Skip to content

Complete runtime hardening and server structure modernization - #6

Merged
by275 merged 9 commits into
masterfrom
findings-remediation
Aug 23, 2026
Merged

by275 merged 9 commits into
masterfrom
findings-remediation

Conversation

@by275

@by275 by275 commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Summary

This PR completes the compatibility-preserving modernization work for the proxy runtime. It keeps the existing CLI, URI construction model, public factory aliases, protocol wire behavior, and synchronous shutdown usage while strengthening the implementation and verification around them.

What changed

  • Hardened runtime defaults and control-plane behavior, including safer listener behavior, authenticated administration, explicit TLS/QUIC verification policy, SSH host-key verification, and connection-local cipher/plugin state.
  • Added explicit resource and lifecycle ownership for protocol streams, UDP mappings, background tasks, shutdown, cancellation, reconnect, and malformed input handling.
  • Added focused tests for HTTP, SOCKS, WebSocket, cipher/plugin, UDP, H2, H3, QUIC, SSH policy, cancellation, remote termination, and repeated shutdown scenarios.
  • Introduced a typed exception taxonomy for configuration errors, upstream failures, connection closure, protocol rejection, authentication failures, blocked destinations, and unsupported protocols. Unexpected failures remain visible at service boundaries while cancellation is preserved.
  • Reorganized the server implementation into a compatibility facade with focused modules for shared setup, connection lifecycle, request handlers, URI factories, and diagnostics. Existing pproxy.server names continue to resolve through the facade.
  • Added protocol capability metadata and extension points for future optional protocol adapters without coupling them to the core protocol implementation.
  • Consolidated packaging metadata in pyproject.toml for Python 3.12+ Git-based installation and expanded dependency compatibility and CI coverage.

Compatibility

  • Supported Python versions remain 3.12+.
  • Existing CLI options, URI grammar, public factory aliases, protocol classes, cipher names, plugin framing, TCP/UDP behavior, and legacy facade imports are preserved.
  • New exception classes are additive; the protocol validation path remains compatible with callers expecting AssertionError behavior.
  • The server package split is internal to the public facade and does not require application-side import changes.

Validation

  • Core unittest discovery: 77 tests passed, 7 optional tests skipped.
  • Optional-dependency pytest run: 75 tests passed, 2 skipped, with 4 subtests passing.
  • Python bytecode compilation and focused E9,F821 Ruff checks passed.
  • Clean wheel build passed and contains the structured server package without stale module artifacts.
  • Public facade identity and compatibility contract tests passed.

Review focus

Please review the server facade boundaries, lifecycle ownership, exception classification, optional transport shutdown behavior, and compatibility of the public runtime surface.

@by275
by275 merged commit 2d87f1b into master Aug 23, 2026
10 checks passed
@by275
by275 deleted the findings-remediation branch August 23, 2026 16:29
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.

1 participant