Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(parameters): BaseProvider support for Uint8Array #1205

Merged
merged 2 commits into from
Dec 29, 2022

Conversation

dreamorosi
Copy link
Contributor

Description of your changes

This PR introduces some changes to the typing in BaseProvider so that it's now able to handle, transform, or return Uint8Array objects without necessarily coercing them to string.

The change came from the fact that AWS Secrets Manager can return both string (when the secret is stored as SecretString) and pure binaries aka Uint8Array (when the secret is stored as SecretBinary).

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 the DEFAULT_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

  • My changes meet the tenets criteria
  • I have performed a self-review of my own code
  • I have commented my code where necessary, particularly in areas that should be flagged with a TODO, or hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding changes to the examples
  • My changes generate no new warnings
  • The code coverage hasn't decreased
  • I have added tests that prove my change is effective and works
  • New and existing unit tests pass locally and in Github Actions
  • Any dependent changes have been merged and published
  • The PR title follows the conventional commit semantics

Breaking change checklist

  • I have documented the migration process
  • I have added, implemented necessary warnings (if it can live side by side)

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

@dreamorosi dreamorosi self-assigned this Dec 29, 2022
@pull-request-size pull-request-size bot added the size/L PRs between 100-499 LOC label Dec 29, 2022
@dreamorosi dreamorosi changed the title refactor(parameters): BaseProvider refactor(parameters): BaseProvider support for Uint8Array Dec 29, 2022
@github-actions github-actions bot added the feature PRs that introduce new features or minor changes label Dec 29, 2022
@dreamorosi dreamorosi linked an issue Dec 29, 2022 that may be closed by this pull request
2 tasks
@dreamorosi
Copy link
Contributor Author

Given that at this time only DynamoDBProvider, SSMProvider, and SecretsProvider return types are fairly clear, we'll leave the linked issue open after merging this PR, as there might be some additional refactoring needed.

@dreamorosi dreamorosi added the parameters This item relates to the Parameters Utility label Dec 29, 2022
@dreamorosi dreamorosi merged commit 63eeab4 into main Dec 29, 2022
@dreamorosi dreamorosi deleted the refactor/parameters/baseprovider branch December 29, 2022 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature PRs that introduce new features or minor changes parameters This item relates to the Parameters Utility size/L PRs between 100-499 LOC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maintenance: Revisit return types of BaseProvider
1 participant