Skip to content

✨(backend) add expiration date and password to item share links - #810

Draft
kernicPanel wants to merge 14 commits into
mainfrom
feature/link-expiration-password
Draft

✨(backend) add expiration date and password to item share links#810
kernicPanel wants to merge 14 commits into
mainfrom
feature/link-expiration-password

Conversation

@kernicPanel

@kernicPanel kernicPanel commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

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

  • add link_expires_at and link_password fields on Item
  • deny link access once the link has expired, in abilities, inherited
    link definitions, tree and breadcrumb
  • deny link access until the password has been unlocked, the
    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_RATE
  • carry unlocked links in the WOPI access token
  • link-configuration accepts link_expires_at and link_password
  • expose link_expires_at, has_link_password and the
    password_locked ability
  • filter indexed search results on expired or locked links

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
kernicPanel force-pushed the feature/link-expiration-password branch from 2a3d851 to c49c74c Compare August 21, 2026 15:52
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant