Documentation ¶
Index ¶
- Variables
- func AvailableJWTTokensAlgs() []string
- func JwtChangeAlgToNone(token string) (string, error)
- func JwtGenerate(alg string, extraData map[string]interface{}, typ string, key []byte) (string, error)
- func JwtGenerateEx(alg string, extraHeader map[string]interface{}, ...) (string, error)
- func JwtParse(tokenStr string, keys ...string) (*jwt.Token, []byte, error)
- func NewJWTHelper(alg string) (*jwt.Token, error)
- type AuthHackJWTSigningNone
Constants ¶
This section is empty.
Variables ¶
View Source
var JWTExports = map[string]interface{}{ "ALG_NONE": "None", "ALG_ES256": "ES256", "ALG_ES384": "ES384", "ALG_ES512": "ES512", "ALG_HS256": "HS256", "ALG_HS384": "HS384", "ALG_HS512": "HS512", "ALG_RS256": "RS256", "ALG_RS384": "RS384", "ALG_RS512": "RS512", "ALG_PS256": "PS256", "ALG_PS384": "PS384", "ALG_PS512": "PS512", "Parse": JwtParse, "JWTGenerate": func(alg string, i interface{}, key []byte) (string, error) { return JwtGenerate(alg, utils.InterfaceToMapInterface(i), "JWT", key) }, "JWTGenerateEx": func(alg string, extraHeader, i interface{}, key []byte) (string, error) { return JwtGenerateEx(alg, utils.InterfaceToMapInterface(extraHeader), utils.InterfaceToMapInterface(i), "JWT", key) }, "JWSGenerate": func(alg string, i interface{}, key []byte) (string, error) { return JwtGenerate(alg, utils.InterfaceToMapInterface(i), "JWS", key) }, "JWSGenerateEx": func(alg string, extraHeader, i interface{}, key []byte) (string, error) { return JwtGenerateEx(alg, utils.InterfaceToMapInterface(extraHeader), utils.InterfaceToMapInterface(i), "JWS", key) }, "RemoveAlg": JwtChangeAlgToNone, "AllAlgs": AvailableJWTTokensAlgs, }
View Source
var ( JwtAlgs = []jwt.SigningMethod{ jwt.SigningMethodES384, jwt.SigningMethodES256, jwt.SigningMethodES512, jwt.SigningMethodHS256, jwt.SigningMethodHS384, jwt.SigningMethodHS512, jwt.SigningMethodPS256, jwt.SigningMethodPS384, jwt.SigningMethodPS512, jwt.SigningMethodRS256, jwt.SigningMethodRS384, jwt.SigningMethodRS512, &AuthHackJWTSigningNone{}, } )
Functions ¶
func AvailableJWTTokensAlgs ¶
func AvailableJWTTokensAlgs() []string
func JwtChangeAlgToNone ¶
func JwtGenerate ¶
func JwtGenerateEx ¶ added in v1.2.2
func NewJWTHelper ¶
Types ¶
type AuthHackJWTSigningNone ¶
type AuthHackJWTSigningNone struct{}
Implements the none signing method. This is required by the spec but you probably should never use it.
func (*AuthHackJWTSigningNone) Alg ¶
func (m *AuthHackJWTSigningNone) Alg() string
func (*AuthHackJWTSigningNone) Sign ¶
func (m *AuthHackJWTSigningNone) Sign(signingString string, key interface{}) (string, error)
Only allow 'none' signing if UnsafeAllowNoneSignatureType is specified as the key
func (*AuthHackJWTSigningNone) Verify ¶
func (m *AuthHackJWTSigningNone) Verify(signingString, signature string, key interface{}) (err error)
Only allow 'none' alg type if UnsafeAllowNoneSignatureType is specified as the key
Click to show internal directories.
Click to hide internal directories.