auth

package
v0.0.0-...-d785689 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UserKey = "user-ctx"
)

Functions

func Configure

func Configure(keyStr string) error

func GenerateToken

func GenerateToken(claims CustomClaims) (string, error)

Types

type CustomClaims

type CustomClaims struct {
	jwt.RegisteredClaims
	Name string `json:"name,omitempty"`
}

func ClaimJWT

func ClaimJWT(bearerToken string) (*CustomClaims, error)

func GetUserContext

func GetUserContext(ctx context.Context) *CustomClaims

Jump to

Keyboard shortcuts

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