http_middleware

package
v1.42.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

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.

func (Middleware) Handler

func (m Middleware) Handler(next http.Handler) http.Handler

Handler is a http middleware used to decorate the auth provider gateway handler. This is used to clear the appropriate cookies on logout.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL