passwordreuse

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Overview

Package passwordreuse enforces the re-use rule of the instance password policy (Instance admin › Authentication › Password policy): a new password can't be any of the person's last N passwords, the current one included. Previous hashes are recorded by a database trigger whenever users.password_hash changes, so every way a password changes is covered.

Index

Constants

This section is empty.

Variables

View Source
var Choices = []int32{0, 5, 10}

Choices are the policy values the admin can pick (0 allows re-use).

Functions

func Message

func Message(n int32) string

Message explains a rejected password.

func Used

func Used(ctx context.Context, q store.Querier, userID uuid.UUID, current *string, password string, n int32) (bool, error)

Used reports whether password is the current one (current is its hash) or one of the n-1 passwords before it. n is the policy; 0 allows re-use.

Types

This section is empty.

Jump to

Keyboard shortcuts

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