handlers

package
v0.0.0-...-235c1e2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DebugHandler

func DebugHandler(writer http.ResponseWriter, req *http.Request)

DebugHandler is responsible for providing the pprof

func DiscoveryHandler

func DiscoveryHandler(
	logger *zap.Logger,
	withOAuthURI func(string) string,
) func(wrt http.ResponseWriter, _ *http.Request)

discoveryHandler provides endpoint info

func EmptyHandler

func EmptyHandler(_ http.ResponseWriter, _ *http.Request)

EmptyHandler is responsible for doing nothing

func ExpirationHandler

func ExpirationHandler(
	getIdentity func(req *http.Request, tokenCookie string, tokenHeader string) (*models.UserContext, error),
	cookieAccessName string,
) func(wrt http.ResponseWriter, req *http.Request)

ExpirationHandler checks if the token has expired

func GetRedirectionURL

func GetRedirectionURL(
	logger *zap.Logger,
	redirectionURL string,
	noProxy bool,
	noRedirects bool,
	secureCookie bool,
	cookieOAuthStateName string,
	withOAuthURI func(string) string,
) func(wrt http.ResponseWriter, req *http.Request) string

getRedirectionURL returns the redirectionURL for the oauth flow

func HealthHandler

func HealthHandler(w http.ResponseWriter, _ *http.Request)

HealthHandler is a health check handler for the service

func MethodNotAllowHandlder

func MethodNotAllowHandlder(w http.ResponseWriter, _ *http.Request)

func ProxyMetricsHandler

func ProxyMetricsHandler(
	localhostMetrics bool,
	accessForbidden func(wrt http.ResponseWriter, req *http.Request) context.Context,
	metricsHandler http.Handler,
) func(wrt http.ResponseWriter, req *http.Request)

ProxyMetricsHandler forwards the request into the prometheus handler

func RetrieveIDToken

func RetrieveIDToken(
	cookieIDTokenName string,
	enableEncryptedToken bool,
	forceEncryptedCookie bool,
	encryptionKey string,
	req *http.Request,
) (string, string, error)

RetrieveIDToken retrieves the id token from cookie

func TokenHandler

func TokenHandler(
	getIdentity func(req *http.Request, tokenCookie string, tokenHeader string) (*models.UserContext, error),
	cookieAccessName string,
	accessError func(wrt http.ResponseWriter, req *http.Request) context.Context,
) func(wrt http.ResponseWriter, req *http.Request)

TokenHandler display access token to screen

Types

This section is empty.

Jump to

Keyboard shortcuts

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