-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[Feature] Implement user identity impersonation for the Iceberg REST catalog using the OIDC token + Iceberg token exchange flow #57443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| return icebergCatalog.tableExists(context, dbName, tblName); | ||
| } | ||
|
|
||
| @Override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The most risky bug in this code is:
Inconsistent Use of ConnectContext in alterView
You can modify the code like this:
Database db = getDb(context, stmt.getDbName());| return new SessionCatalog.SessionContext(sessionId, context.getQualifiedUser(), credentials, ImmutableMap.of(), | ||
| context.getCurrentUserIdentity()); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The most risky bug in this code is:
The convertContext method overwrites credentials in a way that might not include required keys if context.getAuthToken() is non-empty, potentially breaking authentication.
You can modify the code like this:
private SessionCatalog.SessionContext convertContext(ConnectContext context) {
String sessionId = format("%s-%s", context.getQualifiedUser(), context.getSessionId());
Map<String, String> baseCredentials = Maps.filterKeys(securityProperties.get(), key -> Set.of(TOKEN, CREDENTIAL).contains(key));
Map<String, String> credentials;
if (Strings.isNullOrEmpty(context.getAuthToken())) {
credentials = baseCredentials;
} else {
credentials = ImmutableMap.<String, String>builder()
.putAll(baseCredentials)
.put(OAuth2Properties.ACCESS_TOKEN_TYPE, context.getAuthToken())
.build();
}
return new SessionCatalog.SessionContext(sessionId, context.getQualifiedUser(), credentials, ImmutableMap.of(),
context.getCurrentUserIdentity());
}
|
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]✅ pass : 107 / 126 (84.92%) file detail
|
[BE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
Why I'm doing:
##57024
Implement user identity impersonation for the Iceberg REST catalog using the OIDC token + Iceberg token exchange flow.
I have already conducted tests using OKTA + Nessie.
example:
What I'm doing:
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: