Skip to content

feat: adapt secret resolver for customization#217

Open
betinacosta wants to merge 9 commits into
feat/new-secret-resolverfrom
feat/adapt-secret-resolver-for-custumization
Open

feat: adapt secret resolver for customization#217
betinacosta wants to merge 9 commits into
feat/new-secret-resolverfrom
feat/adapt-secret-resolver-for-custumization

Conversation

@betinacosta

@betinacosta betinacosta commented Jul 8, 2026

Copy link
Copy Markdown
Member

Description

This is the first of a series of PRs. I started by doing changes to secret resolver. I tested the changes using the destination module, but I will only modify the modules usage of secret resolver later.

Refactors the secret resolver module to expose a composable, class-based API alongside the existing legacy function. Users can now wire a custom resolver chain once at application startup via configure(SdkConfig(resolver=...)) and all create_client() calls across modules will use it automatically. The built-in MountResolver and EnvVarResolver classes implement the Resolver protocol, and ChainedResolver tries each in order — providing a clear extension point for custom sources (e.g. VCAP_SERVICES, HashiCorp Vault).

The legacy read_from_mount_and_fallback_to_env_var function is preserved for backwards compatibility. Internally it now delegates to the same MountResolver/EnvVarResolver implementations.

Related Issue

Closes #

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Dependency update

How to Test

Run the unit test suite: pytest tests/core/unit/secret_resolver/

Checklist

  • I have read the Contributing Guidelines
  • I have verified that my changes solve the issue
  • I have added/updated automated tests to cover my changes
  • All tests pass locally
  • I have verified that my code follows the Code Guidelines
  • I have updated documentation (if applicable)
  • I have added type hints for all public APIs
  • My code does not contain sensitive information (credentials, tokens, etc.)
  • I have followed Conventional Commits for commit messages

@betinacosta betinacosta requested a review from a team as a code owner July 8, 2026 18:38

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The idea is to remove this file later, when all modules start using the new secret resolver

@betinacosta betinacosta marked this pull request as draft July 8, 2026 18:44
@betinacosta betinacosta marked this pull request as ready for review July 9, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant