Documentation
¶
Index ¶
- Constants
- Variables
- func Email(ctx context.Context) string
- func GetRawToken(ctx context.Context) string
- func HasGroup(ctx context.Context, group string, logMessage string, timestamp time.Time) apierrors.AnnotatedError
- func IsAuthenticated(ctx context.Context, logMessage string, timestamp time.Time) apierrors.AnnotatedError
- func JwtValidator(next http.Handler) http.Handler
- func Name(ctx context.Context) string
- func PutClaims(ctx context.Context, claimsPtr *AllClaims) context.Context
- func PutRawToken(ctx context.Context, rawToken string) context.Context
- func Setup(publicKeyPEMs []string, config config.CustomConfiguration) error
- func Subject(ctx context.Context) string
- type AllClaims
- type CustomClaims
Constants ¶
View Source
const ( RawTokenKey ctxJwtKeyType = 0 ClaimsKey ctxJwtKeyType = 1 )
Variables ¶
View Source
var Now = time.Now
Now exported for testing
View Source
var RsaPublicKeys = make([]*rsa.PublicKey, 0)
Functions ¶
func GetRawToken ¶
GetRawToken returns the raw token from the given context if one is present.
Returns the empty string if the context contains no valid token.
func IsAuthenticated ¶
func PutClaims ¶
PutClaims places a raw token in the context under the correct key.
Returns a child context with the token set.
Exposed for testing only.
func PutRawToken ¶
PutRawToken places a raw token in the context under the correct key.
Returns a child context with the token set.
Exposed for testing only.
Types ¶
type AllClaims ¶
type AllClaims struct { // maybe * ? jwt.RegisteredClaims CustomClaims }
type CustomClaims ¶
Click to show internal directories.
Click to hide internal directories.