mirror of
https://github.com/grafana/grafana.git
synced 2024-11-29 04:04:00 -06:00
e2435f92f1
* authn: add GetIDClaims() to Requester Co-Authored-By: Gabriel MABILLE <gamab@users.noreply.github.com> * authn: update StaticRequester Co-Authored-By: Gabriel MABILLE <gamab@users.noreply.github.com> * update auth/idtest/mock Co-Authored-By: Gabriel MABILLE <gamab@users.noreply.github.com> * Fix test Co-authored-by: Claudiu Dragalina-Paraipan <claudiu.dragalina@grafana.com> --------- Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com> Co-authored-by: gamab <gabriel.mabille@grafana.com>
24 lines
685 B
Go
24 lines
685 B
Go
package auth
|
|
|
|
import (
|
|
"context"
|
|
|
|
authnlib "github.com/grafana/authlib/authn"
|
|
|
|
"github.com/grafana/grafana/pkg/apimachinery/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, id identity.Requester) (string, *authnlib.Claims[authnlib.IDTokenClaims], error)
|
|
|
|
// RemoveIDToken removes any locally stored id tokens for key
|
|
RemoveIDToken(ctx context.Context, identity identity.Requester) error
|
|
}
|
|
|
|
type IDSigner interface {
|
|
SignIDToken(ctx context.Context, claims *IDClaims) (string, error)
|
|
}
|
|
|
|
type IDClaims = authnlib.Claims[authnlib.IDTokenClaims]
|