passwordreuse

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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