@spine-event-engine/auth 2.0.0-snapshot.25 → 2.0.0-snapshot.28
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 +128 -11
- package/REFERENCE.md +166 -12
- 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 +60 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- 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/oidc/contracts.d.ts +18 -4
- package/dist/oidc/contracts.d.ts.map +1 -1
- package/dist/oidc/flow-store.d.ts +143 -0
- package/dist/oidc/flow-store.d.ts.map +1 -0
- package/dist/oidc/flow-store.js +184 -0
- package/dist/oidc/flow-store.js.map +1 -0
- package/dist/oidc/index.d.ts +29 -9
- package/dist/oidc/index.d.ts.map +1 -1
- package/dist/oidc/index.js +611 -152
- package/dist/oidc/index.js.map +1 -1
- package/dist/oidc/persistent-flow-store.d.ts +117 -0
- package/dist/oidc/persistent-flow-store.d.ts.map +1 -0
- package/dist/oidc/persistent-flow-store.js +413 -0
- package/dist/oidc/persistent-flow-store.js.map +1 -0
- package/dist/oidc/records.d.ts +15 -0
- package/dist/oidc/records.d.ts.map +1 -0
- package/dist/oidc/records.js +91 -0
- package/dist/oidc/records.js.map +1 -0
- package/dist/providers/index.d.ts +10 -5
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +103 -30
- package/dist/providers/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/sessions/cookies.d.ts +46 -8
- package/dist/sessions/cookies.d.ts.map +1 -1
- package/dist/sessions/cookies.js +269 -47
- package/dist/sessions/cookies.js.map +1 -1
- package/dist/sessions/opaque-session-store.d.ts +143 -0
- package/dist/sessions/opaque-session-store.d.ts.map +1 -0
- package/dist/sessions/opaque-session-store.js +185 -0
- package/dist/sessions/opaque-session-store.js.map +1 -0
- package/dist/sessions/opaque.d.ts +93 -106
- package/dist/sessions/opaque.d.ts.map +1 -1
- package/dist/sessions/opaque.js +501 -232
- package/dist/sessions/opaque.js.map +1 -1
- package/dist/sessions/persistent-opaque-session-store.d.ts +105 -0
- package/dist/sessions/persistent-opaque-session-store.d.ts.map +1 -0
- package/dist/sessions/persistent-opaque-session-store.js +333 -0
- package/dist/sessions/persistent-opaque-session-store.js.map +1 -0
- package/dist/sessions/persistent-token-revocations.d.ts +90 -0
- package/dist/sessions/persistent-token-revocations.d.ts.map +1 -0
- package/dist/sessions/persistent-token-revocations.js +422 -0
- package/dist/sessions/persistent-token-revocations.js.map +1 -0
- package/dist/sessions/session-lifetime.d.ts +67 -0
- package/dist/sessions/session-lifetime.d.ts.map +1 -0
- package/dist/sessions/session-lifetime.js +165 -0
- package/dist/sessions/session-lifetime.js.map +1 -0
- package/dist/sessions/session-record.d.ts +15 -0
- package/dist/sessions/session-record.d.ts.map +1 -0
- package/dist/sessions/session-record.js +109 -0
- package/dist/sessions/session-record.js.map +1 -0
- package/dist/sessions/signed.d.ts +5 -4
- package/dist/sessions/signed.d.ts.map +1 -1
- package/dist/sessions/signed.js +212 -74
- package/dist/sessions/signed.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 +680 -134
- package/dist/subscriptions/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +20 -6
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EACV,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,MAAM,EACP,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,KAAK,KAAK,EACV,KAAK,YAAY,EACjB,KAAK,MAAM,EACX,KAAK,KAAK,EACX,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,uBAAuB;IAGtC;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAEhC;;OAEG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAC/C,uBAAuB,EACvB,WAAW,GAAG,eAAe,CAC9B;IAGC;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;CACjE;AAED;;GAEG;AAC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YAAY,EACV,kBAAkB,EAClB,yBAAyB,EACzB,yBAAyB,EACzB,mBAAmB,EACnB,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,kBAAkB,EAClB,wBAAwB,EACxB,yBAAyB,EACzB,mBAAmB,EACnB,2BAA2B,EAC3B,uBAAuB,EACvB,4BAA4B,EAC5B,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,uBAAuB,EACvB,wBAAwB,EACxB,gBAAgB,EAChB,eAAe,EACf,6BAA6B,EAC7B,qBAAqB,EACrB,sBAAsB,EACtB,aAAa,EACb,qBAAqB,EACrB,sBAAsB,EACtB,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,4BAA4B,EAC5B,2BAA2B,GAC5B,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,EACnB,aAAa,GACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,qBAAqB,EACrB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GACzB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -51,6 +51,10 @@ const TransportFactsValues = Object.freeze({
|
|
|
51
51
|
export { UnaryGateway } from "./gateway/index.js";
|
|
52
52
|
export { OpaqueSessionCookies } from "./sessions/cookies.js";
|
|
53
53
|
export { OpaqueSessions } from "./sessions/opaque.js";
|
|
54
|
+
export { MemoryOpaqueSessionStore } from "./sessions/opaque-session-store.js";
|
|
55
|
+
export { PersistentOpaqueSessionStore } from "./sessions/persistent-opaque-session-store.js";
|
|
56
|
+
export { PersistentOidcFlowStore } from "./oidc/persistent-flow-store.js";
|
|
57
|
+
export { PersistentTokenRevocations } from "./sessions/persistent-token-revocations.js";
|
|
54
58
|
export { SignedSessions } from "./sessions/signed.js";
|
|
55
59
|
export { OidcFlow } from "./oidc/index.js";
|
|
56
60
|
export { createGitHubProvider, createGoogleProvider, createOidcProvider, discoverOidcProvider, } from "./providers/index.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAaH,OAAO,EAMN,MAAM,kCAAkC,CAAC;AAmmB1C;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAgC,MAAM,CAAC,MAAM,CAAC;IACvE,kBAAkB;IAElB;;;;OAIG;IACH,IAAI,CAAC,KAA0B;QAC7B,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,CAChC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC;aAChC,MAAM,CAAC,CAAC,KAAK,EAA6B,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;aACpE,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,KAAK,CAAC,CAAC,CACvD,CAAC;QACF,OAAO,oBAAoB,CAAC,OAAO,CAAC;YAClC,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,SAAS,EAAE,OAAO,CAAC,cAAc,CAAC;YAClC,aAAa,EAAE,OAAO,CAAC,kBAAkB,CAAC;YAC1C,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,SAAS,EAAE,KAAK,CAAC,SAAS;SAC3B,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AACH,O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
|
import { type HandlerContext, type ServiceImpl, type Transport } from "@connectrpc/connect";
|
|
2
2
|
import { CommandService, QueryService, SubscriptionService, type SubscriptionUpdate } from "@spine-event-engine/proto/client";
|
|
3
3
|
import { AuthenticationService } from "@spine-event-engine/proto/auth";
|
|
4
|
+
import { type ReaderProofIssuer } from "@spine-event-engine/core/spi/reader-forwarding";
|
|
5
|
+
import type { TrustedReaderContext } from "@spine-event-engine/core/spi/trusted-reader";
|
|
4
6
|
import type { UnaryForwarder, UnaryGateway } from "../gateway/index.js";
|
|
5
7
|
import type { RequestCredential, TransportRequestContext } from "../index.js";
|
|
6
8
|
import type { BackendSubscriptionEnvelope, PublicSubscriptionWire, SubscriptionAbortSignal, SubscriptionCreator, SubscriptionUpdateSink, SubscriptionUpdateWire, SubscriptionGateway } from "../subscriptions/index.js";
|
|
@@ -25,12 +27,14 @@ export declare class SubscriptionUpdateRelay implements AsyncIterable<Subscripti
|
|
|
25
27
|
#private;
|
|
26
28
|
/**
|
|
27
29
|
* Creates a bounded FIFO relay.
|
|
30
|
+
*
|
|
28
31
|
* @param limits The optional message and byte bounds.
|
|
29
32
|
*/
|
|
30
33
|
constructor(limits?: SubscriptionRelayLimits);
|
|
31
34
|
/**
|
|
32
35
|
* Copies and validates an update before FIFO admission. Count precedes bytes;
|
|
33
36
|
* either bound rejects with `ResourceExhausted`.
|
|
37
|
+
*
|
|
34
38
|
* @param update The update bytes to admit.
|
|
35
39
|
* @returns Completes after the update is admitted or rejected.
|
|
36
40
|
*/
|
|
@@ -41,11 +45,13 @@ export declare class SubscriptionUpdateRelay implements AsyncIterable<Subscripti
|
|
|
41
45
|
close(): void;
|
|
42
46
|
/**
|
|
43
47
|
* Throws queued and future consumers, purging bytes.
|
|
48
|
+
*
|
|
44
49
|
* @param reason The terminal failure reason.
|
|
45
50
|
*/
|
|
46
51
|
fail(reason: unknown): void;
|
|
47
52
|
/**
|
|
48
53
|
* Returns the public iterator; `return()` cancels it and purges queued bytes, while `throw()` fails it.
|
|
54
|
+
*
|
|
49
55
|
* @returns The single public update iterator.
|
|
50
56
|
*/
|
|
51
57
|
[Symbol.asyncIterator](): AsyncIterator<SubscriptionUpdate>;
|
|
@@ -53,18 +59,26 @@ export declare class SubscriptionUpdateRelay implements AsyncIterable<Subscripti
|
|
|
53
59
|
/**
|
|
54
60
|
* Native Connect adapter. Post/Read use their matching Command/Query descriptors;
|
|
55
61
|
* Subscribe/Activate/Cancel/Dispose use the shared Subscription descriptors.
|
|
56
|
-
*
|
|
62
|
+
* Native requests carry the admitted cancellation signal and, when an issuer is
|
|
63
|
+
* configured, operation-bound internal headers with detached verified reader
|
|
64
|
+
* facts. Browser credentials and raw transport facts are not forwarded.
|
|
57
65
|
*/
|
|
58
66
|
export declare class NativeSubscriptionCreator implements SubscriptionCreator, UnaryForwarder {
|
|
59
67
|
#private;
|
|
60
68
|
/**
|
|
61
69
|
* Creates a native adapter over one Connect transport.
|
|
70
|
+
*
|
|
62
71
|
* @param transport The native Connect transport.
|
|
72
|
+
* @param forwarding Configured peer proof issuer and existing request-size bound.
|
|
63
73
|
*/
|
|
64
|
-
constructor(transport: Transport
|
|
74
|
+
constructor(transport: Transport, forwarding?: {
|
|
75
|
+
readonly issuer: ReaderProofIssuer;
|
|
76
|
+
readonly maxBytes: number;
|
|
77
|
+
});
|
|
65
78
|
/**
|
|
66
79
|
* Sends an admitted Post or Read envelope through its matching native descriptor.
|
|
67
80
|
* Removes the backend transport's media type from errors before a gateway serializes them.
|
|
81
|
+
*
|
|
68
82
|
* @param request The admitted unary request envelope.
|
|
69
83
|
* @returns The encoded native response.
|
|
70
84
|
*/
|
|
@@ -72,10 +86,24 @@ export declare class NativeSubscriptionCreator implements SubscriptionCreator, U
|
|
|
72
86
|
readonly service: string;
|
|
73
87
|
readonly method: string;
|
|
74
88
|
readonly value: Uint8Array;
|
|
89
|
+
readonly reader?: TrustedReaderContext;
|
|
75
90
|
readonly signal?: AbortSignal;
|
|
76
91
|
}): Promise<Uint8Array>;
|
|
92
|
+
/**
|
|
93
|
+
* Builds peer-authenticated metadata for an admitted unary request.
|
|
94
|
+
*
|
|
95
|
+
* @param request Admitted operation and trusted reader facts.
|
|
96
|
+
* @returns Headers for the configured native forwarding peer.
|
|
97
|
+
*/
|
|
98
|
+
readerHeaders(request: {
|
|
99
|
+
readonly service: string;
|
|
100
|
+
readonly method: string;
|
|
101
|
+
readonly value: Uint8Array;
|
|
102
|
+
readonly reader?: TrustedReaderContext | undefined;
|
|
103
|
+
}): Promise<Readonly<Record<string, string>> | undefined>;
|
|
77
104
|
/**
|
|
78
105
|
* Creates a native subscription with the supplied admitted cancellation signal.
|
|
106
|
+
*
|
|
79
107
|
* @param request The admitted canonical subscription definition.
|
|
80
108
|
* @param signal The admitted cancellation signal.
|
|
81
109
|
* @returns The private backend subscription envelope.
|
|
@@ -83,6 +111,7 @@ export declare class NativeSubscriptionCreator implements SubscriptionCreator, U
|
|
|
83
111
|
subscribe(request: PublicSubscriptionWire, signal: SubscriptionAbortSignal): Promise<BackendSubscriptionEnvelope>;
|
|
84
112
|
/**
|
|
85
113
|
* Streams native Activate updates through the supplied asynchronous public-update sink.
|
|
114
|
+
*
|
|
86
115
|
* @param request The private native subscription envelope and update sink.
|
|
87
116
|
* @param signal The admitted cancellation signal.
|
|
88
117
|
* @returns Completes after native activation ends.
|
|
@@ -91,8 +120,16 @@ export declare class NativeSubscriptionCreator implements SubscriptionCreator, U
|
|
|
91
120
|
readonly wire: BackendSubscriptionEnvelope;
|
|
92
121
|
readonly updates: SubscriptionUpdateSink;
|
|
93
122
|
}, signal: SubscriptionAbortSignal): Promise<void>;
|
|
123
|
+
/**
|
|
124
|
+
* Rejects a child update from a different subscription or Topic.
|
|
125
|
+
*
|
|
126
|
+
* @param subscription The subscription definition being processed.
|
|
127
|
+
* @param update Native subscription update.
|
|
128
|
+
*/
|
|
129
|
+
private checkUpdate;
|
|
94
130
|
/**
|
|
95
131
|
* Cancels the native subscription represented by the canonical definition.
|
|
132
|
+
*
|
|
96
133
|
* @param request The canonical subscription definition.
|
|
97
134
|
* @param signal The admitted cancellation signal.
|
|
98
135
|
* @returns Completes after native cancellation ends.
|
|
@@ -102,6 +139,7 @@ export declare class NativeSubscriptionCreator implements SubscriptionCreator, U
|
|
|
102
139
|
}, signal: SubscriptionAbortSignal): Promise<void>;
|
|
103
140
|
/**
|
|
104
141
|
* Performs mandatory native cancellation/disposal compensation for a private envelope.
|
|
142
|
+
*
|
|
105
143
|
* @param envelope The private backend subscription envelope.
|
|
106
144
|
* @param signal The admitted cancellation signal.
|
|
107
145
|
* @returns Completes after native disposal ends.
|
|
@@ -114,12 +152,14 @@ export declare class NativeSubscriptionCreator implements SubscriptionCreator, U
|
|
|
114
152
|
export interface NativeGatewayRequestContext {
|
|
115
153
|
/**
|
|
116
154
|
* Reads credentials for the gateway only; they are never forwarded to native services.
|
|
155
|
+
*
|
|
117
156
|
* @param context The incoming Connect handler context.
|
|
118
157
|
* @returns The extracted request credential.
|
|
119
158
|
*/
|
|
120
159
|
credential(context: HandlerContext): RequestCredential | undefined;
|
|
121
160
|
/**
|
|
122
161
|
* Reads the allowlisted authorization and diagnostic transport view for the gateway only.
|
|
162
|
+
*
|
|
123
163
|
* @param context The incoming Connect handler context.
|
|
124
164
|
* @returns The allowed transport facts.
|
|
125
165
|
*/
|
|
@@ -169,13 +209,13 @@ export interface NativeGatewayServicesOptions {
|
|
|
169
209
|
}
|
|
170
210
|
/**
|
|
171
211
|
* Creates native handlers without exposing private envelopes.
|
|
172
|
-
*
|
|
173
212
|
* Unauthenticated requests map to `Unauthenticated`; forbidden or denied requests to
|
|
174
213
|
* `PermissionDenied`; request/capacity limits to `ResourceExhausted`; busy bindings to `Aborted`;
|
|
175
214
|
* and unknown operations to `Unimplemented`. Malformed, stale-context, backend-envelope, and other
|
|
176
215
|
* validation rejections map to `InvalidArgument`. Terminal context/iterator paths abort native
|
|
177
216
|
* work. Natural completion drains FIFO updates, whereas failure or iterator cancellation purges
|
|
178
217
|
* them.
|
|
218
|
+
*
|
|
179
219
|
* @param options The unary, subscription, context, and relay dependencies.
|
|
180
220
|
* @returns The native Connect service implementations.
|
|
181
221
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/native/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,SAAS,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,cAAc,EACd,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/native/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,SAAS,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,cAAc,EACd,YAAY,EAOZ,mBAAmB,EAInB,KAAK,kBAAkB,EACxB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAsB,MAAM,qBAAqB,CAAC;AAC5F,OAAO,KAAK,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,KAAK,EACV,2BAA2B,EAC3B,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EAEpB,MAAM,2BAA2B,CAAC;AAEnC;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IAGtC;;OAEG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAOD;;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,mBAAmB,CAAC,CAAC;CAChE;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAG3C;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAE,mBAAmB,CAAC;IAE5C;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,2BAA2B,CAAC;IAE/C;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,uBAAuB,CAAC;CAC1C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,4BAA4B,GACpC,qBAAqB,CAkBvB"}
|
package/dist/native/index.js
CHANGED
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { clone, create, equals, fromBinary, toBinary } from "@bufbuild/protobuf";
|
|
15
15
|
import { Code, ConnectError, createClient, } from "@connectrpc/connect";
|
|
16
|
-
import { CommandService, QueryService, SubscriptionSchema, SubscriptionService, SubscriptionUpdateSchema, TopicSchema, } from "@spine-event-engine/proto/client";
|
|
16
|
+
import { CommandService, QueryService, AppQuerySchema, SubscriptionSchema, SubscriptionService, SubscriptionUpdateSchema, TopicSchema, } from "@spine-event-engine/proto/client";
|
|
17
17
|
import { AuthenticationService } from "@spine-event-engine/proto/auth";
|
|
18
|
+
import { ReaderForwarding, } from "@spine-event-engine/core/spi/reader-forwarding";
|
|
18
19
|
const relayDefaults = {
|
|
19
20
|
maxMessages: 64,
|
|
20
21
|
maxBytes: 1_048_576,
|
|
@@ -31,6 +32,7 @@ export class SubscriptionUpdateRelay {
|
|
|
31
32
|
#closed = false;
|
|
32
33
|
/**
|
|
33
34
|
* Creates a bounded FIFO relay.
|
|
35
|
+
*
|
|
34
36
|
* @param limits The optional message and byte bounds.
|
|
35
37
|
*/
|
|
36
38
|
constructor(limits = {}) {
|
|
@@ -39,6 +41,7 @@ export class SubscriptionUpdateRelay {
|
|
|
39
41
|
/**
|
|
40
42
|
* Copies and validates an update before FIFO admission. Count precedes bytes;
|
|
41
43
|
* either bound rejects with `ResourceExhausted`.
|
|
44
|
+
*
|
|
42
45
|
* @param update The update bytes to admit.
|
|
43
46
|
* @returns Completes after the update is admitted or rejected.
|
|
44
47
|
*/
|
|
@@ -86,6 +89,7 @@ export class SubscriptionUpdateRelay {
|
|
|
86
89
|
}
|
|
87
90
|
/**
|
|
88
91
|
* Throws queued and future consumers, purging bytes.
|
|
92
|
+
*
|
|
89
93
|
* @param reason The terminal failure reason.
|
|
90
94
|
*/
|
|
91
95
|
fail(reason) {
|
|
@@ -93,6 +97,7 @@ export class SubscriptionUpdateRelay {
|
|
|
93
97
|
}
|
|
94
98
|
/**
|
|
95
99
|
* Returns the public iterator; `return()` cancels it and purges queued bytes, while `throw()` fails it.
|
|
100
|
+
*
|
|
96
101
|
* @returns The single public update iterator.
|
|
97
102
|
*/
|
|
98
103
|
[Symbol.asyncIterator]() {
|
|
@@ -108,7 +113,11 @@ export class SubscriptionUpdateRelay {
|
|
|
108
113
|
},
|
|
109
114
|
};
|
|
110
115
|
}
|
|
111
|
-
|
|
116
|
+
/**
|
|
117
|
+
* Dequeues the next native update or waits for stream progress.
|
|
118
|
+
*
|
|
119
|
+
* @returns The next iterator result.
|
|
120
|
+
*/ async #next() {
|
|
112
121
|
const bytes = this.#queue.shift();
|
|
113
122
|
if (bytes !== undefined) {
|
|
114
123
|
this.#bytes -= bytes.byteLength;
|
|
@@ -129,12 +138,22 @@ export class SubscriptionUpdateRelay {
|
|
|
129
138
|
}
|
|
130
139
|
return new Promise((resolve, reject) => this.#waiters.push({ resolve, reject }));
|
|
131
140
|
}
|
|
132
|
-
|
|
141
|
+
/**
|
|
142
|
+
* Fails a native update stream after its queue limit is exceeded.
|
|
143
|
+
*
|
|
144
|
+
* @param dimension Subscription limit dimension being checked.
|
|
145
|
+
* @param limit Configured operation bound.
|
|
146
|
+
* @param observed Observed subscription or lifecycle state.
|
|
147
|
+
*/ #failOverflow(dimension, limit, observed) {
|
|
133
148
|
const error = new ConnectError(`subscription relay ${dimension} limit ${String(limit)} exceeded by ${String(observed)}`, Code.ResourceExhausted);
|
|
134
149
|
this.#finish(error);
|
|
135
150
|
throw error;
|
|
136
151
|
}
|
|
137
|
-
|
|
152
|
+
/**
|
|
153
|
+
* Completes a native update stream and releases queued listeners.
|
|
154
|
+
*
|
|
155
|
+
* @param reason Failure reason returned to the caller.
|
|
156
|
+
*/ #finish(reason) {
|
|
138
157
|
if (this.#closed) {
|
|
139
158
|
if (this.#terminal !== undefined || reason === undefined)
|
|
140
159
|
return;
|
|
@@ -181,45 +200,102 @@ const NativeRelayValues = Object.freeze({
|
|
|
181
200
|
/**
|
|
182
201
|
* Native Connect adapter. Post/Read use their matching Command/Query descriptors;
|
|
183
202
|
* Subscribe/Activate/Cancel/Dispose use the shared Subscription descriptors.
|
|
184
|
-
*
|
|
203
|
+
* Native requests carry the admitted cancellation signal and, when an issuer is
|
|
204
|
+
* configured, operation-bound internal headers with detached verified reader
|
|
205
|
+
* facts. Browser credentials and raw transport facts are not forwarded.
|
|
185
206
|
*/
|
|
186
207
|
export class NativeSubscriptionCreator {
|
|
187
208
|
#transport;
|
|
209
|
+
#issuer;
|
|
210
|
+
#maxBytes;
|
|
188
211
|
/**
|
|
189
212
|
* Creates a native adapter over one Connect transport.
|
|
213
|
+
*
|
|
190
214
|
* @param transport The native Connect transport.
|
|
215
|
+
* @param forwarding Configured peer proof issuer and existing request-size bound.
|
|
191
216
|
*/
|
|
192
|
-
constructor(transport) {
|
|
217
|
+
constructor(transport, forwarding) {
|
|
193
218
|
this.#transport = transport;
|
|
219
|
+
this.#issuer = forwarding?.issuer;
|
|
220
|
+
this.#maxBytes = forwarding?.maxBytes ?? 4 * 1024 * 1024;
|
|
194
221
|
}
|
|
195
222
|
/**
|
|
196
223
|
* Sends an admitted Post or Read envelope through its matching native descriptor.
|
|
197
224
|
* Removes the backend transport's media type from errors before a gateway serializes them.
|
|
225
|
+
*
|
|
198
226
|
* @param request The admitted unary request envelope.
|
|
199
227
|
* @returns The encoded native response.
|
|
200
228
|
*/
|
|
201
229
|
async forward(request) {
|
|
202
230
|
try {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
if (request.service === "spine.client.QueryService" && request.method === "Read")
|
|
206
|
-
return toBinary(QueryService.method.read.output, await createClient(QueryService, this.#transport).read(fromBinary(QueryService.method.read.input, request.value), ...(request.signal === undefined ? [] : [{ signal: request.signal }])));
|
|
207
|
-
throw new ConnectError("unsupported native unary operation", Code.Unimplemented);
|
|
231
|
+
const headers = request.reader === undefined ? undefined : await this.readerHeaders(request);
|
|
232
|
+
return await this.#forwardResponse(request, headers);
|
|
208
233
|
}
|
|
209
234
|
catch (error) {
|
|
210
235
|
throw NativeGatewayValues.publicError(error);
|
|
211
236
|
}
|
|
212
237
|
}
|
|
238
|
+
/**
|
|
239
|
+
* Invokes the selected native unary descriptor using admitted headers and cancellation.
|
|
240
|
+
*
|
|
241
|
+
* @param request The canonical operation and wire bytes.
|
|
242
|
+
* @param headers Forwarded verified-reader proof, when configured.
|
|
243
|
+
* @returns Serialized native response bytes.
|
|
244
|
+
*/
|
|
245
|
+
async #forwardResponse(request, headers) {
|
|
246
|
+
const options = {
|
|
247
|
+
...(request.signal === undefined ? {} : { signal: request.signal }),
|
|
248
|
+
...(headers === undefined ? {} : { headers }),
|
|
249
|
+
};
|
|
250
|
+
if (request.service === "spine.client.CommandService" && request.method === "Post")
|
|
251
|
+
return toBinary(CommandService.method.post.output, await createClient(CommandService, this.#transport).post(fromBinary(CommandService.method.post.input, request.value), options));
|
|
252
|
+
if (request.service === "spine.client.QueryService" && request.method === "Read")
|
|
253
|
+
return toBinary(QueryService.method.read.output, await createClient(QueryService, this.#transport).read(fromBinary(QueryService.method.read.input, request.value), options));
|
|
254
|
+
if (request.service === "spine.client.QueryService" && request.method === "Execute")
|
|
255
|
+
return toBinary(QueryService.method.execute.output, await createClient(QueryService, this.#transport).execute(fromBinary(QueryService.method.execute.input, request.value), options));
|
|
256
|
+
throw new ConnectError("unsupported native unary operation", Code.Unimplemented);
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Builds peer-authenticated metadata for an admitted unary request.
|
|
260
|
+
*
|
|
261
|
+
* @param request Admitted operation and trusted reader facts.
|
|
262
|
+
* @returns Headers for the configured native forwarding peer.
|
|
263
|
+
*/
|
|
264
|
+
async readerHeaders(request) {
|
|
265
|
+
if (request.reader === undefined)
|
|
266
|
+
return undefined;
|
|
267
|
+
if (this.#issuer === undefined) {
|
|
268
|
+
if (request.reader.principal !== undefined || request.reader.authorityFacts !== undefined)
|
|
269
|
+
throw new Error("Authenticated forwarding requires a configured proof issuer.");
|
|
270
|
+
return undefined;
|
|
271
|
+
}
|
|
272
|
+
return ReaderForwarding.seal(request.service, request.method, request.value, request.reader, this.#issuer, this.#maxBytes);
|
|
273
|
+
}
|
|
213
274
|
/**
|
|
214
275
|
* Creates a native subscription with the supplied admitted cancellation signal.
|
|
276
|
+
*
|
|
215
277
|
* @param request The admitted canonical subscription definition.
|
|
216
278
|
* @param signal The admitted cancellation signal.
|
|
217
279
|
* @returns The private backend subscription envelope.
|
|
218
280
|
*/
|
|
219
281
|
async subscribe(request, signal) {
|
|
220
282
|
try {
|
|
221
|
-
const
|
|
222
|
-
|
|
283
|
+
const topic = fromBinary(SubscriptionSchema, request.bytes).topic ?? create(TopicSchema);
|
|
284
|
+
const headers = await this.readerHeaders({
|
|
285
|
+
service: "spine.client.SubscriptionService",
|
|
286
|
+
method: "Subscribe",
|
|
287
|
+
value: toBinary(TopicSchema, topic),
|
|
288
|
+
reader: request.reader,
|
|
289
|
+
});
|
|
290
|
+
const result = await createClient(SubscriptionService, this.#transport).subscribe(topic, {
|
|
291
|
+
signal,
|
|
292
|
+
...(headers === undefined ? {} : { headers }),
|
|
293
|
+
});
|
|
294
|
+
return {
|
|
295
|
+
kind: "backend-subscription-envelope",
|
|
296
|
+
bytes: toBinary(SubscriptionSchema, result),
|
|
297
|
+
...(request.reader === undefined ? {} : { reader: request.reader }),
|
|
298
|
+
};
|
|
223
299
|
}
|
|
224
300
|
catch (error) {
|
|
225
301
|
throw NativeGatewayValues.publicError(error);
|
|
@@ -227,6 +303,7 @@ export class NativeSubscriptionCreator {
|
|
|
227
303
|
}
|
|
228
304
|
/**
|
|
229
305
|
* Streams native Activate updates through the supplied asynchronous public-update sink.
|
|
306
|
+
*
|
|
230
307
|
* @param request The private native subscription envelope and update sink.
|
|
231
308
|
* @param signal The admitted cancellation signal.
|
|
232
309
|
* @returns Completes after native activation ends.
|
|
@@ -234,14 +311,14 @@ export class NativeSubscriptionCreator {
|
|
|
234
311
|
async activate(request, signal) {
|
|
235
312
|
const subscription = fromBinary(SubscriptionSchema, request.wire.bytes);
|
|
236
313
|
try {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
314
|
+
const headers = await this.readerHeaders({
|
|
315
|
+
service: "spine.client.SubscriptionService",
|
|
316
|
+
method: "Activate",
|
|
317
|
+
value: toBinary(SubscriptionSchema, subscription),
|
|
318
|
+
reader: request.wire.reader,
|
|
319
|
+
});
|
|
320
|
+
for await (const update of createClient(SubscriptionService, this.#transport).activate(subscription, { signal, ...(headers === undefined ? {} : { headers }) })) {
|
|
321
|
+
this.checkUpdate(subscription, update);
|
|
245
322
|
await request.updates({
|
|
246
323
|
kind: "subscription-update",
|
|
247
324
|
bytes: toBinary(SubscriptionUpdateSchema, update),
|
|
@@ -252,15 +329,41 @@ export class NativeSubscriptionCreator {
|
|
|
252
329
|
throw NativeGatewayValues.publicError(error);
|
|
253
330
|
}
|
|
254
331
|
}
|
|
332
|
+
/**
|
|
333
|
+
* Rejects a child update from a different subscription or Topic.
|
|
334
|
+
*
|
|
335
|
+
* @param subscription The subscription definition being processed.
|
|
336
|
+
* @param update Native subscription update.
|
|
337
|
+
*/
|
|
338
|
+
checkUpdate(subscription, update) {
|
|
339
|
+
const topic = subscription.topic;
|
|
340
|
+
const updateTopic = update.subscription?.topic;
|
|
341
|
+
if (update.subscription?.id?.value !== subscription.id?.value ||
|
|
342
|
+
topic === undefined ||
|
|
343
|
+
updateTopic === undefined ||
|
|
344
|
+
!equals(TopicSchema, updateTopic, topic))
|
|
345
|
+
throw new Error("Backend child update does not match its subscription.");
|
|
346
|
+
}
|
|
255
347
|
/**
|
|
256
348
|
* Cancels the native subscription represented by the canonical definition.
|
|
349
|
+
*
|
|
257
350
|
* @param request The canonical subscription definition.
|
|
258
351
|
* @param signal The admitted cancellation signal.
|
|
259
352
|
* @returns Completes after native cancellation ends.
|
|
260
353
|
*/
|
|
261
354
|
async cancel(request, signal) {
|
|
262
355
|
try {
|
|
263
|
-
|
|
356
|
+
const subscription = fromBinary(SubscriptionSchema, request.wire.bytes);
|
|
357
|
+
const headers = await this.readerHeaders({
|
|
358
|
+
service: "spine.client.SubscriptionService",
|
|
359
|
+
method: "Cancel",
|
|
360
|
+
value: toBinary(SubscriptionSchema, subscription),
|
|
361
|
+
reader: request.wire.reader,
|
|
362
|
+
});
|
|
363
|
+
await createClient(SubscriptionService, this.#transport).cancel(subscription, {
|
|
364
|
+
signal,
|
|
365
|
+
...(headers === undefined ? {} : { headers }),
|
|
366
|
+
});
|
|
264
367
|
}
|
|
265
368
|
catch (error) {
|
|
266
369
|
throw NativeGatewayValues.publicError(error);
|
|
@@ -268,13 +371,24 @@ export class NativeSubscriptionCreator {
|
|
|
268
371
|
}
|
|
269
372
|
/**
|
|
270
373
|
* Performs mandatory native cancellation/disposal compensation for a private envelope.
|
|
374
|
+
*
|
|
271
375
|
* @param envelope The private backend subscription envelope.
|
|
272
376
|
* @param signal The admitted cancellation signal.
|
|
273
377
|
* @returns Completes after native disposal ends.
|
|
274
378
|
*/
|
|
275
379
|
async dispose(envelope, signal) {
|
|
276
380
|
try {
|
|
277
|
-
|
|
381
|
+
const subscription = fromBinary(SubscriptionSchema, envelope.bytes);
|
|
382
|
+
const headers = await this.readerHeaders({
|
|
383
|
+
service: "spine.client.SubscriptionService",
|
|
384
|
+
method: "Cancel",
|
|
385
|
+
value: toBinary(SubscriptionSchema, subscription),
|
|
386
|
+
reader: envelope.reader,
|
|
387
|
+
});
|
|
388
|
+
await createClient(SubscriptionService, this.#transport).cancel(subscription, {
|
|
389
|
+
signal,
|
|
390
|
+
...(headers === undefined ? {} : { headers }),
|
|
391
|
+
});
|
|
278
392
|
}
|
|
279
393
|
catch (error) {
|
|
280
394
|
throw NativeGatewayValues.publicError(error);
|
|
@@ -283,13 +397,13 @@ export class NativeSubscriptionCreator {
|
|
|
283
397
|
}
|
|
284
398
|
/**
|
|
285
399
|
* Creates native handlers without exposing private envelopes.
|
|
286
|
-
*
|
|
287
400
|
* Unauthenticated requests map to `Unauthenticated`; forbidden or denied requests to
|
|
288
401
|
* `PermissionDenied`; request/capacity limits to `ResourceExhausted`; busy bindings to `Aborted`;
|
|
289
402
|
* and unknown operations to `Unimplemented`. Malformed, stale-context, backend-envelope, and other
|
|
290
403
|
* validation rejections map to `InvalidArgument`. Terminal context/iterator paths abort native
|
|
291
404
|
* work. Natural completion drains FIFO updates, whereas failure or iterator cancellation purges
|
|
292
405
|
* them.
|
|
406
|
+
*
|
|
293
407
|
* @param options The unary, subscription, context, and relay dependencies.
|
|
294
408
|
* @returns The native Connect service implementations.
|
|
295
409
|
*/
|
|
@@ -303,8 +417,23 @@ export function createNativeGatewayServices(options) {
|
|
|
303
417
|
},
|
|
304
418
|
query: {
|
|
305
419
|
read: async (request, context) => NativeGatewayValues.queryResponse(options, request, context),
|
|
420
|
+
execute: async (request, context) => NativeGatewayValues.appQueryResponse(options, request, context),
|
|
306
421
|
},
|
|
307
|
-
subscription:
|
|
422
|
+
subscription: NativeGatewayValues.subscriptionService(options),
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Converts native Connect gateway inputs, responses, and errors.
|
|
427
|
+
*/
|
|
428
|
+
const NativeGatewayValues = Object.freeze({
|
|
429
|
+
/**
|
|
430
|
+
* Binds native subscription handlers to the existing gateway policy.
|
|
431
|
+
*
|
|
432
|
+
* @param options Subscription gateway and request facts.
|
|
433
|
+
* @returns Connect implementation for subscription lifecycle methods.
|
|
434
|
+
*/
|
|
435
|
+
subscriptionService(options) {
|
|
436
|
+
return {
|
|
308
437
|
subscribe: async (request, context) => {
|
|
309
438
|
const result = await options.subscriptions.handle(NativeGatewayValues.subscriptionRequest("Subscribe", toBinary(TopicSchema, request), context, options.requests));
|
|
310
439
|
if (result.kind !== "subscribed")
|
|
@@ -318,15 +447,11 @@ export function createNativeGatewayServices(options) {
|
|
|
318
447
|
throw NativeGatewayValues.gatewayResultError(result);
|
|
319
448
|
return create(SubscriptionService.method.cancel.output);
|
|
320
449
|
},
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
/**
|
|
325
|
-
* Converts native Connect gateway inputs, responses, and errors.
|
|
326
|
-
*/
|
|
327
|
-
const NativeGatewayValues = Object.freeze({
|
|
450
|
+
};
|
|
451
|
+
},
|
|
328
452
|
/**
|
|
329
453
|
* Removes backend transport headers before another Connect server serializes the error.
|
|
454
|
+
*
|
|
330
455
|
* @param error The native RPC failure.
|
|
331
456
|
* @returns The original failure with application metadata and details retained.
|
|
332
457
|
*/
|
|
@@ -406,6 +531,27 @@ const NativeGatewayValues = Object.freeze({
|
|
|
406
531
|
throw NativeGatewayValues.unaryError(result);
|
|
407
532
|
return fromBinary(QueryService.method.read.output, result.value);
|
|
408
533
|
},
|
|
534
|
+
/**
|
|
535
|
+
* Maps a forwarded application request to its public Execute response.
|
|
536
|
+
*
|
|
537
|
+
* @param options Gateway collaborators for this operation.
|
|
538
|
+
* @param request Complete App Query envelope.
|
|
539
|
+
* @param context Authenticated native request context.
|
|
540
|
+
* @returns The app-node's packed paired response.
|
|
541
|
+
*/
|
|
542
|
+
async appQueryResponse(options, request, context) {
|
|
543
|
+
const result = await options.unary.handle({
|
|
544
|
+
service: "spine.client.QueryService",
|
|
545
|
+
method: "Execute",
|
|
546
|
+
value: toBinary(AppQuerySchema, request),
|
|
547
|
+
credential: options.requests.credential(context),
|
|
548
|
+
transport: options.requests.transport(context),
|
|
549
|
+
signal: context.signal,
|
|
550
|
+
});
|
|
551
|
+
if (result.kind === "rejected")
|
|
552
|
+
throw NativeGatewayValues.unaryError(result);
|
|
553
|
+
return fromBinary(QueryService.method.execute.output, result.value);
|
|
554
|
+
},
|
|
409
555
|
/**
|
|
410
556
|
* Activates the authenticated subscription stream.
|
|
411
557
|
*
|