Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNilValidator = errors.New("validator cannot be nil") ErrInvalidToken = errors.New("invalid token") ErrUnexpectedSigningMethod = errors.New("unexpected signing method") ErrInvalidClaims = errors.New("invalid claims") ErrNilClaims = errors.New("claims cannot be nil") ErrNilClaimsValidator = errors.New("claims validator cannot be nil") )
Functions ¶
This section is empty.
Types ¶
type Ed25519Validator ¶
type Ed25519Validator struct {
// contains filtered or unexported fields
}
Ed25519Validator handles parsing and validation of JWT tokens with ED25519 public key
func NewEd25519Validator ¶
func NewEd25519Validator( publicKey []byte, claimsValidator gojwtclaims.Validator, mode *goflagmode.Flag, ) (*Ed25519Validator, error)
NewEd25519Validator returns a new validator by parsing the given file path as an ED25519 public key
func (*Ed25519Validator) GetClaims ¶
func (d *Ed25519Validator) GetClaims(rawToken string) ( *jwt.MapClaims, error, )
GetClaims parses and validates the given JWT raw token
func (*Ed25519Validator) GetToken ¶
func (d *Ed25519Validator) GetToken(rawToken string) (*jwt.Token, error)
GetToken parses the given JWT raw token
func (*Ed25519Validator) ValidateClaims ¶
func (d *Ed25519Validator) ValidateClaims( rawToken string, token gojwttoken.Token, ) (*jwt.MapClaims, error)
ValidateClaims validates the given token claims based on the given token type and returns the claims if valid
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is the JWT validator logger
func NewLogger ¶
func NewLogger(header string, modeLogger gologgermode.Logger) (*Logger, error)
NewLogger creates a new JWT validator logger
func (*Logger) MissingTokenClaimsUserId ¶
func (l *Logger) MissingTokenClaimsUserId()
MissingTokenClaimsUserId logs the missing token claims user ID
func (*Logger) ValidatedToken ¶
func (l *Logger) ValidatedToken()
ValidatedToken logs a message when the server validates a token
Click to show internal directories.
Click to hide internal directories.