Skip to content

Implement minimal reusable OAuth core extraction #6

Description

@jmrGrav

Goal

Implement the minimal reusable OAuth component boundary documented in PR #7, without changing existing mcp-runtime-go runtime behavior.

Design reference:

Scope

Extract reusable candidates incrementally behind an internal boundary, starting with internal/oauthcore:

  • OAuth authorization server metadata builders
  • OAuth protected resource metadata builders
  • Dynamic Client Registration models/validation
  • Authorization Code + PKCE service logic
  • token endpoint models/errors
  • token storage interface and existing SQLite adapter compatibility
  • request IP/trusted proxy helpers
  • redirect URI validation
  • audit redaction patterns
  • scope-to-tool ACL after related ACL work is stable

Non-goals

  • No production cutover
  • No behavior change for existing mcp-runtime-go deployments
  • No public shared module yet
  • No changes to hugo-public-mcp in this issue
  • No fake JWKS/OIDC/revocation/refresh endpoints
  • No public /authorize behavior change

Acceptance criteria

  • Existing public HTTP behavior remains compatible
  • Existing OAuth tests keep passing
  • New oauthcore tests cover extracted pure logic
  • Proxy-specific behavior stays in oauthproxy
  • No backend URL/token/path fields enter the reusable core config
  • go test ./..., go test -race ./..., go vet ./..., and secret scanning pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions