Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingJWT = errors.New("missing jwt") ErrInvalidPayload = errors.New("cannot map claims") )
Functions ¶
This section is empty.
Types ¶
type JWT ¶
type JWT struct { // Filter defines an optional function to skip the middleware // if a certain criteria is met. Default: nil. Filter func(c *fiber.Ctx) bool // SuccessHandler is called when the jwt verification process // succeeds, so it will call the next handler in the chain. SuccessHandler fiber.Handler // ErrorHandler is called when an error occurred during // the token verification. ErrorHandler fiber.ErrorHandler // contains filtered or unexported fields }
type JWTOption ¶
type JWTOption interface { Option // contains filtered or unexported methods }
func WithAlgorithm ¶
func WithAlgorithm(alg SignatureAlgorithm) JWTOption
func WithNextFunc ¶
func WithSignKey ¶
func WithTokenLookup ¶
func WithUserCtxKey ¶
func WithVerifyKey ¶
type SignatureAlgorithm ¶
type SignatureAlgorithm = jwa.SignatureAlgorithm
const ( ES256 SignatureAlgorithm = "ES256" // ECDSA using P-256 and SHA-256 ES256K SignatureAlgorithm = "ES256K" // ECDSA using secp256k1 and SHA-256 ES384 SignatureAlgorithm = "ES384" // ECDSA using P-384 and SHA-384 ES512 SignatureAlgorithm = "ES512" // ECDSA using P-521 and SHA-512 EdDSA SignatureAlgorithm = "EdDSA" // EdDSA signature algorithms HS256 SignatureAlgorithm = "HS256" // HMAC using SHA-256 HS384 SignatureAlgorithm = "HS384" // HMAC using SHA-384 HS512 SignatureAlgorithm = "HS512" // HMAC using SHA-512 PS256 SignatureAlgorithm = "PS256" // RSASSA-PSS using SHA256 and MGF1-SHA256 PS384 SignatureAlgorithm = "PS384" // RSASSA-PSS using SHA384 and MGF1-SHA384 PS512 SignatureAlgorithm = "PS512" // RSASSA-PSS using SHA512 and MGF1-SHA512 RS256 SignatureAlgorithm = "RS256" // RSASSA-PKCS-v1.5 using SHA-256 RS384 SignatureAlgorithm = "RS384" // RSASSA-PKCS-v1.5 using SHA-384 RS512 SignatureAlgorithm = "RS512" // RSASSA-PKCS-v1.5 using SHA-512 )
Click to show internal directories.
Click to hide internal directories.