dataprovider: add naming rules

naming rules allow to support case insensitive usernames, trim trailing
and leading white spaces, and accept any valid UTF-8 characters in
usernames.

If you were enabling `skip_natural_keys_validation` now you need to
set `naming_rules` to `1`

Fixes #687

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2022-01-31 18:01:37 +01:00
parent fb2d59ec92
commit 02db00d008
13 changed files with 137 additions and 30 deletions

View File

@@ -103,6 +103,7 @@ func updateAdmin(w http.ResponseWriter, r *http.Request) {
}
adminID := admin.ID
username = admin.Username
totpConfig := admin.Filters.TOTPConfig
recoveryCodes := admin.Filters.RecoveryCodes
admin.Filters.TOTPConfig = dataprovider.AdminTOTPConfig{}