Documentation
¶
Index ¶
- Variables
- func AccessMiddleware(ctx core.Context) func(http.Handler) http.Handler
- func AccountVerifiedMiddleware(ctx core.Context) func(http.Handler) http.Handler
- func AuthMiddleware(options AuthMiddlewareOptions) func(http.Handler) http.Handler
- func CorsMiddleware(opts *cors.Options) func(h http.Handler) http.Handler
- func FindAuthToken(r *http.Request, secretKey ed25519.PrivateKey, cookieName string, ...) string
- func GetAuthTokenFromContext(ctx context.Context) (string, error)
- func GetUserFromContext(ctx context.Context, key ...string) (uint, error)
- func ParseAuthTokenHeader(headers http.Header) string
- func TusCorsMiddleware() func(h http.Handler) http.Handler
- func TusPathMiddleware(basePath string) mux.MiddlewareFunc
- type AuthMiddlewareOptions
- type AuthTokenContextKeyType
- type FindAuthTokenFunc
- type UserIdContextKeyType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorUserContextInvalid = errors.New("user id stored in context is not of type uint") ErrorAuthTokenContextInvalid = errors.New("auth token stored in context is not of type string") )
Functions ¶
func AccessMiddleware ¶ added in v0.2.0
func AccountVerifiedMiddleware ¶ added in v0.2.0
func AuthMiddleware ¶
func AuthMiddleware(options AuthMiddlewareOptions) func(http.Handler) http.Handler
func CorsMiddleware ¶ added in v0.2.0
func FindAuthToken ¶
func ParseAuthTokenHeader ¶
func TusPathMiddleware ¶ added in v0.2.0
func TusPathMiddleware(basePath string) mux.MiddlewareFunc
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 FindAuthTokenFunc ¶
type UserIdContextKeyType ¶
type UserIdContextKeyType string
const DEFAULT_USER_ID_CONTEXT_KEY UserIdContextKeyType = "user_id"
Source Files
¶
Click to show internal directories.
Click to hide internal directories.