auth

package
v0.0.0-...-84f50f4 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UsernameFormKey = "username"
	PasswordFormKey = "password"
)

Functions

func HashPassword

func HashPassword(password string) (string, error)

HashPassword generates a hashed password using Argon2

Types

type Handler

type Handler struct {
	DB *db.DB
}

func NewHandler

func NewHandler(database *db.DB) *Handler

func (*Handler) GetOrCreateSession

func (h *Handler) GetOrCreateSession(r *foundation.Request) (*foundation.Session, error)

func (*Handler) Login

func (h *Handler) Login(r *foundation.Request) error

func (*Handler) Logout

func (h *Handler) Logout(r *foundation.Request) error

type RateLimit

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

type RateLimiter

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

func NewRateLimiter

func NewRateLimiter() *RateLimiter

func (*RateLimiter) IsBlocked

func (rl *RateLimiter) IsBlocked(r *foundation.Request, username string) bool

func (*RateLimiter) RecordAttempt

func (rl *RateLimiter) RecordAttempt(r *foundation.Request, username string, success bool)

Jump to

Keyboard shortcuts

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