feat(destination, agent-memory, core): support binding rotation in HTTP clients - #290
Draft
cassiofariasmachado wants to merge 3 commits into
Draft
feat(destination, agent-memory, core): support binding rotation in HTTP clients#290cassiofariasmachado wants to merge 3 commits into
cassiofariasmachado wants to merge 3 commits into
Conversation
…n in HTTP clients
cassiofariasmachado
marked this pull request as draft
August 27, 2026 15:43
cassiofariasmachado
force-pushed
the
refactor/support-binding-rotation-in-clients
branch
from
August 27, 2026 16:29
c64beee to
b85c7cb
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
Introduces a shared
HttpClient+XsuaaAuthProviderlayer incore/that all service module transports compose. Solves a silent failure mode where long-lived clients hold frozen credentials — after a BTP secret rotation the old token expires and every call fails with 401 until the client is re-instantiated.Two layers of rotation resilience:
ConfigFactory.has_changed()checks the binding directory mtime before serving each cached token; on change it evicts the full token cache and re-reads credentials immediately.HttpClient.requestinvalidates the token cache entry and retries once on any 401 response.Migrates both
destinationandagent_memorymodules to composeHttpClientdirectly (removesHttpTransportfromagent_memory; replacesTokenProviderindestination). Rewrites unit test suites for both modules to use module-levelmock_httpfixtures and a_make_responsehelper.Related Issue
No linked issue.
Type of Change
How to Test
uv run pytest tests/agent_memory/— 248 passed, 12 skippeduv run pytest tests/destination/— all passinguvx pre-commit run --all-files— all hooks pass (ruff-format, ruff-check, ty)Checklist
Breaking Changes
None.
AgentMemoryClientandDestinationClientpublic APIs are unchanged. InternalHttpTransportclass is removed but was never part of the public API.Additional Notes
auditloganddata_anonymizationmodules are out of scope for this PR and can adoptHttpClientin a follow-up.data_anonymizationuses mTLS and would need anMTlsAuthProviderimplementation.ConfigFactoryis generic (ConfigFactory[C]) and can be reused by any future module that needs binding re-read on rotation.