diff --git a/test/suites/auth.sh b/test/suites/auth.sh index b51a41060489..115bc7d91084 100644 --- a/test/suites/auth.sh +++ b/test/suites/auth.sh @@ -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 test-user@example.com can_view || false # Missing authentication method @@ -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}"