Repository navigation
feat(auth): add OAuth2 client and secure token stores (#68) - #98
Open
jpsiddharth2008 wants to merge 1 commit into
Open
jpsiddharth2008 wants to merge 1 commit into
jpsiddharth2008 wants to merge 1 commit into
Conversation
Collaborator
|
If the |
This branch has not been deployed
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.
Summary
Implements #68 by introducing a reusable OAuth2 client and token-storage APIs, adapted from the unmerged implementation in PR #4.
The client handles discovery, authorization-code exchanges, client-credentials grants, refresh, revocation and client registration. Successfully acquired or refreshed tokens are saved before returning to the caller.
What changed
Token records and storage
StoredTokenrecords and an asynchronousTokenStoreprotocol.MemoryTokenStoreas the client’s default storage.FileTokenStorewith atomic replacement, process-local locking, symlink rejection and POSIX0600permissions.nitrostack[token-encryption].expires_inis missing orNone; explicit zero expires immediately.OAuth2 client
Discovery and security
urllibwith worker threads, configurable timeouts, bounded responses and redirect rejection.Documentation and exports
Validation
Added 78 feature tests covering:
The complete suite collects 967 tests. Full-suite runs used MCP 2.2.0, without exclusions or newly added skips/xfail markers.
Windows 3.12 limitation
An unchanged live localhost OAuth discovery test failed with
WinError 10053. The same socket error reproduced on unchangeddevelopwhen running the existing OAuth/authentication modules together, although complete baseline runs and isolated repetitions passed.The Windows 3.12 suite is therefore not reported as green. Reproduction commands and comparison results are recorded in
docs/oauth-client-verification.md.Additional checks passed:
git diff --checkuv lock --checkLinux results are local WSL compatibility runs; hosted CI remains to be verified.
Boundaries
develop, without PR fix: unify HTTP factory and migrate tests to official MCP transport #36 or spillover changes.