Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SegmentCountErr = errors.New("a JWT must have three segments separated by period characters") MalformedHeaderErr = errors.New("the header is malformed") MalformedHeaderContentErr = errors.New("the header content is malformed") MalformedPayloadContentErr = errors.New("the payload content is malformed") MalformedSignatureErr = errors.New("the signature is malformed") UnrecognizedSignatureErr = errors.New("unrecognized signature") UnrecognizedAlgorithmErr = errors.New("unrecognized algorithm") )
View Source
var ( TokenExpiredErr = errors.New("the token is expired") InvalidAudienceErr = errors.New("the audience is invalid") )
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
func NewDecoder ¶
func NewDecoder(options ...DecoderOption) *Decoder
type DecoderOption ¶
type DecoderOption func(*Decoder)
func WithDecodingAlgorithm ¶
func WithDecodingAlgorithm(algorithm Algorithm) DecoderOption
func WithDecodingSecrets ¶
func WithDecodingSecrets(callback func(id string) (secret []byte)) DecoderOption
func WithDecodingValidator ¶
func WithDecodingValidator(validator Validator) DecoderOption
func WithNamedDecodingAlgorithms ¶
func WithNamedDecodingAlgorithms(names ...string) DecoderOption
type DefaultValidator ¶
type DefaultValidator struct {
// contains filtered or unexported fields
}
func NewDefaultValidator ¶
func NewDefaultValidator(audiences ...string) DefaultValidator
func (DefaultValidator) Validate ¶
func (this DefaultValidator) Validate(claim interface{}) error
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
func NewEncoder ¶
func NewEncoder(options ...EncoderOption) *Encoder
type EncoderOption ¶
type EncoderOption func(encoder *Encoder)
func WithEncodingAlgorithm ¶
func WithEncodingAlgorithm(algorithm Algorithm) EncoderOption
func WithEncodingSecret ¶
func WithEncodingSecret(id string, secret []byte) EncoderOption
func WithNamedEncodingAlgorithm ¶
func WithNamedEncodingAlgorithm(algorithm string) EncoderOption
type NoAlgorithm ¶
type NoAlgorithm struct{}
func (NoAlgorithm) ComputeHash ¶
func (this NoAlgorithm) ComputeHash(value, secret []byte) []byte
func (NoAlgorithm) Name ¶
func (this NoAlgorithm) Name() string
type StandardClaims ¶
type StandardClaims struct { Expiration int64 `json:"exp,omitempty"` Audience string `json:"aud,omitempty"` }
func (StandardClaims) TokenAudience ¶
func (this StandardClaims) TokenAudience() string
func (StandardClaims) TokenExpiration ¶
func (this StandardClaims) TokenExpiration() time.Time
type TokenAudience ¶
type TokenAudience interface {
TokenAudience() string
}
type TokenExpiration ¶
Click to show internal directories.
Click to hide internal directories.