Files
grafana/pkg/services/auth/jwt/jwt.go
T
grafana-delivery-bot[bot] 6f6667d89c [v11.0.x] JWT: Find login and email claims with JMESPATH (#86357)
JWT: Find login and email claims with JMESPATH (#85305)

* 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

(cherry picked from commit e4250a72db)

Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>
2024-04-16 16:25:18 +01:00

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
},
}
}