Skip to content

feat: sync auth subsystem and config manager from internal repository - #2128

Open
unsupo wants to merge 2 commits into
developmentfrom
feat/auth-files-sync
Open

unsupo wants to merge 2 commits into
developmentfrom
feat/auth-files-sync

Conversation

@unsupo

@unsupo unsupo commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Syncs the complete authentication/authorization subsystem and configuration manager from the internal repository. These were missing from PR #2127 (core integration) because the expected file paths were wrong — they live under server/auth/, not auth/.

What's included

Directory Files Content
server/auth/ (root) 26 Core auth: dependencies, sessions, users, JWT, refresh tokens, API keys, MCP credentials, audit logging, rate limiting, MFA, password validation, timing attack prevention, concurrency protection
server/auth/oauth/ 3 OAuth manager, routes (authorization code flow + PKCE)
server/auth/oidc/ 5 OIDC manager, provider, routes, state manager (JIT user provisioning)
server/auth/ gateway 3 Gateway auth wiring, identity authenticator, JWT validator (RS256 JWKS)
server/utils/ 1 config_manager.py — central configuration system
server/ root 4 app.py, app_state.py, error_codes.py, main.py

Gateway authentication files

These are the files that enable the EKS-tested gateway auth flow:

  • gateway_auth_wiring.py — dispatches authentication based on request source
  • gateway_identity_authenticator.py — extracts identity from gateway JWT
  • gateway_jwt_validator.py — RS256 JWT validation against trusted JWKS endpoint

Scrubbing applied

  • K8s internal DNS (*.svc.cluster.local) replaced with localhost
  • Internal ticket references (EVO-NNNNN) removed
  • Internal email domains replaced with @example.com
  • AWS account IDs replaced with ACCOUNT_ID
  • Disclosure scan passed (no secrets, internal hostnames, or PII)

Relationship to other PRs

This completes the gap identified in PR #2127:

Suggested merge order

  1. feat: add SDK core packages (cidx-sdk, cidx-testkit, backends) #2122 (SDK core) — base layer
  2. feat: add feature packages (depmap, memory, scip, wiki, xray) #2123 (feature packages) — depends on SDK
  3. feat: core integration — wire packages into the server #2127 (core integration) — wires packages in
  4. This PR — completes the server/auth subsystem
  5. feat: trusted gateway authentication for per-user access #2121 (gateway auth) — new gateway auth on top of the existing auth subsystem
  6. feat: add plugin packages (cidx-git-backend, cidx-orchestrator-invoker) #2124, docs: sync documentation from internal repository #2125, feat: sync Rust xray crate from internal repository #2126 — independent

Merge-order dependencies

Prerequisite What it supplies
PR #2121 Trusted gateway auth module
PR #2122 cidx-sdk packages
PR #2127 Core integration

Review findings

# Severity Status Summary
3 BLOCKING Fixed Internal service names in config_manager.py, dependencies.py
13 LOW Noted Commit message references internal tracker prefix (cosmetic)
1-2 BLOCKING Merge-order Missing gateway auth + SDK packages
4-12, 14-19 MED/LOW Noted Code quality, security (tracked privately)

Bring the complete authentication/authorization subsystem and config
manager that were missing from the core integration PR (#2127) — the
expected paths were wrong (server/auth/, not auth/).

Auth subsystem (server/auth/ — 37 files):
- Core: dependencies, session manager, user manager, JWT manager,
  refresh token manager, API key manager, MCP credential manager
- Gateway auth: gateway_auth_wiring, gateway_identity_authenticator,
  gateway_jwt_validator (RS256 validation against trusted JWKS)
- OAuth: oauth_manager, routes (authorization code flow + PKCE)
- OIDC: oidc_manager, oidc_provider, routes, state_manager
  (JIT user provisioning via OIDCManager)
- Security: MFA challenge (TOTP), password strength validation,
  timing attack prevention, rate limiting (login + OAuth),
  concurrency protection, elevated session manager, audit logger
- Error handling: auth_error_handler, login_outcome

Config manager (server/utils/config_manager.py):
- Central configuration system (185KB) — manages all server config
  state, feature flags, and runtime settings

Additional server files:
- app.py (FastAPI application factory)
- app_state.py (application state management)
- error_codes.py (error code definitions)
- main.py (server entry point)

Scrubbing applied:
- K8s internal DNS replaced with localhost
- Internal ticket references (EVO-NNNNN) removed
- Internal email domains replaced
- AWS account IDs replaced with placeholder
- Disclosure scan passed
- Neutralize internal MCP service names in config_manager.py and dependencies.py
- Replace internal authorizer and gateway references with generic names
- Clean up deployment-specific terminology in comments and docstrings
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