server

package
v0.0.0-...-6fab97a Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAuthWithConfig

func CheckAuthWithConfig(cfg Config) echo.MiddlewareFunc

func LoginSkipper

func LoginSkipper(prefix string) middleware.Skipper

LoginSkipper used to avoid running middleware for login requests

func MustRandomState

func MustRandomState(len int) string

MustRandomState returns a base64 encoded random 32 byte string.

Types

type Auth

type Auth struct {
	// contains filtered or unexported fields
}

Auth authentication related handlers

func NewAuth

func NewAuth(ac *flags.API, providerFunc ProviderFunc) (*Auth, error)

NewAuth new auth server http handlers

func (*Auth) Callback

func (l *Auth) Callback(c echo.Context) error

Callback callback http handler

func (*Auth) Login

func (l *Auth) Login(c echo.Context) error

Login login http handler

func (*Auth) Logout

func (l *Auth) Logout(c echo.Context) error

Logout logout http handler

func (*Auth) RegisterRoutes

func (l *Auth) RegisterRoutes(r interface {
	GET(string, echo.HandlerFunc, ...echo.MiddlewareFunc) *echo.Route
})

RegisterRoutes register the login related auth routes

func (*Auth) UserInfo

func (l *Auth) UserInfo(c echo.Context) error

UserInfo user info http handler

type Callback

type Callback struct {
	Code  string `query:"code"`
	State string `query:"state"`
}

Callback callback info

type Config

type Config struct {
	Skipper middleware.Skipper
}

type ProviderFunc

type ProviderFunc = func(ctx context.Context, issuer string) (*oidc.Provider, error)

type UserInfo

type UserInfo struct {
	Sub   string `json:"sub,omitempty"`
	Email string `json:"email,omitempty"`
}

UserInfo user info returned by user info route

Jump to

Keyboard shortcuts

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