Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Middleware ¶
type Middleware struct {
// contains filtered or unexported fields
}
Middleware contains various extensions for appropriate integration of the generic auth services behind gRPC gateway. This currently includes clearing the appropriate cookies on logout.
func NewHTTPMiddleware ¶
func NewHTTPMiddleware(config config.AuthenticationSession) *Middleware
NewHTTPMiddleware constructs a new auth HTTP middleware.
func (Middleware) ErrorHandler ¶
func (m Middleware) ErrorHandler(ctx context.Context, sm *runtime.ServeMux, ms runtime.Marshaler, w http.ResponseWriter, r *http.Request, err error)
ErrorHandler ensures cookies are cleared when cookie auth is attempted but leads to an unauthenticated response. This ensures well behaved user-agents won't attempt to supply the same token via a cookie again in a subsequent call.
Click to show internal directories.
Click to hide internal directories.