Skip to content
Open
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
6 changes: 6 additions & 0 deletions src/auth/defaultawssecuritycredentialssupplier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@
metadataHeaders,
context.transporter,
);
if (awsCreds == null || awsCreds.AccessKeyId == null || awsCreds.SecretAccessKey == null || awsCreds.Token == null) {

Check failure on line 178 in src/auth/defaultawssecuritycredentialssupplier.ts

View workflow job for this annotation

GitHub Actions / lint

Expected '===' and instead saw '=='

Check failure on line 178 in src/auth/defaultawssecuritycredentialssupplier.ts

View workflow job for this annotation

GitHub Actions / lint

Expected '===' and instead saw '=='

Check failure on line 178 in src/auth/defaultawssecuritycredentialssupplier.ts

View workflow job for this annotation

GitHub Actions / lint

Expected '===' and instead saw '=='

Check failure on line 178 in src/auth/defaultawssecuritycredentialssupplier.ts

View workflow job for this annotation

GitHub Actions / lint

Expected '===' and instead saw '=='

Check failure on line 178 in src/auth/defaultawssecuritycredentialssupplier.ts

View workflow job for this annotation

GitHub Actions / lint

Replace `awsCreds·==·null·||·awsCreds.AccessKeyId·==·null·||·awsCreds.SecretAccessKey·==·null·||·awsCreds.Token·==·null` with `⏎······awsCreds·==·null·||⏎······awsCreds.AccessKeyId·==·null·||⏎······awsCreds.SecretAccessKey·==·null·||⏎······awsCreds.Token·==·null⏎····`
throw new Error("Retrieved invalid aws credentials, expected fields `AccessKeyId`, `SecretAccessKey` and `Token` to be non-null but one or more are null.");

Check warning on line 179 in src/auth/defaultawssecuritycredentialssupplier.ts

View workflow job for this annotation

GitHub Actions / lint

Strings must use singlequote

Check failure on line 179 in src/auth/defaultawssecuritycredentialssupplier.ts

View workflow job for this annotation

GitHub Actions / lint

Replace `"Retrieved·invalid·aws·credentials,·expected·fields·`AccessKeyId`,·`SecretAccessKey`·and·`Token`·to·be·non-null·but·one·or·more·are·null."` with `⏎········'Retrieved·invalid·aws·credentials,·expected·fields·`AccessKeyId`,·`SecretAccessKey`·and·`Token`·to·be·non-null·but·one·or·more·are·null.',⏎······`
}
return {
accessKeyId: awsCreds.AccessKeyId,
secretAccessKey: awsCreds.SecretAccessKey,
Expand Down Expand Up @@ -243,6 +246,9 @@
...this.additionalGaxiosOptions,
url: `${this.securityCredentialsUrl}/${roleName}`,
headers: headers,
// NOTE: Do not remove this. AWS returns `Content-Type: text/plain` even though
// the response is a json, so it is necessary to have this.
responseType: 'json'

Check failure on line 251 in src/auth/defaultawssecuritycredentialssupplier.ts

View workflow job for this annotation

GitHub Actions / lint

Insert `,`
} as GaxiosOptions;
AuthClient.setMethodName(opts, '#retrieveAwsSecurityCredentials');
const response =
Expand Down
Loading