[ https://issues.apache.org/jira/browse/HADOOP-18498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17637363#comment-17637363 ]
ASF GitHub Bot commented on HADOOP-18498: ----------------------------------------- steveloughran commented on code in PR #5136: URL: https://github.com/apache/hadoop/pull/5136#discussion_r1029603628 ########## hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/extensions/MockWithPrefixSASTokenProvider.java: ########## @@ -0,0 +1,46 @@ +/** + * 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 +<<<<<<< HEAD Review Comment: you need to cut the <<< === >>> lines ########## hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/extensions/MockWithPrefixSASTokenProvider.java: ########## @@ -0,0 +1,46 @@ +/** + * 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 +<<<<<<< HEAD + * + * http://www.apache.org/licenses/LICENSE-2.0 + * +======= + * <p> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p> +>>>>>>> f24ab617430d69d1350ba6f5f624c59123e72a25 + * 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.hadoop.fs.azurebfs.extensions; + +import java.io.IOException; + +public class MockWithPrefixSASTokenProvider extends MockSASTokenProvider { + + /** + * Function to return an already generated SAS Token with a '?' prefix + * @param accountName the name of the storage account. + * @param fileSystem the name of the fileSystem. + * @param path the file or directory path. + * @param operation the operation to be performed on the path. + * @return + * @throws IOException + */ + @Override + public String getSASToken(String accountName, String fileSystem, String path, + String operation) throws IOException { + String token = super.getSASToken(accountName, fileSystem, path, operation); + return "?"+token; Review Comment: nit: add some spaces for checkstyle > [ABFS]: Error introduced when SAS Token containing '?' prefix is passed > ----------------------------------------------------------------------- > > Key: HADOOP-18498 > URL: https://issues.apache.org/jira/browse/HADOOP-18498 > Project: Hadoop Common > Issue Type: Bug > Components: fs/azure > Reporter: Sree Bhattacharyya > Assignee: Sree Bhattacharyya > Priority: Minor > Labels: pull-request-available > > Error Description: > At present, SAS Tokens generated from the Azure Portal may or may not contain > a ? as a prefix. SAS Tokens that contain the ? prefix will lead to an error > in the driver due to a clash of query parameters. This leads to customers > having to manually remove the ? prefix before passing the SAS Tokens. > Mitigation: > After receiving the SAS Token from the provider, check if any prefix ? is > present or not. If present, remove it and pass the SAS Token. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org