[PR #689] [MERGED] fix: tweak auth logic #4800

Closed
opened 2026-05-27 23:06:43 +03:00 by zhus · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/sigoden/dufs/pull/689
Author: @sigoden
Created: 4/25/2026
Status: Merged
Merged: 4/25/2026
Merged by: @sigoden

Base: mainHead: fix


📝 Commits (1)

📊 Changes

2 files changed (+58 additions, -23 deletions)

View changed files

📝 src/auth.rs (+46 -22)
📝 tests/auth.rs (+12 -1)

📄 Description

For the same auth paths, permissions defined for deeper directory paths take precedence.
e.g., if /dir1:rw and /dir1/dir2:ro are configured, /dir1/dir2 will be read-only.
e.g., if /dir1:ro and /dir1/dir2:rw are configured, /dir1/dir2 will be read-write.

When both user-specific and anonymous paths exist, the one granting higher (more permissive) access takes precedence.
e.g., if user:pass@/dir1:rw and @/dir1/dir2:ro are configured, /dir1/dir2 will be read-write for that user, and the @/dir1/dir2:ro rule can be ignored.

Close #676 Revert #521


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/sigoden/dufs/pull/689 **Author:** [@sigoden](https://github.com/sigoden) **Created:** 4/25/2026 **Status:** ✅ Merged **Merged:** 4/25/2026 **Merged by:** [@sigoden](https://github.com/sigoden) **Base:** `main` ← **Head:** `fix` --- ### 📝 Commits (1) - [`db54ca8`](https://github.com/sigoden/dufs/commit/db54ca85a97c11f33e2dc4471dacdd257674f510) fix: tweak auth logic ### 📊 Changes **2 files changed** (+58 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `src/auth.rs` (+46 -22) 📝 `tests/auth.rs` (+12 -1) </details> ### 📄 Description For the same auth paths, permissions defined for deeper directory paths take precedence. e.g., if `/dir1:rw` and `/dir1/dir2:ro` are configured, `/dir1/dir2` will be read-only. e.g., if `/dir1:ro` and `/dir1/dir2:rw` are configured, `/dir1/dir2` will be read-write. When both user-specific and anonymous paths exist, the one granting higher (more permissive) access takes precedence. e.g., if `user:pass@/dir1:rw` and `@/dir1/dir2:ro` are configured, `/dir1/dir2` will be read-write for that user, and the `@/dir1/dir2:ro` rule can be ignored. Close #676 Revert #521 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
zhus added the pull-request label 2026-05-27 23:06:43 +03:00
zhus closed this issue 2026-05-27 23:06:43 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sigoden/dufs#4800