Skip to content

Commit

Permalink
test: Test that we can retrieve entities with their entitlements
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Mougard <[email protected]>
  • Loading branch information
gabrielmougard committed Jan 9, 2025
1 parent 7f5457a commit 1a09849
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/suites/auth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ fine_grained: true"

[ "$(LXD_CONF="${LXD_CONF2}" lxc auth identity info tls:)" = "${expectedTLSInfo}" ]

# Test that we can retrieve entities with their respective entitlements.
check_entities_with_entitlements

# Identity permissions.
! lxc auth group permission add test-group identity [email protected] can_view || false # Missing authentication method
Expand Down Expand Up @@ -372,6 +374,15 @@ storage_pool_used_by() {
[ "$(lxc query "/1.0/storage-pools/${pool_name}" | jq '.used_by | length')" -eq $((start_length)) ]
}

check_entities_with_entitlements() {
# Create a project with some entitlements
lxc project create oidc:project-with-entitlements
lxc auth group permission add oidc:test-group project project-with-entitlements can_view
lxc auth group permission add oidc:test-group project project-with-entitlements can_edit
p=$(lxc query --wait oidc:/1.0/projects/project-with-entitlements\?with-entitlements=admin)
echo "${p}"
}

fine_grained_authorization() {
remote="${1}"

Expand Down

0 comments on commit 1a09849

Please sign in to comment.