Skip to content

fix(parameters): return only requested secret names - #8621

Merged
leandrodamascena merged 2 commits into
aws-powertools:developfrom
hiyouwhatsapp:fix/exact-secret-name-results
Oct 22, 2026
Merged

leandrodamascena merged 2 commits into
aws-powertools:developfrom
hiyouwhatsapp:fix/exact-secret-name-results

Conversation

@hiyouwhatsapp

Copy link
Copy Markdown
Contributor

Issue number: closes #8592

Summary

Changes

Filter the batch response to an exact-name set before extracting values, transforming results, or caching. The existing name-filter request and pagination remain unchanged.

Add six regression cases covering string and binary values, prefix collisions, cached and forced reads, a prefix-only page before an exact match, JSON transformation, and no exact matches.

User experience

With secrets db, db-password, and db2, requesting ["db"] now returns only db on both fresh and cached reads. Unrequested prefix matches cannot cause transformation errors.

Validation

Verified commit: a8278e0c626e26c10a7d128667cd02b704ebf599.

  • Unchanged quality workflow: passed on Python 3.10–3.14; 3,848 tests plus 10 performance tests per version, mypy, ty, and all 15 Nox dependency sessions. Formatting, lint, security and complexity baselines passed.
  • Supplementary contribution checks: documentation lint and pre-commit hooks on both changed files passed, with no resulting source changes.
  • Dependency Review: passed after enabling the fork's dependency graph.
  • All six new regression cases failed on the original implementation.

Verification-only workflows are on separate fork branches and are not included here.


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

@hiyouwhatsapp
hiyouwhatsapp requested a review from a team as a code owner October 18, 2026 17:50
@hiyouwhatsapp
hiyouwhatsapp requested a review from svozza October 18, 2026 17:50
@boring-cyborg

boring-cyborg Bot commented Oct 18, 2026

Copy link
Copy Markdown

Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link

@boring-cyborg boring-cyborg Bot added the tests label Oct 18, 2026
@powertools-for-aws-oss-automation powertools-for-aws-oss-automation Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 18, 2026
@leandrodamascena leandrodamascena added this to the 3.38.0 milestone Oct 19, 2026

@leandrodamascena leandrodamascena left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @hiyouwhatsapp! I ran the suite and also tested this against real Secrets Manager with db, db-password and db2: develop returns all three for ["db"] on the first call and only db from the cache, your branch returns only db both times. Pagination, the Errors path and transform="json" all behave, and keeping the same API request was the right call.

Approving now. This goes out in 3.38.0, so it will sit here a bit before I merge. No need to rebase or touch anything, I'll take care of it and you'll get the credit in the release notes. Thank you!

@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.93%. Comparing base (246aa01) to head (e2a7105).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #8621   +/-   ##
========================================
  Coverage    96.93%   96.93%           
========================================
  Files          318      318           
  Lines        16072    16075    +3     
  Branches      1435     1436    +1     
========================================
+ Hits         15580    15583    +3     
  Misses         349      349           
  Partials       143      143           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud

Copy link
Copy Markdown

@leandrodamascena
leandrodamascena merged commit 46eb971 into aws-powertools:develop Oct 22, 2026
14 checks passed
@boring-cyborg

boring-cyborg Bot commented Oct 22, 2026

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience!

@powertools-for-aws-oss-automation

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: get_secrets_by_name returns secrets that were not requested, and a different result once cached

2 participants