-
Notifications
You must be signed in to change notification settings - Fork 933
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
auth: Add entitlements to LXD entities (part 2: Enrich LXD resources with entitlements) #14748
base: main
Are you sure you want to change the base?
auth: Add entitlements to LXD entities (part 2: Enrich LXD resources with entitlements) #14748
Conversation
d5f0001
to
3cae833
Compare
e653ad9
to
7f5457a
Compare
171b326
to
1a09849
Compare
1a09849
to
e18b874
Compare
@minaelee thanks for the feedbacks. Fixing that right now |
6f763e7
to
c793358
Compare
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.
Approach and format seems all right from my point of view. Left some comments below.
This interface will need to be implemented for each API types that need to be returned from the API handlers with `access_entitlements` Signed-off-by: Gabriel Mougard <[email protected]> Co-authored-by: Mark Laing <[email protected]>
…es that are eligible for entitlement enrichment Signed-off-by: Gabriel Mougard <[email protected]> Co-authored-by: Mark Laing <[email protected]>
Signed-off-by: Gabriel Mougard <[email protected]>
Signed-off-by: Gabriel Mougard <[email protected]> Co-authored-by: Mark Laing <[email protected]>
Signed-off-by: Gabriel Mougard <[email protected]> Co-authored-by: Mark Laing <[email protected]>
This function add entitlements to a map of entity URLs to EntitlementReporters, which are in practice API types implementing the `ReportEntitlements` method. Signed-off-by: Gabriel Mougard <[email protected]> Co-authored-by: Mark Laing <[email protected]>
Signed-off-by: Gabriel Mougard <[email protected]>
Signed-off-by: Gabriel Mougard <[email protected]>
Signed-off-by: Gabriel Mougard <[email protected]>
Signed-off-by: Gabriel Mougard <[email protected]>
Signed-off-by: Gabriel Mougard <[email protected]>
Signed-off-by: Gabriel Mougard <[email protected]>
eebe53d
to
53c6a8e
Compare
@markylaing updated following the approach you suggested this morning. I also added the enrichment for all the other entities. |
Signed-off-by: Gabriel Mougard <[email protected]>
Signed-off-by: Gabriel Mougard <[email protected]>
Signed-off-by: Gabriel Mougard <[email protected]>
…-group' entities Signed-off-by: Gabriel Mougard <[email protected]>
Signed-off-by: Gabriel Mougard <[email protected]>
Signed-off-by: Gabriel Mougard <[email protected]>
Signed-off-by: Gabriel Mougard <[email protected]>
Signed-off-by: Gabriel Mougard <[email protected]>
Signed-off-by: Gabriel Mougard <[email protected]>
Signed-off-by: Gabriel Mougard <[email protected]>
…entitlements' fields Signed-off-by: Gabriel Mougard <[email protected]>
53c6a8e
to
01a6872
Compare
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.
New tests are great, thanks for adding. I skimmed through the code without detailed reading, just one non-blocking observation below. LGTM 👍
return response.SmartError(err) | ||
} | ||
|
||
if len(withEntitlements) > 0 && recursion != "1" { |
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.
if len(withEntitlements) > 0 && recursion != "1" { | |
if len(withEntitlements) > 0 && !recursion { |
Should be more future-proof this way in case higher recursion levels are introduced. wdyt?
return response.SmartError(err) | ||
} | ||
|
||
if len(withEntitlements) > 0 && recursion != "1" { |
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.
Similar to above, there are a couple of more occurrences like this below.
This is the second part of a group of three stacked PRs.
IsFineGrained
field) #14745