Skip to content

Conversation

@jakedoublev
Copy link
Contributor

@jakedoublev jakedoublev commented Mar 27, 2024

  1. removes AttributeInstance type
  2. DRY improvements to tests in pdp_test.go
  3. adds tests for existing and new helper functions (grouping, FQN relations, etc)
  4. fixes commented structure vs real structure of EntityEntitlements proto and clarifies field name

Addresses #469

@jakedoublev jakedoublev changed the base branch from feat/kas-getdecisions to feat/kas-get-decisions March 27, 2024 22:00
@jakedoublev jakedoublev changed the base branch from feat/kas-get-decisions to main March 28, 2024 16:12
@jakedoublev jakedoublev changed the base branch from main to feat/kas-get-decisions March 28, 2024 16:13
repeated string attribute_value_fqns = 2;
}

//A logical bucket of attributes belonging to a "Resource"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we unify attribute-fqns in resource attribute also?

assert.Equal(t, mockAttrDefinitions[0], decisions[mockEntityId].Results[0].RuleDefinition)
}

// TODO: Is this test accurate? Containing the top AND a lower value results in a fail?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CC: @pflynn-virtru on this test case

// fmt.Printf("\nTODO: make access decision here with these fully qualified attributes: %+v\n", attrs)
// get the entities entitlements
//
// TODO: we should already have the subject mappings here and be able to just use OPA to trim down the known data attr values to the ones matched up with the entities
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CC: @pflynn-virtru is this accurate that we can just use the subject mappings & their subject condition sets that we have from the GetAttributesByFqnValues response looking up the data/resource attributes to see which data/resource attributes relate to the subject without retrieving their entitlements separately? That would avoid an extra call to the same GetAttributeByFqnValues endpoint when calling GetEntitlements, right?

Level: logLevel,
}
logger := slog.New(slog.NewJSONHandler(os.Stdout, opts))
// TODO: uncomment the below when authorization service responds with multiple decisions instead of just a sole permit/deny
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @pflynn-virtru: added these test assertions for when the response contains multiple decision responses

assert.NotNil(t, resp)

// some asserts about resp
// NOTE: there should be two decision responses, one for each data attribute value, but authorization service
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc: @pflynn-virtru: Same note here as above that there should be two decisions to assert on when there are multiple resource attribute values, but the service only sends back one at the moment.

pflynn-virtru added a commit that referenced this pull request Apr 1, 2024
… and use policy proto generated struct types instead (#485)

1. removes `AttributeInstance` type
2. DRY improvements to tests in pdp_test.go
3. adds tests for existing and new helper functions (grouping, FQN
relations, etc)
4. fixes commented structure vs real structure of `EntityEntitlements`
proto and clarifies field name

Addresses #469 

Original PR #471 and author
@jakedoublev
@pflynn-virtru
Copy link
Member

moved to #485

sujankota pushed a commit that referenced this pull request Apr 2, 2024
… and use policy proto generated struct types instead (#485)

1. removes `AttributeInstance` type
2. DRY improvements to tests in pdp_test.go
3. adds tests for existing and new helper functions (grouping, FQN
relations, etc)
4. fixes commented structure vs real structure of `EntityEntitlements`
proto and clarifies field name

Addresses #469 

Original PR #471 and author
@jakedoublev
tech-guru42 added a commit to tech-guru42/TDF that referenced this pull request Jun 3, 2024
… and use policy proto generated struct types instead (#485)

1. removes `AttributeInstance` type
2. DRY improvements to tests in pdp_test.go
3. adds tests for existing and new helper functions (grouping, FQN
relations, etc)
4. fixes commented structure vs real structure of `EntityEntitlements`
proto and clarifies field name

Addresses #469 

Original PR opentdf/platform#471 and author
@jakedoublev
passion-127 added a commit to passion-127/TDF that referenced this pull request Jun 6, 2024
… and use policy proto generated struct types instead (#485)

1. removes `AttributeInstance` type
2. DRY improvements to tests in pdp_test.go
3. adds tests for existing and new helper functions (grouping, FQN
relations, etc)
4. fixes commented structure vs real structure of `EntityEntitlements`
proto and clarifies field name

Addresses #469 

Original PR opentdf/platform#471 and author
@jakedoublev
@jakedoublev jakedoublev deleted the kas-get-decisions/remove-instance-type branch June 19, 2024 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants