You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a07216e
Browse filesBrowse the repository at this point in the historyBrowse files
Iceberg connector consumer for the per-user REST session feature:
- IcebergConnectorProperties + IcebergRestMetaStoreProperties: iceberg.rest.session
(none|user) + iceberg.rest.oauth2.delegated-token-mode (access_token|token_exchange)
+ optional session-timeout, with validation (session=user requires
security.type=oauth2; relax the "oauth2 requires static token/credential" rule for
user-session, whose identity is the per-request user token).
- IcebergDelegatedCredentialUtils + IcebergSessionCatalogAdapter: bridge the neutral
ConnectorDelegatedCredential to an iceberg SessionCatalog.SessionContext (access_token
= verbatim OAuth2 bearer; token_exchange = the typed token-type key) over a SINGLE
shared RESTSessionCatalog. delegatedCatalog/delegatedViewCatalog fail closed on a
tokenless session=user request (never borrow a shared identity).
- IcebergConnector: build a RESTSessionCatalog for a session=user REST catalog;
newCatalogBackedOps(session) routes per-request metadata through the querying user's
delegated catalog; declare SUPPORTS_USER_SESSION only for that config.
- scan/write/procedure providers take a Function<ConnectorSession, IcebergCatalogOps>
resolver (connector passes this::newCatalogBackedOps); the legacy ops constructors
bind a constant s->ops so existing tests/behaviour stay byte-identical. This makes
SELECT / INSERT-DELETE-MERGE / ALTER TABLE ... EXECUTE run per-user. The write COMMIT
was already per-user (IcebergConnectorTransaction is opened by beginTransaction over
the session-aware metadata ops).
Tests: IcebergProviderSessionRoutingTest (each provider resolves ops with the call
session + fail-closed), IcebergSessionCatalogAdapterTest (credential-key mapping per
mode + fail-closed + fromString), IcebergConnectorValidatePropertiesTest (+session
validation). IcebergConnectorTest/IcebergProcedureOpsTest adjusted for the resolver
constructor (reflection reads catalogOpsResolver; a bare-null ctor arg is cast).
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013KKXx3btbQc6w3MbZbEoRf
Copy file name to clipboardExpand all lines: fe/fe-connector/fe-connector-iceberg/src/main/java/org/apache/doris/connector/iceberg/IcebergCatalogOps.java
+30-7Lines changed: 30 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -197,6 +197,11 @@ class CatalogBackedIcebergCatalogOps implements IcebergCatalogOps {
Copy file name to clipboardExpand all lines: fe/fe-connector/fe-connector-iceberg/src/main/java/org/apache/doris/connector/iceberg/IcebergConnector.java
+112-5Lines changed: 112 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -44,9 +44,12 @@
44
44
importorg.apache.iceberg.CatalogProperties;
45
45
importorg.apache.iceberg.CatalogUtil;
46
46
importorg.apache.iceberg.catalog.Catalog;
47
+
importorg.apache.iceberg.catalog.SessionCatalog;
47
48
importorg.apache.iceberg.catalog.TableIdentifier;
49
+
importorg.apache.iceberg.catalog.ViewCatalog;
48
50
importorg.apache.iceberg.io.FileIO;
49
51
importorg.apache.iceberg.rest.RESTCatalog;
52
+
importorg.apache.iceberg.rest.RESTSessionCatalog;
50
53
importorg.apache.iceberg.util.ThreadPools;
51
54
importorg.apache.logging.log4j.LogManager;
52
55
importorg.apache.logging.log4j.Logger;
@@ -141,6 +144,11 @@ public class IcebergConnector implements Connector {
141
144
privatefinalMap<String, String> properties;
142
145
privatefinalConnectorContextcontext;
143
146
privatevolatileCatalogicebergCatalog;
147
+
// Session-aware REST catalog + adapter, built ONLY for a REST catalog configured iceberg.rest.session=user
148
+
// (#63068). The RESTSessionCatalog is a SINGLE shared instance; per-request asCatalog(ctx)/asViewCatalog(ctx)
149
+
// (through the adapter) attach the querying user's delegated credential. Both null for every other catalog.
Copy file name to clipboardExpand all lines: fe/fe-connector/fe-connector-iceberg/src/main/java/org/apache/doris/connector/iceberg/IcebergConnectorProperties.java
0 commit comments