polyzos commented on code in PR #2947: URL: https://github.com/apache/fluss/pull/2947#discussion_r3009902823
########## fluss-filesystems/fluss-fs-azure/src/test/java/org/apache/fluss/fs/azure/AbfsFileSystemDelegationTokenITCase.java: ########## @@ -0,0 +1,99 @@ +/* + * 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.fluss.fs.azure; + +import org.apache.fluss.config.Configuration; +import org.apache.fluss.fs.FileSystem; +import org.apache.fluss.fs.FileSystemBehaviorTestSuite; +import org.apache.fluss.fs.FsPath; +import org.apache.fluss.fs.azure.token.AbfsDelegationTokenReceiver; +import org.apache.fluss.fs.azure.token.AzureDelegationTokenReceiver; +import org.apache.fluss.fs.token.Credentials; +import org.apache.fluss.fs.token.CredentialsJsonSerde; +import org.apache.fluss.fs.token.ObtainedSecurityToken; + +import org.apache.commons.lang3.reflect.FieldUtils; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; + +import java.io.IOException; +import java.net.URI; +import java.util.HashMap; +import java.util.Map; + +/** + * Tests that validate the Azure File System Plugin initializes correctly via the delegation token + * path — i.e., when no {@code fs.azure.account.key} is configured and the client receives an OAuth + * token from the server instead. This is the code path exercised by Fluss clients reading KV + * snapshots from remote Azure storage. + */ +class AbfsFileSystemDelegationTokenITCase extends FileSystemBehaviorTestSuite { + + private static final String ABFS_FS_PATH = "abfs://[email protected]/test"; Review Comment: i assume here you meant to have fluss://? ########## fluss-filesystems/fluss-fs-azure/src/main/java/org/apache/fluss/fs/azure/token/AzureDelegationTokenReceiver.java: ########## @@ -56,6 +56,11 @@ public static void updateHadoopConfig(org.apache.hadoop.conf.Configuration hadoo LOG.debug("Provider already exists"); } + // Tell the ABFS driver to use the custom token provider instead of defaulting to SharedKey. + // DynamicTemporaryAzureCredentialsProvider implements CustomTokenProviderAdaptee, which + // requires auth.type=Custom to be activated. + hadoopConfig.set("fs.azure.account.auth.type", "Custom"); Review Comment: `auth.type` is set before the additionInfos null guard -- 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]
