Skip to content

Commit

Permalink
lxd/identities: Add FineGrained field to the `GET /1.0/auth/identit…
Browse files Browse the repository at this point in the history
…ies/current` endpoint

This is needed to let know the client if the currently used identity is fine-grained or not.

Signed-off-by: Gabriel Mougard <[email protected]>
  • Loading branch information
gabrielmougard committed Jan 8, 2025
1 parent a958d97 commit e416748
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lxd/identities.go
Original file line number Diff line number Diff line change
Expand Up @@ -1126,6 +1126,7 @@ func getCurrentIdentityInfo(d *Daemon, r *http.Request) response.Response {
Identity: *apiIdentity,
EffectiveGroups: effectiveGroups,
EffectivePermissions: effectivePermissions,
FineGrained: identity.IsFineGrainedIdentityType(apiIdentity.Type),
})
}

Expand Down Expand Up @@ -1884,7 +1885,8 @@ func updateIdentityCacheFromLocal(d *Daemon) error {
return fmt.Errorf("Failed reading certificates from local database: %w", err)
}

var identityCacheEntries []identity.CacheEntry
// identityCacheEntries needs to be pre-allocated.
identityCacheEntries := make([]identity.CacheEntry, 0)
for _, dbCert := range localServerCerts {
certBlock, _ := pem.Decode([]byte(dbCert.Certificate))
if certBlock == nil {
Expand Down

0 comments on commit e416748

Please sign in to comment.