[GH-ISSUE #505] can auth the specified file?it seems that only can auth dir now,rigth? #288

Closed
opened 2026-04-08 16:51:44 +03:00 by zhus · 5 comments
Owner

Originally created by @yuf19-2022 on GitHub (Dec 20, 2024).
Original GitHub issue: https://github.com/sigoden/dufs/issues/505

-a, --auth Add auth roles, e.g. user:pass@/dir1:rw,/dir2
can auth the specified file?it seems that only can auth dir now,rigth?

Originally created by @yuf19-2022 on GitHub (Dec 20, 2024). Original GitHub issue: https://github.com/sigoden/dufs/issues/505 -a, --auth <rules> Add auth roles, e.g. user:pass@/dir1:rw,/dir2 can auth the specified file?it seems that only can auth dir now,rigth?
zhus closed this issue 2026-04-08 16:51:44 +03:00
Author
Owner

@yuf19-2022 commented on GitHub (Dec 20, 2024):

eg:/project/index.html,set "@/project/index.html".I hope can only ascess ip:5000/project,but in fact,when I access ip:5000,I will see the "project" dir.

<!-- gh-comment-id:2556776496 --> @yuf19-2022 commented on GitHub (Dec 20, 2024): eg:/project/index.html,set "@/project/index.html".I hope can only ascess ip:5000/project,but in fact,when I access ip:5000,I will see the "project" dir.
Author
Owner

@sigoden commented on GitHub (Dec 20, 2024):

dufs can auth on specific file.

<!-- gh-comment-id:2556861512 --> @sigoden commented on GitHub (Dec 20, 2024): dufs can auth on specific file.
Author
Owner

@sigoden commented on GitHub (Dec 20, 2024):

I have tested it, and everything works fine.

mkdir project
echo hello world > project/index.html
dufs . -a admin:admin@/project/index.html

Access http://127.0.0.1:5000/project/index.html. The browser prompts for authentication; after entering the username and password, I can access the page.

<!-- gh-comment-id:2556865855 --> @sigoden commented on GitHub (Dec 20, 2024): I have tested it, and everything works fine. ``` mkdir project echo hello world > project/index.html dufs . -a admin:admin@/project/index.html ``` Access `http://127.0.0.1:5000/project/index.html`. The browser prompts for authentication; after entering the username and password, I can access the page.
Author
Owner

@yuf19-2022 commented on GitHub (Dec 20, 2024):

I have tested it, and everything works fine.

mkdir project
echo hello world > project/index.html
dufs . -a admin:admin@/project/index.html

Access http://127.0.0.1:5000/project/index.html. The browser prompts for authentication; after entering the username and password, I can access the page.

OK,I see.I just want when i auth /a/b to userA,he cannot access ip:5000/a,but because b is the sub dir of a,he can ascess ip:5000/a and ip:5000/a/b.
It may be not important.

<!-- gh-comment-id:2556918253 --> @yuf19-2022 commented on GitHub (Dec 20, 2024): > I have tested it, and everything works fine. > > ``` > mkdir project > echo hello world > project/index.html > dufs . -a admin:admin@/project/index.html > ``` > > Access `http://127.0.0.1:5000/project/index.html`. The browser prompts for authentication; after entering the username and password, I can access the page. OK,I see.I just want when i auth /a/b to userA,he cannot access ip:5000/a,but because b is the sub dir of a,he can ascess ip:5000/a and ip:5000/a/b. It may be not important.
Author
Owner

@sigoden commented on GitHub (Dec 20, 2024):

he can ascess ip:5000/a and ip:5000/a/b.

First, it's important to understand that there are three types of permissions in dufs: index, read, and write.

The -a user:pass@/a/b/ grants read permissions for the directory a/b and grants index permissions for the directory a.

If that's not the case, please submit a details (including dufs running parameters, logs, version, etc.).

<!-- gh-comment-id:2556933189 --> @sigoden commented on GitHub (Dec 20, 2024): > he can ascess ip:5000/a and ip:5000/a/b. First, it's important to understand that there are three types of permissions in dufs: index, read, and write. The `-a user:pass@/a/b/` grants read permissions for the directory `a/b` and grants index permissions for the directory `a`. If that's not the case, please submit a details (including dufs running parameters, logs, version, etc.).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sigoden/dufs#288