iting0321 commented on code in PR #3750:
URL: https://github.com/apache/polaris/pull/3750#discussion_r2850963370


##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandler.java:
##########
@@ -598,15 +605,19 @@ public LoadTableResponse createTableStaged(
       EnumSet<AccessDelegationMode> delegationModes,
       Optional<String> refreshCredentialsEndpoint) {
 
+    // Authorize first with original delegation modes to initialize resolution 
manifest
     authorizeCreateTableStaged(namespace, request, delegationModes);
 
+    // Resolve the optimal delegation mode based on catalog capabilities 
(after authorization)
+    AccessDelegationMode resolvedMode = 
resolveAccessDelegationModes(delegationModes);

Review Comment:
   Thanks for catching this! I've changed 
`checkAllowExternalCatalogCredentialVending` to use 
   `resolvedMode`.
   
   I kept it as a separate call after authorization though the check must 
happen 
   **AFTER** authorization because `resolveAccessDelegationModes()` calls 
   `getResolvedCatalogEntity()`, which requires the resolution manifest to be 
   initialized by the authorization step first.
   
   Updated all three methods to follow this pattern. 



-- 
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]

Reply via email to