Architecture
This page documents Orleans.Lattice.Api.Auth 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 facade is a thin, administrator-gated layer over three seams the lower packages own: the membership directory, the authorization policy store and the access gate. It keeps no state of its own and adds no enforcement path beside the cluster's access gate. This page describes the request path by behaviour; the public surface is in the Public API.
Registration
AddLatticeAuthApi refuses to run unless AddLatticeAuth(...) has registered ILatticeAuthorizationPolicyStore on the same builder, and AddLatticeAuth in turn requires AddLatticeMembership(...). It binds LatticeApiAuthOptions and registers one singleton implementation of ILatticeAuthAdmin. Nothing runs in the background; work happens only when a method is called. A transport binding such as Orleans.Lattice.Api.Auth.Grpc resolves ILatticeAuthAdmin from the same service provider.
Request path
Every method follows the same shape:
- Argument validation. Null or empty identifiers are rejected before anything else.
- Administrator check. The facade asks the registered
ILatticeAccessGatefor a whole-treeAdminverdict on the reservedsys-auth-policytree for the ambient caller, using the same enforcement primitive the core data path uses. The caller's subject comes from the coreILatticeMembershipContext, so it is whatever the membership pipeline resolves from the caller's credential. A bootstrap administrator passes through the gate's root-of-trust bypass; withAccessAdministrationDelegationEnabled, a subject holding the delegated grant passes too; every other caller, including an anonymous one, is denied withLatticeAuthorizationDeniedExceptionand nothing is read or written. - Tenant-tier checks. A
t/group id is refused on create and remove, atenant:rule id and a tenant-wide sentinel scope are refused on rule authoring, and removal of atenant:rule is the operator's break-glass path (Tenant-tier alignment). - Identity-directory validation. On group creation and on adding a member, when
LatticeIdentityDirectoryOptions.ValidationRequiredis set and a realILatticeIdentityDirectoryis active, each referenced id (the group, and for an edge the member too) is resolved and the call fails withLatticeDirectoryValidationExceptionwhen one does not resolve or resolves to the wrong kind. At/id on an edge skips this step and is decided by the directory's nesting rule instead. - The underlying operation. Membership calls run against
ILatticeMembershipDirectoryunder system origin, so the administrator check in step 2 is the single authorization point and the directory's own tree reads cannot re-enter the gate. Rule writes go toILatticeAuthorizationPolicyStore, which runs its own tree operations under system origin and applies its rule-shape, app-owned and confinement guards.
The order of steps 2, 4 and 5 is fixed: authorize, then validate, then write.
Introspection
ExplainAsync rebuilds the named subject from the membership directory - its transitive group closure, or for a group subject the group and its ancestors - and submits the request to the same ILatticeAccessGate the data plane uses, so the verdict is the gate's own. The evaluation runs inside a scope that keeps it off the decision meter and out of the audit sinks, because it is not the subject's own access attempt. Layered on that verdict, the facade asks the decision engine which layer and rule decided it, and collects the matching authored rules from the target tree, the * bucket and, for a tree the tenant layer governs, the owning tenant's tenant-wide rules, up to MaxExplanationRules.
EffectivePermissionsAsync resolves the same closure and lists every authored rule whose subject matches it, up to the same cap. It reports rules, not a verdict. Both results carry the live AuthPolicyPosture.
The directory reads SearchDirectoryAsync and ResolveDirectoryPrincipalAsync call the active ILatticeIdentityDirectory. With the default no-op provider they return DirectorySearchResult.Unavailable and null instead of calling it. A provider-backed search is timed and counted on the membership package's orleans.lattice.membership.directory.search.duration histogram and its orleans.lattice.membership.directory.search.hits / orleans.lattice.membership.directory.search.misses counters (membership observability); this package declares no instruments of its own.
GetAccessModelAsync reports posture from the registrations it can see: the authentication mode from the registered credential authenticators, whether the gate enforces rules, the identity-directory provider and its guidance text, whether locally administered membership is effective under the group merge mode, the two authorization tier flags, and whether the tenant rule layer is active.
Listings
ListGroupsAsync, ListRulesAsync and ListRulesForTreeAsync page with an exclusive continuation token over the directory's and the store's ordered enumerations. Filters - cluster groups only, or rules owned by the caller's validated active tenant - are applied before the page is cut. ListRulesForTreeAsync merges the tree's own rules with the * bucket and, for a tenant-layer tree, the owning tenant's tenant-wide rules, in catalogue order.
Source map
Related
- Public API
- Configuration
Orleans.Lattice.Autharchitecture - the gate and policy store this facade drives.Orleans.Lattice.Api.Auth.Grpcarchitecture - the remote transport over this facade.