Skip to content

Commit 4da2f65

Browse files
authored
fix(cli): cli still fails for some plugins returning expiration: null (#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*
1 parent 00db01f commit 4da2f65

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/aws-cdk/lib/api/aws-auth/credential-plugins.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ function v3ProviderFromV2Credentials(x: SDKv2CompatibleCredentials): AwsCredenti
140140
accessKeyId: x.accessKeyId,
141141
secretAccessKey: x.secretAccessKey,
142142
sessionToken: x.sessionToken,
143-
expiration: x.expireTime,
143+
expiration: x.expireTime ?? undefined,
144144
};
145145
};
146146
}

0 commit comments

Comments
 (0)