Skip to content
Permalink
Browse files
JENKINS-14470: S3 Plugin switches credential profiles
  • Loading branch information
Jimilian committed May 20, 2016
1 parent 1ebc49d commit 8e9d9228bcfbbfaeb0bce23cdbe08240941fba4c
Showing 1 changed file with 8 additions and 3 deletions.
@@ -33,16 +33,21 @@

protected synchronized TransferManager getTransferManager()
{
if (transferManagers.get(region) == null) {
final String uniqueKey = getUniqueKey();
if (transferManagers.get(uniqueKey) == null) {
final AmazonS3 client = ClientHelper.createClient(accessKey, Secret.toString(secretKey), useRole, region, proxy);
transferManagers.put(region, new TransferManager(client));
transferManagers.put(uniqueKey, new TransferManager(client));
}

return transferManagers.get(region);
return transferManagers.get(uniqueKey);
}

@Override
public void checkRoles(RoleChecker roleChecker) throws SecurityException {

}

private String getUniqueKey() {
return region + '_' + secretKey + '_' + accessKey + '_' + useRole;
}
}

0 comments on commit 8e9d922

Please sign in to comment.