Skip to content

fix(proxy): OSS-248 loopback direct knock tests on Windows - #397

Merged
athNdev merged 1 commit into
mainfrom
fix/oss-248-windows-test-loopback
Nov 10, 2026
Merged

athNdev merged 1 commit into
mainfrom
fix/oss-248-windows-test-loopback

Conversation

@athNdev

@athNdev athNdev commented Nov 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • Root cause: DirectKnockManager.StartKnock bound cp to :%d (all interfaces). TestDirectKnock_* in proxy.test.exe exercised that path, which can trigger Windows Security / Windows Firewall consent for newly built Go test binaries (related to OSS-246 / prior MINE-271 services fix).
  • Before:
    et.Listen(tcp, fmt.Sprintf(:%d, server.Port)) with no test override; every direct knock integration test opened a wildcard listener.
  • After: Production unchanged (empty bind host → :%d). Tests call SetKnockBindHost(127.0.0.1) via
    ewTestDirectKnockManager and regression tests assert directKnockListen receives loopback-only addresses; injectable directKnockListen mirrors the services isHostPortBoundWith pattern.

Test plan

  • go test ./internal/proxy/... -count=1
  • go test ./... -count=1 (native Windows, unelevated)
  • go vet ./internal/proxy/...
  • go run ./cmd/knowledge-lint -root . -fix + lint pass

Fixes OSS-248 (migrated from MINE-271).

Made with Cursor

StartKnock still listens on all interfaces in production so direct-port
wake ingress is unchanged. Tests set an optional bind host and injectable
listen function so proxy tests avoid Windows Firewall prompts.

Co-authored-by: Cursor <[email protected]>
@athNdev
athNdev merged commit 0ebf951 into main Nov 10, 2026
11 checks passed
@athNdev
athNdev deleted the fix/oss-248-windows-test-loopback branch November 10, 2026 05:19
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