Architecture
This page documents Orleans.Lattice.Api.Auth.Grpc 10.5.0, in the documentation for Orleans.Lattice 10.5.0 (release line 10.5), built 2026-12-05. It is also published as markdown, with every table and list, at architecture.md, and llms.txt lists every page.The binding adapts the in-process ILatticeAuthAdmin facade to a code-first gRPC service. It adds a transport gate in front of the facade and an identity bridge into it, and leaves every authorization decision about membership and policy to the facade and the cluster's access gate. This page describes the pipeline by behaviour; the public surface is in the Public API.
Registration and routing
AddLatticeAuthApiGrpc registers, on the host's service collection, the method definitions, the service, the default-deny authorizer, the header credential bridge and the authorization interceptor. The method definitions are built from the Orleans serializers in the host's container, so every request and response record is marshalled with the Orleans binary serializer and no .proto file exists. MapLatticeAuthApiGrpc resolves the method definitions before mapping, so they are in place when ASP.NET Core binds the service, and maps one unary method per facade operation under the service name orleans.lattice.api.auth.
The interceptor is registered globally but acts only on calls whose routed method belongs to that service, so other gRPC services on the same host are unaffected.
Call pipeline
Each call passes through these stages in order:
- Method classification. The interceptor resolves the method from the routed endpoint's metadata rather than from the raw request path. Endpoint routing matches paths case-insensitively, so classifying the raw path could let a re-cased path reach the handler without passing the gate.
- Transport gate. When
RequireAuthorizationis set, the interceptor describes the call as aLatticeAuthApiAuthorizationContext- the decodedLatticeAuthApiOperation(Unknownfor an unrecognised method) and the id the request targets - and asks the registeredILatticeAuthApiAuthorizer. Afalseanswer fails the call withPermissionDeniedand logs a warning; cancellation while deciding fails it withCancelled. With the defaultDenyAllAuthApiAuthorizerevery call stops here. - Identity bridge. The service asks
ILatticeAuthApiCredentialBridgefor the caller's credential and, when there is one, places it on the ambient core credential context for the duration of the call. The default bridge reads the configured header, strips the configured scheme prefix and returns no credential for an absent or empty value, so the caller is anonymous. The bridge does not validate the token; a credential authenticator registered on the silo does, when the facade resolves the caller (membership pipeline). - Active-tenant assertion. Only for a
ListRulescall withAuthPageRequest.ActiveTenantOnlyset, the service stamps the asserted tenant from the configured header onto the ambient context for the facade to validate. - Facade call. The service invokes the matching
ILatticeAuthAdminmethod. The facade's administrator check runs against the resolved subject whatever the transport gate decided, so a permissive authorizer orRequireAuthorization = falsenever admits an anonymous or non-administrator caller. - Error mapping. A facade denial becomes
PermissionDeniedwith only the denied tree, operation, subject and reason in trailers; a refused tenant assertion becomesPermissionDenied; anArgumentExceptionbecomesInvalidArgumentwith its message; cancellation becomesCancelled; storage back-pressure (LatticeSaturatedException) becomesResourceExhausted; an in-cluster timeout becomesDeadlineExceeded; a quiesced WAL shard, an unavailable silo or a lost remote enumeration becomesUnavailable; anything else is logged and returned asInternalwith a generic message. See Error mapping.
Client
LatticeAuthApiGrpcClient builds the same method definitions from the caller's serializer provider and issues unary calls over the caller's CallInvoker. Because both sides derive their marshallers from the same Orleans serializers and record aliases, client and server stay wire-compatible by construction.