Skip to content

[python] Add Secret management module in apache_beam.utils.secret - #39636

Open
shunping wants to merge 11 commits into
apache:masterfrom
shunping:secret-manager-1
Open

[python] Add Secret management module in apache_beam.utils.secret#39636
shunping wants to merge 11 commits into
apache:masterfrom
shunping:secret-manager-1

Conversation

@shunping

@shunping shunping commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Description

Introduces apache_beam.utils.secret to centralize secret management in the Python SDK.

Changes:

  • Derived a new Secret base class and implementations (RawSecret, GcpSecret, and GcpHsmGeneratedSecret) from the existing secret classes defined in util.py used by GBEK.
  • Added factory methods Secret.from_spec() and Secret.from_option_string().
  • Re-exported classes in apache_beam.transforms.util for backwards compatibility.
  • Added unit tests in secret_test.py and updated util_test.py.

….secret

* Add `Secret` base class with shared caching (`get`, `get_bytes`) and pickling protection.
* Implement `RawSecret`, `GcpSecret`, and `GcpHsmGeneratedSecret` secret providers.
* Add factory methods (`from_spec`, `from_option_string`) and unit test suite in `utils/secret_test.py`.
@github-actions github-actions Bot added the python label Aug 5, 2026
Comment thread sdks/python/apache_beam/utils/secret.py Dismissed
Comment thread sdks/python/apache_beam/utils/secret.py Dismissed
@shunping

shunping commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

r: @damccorm

@shunping
shunping marked this pull request as ready for review August 5, 2026 19:31
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment assign set of reviewers

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants