-
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/auth: Add check for entitlements
Signed-off-by: Gabriel Mougard <[email protected]>
- Loading branch information
1 parent
291c1f2
commit d5f0001
Showing
1 changed file
with
8 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,7 +138,8 @@ test_authorization() { | |
lxc auth identity list --format csv | grep -Fq "tls,Client certificate,test-user,${tls_identity_fingerprint},test-group" | ||
|
||
# Test `lxc auth identity info` | ||
expectedOIDCInfo='authentication_method: oidc | ||
expectedOIDCInfo='entitlements: [] | ||
authentication_method: oidc | ||
type: OIDC client | ||
id: [email protected] | ||
name: '"'"' '"'"' | ||
|
@@ -152,7 +153,8 @@ fine_grained: true' | |
|
||
[ "$(lxc auth identity info oidc:)" = "${expectedOIDCInfo}" ] | ||
|
||
expectedTLSInfo="authentication_method: tls | ||
expectedTLSInfo="entitlements: [] | ||
authentication_method: tls | ||
type: Client certificate | ||
id: ${tls_identity_fingerprint} | ||
name: test-user | ||
|
@@ -283,6 +285,10 @@ fine_grained: true" | |
LXD_CONF="${LXD_CONF6}" gen_cert_and_key "client" | ||
token="$(lxc auth identity create tls/test-user6 --quiet)" | ||
LXD_CONF="${LXD_CONF6}" lxc_remote remote add tls "${token}" | ||
## TO REMOVE | ||
tlsInfo=$(LXD_CONF="${LXD_CONF6}" lxc auth identity info tls:) | ||
echo "${tlsInfo}" | ||
## TO REMOVE | ||
! LXD_CONF="${LXD_CONF6}" lxc auth identity info tls: | grep 'fine_grained: true' || false | ||
|
||
# Cleanup | ||
|