Path: redb-route/redb.Route.Grpc/GrpcHeaders.cs
Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route
Page: https://redbase.app/src/dev-2026-12-06/redb-route/redb.Route.Grpc/GrpcHeaders.cs
----
namespace redb.Route.Grpc;
///
/// Well-known header constants used by the gRPC component.
/// Exchange headers with the "redbGrpc." prefix are set/read automatically.
///
public static class GrpcHeaders
{
/// Common prefix for all gRPC component headers.
public const string Prefix = "redbGrpc.";
/// gRPC service name. Example: "redb.route.grpc.RedbService".
public const string Service = "redbGrpc.Service";
/// gRPC method name. Example: "Process".
public const string Method = "redbGrpc.Method";
///
/// gRPC status code (int, or the Grpc.Core.StatusCode name). Set by the producer after a
/// response; set it on the consumer's Out to choose the status the caller receives. When it is
/// absent the consumer falls back to the transport-neutral status.code that controllers write.
///
public const string StatusCode = "redbGrpc.StatusCode";
/// gRPC status detail message (the grpc-message trailer).
public const string StatusDetail = "redbGrpc.StatusDetail";
///
/// Prefix for response trailers. A header redbGrpc.Trailer.error becomes the trailer
/// error, so a route can return structured failure detail without disturbing the body.
///
public const string TrailerPrefix = "redbGrpc.Trailer.";
/// Full method address the call arrived on, e.g. /identity.v1.Identity/Token.
public const string Route = "redbGrpc.Route";
/// Remote peer address (consumer-side), raw gRPC form: ipv4:10.0.0.5:51234.
public const string RemotePeer = "redbGrpc.RemotePeer";
/// Remote client address, bare (no scheme, no port) — what IP-based policies expect.
public const string RemoteIp = "redbGrpc.RemoteIp";
/// Remote client port (int).
public const string RemotePort = "redbGrpc.RemotePort";
/// Thumbprint of the client certificate, when mTLS is enabled and one was presented.
public const string ClientCertThumbprint = "redbGrpc.ClientCertThumbprint";
/// Subject of the client certificate.
public const string ClientCertSubject = "redbGrpc.ClientCertSubject";
/// Expiry (ISO 8601) of the client certificate.
public const string ClientCertNotAfter = "redbGrpc.ClientCertNotAfter";
/// Server port the request was received on (consumer-side).
public const string Port = "redbGrpc.Port";
/// Authority (host:port) from the gRPC call.
public const string Authority = "redbGrpc.Authority";
/// Deadline for the gRPC call (ISO 8601), if set by the caller.
public const string Deadline = "redbGrpc.Deadline";
/// Returns true if the header key belongs to the gRPC component.
public static bool IsRedbHeader(string key) =>
key.StartsWith(Prefix, StringComparison.OrdinalIgnoreCase);
}