mirror of
https://github.com/sigoden/dufs.git
synced 2026-06-07 15:59:03 +03:00
fix: tweak auth logic (#689)
This commit is contained in:
+12
-1
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user