-
Notifications
You must be signed in to change notification settings - Fork 933
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Test that we can retrieve entities with their entitlements
Signed-off-by: Gabriel Mougard <[email protected]>
- Loading branch information
1 parent
7f5457a
commit 171b326
Showing
2 changed files
with
74 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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}" | ||
|
||
|