auth

package
v0.0.0-...-ed7a308 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComparePasswords

func ComparePasswords(hashed string, plain []byte) bool

func CreateJWT

func CreateJWT(userID uuid.UUID, cache *redis.Client) (string, error)

func GetUserIdFromContext

func GetUserIdFromContext(ctx context.Context) string

func HashPasswords

func HashPasswords(password string) (string, error)

func InitializeKeys

func InitializeKeys(cache *redis.Client) error

func JWKSHandler

func JWKSHandler(cache *redis.Client) http.HandlerFunc

func RefreshToken

func RefreshToken(cache *redis.Client) http.HandlerFunc

func WithJWTAuth

func WithJWTAuth(handlerFunc http.HandlerFunc, cache *redis.Client) http.HandlerFunc

Types

type Key

type Key struct {
	PrivateKey *rsa.PrivateKey
	PublicKey  *rsa.PublicKey
	Kid        string
	CreatedAt  time.Time
}

Jump to

Keyboard shortcuts

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