Skip to content

server: redeem recipient activation URLs into a profile - #100

Merged
littlegrasscao merged 5 commits into
mainfrom
server/split2/11-recipient-activation
Oct 21, 2026
Merged

littlegrasscao merged 5 commits into
mainfrom
server/split2/11-recipient-activation

Conversation

@littlegrasscao

@littlegrasscao littlegrasscao commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • ActivationService redeems activation links: GET {activation.base-path}/{code}, with no provider token, turns a one-time activation code into a Delta Sharing profile file (shareCredentialsVersion, bearerToken, endpoint, expirationTime)
    • the bearer token is generated at redemption and stored only as a SHA-256 hash (TokenHashes); the token row is locked, so a concurrent redemption of the same code fails
    • an unknown, used, or expired code is 404 RESOURCE_DOES_NOT_EXIST; once the code is redeemed, the recipient's activationUrl is omitted
    • the profile's endpoint is server.public-url plus the new protocol.base-path (default /api/1.0/opensharing), not the address the activation request arrived on
  • tokenExpirationDays is required on create and must be positive; the token expires that many days after it is issued
  • POST /recipients/{recipient}/rotate-token issues a replacement token with a new activation URL. Existing tokens stop working immediately unless existingTokenExpireInSeconds sets a grace window. Owner only

Testing

  • mvn clean install: 112 tests passed
  • ActivationServiceTest: an unknown code is 404; redeeming a link returns the profile and stores only the token hash, and redeeming it again is 404
  • RecipientAdminServiceTest: create requires tokenExpirationDays and puts the expiration on the profile; rotation is owner-only, invalidates the old pending activation, requires a lifetime, and without a grace window expires the activated token immediately
  • ProfileEndpointTest: with server.public-url set to another address, the redeemed profile points at it
  • RecipientRotationConcurrencyTest: after 8 concurrent rotations of one recipient, exactly one returned activation URL can be redeemed
  • earlier tests that create recipients now send tokenExpirationDays

Stacked on #99.

@littlegrasscao
littlegrasscao marked this pull request as ready for review September 18, 2026 23:16
@littlegrasscao
littlegrasscao force-pushed the server/split2/11-recipient-activation branch from 7d19494 to 42ed727 Compare September 22, 2026 16:42
@littlegrasscao
littlegrasscao force-pushed the server/split2/11-recipient-activation branch from 42ed727 to dd93e92 Compare September 25, 2026 22:19
@littlegrasscao
littlegrasscao force-pushed the server/split2/11-recipient-activation branch from dd93e92 to d3d04ad Compare September 25, 2026 22:27
@littlegrasscao
littlegrasscao force-pushed the server/split2/11-recipient-activation branch from d3d04ad to 5aa6db2 Compare September 25, 2026 22:32
@littlegrasscao
littlegrasscao force-pushed the server/split2/11-recipient-activation branch from 5aa6db2 to dd5f143 Compare September 25, 2026 22:38
@littlegrasscao
littlegrasscao requested a review from zhu-tom October 1, 2026 00:18
@zhu-tom
zhu-tom added this pull request to stack #111 October 1, 2026 18:55
@littlegrasscao
littlegrasscao removed this pull request from stack #111 October 1, 2026 20:19
@littlegrasscao
littlegrasscao added this pull request to stack #112 October 1, 2026 20:20
@littlegrasscao
littlegrasscao force-pushed the server/split2/11-recipient-activation branch from dd5f143 to 378692d Compare October 2, 2026 16:16
@littlegrasscao
littlegrasscao force-pushed the server/split2/11-recipient-activation branch from 378692d to 420e233 Compare October 2, 2026 16:40
@littlegrasscao
littlegrasscao force-pushed the server/split2/11-recipient-activation branch from 420e233 to 666be9f Compare October 5, 2026 20:57
@littlegrasscao
littlegrasscao force-pushed the server/split2/11-recipient-activation branch from 666be9f to 9152783 Compare October 5, 2026 21:25
@littlegrasscao
littlegrasscao force-pushed the server/split2/11-recipient-activation branch from 9152783 to b12d3a8 Compare October 5, 2026 23:59
@littlegrasscao
littlegrasscao force-pushed the server/split2/11-recipient-activation branch from b12d3a8 to 746498e Compare October 6, 2026 00:06
@littlegrasscao
littlegrasscao force-pushed the server/split2/11-recipient-activation branch from 746498e to 5085ad9 Compare October 6, 2026 00:15
@littlegrasscao
littlegrasscao force-pushed the server/split2/11-recipient-activation branch from aab5443 to 93ebcea Compare October 13, 2026 23:55
@littlegrasscao
littlegrasscao force-pushed the server/split2/11-recipient-activation branch 4 times, most recently from dfb2522 to 6c1752f Compare October 14, 2026 00:42
@littlegrasscao
littlegrasscao force-pushed the server/split2/11-recipient-activation branch from 6c1752f to dbe4568 Compare October 14, 2026 00:56
@littlegrasscao
littlegrasscao force-pushed the server/split2/11-recipient-activation branch from dbe4568 to 3032ff4 Compare October 14, 2026 19:24
@littlegrasscao
littlegrasscao force-pushed the server/split2/11-recipient-activation branch from 3032ff4 to e4f917d Compare October 15, 2026 16:46
@littlegrasscao
littlegrasscao force-pushed the server/split2/11-recipient-activation branch from e4f917d to 847f241 Compare October 15, 2026 18:13
@littlegrasscao
littlegrasscao force-pushed the server/split2/11-recipient-activation branch from 847f241 to d75b5a4 Compare October 15, 2026 23:34
@littlegrasscao
littlegrasscao force-pushed the server/split2/11-recipient-activation branch from d75b5a4 to 85594a5 Compare October 15, 2026 23:38
@littlegrasscao
littlegrasscao force-pushed the server/split2/11-recipient-activation branch from 85594a5 to bdc29b0 Compare October 16, 2026 00:41
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