Skip to content

fix(llm-router): require explicit schemes for cross-region watch URLs #1296

Description

@mikeyrcamp

Describe the bug

Cross-region watchStargateUrls can be advertised as a raw hostname and port without a URI scheme. Pylon normalizes scheme-less gRPC addresses to http://.

When the remote endpoint is a TLS listener, Pylon therefore sends plaintext HTTP/2 to a TLS port. The remote watch fails before it can discover or register with Stargates in that region.

Steps or code to reproduce bug

  1. Configure a remote watchStargateUrls entry as <host>:50071 while the endpoint requires TLS.
  2. Start Pylon with otherwise working local HTTPS registration.
  3. Observe the remote address normalize to HTTP and the remote watch fail at the TLS boundary.

Test this independently from the Pylon HTTPS client and Deployment/SRV identity defects.

Expected behavior

  • Secure cross-region watch configuration always carries an explicit https:// URI.
  • Configuration rendering/validation rejects scheme-less remote watch addresses in secure profiles rather than silently downgrading them to HTTP.
  • Explicit http:// remains possible only where a development/plaintext profile deliberately permits it.
  • TLS SNI and certificate verification use the remote dial hostname.
  • Returned per-pod Stargate authorities remain independent of the remote dial hostname.

Acceptance criteria

  • Unit and render tests cover HTTPS, explicit development HTTP, missing scheme, and unsupported scheme values.
  • A multi-region test proves the remote Watch reaches stargate-k8s-router over verified TLS.
  • Every returned grpcPylonDialAddr is an explicit URI consistent with its listener.
  • Wrong-root, wrong-hostname, and plaintext-to-TLS cases fail closed.
  • Cross-region registration, authenticated reverse QUIC, and invocation succeed after discovery.

Additional context

Tracked by #1292.


By submitting this issue, you agree to follow the project code of conduct and contributing guidelines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageIssue or PR awaiting maintainer triage

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions