[ 
https://issues.apache.org/jira/browse/HADOOP-19242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17878685#comment-17878685
 ] 

ASF GitHub Bot commented on HADOOP-19242:
-----------------------------------------

zhouaoe commented on code in PR #6967:
URL: https://github.com/apache/hadoop/pull/6967#discussion_r1740643379


##########
hadoop-tools/hadoop-aliyun/src/test/java/org/apache/hadoop/fs/aliyun/oss/TestAliyunOSSRedirect.java:
##########
@@ -0,0 +1,279 @@
+/**
+ * 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.hadoop.fs.aliyun.oss;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.math3.analysis.function.Log;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FSDataInputStream;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.fs.contract.ContractTestUtils;
+import org.apache.hadoop.fs.impl.prefetch.ExceptionAsserts;
+import org.apache.hadoop.io.IOUtils;
+import org.apache.hadoop.util.VersionInfo;
+import org.apache.hadoop.fs.FileStatus;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.internal.AssumptionViolatedException;
+import org.junit.rules.Timeout;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xbill.DNS.tools.primary;
+
+import com.aliyun.oss.ClientConfiguration;
+import com.aliyun.oss.OSSClient;
+import com.aliyun.oss.OSSException;
+import com.aliyun.oss.common.auth.CredentialsProvider;
+import com.aliyun.oss.common.comm.Protocol;
+import com.aliyun.oss.model.BucketWebsiteResult;
+import com.aliyun.oss.model.CannedAccessControlList;
+import com.aliyun.oss.model.RoutingRule;
+import com.aliyun.oss.model.SetBucketWebsiteRequest;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Random;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
+import static org.apache.hadoop.fs.aliyun.oss.Constants.*;
+import static org.hamcrest.CoreMatchers.nullValue;
+
+import com.aliyun.oss.ClientException;
+
+/**
+ * Tests basic functionality for AliyunOSSInputStream, including seeking and
+ * reading files.
+ */
+public class TestAliyunOSSRedirect {

Review Comment:
   > Is this really trying to talk to the store?
   
   This case will access the OSS storage layer for real(This test checks the 
redirection behavior of Aliyun OSS. When the redirection feature is available, 
it will access the redirected target file.). but, it does not call seeking. The 
comment is inaccurate; I will rephrase it.    





> AliyunOSS: Add a feature to disable redirection for the OSS connector.
> ----------------------------------------------------------------------
>
>                 Key: HADOOP-19242
>                 URL: https://issues.apache.org/jira/browse/HADOOP-19242
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: fs/oss
>    Affects Versions: 3.1.0, 3.3.2
>            Reporter: zhouao
>            Priority: Major
>              Labels: pull-request-available
>
> For security reasons, some users of the OSS connector wish to disable the 
> connector's HTTP redirection functionality. The OSS Java SDK have the 
> capability to turn off HTTP redirection, but the configuration is not exposed 
> in the {{core-site.xml}} file. This change primarily involves adding a flag 
> to disable HTTP redirection in the {{core-site.xml}} file



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to