feat: add secure user resource sharing - #107
Merged
DenizAltunkapan merged 2 commits intoJul 27, 2026
Merged
Conversation
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
arnabnandy7
requested review from
DenizAltunkapan,
GabrielBBaldez and
MaximilianRau04
as code owners
July 25, 2026 06:36
DenizAltunkapan
requested changes
Jul 25, 2026
DenizAltunkapan
left a comment
Member
There was a problem hiding this comment.
This is strong work. The security fundamentals are all here: path traversal is checked in depth, every resolve re-validates the real path against both the shared root and the owner root, recipient isolation goes through the repository query, permissions are enforced per operation, and revocation takes effect immediately. The tests hit exactly the properties that matter (escape attempts, cross-recipient access, edit staying inside the boundary, revocation), and the full suite passes locally at 202 tests. No conflicts, CI green.
A few things I would like addressed before approving, details inline:
- The new share endpoints are not covered by the rate limiter. The folder download in particular streams arbitrarily large archives, which is the same resource class that is deliberately throttled elsewhere.
- The edit write path can follow a symlink swapped in after resolution, the same TOCTOU window that #106 just closed on the read path.
- create has no duplicate guard, so the same path can be shared to the same recipient repeatedly.
Nothing here is a design problem, the shape is right. Happy to approve once 1 and 2 are handled.
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
VIEW,DOWNLOAD, andEDITpermissions..trashaccess.Linked issue
Closes #27
How to test
The test suite should report:
The sharing endpoints can also be tested with authenticated users:
POST /api/shares.GET /api/shares/shared-with-me.VIEW,DOWNLOAD, orEDIToperation.DELETE /api/shares/{id}as the owner.404.Notes / Risk
resource_sharesandresource_share_permissionstables through the existingspring.jpa.hibernate.ddl-auto=updateconfiguration.EDITreplaces the contents of an existing shared file. It does not create, rename, move, or delete resources.