httpauth

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware

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

func NewBearerTokenMiddleware

func NewBearerTokenMiddleware(verifyToken VerifyTokenFunc) Middleware

func NewSessionCookieMiddleware

func NewSessionCookieMiddleware(cookieName string, verifyCookie VerifyCookieFunc) Middleware

func (*Middleware) AllOfRoles

func (middleware *Middleware) AllOfRoles(requiredRoles ...string) gin.HandlerFunc

func (*Middleware) AnyAuthenticated

func (middleware *Middleware) AnyAuthenticated() gin.HandlerFunc

func (*Middleware) AnyOfRoles

func (middleware *Middleware) AnyOfRoles(allowedRoles ...string) gin.HandlerFunc

type MiddlewareHandler

type MiddlewareHandler = func(rolesCheckingFunc RolesCheckingFunc) gin.HandlerFunc

type RolesCheckingFunc

type RolesCheckingFunc = func(roles []string) bool

type VerificationResult

type VerificationResult struct {
	Verified bool
	Roles    []string
}

type VerifyCookieFunc

type VerifyCookieFunc = func(c *gin.Context, cookie string) (*VerificationResult, error)

type VerifyTokenFunc

type VerifyTokenFunc = func(c *gin.Context, token string) (*VerificationResult, error)

Jump to

Keyboard shortcuts

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