Skip to content

v0.8.1

Choose a tag to compare

@RomanEmreis RomanEmreis released this 16 Oct 13:36
4d8ac33

neva 0.8.1 lets bearer auth accept plain HTTP where TLS ends in front of the server, gives Error a public code(), and stops #[tool] from putting root-only keywords inside an argument's schema. All three were found while building ferrus-memory, a neva server.

Compatible with 0.8.0: nothing in the public API was removed or changed. One published schema changes; see Behaviour changes. MSRV is unchanged at 1.90.

Bearer auth behind TLS termination

Volga refuses a request over plain HTTP from a peer that is not loopback with a 400 and WWW-Authenticate: Bearer error="invalid_request". That is the right default, but neva had no way to turn it off. So a server behind a TLS-terminating proxy or ingress, behind a mesh sidecar, or in a container whose published port reaches it from the bridge gateway refused every request (#167).

http.bind("0.0.0.0:3000")
    .with_auth(|auth| auth
        .with_oauth(|oauth| oauth.with_issuer("https://auth.example.com"))
        // TLS ends at the ingress
        .require_https(false))
  • AuthConfig::require_https(bool) forwards to Volga's. The default stays true.
  • The server does not read X-Forwarded-Proto. With the check off, it takes a token from any peer that reaches it, so never turn it off on a server reachable directly over plain HTTP.
  • This is a different switch from the require_https in OAuthConfig::with_config(|cfg| cfg.with_client_config(..)), which governs the URLs the server fetches the issuer's keys from.

Error codes

Error::code() returns the ErrorCode, so a client can branch on what went wrong instead of parsing Display (#168). An error decoded from a response keeps the code the peer sent, and data() holds what comes with it.

match client.tools().call("forget", ()).await {
    Err(err) if err.code() == ErrorCode::InsufficientScope => {
        // `requiredScopes` and `missingScopes`
        let missing = err.data().and_then(|data| data.get("missingScopes"));
        // ...
    }
    Err(err) => return Err(err),
    Ok(result) => { /* ... */ }
}

The codes worth branching on are the ones MCP 2026-07-28 and neva 0.8.0 added: InsufficientScope for a client that cannot step up by itself, MissingRequiredClientCapability, UnsupportedProtocolVersion and HeaderMismatch.

Fixed

  • A #[tool] argument of a JsonSchema type, Json<T> among them, no longer carries $schema or a schemars-made title such as Array_of_Entity inside inputSchema.properties. JSON Schema 2020-12 forbids $schema outside a resource root, so a strict validator could refuse the whole schema. A #[schemars(title = "...")] stays (#169).

Behaviour changes

  • The inputSchema of a #[tool] with a JsonSchema argument changes: those two keys go, and nothing else in the subschema changes. outputSchema keeps its $schema, where it is allowed at the root.

Known limits

  • An error response whose code is not an ErrorCode, such as a server's own code, still fails to parse, and the client sees ParseError or InternalError instead of what the server sent. Fixing it is a breaking change, planned for 0.9 (#171).
  • A recursive type as a #[tool] argument publishes a $ref that points at the wrong schema, or at none (#172).

The full list is in CHANGELOG.md. Diff: 0.8.0...0.8.1.