Skip to content

Commit d115595

Browse files
authored
HADOOP-19282. STSClientFactory: do not use URIBuilder (#7966)
URIBuilder was used from the AWS SDK for Java v2, from the shaded Apache HTTP Client. It is a problem if a user would like not to use the AWS SDK bundle, since more or less only 3 modules are needed (s3, s3-transfer & sts), but that may cause problems on unshaded dependency versions. Since a URI constructor can achieve the same here I switched it as a preferred option. Contributed by Lapshin Dmitry
1 parent 1272a01 commit d115595

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/auth/STSClientFactory.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import software.amazon.awssdk.services.sts.model.AssumeRoleRequest;
3636
import software.amazon.awssdk.services.sts.model.Credentials;
3737
import software.amazon.awssdk.services.sts.model.GetSessionTokenRequest;
38-
import software.amazon.awssdk.thirdparty.org.apache.http.client.utils.URIBuilder;
3938
import org.apache.hadoop.fs.s3a.impl.AWSClientConfig;
4039
import org.apache.hadoop.util.Preconditions;
4140

@@ -167,7 +166,7 @@ public static StsClientBuilder builder(final AwsCredentialsProvider credentials,
167166
*/
168167
private static URI getSTSEndpoint(String endpoint) {
169168
try {
170-
return new URIBuilder().setScheme("https").setHost(endpoint).build();
169+
return new URI("https", endpoint, null, null);
171170
} catch (URISyntaxException e) {
172171
throw new IllegalArgumentException(e);
173172
}

0 commit comments

Comments
 (0)