Documentation ¶
Index ¶
- Variables
- func AuthHandler(pool *pgx.ConnPool, config auth.Config, handler http.Handler) authHandler
- func ContextHandler(pool *pgx.ConnPool, nomad *nomad.Client, h http.Handler) *contextHandler
- func GetAuthSession(ctx context.Context) *auth.Session
- func GetDBPool(ctx context.Context) (*pgx.ConnPool, bool)
- func GetNomadClient(ctx context.Context) (*nomad.Client, bool)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoConnPool = errors.New("handlers can't access database pool") ErrNoNomadClient = errors.New("handlers can't access nomad client") ErrFailedAuth = errors.New("failed request authentication") ErrFailedSession = errors.New("failed session authentication") ErrFailedAccount = errors.New("failed account authentication") ErrFailedKey = errors.New("failed key authentication") ErrNoSession = errors.New("failed to get authenticated session") )
Functions ¶
func AuthHandler ¶
AuthHandler constructs and returns the HTTP handler object responsible for authenticating a request. This accepts a chain of HTTP handlers.
func ContextHandler ¶
func GetAuthSession ¶
GetAuthSession pulls the current active authenticated session out of the current request context. This keeps authentication scoped to the active request only.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.