@spine-event-engine/auth 2.0.0-snapshot.2

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.
Files changed (57) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +112 -0
  3. package/REFERENCE.md +94 -0
  4. package/dist/gateway/dynamic-subscription-creator.d.ts +52 -0
  5. package/dist/gateway/dynamic-subscription-creator.d.ts.map +1 -0
  6. package/dist/gateway/dynamic-subscription-creator.js +71 -0
  7. package/dist/gateway/dynamic-subscription-creator.js.map +1 -0
  8. package/dist/gateway/dynamic-unary-forwarder.d.ts +130 -0
  9. package/dist/gateway/dynamic-unary-forwarder.d.ts.map +1 -0
  10. package/dist/gateway/dynamic-unary-forwarder.js +185 -0
  11. package/dist/gateway/dynamic-unary-forwarder.js.map +1 -0
  12. package/dist/gateway/index.d.ts +164 -0
  13. package/dist/gateway/index.d.ts.map +1 -0
  14. package/dist/gateway/index.js +195 -0
  15. package/dist/gateway/index.js.map +1 -0
  16. package/dist/index.d.ts +433 -0
  17. package/dist/index.d.ts.map +1 -0
  18. package/dist/index.js +56 -0
  19. package/dist/index.js.map +1 -0
  20. package/dist/native/index.d.ts +182 -0
  21. package/dist/native/index.d.ts.map +1 -0
  22. package/dist/native/index.js +463 -0
  23. package/dist/native/index.js.map +1 -0
  24. package/dist/oidc/contracts.d.ts +334 -0
  25. package/dist/oidc/contracts.d.ts.map +1 -0
  26. package/dist/oidc/contracts.js +15 -0
  27. package/dist/oidc/contracts.js.map +1 -0
  28. package/dist/oidc/index.d.ts +41 -0
  29. package/dist/oidc/index.d.ts.map +1 -0
  30. package/dist/oidc/index.js +825 -0
  31. package/dist/oidc/index.js.map +1 -0
  32. package/dist/providers/index.d.ts +154 -0
  33. package/dist/providers/index.d.ts.map +1 -0
  34. package/dist/providers/index.js +574 -0
  35. package/dist/providers/index.js.map +1 -0
  36. package/dist/request/index.d.ts +10 -0
  37. package/dist/request/index.d.ts.map +1 -0
  38. package/dist/request/index.js +81 -0
  39. package/dist/request/index.js.map +1 -0
  40. package/dist/sessions/cookies.d.ts +104 -0
  41. package/dist/sessions/cookies.d.ts.map +1 -0
  42. package/dist/sessions/cookies.js +295 -0
  43. package/dist/sessions/cookies.js.map +1 -0
  44. package/dist/sessions/opaque.d.ts +163 -0
  45. package/dist/sessions/opaque.d.ts.map +1 -0
  46. package/dist/sessions/opaque.js +268 -0
  47. package/dist/sessions/opaque.js.map +1 -0
  48. package/dist/sessions/signed.d.ts +245 -0
  49. package/dist/sessions/signed.d.ts.map +1 -0
  50. package/dist/sessions/signed.js +534 -0
  51. package/dist/sessions/signed.js.map +1 -0
  52. package/dist/subscriptions/index.d.ts +463 -0
  53. package/dist/subscriptions/index.d.ts.map +1 -0
  54. package/dist/subscriptions/index.js +814 -0
  55. package/dist/subscriptions/index.js.map +1 -0
  56. package/dist/tsconfig.tsbuildinfo +1 -0
  57. package/package.json +37 -0
@@ -0,0 +1,334 @@
1
+ import type { AuthenticatedPrincipal, RequestCredential, ResolvedSession } from "../index.js";
2
+ /**
3
+ * Clock used to evaluate finite OIDC transactions.
4
+ */
5
+ export interface OidcFlowClock {
6
+ /**
7
+ * Returns a safe Unix epoch millisecond value in the Protobuf Timestamp range.
8
+ * @returns The current milliseconds.
9
+ */
10
+ now(): number;
11
+ }
12
+ /**
13
+ * Creates random OIDC state, nonce, and PKCE verifier material.
14
+ * @param length The required byte length.
15
+ * @returns The generated bytes.
16
+ */
17
+ export type OidcFlowRandom = (length: number) => Uint8Array;
18
+ /**
19
+ * A provider identity verified against its authorization-code response.
20
+ */
21
+ export interface ExternalIdentity {
22
+ /**
23
+ * Identifies the verified provider issuer.
24
+ */
25
+ readonly issuer: string;
26
+ /**
27
+ * Identifies the provider subject.
28
+ */
29
+ readonly subject: string;
30
+ /**
31
+ * Provides verified provider claims.
32
+ */
33
+ readonly claims?: Readonly<Record<string, string>>;
34
+ }
35
+ /**
36
+ * Application identity produced by a provider-neutral mapping.
37
+ */
38
+ export interface ResolvedApplicationIdentity {
39
+ /**
40
+ * Provides the verified provider identity.
41
+ */
42
+ readonly externalIdentity: ExternalIdentity;
43
+ /**
44
+ * Provides the mapped application principal.
45
+ */
46
+ readonly principal: AuthenticatedPrincipal;
47
+ }
48
+ /**
49
+ * Application-owned mapping from a verified external identity to a principal.
50
+ */
51
+ export interface IdentityMapping {
52
+ /**
53
+ * Resolves a verified identity to an application principal.
54
+ * @param identity The verified provider identity.
55
+ * @param signal The operation cancellation signal.
56
+ * @returns The mapped identity, or undefined when it is not admitted.
57
+ */
58
+ resolve(identity: ExternalIdentity, signal: AbortSignal): Promise<ResolvedApplicationIdentity | undefined>;
59
+ }
60
+ /**
61
+ * Input to an adapter that exchanges and verifies an authorization code.
62
+ */
63
+ export interface OidcAuthorizationCodeExchange {
64
+ /**
65
+ * Provides the provider authorization code.
66
+ */
67
+ readonly code: string;
68
+ /**
69
+ * Provides the configured OAuth client ID.
70
+ */
71
+ readonly clientId: string;
72
+ /**
73
+ * Provides the configured callback URI.
74
+ */
75
+ readonly callbackUri: string;
76
+ /**
77
+ * Provides the provider PKCE verifier.
78
+ */
79
+ readonly providerCodeVerifier: string;
80
+ /**
81
+ * Provides the nonce expected in the ID token.
82
+ */
83
+ readonly expectedNonce: string;
84
+ /**
85
+ * Cancels the provider exchange.
86
+ */
87
+ readonly signal: AbortSignal;
88
+ }
89
+ /**
90
+ * Provider-specific authorization-code and identity-verification seam.
91
+ */
92
+ export interface OidcVerifiedIdentityProvider {
93
+ /**
94
+ * Identifies the provider issuer.
95
+ */
96
+ readonly issuer: string;
97
+ /**
98
+ * Processes and verifies a provider authorization code.
99
+ * @param input The provider exchange input.
100
+ * @returns The verified identity, or undefined when verification fails.
101
+ */
102
+ exchangeAuthorizationCode(input: OidcAuthorizationCodeExchange): Promise<ExternalIdentity | undefined>;
103
+ }
104
+ /**
105
+ * Result issued by the application-selected application-session strategy.
106
+ */
107
+ export interface ApplicationSessionIssue {
108
+ /**
109
+ * Provides the issued application credential.
110
+ */
111
+ readonly credential: RequestCredential;
112
+ /**
113
+ * Provides the issued application session.
114
+ */
115
+ readonly session: ResolvedSession;
116
+ }
117
+ /**
118
+ * Application-session seam used only after a successful OIDC grant exchange.
119
+ */
120
+ export interface ApplicationSessionIssuer {
121
+ /**
122
+ * Creates an application session for a mapped principal.
123
+ * @param principal The mapped principal.
124
+ * @param signal The operation cancellation signal.
125
+ * @returns The issued session, or undefined when issuance fails.
126
+ */
127
+ issue(principal: AuthenticatedPrincipal, signal: AbortSignal): Promise<ApplicationSessionIssue | undefined>;
128
+ }
129
+ /**
130
+ * Construction options for the bounded, framework-neutral OIDC code flow.
131
+ */
132
+ export interface OidcFlowOptions {
133
+ /**
134
+ * Provides the trusted authorization endpoint.
135
+ */
136
+ readonly authorizationEndpoint: string;
137
+ /**
138
+ * Provides the application callback URI.
139
+ */
140
+ readonly callbackUri: string;
141
+ /**
142
+ * Provides the OAuth client ID.
143
+ */
144
+ readonly clientId: string;
145
+ /**
146
+ * Provides requested provider scopes.
147
+ */
148
+ readonly scopes: readonly string[];
149
+ /**
150
+ * Provides permitted post-login redirects.
151
+ */
152
+ readonly allowedPostLoginRedirects: readonly string[];
153
+ /**
154
+ * Provides the verified identity provider.
155
+ */
156
+ readonly provider: OidcVerifiedIdentityProvider;
157
+ /**
158
+ * Maps verified identities to principals.
159
+ */
160
+ readonly identityMapping: IdentityMapping;
161
+ /**
162
+ * Issues application sessions.
163
+ */
164
+ readonly sessionIssuer: ApplicationSessionIssuer;
165
+ /**
166
+ * Provides the optional flow clock.
167
+ */
168
+ readonly clock?: OidcFlowClock;
169
+ /**
170
+ * Provides the optional random-byte source.
171
+ */
172
+ readonly randomBytes?: OidcFlowRandom;
173
+ /**
174
+ * Limits transaction lifetime in milliseconds.
175
+ */
176
+ readonly transactionTtlMilliseconds?: number;
177
+ /**
178
+ * Limits grant lifetime in milliseconds.
179
+ */
180
+ readonly grantTtlMilliseconds?: number;
181
+ /**
182
+ * Limits retained transactions.
183
+ */
184
+ readonly maxTransactions?: number;
185
+ /**
186
+ * Limits retained grants.
187
+ */
188
+ readonly maxGrants?: number;
189
+ /**
190
+ * Limits entropy collision retries.
191
+ */
192
+ readonly collisionAttempts?: number;
193
+ /**
194
+ * Limits provider-operation time in milliseconds.
195
+ */
196
+ readonly operationTimeoutMilliseconds?: number;
197
+ /**
198
+ * Limits authorization URL length.
199
+ */
200
+ readonly maxAuthorizationUrlLength?: number;
201
+ }
202
+ /**
203
+ * Input accepted by {@link OidcFlow.start}.
204
+ */
205
+ export interface OidcFlowStartInput {
206
+ /**
207
+ * Browser-generated RFC 7636 S256 code challenge.
208
+ */
209
+ readonly browserCodeChallenge: string;
210
+ /**
211
+ * Exact preconfigured application redirect to use after successful sign-in.
212
+ */
213
+ readonly postLoginRedirect: string;
214
+ }
215
+ /**
216
+ * Result of opening one authorization-code transaction.
217
+ */
218
+ export type OidcFlowStartResult = {
219
+ /**
220
+ * Identifies a started transaction.
221
+ */ readonly kind: "started";
222
+ /**
223
+ * Provides the authorization URL.
224
+ */ readonly authorizationUrl: string;
225
+ /**
226
+ * Provides transaction expiry milliseconds.
227
+ */ readonly expiresAt: number;
228
+ } | {
229
+ /**
230
+ * Identifies a rejected transaction.
231
+ */
232
+ readonly kind: "rejected";
233
+ /**
234
+ * Explains why the transaction was rejected.
235
+ */
236
+ readonly reason: "invalid-input" | "capacity-exceeded" | "entropy-exhausted" | "clock-failure" | "closed";
237
+ };
238
+ /**
239
+ * Common callback facts. Exactly one of code or error is required.
240
+ */
241
+ export interface OidcFlowCallbackBase {
242
+ /**
243
+ * Provides the one-time callback state.
244
+ */
245
+ readonly state: string;
246
+ /**
247
+ * Optional issuer returned by a provider authorization response.
248
+ */
249
+ readonly responseIssuer?: string;
250
+ }
251
+ /**
252
+ * Input accepted by {@link OidcFlow.callback}.
253
+ */
254
+ export type OidcFlowCallbackInput = (OidcFlowCallbackBase & {
255
+ /**
256
+ * Provides the provider code.
257
+ */ readonly code: string;
258
+ /**
259
+ * Excludes provider error.
260
+ */ readonly error?: never;
261
+ }) | (OidcFlowCallbackBase & {
262
+ /**
263
+ * Provides the provider error.
264
+ */ readonly error: string;
265
+ /**
266
+ * Excludes provider code.
267
+ */ readonly code?: never;
268
+ });
269
+ /**
270
+ * Result of atomically consuming an authorization-code transaction.
271
+ */
272
+ export type OidcFlowCallbackResult = {
273
+ /**
274
+ * Identifies an accepted callback.
275
+ */
276
+ readonly kind: "granted";
277
+ /**
278
+ * Provides the one-time application grant.
279
+ */
280
+ readonly grant: string;
281
+ /**
282
+ * Provides the permitted post-login redirect.
283
+ */
284
+ readonly postLoginRedirect: string;
285
+ /**
286
+ * Provides grant expiry milliseconds.
287
+ */
288
+ readonly expiresAt: number;
289
+ } | {
290
+ /**
291
+ * Identifies a rejected callback.
292
+ */
293
+ readonly kind: "rejected";
294
+ /**
295
+ * Explains why the callback was rejected.
296
+ */
297
+ readonly reason: "invalid-input" | "not-found" | "expired" | "provider-error" | "issuer-mismatch" | "verification-failed" | "mapping-failed" | "capacity-exceeded" | "entropy-exhausted" | "clock-failure" | "closed";
298
+ };
299
+ /**
300
+ * Input accepted by {@link OidcFlow.exchange}.
301
+ */
302
+ export interface OidcFlowExchangeInput {
303
+ /**
304
+ * One-time grant returned by {@link OidcFlow.callback}.
305
+ */
306
+ readonly grant: string;
307
+ /**
308
+ * Browser-held RFC 7636 verifier for the application's separate grant.
309
+ */
310
+ readonly browserCodeVerifier: string;
311
+ }
312
+ /**
313
+ * Enumeration-safe result of a one-time application-session exchange.
314
+ */
315
+ export type OidcFlowExchangeResult = {
316
+ /**
317
+ * Identifies an issued application session.
318
+ */
319
+ readonly kind: "issued";
320
+ /**
321
+ * Provides the issued application credential.
322
+ */
323
+ readonly credential: RequestCredential;
324
+ /**
325
+ * Provides the issued application session.
326
+ */
327
+ readonly session: ResolvedSession;
328
+ } | {
329
+ /**
330
+ * Identifies a rejected exchange.
331
+ */
332
+ readonly kind: "rejected";
333
+ };
334
+ //# sourceMappingURL=contracts.d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AE,iBAAiB,CAAC;IAEvC;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;CACnC,GACD;IAGE;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC3B,CAAC"}
@@ -0,0 +1,15 @@
1
+ /*
2
+ * Copyright 2026, CodeMatters. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5
+ * in compliance with the License. You may obtain a copy of the License at
6
+ *
7
+ * https://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
10
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11
+ * or implied. See the License for the specific language governing permissions and limitations under
12
+ * the License.
13
+ */
14
+ export {};
15
+ //# sourceMappingURL=contracts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src/oidc/contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
@@ -0,0 +1,41 @@
1
+ import type { OidcFlowCallbackInput, OidcFlowCallbackResult, OidcFlowExchangeInput, OidcFlowExchangeResult, OidcFlowOptions, OidcFlowStartInput, OidcFlowStartResult } from "./contracts.js";
2
+ export type * from "./contracts.js";
3
+ /**
4
+ * Bounded, framework-neutral authorization-code transaction manager.
5
+ *
6
+ * It owns finite start, callback, and one-time application-session exchange
7
+ * transitions; HTTP endpoints and provider discovery remain application work.
8
+ */
9
+ export declare class OidcFlow {
10
+ #private;
11
+ /**
12
+ * Creates a bounded authorization-code flow.
13
+ * @param options The trusted provider, callback, transaction, grant, and session settings.
14
+ */
15
+ constructor(options: OidcFlowOptions);
16
+ /**
17
+ * Starts one finite authorization-code transaction without exposing any application credential.
18
+ * @param input The browser redirect and requested scopes.
19
+ * @returns The authorization URL and state, or a rejection.
20
+ */
21
+ start(input: OidcFlowStartInput): OidcFlowStartResult;
22
+ /**
23
+ * Processes a callback state before provider verification or mapping.
24
+ * A rejected callback never restores its transaction.
25
+ * @param input The callback state and provider response.
26
+ * @returns The callback result, including a one-time grant when accepted.
27
+ */
28
+ callback(input: OidcFlowCallbackInput): Promise<OidcFlowCallbackResult>;
29
+ /**
30
+ * Processes a grant before validating browser PKCE proof or issuing a session.
31
+ * All failures deliberately have the same result to avoid grant-state enumeration.
32
+ * @param input The grant and browser PKCE proof.
33
+ * @returns The issued application session or an enumeration-safe rejection.
34
+ */
35
+ exchange(input: OidcFlowExchangeInput): Promise<OidcFlowExchangeResult>;
36
+ /**
37
+ * Closes the flow and discards retained OIDC transaction material.
38
+ */
39
+ close(): void;
40
+ }
41
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/oidc/index.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAKV,qBAAqB,EACrB,sBAAsB,EAEtB,qBAAqB,EACrB,sBAAsB,EACtB,eAAe,EAEf,kBAAkB,EAClB,mBAAmB,EAGpB,MAAM,gBAAgB,CAAC;AAExB,mBAAmB,gBAAgB,CAAC;AAapC;;;;;GAKG;AACH,qBAAa,QAAQ;;IAwBnB;;;OAGG;gBACS,OAAO,EAAE,eAAe;IAyDpC;;;;OAIG;IACH,KAAK,CAAC,KAAK,EAAE,kBAAkB,GAAG,mBAAmB;IA4DrD;;;;;OAKG;IACG,QAAQ,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAqF7E;;;;;OAKG;IACG,QAAQ,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAuC7E;;OAEG;IACH,KAAK,IAAI,IAAI;CAqKd"}