nastra commented on code in PR #11577: URL: https://github.com/apache/iceberg/pull/11577#discussion_r1957988027
########## azure/src/main/java/org/apache/iceberg/azure/adlsv2/AzureSasCredentialRefresher.java: ########## @@ -0,0 +1,69 @@ +/* + * 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.azure.adlsv2; + +import com.azure.core.credential.AzureSasCredential; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; +import org.apache.iceberg.util.Pair; + +class AzureSasCredentialRefresher { + private final Supplier<Pair<String, Long>> sasTokenWithExpirationSupplier; Review Comment: for 1 I would say it is up to us on how we use the refreshed token. After all, we'd use the `SimpleTokenCache` really only for the refresh part (which is currently being done manually). for 2 I don't think we need to inject anything. The idea was to use the `SimpleTokenCache` for the refresh handling and then create the SAS credential from the SAS token string that was returned by the server. The same approach is currently being done in the PR, where the server returns a SAS token as a string and you're then creating the `AzureSasCredential`. -- 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]
