Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
126fdec243 | ||
|
|
a9429dfb1d |
@@ -6,6 +6,27 @@ this crate adheres to [Semantic Versioning](https://semver.org/).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.3.0] — 2026-09-07
|
||||
|
||||
### Changed
|
||||
|
||||
- **`alkcall` dependency bumped to 0.6.0** (review 007's
|
||||
establishment follow-ups sweep). One consumer-visible change: the
|
||||
`OpenHandler` signature gained a plan parameter —
|
||||
`Fn(Value, Option<ChannelPlan>, Connection, AuthContext) ->
|
||||
JoinHandle<()>` — so `OpenableAlpn::new` callers' handler closures
|
||||
gain a `_plan` argument (mechanical). With an establisher attached
|
||||
(ADR-049), its `Establishment.plan` (a typed-opaque
|
||||
`Arc<dyn Any + Send + Sync>`) is threaded process-locally to the
|
||||
handler's plan parameter: ALPN crates dial/allocate in the
|
||||
establisher and deliver the live handle without a side-channel
|
||||
handoff. This crate's WS ferry passes the `Option<OpenEstablisher>`
|
||||
through unchanged and constructs no `Establishment` itself, so the
|
||||
ride is otherwise additive — alkcall 0.6.0's `channels::pump_bidi`
|
||||
helper (ADR-050) is available to data-plane handlers this crate
|
||||
ferries. Docs updated (websocket.md, `OpenableAlpn` field docs,
|
||||
adapter.rs).
|
||||
|
||||
## [0.2.0] — 2026-09-06
|
||||
|
||||
### Changed
|
||||
|
||||
Generated
+3
-3
@@ -27,9 +27,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "alkcall"
|
||||
version = "0.5.0"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0bbaeb718c370b74f9136d1d59b4608249bd7d1dd2332c0259f98351d709737f"
|
||||
checksum = "a44500900b82904d2a870e444051fc041a042e42ff7190803bbc5b3973f4feeb"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"bytes",
|
||||
@@ -48,7 +48,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "alkhttp"
|
||||
version = "0.2.0"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"alkcall",
|
||||
"arc-swap",
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "alkhttp"
|
||||
version = "0.2.0"
|
||||
version = "0.3.0"
|
||||
edition = "2021"
|
||||
rust-version = "1.85"
|
||||
license = "MIT OR Apache-2.0"
|
||||
@@ -42,7 +42,7 @@ h2 = ["server", "dep:hyper", "hyper-util/http2", "hyper/http2"]
|
||||
http1 = ["server", "dep:hyper", "hyper-util/http1", "hyper/http1"]
|
||||
|
||||
[dependencies]
|
||||
alkcall = { version = "0.5", features = ["gateway"] }
|
||||
alkcall = { version = "0.6", features = ["gateway"] }
|
||||
arc-swap = { version = "1", optional = true }
|
||||
axum = { version = "0.8", optional = true, features = ["ws"] }
|
||||
bytes = "1"
|
||||
|
||||
@@ -161,7 +161,7 @@ A lean single-side build takes `default-features = false` plus the side
|
||||
it needs:
|
||||
|
||||
```toml
|
||||
alkhttp = { version = "0.2", default-features = false, features = ["server"] }
|
||||
alkhttp = { version = "0.3", default-features = false, features = ["server"] }
|
||||
```
|
||||
|
||||
## Security posture
|
||||
|
||||
@@ -285,7 +285,15 @@ semantically-validating hook dials/prepares the backend before the
|
||||
reply, and a bounded failure resolves `channel:open_failed` with
|
||||
`details.reason` (the channel never exists consumer-side). The
|
||||
per-registration timeout override bounds the establisher when the
|
||||
dispatch carries no deadline. The `OpenableAlpns` request-extension
|
||||
dispatch carries no deadline. The establisher's `Establishment.plan`
|
||||
payload (alkcall 0.6.0 / ADR-049 amendment 2 — a typed-opaque
|
||||
`ChannelPlan`) is threaded process-locally to the pump handler's
|
||||
second parameter: the establisher and the handler agree on the
|
||||
concrete type, so ALPN crates dial/allocate in the establisher and
|
||||
deliver the live handle to their handler without a side-channel
|
||||
handoff. Data-plane handlers that pump a channel stream against a
|
||||
peer's split halves can use alkcall's `channels::pump_bidi` helper
|
||||
(alkcall 0.6.0 / ADR-050). The `OpenableAlpns` request-extension
|
||||
fallback is available for bare-registry/custom
|
||||
upgrade routes. Cap policy is the `ChannelsPolicy` extension (one
|
||||
instance consulted by both the open wrappers and the demux teardown).
|
||||
|
||||
@@ -273,7 +273,10 @@ impl HttpAdapter {
|
||||
/// `channel_open` marker), the ALPN-specific
|
||||
/// [`OpenHandler`](alkcall::channels::operations::OpenHandler),
|
||||
/// and the optional establisher + per-registration timeout
|
||||
/// (ADR-049, threaded through with `None` defaults). Each WS
|
||||
/// (ADR-049, threaded through with `None` defaults). With an
|
||||
/// establisher attached, its `Establishment.plan` (alkcall 0.6.0 /
|
||||
/// ADR-049 amendment 2) is threaded process-locally to the pump
|
||||
/// handler's second parameter. Each WS
|
||||
/// session's per-session fork registers the set (plus the generic
|
||||
/// channel ops, bootstrap discovery, and `op/register`), so a WS
|
||||
/// client can open data channels exactly as any channels consumer
|
||||
|
||||
@@ -271,13 +271,24 @@ pub struct OpenableAlpn {
|
||||
/// per the upstream C-08 stub until channel adoption lands).
|
||||
pub spec: OperationSpec,
|
||||
/// The data-plane protocol handler spawned on the allocated
|
||||
/// channel's `Connection`.
|
||||
/// channel's `Connection` — `Fn(Value, Option<ChannelPlan>,
|
||||
/// Connection, AuthContext) -> JoinHandle<()>`. With an
|
||||
/// establisher attached, the plan (alkcall 0.6.0 /
|
||||
/// ADR-049 amendment 2) is the establisher's `Establishment.plan`:
|
||||
/// the establisher and the handler agree on the concrete type
|
||||
/// (downcast in the ALPN crate); `None` when no establisher is
|
||||
/// registered or it returned `Establishment::default()`
|
||||
/// (`alkcall::channels::operations::Establishment::default`).
|
||||
pub open_handler: OpenHandler,
|
||||
/// The awaited establishment phase (ADR-049 §1): validate params
|
||||
/// semantically, consult ownership, prepare/dial the backend —
|
||||
/// before the open reply. `None` (the default) = an always-OK
|
||||
/// establisher (the pre-ADR-049 shape; existing registrations
|
||||
/// behave unchanged).
|
||||
/// behave unchanged). A successful establisher returns
|
||||
/// `Establishment::new(plan)` (to deliver a channel plan to the
|
||||
/// pump handler) or `Establishment::default()` when it only
|
||||
/// validates — both in
|
||||
/// `alkcall::channels::operations`.
|
||||
pub establisher: Option<OpenEstablisher>,
|
||||
/// The per-registration bound on the establisher await
|
||||
/// (ADR-049 §2). `None` = [`ESTABLISHMENT_TIMEOUT`] (10s) when the
|
||||
|
||||
@@ -1057,7 +1057,7 @@ use alkcall::channels::operations::OpenHandler;
|
||||
/// payload) chunks; the handler reads the channel's BiStream and
|
||||
/// writes the echo — the exact data-plane shape ADR-067 promises.
|
||||
fn echo_open_handler() -> OpenHandler {
|
||||
Arc::new(move |_input, channel_conn, _auth| {
|
||||
Arc::new(move |_input, _plan, channel_conn, _auth| {
|
||||
tokio::spawn(async move {
|
||||
let mut stream = match channel_conn.accept_bi().await {
|
||||
Ok(s) => s,
|
||||
|
||||
Reference in New Issue
Block a user