handlers

package
v0.0.0-...-62634f4 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthStateHandler

func AuthStateHandler(w http.ResponseWriter, r *http.Request)

AuthStateHandler /auth/{state}/ - validate info from oauth provider (Google, GitHub, OIDC, etc) - issue jwt in the form of a cookie

func CallbackHandler

func CallbackHandler(w http.ResponseWriter, r *http.Request)

CallbackHandler /auth - redirects to /auth/{state}/ with the state coming from the query parameter

func Configure

func Configure()

Configure see main.go configure()

func HealthcheckHandler

func HealthcheckHandler(w http.ResponseWriter, r *http.Request)

HealthcheckHandler /healthcheck just returns 200 '{ "ok": true }'

func LoginHandler

func LoginHandler(w http.ResponseWriter, r *http.Request)

LoginHandler /login currently performs a 302 redirect to Google

func LogoutHandler

func LogoutHandler(w http.ResponseWriter, r *http.Request)

LogoutHandler /logout Destroys Vouch session If oauth.end_session_endpoint present in conf, also redirects to destroy session at oauth provider If "url" param present in request, also redirects to that (after destroying one or both sessions)

func ValidateRequestHandler

func ValidateRequestHandler(w http.ResponseWriter, r *http.Request)

ValidateRequestHandler /validate

Types

type Provider

type Provider interface {
	Configure()
	GetUserInfo(r *http.Request, user *structs.User, customClaims *structs.CustomClaims, ptokens *structs.PTokens, opts ...oauth2.AuthCodeOption) error
}

Provider each Provider must support GetuserInfo

Jump to

Keyboard shortcuts

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