Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetHTTPProtocols ¶
Returns *http.Protocols that are used by authentication engine http server and clients.
func NewSocketClient ¶
Creates an *http.Client to communicate with the authentication engine that serves over a unix domain socket.
Types ¶
type AuthData ¶
type AuthData struct {
User string // User name
Role []authv1.Role // User roles
Raw *authv1.VerifyTokenRequest // Extracted Token
}
Authentication data to pass through [http.Handler]s as context value.
func AuthDataFrom ¶
type AuthMiddleware ¶
type AuthMiddleware struct {
// contains filtered or unexported fields
}
Middleware to perform authentication over Auth Engine.
func NewAuthMiddleware ¶
Creates a new AuthMiddleware.
func (*AuthMiddleware) Authenticate ¶
func (c *AuthMiddleware) Authenticate(next http.Handler) http.Handler
Middleware to authenticate HTTP requests with Basic Auth against authentication engine.
If 'Authentication' header is missing, an empty 401 response is sent, if the token is invalid, a 403 status is returned, otherwise 'next' handler is called with AuthData in http.Request context (see AuthDataFrom).