jerryshao commented on code in PR #5682:
URL: https://github.com/apache/gravitino/pull/5682#discussion_r1891672936


##########
core/src/main/java/org/apache/gravitino/catalog/CredentialManager.java:
##########
@@ -38,16 +39,19 @@ public CredentialManager(
   }
 
   public List<Credential> getCredentials(NameIdentifier identifier) {
+    CredentialPrivilege privilege =
+        getCredentialPrivilege(PrincipalUtils.getCurrentUserName(), 
identifier);
     return doWithCatalog(
         NameIdentifierUtil.getCatalogIdentifier(identifier),
-        c -> getCredentials(c.catalog(), identifier),
+        catalogWrapper ->
+            catalogWrapper.doWithCredentialOps(
+                credentialOps -> credentialOps.getCredentials(identifier, 
privilege)),
         NoSuchCatalogException.class);
   }
 
-  private List<Credential> getCredentials(BaseCatalog catalog, NameIdentifier 
identifier) {
-    throw new NotImplementedException(
-        String.format(
-            "Load credentials is not implemented for catalog: %s, identifier: 
%s",
-            catalog.name(), identifier));
+  @SuppressWarnings("UnusedVariable")
+  private CredentialPrivilege getCredentialPrivilege(String user, 
NameIdentifier identifier)
+      throws NotAuthorizedException {
+    return CredentialPrivilege.WRITE;

Review Comment:
   Besides, do we need a `CredentialManager`, or is the class name proper?  
Basically, my feeling is that it manages nothing, just a dispatcher.



-- 
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: commits-unsubscr...@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to