[Java] Support dynamic secret provider registration via SecretRegistrar - #39940
Open
shunping wants to merge 1 commit into
Open
[Java] Support dynamic secret provider registration via SecretRegistrar#39940shunping wants to merge 1 commit into
shunping wants to merge 1 commit into
Conversation
shunping
force-pushed
the
secret-manager-4
branch
3 times, most recently
from
September 1, 2026 16:05
2f5bde7 to
47e95fd
Compare
shunping
marked this pull request as ready for review
September 1, 2026 16:13
Collaborator
Author
|
r: @Abacn |
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 |
Abacn
reviewed
Sep 1, 2026
Follow the FileSystems registration pattern by introducing SecretRegistrar SPI and auto-service discovery in Secret.java. This eliminates hardcoded secret provider logic in Secret.java and allows modular extension for new secret managers.
shunping
force-pushed
the
secret-manager-4
branch
from
September 1, 2026 19:53
47e95fd to
e2a5e59
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #39940 +/- ##
=========================================
Coverage 58.37% 58.38%
- Complexity 13491 13500 +9
=========================================
Files 2568 2571 +3
Lines 268743 268751 +8
Branches 11029 11032 +3
=========================================
+ Hits 156888 156898 +10
- Misses 105904 105905 +1
+ Partials 5951 5948 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Previously,
Secret.javahad hardcoded switch statements and factory calls for specific secret managers (such as Google Cloud Secret Manager and HSM-generated secrets). Supporting a new secret manager required directly modifying Secret.java.This PR refactors
Secretto follow Apache Beam's standard Service Provider Interface (SPI) pattern (similar toFileSystems/FileSystemRegistrar). It allows secret providers to register dynamically at runtime viaServiceLoaderand@AutoService, decoupling the core Secret management from specific provider implementations.