QueryEngine
The read side of a node, composed once: the gateways of the three query models (the snapshots and events of each aggregate type a backend serves, the datasets), the schema catalog they compile against, which aggregates and datasets a caller sees (visibility, datasetVisibility), and the reads every entry reads a state through. A host only maps its configuration onto a Builder; the security rules are the builder's:
every gateway runs the scope policy (the tenant, the owner of the aggregates their owners hold) first, then the access policies of the aggregates that have one (AccessQueryPolicy, checked against the Manifest as the engine is built: AccessPolicies.of), then the application's policies, and is observed by the query log and the application's observers;
when an access policy or an application's policy may hide an aggregate from a caller of its scope, a type whose snapshots are not queried still has its policies evaluated on its states (SnapshotPolicyGateway), so its state reads and its events fail closed;
an aggregate the snapshot queries hide is hidden from the state reads too, and from the events model: an access policy by its filter on the access attributes each stream records, the aggregate's current ones; an application's policy, which reads the state, by pinning the events queries to the aggregates they name;
every query of the snapshots and the events runs under its store's QueryBulkhead, whichever entry asks, and an events query that names no aggregate is refused where UnpinnedEvents.REFUSE says so.
Properties
The access policies of the node's aggregates, each resolved to its aggregate.
Whether a caller that may act across scopes may query across tenants.
The events query gateways, one per aggregate type a backend serves the events of.
Who each aggregate type belongs to besides its tenant, as the Manifest says.
The policy gateways of the types whose snapshots are not queried while policies may hide one.
Every entry's state reads: read, check against visibility, mask, observed as the queries are.
The snapshot query gateways, one per aggregate type a backend serves the snapshots of.
The read side's scope rules over tenants and crossTenant: an edge builds its callers with them, and every gateway and state read checks an HTTP caller against them again (QueryTargets.recheck).
The tenant a caller's queries of each aggregate type are restricted to.
Functions
The events query gateway of type, or null when no backend serves its events.
The snapshot query gateway of type, or null when no backend serves its snapshots.
The gateway whose policies decide which of type's states a caller sees, or null when none applies.