Skip to content

feat(client): add explicit insecure HTTP opt-in across integrations - #1535

Open
frf12 wants to merge 2 commits into
oceanbase:masterfrom
frf12:feat/client-insecure-http
Open

feat(client): add explicit insecure HTTP opt-in across integrations#1535
frf12 wants to merge 2 commits into
oceanbase:masterfrom
frf12:feat/client-insecure-http

Conversation

@frf12

@frf12 frf12 commented Sep 9, 2026

Copy link
Copy Markdown
Member

Which issue or RFC does this PR close?

Closes #1534.

Rationale for this change

A remote PowerContext Server can be reachable from an Agent machine while PowerContext-owned hooks and clients reject its non-loopback HTTP URL. Users currently discover this late, and environment-only workarounds are not durable across sessions. The default should remain secure, with an explicit, visible opt-in for controlled plaintext deployments.

What changes are included in this PR?

  • Add endpoint-bound client transport consent, strict boolean parsing, common/host environment configuration and non-secret per-host persistence.
  • Add --server-url and --allow-insecure-http/--no-allow-insecure-http to all eight setup targets and setup select; resolve the effective URL before installation, prompt with default No only in a TTY, and never prompt in JSON/noninteractive mode.
  • Save endpoint and consent in ~/.config/powercontext/clients.json (or POWERCONTEXT_CLIENT_CONFIG_FILE), preserving unrelated hosts and rolling back paired native writes on failure.
  • Keep installed native MCP and hook endpoints aligned for Codex, Claude Code and WorkBuddy; synchronize Hermes/OpenClaw native settings.
  • Apply the policy to standalone Python hooks, DSH/Pi/OpenCode/OpenClaw clients, the Python Client, LangChain, LangGraph, Pydantic AI and Bub. Rebuild shipped DSH/OpenCode bundles.
  • Prevent saved/native permission for endpoint A from authorizing endpoint B after an environment/settings override. Explicit false remains authoritative.
  • Add read-only native transport diagnostics. Explicitly insecure HTTP is degraded; unsupported or ambiguous native configuration is not reported as safe.
  • Document the transport boundary for MiniMax and generic Agent Plugin, whose native MCP transport belongs to the host; add bilingual remote-installation guidance and refresh integration pages.

Are there any user-facing changes?

Yes. HTTPS and IPv4/IPv6 loopback HTTP remain available by default; non-loopback HTTP needs explicit consent. This intentionally tightens DSH/OpenClaw paths that previously accepted remote plaintext HTTP without consent.

Example:

powercontext setup claude-code --server-url http://192.0.2.10:8000 --allow-insecure-http --json

The flag does not disable TLS certificate verification, configure credentials, change Server binding/authentication, or override host-owned MCP policy. doctor returns a nonzero status for degraded plaintext transport even when the endpoint is reachable.

Codex uses its installed .mcp.json as the common hook/MCP endpoint; rerun setup after an update replaces it. DSH's standard empty patch is supported, but custom runtime overlays require manual alignment/removal before setup: the installer fails before mutation rather than silently saving an endpoint that the native override would ignore. Unsupported JSON5/includes and ambiguous cached endpoints are reported as unknown.

How was this change tested?

  • Full Python/doctest run: python -m pytest --doctest-modules, deselecting the four baseline failures listed below: 2,205 passed, 64 skipped, 4 deselected; three packaging cases failed during dependency download (pypi.org TLS EOF for hatchling/hatch-vcs), not test assertions about the implementation. Re-ran all three package suites with UV_FROZEN=true UV_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple python -m pytest tests/langchain_middleware/test_packaging.py tests/langgraph_adapter/test_packaging.py tests/pydantic_ai_adapter/test_packaging.py -q: 3 passed.
  • Targeted setup/native-policy suites: 180 passed; final native/setup profile and rollback regressions: 51 passed. Core/SDK tests and wheel checks passed; Bub evaluation-adapter tests: 13 passed.
  • TypeScript package suites: DSH 220, Pi 77, OpenCode 52, OpenClaw 65; includes DSH live-server cases and Pi CLI loading. Rebuilt the shipped bundles and ran applicable package typechecks.
  • prek run -a, ruff check, ruff format --check, ty check, ty check integrations/pydantic-ai/src, and git diff --check: passed.
  • Website pnpm lint and pnpm build: passed; 785 public pages and internal links verified. Integration-manifest consistency checks passed.
  • Separately reproduced all four deselected failures on a clean detached c33df8d baseline with baseline source imports verified: three Receiver systemd service tests hit the Linux-only guard on macOS; the installed OpenCode 1.2.15 rejects the test's deliberate invalid/model before its capture callback. These unrelated cases are unchanged.

Acceptance boundaries: validated on macOS with Python 3.12; no production deployment or blanket fresh-session acceptance across every real Agent/native MCP implementation is claimed. TLS verification regression tests are mocked rather than a live certificate-handshake test.

AI usage statement

OpenAI Codex assisted with implementation, tests, documentation, and parallel code review under human-provided requirements. Review findings led to additional endpoint-binding, environment-refusal, native-diagnostics and persistence-rollback regressions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add explicit insecure HTTP opt-in across Agent integrations

1 participant