auth

package
v0.0.0-...-b1be036 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComparePasswordAndHash

func ComparePasswordAndHash(password, encodedHash string) (match bool, err error)

ComparePasswordAndHash compares plaintext and its store hash

func ExtractToken

func ExtractToken(r *http.Request) string

ExtractToken gets

func GenerateHash

func GenerateHash(password string) (encodedHash string, err error)

GenerateHash creates the key train

func GenerateTokenPair

func GenerateTokenPair(subject string) (string, string, error)

GenerateTokenPair generates access and refresh tokens

func JwtMiddleware

func JwtMiddleware(next http.Handler) http.Handler

JwtMiddleware validates token in transit

func RefreshTokens

func RefreshTokens(refreshToken string) (string, string, error)

RefreshTokens ...

func TokenValid

func TokenValid(r *http.Request) error

TokenValid ...

func VerifyAccessToken

func VerifyAccessToken(r *http.Request) (*jwt.Token, error)

VerifyAccessToken ..

Types

This section is empty.

Jump to

Keyboard shortcuts

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