Please confirm
Distribution
N/A
Distribution version
N/A
Output of snap list --all lxd core20 core22 core24 snapd
System info
N/A
Instance log
N/A
Expected behavior
When querying /1.0 the user.microcloud key is returned for non-authenticated users.
|
// If not authenticated, return now. |
|
if !requestor.IsTrusted() { |
|
daemonConfig, _ := daemonConfigRender(s) |
|
_, flagExists := daemonConfig["user.microcloud"] |
|
if flagExists { |
|
// Unprivileged users may see the user.microcloud config key |
|
srv.Config = map[string]any{ |
|
"user.microcloud": daemonConfig["user.microcloud"], |
|
} |
|
} |
|
|
|
return response.SyncResponseETag(true, srv, nil) |
|
} |
But if the user is trusted and doesn't have permissions to edit the config, it doesn't get the see the user.microcloud key:
|
|
|
// Only allow identities that can edit configuration to view it as sensitive information may be stored there. |
|
err = s.Authorizer.CheckPermission(r.Context(), entity.ServerURL(), auth.EntitlementCanEdit) |
|
if err != nil && !auth.IsDeniedError(err) { |
|
return response.SmartError(err) |
|
} else if err == nil { |
|
daemonConfig, err := daemonConfigRender(s) |
Actual behavior
It seems to be that a trusted user who cannot edit config will get a permission denied error.
Steps to reproduce
N/A
Information to attach
Please confirm
Distribution
N/A
Distribution version
N/A
Output of
snap list --all lxd core20 core22 core24 snapdSystem info
N/A
Instance log
N/A
Expected behavior
When querying
/1.0theuser.microcloudkey is returned for non-authenticated users.lxd/lxd/api_1.0.go
Lines 277 to 289 in 83189e2
But if the user is trusted and doesn't have permissions to edit the config, it doesn't get the see the
user.microcloudkey:lxd/lxd/api_1.0.go
Lines 450 to 456 in 83189e2
Actual behavior
It seems to be that a trusted user who cannot edit config will get a permission denied error.
Steps to reproduce
N/A
Information to attach
dmesg)lxc config show <instance> --expanded)/var/log/lxd/lxd.logor/var/snap/lxd/common/lxd/logs/lxd.log)--debug--debug(or uselxc monitorwhile reproducing the issue)