1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! gRPC transport.
//!
//! Third thin adapter over the shared core handlers (ADR-005 extended).
//! All 11 `lf.a2a.v1.A2AService` RPCs dispatch into the same `core_*`
//! functions that HTTP and JSON-RPC call; this module contains only
//! transport-level adaptation (error mapping, metadata, streaming
//! serialization).
//!
//! Enabled by the `grpc` Cargo feature. `grpc-reflection` and
//! `grpc-health` are optional sub-features that add the
//! `grpc.reflection.v1alpha.ServerReflection` and
//! `grpc.health.v1.Health` services respectively (off by default).
pub use GrpcAuthLayer;
pub use GrpcService;
use Arc;
use crateMiddlewareStack;
use crateAppState;
/// Build a fully-wired tonic router with auth layered and the
/// [`GrpcService`] registered.
///
/// Auth wraps the entire tonic server: every RPC runs
/// `MiddlewareStack::before_request` before dispatch and receives a
/// populated [`crate::middleware::context::RequestContext`] in the
/// request extensions. Failures surface as `tonic::Status::unauthenticated`
/// / `tonic::Status::permission_denied` — no A2A error model, no HTTP
/// JSON body.
///
/// This is the only public entry point to the gRPC surface. Returning
/// the raw service without the auth layer would permit adopters to
/// silently bypass authentication.
/// Return type of [`make_grpc_router`]: a tonic router with the A2A
/// auth layer already applied. The concrete name is exposed so the
/// server builder can return the same type from
/// [`crate::A2aServer::into_tonic_router`].
pub type LayeredGrpcRouter = Router;