aws / aws-sdk-js-v3

Modularized AWS SDK for JavaScript.
Apache License 2.0
2.96k stars 556 forks source link

don't overwrite defaulted config #6166

Open batzz-00 opened 3 weeks ago

batzz-00 commented 3 weeks ago

Issue

Issue number, if available, prefixed with "#"

Description

What does this implement/fix? Explain your changes. The documentation for the credentials option would lead you to think an explicit undefined or omitting the option would use the default credential provider, the current implementation only works for the latter scenario. Explicitly passing undefined uses the default provider in v2.

In the scenario that a user provides credentials: undefined in the config object, because it is spread at the end of the object, the defaulted properties are overwritten

Testing

How was this change tested?

Additional context

Add any other context about the PR here.

Checklist


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.