Documentation ¶
Index ¶
Constants ¶
View Source
const ( // AuthDetailsContextKey is a key used to store and retrieve the authentication details to/from the http request AuthDetailsContextKey ContextKey = "AuthDetails" // AuthDetailsSessionKey is a key used to store and retrieve the authentication details to/from the http session AuthDetailsSessionKey string = "AuthDetails" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthDetails ¶
type AuthDetails struct { Authenticated bool `json:"authenticated"` Username string `json:"username,omitempty"` UserID uint `json:"userId,omitempty"` AuthType AuthType `json:"authType,omitempty"` }
AuthDetails is a struct used for storing authentication details within the cookie store
func Get ¶ added in v0.3.0
func Get(r *http.Request) AuthDetails
type AuthType ¶
type AuthType string
AuthType is a alias for string used for AuthTypeSession and AuthTypePassPassword AuthType is used to store the type of used authentication within AuthDetails
type ContextKey ¶
type ContextKey string
ContextKey is a string-alias used for safe-usage of the context method
type MiddlewareHandler ¶
type MiddlewareHandler struct {
// contains filtered or unexported fields
}
MiddlewareHandler is a middleware for handling all possible authentication options and storing them into the context of the http request
func (MiddlewareHandler) ServeHTTP ¶
func (m MiddlewareHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements the core functionality of this middleware
Click to show internal directories.
Click to hide internal directories.