XJDKC commented on code in PR #3729:
URL: https://github.com/apache/polaris/pull/3729#discussion_r2893431586


##########
polaris-core/src/main/java/org/apache/polaris/core/connection/GcpAuthenticationParametersDpo.java:
##########
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.polaris.core.connection;
+
+import jakarta.annotation.Nonnull;
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.iceberg.rest.auth.AuthProperties;
+import org.apache.polaris.core.admin.model.AuthenticationParameters;
+import org.apache.polaris.core.admin.model.GcpAuthenticationParameters;
+import org.apache.polaris.core.credentials.PolarisCredentialManager;
+
+/**
+ * See {@link org.apache.iceberg.rest.RESTUtil#configHeaders(Map)} and {@link
+ * org.apache.iceberg.rest.auth.AuthManagers#loadAuthManager(String, Map)} for 
why we do this.
+ */
+public class GcpAuthenticationParametersDpo extends 
AuthenticationParametersDpo {
+
+  public GcpAuthenticationParametersDpo() {
+    super(AuthenticationType.GCP.getCode());
+  }
+
+  @Nonnull
+  @Override
+  public Map<String, String> asIcebergCatalogProperties(
+      PolarisCredentialManager credentialManager) {
+    HashMap<String, String> properties = new HashMap<>();

Review Comment:
   I think we can support both approaches.
   
   For users who just want to use Polaris to experiment with GCP, they can rely 
on inferring credentials from environment variables.
   
   For production-level catalog federation, the catalog vendor should properly 
configure the credentials instead of relying on environment variables (e.g., 
they need to get the credentials from a secret manager)
   
   For AWS SigV4, we use a service identity provider to supply the AWS 
credentials, and each realm has its own credential:
   
[DefaultServiceIdentityProvider.java](https://github.com/apache/polaris/blob/main/runtime/service/src/main/java/org/apache/polaris/service/identity/provider/DefaultServiceIdentityProvider.java)
   
[AwsIamServiceIdentityCredential.java](https://github.com/apache/polaris/blob/main/polaris-core/src/main/java/org/apache/polaris/core/identity/credential/AwsIamServiceIdentityCredential.java)
   
[AwsIamServiceIdentityConfiguration.java](https://github.com/apache/polaris/blob/main/runtime/service/src/main/java/org/apache/polaris/service/identity/AwsIamServiceIdentityConfiguration.java)



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