Documentation
¶
Index ¶
- Constants
- func GetJWTPayloadContext(c ctx, payload interface{}) error
- func JWTGuardMiddleware(j JWT, c JWTGuardMiddlewareConfig) web.Middleware
- func WithJWT() plugins.Plugin
- func WithOAuth() plugins.Plugin
- type Code
- type ConfigJWT
- type ConfigJWTItem
- type ConfigOAuth
- type JWT
- type JWTGuardMiddlewareConfig
- type JWTHeader
- type OAuth
- type OAuthUser
Constants ¶
View Source
const ( JWTAlgHS256 = "HS256" JWTAlgHS384 = "HS384" JWTAlgHS512 = "HS512" )
Variables ¶
This section is empty.
Functions ¶
func GetJWTPayloadContext ¶ added in v0.11.6
func GetJWTPayloadContext(c ctx, payload interface{}) error
func JWTGuardMiddleware ¶ added in v0.9.0
func JWTGuardMiddleware(j JWT, c JWTGuardMiddlewareConfig) web.Middleware
Types ¶
type ConfigJWT ¶ added in v0.9.0
type ConfigJWT struct {
JWT []ConfigJWTItem `yaml:"jwt"`
}
ConfigJWT jwt config model
type ConfigJWTItem ¶ added in v0.9.0
type ConfigOAuth ¶
type ConfigOAuth struct {
Providers []oauth.ConfigOAuthItem `yaml:"oauth"`
}
ConfigOAuth oauth config model
func (*ConfigOAuth) Default ¶
func (v *ConfigOAuth) Default()
type JWTGuardMiddlewareConfig ¶ added in v0.11.6
type JWTHeader ¶ added in v0.9.0
type JWTHeader struct {
Kid string `json:"kid"`
Alg string `json:"alg"`
IssuedAt int64 `json:"iat"`
ExpiresAt int64 `json:"eat"`
}
func GetJWTHeaderContext ¶ added in v0.11.6
func GetJWTHeaderContext(c ctx, payload interface{}) *JWTHeader
func (JWTHeader) MarshalEasyJSON ¶ added in v0.9.0
MarshalEasyJSON supports easyjson.Marshaler interface
func (JWTHeader) MarshalJSON ¶ added in v0.9.0
MarshalJSON supports json.Marshaler interface
func (*JWTHeader) UnmarshalEasyJSON ¶ added in v0.9.0
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*JWTHeader) UnmarshalJSON ¶ added in v0.9.0
UnmarshalJSON supports json.Unmarshaler interface
Click to show internal directories.
Click to hide internal directories.