endpoint-libs 4.1.0

Launch MCP services fast: describe endpoints once in RON, and endpoint-gen generates the Rust models, docs and MCP tool schemas that this crate serves over WebSocket RPC, with roles and typed errors built in.
Documentation
# WebSocket auth protocol validation

`EndpointAuthController` parses comma-separated `Sec-WebSocket-Protocol` segments.
Each segment is trimmed, and empty segments are skipped. A segment is accepted only
when its first byte is an ASCII decimal digit (`0` through `9`). Its first byte is
the borrowed discriminator key; the remaining text is the borrowed payload.

Segments with non-ASCII or otherwise invalid discriminators are ignored. Duplicate
discriminators retain the existing `HashMap` behavior: the last value wins.
Whitespace around segments is trimmed, while whitespace within a payload is kept.
The method discriminator is `0`; if it is missing or does not identify a registered
endpoint, authentication returns an error before creating an authenticated request
context.

## Decisions and reply admission

`AuthController::auth_reply` is required. A controller that used to return
`Ok(())` from `auth` after checking credentials without sending a frame can
return `Ok(AuthReply::Accepted(None))` after the same checks. A controller that
sent its own response returns it as part of `AuthReply` for the caller to send.
A wrapper delegates to the inner `auth_reply` and makes its final decision
before handing back any response. Calling the inner `auth` applies the reply
immediately.

`SubAuthController` implementations registered through `add_auth_endpoint` keep
their typed `AuthResponse` contract. A manual `SubAuthControllerErased`
implementation must provide `auth_reply` with an explicit decision, including
`Rejected(None)` for a silent refusal or `Rejected(Some(error))` for a refusal
with a frame. The erased direct-call `auth` method now returns a result that
reports rejection and failed success-frame admission.

The server queues an accepted decision's success frame before enabling request
dispatch. It refuses the session if the frame cannot enter the queue. A rejected
decision prevents dispatch even if its error frame cannot be queued. The same
admission requirement applies to direct auth through the toolbox. When a
custom sender is installed for direct calls, it must return true only after
accepting the frame. Queue admission does not promise delivery to the peer.

## Malformed input diagnostics

Malformed typed authentication input still returns the generic `BAD_REQUEST`
response `authentication failed`. Malformed legacy text and binary frames still
return `BAD_REQUEST` with `invalid request`; the decode branch keeps dispatch
running after the reply. A later connection policy may still close the session:
`header_only` ends the session after sending its queued response. At debug level,
the server records the Serde error class and safe correlation metadata (request
type and method for typed authentication; line and column for legacy frames, plus
connection and log IDs). It does not log the raw error, input value, frame
contents, or decoder path, since those can contain credentials.

## Integration acceptance

Use the admission lane's transport acceptance fixture as an external integrator
witness. Send real WebSocket upgrades through `EndpointAuthController` with
`Sec-WebSocket-Protocol: éx`, multibyte-only tokens, an empty list, and a valid
known fixture method. Malformed cases must be refused without panic or partial valid
identity. Confirm the shard handles a subsequent valid connection and that the valid
fixture authenticates. Exercise a nonzero shard as well.

The witness should fail if the original byte slicing (`&x[..1]`, `&x[1..]`) is
restored. Run `check-features` and `check-chain` through the integrator before release.