2023-09-27 04:36:23 -05:00
|
|
|
package auth
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2024-05-07 09:46:43 -05:00
|
|
|
authnlib "github.com/grafana/authlib/authn"
|
2023-10-27 01:30:33 -05:00
|
|
|
|
2023-09-27 04:36:23 -05:00
|
|
|
"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)
|
2024-04-05 05:05:46 -05:00
|
|
|
|
|
|
|
// RemoveIDToken removes any locally stored id tokens for key
|
|
|
|
RemoveIDToken(ctx context.Context, identity identity.Requester) error
|
2023-09-27 04:36:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
type IDSigner interface {
|
|
|
|
SignIDToken(ctx context.Context, claims *IDClaims) (string, error)
|
|
|
|
}
|
|
|
|
|
2024-05-07 09:46:43 -05:00
|
|
|
type IDClaims = authnlib.Claims[authnlib.IDTokenClaims]
|