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

lxd: Entitlement enrichment for remaining API entities #14880

Merged
merged 15 commits into from
Jan 31, 2025

Conversation

gabrielmougard
Copy link
Contributor

@gabrielmougard gabrielmougard commented Jan 29, 2025

This should fix the issues discussed here: https://chat.canonical.com/canonical/pl/c3bjkis1g3nmbytao6q5gcaxuc

This also add entitlement enrichment for API entities that weren't added as part as #14748

…nts` field

This will avoid having `access_entitlements: null` in the case we have a response without
having asked for `with-access-entitlements=...` in the URL query params.

Signed-off-by: Gabriel Mougard <[email protected]>
@github-actions github-actions bot added the API Changes to the REST API label Jan 29, 2025
@tomponline
Copy link
Member

@gabrielmougard as discussed please can you check whether we need to additional slices that convert the pointers back to concrete elements?

… can have fine-grained permissions

- ImageAlias
- Server
- InstanceBackup
- InstanceSnapshot
- StorageVolumeBackup
- StorageVolumeSnapshot

Signed-off-by: Gabriel Mougard <[email protected]>
@gabrielmougard gabrielmougard force-pushed the fix/missing-entitlements branch 2 times, most recently from 535e703 to 9fe0f4d Compare January 31, 2025 12:23
Signed-off-by: Gabriel Mougard <[email protected]>
…ace entitlement enrichment

Signed-off-by: Gabriel Mougard <[email protected]>
…-place entitlement enrichment

Signed-off-by: Gabriel Mougard <[email protected]>
…e entitlement enrichment

Signed-off-by: Gabriel Mougard <[email protected]>
…n-place entitlement enrichment

Signed-off-by: Gabriel Mougard <[email protected]>
…`omitempty` field annotation

Signed-off-by: Gabriel Mougard <[email protected]>
@gabrielmougard gabrielmougard force-pushed the fix/missing-entitlements branch from 9fe0f4d to ce7b04e Compare January 31, 2025 12:31
@github-actions github-actions bot added the Documentation Documentation needs updating label Jan 31, 2025
@gabrielmougard gabrielmougard changed the title lxd: Use temporary slice of pointer to structs to handle in-place enrichment of LXD entities with entitlements. lxd: Entitlement enrichment for remaining API entities Jan 31, 2025
@gabrielmougard
Copy link
Contributor Author

@tomponline Now we should have support for all the entities supported by the OpenFGA permission model. I also ensured that we systematically use slice of pointers in the API handlers during the enrichment.

@tomponline
Copy link
Member

@gabrielmougard just to confirm, did you test each endpoint is working correctly with-entitlements now?

@tomponline tomponline merged commit e51283c into canonical:main Jan 31, 2025
28 checks passed
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