Documentation
¶
Index ¶
- func AuthMiddleware(options AuthMiddlewareOptions) func(http.Handler) http.Handler
- func AuthzMiddleware(options AuthzOptions) func(http.Handler) http.Handler
- func FindAuthToken(r *http.Request, cookieName string, queryParam string) string
- func GetAuthTokenFromContext(ctx context.Context) string
- func GetUserFromContext(ctx context.Context, key ...string) uint
- func ParseAuthTokenHeader(headers http.Header) string
- type AuthMiddlewareOptions
- type AuthTokenContextKeyType
- type AuthzOptions
- type FindAuthTokenFunc
- type UserIdContextKeyType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthMiddleware ¶
func AuthMiddleware(options AuthMiddlewareOptions) func(http.Handler) http.Handler
func AuthzMiddleware ¶
func AuthzMiddleware(options AuthzOptions) func(http.Handler) http.Handler
func FindAuthToken ¶
func GetAuthTokenFromContext ¶
func ParseAuthTokenHeader ¶
Types ¶
type AuthMiddlewareOptions ¶
type AuthMiddlewareOptions struct { Context core.Context FindToken FindAuthTokenFunc Purpose core.JWTPurpose AuthContextKey string EmptyAllowed bool ExpiredAllowed bool }
type AuthTokenContextKeyType ¶
type AuthTokenContextKeyType string
const AUTH_TOKEN_CONTEXT_KEY AuthTokenContextKeyType = "auth_token"
type AuthzOptions ¶
type FindAuthTokenFunc ¶
type UserIdContextKeyType ¶
type UserIdContextKeyType string
const DEFAULT_USER_ID_CONTEXT_KEY UserIdContextKeyType = "user_id"
Click to show internal directories.
Click to hide internal directories.