yuqi1129 commented on code in PR #8777:
URL: https://github.com/apache/gravitino/pull/8777#discussion_r2541667567


##########
catalogs/catalog-fileset/src/main/java/org/apache/gravitino/catalog/fileset/authentication/UserContext.java:
##########
@@ -63,50 +64,20 @@ public static void cleanAllUserContext() {
   }
 
   public static UserContext getUserContext(
-      NameIdentifier nameIdentifier,
-      Map<String, String> properties,
-      Configuration configuration,
-      CatalogInfo catalogInfo) {
-    // Try to get the parent user context.
-    NameIdentifier currentNameIdentifier = 
NameIdentifier.of(nameIdentifier.namespace().levels());
-    UserContext parentContext = null;
-    while (!currentNameIdentifier.namespace().isEmpty()) {
-      if (userContextMap.containsKey(currentNameIdentifier)) {
-        parentContext = userContextMap.get(currentNameIdentifier);
-        break;
-      }
-      currentNameIdentifier = 
NameIdentifier.of(currentNameIdentifier.namespace().levels());
-    }
-
-    if (configuration == null) {
-      configuration = new Configuration();
-    }
-    AuthenticationConfig authenticationConfig = new 
AuthenticationConfig(properties);
+      NameIdentifier nameIdentifier, Map<String, String> properties, 
CatalogInfo catalogInfo) {
+    Configuration configuration = 
FileSystemUtils.createConfiguration(GRAVITINO_BYPASS, properties);
+    AuthenticationConfig authenticationConfig = new 
AuthenticationConfig(properties, configuration);
 
     // If we do not set the impersonation, we will use the parent context;
     boolean enableUserImpersonation = 
ENABLE_IMPERSONATION_ENTRY.getDefaultValue();
     if (properties.containsKey(IMPERSONATION_ENABLE_KEY)) {
       enableUserImpersonation = authenticationConfig.isImpersonationEnabled();
-    } else if (parentContext != null) {
-      enableUserImpersonation = parentContext.enableUserImpersonation();
     }
 
     AuthenticationType authenticationType =

Review Comment:
   @jerqi 
   What do you mean here?  



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