adutra commented on code in PR #18754: URL: https://github.com/apache/iceberg/pull/18754#discussion_r4511415310
########## core/src/main/java/org/apache/iceberg/rest/auth/BearerAuthConfig.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; + +import java.nio.file.Path; +import java.nio.file.Paths; +import java.time.Duration; +import java.time.format.DateTimeParseException; +import java.util.Map; +import javax.annotation.Nullable; +import org.apache.iceberg.relocated.com.google.common.base.MoreObjects; +import org.apache.iceberg.relocated.com.google.common.base.Preconditions; + +/** Configuration for the {@link BearerAuthManager}. */ +record BearerAuthConfig( Review Comment: It's a pure immutable value, and a record gives us final fields plus equals/hashCode for free. That matters here because `BearerAuthConfig` is used as a cache key. Records are already used in a few places, and the baseline is Java 17, so there is precedent. Also, here the record is package-private, so we are not committing anything to the public API. Happy to switch to a regular class if we'd rather not use them in core yet. -- 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]
