Skip to content

Commit 2c5d4b2

Browse files
committed
test(credential-provider-imds): verify IMDS credentials without accountId
1 parent fb0362d commit 2c5d4b2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/credential-provider-imds/src/remoteProvider/ImdsCredentials.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ const creds: ImdsCredentials = Object.freeze({
1313
describe("isImdsCredentials", () => {
1414
it("should accept valid ImdsCredentials objects", () => {
1515
expect(isImdsCredentials(creds)).toBe(true);
16+
const { AccountId, ...credsWithoutAccountId } = creds;
17+
expect(isImdsCredentials(credsWithoutAccountId)).toBe(true);
1618
});
1719

1820
it("should reject credentials without an AccessKeyId", () => {
@@ -61,6 +63,6 @@ describe("fromImdsCredentials", () => {
6163
expect(converted.secretAccessKey).toEqual(credsWithoutAccountId.SecretAccessKey);
6264
expect(converted.sessionToken).toEqual(credsWithoutAccountId.Token);
6365
expect(converted.expiration).toEqual(new Date(credsWithoutAccountId.Expiration));
64-
expect(converted).not.toHaveProperty('accountId'); // Verify accountId is not included
66+
expect(converted).not.toHaveProperty("accountId"); // Verify accountId is not included
6567
});
66-
});
68+
});

0 commit comments

Comments
 (0)