@spine-event-engine/auth 2.0.0-snapshot.25 → 2.0.0-snapshot.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/REFERENCE.md +42 -10
- package/dist/gateway/dynamic-unary-forwarder.d.ts +62 -3
- package/dist/gateway/dynamic-unary-forwarder.d.ts.map +1 -1
- package/dist/gateway/dynamic-unary-forwarder.js +189 -10
- package/dist/gateway/dynamic-unary-forwarder.js.map +1 -1
- package/dist/gateway/index.d.ts +5 -0
- package/dist/gateway/index.d.ts.map +1 -1
- package/dist/gateway/index.js +65 -7
- package/dist/gateway/index.js.map +1 -1
- package/dist/index.d.ts +45 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/native/index.d.ts +43 -3
- package/dist/native/index.d.ts.map +1 -1
- package/dist/native/index.js +178 -32
- package/dist/native/index.js.map +1 -1
- package/dist/request/index.d.ts +3 -0
- package/dist/request/index.d.ts.map +1 -1
- package/dist/request/index.js +17 -1
- package/dist/request/index.js.map +1 -1
- package/dist/subscriptions/index.d.ts +35 -3
- package/dist/subscriptions/index.d.ts.map +1 -1
- package/dist/subscriptions/index.js +433 -121
- package/dist/subscriptions/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -54,6 +54,32 @@ Events can refer to the exact Command that caused them. Those metadata fields
|
|
|
54
54
|
are supplied by the caller; they are not proof of identity. Queries and
|
|
55
55
|
subscription Topics receive the context supplied by the gateway resolver.
|
|
56
56
|
|
|
57
|
+
## Pass verified reader information to the application node
|
|
58
|
+
|
|
59
|
+
The gateway also forwards the admitted principal and the `authorityFacts`
|
|
60
|
+
returned by `ContextResolver.resolve()`. These facts may contain JSON values,
|
|
61
|
+
including role arrays, booleans, and nested objects. They are detached from the
|
|
62
|
+
session and resolver result before forwarding. The framework does not copy the
|
|
63
|
+
request credential into them or fetch fresh information from an identity provider.
|
|
64
|
+
Your resolver decides which facts to supply on each request.
|
|
65
|
+
|
|
66
|
+
For a browser gateway, supply the issuer through
|
|
67
|
+
`BrowserServerOptions.forwardingProof`. When assembling a native gateway,
|
|
68
|
+
configure `NativeSubscriptionCreator(transport, { issuer, maxBytes })`; a custom
|
|
69
|
+
unary forwarder must produce the same operation-bound proof. See
|
|
70
|
+
[Verified reader forwarding](REFERENCE.md#verified-reader-forwarding) for the forwarding adapters.
|
|
71
|
+
|
|
72
|
+
In either setup, configure `ServerOptions.services.readerAdmission.forwarded`
|
|
73
|
+
on the receiving application node. The issuer produces a proof for the service,
|
|
74
|
+
method, request bytes, and reader facts. The verifier checks that proof and the
|
|
75
|
+
forwarding peer. Both are replaceable application adapters. A header name, actor
|
|
76
|
+
ID, or loopback connection does not establish a verified reader.
|
|
77
|
+
|
|
78
|
+
Authenticated forwarding requires an issuer. Deliberate `publicAccess: true`
|
|
79
|
+
forwards no principal or authority facts; the gateway's public admission marker
|
|
80
|
+
does not become a user identity. See the [server reference](https://github.com/SpineEventEngine/spine-ts/blob/master/packages/server/REFERENCE.md#native-reader-admission)
|
|
81
|
+
for direct native authentication and managed forwarding configuration.
|
|
82
|
+
|
|
57
83
|
## Browser and OIDC extensions
|
|
58
84
|
|
|
59
85
|
The package does not provide HTTP routes, browser pages, users, permissions,
|
package/REFERENCE.md
CHANGED
|
@@ -7,7 +7,7 @@ Start with the [authentication overview](README.md) when choosing a gateway shap
|
|
|
7
7
|
|
|
8
8
|
The package supplies provider-neutral gateway building blocks. An application places its gateway in front of a Spine TS or Spine JVM backend, then supplies the listener, credential extraction, identity provider, session storage, authorization rules, actor/tenant resolution, and forwarding implementation. The framework does not enforce a particular proxy, route topology, identity provider, tenant policy, or deployment configuration.
|
|
9
9
|
|
|
10
|
-
`TransportFacts.from()` exposes only allowlisted request facts. Credentials are passed only to `Authenticator` or `SessionResolver`; they are not included in `IncomingRequest`. `IncomingRequest` is a discriminated union for command, query, subscription creation, activation, and cancellation. Command facts can include a decoded message when a `TypeRegistryLookup` knows its packed type; unknown and malformed `Any` values remain type-URL-only facts.
|
|
10
|
+
`TransportFacts.from()` exposes only allowlisted request facts. Credentials are passed only to `Authenticator` or `SessionResolver`; they are not included in `IncomingRequest`. `IncomingRequest` is a discriminated union for command, entity query, application query, subscription creation, activation, and cancellation. Command facts can include a decoded message when a `TypeRegistryLookup` knows its packed type; unknown and malformed `Any` values remain type-URL-only facts.
|
|
11
11
|
|
|
12
12
|
`AuthorizationPolicy.authorize()` is evaluated separately for each incoming request. `ContextResolver.resolve()` returns the trusted actor, optional tenant, timestamp, zone, and language. The caller-provided `ActorContext` must match that resolved actor and tenant, otherwise `UnaryGateway` rejects the request as `context-stale`. Backends may rely on these identity checks only when the deployment routes traffic through an application-selected gateway.
|
|
13
13
|
|
|
@@ -40,7 +40,7 @@ a failed remote cleanup remains retryable.
|
|
|
40
40
|
|
|
41
41
|
## Unary requests
|
|
42
42
|
|
|
43
|
-
`UnaryGateway` accepts `CommandService.Post`, `QueryService.Read`, and
|
|
43
|
+
`UnaryGateway` accepts `CommandService.Post`, `QueryService.Read`, `QueryService.Execute`, and
|
|
44
44
|
`AuthenticationService.ResolveContext`. Construct both `UnaryGateway` and
|
|
45
45
|
`SubscriptionGateway` with exactly one admission mode: a `SessionResolver`, or
|
|
46
46
|
`publicAccess: true`. Public access creates no login session and no synthetic
|
|
@@ -50,10 +50,37 @@ Gateway, its authorization policy admits the public principal, and its
|
|
|
50
50
|
also require finite request limits, an authorization function,
|
|
51
51
|
`ContextResolver`, clock, and the corresponding forwarding collaborator.
|
|
52
52
|
|
|
53
|
-
For Post and
|
|
53
|
+
For Post, Read, and Execute, it bounds and decodes bytes, admits the request through the selected mode, authorizes the decoded request, resolves trusted context, checks requested actor/tenant, and forwards exactly once. In authenticated mode, admission resolves the supplied session. In public mode, it uses the public admission marker and no session. The forwarder receives service, method, bytes, detached `reader` facts, and an optional cancellation signal. It does not receive credentials or extra transport facts. It returns `forwarded`, `resolved`, or a rejection reason: `request-too-large`, `unknown-operation`, `malformed-request`, `unauthenticated`, `forbidden`, or `context-stale`. Mapping a rejection to HTTP or gRPC status is the native transport adapter's job.
|
|
54
54
|
|
|
55
55
|
ResolveContext returns informational trusted actor and tenant facts in both modes. In authenticated mode, it validates the current session and also returns its expiry. In public mode, it resolves context for the framework-owned public principal and omits `expiresAt` because no session exists. It neither authorizes a business request nor creates a reusable credential. Later requests are independently admitted and authorized.
|
|
56
56
|
|
|
57
|
+
### Verified reader forwarding
|
|
58
|
+
|
|
59
|
+
`reader.principal` contains the admitted application principal's ID and string
|
|
60
|
+
attributes. `reader.authorityFacts` comes from `AuthorizedRequestContext.authorityFacts`
|
|
61
|
+
and accepts finite JSON values, including nested objects and arrays. The gateway
|
|
62
|
+
copies these values for the invocation. Public admission omits both fields even
|
|
63
|
+
if a context resolver supplies facts for the public admission marker.
|
|
64
|
+
The existing `ContextResolver` remains the replacement point for obtaining
|
|
65
|
+
application-specific authority information; there is no provider polling or
|
|
66
|
+
promise that its information remains current after resolution.
|
|
67
|
+
|
|
68
|
+
`NativeSubscriptionCreator(transport, { issuer, maxBytes })` uses the configured
|
|
69
|
+
issuer to forward that reader with each native operation. `BrowserServerOptions.forwardingProof`
|
|
70
|
+
configures the same issuer in browser composition. Its `issue(bytes)` method
|
|
71
|
+
returns a transport-safe proof. The application node's corresponding
|
|
72
|
+
`services.readerAdmission.forwarded.verify(bytes, proof, peer)` verifies the
|
|
73
|
+
forwarding peer and the assertion. The signed bytes bind the service, method,
|
|
74
|
+
canonical request, and reader facts; an Activate proof cannot authorize Cancel.
|
|
75
|
+
Internal metadata received from a caller is not accepted without that verifier.
|
|
76
|
+
|
|
77
|
+
An authenticated native forwarding call without an issuer fails rather than
|
|
78
|
+
discarding its reader identity. Configure both issuer and verifier for authenticated
|
|
79
|
+
browser forwarding. These are TS forwarding ports; merely sending
|
|
80
|
+
their metadata to a JVM backend does not add verified-reader support there.
|
|
81
|
+
Custom forwarding implementations must establish the equivalent trust at their
|
|
82
|
+
receiving boundary. Credentials and provider tokens are not forwarding fields.
|
|
83
|
+
|
|
57
84
|
## Sessions and sign-in
|
|
58
85
|
|
|
59
86
|
`OpaqueSessions` implements a bounded, process-local `SessionResolver` with random cookie credentials. Defaults are an eight-hour lifetime, 10,000 retained sessions, and three identifier attempts. It lazily removes expired entries and is terminal after `close()`. It suits local development and the supported single-Gateway shape; choose an application session strategy that meets that gateway's restart and revocation requirements.
|
|
@@ -69,10 +96,14 @@ ResolveContext returns informational trusted actor and tenant facts in both mode
|
|
|
69
96
|
`BackendSubscriptionEnvelope` is opaque to the Gateway. A custom `SubscriptionCreator` or `DynamicUnaryClient` must validate each forwarded update's subscription ID and Topic against the actual Subscription accepted by its backend. The built-in native creator performs this validation; a custom envelope does not imply the backend reused the requested child ID.
|
|
70
97
|
|
|
71
98
|
`DurableSubscriptionBindings` from `@spine-event-engine/server/browser` retains one approved
|
|
72
|
-
`GatewayAuthenticatedSubscription` per public Subscription. The
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
99
|
+
`GatewayAuthenticatedSubscription` per public Subscription. The record includes
|
|
100
|
+
the stable principal ID, while its Topic retains the trusted Actor and Tenant.
|
|
101
|
+
Activate and Cancel check all three against the newly admitted request before
|
|
102
|
+
affecting a stream or record. The same principal may reconnect with changed
|
|
103
|
+
attributes or authority facts; those facts are not persisted as its identity.
|
|
104
|
+
Explicit anonymous admission is distinct from a missing legacy binding. A
|
|
105
|
+
missing binding cannot be claimed by the next caller. This remains single-Gateway
|
|
106
|
+
persistence, not cross-process quota, reservation, lease, or fingerprint coordination.
|
|
76
107
|
|
|
77
108
|
Public subscription creation has two stages. `Subscribe` stores a process-local
|
|
78
109
|
definition and returns its ID; `Activate` must arrive within the shared
|
|
@@ -100,9 +131,10 @@ Read the [browser client and gateway guide](../../docs/BROWSER_CLIENT_AUTH_EXTEN
|
|
|
100
131
|
|
|
101
132
|
`DynamicUnaryForwarder` accepts complete current application-node snapshots. It serializes reconciliation, retains only the latest pending snapshot during churn, starts clients in bounded batches, disposes departed clients, and round-robins commands and queries across the resulting set. A dispatched unary request is never retried. Empty membership reports backend unavailability until a later snapshot restores clients.
|
|
102
133
|
|
|
103
|
-
Dynamic subscriptions use the same reconciliation
|
|
104
|
-
the logical subscription definition
|
|
105
|
-
|
|
134
|
+
Dynamic subscriptions use the same reconciliation process. Durable bindings retain
|
|
135
|
+
the logical subscription definition, trusted Actor/Tenant facts, and stable reader
|
|
136
|
+
identity; native streams and changing authority facts are per-process data.
|
|
137
|
+
Nodes may be added, removed, or re-added without
|
|
106
138
|
changing a durable definition. Notifications are best effort, may duplicate,
|
|
107
139
|
and browser clients reconnect and re-query authoritative state after loss.
|
|
108
140
|
|
|
@@ -52,13 +52,67 @@ export declare class DynamicUnaryForwarder implements UnaryForwarder {
|
|
|
52
52
|
* @param options Configures discovery clients and resource bounds.
|
|
53
53
|
*/
|
|
54
54
|
constructor(options: DynamicUnaryOptions);
|
|
55
|
+
/**
|
|
56
|
+
* Records the native child definition and its admitted logical reader.
|
|
57
|
+
*
|
|
58
|
+
* @param definition The serialized logical subscription definition.
|
|
59
|
+
* @param node Selected managed application node.
|
|
60
|
+
* @returns The child subscription definition.
|
|
61
|
+
*/
|
|
62
|
+
private childDefinition;
|
|
55
63
|
/**
|
|
56
64
|
* Builds membership operations for one connected gateway client.
|
|
57
65
|
*
|
|
58
66
|
* @param client The connected gateway client.
|
|
59
67
|
* @returns The member's forwarding and subscription operations.
|
|
60
68
|
*/
|
|
61
|
-
private
|
|
69
|
+
private memberClient;
|
|
70
|
+
/**
|
|
71
|
+
* Removes one native child and then retires its reader associations.
|
|
72
|
+
*
|
|
73
|
+
* @param client Connected member client that created this child.
|
|
74
|
+
* @param child Backend-issued child envelope.
|
|
75
|
+
* @param signal Cancellation signal for native disposal.
|
|
76
|
+
* @returns Completion after native disposal and reader cleanup.
|
|
77
|
+
*/
|
|
78
|
+
private disposeChild;
|
|
79
|
+
/**
|
|
80
|
+
* Starts a native child and tracks an assigned ID for its admitted reader.
|
|
81
|
+
*
|
|
82
|
+
* @param client Native subscription client.
|
|
83
|
+
* @param definition The serialized subscription definition.
|
|
84
|
+
* @param signal The cancellation signal for this operation.
|
|
85
|
+
* @returns The managed-child subscription.
|
|
86
|
+
*/
|
|
87
|
+
private subscribeChild;
|
|
88
|
+
/**
|
|
89
|
+
* Finds detached reader facts for one retained logical or native child definition.
|
|
90
|
+
*
|
|
91
|
+
* @param bytes The serialized message bytes.
|
|
92
|
+
* @returns The persisted reader binding field.
|
|
93
|
+
*/
|
|
94
|
+
private readerField;
|
|
95
|
+
/**
|
|
96
|
+
* Records a backend-assigned child ID to its admitted logical reader.
|
|
97
|
+
*
|
|
98
|
+
* @param association Native child attempt that produced the backend ID.
|
|
99
|
+
* @param produced Backend update produced for a subscription.
|
|
100
|
+
*/
|
|
101
|
+
private rememberProducedChild;
|
|
102
|
+
/**
|
|
103
|
+
* Records one child ID with its attempt and current logical reader.
|
|
104
|
+
*
|
|
105
|
+
* @param association Native child attempt that introduced the ID.
|
|
106
|
+
* @param childId Initial or backend-issued child ID.
|
|
107
|
+
* @param reader Current verified reader facts, if supplied.
|
|
108
|
+
*/
|
|
109
|
+
private associateChildId;
|
|
110
|
+
/**
|
|
111
|
+
* Removes only IDs still associated with this retired child attempt.
|
|
112
|
+
*
|
|
113
|
+
* @param association Native child attempt after successful disposal.
|
|
114
|
+
*/
|
|
115
|
+
private retireChild;
|
|
62
116
|
/**
|
|
63
117
|
* Checks a response-only successful child activation acknowledgement.
|
|
64
118
|
*
|
|
@@ -117,8 +171,7 @@ export declare class DynamicUnaryForwarder implements UnaryForwarder {
|
|
|
117
171
|
* @param wire Supplies the public subscription wire.
|
|
118
172
|
* @param updates Receives relayed subscription updates.
|
|
119
173
|
* @param signal Cancels update relay.
|
|
120
|
-
* @returns Completion after cancellation; rejects on unexpected child failure
|
|
121
|
-
* including bounded cleanup failure.
|
|
174
|
+
* @returns Completion after cancellation; rejects on unexpected child or bounded cleanup failure.
|
|
122
175
|
*/
|
|
123
176
|
activateDefinition(wire: PublicSubscriptionWire, updates: SubscriptionUpdateSink, signal: AbortSignal): Promise<void>;
|
|
124
177
|
/**
|
|
@@ -129,6 +182,12 @@ export declare class DynamicUnaryForwarder implements UnaryForwarder {
|
|
|
129
182
|
* @returns Completion of child cleanup.
|
|
130
183
|
*/
|
|
131
184
|
cancelDefinition(wire: PublicSubscriptionWire, signal: AbortSignal): Promise<void>;
|
|
185
|
+
/**
|
|
186
|
+
* Updates current reader facts for a retained definition and its native children.
|
|
187
|
+
*
|
|
188
|
+
* @param wire The admitted definition with current verified reader facts.
|
|
189
|
+
*/
|
|
190
|
+
private rememberReader;
|
|
132
191
|
/**
|
|
133
192
|
* Resolves when the supplied signal aborts.
|
|
134
193
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-unary-forwarder.d.ts","sourceRoot":"","sources":["../../src/gateway/dynamic-unary-forwarder.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAMjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"dynamic-unary-forwarder.d.ts","sourceRoot":"","sources":["../../src/gateway/dynamic-unary-forwarder.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAMjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAM1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAEV,sBAAsB,EACtB,mBAAmB,EACnB,sBAAsB,EAEvB,MAAM,2BAA2B,CAAC;AAEnC;;;;GAIG;AACH,MAAM,WAAW,kBAAmB,SAAQ,cAAc,EAAE,mBAAmB;IAG7E;;;;OAIG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED;;GAEG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E,sBAAsB,EAC/B,MAAM,EAAE,WAAW,EACnB,uBAAuB,CAAC,EAAE,MAAM,GAC/B,OAAO,CAAC,IAAI,CAAC;IAYhB;;;;;;OAMG;IACG,mBAAmB,CACvB,OAAO,EAAE,sBAAsB,EAC/B,uBAAuB,CAAC,EAAE,MAAM,GAC/B,OAAO,CAAC,IAAI,CAAC;IAYhB;;;;;;;OAOG;IACH,kBAAkB,CAChB,IAAI,EAAE,sBAAsB,EAC5B,OAAO,EAAE,sBAAsB,EAC/B,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,IAAI,CAAC;IAKhB;;;;;;OAMG;IACH,gBAAgB,CAAC,IAAI,EAAE,sBAAsB,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAclF;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAStB;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvD;;;;;OAKG;IACH,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS;IAI3D;;;;;;OAMG;IACH,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,eAAe,GAAG,UAAU;CAsB7E"}
|
|
@@ -15,11 +15,17 @@ import { clone, fromBinary, toBinary } from "@bufbuild/protobuf";
|
|
|
15
15
|
import { ApplicationNode } from "@spine-event-engine/deployment";
|
|
16
16
|
import { BackendMembershipKernel, } from "@spine-event-engine/deployment/spi/backend-membership";
|
|
17
17
|
import { SubscriptionSchema, SubscriptionUpdateSchema } from "@spine-event-engine/proto/client";
|
|
18
|
+
import { snapshotTrustedReader, } from "@spine-event-engine/core/spi/trusted-reader";
|
|
18
19
|
/**
|
|
19
20
|
* Adapts Gateway unary operations to the deployment-owned membership kernel.
|
|
20
21
|
* Durable logical ownership remains in the Gateway's subscription bindings.
|
|
21
22
|
*/
|
|
22
23
|
export class DynamicUnaryForwarder {
|
|
24
|
+
#readers = new Map();
|
|
25
|
+
#children = new Map();
|
|
26
|
+
#associationsById = new Map();
|
|
27
|
+
#pendingAssociations = new WeakMap();
|
|
28
|
+
#activeAssociations = new WeakMap();
|
|
23
29
|
#kernel;
|
|
24
30
|
/**
|
|
25
31
|
* Creates the Gateway adapter around the deployment membership kernel.
|
|
@@ -32,11 +38,11 @@ export class DynamicUnaryForwarder {
|
|
|
32
38
|
options.maxBackendEnvelopeBytes < 1))
|
|
33
39
|
throw new RangeError("maxBackendEnvelopeBytes must be a positive safe integer.");
|
|
34
40
|
this.#kernel = new BackendMembershipKernel({
|
|
35
|
-
create: async (node, signal) =>
|
|
41
|
+
create: async (node, signal) => this.memberClient(await options.create(node, signal)),
|
|
36
42
|
memberKey: (node) => node.id,
|
|
37
43
|
sameMember: (left, right) => left.endpoint === right.endpoint && left.tlsServerName === right.tlsServerName,
|
|
38
44
|
definitionKey: (definition) => DynamicUnaryForwarder.definitionKey(definition),
|
|
39
|
-
childDefinition: (definition, node) =>
|
|
45
|
+
childDefinition: (definition, node) => this.childDefinition(definition, node),
|
|
40
46
|
childSize: (child) => child.bytes.byteLength,
|
|
41
47
|
isActivationAck: (update) => DynamicUnaryForwarder.isActivationAck(update),
|
|
42
48
|
logicalActivationAck: (definition, childAck) => DynamicUnaryForwarder.logicalActivationAck(definition, childAck),
|
|
@@ -48,24 +54,159 @@ export class DynamicUnaryForwarder {
|
|
|
48
54
|
: { maxChildBytes: options.maxBackendEnvelopeBytes }),
|
|
49
55
|
});
|
|
50
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Records the native child definition and its admitted logical reader.
|
|
59
|
+
*
|
|
60
|
+
* @param definition The serialized logical subscription definition.
|
|
61
|
+
* @param node Selected managed application node.
|
|
62
|
+
* @returns The child subscription definition.
|
|
63
|
+
*/
|
|
64
|
+
childDefinition(definition, node) {
|
|
65
|
+
const child = DynamicUnaryForwarder.childDefinition(definition, node);
|
|
66
|
+
const logicalId = DynamicUnaryForwarder.definitionKey(definition);
|
|
67
|
+
const reader = this.#readers.get(logicalId ?? "");
|
|
68
|
+
const childId = DynamicUnaryForwarder.definitionKey(child);
|
|
69
|
+
if (logicalId !== undefined && childId !== undefined) {
|
|
70
|
+
const association = { logicalId, initialId: childId, ids: new Set() };
|
|
71
|
+
this.#pendingAssociations.set(child, association);
|
|
72
|
+
this.associateChildId(association, childId, reader);
|
|
73
|
+
}
|
|
74
|
+
return child;
|
|
75
|
+
}
|
|
51
76
|
/**
|
|
52
77
|
* Builds membership operations for one connected gateway client.
|
|
53
78
|
*
|
|
54
79
|
* @param client The connected gateway client.
|
|
55
80
|
* @returns The member's forwarding and subscription operations.
|
|
56
81
|
*/
|
|
57
|
-
|
|
82
|
+
memberClient(client) {
|
|
58
83
|
return {
|
|
59
84
|
forward: (request) => client.forward(request),
|
|
60
|
-
subscribe: (definition, signal) =>
|
|
85
|
+
subscribe: (definition, signal) => this.subscribeChild(client, definition, signal),
|
|
61
86
|
activate: (child, updates, signal) => client.activate({
|
|
62
|
-
wire: {
|
|
87
|
+
wire: {
|
|
88
|
+
kind: "backend-subscription-envelope",
|
|
89
|
+
bytes: child.bytes.slice(),
|
|
90
|
+
...this.readerField(child.bytes),
|
|
91
|
+
},
|
|
63
92
|
updates,
|
|
64
93
|
}, signal),
|
|
65
|
-
dispose: (child, signal) =>
|
|
94
|
+
dispose: (child, signal) => this.disposeChild(client, child, signal),
|
|
66
95
|
close: () => client.close(),
|
|
67
96
|
};
|
|
68
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Removes one native child and then retires its reader associations.
|
|
100
|
+
*
|
|
101
|
+
* @param client Connected member client that created this child.
|
|
102
|
+
* @param child Backend-issued child envelope.
|
|
103
|
+
* @param signal Cancellation signal for native disposal.
|
|
104
|
+
* @returns Completion after native disposal and reader cleanup.
|
|
105
|
+
*/
|
|
106
|
+
async disposeChild(client, child, signal) {
|
|
107
|
+
await client.dispose({
|
|
108
|
+
kind: "backend-subscription-envelope",
|
|
109
|
+
bytes: child.bytes.slice(),
|
|
110
|
+
...this.readerField(child.bytes),
|
|
111
|
+
}, signal);
|
|
112
|
+
const association = this.#activeAssociations.get(child);
|
|
113
|
+
if (association !== undefined)
|
|
114
|
+
this.retireChild(association);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Starts a native child and tracks an assigned ID for its admitted reader.
|
|
118
|
+
*
|
|
119
|
+
* @param client Native subscription client.
|
|
120
|
+
* @param definition The serialized subscription definition.
|
|
121
|
+
* @param signal The cancellation signal for this operation.
|
|
122
|
+
* @returns The managed-child subscription.
|
|
123
|
+
*/
|
|
124
|
+
subscribeChild(client, definition, signal) {
|
|
125
|
+
const reader = this.readerField(definition);
|
|
126
|
+
const association = this.#pendingAssociations.get(definition);
|
|
127
|
+
const result = client.subscribe({ kind: "public-subscription", bytes: definition.slice(), ...reader }, signal);
|
|
128
|
+
return result.then((child) => {
|
|
129
|
+
if (association !== undefined) {
|
|
130
|
+
this.#activeAssociations.set(child, association);
|
|
131
|
+
this.rememberProducedChild(association, child.bytes);
|
|
132
|
+
}
|
|
133
|
+
return child;
|
|
134
|
+
}, (error) => {
|
|
135
|
+
if (association !== undefined)
|
|
136
|
+
this.retireChild(association);
|
|
137
|
+
throw error;
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Finds detached reader facts for one retained logical or native child definition.
|
|
142
|
+
*
|
|
143
|
+
* @param bytes The serialized message bytes.
|
|
144
|
+
* @returns The persisted reader binding field.
|
|
145
|
+
*/
|
|
146
|
+
readerField(bytes) {
|
|
147
|
+
let id;
|
|
148
|
+
try {
|
|
149
|
+
id = DynamicUnaryForwarder.definitionKey(bytes);
|
|
150
|
+
}
|
|
151
|
+
catch {
|
|
152
|
+
return {};
|
|
153
|
+
}
|
|
154
|
+
const reader = this.#readers.get(id ?? "");
|
|
155
|
+
return reader === undefined ? {} : { reader: snapshotTrustedReader(reader) };
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Records a backend-assigned child ID to its admitted logical reader.
|
|
159
|
+
*
|
|
160
|
+
* @param association Native child attempt that produced the backend ID.
|
|
161
|
+
* @param produced Backend update produced for a subscription.
|
|
162
|
+
*/
|
|
163
|
+
rememberProducedChild(association, produced) {
|
|
164
|
+
if (this.#associationsById.get(association.initialId) !== association)
|
|
165
|
+
return;
|
|
166
|
+
let producedId;
|
|
167
|
+
try {
|
|
168
|
+
producedId = DynamicUnaryForwarder.definitionKey(produced);
|
|
169
|
+
}
|
|
170
|
+
catch {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
if (producedId === undefined)
|
|
174
|
+
return;
|
|
175
|
+
this.associateChildId(association, producedId, this.#readers.get(association.initialId));
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Records one child ID with its attempt and current logical reader.
|
|
179
|
+
*
|
|
180
|
+
* @param association Native child attempt that introduced the ID.
|
|
181
|
+
* @param childId Initial or backend-issued child ID.
|
|
182
|
+
* @param reader Current verified reader facts, if supplied.
|
|
183
|
+
*/
|
|
184
|
+
associateChildId(association, childId, reader) {
|
|
185
|
+
association.ids.add(childId);
|
|
186
|
+
const children = this.#children.get(association.logicalId) ?? new Set();
|
|
187
|
+
children.add(childId);
|
|
188
|
+
this.#children.set(association.logicalId, children);
|
|
189
|
+
this.#associationsById.set(childId, association);
|
|
190
|
+
if (reader !== undefined)
|
|
191
|
+
this.#readers.set(childId, reader);
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Removes only IDs still associated with this retired child attempt.
|
|
195
|
+
*
|
|
196
|
+
* @param association Native child attempt after successful disposal.
|
|
197
|
+
*/
|
|
198
|
+
retireChild(association) {
|
|
199
|
+
const children = this.#children.get(association.logicalId);
|
|
200
|
+
for (const id of association.ids) {
|
|
201
|
+
if (this.#associationsById.get(id) !== association)
|
|
202
|
+
continue;
|
|
203
|
+
this.#associationsById.delete(id);
|
|
204
|
+
this.#readers.delete(id);
|
|
205
|
+
children?.delete(id);
|
|
206
|
+
}
|
|
207
|
+
if (children?.size === 0)
|
|
208
|
+
this.#children.delete(association.logicalId);
|
|
209
|
+
}
|
|
69
210
|
/**
|
|
70
211
|
* Checks a response-only successful child activation acknowledgement.
|
|
71
212
|
*
|
|
@@ -114,7 +255,11 @@ export class DynamicUnaryForwarder {
|
|
|
114
255
|
* @returns Completion of backend cleanup.
|
|
115
256
|
*/
|
|
116
257
|
close() {
|
|
117
|
-
return this.#kernel.close()
|
|
258
|
+
return this.#kernel.close().finally(() => {
|
|
259
|
+
this.#readers.clear();
|
|
260
|
+
this.#children.clear();
|
|
261
|
+
this.#associationsById.clear();
|
|
262
|
+
});
|
|
118
263
|
}
|
|
119
264
|
/**
|
|
120
265
|
* Creates backend children for one logical Gateway subscription.
|
|
@@ -128,6 +273,7 @@ export class DynamicUnaryForwarder {
|
|
|
128
273
|
if (maxBackendEnvelopeBytes !== undefined &&
|
|
129
274
|
(!Number.isSafeInteger(maxBackendEnvelopeBytes) || maxBackendEnvelopeBytes < 1))
|
|
130
275
|
throw new RangeError("maxBackendEnvelopeBytes must be a positive safe integer.");
|
|
276
|
+
this.rememberReader(request);
|
|
131
277
|
return this.#kernel
|
|
132
278
|
.subscribe(request.bytes, signal, maxBackendEnvelopeBytes)
|
|
133
279
|
.catch((error) => DynamicUnaryForwarder.#gatewayError(error));
|
|
@@ -143,6 +289,7 @@ export class DynamicUnaryForwarder {
|
|
|
143
289
|
if (maxBackendEnvelopeBytes !== undefined &&
|
|
144
290
|
(!Number.isSafeInteger(maxBackendEnvelopeBytes) || maxBackendEnvelopeBytes < 1))
|
|
145
291
|
throw new RangeError("maxBackendEnvelopeBytes must be a positive safe integer.");
|
|
292
|
+
this.rememberReader(request);
|
|
146
293
|
await this.#kernel
|
|
147
294
|
.rehydrate(request.bytes, maxBackendEnvelopeBytes)
|
|
148
295
|
.catch((error) => DynamicUnaryForwarder.#gatewayError(error));
|
|
@@ -153,10 +300,10 @@ export class DynamicUnaryForwarder {
|
|
|
153
300
|
* @param wire Supplies the public subscription wire.
|
|
154
301
|
* @param updates Receives relayed subscription updates.
|
|
155
302
|
* @param signal Cancels update relay.
|
|
156
|
-
* @returns Completion after cancellation; rejects on unexpected child failure
|
|
157
|
-
* including bounded cleanup failure.
|
|
303
|
+
* @returns Completion after cancellation; rejects on unexpected child or bounded cleanup failure.
|
|
158
304
|
*/
|
|
159
305
|
activateDefinition(wire, updates, signal) {
|
|
306
|
+
this.rememberReader(wire);
|
|
160
307
|
return this.#kernel.activate(wire.bytes, updates, signal);
|
|
161
308
|
}
|
|
162
309
|
/**
|
|
@@ -167,7 +314,34 @@ export class DynamicUnaryForwarder {
|
|
|
167
314
|
* @returns Completion of child cleanup.
|
|
168
315
|
*/
|
|
169
316
|
cancelDefinition(wire, signal) {
|
|
170
|
-
|
|
317
|
+
this.rememberReader(wire);
|
|
318
|
+
return this.#kernel.cancel(wire.bytes, signal).then(() => {
|
|
319
|
+
const id = DynamicUnaryForwarder.definitionKey(wire.bytes);
|
|
320
|
+
if (id === undefined)
|
|
321
|
+
return;
|
|
322
|
+
this.#readers.delete(id);
|
|
323
|
+
for (const childId of this.#children.get(id) ?? []) {
|
|
324
|
+
this.#readers.delete(childId);
|
|
325
|
+
this.#associationsById.delete(childId);
|
|
326
|
+
}
|
|
327
|
+
this.#children.delete(id);
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Updates current reader facts for a retained definition and its native children.
|
|
332
|
+
*
|
|
333
|
+
* @param wire The admitted definition with current verified reader facts.
|
|
334
|
+
*/
|
|
335
|
+
rememberReader(wire) {
|
|
336
|
+
if (wire.reader === undefined)
|
|
337
|
+
return;
|
|
338
|
+
const id = DynamicUnaryForwarder.definitionKey(wire.bytes);
|
|
339
|
+
if (id === undefined)
|
|
340
|
+
return;
|
|
341
|
+
const reader = snapshotTrustedReader(wire.reader);
|
|
342
|
+
this.#readers.set(id, reader);
|
|
343
|
+
for (const childId of this.#children.get(id) ?? [])
|
|
344
|
+
this.#readers.set(childId, reader);
|
|
171
345
|
}
|
|
172
346
|
/**
|
|
173
347
|
* Resolves when the supplied signal aborts.
|
|
@@ -205,6 +379,11 @@ export class DynamicUnaryForwarder {
|
|
|
205
379
|
subscriptionId.value = `${id}/${node.id}`;
|
|
206
380
|
return toBinary(SubscriptionSchema, subscription);
|
|
207
381
|
}
|
|
382
|
+
/**
|
|
383
|
+
* Sanitizes a gateway failure before returning it to the caller.
|
|
384
|
+
*
|
|
385
|
+
* @param error The failure being classified or propagated.
|
|
386
|
+
*/
|
|
208
387
|
static #gatewayError(error) {
|
|
209
388
|
if (error instanceof Error && error.message === "backend membership is unavailable.")
|
|
210
389
|
throw new Error("Gateway backend is absent.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-unary-forwarder.js","sourceRoot":"","sources":["../../src/gateway/dynamic-unary-forwarder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EACL,uBAAuB,GAExB,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AA2DhG;;;GAGG;AACH,MAAM,OAAO,qBAAqB;IACvB,OAAO,CAKd;IAEF;;;;OAIG;IACH,YAAY,OAA4B;QACtC,IACE,OAAO,CAAC,uBAAuB,KAAK,SAAS;YAC7C,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,uBAAuB,CAAC;gBACrD,OAAO,CAAC,uBAAuB,GAAG,CAAC,CAAC;YAEtC,MAAM,IAAI,UAAU,CAAC,0DAA0D,CAAC,CAAC;QACnF,IAAI,CAAC,OAAO,GAAG,IAAI,uBAAuB,CAKxC;YACA,MAAM,E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MAAM,CAAC,aAAa,CAAC,KAAc;QACjC,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,OAAO,KAAK,oCAAoC;YAClF,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAChD,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,OAAO,KAAK,sCAAsC;YACpF,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;QACtD,MAAM,KAAK,CAAC;IACd,CAAC;CACF"}
|
package/dist/gateway/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { TypeRegistryLookup } from "@spine-event-engine/core";
|
|
2
|
+
import { type TrustedReaderContext } from "@spine-event-engine/core/spi/trusted-reader";
|
|
2
3
|
import type { AuthorizationPolicy, Clock, ContextResolver, RequestCredential, SessionResolver, TransportRequestContext } from "../index.js";
|
|
3
4
|
/**
|
|
4
5
|
* Owned request bytes and canonical operation identity accepted by the B2 gateway.
|
|
@@ -43,6 +44,10 @@ export interface UnaryForwarder {
|
|
|
43
44
|
readonly service: string;
|
|
44
45
|
readonly method: string;
|
|
45
46
|
readonly value: Uint8Array;
|
|
47
|
+
/**
|
|
48
|
+
* Verified reader data, detached from the session and context resolver.
|
|
49
|
+
*/
|
|
50
|
+
readonly reader?: TrustedReaderContext;
|
|
46
51
|
readonly signal?: AbortSignal;
|
|
47
52
|
}): Promise<Uint8Array>;
|
|
48
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/gateway/index.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAEV,mBAAmB,EACnB,KAAK,EACL,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/gateway/index.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,kBAAkB,EAAE,M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