Skip to content

Port ToolHive's networking package into core #221

Closed

Description

@jhrozek

ToolHive's networking package — hardened HTTP client, SSRF-safe fetch, error mapping, and port/listener helpers — has a second consumer coming and is currently only available inside stacklok/toolhive.

Work already exists on the unmerged feat/networking branch (4 commits, ~4,200 lines with tests):

  • networking/fetch.go, http_client.go, http_error.go, utilities.go, port.go
  • review fixes already applied on the branch: SSRF and redirect gaps closed, and invalid ports rejected rather than silently replaced
  • a race-free listener API added on top of the straight port

Why core. It is the substrate the authn package needs (filed separately), and a JWKS/discovery fetcher without default-deny SSRF protection is the kind of thing that should exist once rather than per-consumer.

Consumers: toolhive, which deduplicates its own copy, and toolhive-core/authn.

Done means merged and released. Downstream consumers pin by version, so an unreleased merge is not consumable.

Activity

  1. added
    needs-triage
    on Aug 10, 2026
  2. self-assigned this
    on Aug 10, 2026
  3. removed
    needs-triage
    on Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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