Skip to content

Commit

Permalink
Revert " fix(provider/aws): ensure STSAssumeRoleSessionCredentialsPro…
Browse files Browse the repository at this point in the history
…vider get the right endpoint (spinnaker#1888)"

This reverts commit 828fbb7.
  • Loading branch information
danielpeach committed Sep 18, 2017
1 parent a6f0e45 commit 3bd52d4
Showing 1 changed file with 2 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,20 @@
package com.netflix.spinnaker.clouddriver.aws.security;

import com.amazonaws.auth.AWSCredentialsProvider;
import com.amazonaws.auth.AWSSessionCredentials;
import com.amazonaws.auth.AWSSessionCredentialsProvider;
import com.amazonaws.auth.STSAssumeRoleSessionCredentialsProvider;
import com.amazonaws.services.securitytoken.AWSSecurityTokenService;
import com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient;

public class NetflixSTSAssumeRoleSessionCredentialsProvider implements AWSSessionCredentialsProvider {
private final STSAssumeRoleSessionCredentialsProvider delegate;
public class NetflixSTSAssumeRoleSessionCredentialsProvider extends STSAssumeRoleSessionCredentialsProvider {
private final String accountId;


public NetflixSTSAssumeRoleSessionCredentialsProvider(AWSCredentialsProvider longLivedCredentialsProvider,
String roleArn,
String roleSessionName,
String accountId) {
super(longLivedCredentialsProvider, roleArn, roleSessionName);
this.accountId = accountId;
AWSSecurityTokenService stsClient = AWSSecurityTokenServiceClient.builder().withCredentials(longLivedCredentialsProvider).build();
delegate = new STSAssumeRoleSessionCredentialsProvider.Builder(roleArn, roleSessionName).withStsClient(stsClient).build();
}

public String getAccountId() {
return accountId;
}

@Override
public AWSSessionCredentials getCredentials() {
return delegate.getCredentials();
}

@Override
public void refresh() {
delegate.refresh();
}
}

0 comments on commit 3bd52d4

Please sign in to comment.