Identity: Rename "namespace" to "type" in the requester interface (#90567)
This commit is contained in:
@@ -66,7 +66,7 @@ func (s *Service) SignIdentity(ctx context.Context, id identity.Requester) (stri
|
||||
cacheKey := prefixCacheKey(id.GetCacheKey())
|
||||
|
||||
result, err, _ := s.si.Do(cacheKey, func() (interface{}, error) {
|
||||
namespace, identifier := id.GetNamespacedID()
|
||||
namespace, identifier := id.GetTypedID()
|
||||
|
||||
cachedToken, err := s.cache.Get(ctx, cacheKey)
|
||||
if err == nil {
|
||||
@@ -92,7 +92,7 @@ func (s *Service) SignIdentity(ctx context.Context, id identity.Requester) (stri
|
||||
},
|
||||
}
|
||||
|
||||
if identity.IsNamespace(namespace, identity.NamespaceUser) {
|
||||
if identity.IsIdentityType(namespace, identity.TypeUser) {
|
||||
claims.Rest.Email = id.GetEmail()
|
||||
claims.Rest.EmailVerified = id.IsEmailVerified()
|
||||
claims.Rest.AuthenticatedBy = id.GetAuthenticatedBy()
|
||||
@@ -144,7 +144,7 @@ func (s *Service) hook(ctx context.Context, identity *authn.Identity, _ *authn.R
|
||||
token, err := s.SignIdentity(ctx, identity)
|
||||
if err != nil {
|
||||
if shouldLogErr(err) {
|
||||
namespace, id := identity.GetNamespacedID()
|
||||
namespace, id := identity.GetTypedID()
|
||||
s.logger.FromContext(ctx).Error("Failed to sign id token", "err", err, "namespace", namespace, "id", id)
|
||||
}
|
||||
// for now don't return error so we don't break authentication from this hook
|
||||
|
||||
Reference in New Issue
Block a user