feat(username|email): pass1: normalize auth.user data

username: now optional, if defined 2..64 chars
    password: now optional (no mode __NO_PASSWORD...__)
    oidc: now optional

    important: if need Nextcloud, username must be defined
This commit is contained in:
Edouard Vanbelle
2026-06-02 21:21:24 +02:00
parent 37b1c2703b
commit d57a50d056
17 changed files with 418 additions and 247 deletions
@@ -151,7 +151,7 @@ impl UserLifecycleHook for AuditLifecycleHook {
target: "audit",
event = "user.created",
user_id = %user.id(),
username = %user.username(),
username = %user.display_for_audit(),
is_external = user.is_external(),
);
Ok(())
@@ -162,7 +162,7 @@ impl UserLifecycleHook for AuditLifecycleHook {
target: "audit",
event = "user.login",
user_id = %user.id(),
username = %user.username(),
username = %user.display_for_audit(),
is_external = user.is_external(),
first_login = user.last_login_at().is_none(),
);
@@ -174,7 +174,7 @@ impl UserLifecycleHook for AuditLifecycleHook {
target: "audit",
event = "user.logout",
user_id = %user.id(),
username = %user.username(),
username = %user.display_for_audit(),
is_external = user.is_external(),
reason = ?reason,
);
@@ -193,7 +193,7 @@ impl UserLifecycleHook for AuditLifecycleHook {
target: "audit",
event = "user.deleted",
user_id = %user.id(),
username = %user.username(),
username = %user.display_for_audit(),
is_external = user.is_external(),
mode = ?mode,
);
@@ -272,7 +272,7 @@ impl UserLifecycleHook for SessionRevocationLifecycleHook {
target: "audit",
event = "user.sessions_revoked_on_delete",
user_id = %user.id(),
username = %user.username(),
username = %user.display_for_audit(),
mode = ?mode,
count = count,
);