refactor(connector-manager): extract CredentialService, strip OAuth from shared repo - #395
Merged
Conversation
…rom shared repo - New CredentialService handles all OAuth token refresh outside DB txns - ServiceCredentialsRepo is now pure encrypted CRUD with no side effects - remote_mcp/oauth.rs reduced to metadata parsing only - In-process mutex serialises per-credential refresh concurrency - Token endpoint resolved from connector config -> credential JSON -> metadata
…h mock OAuth endpoint - 12 integration tests covering CredentialService refresh flow and ServiceCredentialsRepo CRUD operations - Postgres via long-lived container (avoids testcontainers overhead) - Axum mock OAuth token endpoint for refresh verification - Tests validate: token refresh with persistence, raw reads skip refresh, non-OAuth/non-refreshable credentials pass unchanged, CRUD operations - Also fix SSRF filter in do_oauth_refresh: use plain reqwest::Client for native connector refresh (only remote MCP uses pinned client)
…cused cases Keep the high-value integration tests: full refresh flow end-to-end, raw-read bypasses refresh, and CRUD round-trip regression.
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.
New
CredentialServiceconsolidates all OAuth token refresh logic;ServiceCredentialsRepois now pure encrypted CRUD with no side-effectsMutexserialises per-credential refresh (replacespg_advisory_xact_lock)remote_mcp/oauth.rsreduced to config parsing only