utils

package
v0.0.0-...-9506fc3 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComparePasswords

func ComparePasswords(hashedPwd, inputPwd string) bool

func ConnectionURLBuilder

func ConnectionURLBuilder(n string) (string, error)

func GeneratePassword

func GeneratePassword(p string) string

func GetCredentialsByRole

func GetCredentialsByRole(role string) ([]string, error)

func NewValidator

func NewValidator() *validator.Validate

func NormalizePassword

func NormalizePassword(p string) []byte

func ParseRefreshToken

func ParseRefreshToken(refreshToken string) (int64, error)

func StartServer

func StartServer(a *fiber.App)

func StartServerWithGracefulShutdown

func StartServerWithGracefulShutdown(a *fiber.App)

func ValidatorErrors

func ValidatorErrors(err error) map[string]string

func VerifyRole

func VerifyRole(role string) (string, error)

Types

type TokenMetadata

type TokenMetadata struct {
	UserID      uuid.UUID
	Credentials map[string]bool
	Expires     int64
}

func ExtractTokenMetadata

func ExtractTokenMetadata(c *fiber.Ctx) (*TokenMetadata, error)

type Tokens

type Tokens struct {
	Access  string
	Refresh string
}

func GenerateNewTokens

func GenerateNewTokens(id string, credentials []string) (*Tokens, error)

Jump to

Keyboard shortcuts

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