Skip to content

Commit

Permalink
fix(cli): CLI still fails for some plugins returning expiration: null
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rix0rrr committed Dec 27, 2024
1 parent 00db01f commit 1c53896
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 1c53896

Please sign in to comment.