mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* add function to static function to static service * find email and login claims with jmespath * rename configuration files * Replace JWTClaims struct for map * check for subclaims error
26 lines
566 B
Go
26 lines
566 B
Go
package jwt
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
type JWTService interface {
|
|
Verify(ctx context.Context, strToken string) (map[string]any, error)
|
|
}
|
|
|
|
type FakeJWTService struct {
|
|
VerifyProvider func(context.Context, string) (map[string]any, error)
|
|
}
|
|
|
|
func (s *FakeJWTService) Verify(ctx context.Context, token string) (map[string]any, error) {
|
|
return s.VerifyProvider(ctx, token)
|
|
}
|
|
|
|
func NewFakeJWTService() *FakeJWTService {
|
|
return &FakeJWTService{
|
|
VerifyProvider: func(ctx context.Context, token string) (map[string]any, error) {
|
|
return map[string]any{}, nil
|
|
},
|
|
}
|
|
}
|