auth

package
v0.0.0-...-5ad4795 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const AuthzAudience = "chat"

AuthzAudience defines the value of jwt audience field.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoStrategy

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

AutoStrategy defines authentication strategy which can automatically choose between Basic and Bearer according `Authorization` header.

func NewAutoStrategy

func NewAutoStrategy(jwt JWTStrategy) AutoStrategy

NewAutoStrategy create auto strategy with basic strategy and jwt strategy.

func (AutoStrategy) AuthFunc

func (a AutoStrategy) AuthFunc() gin.HandlerFunc

AuthFunc defines auto strategy as the gin authentication middleware.

type JWTStrategy

type JWTStrategy struct {
	ginjwt.GinJWTMiddleware
}

JWTStrategy defines jwt bearer authentication strategy.

func NewJWTStrategy

func NewJWTStrategy(gjwt ginjwt.GinJWTMiddleware) JWTStrategy

NewJWTStrategy create jwt bearer strategy with GinJWTMiddleware.

func (JWTStrategy) AuthFunc

func (j JWTStrategy) AuthFunc() gin.HandlerFunc

AuthFunc defines jwt bearer strategy as the gin authentication middleware.

Jump to

Keyboard shortcuts

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