Skip to content

auth: tenant-aware remote header resolution is never wired (tenant_id is always None) #353

Open

Description

@ViperJuice

Found by the 2.8.0 docs audit.

What

resolve_remote_headers_for_tenant (src/pmcp/remote_auth.py:121) reads tenant-isolated credentials from .pmcp/tenants/<id>/pmcp.env when given a tenant_id, and _remote_headers in src/pmcp/client/manager.py (~950) accepts tenant_id. But its only callers (client/manager.py:2578 and :2594) never pass one, so the tenant path is dead code and every remote connection resolves headers from the process environment. The README described tenant-aware header resolution as live; the 2.8.0 docs audit corrects the README to say it is not wired yet.

To decide

Where a tenant id comes from for a connection (per-request context, per-server config, or a gateway-level tenant), and how it reaches the connect path; or remove the unused path. Tests: a remote server's headers resolve from the tenant file when a tenant is set, and never from another tenant's file.

See specs/tenant-code-mode-host-contract.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions