Skip to content

HADOOP-16568. S3A FullCredentialsTokenBinding fails if local credentials are unset #1441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
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;
Expand Down Expand Up @@ -73,7 +75,6 @@ public FullCredentialsTokenBinding() {
@Override
protected void serviceStart() throws Exception {
super.serviceStart();
loadAWSCredentials();
}

/**
Expand Down Expand Up @@ -116,6 +117,7 @@ private void loadAWSCredentials() throws IOException {
@Override
public AWSCredentialProviderList deployUnbonded() throws IOException {
requireServiceStarted();
loadAWSCredentials();
return new AWSCredentialProviderList(
"Full Credentials Token Binding",
new MarshalledCredentialProvider(
Expand All @@ -142,7 +144,8 @@ public AbstractS3ATokenIdentifier createTokenIdentifier(
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,
Expand Down