-
Notifications
You must be signed in to change notification settings - Fork 24
chore(core): remove access pdp internal AttributeInstance type and use policy proto generated struct types instead #471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…sense, and clarify naming
…naming throughout access pdp and authorization service
| repeated string attribute_value_fqns = 2; | ||
| } | ||
|
|
||
| //A logical bucket of attributes belonging to a "Resource" |
There was a problem hiding this comment.
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? |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
… 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
|
moved to #485 |
… 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
… 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
… 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
AttributeInstancetypeEntityEntitlementsproto and clarifies field nameAddresses #469