refactor(parameters): BaseProvider support for Uint8Array #1205
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of your changes
This PR introduces some changes to the typing in
BaseProvider
so that it's now able to handle, transform, or returnUint8Array
objects without necessarily coercing them tostring
.The change came from the fact that AWS Secrets Manager can return both
string
(when the secret is stored asSecretString
) and pure binaries akaUint8Array
(when the secret is stored asSecretBinary
).Consumers of the library should be able to both retrieve the latter and have them automatically transformed by the Parameters utility but also have them returned as-is (
Uint8Array
) in case they don't want to apply any transform.The PR enables the behavior described above.
The PR introduces also some light housekeeping around dependencies (switches from
@aws-sdk/util-base64-node
to@aws-sdk/util-base64
due to the former having being marked as being on a deprecation path) and the introduction of theDEFAULT_PROVIDERS
object which is required by the other providers.How to verify this change
See status checks under this PR.
Related issues, RFCs
Issue number: #1172
PR status
Is this ready for review?: YES
Is it a breaking change?: NO
Checklist
Breaking change checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.