Feature issue#111 - #120
Merged
Merged
Conversation
AnUbH75
requested review from
DenizAltunkapan,
GabrielBBaldez and
MaximilianRau04
as code owners
August 23, 2026 22:40
Contributor
Author
|
@DenizAltunkapan please review this PR this is only backend changes check Vault-Web/vault-web#324 for frontend changes |
DenizAltunkapan
approved these changes
Aug 25, 2026
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
Implements the two behaviors requested in #111: links can now be created with no expiry ("never expires"), and an owner can permanently delete a link so it stops resolving immediately and disappears from their list for good — distinct from the existing revoke, which is left unchanged.
expiresAtis now optional on creation.CreateSecureSendRequestdrops@NotNull(keeps@Future, which already treatsnullas valid).SecureSendService.create()and the internalrequireActive()check are null-safe: a link with no expiry is treated as always-active rather than throwing.lastAccessedAt— already present on theSecureSendentity andSecureSendDtobut never actually written — is now set on every successfulrequireAccess()call (coversresolve(),listFolder(),resolveFolderArchive()), so owners can see when a link was last opened and spot stale ones, especially now that links can live indefinitely.DELETE /secure-sends/{id}/permanentendpoint +SecureSendService.delete(), hard-removing the row so the token becomes unavailable immediately rather than waiting on the nightly cleanup job. Kept as a separate route/method from the existingrevoke()— revoke's behavior is untouched.Linked issue
Closes #111
How to test
Automated:
SecureSendServiceTestcovers null-expiry creation, null-expiry links never being treated as expired,lastAccessedAtbeing set on access, anddelete()both removing the row and rejecting an unknown/unauthorized id.Manual (curl):
expiresAtfield in the request body → expect200, not400.DELETE /secure-sends/{id}/permanenton it → expect204.404/unavailable, not a stale success or a delay until cleanup runs.DELETE /secure-sends/{id}) is unaffected — link still shows as revoked, not removed from the list.Notes / Risk
expires_atwas already nullable andlast_accessed_atalready existed as a column, just previously unused.deleteExpiredRecords()'s scheduled cleanup relies on Postgres'sNULL < xcomparison evaluating to false/unknown, so null-expiry ("never expires") rows should be naturally skipped bydeleteByExpiresAtBefore(...). This wasn't exercised via a DB-backed integration test in this PR — the existing test suite mocks the repository — so it's worth a manual check against a real Postgres instance before/after merge, or a follow-up integration test if this project adds@DataJpaTest/Testcontainers infra later.