feat: add retry credentials to all modules using binding - #332
Open
NicoleMGomes wants to merge 9 commits into
Open
NicoleMGomes wants to merge 9 commits into
NicoleMGomes wants to merge 9 commits into
Conversation
NicoleMGomes
force-pushed
the
feat/retry-all-modules
branch
from
September 14, 2026 13:18
233e0f7 to
212c7d1
Compare
NicoleMGomes
marked this pull request as ready for review
September 14, 2026 13:34
NicoleMGomes
force-pushed
the
feat/retry-all-modules
branch
from
September 14, 2026 13:57
0f81fed to
5642779
Compare
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.
Description
Adds binding rotation support to all SDK modules that read credentials from BTP service bindings (volume mounts or environment variables). When a BTP binding rotates at runtime, long-lived clients previously held stale credentials and would fail until the application was restarted. This change makes every module resilient to secret rotation without requiring a restart or client recreation.
Two resilience layers are applied consistently across all affected modules:
ConfigFactory.has_changed()checks whether the secret directory mtime has changed. If so, credentials are re-read and any cached tokens or sessions are discarded.InvalidAccessKeyIdorSignatureDoesNotMatchS3 error, credentials are refreshed and the failed operation is retried once.Modules updated:
objectstore,print,adms,dms,auditlog.All changes are backward-compatible. The
config=explicit parameter path continues to work on allcreate_clientfunctions; callers using explicit config simply do not get rotation tracking.Type of Change
How to Test
tests/objectstore/unit/test_s3_client.py::TestRotationtests/print/unit/test_http.py::TestTokenProviderRotationtests/adms/unit/test_ias_fetcher.py::TestIasTokenFetcherRotationtests/dms/unit/test_auth.py::TestAuthRotationtests/core/unit/auditlog/unit/test_http_transport.py::TestHttpTransportRotationuvx pre-commit run --all-filesChecklist
Additional Notes
The rotation pattern is now documented in
docs/GUIDELINES.mdunder "Credential Binding Rotation" and is enforced by the code review skill. Any future module that reads from service bindings should follow the same pattern: accept aConfigFactoryon the auto-detection path, implement_refresh_if_rotated(), and include the four standard rotation test cases (proactive, reactive, no-rebuild, static config).Internal note:
ObjectStoreClient.__init__now accepts aConfigFactory[ObjectStoreBindingData]instead of a plainObjectStoreBindingData. This is not a public API break sinceObjectStoreClientis intended to be constructed viacreate_client(), but any code directly instantiatingObjectStoreClientwill need to wrap the config in a factory callable.