oauth2

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultConfig is the default middleware config.
	DefaultConfig = MiddlewareConfig{
		TokenKey: "token",
		Skipper: func(*fiber.Ctx) bool {
			return false
		},
	}
)

Functions

func BearerAuth

func BearerAuth(c *fiber.Ctx) (string, bool)

func InitServer

func InitServer(manager *manage.Manager) *server.Server

InitServer Initialize the service

func RegisterRoute

func RegisterRoute(app *fiber.App)

RegisterRoute register th OAuth routes to router

func Set

func Set(app *fiber.App)

func TokenHandler

func TokenHandler() fiber.Handler

TokenHandler gets the token from request using default config

func TokenHandlerWithConfig

func TokenHandlerWithConfig(cfg *MiddlewareConfig) fiber.Handler

TokenHandlerWithConfig gets the token from request with given config

Types

type MiddlewareConfig

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

Config for middleware

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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