gh-yzou commented on code in PR #3729:
URL: https://github.com/apache/polaris/pull/3729#discussion_r2891530964
##########
polaris-core/src/main/java/org/apache/polaris/core/connection/iceberg/IcebergRestConnectionConfigInfoDpo.java:
##########
@@ -43,19 +43,31 @@
public class IcebergRestConnectionConfigInfoDpo extends ConnectionConfigInfoDpo
implements IcebergCatalogPropertiesProvider {
+ private static final String QUOTA_PROJECT_ID_HEADER_KEY =
"x-goog-user-project";
Review Comment:
Hi @PhillHenry is that config big lake specific as @XJDKC pointed out? if
yes, how about let's call it BIG_LAKE_QUOTA_PROJECT_ID_HEADER_KEY to be more
clear?
##########
polaris-core/src/main/java/org/apache/polaris/core/connection/iceberg/IcebergRestConnectionConfigInfoDpo.java:
##########
@@ -43,19 +43,31 @@
public class IcebergRestConnectionConfigInfoDpo extends ConnectionConfigInfoDpo
implements IcebergCatalogPropertiesProvider {
+ private static final String QUOTA_PROJECT_ID_HEADER_KEY =
"x-goog-user-project";
+
private final String remoteCatalogName;
+ @Nullable
+ public Map<String, String> getAdditionalHeaders() {
+ return additionalHeaders;
+ }
+
+ @Nullable private final Map<String, String> additionalHeaders;
+
public IcebergRestConnectionConfigInfoDpo(
@JsonProperty(value = "uri", required = true) @Nonnull String uri,
@JsonProperty(value = "authenticationParameters", required = true)
@Nonnull
AuthenticationParametersDpo authenticationParameters,
@JsonProperty(value = "serviceIdentity", required = false) @Nullable
ServiceIdentityInfoDpo serviceIdentityInfo,
@JsonProperty(value = "remoteCatalogName", required = false) @Nullable
- String remoteCatalogName) {
+ String remoteCatalogName,
+ @JsonProperty(value = "additionalHeaders", required = false) @Nullable
Review Comment:
instead of calling additionalHeaders, how about just cal it configs? which
can be used to put any catalog connection required configuration that is not
authentication related, which may or may not be a header.
##########
polaris-core/src/main/java/org/apache/polaris/core/connection/iceberg/IcebergRestConnectionConfigInfoDpo.java:
##########
@@ -43,19 +43,31 @@
public class IcebergRestConnectionConfigInfoDpo extends ConnectionConfigInfoDpo
implements IcebergCatalogPropertiesProvider {
+ private static final String QUOTA_PROJECT_ID_HEADER_KEY =
"x-goog-user-project";
+
private final String remoteCatalogName;
+ @Nullable
+ public Map<String, String> getAdditionalHeaders() {
+ return additionalHeaders;
+ }
+
+ @Nullable private final Map<String, String> additionalHeaders;
+
public IcebergRestConnectionConfigInfoDpo(
@JsonProperty(value = "uri", required = true) @Nonnull String uri,
@JsonProperty(value = "authenticationParameters", required = true)
@Nonnull
AuthenticationParametersDpo authenticationParameters,
@JsonProperty(value = "serviceIdentity", required = false) @Nullable
ServiceIdentityInfoDpo serviceIdentityInfo,
@JsonProperty(value = "remoteCatalogName", required = false) @Nullable
- String remoteCatalogName) {
+ String remoteCatalogName,
+ @JsonProperty(value = "additionalHeaders", required = false) @Nullable
Review Comment:
Let's add a comment about what is going into this fields?
##########
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:
@PhillHenry just to understand this part better, you mentioned that
GCP_CREDENTIALS_PATH_PROPERTY and GCP_SCOPES_PROPERTY can be added in a
different PR, so does that mean we do not need those information to connect to
big lake? or those information needs to be setup through env var when service
start?
--
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]