Documentation ¶
Index ¶
- Constants
- type AuthConfig
- type AuthHandler
- func (t AuthHandler) CheckAuth(ctx *routing.Context) error
- func (t AuthHandler) CheckAuthRaw(authToken string) (Claims, error)
- func (t *AuthHandler) CheckScopes(must ...string) func(ctx *routing.Context) error
- func (t AuthHandler) HandleGetOtaQR(ctx *routing.Context) error
- func (t AuthHandler) HandleLogin(redirectPath string) func(ctx *routing.Context, claims Claims) error
- func (t AuthHandler) HandleLogout(ctx *routing.Context) error
- func (t AuthHandler) HandleOTALogin(ctx *routing.Context) error
- func (t AuthHandler) HandleRefresh(ctx *routing.Context) error
- type AuthOrigin
- type Claims
- type JWTHandler
Constants ¶
View Source
const ( AuthOriginDiscord = AuthOrigin("origin:discord") AuthOriginTwitch = AuthOrigin("origin:twitch") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶
type AuthHandler ¶
type AuthHandler struct {
// contains filtered or unexported fields
}
func New ¶
func New( config AuthConfig, publicAddress string, checkApiTokenHandler func(string) (string, error), ) (*AuthHandler, error)
func (AuthHandler) CheckAuthRaw ¶
func (t AuthHandler) CheckAuthRaw(authToken string) (Claims, error)
func (*AuthHandler) CheckScopes ¶ added in v1.5.0
func (t *AuthHandler) CheckScopes(must ...string) func(ctx *routing.Context) error
func (AuthHandler) HandleGetOtaQR ¶
func (t AuthHandler) HandleGetOtaQR(ctx *routing.Context) error
func (AuthHandler) HandleLogin ¶
func (AuthHandler) HandleLogout ¶
func (t AuthHandler) HandleLogout(ctx *routing.Context) error
func (AuthHandler) HandleOTALogin ¶
func (t AuthHandler) HandleOTALogin(ctx *routing.Context) error
func (AuthHandler) HandleRefresh ¶
func (t AuthHandler) HandleRefresh(ctx *routing.Context) error
type AuthOrigin ¶ added in v1.5.0
type AuthOrigin string
type Claims ¶
type Claims struct { jwt.PublicClaims UserID string Username string Scopes []string }
func (Claims) IsAuthOrigin ¶ added in v1.5.0
func (t Claims) IsAuthOrigin(origin AuthOrigin) bool
type JWTHandler ¶
type JWTHandler struct {
// contains filtered or unexported fields
}
func NewJWTHandler ¶
func (JWTHandler) Lifetime ¶
func (t JWTHandler) Lifetime() time.Duration
Click to show internal directories.
Click to hide internal directories.