authz

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

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