The TCP BIND dispatch arm replaces its refusal with the full phase model (POC #5-validated scope), plus the command gate at dispatch: - The command gate: TCP BIND requires socks5:bind from the per-call opener identity (CF-005/CF-006) — the pump handler resolves it from the open-op AuthContext; serve_socks5_over<T> takes the resolved can_bind boolean explicitly. A scope-less identity gets the RFC-faithful ConnectionNotAllowed (0x02) with no factory call (the gate precedes the seam) while CONNECT still serves it. - The phase model (wire.md §BIND): the BindAcceptFactory at the command-read interception point → reply#1 carrying BND.ADDR (the factory's bind_addr) → the quiet wait (single-shot select!, exactly two exits: the one accept, or the control stream's EOF/garbage/ error; any byte = protocol garbage → session ends, no data plane; the accept future's drop IS the client-gone teardown) → reply#2 carrying the peer address (via the fork's published new_reply) → pump_bidi inline (the CONNECT shape, R-02). - Two-stage RFC-faithful failure mapping: factory failure → reply#1's mapped code; accept-stage failure → reply#2's mapped code, no data plane. No phantom listeners, no phantom data planes. - The no-factory default is the wrapper-aware in-band variant (ADR-007 variant 3, documented): sentinel reply#1 + sentinel reply#2 (0.0.0.0:0), the full phase model preserved — the channel is the connection. - The accept wait lives in the teardown-governed pump phase, never under the establishment bound (ADR-007). Tests: 16 unit tests (raw RFC client over duplex) + 7 harness integration tests over channels — happy path, the gate (0x02 while CONNECT serves, both scopes), quiet-wait garbage, client-gone teardown (owner-flag witness), both failure stages over channels, no-factory variant 3, and the three-command regression guard (CONNECT serves, BIND serves under its gate, ASSOCIATE still refuses). Verification: cargo test green (96 lib + 26 harness + 37 differential); clippy -D warnings clean (all targets, native + wasm32-unknown-unknown); cargo fmt clean; wasm check clean. Task: tasks/implementation/core-producer-bind.md (status → completed)
42 lines
1.7 KiB
TOML
42 lines
1.7 KiB
TOML
[package]
|
|
name = "alksocks"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
rust-version = "1.88"
|
|
license = "MIT OR Apache-2.0"
|
|
description = "SOCKS5 (RFC 1928) proxy protocol over alkcall channels: targeted-forked fast-socks5 typestate core plus producer/consumer sessions. Producer/consumer protocol crate."
|
|
repository = "https://git.alk.dev/alkdev/alksocks"
|
|
keywords = ["socks5", "proxy", "rfc1928", "channels", "alkcall"]
|
|
categories = ["network-programming", "asynchronous"]
|
|
exclude = [".opencode/", "AGENTS.md", "docs/reviews/", "docs/research/", "docs/plans/", "tasks/", "docs/sdd_process.md"]
|
|
|
|
[lib]
|
|
name = "alksocks"
|
|
|
|
[features]
|
|
# Declared empty by design (ADR-009): `local` adds tokio/net + socket2
|
|
# when its modules land, `composed` adds the alktunnels dep. The
|
|
# default build is protocol-only and wasm-clean by construction.
|
|
default = []
|
|
local = []
|
|
composed = []
|
|
|
|
[dependencies]
|
|
# The substrate (convention 11): pinned, bump deliberately, never
|
|
# transitively. First consumption of the 0.8.0 surface.
|
|
alkcall = "0.8.0"
|
|
tokio = { version = "1", default-features = false, features = ["rt", "sync", "io-util", "macros", "time"] }
|
|
# The fork's declared logging seam (rfc1928.md: upstream `log` calls
|
|
# were dropped or re-pointed here); no source file references it yet —
|
|
# the first consumer is expected to be the producer layer's
|
|
# diagnostics (review 001 N-2).
|
|
tracing = "0.1"
|
|
thiserror = "2"
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
bytes = "1"
|
|
futures = { version = "0.3", default-features = false, features = ["std"] }
|
|
|
|
[dev-dependencies]
|
|
tokio = { version = "1", features = ["full", "test-util", "macros"] }
|
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] } |