internal

package
v0.0.0-...-1ec4bbe Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultConfig is the default middleware config.
	DefaultConfig = Config{
		TokenKey: "token",
		Skipper: func(_ echo.Context) bool {
			return false
		},
	}
)
View Source
var Oauth2Config *oauth2.Config

Functions

func InitOauth2Flow

func InitOauth2Flow()

func Oauth2Callback

func Oauth2Callback(c echo.Context) error

func Oauth2Login

func Oauth2Login(c echo.Context) error

func TokenHandler

func TokenHandler() echo.MiddlewareFunc

TokenHandler gets the token from request using default config

func TokenHandlerWithConfig

func TokenHandlerWithConfig(cfg *Config) echo.MiddlewareFunc

TokenHandlerWithConfig gets the token from request with given config

Types

type Config

type Config struct {
	// keys stored in the context
	TokenKey string
	// defines a function to skip middleware.Returning true skips processing
	// the middleware.
	Skipper func(echo.Context) bool
}

Config for middleware

Jump to

Keyboard shortcuts

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