diff --git a/packages/credential-provider-imds/src/remoteProvider/ImdsCredentials.spec.ts b/packages/credential-provider-imds/src/remoteProvider/ImdsCredentials.spec.ts index 4dd6899798e..072123c77e9 100644 --- a/packages/credential-provider-imds/src/remoteProvider/ImdsCredentials.spec.ts +++ b/packages/credential-provider-imds/src/remoteProvider/ImdsCredentials.spec.ts @@ -48,8 +48,6 @@ describe("fromImdsCredentials", () => { expect(converted.accessKeyId).toEqual(creds.AccessKeyId); expect(converted.secretAccessKey).toEqual(creds.SecretAccessKey); expect(converted.sessionToken).toEqual(creds.Token); - expect(converted.expiration).toEqual( - Math.floor(new Date(creds.Expiration).valueOf() / 1000) - ); + expect(converted.expiration).toEqual(new Date(creds.Expiration)); }); }); diff --git a/packages/credential-provider-imds/src/remoteProvider/ImdsCredentials.ts b/packages/credential-provider-imds/src/remoteProvider/ImdsCredentials.ts index 1bdd48d5b67..f3798c0be29 100644 --- a/packages/credential-provider-imds/src/remoteProvider/ImdsCredentials.ts +++ b/packages/credential-provider-imds/src/remoteProvider/ImdsCredentials.ts @@ -23,6 +23,6 @@ export function fromImdsCredentials(creds: ImdsCredentials): Credentials { accessKeyId: creds.AccessKeyId, secretAccessKey: creds.SecretAccessKey, sessionToken: creds.Token, - expiration: Math.floor(new Date(creds.Expiration).valueOf() / 1000) + expiration: new Date(creds.Expiration) }; }