Skip to content

server: add provider-admin recipient entities and CRUD - #98

Merged
littlegrasscao merged 4 commits into
mainfrom
server/split2/09-provider-recipients
Oct 21, 2026
Merged

littlegrasscao merged 4 commits into
mainfrom
server/split2/09-provider-recipients

Conversation

@littlegrasscao

@littlegrasscao littlegrasscao commented Sep 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • add RecipientEntity and RecipientTokenEntity persistence and the provider recipient API, served by RecipientAdminService:
    • POST /recipients, GET /recipients, GET /recipients/{recipient}, PATCH /recipients/{recipient}, DELETE /recipients/{recipient}
  • RecipientService.create calls catalog.authorize(CREATE_RECIPIENT); the catalog's userId becomes the owner, and only the owner may update or delete the recipient
  • names are stored lowercase and looked up in any case; deleting a recipient deletes its tokens
  • owner changes to a recipient load it with SELECT ... FOR UPDATE, so concurrent changes to one recipient run one at a time; an update that waits on a delete gets 404
  • creating a recipient issues a one-time activation code, and responses carry its activationUrl
  • activation links are built on a new required server.public-url setting, the address recipients reach the server at, rather than the address the provider's request arrived on, which can be internal to a proxy. The server fails to start without it, and it must be an http or https URL
  • reading recipients is not limited yet; TODOs mark where USE_RECIPIENT will apply

Testing

  • mvn clean install: 100 tests passed
  • RecipientServiceTest: creating a recipient requires CREATE_RECIPIENT from the catalog
  • RecipientAdminServiceTest: recipient CRUD over HTTP as the owner, case-insensitive gets, owner-only updates and deletes, and 401 without a token the catalog accepts
  • PublicUrlTest: startup fails without server.public-url, invalid values are rejected, and activation links use the public URL rather than the request address
  • TestServer sets server.public-url to its own address; OpenSharingServerTest and UnknownRouteTest set one so the server starts

@littlegrasscao
littlegrasscao force-pushed the server/split2/09-provider-recipients branch from 5aa09d2 to 66ec9b5 Compare September 18, 2026 00:12
@littlegrasscao
littlegrasscao marked this pull request as ready for review September 18, 2026 00:33
@littlegrasscao
littlegrasscao force-pushed the server/split2/09-provider-recipients branch 2 times, most recently from 294e667 to 960f905 Compare September 22, 2026 16:42
@littlegrasscao
littlegrasscao force-pushed the server/split2/09-provider-recipients branch from 960f905 to 75bcb6d Compare September 25, 2026 22:18
@littlegrasscao
littlegrasscao force-pushed the server/split2/09-provider-recipients branch from 75bcb6d to d236608 Compare September 25, 2026 22:27
@littlegrasscao
littlegrasscao force-pushed the server/split2/09-provider-recipients branch from d236608 to b172143 Compare September 25, 2026 22:32
@littlegrasscao
littlegrasscao force-pushed the server/split2/09-provider-recipients branch from b172143 to a1ec6a8 Compare September 25, 2026 22:37
@littlegrasscao
littlegrasscao requested a review from zhu-tom October 1, 2026 00:17
@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/09-provider-recipients branch from a1ec6a8 to 53e0056 Compare October 2, 2026 16:15
@littlegrasscao
littlegrasscao force-pushed the server/split2/09-provider-recipients branch from 53e0056 to 5477176 Compare October 2, 2026 16:40
@littlegrasscao
littlegrasscao force-pushed the server/split2/09-provider-recipients branch from 5477176 to 606cba6 Compare October 5, 2026 20:57
@littlegrasscao
littlegrasscao force-pushed the server/split2/09-provider-recipients branch from 606cba6 to be8d758 Compare October 5, 2026 21:25
@littlegrasscao
littlegrasscao force-pushed the server/split2/09-provider-recipients branch from be8d758 to e925253 Compare October 5, 2026 23:59
@littlegrasscao
littlegrasscao force-pushed the server/split2/09-provider-recipients branch from aa3ec7a to 4fb8356 Compare October 9, 2026 23:35
@littlegrasscao
littlegrasscao force-pushed the server/split2/09-provider-recipients branch from 4fb8356 to 372d96d Compare October 13, 2026 23:35
@littlegrasscao
littlegrasscao force-pushed the server/split2/09-provider-recipients branch 2 times, most recently from 0d3c637 to 52bedce Compare October 14, 2026 00:06
@littlegrasscao
littlegrasscao force-pushed the server/split2/09-provider-recipients branch from 52bedce to 1ced28e Compare October 14, 2026 00:56
@littlegrasscao
littlegrasscao force-pushed the server/split2/09-provider-recipients branch from 1ced28e to 7e1dbc0 Compare October 14, 2026 19:24
@littlegrasscao
littlegrasscao force-pushed the server/split2/09-provider-recipients branch from 7e1dbc0 to eed5e6a Compare October 15, 2026 16:46
@littlegrasscao
littlegrasscao force-pushed the server/split2/09-provider-recipients branch 2 times, most recently from 1258223 to 3700fcf Compare October 15, 2026 23:38
@littlegrasscao
littlegrasscao force-pushed the server/split2/09-provider-recipients branch from 3700fcf to e84e796 Compare October 16, 2026 00:40
@littlegrasscao
littlegrasscao force-pushed the server/split2/09-provider-recipients branch from e84e796 to 6fbf684 Compare October 19, 2026 17:12
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