IDForwarding: Add service and a local signer (#75423)

* IDForwarding: Add service for handling id token and create a local signer
---------

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
This commit is contained in:
Karl Persson
2023-09-27 11:36:23 +02:00
committed by GitHub
parent 5983bcec86
commit b50f1e15a8
5 changed files with 147 additions and 0 deletions

21
pkg/services/auth/id.go Normal file
View File

@@ -0,0 +1,21 @@
package auth
import (
"context"
"github.com/go-jose/go-jose/v3/jwt"
"github.com/grafana/grafana/pkg/services/auth/identity"
)
type IDService interface {
// SignIdentity signs a id token for provided identity that can be forwarded to plugins and external services
SignIdentity(ctx context.Context, identity identity.Requester) (string, error)
}
type IDSigner interface {
SignIDToken(ctx context.Context, claims *IDClaims) (string, error)
}
type IDClaims struct {
jwt.Claims
}