Skip to content

P1: Implement C7/C8 in the reference HTTP transport: auth-carrying connect API, TLS refusal, credential redaction #13

Description

@macanderson

Problem

The HTTP transport has no authentication and no transport-security requirements.

  • HttpProvider::connect(id, url) (contextgraph-host/src/http.rs:38) builds a plain reqwest client — there is no way to attach a bearer token, API key header, or mTLS identity. Essentially every real remote provider (a hosted docs index, an org-internal knowledge graph) will require credentials, so today the HTTP story only works for anonymous endpoints.
  • Nothing in the spec forbids plain http:// to a non-loopback provider. The consent gate correctly ensures the user agreed that workspace content leaves the machine — and then the protocol is silent on whether it leaves in cleartext. Consent to egress is not consent to interception.

Worth preserving as-is: the transport-forced egress rule (http.rs:72-80 — every remote is treated as egress regardless of its handshake claim) is exactly right and should be lifted from code comment into normative spec text if it isn't already (C4).

Proposal

  1. Connect-time auth config: HttpProvider::connect_with(id, url, HttpConfig { bearer: Option<String>, headers: HeaderMap, timeout: … }). Static bearer + arbitrary headers covers the practical 90%; OAuth/OIDC device flows stay out of scope for 1.0 (document as a host concern — the host obtains the token, the transport carries it).
  2. Normative transport rules in the spec: a host MUST use https for non-loopback provider URLs (loopback exempt for local dev); credentials MUST NOT be logged or echoed into conformance evidence strings; a 401/403 response maps to a distinct, named HostError variant (auth failure ≠ transport failure — hosts should prompt for credentials, not retry).
  3. Conformance: contextgraph-inspect accepts --bearer/--header so a credentialed provider can actually be conformance-tested.

Acceptance criteria

  • Auth-carrying connect API on HttpProvider
  • https-required rule (with loopback exemption) in the spec's transport section
  • Named auth-failure error variant, distinct from Transport
  • contextgraph-inspect can test a credentialed endpoint

Metadata

Metadata

Assignees

No one assigned

    Labels

    normativeChanges the protocol version or conformance contract (GOVERNANCE.md process)roadmapPart of the steering roadmapsecurityConsent, egress, integrity, injection surface

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions