feat(DPoP): check requests and 401 on failure

This commit is contained in:
Edouard Vanbelle
2026-08-08 19:55:18 +02:00
parent ed99b08e62
commit 8d6e03a4bb
11 changed files with 283 additions and 63 deletions
@@ -203,11 +203,15 @@ pub async fn basic_auth_middleware(
// `Arc<CurrentUser>` extension AND `NcSession.user` (the old
// code built the struct, cloned it for the extension, then
// moved the original — 2-3 String allocs per request).
// Nextcloud clients are always unbound — they authenticate
// with app passwords via Basic Auth, no WebCrypto, no DPoP.
// Middleware exempts unbound sessions per Gate 9 design.
let current_user = Arc::new(CurrentUser {
id: user_id,
username: uname,
email,
role,
dpop_jkt: None,
});
// ── Resolve chroot from the Basic Auth drive marker ─────