Skip to content

feat: secure, harden, and verify the Network backend - #58

Open
rchatham wants to merge 25 commits into
feature/network-migration-backend-selectorfrom
feature/network-migration-network-config
Open

feat: secure, harden, and verify the Network backend#58
rchatham wants to merge 25 commits into
feature/network-migration-backend-selectorfrom
feature/network-migration-network-config

Conversation

@rchatham

@rchatham rchatham commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Summary

Secure, harden, and verify the opt-in Network.framework backend across loopback, multi-peer, reconnect, cleanup, and API-contract scenarios.

Changes

  • Add local Network loopback verification.
  • Add TLS pre-shared-key transport while retaining explicitly unauthenticated diagnostic mode.
  • Harden connection lifecycle, duplicate replacement, reconnect handling, timeout/cap policy, cancellation, and cleanup.
  • Define backend API expectations and unsupported-operation behavior.
  • Add expanded message, multi-peer broadcast, reconnect, and cleanup coverage.
  • Isolate Network loopback CI strategy and defer runtime policy configuration deliberately.
  • Document backend setup and migration behavior.
  • Guarantee loopback teardown on every test path.
  • Sanitize supplied and host-derived display names to non-empty values within the 63-byte UTF-8 Multipeer limit for both backends.
  • Incorporate the reviewed adapter, discovery, identity, and frame-decoder fixes from the updated parent.

Security

Network TLS-PSK authenticates possession of a group secret, not an individual peer identity. Unauthenticated transport remains explicit and is not suitable for sensitive production traffic. Display names and Bonjour identifiers remain unsuitable as authorization principals.

Verification

  • swift test — 159 tests passed locally at this checkpoint.
  • iPhone 16 / iOS 18.3.1 Xcode tests — 159 tests passed locally.
  • Demo build passed locally.
  • Coverage includes matching/mismatched PSKs, lifecycle state transitions, loopback messaging, multi-peer broadcast, reconnect, cleanup, display-name boundaries, and unsupported APIs.
  • Correctness and security reviews found no blockers.

Limitations

Network remains experimental opt-in. Stream/resource parity, reusable browser UI, production trust, and adopter UX are handled in later checkpoints.

Stack

rchatham added 25 commits August 6, 2026 14:11
…d-selector' into HEAD

# Conflicts:
#	PeerConnectivity.xcodeproj/project.pbxproj
#	PeerConnectivityDemo/ViewController.swift
#	Sources/NetworkPeerCoordinator.swift
#	Sources/PeerConnectionManager.swift
…loopback' into HEAD

# Conflicts:
#	Sources/PeerConnectionManager.swift
#	Sources/PeerConnectionTransports.swift
…tion-hardening' into HEAD

# Conflicts:
#	Sources/PeerConnectivityUI/PeerConnectionManager+UI.swift
…d-selector' into HEAD

# Conflicts:
#	PeerConnectivityTests/NetworkPeerCoordinatorTests.swift
#	Sources/NetworkPeerCoordinator.swift
#	Sources/NetworkPeerTransport.swift
#	Sources/NetworkPeerTransportAdapters.swift
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