Skip to content

Add secure send link reactivation - #196

Merged
DenizAltunkapan merged 1 commit into
mainfrom
feature/secure-send-reactivation
Nov 6, 2026
Merged

DenizAltunkapan merged 1 commit into
mainfrom
feature/secure-send-reactivation

Conversation

@DenizAltunkapan

Copy link
Copy Markdown
Member

Summary

Add POST /api/secure-sends/{id}/reactivate for the owner of a revoked, unexpired public share link. Reactivation clears only the revocation timestamp, preserving the original token, password, expiry, and access history. Active, expired, deleted, and other users' links cannot be reactivated.

This backend change is required by Vault-Web/vault-web#416 (Vault-Web/vault-web#414). It should be merged before the frontend PR.

Verification

  • Full backend test suite and Spotless check pass.
  • HTTP flow verified against a local PostgreSQL-backed server: create, access, revoke, confirm 404, reactivate, and access again with the same URL and password. An incorrect password remains rejected.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The reactivation test can pass even if reactivate() omits save(), so it needs to verify that save occurs before resolve() performs another save.

1 open issue
What changed in this PR

Adds backend support for reactivating revoked, unexpired secure-send links so owners can restore sharing without creating a new URL.

Changes:

  • Adds an owner-scoped POST /api/secure-sends/{id}/reactivate endpoint returning no content.
  • Clears revocation while preserving link settings and access history; rejects ineligible links.
  • Adds service and controller tests for reactivation and rejection behavior.
File Description
backend/​src/​test/​java/​cloudpage/​service/​SecureSendServiceTest.java Tests restored access, preserved settings, and rejected reactivations.
backend/​src/​test/​java/​cloudpage/​controller/​SecureSendControllerTest.java Tests current-owner delegation and the no-content response.
backend/​src/​main/​java/​cloudpage/​service/​SecureSendService.java Implements owner-scoped validation and clears revocation.
backend/​src/​main/​java/​cloudpage/​controller/​SecureSendController.java Exposes the reactivation endpoint.

Review effort: Balanced

assertThrows(
SecureSendUnavailableException.class, () -> service.resolve(created.token(), "secret", ""));

service.reactivate("owner-1", send.getId());

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agent review

Suggestion: approve. I did not find any high-confidence correctness, security, regression, or missing-test issues in this diff.

Generated by Pull Request Review for #196 · copilot · auto · 17.2 AIC · ⌖ 0.515 AIC · ⊞ 7.4K

@DenizAltunkapan
DenizAltunkapan force-pushed the feature/secure-send-reactivation branch from 0760276 to d3749bb Compare November 6, 2026 10:50

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agent review

Suggestion: approve. I did not find any high-confidence correctness, security, regression, or missing-test issues in this diff.

Generated by Pull Request Review for #196 · copilot · auto · 12.7 AIC · ⌖ 0.508 AIC · ⊞ 7.4K

@DenizAltunkapan
DenizAltunkapan merged commit 6ee13da into main Nov 6, 2026
8 checks passed
@DenizAltunkapan
DenizAltunkapan deleted the feature/secure-send-reactivation branch November 6, 2026 10:55
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.

2 participants