mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-08-11 13:55:30 +00:00
fix(oidc): enforce reserved-username check in _create_user_locked
The reserved-username guard was only in create_user(), but setup() now calls _create_user_locked() directly (to avoid nested flock deadlock). Move the check into the shared helper so it applies regardless of which path creates the user. Fixes CI failure in test_setup_rejects_reserved_admin_username.
This commit is contained in:
parent
817281716d
commit
352f4cf52b
1 changed files with 3 additions and 0 deletions
|
|
@ -346,6 +346,9 @@ class AuthManager:
|
|||
def _create_user_locked(self, username: str, password: str, is_admin: bool) -> bool:
|
||||
"""Internal helper — caller must hold _interprocess_auth_lock
|
||||
and _config_lock. Does not reload (caller did that)."""
|
||||
if username in RESERVED_USERNAMES:
|
||||
logger.warning("Refused to create reserved username '%s'", username)
|
||||
return False
|
||||
if username in self._config.get("users", {}):
|
||||
return False
|
||||
if "users" not in self._config:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue