Documentation
¶
Index ¶
- Constants
- func JWTPayloadContext(c tContext, payload interface{}) error
- func WithJWT() plugins.Plugin
- func WithOAuth(opts ...func(OAuthOption)) plugins.Plugin
- type Config
- type ConfigJWT
- type ConfigOAuth
- type JWT
- type JWTConfig
- type JWTHeader
- type JWTKey
- type JWTOption
- type OAuth
- type OAuthCode
- type OAuthGoogleProvider
- type OAuthOption
- type OAuthProvider
- type OAuthUser
- type OAuthYandexProvider
Constants ¶
View Source
const ( AlgHS256 = "HS256" AlgHS384 = "HS384" AlgHS512 = "HS512" )
View Source
const CodeGoogle = "google"
View Source
const CodeYandex = "yandex"
Variables ¶
This section is empty.
Functions ¶
func JWTPayloadContext ¶
func JWTPayloadContext(c tContext, payload interface{}) error
func WithOAuth ¶
func WithOAuth(opts ...func(OAuthOption)) plugins.Plugin
WithOAuth init oauth providers
Types ¶
type ConfigOAuth ¶
type ConfigOAuth struct {
Providers []Config `yaml:"oauth"`
}
ConfigOAuth oauth config model
func (*ConfigOAuth) Default ¶
func (v *ConfigOAuth) Default()
type JWTHeader ¶
type JWTHeader struct { Kid string `json:"kid"` Alg string `json:"alg"` IssuedAt int64 `json:"iat"` ExpiresAt int64 `json:"eat"` }
func (JWTHeader) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (JWTHeader) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*JWTHeader) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*JWTHeader) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type OAuthGoogleProvider ¶
type OAuthGoogleProvider struct {
// contains filtered or unexported fields
}
func (*OAuthGoogleProvider) AuthCodeKey ¶
func (v *OAuthGoogleProvider) AuthCodeKey() string
func (*OAuthGoogleProvider) AuthCodeURL ¶
func (v *OAuthGoogleProvider) AuthCodeURL() string
func (*OAuthGoogleProvider) Code ¶
func (v *OAuthGoogleProvider) Code() string
func (*OAuthGoogleProvider) Config ¶
func (v *OAuthGoogleProvider) Config(c Config)
type OAuthOption ¶
type OAuthOption interface {
ApplyProvider(p ...OAuthProvider)
}
type OAuthProvider ¶
type OAuthYandexProvider ¶
type OAuthYandexProvider struct {
// contains filtered or unexported fields
}
func (*OAuthYandexProvider) AuthCodeKey ¶
func (v *OAuthYandexProvider) AuthCodeKey() string
func (*OAuthYandexProvider) AuthCodeURL ¶
func (v *OAuthYandexProvider) AuthCodeURL() string
func (*OAuthYandexProvider) Code ¶
func (v *OAuthYandexProvider) Code() string
func (*OAuthYandexProvider) Config ¶
func (v *OAuthYandexProvider) Config(c Config)
Click to show internal directories.
Click to hide internal directories.