auth

package
v0.0.0-...-01627f8 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthorizationHeader = "Authorization"
	BearerPrefix        = "Bearer "
)

Variables

This section is empty.

Functions

func AuthenticationFunc1

func AuthenticationFunc1(c context.Context, input *openapi3filter.AuthenticationInput) error

func GenerateAccessToken

func GenerateAccessToken(secretKey []byte, userID uint, expiresIn time.Duration) (string, error)

func GenerateRefreshToken

func GenerateRefreshToken(secretKey []byte, userID uint, expiry time.Time) (string, error)

func GenerateTokens

func GenerateTokens(secretKey []byte, userID uint, expiresIn time.Duration) (string, string, time.Time, error)

func HashPassword

func HashPassword(password string) (string, error)

HashPassword securely hashes a password using bcrypt.

func ValidatePassword

func ValidatePassword(hash, password string) bool

ValidatePassword compares a hashed password with a provided password.

Types

This section is empty.

Jump to

Keyboard shortcuts

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