fix(auth): throttle bootstrap and require reauth for user changes
Bootstrap takes the client IP, is limited per IP, and writes no audit line once an admin exists. Creating, changing the role of or deleting a user now needs a session with recent reauthentication; API tokens are refused. /api/analyze and /api/update return fixed messages and log the detail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2b1bc63340
commit
5ad89d5be5
6 files changed
+218
-39
No files matched your search
@@ -607,7 +607,7 @@ mod tests {
|
||||
/// Bootstraps `root` (admin, MFA enrolled).
|
||||
fn root(s: &AuthService) -> String {
|
||||
let code = s.ensure_bootstrap(T0).unwrap().unwrap();
|
||||
s.complete_bootstrap(&code, "root", PW, T0).unwrap();
|
||||
s.complete_bootstrap(&code, "root", PW, ip(), T0).unwrap();
|
||||
let id = uid(s, "root");
|
||||
enroll(s, &id, T0);
|
||||
id
|
||||
|
||||
Reference in new issue
Block a user