AuthN: Implement requester interface for identity (#75618)

* AuthN: Implement identity.Requester interface for authn.Identity

* AuthN: Replace OrgRole with GetOrgRole

* IDForwarding: skip converting to SignedInUser

* Pass identity directly in permission sync hook
This commit is contained in:
Karl Persson
2023-09-28 16:37:32 +02:00
committed by GitHub
parent 2fe4ecde19
commit fd2235b5ad
4 changed files with 121 additions and 21 deletions

View File

@@ -80,9 +80,8 @@ func (s *Service) SignIdentity(ctx context.Context, id identity.Requester) (stri
}
func (s *Service) hook(ctx context.Context, identity *authn.Identity, _ *authn.Request) error {
// FIXME(kalleep): implement identity.Requester for authn.Identity
// FIXME(kalleep): we should probably lazy load this
token, err := s.SignIdentity(ctx, identity.SignedInUser())
token, err := s.SignIdentity(ctx, identity)
if err != nil {
namespace, id := identity.NamespacedID()
s.logger.Error("Failed to sign id token", "err", err, "namespace", namespace, "id", id)