fix: tweak auth logic (#689)

This commit is contained in:
sigoden
2026-04-25 17:28:28 +08:00
committed by GitHub
parent 0ccc2cf1e7
commit 43c778182b
2 changed files with 58 additions and 23 deletions
+12 -1
View File
@@ -366,7 +366,18 @@ fn auth_data(
}
#[rstest]
fn auth_shadow(
fn auth_precedence(
#[with(&["--auth", "user:pass@/dir1:rw,/dir1/test.txt", "-A"])] server: TestServer,
) -> Result<(), Error> {
let url = format!("{}dir1/test.txt", server.url());
let resp = send_with_digest_auth(fetch!(b"PUT", &url).body(b"abc".to_vec()), "user", "pass")?;
assert_eq!(resp.status(), 403);
Ok(())
}
#[rstest]
fn auth_anonymous_no_precedence(
#[with(&["--auth", "user:pass@/:rw", "-a", "@/dir1", "-A"])] server: TestServer,
) -> Result<(), Error> {
let url = format!("{}dir1/test.txt", server.url());