Skip to content

Commit

Permalink
Update src/auth/awsclient.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Bankhead <dan@danielbankhead.com>
  • Loading branch information
lsirac and danielbankhead authored Nov 23, 2022
1 parent f5267fc commit 6a0abb7
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/auth/awsclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,21 +356,19 @@ export class AwsClient extends BaseExternalAccountClient {
return process.env['AWS_REGION'] || process.env['AWS_DEFAULT_REGION'];
}

private get securityCredentialsFromEnvironment():
| AwsSecurityCredentialsFromEnvironment
| undefined {
let awsSecurityCredentials;
// Check if both AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are available.
private get securityCredentialsFromEnv(): AwsSecurityCredentials | null {
// Both AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are required.
if (
process.env['AWS_ACCESS_KEY_ID'] &&
process.env['AWS_SECRET_ACCESS_KEY']
) {
awsSecurityCredentials = {
return {
accessKeyId: process.env['AWS_ACCESS_KEY_ID'],
secretAccessKey: process.env['AWS_SECRET_ACCESS_KEY'],
token: process.env['AWS_SESSION_TOKEN'],
};
}
return awsSecurityCredentials;

return null;
}
}

0 comments on commit 6a0abb7

Please sign in to comment.