Skip to content

refactor(connector-manager): extract CredentialService, strip OAuth from shared repo - #395

Merged
prvnsmpth merged 3 commits into
masterfrom
feat/credential-service
Jul 30, 2026
Merged

refactor(connector-manager): extract CredentialService, strip OAuth from shared repo#395
prvnsmpth merged 3 commits into
masterfrom
feat/credential-service

Conversation

@prvnsmpth

Copy link
Copy Markdown
Contributor

New CredentialService consolidates all OAuth token refresh logic; ServiceCredentialsRepo is now pure encrypted CRUD with no side-effects

  • OAuth HTTP calls always happen outside any database transaction
  • In-process Mutex serialises per-credential refresh (replaces pg_advisory_xact_lock)
  • Token endpoint resolved from connector config → credential JSON → remote-MCP metadata
  • remote_mcp/oauth.rs reduced to config parsing only
  • 14 unit tests covering predicates, auth-method fallbacks, and refresh response parsing

…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.
@prvnsmpth
prvnsmpth merged commit b263241 into master Jul 30, 2026
117 of 118 checks passed
@prvnsmpth
prvnsmpth deleted the feat/credential-service branch July 30, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant