Skip to content

Commit

Permalink
test/auth: Add check for 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 8, 2025
1 parent 291c1f2 commit d5f0001
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/suites/auth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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: '"'"' '"'"'
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d5f0001

Please sign in to comment.