Conversation
…scovery manifest (#936) G15 — WebSocket lifecycle: - Atomic slot reservation (CAS on AtomicUsize) before upgrade handshake eliminates TOCTOU race between max_sessions check and DashMap insertion - 30s ping / 90s pong-timeout keepalive with tokio::select! - Binary frame rejection with close code 1003 per RFC 6455 - 1s write-task drain window on disconnect ensures close frame delivery - 1 MiB max message size enforced at upgrade G16 — Bearer token authentication: - New Tower middleware (auth.rs) with constant-time comparison via subtle::ConstantTimeEq - Applied to /acp and /acp/ws routes; discovery endpoint exempt - Configured via acp.auth_bearer_token / ZEPH_ACP_AUTH_TOKEN env / --acp-auth-token CLI - Open mode (no token) for unauthenticated local access G17 — Agent discovery manifest: - GET /.well-known/acp.json returns name/version/transports/authentication type - Always unauthenticated; controlled by acp.discovery_enabled / ZEPH_ACP_DISCOVERY_ENABLED Security: - AcpConfig uses custom impl Debug redacting auth_token as [REDACTED] Tests: 2855 passed (+9 new: bearer auth valid/missing/wrong/none, discovery json/bearer/disabled, debug-redaction, atomic slot reservation)
This was
linked to
issues
Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Epic 7 from the ACP gap analysis (#936): three transport hardening gaps closed.
G15 — WebSocket lifecycle
AtomicUsize) before upgrade handshake eliminates TOCTOU race betweenmax_sessionscheck andDashMapinsertionG16 — Bearer token authentication
auth.rs) with constant-time comparison viasubtle::ConstantTimeEq/acpand/acp/ws; discovery endpoint is exemptacp.auth_bearer_token/ZEPH_ACP_AUTH_TOKENenv /--acp-auth-tokenCLIAcpConfiguses customimpl Debugthat redactsauth_tokenas[REDACTED]G17 — Agent discovery manifest
GET /.well-known/acp.jsonreturns name, version, supported transports, and auth typeacp.discovery_enabled(defaulttrue) /ZEPH_ACP_DISCOVERY_ENABLEDTest plan
cargo nextest run --workspace --lib --bins— 2855/2855 passed (+9 new tests)AcpConfigdebug output contains[REDACTED], not the token valuecargo clippy --workspace --features acp-http -- -D warnings— cleancargo +nightly fmt --check— clean