mirror of
https://github.com/sigoden/dufs.git
synced 2026-04-08 16:49:02 +03:00
[PR #218] [MERGED] feat: new auth #518
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/sigoden/dufs/pull/218
Author: @sigoden
Created: 6/1/2023
Status: ✅ Merged
Merged: 6/1/2023
Merged by: @sigoden
Base:
main← Head:new-auth📝 Commits (1)
b43f7eabreaking: new auth📊 Changes
7 files changed (+481 additions, -273 deletions)
View changed files
📝
Cargo.toml(+1 -1)📝
src/args.rs(+2 -2)📝
src/auth.rs(+231 -128)📝
src/server.rs(+206 -124)📝
tests/auth.rs(+38 -15)📝
tests/log_http.rs(+2 -2)📝
tests/single_file.rs(+1 -1)📄 Description
The access level path control used by dufs has two disadvantages:
So it needs to be refactored.
The new auth is account based, it closes #207, closes #208.
Access Control
Dufs supports account based access control. You can control who can do what on which path with
--auth/-a.1: Multiple rules are separated by "|"
2: User and pass are the account name and password, if omitted, it is an anonymous user
3: One rule can set multiple paths, separated by ","
4: Add
:rwafter the path to indicate that the path has read and write permissions, otherwise the path has readonly permissions.adminhas all permissions for all paths.guesthas readonly permissions for all paths.All paths is public, everyone can view/download it.
user1has all permissions for/user1/*path.user2has all permissions for/user2/*path.userhas all permissions for/dir1/*and/dir2/*, has readonly permissions for/dir3/.Since dufs only allows viewing/downloading,
admincan only view/download files.BREAKING CHANGE: new auth
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.