danielcweeks commented on code in PR #15703:
URL: https://github.com/apache/iceberg/pull/15703#discussion_r3693325358


##########
core/src/main/java/org/apache/iceberg/rest/auth/oauth2/ConfigUtil.java:
##########
@@ -0,0 +1,108 @@
+/*
+ * 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.iceberg.rest.auth.oauth2;
+
+import com.nimbusds.oauth2.sdk.GrantType;
+import com.nimbusds.oauth2.sdk.auth.ClientAuthenticationMethod;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.OptionalInt;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import javax.annotation.Nullable;
+import org.apache.iceberg.relocated.com.google.common.base.Splitter;
+
+/**
+ * Helper class for parsing configuration options. It also exposes useful 
constants for config
+ * validation.
+ */
+final class ConfigUtil {
+
+  public static final List<GrantType> SUPPORTED_GRANT_TYPES =
+      List.of(GrantType.CLIENT_CREDENTIALS, GrantType.TOKEN_EXCHANGE, 
GrantType.REFRESH_TOKEN);
+
+  public static final List<GrantType> SUPPORTED_INITIAL_GRANT_TYPES =
+      List.of(GrantType.CLIENT_CREDENTIALS, GrantType.TOKEN_EXCHANGE);
+
+  public static final List<ClientAuthenticationMethod> 
SUPPORTED_CLIENT_AUTH_METHODS =
+      List.of(
+          ClientAuthenticationMethod.NONE,
+          ClientAuthenticationMethod.CLIENT_SECRET_BASIC,
+          ClientAuthenticationMethod.CLIENT_SECRET_POST);
+
+  /**
+   * A sentinel value used to indicate that the parent session's token should 
be used. This is
+   * useful for the token exchange flow.
+   */
+  public static final String PARENT_TOKEN = "::parent::";

Review Comment:
   This sentinel has me concerned because I don't see the context in which it 
would be used.  At this point I would have to assume I understand and agree 
with how it will be used, but I don't.  I'd rather leave things like this out 
and introduce them only when they're used so it makes sense in context of the 
introduced changes.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to