Repository navigation
[Server] Serve OpenSharing's share API from Unity Catalog - #1
Draft
littlegrasscao wants to merge 3 commits into
Draft
littlegrasscao wants to merge 3 commits into
littlegrasscao wants to merge 3 commits into
Conversation
This was referenced Nov 7, 2026
littlegrasscao
force-pushed
the
sharing/provider-shares
branch
from
November 7, 2026 01:19
e83dae1 to
c0d1f16
Compare
littlegrasscao
force-pushed
the
sharing/connector
branch
2 times, most recently
from
November 8, 2026 00:02
0e9a704 to
191a789
Compare
littlegrasscao
force-pushed
the
sharing/provider-shares
branch
from
November 8, 2026 00:02
c0d1f16 to
24fdad2
Compare
littlegrasscao
force-pushed
the
sharing/connector
branch
from
November 9, 2026 20:09
191a789 to
aea5613
Compare
littlegrasscao
force-pushed
the
sharing/provider-shares
branch
2 times, most recently
from
November 9, 2026 23:10
85ec7f0 to
56656e6
Compare
littlegrasscao
force-pushed
the
sharing/connector
branch
2 times, most recently
from
November 9, 2026 23:19
cf91d2a to
9f202d8
Compare
littlegrasscao
force-pushed
the
sharing/provider-shares
branch
3 times, most recently
from
November 11, 2026 17:11
d070cdf to
f8dbeaf
Compare
littlegrasscao
force-pushed
the
sharing/connector
branch
from
November 11, 2026 17:11
9f202d8 to
d9b8c92
Compare
littlegrasscao
force-pushed
the
sharing/provider-shares
branch
from
November 11, 2026 18:22
f8dbeaf to
f89a689
Compare
littlegrasscao
force-pushed
the
sharing/connector
branch
from
November 11, 2026 23:57
d9b8c92 to
4666240
Compare
littlegrasscao
force-pushed
the
sharing/provider-shares
branch
from
November 11, 2026 23:57
f89a689 to
c63edbb
Compare
littlegrasscao
force-pushed
the
sharing/connector
branch
from
November 12, 2026 00:18
4666240 to
5dbf1c4
Compare
littlegrasscao
force-pushed
the
sharing/provider-shares
branch
2 times, most recently
from
November 12, 2026 02:34
428161b to
c921c28
Compare
littlegrasscao
force-pushed
the
sharing/connector
branch
from
November 12, 2026 05:46
2d07b6b to
cdd6fa7
Compare
littlegrasscao
force-pushed
the
sharing/provider-shares
branch
from
November 12, 2026 05:46
c921c28 to
4b19553
Compare
littlegrasscao
force-pushed
the
sharing/connector
branch
from
November 12, 2026 05:57
cdd6fa7 to
acd6905
Compare
littlegrasscao
force-pushed
the
sharing/provider-shares
branch
from
November 12, 2026 05:57
4b19553 to
61e2db2
Compare
littlegrasscao
force-pushed
the
sharing/connector
branch
from
November 16, 2026 22:00
acd6905 to
8daff29
Compare
littlegrasscao
force-pushed
the
sharing/provider-shares
branch
2 times, most recently
from
November 16, 2026 22:43
15c307b to
80d1cfb
Compare
littlegrasscao
force-pushed
the
sharing/connector
branch
from
November 17, 2026 00:04
5a8e6fe to
b24d132
Compare
littlegrasscao
force-pushed
the
sharing/provider-shares
branch
7 times, most recently
from
November 17, 2026 22:13
3c34540 to
8c978a6
Compare
OpenSharing's six tables (os_shares, os_share_properties, os_shared_data_objects, os_recipients, os_share_permissions and os_recipient_tokens) are Unity Catalog schema steps, V4 through V11, for H2, PostgreSQL and MySQL: one statement per step, the tables in foreign-key order, then the owner_id indexes. They are created whether or not embedded OpenSharing is enabled, and the steps build the schema Hibernate builds from OpenSharing's entities, which UC's own session factory now maps. Each step ships its H2 effect file; the PostgreSQL and MySQL ones follow from a run with Docker. HibernateTransactions runs OpenSharing's store work in sessions of that factory, and joins a transaction the thread already has, so a caller can make several OpenSharing calls and its own steps one unit of work. The schema migrator and the schema snapshot treat os_* tables as Unity Catalog's own, so the steps' index names are not blamed on another application and the snapshots see the tables the steps create. Signed-off-by: Sun Cao <sun.cao+data@databricks.com> Match OpenSharing 0.1.1's schema OpenSharing 0.1.1 stores ids as the database's native uuid (binary(16) on MySQL), its enums as plain varchar through converters, and names its foreign keys. The steps build the same columns, types and names its V1 does on each dialect, and the owner_id indexes its entities declare. Co-authored-by: Isaac <no-reply@databricks.com>
Shares and recipients become securable types, with CREATE SHARE, USE SHARE, CREATE RECIPIENT and USE RECIPIENT as privileges on the metastore. UC grants nothing on a share or recipient itself, so validation of grants, the authorization hierarchy and the OPA input treat them as roots, and the permissions API refuses them. The key mapper resolves a share or recipient by name from OpenSharing's tables, and answers a missing one with the NOT_FOUND that UC gives for any missing object, not OpenSharing's own exception. It reads those tables only when asked for such a key, which only OpenSharing's provider API, once enabled, produces. The result filter reads the ids of OpenSharing's share and recipient responses. Signed-off-by: Sun Cao <sun.cao+data@databricks.com> Read OpenSharing 0.1.1's UUID ids OpenSharing 0.1.1 keys its entities by UUID, so the OPA input and the key mapper look them up directly instead of by their string form, and the JSON still carries the string form. Co-authored-by: Isaac <no-reply@databricks.com>
With server.opensharing.enabled=true, the server serves OpenSharing's
provider API for shares at /api/2.1/unity-catalog/opensharing/provider,
behind UC's authentication and authorization. It is registered as the
OPENSHARING protocol of ArmeriaServerBuilder next to Iceberg and Delta,
with OpenSharing's JSON mapper and error dialect. UC records each
share's owner in its authorizer, in the same transaction as the share
itself. A share that does not exist is OpenSharing's 404 on these
routes. With the flag off, none of this is registered and none of
OpenSharing's tables is read or written.
A sharing docs page describes the provider API, its privileges, how
shared tables are read, and the database tables.
Signed-off-by: Sun Cao <sun.cao+data@databricks.com>
Consume OpenSharing 0.1.1 and support admin ownership transfers
The provider service answers with OpenSharing's JSON, so its methods
carry ProducesJson: without it Armeria found no response converter and
answered 500. The caller's context now says whether they own the
metastore, and PATCH /shares/{share} takes a catalog admin transferring
the ownership to the body's ownerId, on its own, with UC's owner record
moving to the new owner in the same transaction.
Co-authored-by: Isaac <no-reply@databricks.com>
littlegrasscao
force-pushed
the
sharing/connector
branch
from
November 17, 2026 22:42
b24d132 to
e5fdd23
Compare
littlegrasscao
force-pushed
the
sharing/provider-shares
branch
from
November 17, 2026 22:42
8c978a6 to
440d7c9
Compare
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.
Review copy of unitycatalog#2146, part 2 of 4 of embedded OpenSharing in Unity Catalog. It targets the previous PR's branch, so its diff shows only this part. It won't be merged here: the change merges through unitycatalog#2146, which has the full description and CI.
The four PRs, each building on the one before:
main, so it has no review copy.