SS-441 Add OAUTH2 SERVER URL option to Iceberg catalog connections to support Unity Catalog - #38373
Open
patrickwwbutler wants to merge 1 commit into
Open
SS-441 Add OAUTH2 SERVER URL option to Iceberg catalog connections to support Unity Catalog#38373patrickwwbutler wants to merge 1 commit into
patrickwwbutler wants to merge 1 commit into
Conversation
REST catalog connections that authenticate with CREDENTIAL exchange it for a bearer token at the endpoint the Iceberg REST specification derives from the catalog URL, `<url>/v1/oauth/tokens`. Not every catalog serves that endpoint. Databricks Unity Catalog, for one, routes its whole `/api/` surface through an auth gateway that requires a bearer token on every request, so the exchange returns 401 rather than issuing the first token. Its token endpoint lives at `/oidc/v1/token` on the workspace root instead. OAUTH2 SERVER URL points the exchange at an explicit endpoint, which makes those catalogs reachable. Omitted, the derived endpoint is used exactly as before, so existing connections are unaffected. The option is rejected on s3tablesrest catalogs, which authenticate with SigV4 through an AWS connection and perform no OAuth exchange, and alongside GCP CONNECTION, which supplies its own bearer token. `iceberg-rust` already reads the corresponding `oauth2-server-uri` catalog property and posts the client-credentials grant as form parameters, which is the shape Databricks expects, so this is a connection-option change only. Adds a parser round-trip case in the sql-parser datadriven tests and test/iceberg/oauth2-server-url.td, a plan-time test covering the accepted form, the s3tablesrest rejection, and the unchanged default. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
REST catalog connections that authenticate with
CREDENTIALexchange it for a bearer token at the endpoint the Iceberg REST specification derives from the catalog URL,<url>/v1/oauth/tokens. Not every catalog serves that endpoint.Databricks Unity Catalog is the motivating case. It routes its whole
/api/surface through an auth gateway that requires a bearer token on every request, so posting a client-credentials grant to the derived endpoint returns:That is self-defeating for an endpoint whose job is to issue the first token. Unity Catalog's token endpoint lives at
/oidc/v1/tokenon the workspace root instead, outside/api/.OAUTH2 SERVER URLpoints the exchange at an explicit endpoint:Omitted, the derived endpoint is used exactly as before, so existing connections are unaffected.
The option is rejected on
s3tablesrestcatalogs, which authenticate with SigV4 through an AWS connection and perform no OAuth exchange, and alongsideGCP CONNECTION, which supplies its own bearer token.This is a connection-option change only.
iceberg-rustalready reads the correspondingoauth2-server-uricatalog property, and its OAuth2 provider posts the client-credentials grant as form parameters rather than HTTP Basic, which is the shape Databricks expects.Tests
Adds a parser round-trip case to the
sql-parserdatadriven tests, andtest/iceberg/oauth2-server-url.tdwith aworkflow_oauth2_server_urlcovering the accepted form, thes3tablesrestrejection, and the unchanged default. Both are plan-time only and need no Iceberg backend.Known gap
Connecting to Unity Catalog end to end also needs catalog-vended storage credentials, since Unity Catalog vends temporary credentials rather than exposing bucket keys. That is the follow-up PR stacked on top of this one.
Separately,
iceberg-rust'sOAuth2TokenProvidercaches the token for the lifetime of the catalog object and never consultsexpires_in, and the REST client has no 401-invalidate-and-retry path. With Databricks' 3600s tokens, a long-running sink will start getting 401s after an hour and recover only by stalling and restarting the dataflow. Worth fixing in the fork before this is used in anger.Release notes
This release will add an
OAUTH2 SERVER URLoption toCREATE CONNECTION ... TO ICEBERG CATALOG, allowing REST catalogs whose OAuth2 token endpoint is not at the specification-derived location to be used.🤖 Generated with Claude Code