Repository navigation
Allow client settings to configure application-owned token managers - #11
Merged
Merged
Conversation
Expose a factory over resolved providers while retaining lazy in-memory defaults. Test saved-session reuse, refresh rotation, isolation, logout and factory behavior. Document native manager configuration and application lifecycle ownership.
|
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.
ClientSettings previously always created an in-memory token manager, so configuration-created clients could not reopen an application's saved session. Add an optional TokenManagerFactory to construction and resolution that receives the resolved provider map and creates exactly one application-configured native manager.
The default stays memory-only and the hook is skipped for public settings. Applications retain control of storage, native clock/skew options and lifecycle. Document logout, session/environment isolation and the scope of single-flight renewal.
Regression coverage executes initial acquisition, reuse by a new settings instance, expiry/skew-triggered refresh, persisted refresh-token rotation, concurrent renewal, isolation and logout. It also checks lazy storage access, constructor/resolver forwarding, skipped hooks for public/invalid settings and factory errors.
Validation: 486 tests passed with 92.45% coverage; Ruff format/lint, strict mypy, wheel/sdist build and Twine checks passed. Cross-repository generated per-service and aggregate persistence tests also pass against this worktree.
Closes #10. Runtime dependency for outfoxx/sunday-generator#253; publish a companion release before the generator forwarding is released.