Skip to content

server: add provider-admin share entities and CRUD - #96

Merged
littlegrasscao merged 3 commits into
mainfrom
server/split2/07-provider-shares
Oct 21, 2026
Merged

littlegrasscao merged 3 commits into
mainfrom
server/split2/07-provider-shares

Conversation

@littlegrasscao

@littlegrasscao littlegrasscao commented Sep 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • add ShareEntity persistence with Hibernate (JpaTransactions) and the provider share API under provider.base-path (default /api/1.0/opensharing/provider), served by ShareAdminService on Armeria:
    • POST /shares, GET /shares, GET /shares/{share}, PATCH /shares/{share}, DELETE /shares/{share}
  • ProviderTokenDecorator authenticates every provider request by calling CatalogConnector.authorize with the bearer token and no privilege. A missing token, or one the catalog cannot authenticate, is 401 UNAUTHENTICATED
  • ShareService.create calls catalog.authorize(CREATE_SHARE); the catalog's userId becomes the share owner, and only the owner may update or delete the share; Ownership.check denies a missing owner or user id
  • owner changes to a share load it with SELECT ... FOR UPDATE, so concurrent changes to one share run one at a time and each sees what the one before it wrote; an update that waits on a delete gets 404
  • the local catalog file lists the principals it accepts; OpenSharing keeps no principal table
  • shared objects and recipient grants are not in this PR

Testing

  • mvn clean install: 82 tests passed
  • ShareServiceTest: creating a share requires CREATE_SHARE from the catalog
  • OwnershipTest: only the owner passes the owner check, and a missing owner or user id never matches
  • ProviderTokenDecoratorTest: a missing token never reaches the catalog, a token the catalog cannot authenticate is 401, other catalog failures are 502, and the authenticated caller reaches the service
  • ShareAdminServiceTest: share CRUD over HTTP, duplicate and invalid names, partial updates, owner-only deletes, and 404 for missing shares

@littlegrasscao
littlegrasscao force-pushed the server/split2/07-provider-shares branch from 70271a3 to 71c8d30 Compare September 16, 2026 21:53
@littlegrasscao
littlegrasscao marked this pull request as ready for review September 16, 2026 22:24
@littlegrasscao
littlegrasscao force-pushed the server/split2/07-provider-shares branch from 8832768 to 623b1fa Compare September 22, 2026 16:42
@littlegrasscao
littlegrasscao force-pushed the server/split2/07-provider-shares branch from d478fe2 to dc10dd2 Compare September 25, 2026 22:27
@littlegrasscao
littlegrasscao force-pushed the server/split2/07-provider-shares branch from dc10dd2 to 259348c Compare September 25, 2026 22:32
@littlegrasscao
littlegrasscao force-pushed the server/split2/07-provider-shares branch from 259348c to c34e978 Compare September 25, 2026 22:37
@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/07-provider-shares branch from c34e978 to 30b98ab Compare October 2, 2026 16:10
@littlegrasscao
littlegrasscao force-pushed the server/split2/07-provider-shares branch from 30b98ab to b7d3a2e Compare October 2, 2026 16:40
@littlegrasscao
littlegrasscao force-pushed the server/split2/07-provider-shares branch from 974e2e8 to 9c50952 Compare October 5, 2026 21:25
@littlegrasscao
littlegrasscao force-pushed the server/split2/07-provider-shares branch from 9c50952 to c6bce2a Compare October 5, 2026 23:58
@littlegrasscao
littlegrasscao force-pushed the server/split2/07-provider-shares branch from c6bce2a to eda1652 Compare October 6, 2026 00:05
@littlegrasscao
littlegrasscao force-pushed the server/split2/07-provider-shares branch from eda1652 to 724a4b9 Compare October 6, 2026 00:14
@littlegrasscao
littlegrasscao force-pushed the server/split2/07-provider-shares branch from aa23cc9 to a55d577 Compare October 13, 2026 22:37
@littlegrasscao
littlegrasscao force-pushed the server/split2/07-provider-shares branch from a55d577 to 21f4d6e Compare October 13, 2026 22:40
@littlegrasscao
littlegrasscao force-pushed the server/split2/07-provider-shares branch from 21f4d6e to e50801a Compare October 13, 2026 22:44
@littlegrasscao
littlegrasscao force-pushed the server/split2/07-provider-shares branch 3 times, most recently from ece0aa4 to 26a1486 Compare October 13, 2026 23:27
@littlegrasscao
littlegrasscao force-pushed the server/split2/07-provider-shares branch from 26a1486 to d813775 Compare October 14, 2026 00:56
@littlegrasscao
littlegrasscao force-pushed the server/split2/07-provider-shares branch from d813775 to e2d1d47 Compare October 14, 2026 19:24
@littlegrasscao
littlegrasscao force-pushed the server/split2/07-provider-shares branch from e2d1d47 to c24f7b7 Compare October 19, 2026 17:12
@littlegrasscao
littlegrasscao force-pushed the server/split2/07-provider-shares branch from 684d02a to 0e69c53 Compare October 19, 2026 22:30
Base automatically changed from server/split2/05-http-errors to main October 19, 2026 22:31
@littlegrasscao
littlegrasscao force-pushed the server/split2/07-provider-shares branch from 0e69c53 to 2df60b3 Compare October 19, 2026 22:31
Comment thread server/opensharing-server-core/src/main/java/io/opensharing/auth/UserContext.java Outdated
Comment thread server/opensharing-server-core/src/main/java/io/opensharing/share/ShareStore.java Outdated
Comment thread server/opensharing-server-core/src/main/java/io/opensharing/share/ShareStore.java Outdated
Comment thread server/opensharing-server-core/src/main/java/io/opensharing/share/ShareStore.java Outdated
Comment thread server/opensharing-server-core/src/main/java/io/opensharing/share/ShareStore.java Outdated
Comment thread server/opensharing-server-core/src/main/java/io/opensharing/share/ShareStore.java Outdated
@littlegrasscao
littlegrasscao merged commit 56e330f into main Oct 21, 2026
1 check passed
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.

3 participants