security

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAccountLockout

func CheckAccountLockout(app App, userId string) error

CheckAccountLockout checks if account is locked

func CheckPasswordChangeFrequency

func CheckPasswordChangeFrequency(app App, userId string) error

CheckPasswordChangeFrequency enforces max 5 password changes per 24h

func CheckPasswordReuse

func CheckPasswordReuse(app App, userId string, newPassword string) error

CheckPasswordReuse prevents reusing passwords within 24 hours

func HashPassword

func HashPassword(password string) string

HashPassword creates SHA-256 hash of password for reuse checking

func TrackFailedAuthAttempt

func TrackFailedAuthAttempt(app App, userId string) error

TrackFailedAuthAttempt tracks failed login attempts and locks account after 5 failures

func TrackPasswordChange

func TrackPasswordChange(app App, userId string, password string, success bool)

TrackPasswordChange records password change in history

Types

type App

type App interface {
	FindCollectionByNameOrId(collectionNameOrId string) (*core.Collection, error)
	FindRecordsByFilter(collection any, filter string, sort string, limit int, offset int, params ...dbx.Params) ([]*core.Record, error)
	Save(record core.Model) error
}

App interface for testability

Jump to

Keyboard shortcuts

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