dimas-b commented on code in PR #2974:
URL: https://github.com/apache/polaris/pull/2974#discussion_r2510760490
##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/io/AccessConfigProvider.java:
##########
@@ -91,14 +89,47 @@ public AccessConfig getAccessConfig(
.log("Table entity has no storage configuration in its hierarchy");
return AccessConfig.builder().supportsCredentialVending(false).build();
}
- return FileIOUtil.refreshAccessConfig(
- callContext,
- storageCredentialCache,
-
metaStoreManagerFactory.getOrCreateMetaStoreManager(callContext.getRealmContext()),
- tableIdentifier,
- tableLocations,
- storageActions,
- storageInfo.get(),
- refreshCredentialsEndpoint);
+ PolarisEntity storageInfoEntity = storageInfo.get();
+
+ boolean skipCredentialSubscopingIndirection =
+ storageCredentialsVendor
+ .getRealmConfig()
+
.getConfig(FeatureConfiguration.SKIP_CREDENTIAL_SUBSCOPING_INDIRECTION);
+ if (skipCredentialSubscopingIndirection) {
+ LOGGER
+ .atDebug()
+ .addKeyValue("tableIdentifier", tableIdentifier)
+ .log("Skipping generation of subscoped creds for table");
+ return AccessConfig.builder().build();
+ }
+
+ boolean allowList =
+ storageActions.contains(PolarisStorageActions.LIST)
+ || storageActions.contains(PolarisStorageActions.ALL);
+ Set<String> writeLocations =
+ storageActions.contains(PolarisStorageActions.WRITE)
+ || storageActions.contains(PolarisStorageActions.DELETE)
+ || storageActions.contains(PolarisStorageActions.ALL)
+ ? tableLocations
+ : Set.of();
+ AccessConfig accessConfig =
+ storageCredentialCache.getOrGenerateSubScopeCreds(
Review Comment:
Sure. A follow-up PR for this SGTM :+1:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]