Public API
This page documents Orleans.Lattice.Api.State.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 api.md, and llms.txt lists every page.Orleans.Lattice.Api.State.Grpc publishes the remote half of the read-only state API: the LatticeStateApiGrpcClient, the binding-owned wire envelopes, the server options, the transport authorization seam and its implementations (including the turnkey environment-variable credential authorizer and its public password-hash format), the identity and auth-scheme advertisement seams, and the registration extensions. The gRPC service, its method definitions, marshallers and authorization interceptor are internal; they are described by behaviour in Architecture.
Most RPCs carry the facade's own request and response records unchanged; those are listed in the state facade's public API. The RPC-by-RPC contract is in the gRPC contract, and building and driving the client is covered in Client.
Registration
| Method | What it registers |
|---|---|
AddLatticeStateApiGrpc(this IServiceCollection services, Action<LatticeStateApiGrpcOptions>? configure = null) |
The options, the default-deny ILatticeStateApiAuthorizer, the header-based ILatticeStateApiCredentialBridge, the options-backed ILatticeStateApiAuthSchemeSource, the authorization interceptor, and the service. Each seam is registered with TryAdd. |
MapLatticeStateApiGrpc(this IEndpointRouteBuilder endpoints) |
Maps the orleans.lattice.api.state service routes. |
AddEnvVarCredentialAuthorizer(this IServiceCollection services, Action<EnvVarCredentialAuthorizerOptions>? configure = null) |
Binds EnvVarCredentialAuthorizerOptions, registers ProcessEnvironmentVariableReader as the IEnvironmentVariableReader (with TryAdd), and replaces every previously registered ILatticeStateApiAuthorizer with EnvVarCredentialAuthorizer. |
The silo must also register the facade with AddLatticeStateApi(); see Setup. Option values are documented in Configuration.
Client
LatticeStateApiGrpcClient.Create(CallInvoker callInvoker, IServiceProvider serializerProvider) builds a client over a caller-supplied call invoker, resolving the per-message Orleans serializers from serializerProvider. The client has one method per RPC:
| Kind | Client methods |
|---|---|
| Unary | ListTreesAsync, ListViewsAsync, ListTagIndexesAsync, ListTagValuesAsync, ListCoveredTreesAsync, ListIndexTagsAsync, ScanTagMembersAsync, GetTreeStructureAsync, ScanEntriesAsync, GetEntryAsync, GetEntryHistoryAsync, CancelScanAsync, GetMetricsSnapshotAsync, GetClusterInfoAsync, GetAuthSchemeAsync, GetDeadLetterCountAsync, ListDeadLettersAsync |
Server-streaming (IAsyncEnumerable<T>) |
ObserveChangesAsync, ObserveMetricsAsync |
Wire envelopes
The binding-owned records wrap scalar facade arguments and results, or add a StateQueryStatus, so the wire contract can grow additively: EntryGetRequest / EntryGetResponse, EntryScanResponse, EntryScanCancelResponse, EntryHistoryResponse, StructureResponse, DeadLetterCountRequest / DeadLetterCountResponse, and the auth-scheme records AuthSchemeAdvertisementRequest, AuthSchemeAdvertisement and AuthSchemeDescriptor. Their stable wire aliases are the constants in GrpcStateTypeAliases.
Seams
| Seam | Default | Purpose |
|---|---|---|
ILatticeStateApiAuthorizer |
DenyAllStateApiAuthorizer |
Coarse admission for every protected RPC, given a LatticeStateApiAuthorizationContext. Implementations shipped: DenyAllStateApiAuthorizer, AllowAllStateApiAuthorizer, EnvVarCredentialAuthorizer. |
ILatticeStateApiCredentialBridge |
header-based (internal) | Lifts the caller credential from request metadata onto the ambient Lattice credential used by read visibility. |
ILatticeStateApiAuthSchemeSource |
options-backed (internal) | Supplies the advertisement the unauthenticated GetAuthScheme RPC returns. |
IEnvironmentVariableReader |
ProcessEnvironmentVariableReader |
Where EnvVarCredentialAuthorizer reads stored password hashes. |
LatticePasswordHash encodes, parses and verifies the pbkdf2-sha256$<iterations>$<base64-salt>$<base64-derived-key> hash format the environment-variable authorizer reads; TryParse yields a LatticePasswordHashComponents. See Security.
Related
Public declaration reference
The following inventory includes directly declared public members and overloads, enum values, and record positional members. Inherited framework members and compiler-generated record members are not additional package operations. Each source link identifies the declaration that defines its signature.
Orleans.Lattice.Api.State.Grpc.EnvVarCredentialAuthorizerServiceCollectionExtensions
Source (line 24).
public static class EnvVarCredentialAuthorizerServiceCollectionExtensions
public static IServiceCollection AddEnvVarCredentialAuthorizer(this IServiceCollection services, Action<EnvVarCredentialAuthorizerOptions>? configure = null)
Orleans.Lattice.Api.State.Grpc.ILatticeStateApiCredentialBridge
Source (line 37).
public interface ILatticeStateApiCredentialBridge
LatticeCredential? Resolve(ServerCallContext context)
Orleans.Lattice.Api.State.Grpc.LatticeStateApiGrpcClient
Source (line 22).
public sealed class LatticeStateApiGrpcClient
public static LatticeStateApiGrpcClient Create(CallInvoker callInvoker, IServiceProvider serializerProvider)public Task<TreeCatalogPage> ListTreesAsync(CatalogRequest request, CancellationToken cancellationToken = default)public Task<ViewCatalogPage> ListViewsAsync(CatalogRequest request, CancellationToken cancellationToken = default)public Task<TagIndexCatalogPage> ListTagIndexesAsync(CatalogRequest request, CancellationToken cancellationToken = default)public Task<TagValueCatalogPage> ListTagValuesAsync(CatalogRequest request, CancellationToken cancellationToken = default)public Task<CoveredTreeCatalogPage> ListCoveredTreesAsync(CatalogRequest request, CancellationToken cancellationToken = default)public Task<TagValueCatalogPage> ListIndexTagsAsync(CatalogRequest request, CancellationToken cancellationToken = default)public Task<TagMemberScanPage> ScanTagMembersAsync(TagMemberScanRequest request, CancellationToken cancellationToken = default)public Task<StructureResponse> GetTreeStructureAsync(StructureRequest request, CancellationToken cancellationToken = default)public Task<EntryScanResponse> ScanEntriesAsync(EntryScanRequest request, CancellationToken cancellationToken = default)public Task<EntryGetResponse> GetEntryAsync(EntryGetRequest request, CancellationToken cancellationToken = default)public Task<EntryHistoryResponse> GetEntryHistoryAsync(EntryHistoryRequest request, CancellationToken cancellationToken = default)public Task<EntryScanCancelResponse> CancelScanAsync(EntryScanCancelRequest request, CancellationToken cancellationToken = default)public Task<TreeMetricsSnapshot> GetMetricsSnapshotAsync(TreeMetricsRequest request, CancellationToken cancellationToken = default)public Task<ClusterInfo> GetClusterInfoAsync(ClusterInfoRequest request, CancellationToken cancellationToken = default)public Task<AuthSchemeAdvertisement> GetAuthSchemeAsync(AuthSchemeAdvertisementRequest request, CancellationToken cancellationToken = default)public Task<DeadLetterCountResponse> GetDeadLetterCountAsync(DeadLetterCountRequest request, CancellationToken cancellationToken = default)public Task<DeadLetterQueuePage> ListDeadLettersAsync(DeadLetterQueueRequest request, CancellationToken cancellationToken = default)public IAsyncEnumerable<StateChangeNotification> ObserveChangesAsync(StateObserveRequest request, CancellationToken cancellationToken = default)public IAsyncEnumerable<TreeMetricsSnapshot> ObserveMetricsAsync(TreeMetricsRequest request, CancellationToken cancellationToken = default)
Orleans.Lattice.Api.State.Grpc.LatticeStateApiGrpcOptions
Source (line 7).
public sealed class LatticeStateApiGrpcOptions
public bool RequireAuthorizationpublic string CredentialHeaderNamepublic string ActiveTenantHeaderNamepublic string CredentialSchemepublic IList<AuthSchemeDescriptor> AdvertisedAuthSchemes
Orleans.Lattice.Api.State.Grpc.LatticeStateApiGrpcServiceCollectionExtensions
Source (line 32).
public static class LatticeStateApiGrpcServiceCollectionExtensions
public static IServiceCollection AddLatticeStateApiGrpc(this IServiceCollection services, Action<LatticeStateApiGrpcOptions>? configure = null)public static IEndpointRouteBuilder MapLatticeStateApiGrpc(this IEndpointRouteBuilder endpoints)
Orleans.Lattice.Api.State.Grpc.AuthSchemeAdvertisement
Source (line 12).
public sealed record AuthSchemeAdvertisement
public IReadOnlyList<AuthSchemeDescriptor> Schemes
Orleans.Lattice.Api.State.Grpc.AuthSchemeAdvertisementRequest
Source (line 11).
public sealed record AuthSchemeAdvertisementRequest
Orleans.Lattice.Api.State.Grpc.AuthSchemeDescriptor
Source (line 19).
public sealed record AuthSchemeDescriptor
public required string SchemeIdpublic string DisplayNamepublic IReadOnlyDictionary<string, string> Parameters
Orleans.Lattice.Api.State.Grpc.DeadLetterCountRequest
Source (line 11).
public sealed record DeadLetterCountRequest
public required string TreeId
Orleans.Lattice.Api.State.Grpc.DeadLetterCountResponse
Source (line 12).
public sealed record DeadLetterCountResponse
public required string TreeIdpublic int Count
Orleans.Lattice.Api.State.Grpc.EntryGetRequest
Source (line 11).
public sealed record EntryGetRequest
public required string TreeIdpublic required string Key
Orleans.Lattice.Api.State.Grpc.EntryGetResponse
Source (line 11).
public sealed record EntryGetResponse
public StateQueryStatus Statuspublic required string TreeIdpublic required string Keypublic EntryRecord? Entry
Orleans.Lattice.Api.State.Grpc.EntryHistoryResponse
Source (line 13).
public sealed record EntryHistoryResponse
public StateQueryStatus Statuspublic required string TreeIdpublic required string Keypublic IReadOnlyList<EntryRevisionRecord> Revisionspublic string? ContinuationTokenpublic EntryHistoryBound Boundpublic HybridLogicalClock EarliestAvailable
Orleans.Lattice.Api.State.Grpc.EntryScanCancelResponse
Source (line 13).
public sealed record EntryScanCancelResponse
Orleans.Lattice.Api.State.Grpc.EntryScanResponse
Source (line 12).
public sealed record EntryScanResponse
public StateQueryStatus Statuspublic required string TreeIdpublic IReadOnlyList<EntryRecord> Entriespublic string? ContinuationToken
Orleans.Lattice.Api.State.Grpc.GrpcStateTypeAliases
Source (line 15).
public static class GrpcStateTypeAliases
public const string EntryGetRequestpublic const string StructureResponsepublic const string EntryScanResponsepublic const string EntryScanCancelResponsepublic const string EntryGetResponsepublic const string EntryHistoryResponsepublic const string AuthSchemeAdvertisementRequestpublic const string AuthSchemeDescriptorpublic const string AuthSchemeAdvertisementpublic const string DeadLetterCountRequestpublic const string DeadLetterCountResponse
Orleans.Lattice.Api.State.Grpc.StructureResponse
Source (line 12).
public sealed record StructureResponse
public StateQueryStatus Statuspublic required string TreeIdpublic IReadOnlyList<NodeStateSummary> Rootspublic bool Truncated
Orleans.Lattice.Api.State.Grpc.EnvVarCredentialAuthorizer
Source (line 36).
public sealed class EnvVarCredentialAuthorizer : ILatticeStateApiAuthorizer
public EnvVarCredentialAuthorizer(IEnvironmentVariableReader environment, IOptionsMonitor<EnvVarCredentialAuthorizerOptions> options, ILogger<EnvVarCredentialAuthorizer> logger, TimeProvider? timeProvider = null)public Task<bool> IsAuthorizedAsync(LatticeStateApiAuthorizationContext authorizationContext, CancellationToken cancellationToken)
Orleans.Lattice.Api.State.Grpc.EnvVarCredentialAuthorizerOptions
Source (line 9).
public sealed class EnvVarCredentialAuthorizerOptions
public string EnvironmentVariablePrefixpublic int MaxFailedAttemptspublic TimeSpan LockoutDuration
Orleans.Lattice.Api.State.Grpc.IEnvironmentVariableReader
Source (line 8).
public interface IEnvironmentVariableReader
string? GetVariable(string name)
Orleans.Lattice.Api.State.Grpc.ProcessEnvironmentVariableReader
Source (line 24).
public sealed class ProcessEnvironmentVariableReader : IEnvironmentVariableReader
public string? GetVariable(string name)
Orleans.Lattice.Api.State.Grpc.ILatticeStateApiAuthSchemeSource
Source (line 15).
public interface ILatticeStateApiAuthSchemeSource
AuthSchemeAdvertisement GetAdvertisement()
Orleans.Lattice.Api.State.Grpc.ILatticeStateApiAuthorizer
Source (line 15).
public interface ILatticeStateApiAuthorizer
Task<bool> IsAuthorizedAsync(LatticeStateApiAuthorizationContext authorizationContext, CancellationToken cancellationToken)
Orleans.Lattice.Api.State.Grpc.DenyAllStateApiAuthorizer
Source (line 41).
public sealed class DenyAllStateApiAuthorizer : ILatticeStateApiAuthorizer
public Task<bool> IsAuthorizedAsync(LatticeStateApiAuthorizationContext authorizationContext, CancellationToken cancellationToken)
Orleans.Lattice.Api.State.Grpc.AllowAllStateApiAuthorizer
Source (line 54).
public sealed class AllowAllStateApiAuthorizer : ILatticeStateApiAuthorizer
public Task<bool> IsAuthorizedAsync(LatticeStateApiAuthorizationContext authorizationContext, CancellationToken cancellationToken)
Orleans.Lattice.Api.State.Grpc.LatticePasswordHash
Source (line 28).
public static class LatticePasswordHash
public const string AlgorithmPrefixpublic const int DefaultIterationspublic const int SaltSizeBytespublic const int DerivedKeySizeBytespublic static string Hash(string password, int iterations = DefaultIterations)public static string Encode(string password, ReadOnlySpan<byte> salt, int iterations)public static bool Verify(string? password, string? encodedHash)public static bool TryParse(string? encodedHash, out LatticePasswordHashComponents result)
Orleans.Lattice.Api.State.Grpc.LatticePasswordHashComponents
Source (line 181).
public readonly record struct LatticePasswordHashComponents(int Iterations, byte[] Salt, byte[] DerivedKey)
Orleans.Lattice.Api.State.Grpc.LatticeStateApiOperation
Source (line 11).
public enum LatticeStateApiOperation
ListTreesListViewsGetTreeStructureScanEntriesGetEntryGetEntryHistoryListTagIndexesListTagValuesListCoveredTreesListIndexTagsScanTagMembersCancelScanObserveChangesObserveMetricsGetMetricsSnapshotGetClusterInfoUnknownGetDeadLetterCountListDeadLetters
Orleans.Lattice.Api.State.Grpc.LatticeStateApiAuthorizationContext
Source (line 107).
public readonly struct LatticeStateApiAuthorizationContext
public LatticeStateApiAuthorizationContext(ServerCallContext call, LatticeStateApiOperation operation, string? targetTreeId)public ServerCallContext Callpublic LatticeStateApiOperation Operationpublic string? TargetTreeId