You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by st...@apache.org on 2020/06/03 16:07:12 UTC
[hadoop] branch trunk updated: HADOOP-16568. S3A
FullCredentialsTokenBinding fails if local credentials are unset. (#1441)
This is an automated email from the ASF dual-hosted git repository.
stevel pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new 40d63e0 HADOOP-16568. S3A FullCredentialsTokenBinding fails if local credentials are unset. (#1441)
40d63e0 is described below
commit 40d63e02f04fb7477e25dd8ef4533da27a4229e3
Author: Steve Loughran <st...@cloudera.com>
AuthorDate: Wed Jun 3 17:07:00 2020 +0100
HADOOP-16568. S3A FullCredentialsTokenBinding fails if local credentials are unset. (#1441)
Contributed by Steve Loughran.
Move the loading to deployUnbonded (where they are required) and add a safety check when a new DT is requested
---
.../hadoop/fs/s3a/auth/delegation/FullCredentialsTokenBinding.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/auth/delegation/FullCredentialsTokenBinding.java b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/auth/delegation/FullCredentialsTokenBinding.java
index d80e780..8df6664 100644
--- a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/auth/delegation/FullCredentialsTokenBinding.java
+++ b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/auth/delegation/FullCredentialsTokenBinding.java
@@ -22,6 +22,8 @@ import java.io.IOException;
import java.net.URI;
import java.util.Optional;
+import com.google.common.base.Preconditions;
+
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.s3a.AWSCredentialProviderList;
import org.apache.hadoop.fs.s3a.S3AUtils;
@@ -73,7 +75,6 @@ public class FullCredentialsTokenBinding extends
@Override
protected void serviceStart() throws Exception {
super.serviceStart();
- loadAWSCredentials();
}
/**
@@ -116,6 +117,7 @@ public class FullCredentialsTokenBinding extends
@Override
public AWSCredentialProviderList deployUnbonded() throws IOException {
requireServiceStarted();
+ loadAWSCredentials();
return new AWSCredentialProviderList(
"Full Credentials Token Binding",
new MarshalledCredentialProvider(
@@ -142,7 +144,8 @@ public class FullCredentialsTokenBinding extends
final EncryptionSecrets encryptionSecrets,
final Text renewer) throws IOException {
requireServiceStarted();
-
+ Preconditions.checkNotNull(
+ awsCredentials, "No AWS credentials to use for a delegation token");
return new FullCredentialsTokenIdentifier(getCanonicalUri(),
getOwnerText(),
renewer,
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org