Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a http handler that will use a decoder to decode the authHeaderKey JWT-Token and put the resulting claims in headers
func NewServer ¶
func NewServer(decoder TokenDecoder, authHeaderKey, tokenValidatedHeaderKey string, authHeaderRequired bool) *Server
NewServer returns a new server that will decode the header with key authHeaderKey with the given TokenDecoder decoder.
func (*Server) DecodeToken ¶
func (s *Server) DecodeToken(rw http.ResponseWriter, r *http.Request)
DecodeToken http handler
type TokenDecoder ¶
TokenDecoder can decode and validate raw JTW tokens
func NewCachedJwtDecoder ¶
func NewCachedJwtDecoder(cache *ristretto.Cache, delegate TokenDecoder) TokenDecoder
NewCachedJwtDecoder returns a new JwtDecoder that will cache Tokens decoded by the delegate
func NewJwsDecoder ¶
func NewJwsDecoder(jwksURL string, claimMapping map[string]string) (TokenDecoder, error)
NewJwsDecoder returns a root Decoder that can decode and validate JWS Tokens It will also map the claims via the claim mapping `claimMapping = map[string][string]{ "key123", "headerKey123" }` will cause the claim `key123` in the JWS token to be mapped to `headerKey123` in the decoded token
type TokenExpiredError ¶
type TokenExpiredError struct {
// contains filtered or unexported fields
}
TokenExpiredError means the token is invalid because it has expired
func (TokenExpiredError) Error ¶
func (e TokenExpiredError) Error() string
type UnexpectedClaimTypeError ¶
type UnexpectedClaimTypeError struct {
// contains filtered or unexported fields
}
UnexpectedClaimTypeError is thrown if a mapped claim in the token has an unexpected type the token should always have type string
func (UnexpectedClaimTypeError) Error ¶
func (e UnexpectedClaimTypeError) Error() string