authz

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: GPL-3.0 Imports: 6 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

Index

Constants

This section is empty.

Variables

View Source
var NormalizeFuncs = map[string]NormalizeFunc{
	"auto":                  NormalizeAuto,
	"precis_casefold_email": address.PRECISFold,
	"precis_casefold":       precis.UsernameCaseMapped.CompareKey,
	"precis_email":          address.PRECIS,
	"precis":                precis.UsernameCasePreserved.CompareKey,
	"casefold": func(s string) (string, error) {
		return strings.ToLower(s), nil
	},
	"noop": NormalizeNoop,
}

NormalizeFuncs defines configurable normalization functions to be used in authentication and authorization routines.

Functions

func AuthorizeEmailUse

func AuthorizeEmailUse(ctx context.Context, username string, addrs []string, mapping module.Table) (bool, error)

func NormalizeAuto added in v0.7.0

func NormalizeAuto(s string) (string, error)

NormalizeAuto applies address.PRECISFold to valid emails and plain UsernameCaseMapped profile to other strings.

func NormalizeNoop added in v0.7.0

func NormalizeNoop(s string) (string, error)

Types

type NormalizeFunc added in v0.7.0

type NormalizeFunc func(string) (string, error)

Jump to

Keyboard shortcuts

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