Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lxd/identity: Validate authentication method when getting cache entries.
When `core.trust_ca_certificates` is enabled, we check the identity cache for a certificate with a matching fingerprint anyway. This is in case the certificate does exist in the truststore and was previously restricted. If the caller erroneously uses the new authentication method `auth.AuthenticationMethodPKI` instead of `api.AuthenticationMethodTLS` the identity will not be found in the cache. Returning a Not Found error in this instance tells the authorizer that they should have admin privileges! Adding validation on the authentication method when getting or setting cache entries will surface these errors more transparently. Signed-off-by: Mark Laing <mark.laing@canonical.com>
- Loading branch information