Skip to content

Commit

Permalink
fix(cli): cli still fails for some plugins returning `expiration: nul…
Browse files Browse the repository at this point in the history
…l` (#32668)

There is one more location where we need to convert `null` into `undefined` if a plugin provider returns `expiration: null`. The SDKv3 code base also expects this value to be `undefined | Date`, just like our own code does; when the plugin returns `null` we pass the value over to the SDKv3 which then does a `getTime()` on the value, and then it crashes.

Issue this fix as a patch, so that we can unblock users of a commonly used plugin at Amazon.

This is a PR targeting `v2-release`, picking exactly one line from #32111. After merging this we can patch-release.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
rix0rrr authored Dec 27, 2024
1 parent 00db01f commit 4da2f65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/aws-cdk/lib/api/aws-auth/credential-plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function v3ProviderFromV2Credentials(x: SDKv2CompatibleCredentials): AwsCredenti
accessKeyId: x.accessKeyId,
secretAccessKey: x.secretAccessKey,
sessionToken: x.sessionToken,
expiration: x.expireTime,
expiration: x.expireTime ?? undefined,
};
};
}
Expand Down

0 comments on commit 4da2f65

Please sign in to comment.