security

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComparePassword

func ComparePassword(password, hash string) (bool, error)

func HashPassword

func HashPassword(password string) (string, error)

func NewUUID

func NewUUID() uuid.UUID

Types

type RequestClaims

type RequestClaims struct {
	UserID string `json:"sub"`
	Email  string `json:"email"`
	Role   string `json:"role"`
	jwt.RegisteredClaims
}

type TokenService

type TokenService struct {
	// contains filtered or unexported fields
}

func NewTokenService

func NewTokenService(authCfg *config.AuthConfig) *TokenService

func (*TokenService) GenerateAccessToken

func (ts *TokenService) GenerateAccessToken(payload RequestClaims) (string, error)

func (*TokenService) ValidateAccessToken

func (ts *TokenService) ValidateAccessToken(accessToken string) (*RequestClaims, error)

Jump to

Keyboard shortcuts

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