middleware

package
v0.0.0-...-b9c0981 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NoCacheMiddleware

func NoCacheMiddleware(next http.Handler) http.Handler

NoCacheMiddleware adds no cache headers to the response header, that tell browsers not to cache the content

Types

type KratosAuthParams

type KratosAuthParams struct {
	session.SessionStore

	// WhoAmIURL is the API endpoint fo the Kratis 'whoami' call that returns the
	// details of an authenticated session
	WhoAmIURL string

	// RedirectUnauthURL is where we will rerirect to if the session is
	// not associated with a valid user
	RedirectUnauthURL string
}

KratosAuthParams configure the KratosAuth http handler

func (KratosAuthParams) KratoAuthMiddleware

func (p KratosAuthParams) KratoAuthMiddleware(next http.Handler) http.Handler

KratoAuthMiddleware retrieves the user from the session via Kratos WhoAmIURL, and if the user is authenticated the request will proceed through the middleware chain. If the session is not authenticated, redirects to the RedirectUnauthURL

Jump to

Keyboard shortcuts

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