MCPcopy Index your code
hub / github.com/foxcpp/maddy / NormalizeAuto

Function NormalizeAuto

internal/authz/normalization.go:18–23  ·  view source on GitHub ↗

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

(s string)

Source from the content-addressed store, hash-verified

16// NormalizeAuto applies address.PRECISFold to valid emails and
17// plain UsernameCaseMapped profile to other strings.
18func NormalizeAuto(s string) (string, error) {
19 if address.Valid(s) {
20 return address.PRECISFold(s)
21 }
22 return precis.UsernameCaseMapped.CompareKey(s)
23}
24
25// NormalizeFuncs defines configurable normalization functions to be used
26// in authentication and authorization routines.

Callers

nothing calls this directly

Calls 2

ValidFunction · 0.92
PRECISFoldFunction · 0.92

Tested by

no test coverage detected