auth

package
v0.0.0-...-1329338 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserAuthHeader string = "Authorization"
	TokenPrefix    string = "Bearer"
	LenPrefix      int    = len(TokenPrefix + " ")
)
View Source
const TokenIssuer string = "chat-api"

Variables

View Source
var (
	RegularAudience []string = []string{"user"}
	AdminAudience   []string = []string{"user", "admin"}
)

Functions

func Authentication

func Authentication(next http.Handler) http.Handler

func GetUserData

func GetUserData(r *http.Request) database.User

func SaltyPassword

func SaltyPassword(password, salt []byte) []byte

func SetupAuth

func SetupAuth() error

func UserToToken

func UserToToken(u database.User) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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