✨(backend) add expiration date and password to item share links - #810
Draft
kernicPanel wants to merge 14 commits into
Draft
✨(backend) add expiration date and password to item share links#810kernicPanel wants to merge 14 commits into
kernicPanel wants to merge 14 commits into
Conversation
Prepare the schema for share links that can expire and be protected by a password. The fields are not used yet.
An expired link is treated as restricted when computing abilities and inherited link definitions, and when filtering readable items for the tree and breadcrumb. Users with an explicit access are not affected.
Let clients display the expiration date of an item share link.
The date must be in the future and only applies to non-restricted links, it is cleared when the link is restricted again or when descendants are synced with a parent link.
Make room for link access conditions beyond reach, like a password.
Reuse Django password hashers so the raw password is never stored.
Record which item holds the password of the effective link, the closest one providing its reach and role.
The link role is only granted once the user has unlocked the item holding the password, known through unlocked_link_items on the user.
Let clients know when unlocking the link password would grant the user more than the explicit role.
Items endpoints need to know which links the user has unlocked. The WOPI client has no session, so the access token stores them as well.
Unlocking stores in the session the item holding the password, so every item sharing that link is unlocked. Attempts are rate limited.
Let link managers know a password is set without exposing it.
The password is hashed, never returned, only applies to non-restricted links and is cleared when the link is restricted again or when descendants are synced with a parent link.
The search index only knows the link reach, so items whose link has expired or is locked by a password were still returned.
kernicPanel
force-pushed
the
feature/link-expiration-password
branch
from
August 21, 2026 15:52
2a3d851 to
c49c74c
Compare
|
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.



Purpose
Let users share an item through a link that expires at a given date
and/or requires a password. Backend part of #285.
Proposal
link_expires_atandlink_passwordfields on Itemlink definitions, tree and breadcrumb
password of the closest ancestor link applies to descendants
POST /items/{id}/unlock/stores the unlocked link in the session,rate limited by
API_ITEMS_UNLOCK_THROTTLE_RATElink-configurationacceptslink_expires_atandlink_passwordlink_expires_at,has_link_passwordand thepassword_lockedability