Skip to content
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 resources (part 2: Get entitlements from Authorizer interface) #14746

Conversation

gabrielmougard
Copy link
Contributor

@gabrielmougard gabrielmougard commented Jan 6, 2025

@github-actions github-actions bot added Documentation Documentation needs updating API Changes to the REST API labels Jan 6, 2025
@gabrielmougard gabrielmougard force-pushed the feat/auth-dry-run-check-part2 branch 7 times, most recently from 0e88556 to e7df56e Compare January 8, 2025 11:50
@gabrielmougard gabrielmougard marked this pull request as ready for review January 8, 2025 12:00
@gabrielmougard gabrielmougard force-pushed the feat/auth-dry-run-check-part2 branch 2 times, most recently from cf7fc3f to b35d8fc Compare January 8, 2025 16:56
test/suites/auth.sh Fixed Show fixed Hide fixed
test/suites/auth.sh Fixed Show fixed Hide fixed
test/suites/auth.sh Fixed Show fixed Hide fixed
test/suites/auth.sh Fixed Show fixed Hide fixed
@gabrielmougard gabrielmougard force-pushed the feat/auth-dry-run-check-part2 branch from b35d8fc to 4a142e4 Compare January 8, 2025 17:01
minaelee
minaelee previously approved these changes Jan 8, 2025
@gabrielmougard gabrielmougard force-pushed the feat/auth-dry-run-check-part2 branch 2 times, most recently from 929e682 to f394e71 Compare January 10, 2025 08:43
Adds `fine_grained` field to `GET /1.0/auth/identities/current` to indicate if the current identity
interacting with the LXD API is fine-grained (i.e, associated permissions are managed via group membership) and
allow LXD entities to be returned with an `entitlements` field if the current identity is fine-grained and if the
GET request to fetch the LXD entities has the `with-entitlements=<comma_separated_list_of_candidate_entitlements>` query parameter.

Signed-off-by: Gabriel Mougard <[email protected]>
Signed-off-by: Gabriel Mougard <[email protected]>
@gabrielmougard gabrielmougard force-pushed the feat/auth-dry-run-check-part2 branch 2 times, most recently from 8b60caf to d9a0b7c Compare January 10, 2025 14:28
…ies/current` endpoint

This is needed to let know the client if the currently used identity is fine-grained or not.

Signed-off-by: Gabriel Mougard <[email protected]>
@gabrielmougard gabrielmougard force-pushed the feat/auth-dry-run-check-part2 branch from d9a0b7c to 7858a0b Compare January 10, 2025 16:51
… current identity info

Signed-off-by: Gabriel Mougard <[email protected]>
…e `Authorizer` interface

These methods return the entitlements corresponding to the entity/entities through calls to the
OpenFGA datastore. These functions should be called at the end of a LXD API handler so that the
OpenFGA per-request cache can be hit.

Signed-off-by: Gabriel Mougard <[email protected]>
@gabrielmougard gabrielmougard force-pushed the feat/auth-dry-run-check-part2 branch from 7858a0b to a4d5c3a Compare January 10, 2025 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Changes to the REST API Documentation Documentation needs updating
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants