mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
19 lines
379 B
Go
19 lines
379 B
Go
package idtest
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/grafana/grafana/pkg/services/auth"
|
|
)
|
|
|
|
type MockSigner struct {
|
|
SignIDTokenFn func(ctx context.Context, claims *auth.IDClaims) (string, error)
|
|
}
|
|
|
|
func (s *MockSigner) SignIDToken(ctx context.Context, claims *auth.IDClaims) (string, error) {
|
|
if s.SignIDTokenFn != nil {
|
|
return s.SignIDTokenFn(ctx, claims)
|
|
}
|
|
return "", nil
|
|
}
|