handlers

package
v0.0.0-...-81bf7c8 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2019 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallbackHandler

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

CallbackHandler /auth - validate info from oauth provider (Google, GitHub, OIDC, etc) - create user - issue jwt in the form of a cookie

func ClaimsFromJWT

func ClaimsFromJWT(jwt string) (jwtmanager.Oauth2Claims, error)

ClaimsFromJWT parse the jwt and return the claims

func FindJWT

func FindJWT(r *http.Request) string

FindJWT look for JWT in Cookie, JWT Header, Authorization Header (OAuth2 Bearer Token) and Query String in that order

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 currently performs a 302 redirect to Google

func ValidateRequestHandler

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

ValidateRequestHandler /validate TODO this should use the handler interface

func VerifyUser

func VerifyUser(u interface{}) (ok bool, err error)

VerifyUser validates that the domains match for the user func VerifyUser(u structs.User) (ok bool, err error) {

Types

type AuthError

type AuthError struct {
	Error string
	JWT   string
}

AuthError sets the values to return to nginx

type Index

type Index struct {
	Msg      string
	TestURLs []string
	Testing  bool
}

Index variables passed to index.tmpl

Jump to

Keyboard shortcuts

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