Skip to content

[Python] Add AwsSecret to the Secret utility - #40558

Open
shunping wants to merge 4 commits into
apache:masterfrom
shunping:secret-manager-9
Open

shunping wants to merge 4 commits into
apache:masterfrom
shunping:secret-manager-9

Conversation

@shunping

@shunping shunping commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Descriptipon

Adds AwsSecret to retrieve secrets from AWS Secrets Manager via Secret.from_json(spec, 'AwsSecretsManager') or Secret.parse_secret_option('type:awssecret;name:...').

Changes

  • AwsSecret: accepts secret_id/name/arn, version_id/version, version_stage/stage, plus any non-credential AwsOptions setting (e.g. region_name, endpoint_url) as a per-secret override.
  • Secret.apply_pipeline_options(options): passed from from_json() / parse_secret_option() (and --gbek). AwsSecret uses it to pull credentials and defaults from AwsOptions lazily on workers.
  • client_options: rejects AwsSecretsManager as --aws_credentials_secret_manager.

Part of #40528. Builds on #40547.

@codecov

codecov Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.95%. Comparing base (76f6e6d) to head (bc846b3).
⚠️ Report is 160 commits behind head on master.

Additional details and impacted files
@@              Coverage Diff              @@
##             master   #40558       +/-   ##
=============================================
+ Coverage     56.16%   79.95%   +23.78%     
=============================================
  Files          1124      488      -636     
  Lines        178336    82416    -95920     
  Branches       1489        0     -1489     
=============================================
- Hits         100170    65893    -34277     
+ Misses        75645    16523    -59122     
+ Partials       2521        0     -2521     
Flag Coverage Δ
go ?
java ?
python 79.95% <100.00%> (+0.39%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Read secrets from AWS Secrets Manager with
Secret.from_json(spec, 'AwsSecretsManager') or 'type:awssecret;name:...'.

Credentials and connection settings come from the --aws_* options,
passed through a new Secret.apply_pipeline_options() hook (also used for
--gbek). A spec can override non-credential settings such as
region_name or endpoint_url.
@shunping
shunping marked this pull request as ready for review October 14, 2026 03:40
@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @damccorm for label python.
Backup reviewer: claudevdm (if the main reviewer is unresponsive, you can escalate to them by tagging their username)

This pull request likely touches a core component ("core" label). Please review with scrutiny.

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant