Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteCookies(w http.ResponseWriter)
- func GetJWTFromContext(r *http.Request) *jwt.Token
- func GetToken(user *User, xsfrToken string) (string, error)
- func SetCookies(w http.ResponseWriter, r *http.Request, authenticationToken, xsrfToken string)
- type Config
- type Methods
- type Role
- type TokenLocation
- type User
Constants ¶
View Source
const JWTToken = "jwtToken"
JWTToken constant
Variables ¶
View Source
var ( // Roles contains the roles for the active auth driver Roles []Role )
Functions ¶
func DeleteCookies ¶
func DeleteCookies(w http.ResponseWriter)
DeleteCookies invalidate the JWT and XSTF cookies
func GetJWTFromContext ¶
GetJWTFromContext retrieves the JWT Token from the request
func SetCookies ¶
func SetCookies(w http.ResponseWriter, r *http.Request, authenticationToken, xsrfToken string)
SetCookies set the proper cookies for the JWT and XSFR tokens
Types ¶
type Config ¶
Config contains the authentication configuration
func (*Config) Authenticate ¶
Authenticate calls the proper handler based on whether authentication is enabled or not
type Role ¶
type Role struct { AccessToken string Datacenters []string Fallback bool Members []string Methods Methods Name string Readonly bool Subscriptions []string }
Role contains the attributes of a role
type TokenLocation ¶
TokenLocation represents a function that accepts a request as input and returns either a token or an error.
Click to show internal directories.
Click to hide internal directories.