@stigmer/server 3.14.1 → 3.15.0
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/dist/boot/compose.d.ts +8 -1
- package/dist/boot/compose.d.ts.map +1 -1
- package/dist/boot/compose.js +98 -12
- package/dist/boot/compose.js.map +1 -1
- package/dist/domain/apikey/verifier.d.ts +8 -1
- package/dist/domain/apikey/verifier.d.ts.map +1 -1
- package/dist/domain/apikey/verifier.js +14 -2
- package/dist/domain/apikey/verifier.js.map +1 -1
- package/dist/domain/identityaccount/constants.d.ts +66 -0
- package/dist/domain/identityaccount/constants.d.ts.map +1 -0
- package/dist/domain/identityaccount/constants.js +153 -0
- package/dist/domain/identityaccount/constants.js.map +1 -0
- package/dist/domain/identityaccount/controller.d.ts +34 -0
- package/dist/domain/identityaccount/controller.d.ts.map +1 -0
- package/dist/domain/identityaccount/controller.js +342 -0
- package/dist/domain/identityaccount/controller.js.map +1 -0
- package/dist/domain/identityaccount/operator.d.ts +14 -0
- package/dist/domain/identityaccount/operator.d.ts.map +1 -0
- package/dist/domain/identityaccount/operator.js +67 -0
- package/dist/domain/identityaccount/operator.js.map +1 -0
- package/dist/domain/identityaccount/provisioning.d.ts +52 -0
- package/dist/domain/identityaccount/provisioning.d.ts.map +1 -0
- package/dist/domain/identityaccount/provisioning.js +114 -0
- package/dist/domain/identityaccount/provisioning.js.map +1 -0
- package/dist/domain/identityaccount/resolve.d.ts +36 -0
- package/dist/domain/identityaccount/resolve.d.ts.map +1 -0
- package/dist/domain/identityaccount/resolve.js +12 -0
- package/dist/domain/identityaccount/resolve.js.map +1 -0
- package/dist/domain/identityaccount/resource-store.d.ts +4 -0
- package/dist/domain/identityaccount/resource-store.d.ts.map +1 -0
- package/dist/domain/identityaccount/resource-store.js +131 -0
- package/dist/domain/identityaccount/resource-store.js.map +1 -0
- package/dist/domain/identityaccount/steps.d.ts +79 -0
- package/dist/domain/identityaccount/steps.d.ts.map +1 -0
- package/dist/domain/identityaccount/steps.js +291 -0
- package/dist/domain/identityaccount/steps.js.map +1 -0
- package/dist/domain/identityaccount/store-contract.d.ts +22 -0
- package/dist/domain/identityaccount/store-contract.d.ts.map +1 -0
- package/dist/domain/identityaccount/store-contract.js +307 -0
- package/dist/domain/identityaccount/store-contract.js.map +1 -0
- package/dist/domain/identityaccount/store.d.ts +66 -0
- package/dist/domain/identityaccount/store.d.ts.map +1 -0
- package/dist/domain/identityaccount/store.js +13 -0
- package/dist/domain/identityaccount/store.js.map +1 -0
- package/dist/extensions/drivers.d.ts +26 -0
- package/dist/extensions/drivers.d.ts.map +1 -1
- package/dist/extensions/gate-slots.d.ts +16 -1
- package/dist/extensions/gate-slots.d.ts.map +1 -1
- package/dist/extensions/gate-slots.js +1 -0
- package/dist/extensions/gate-slots.js.map +1 -1
- package/dist/extensions/identity-federation.d.ts +36 -0
- package/dist/extensions/identity-federation.d.ts.map +1 -0
- package/dist/extensions/identity-federation.js +2 -0
- package/dist/extensions/identity-federation.js.map +1 -0
- package/dist/extensions/registry.d.ts +18 -1
- package/dist/extensions/registry.d.ts.map +1 -1
- package/dist/extensions/registry.js +20 -0
- package/dist/extensions/registry.js.map +1 -1
- package/dist/identity/oidc-discovery.d.ts +36 -0
- package/dist/identity/oidc-discovery.d.ts.map +1 -0
- package/dist/identity/oidc-discovery.js +60 -0
- package/dist/identity/oidc-discovery.js.map +1 -0
- package/dist/identity/oidc-userinfo.d.ts +30 -0
- package/dist/identity/oidc-userinfo.d.ts.map +1 -0
- package/dist/identity/oidc-userinfo.js +28 -0
- package/dist/identity/oidc-userinfo.js.map +1 -0
- package/dist/identity/oidc-verifier.d.ts +6 -0
- package/dist/identity/oidc-verifier.d.ts.map +1 -1
- package/dist/identity/oidc-verifier.js +35 -34
- package/dist/identity/oidc-verifier.js.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/pipeline/interceptors/auth.d.ts +10 -0
- package/dist/pipeline/interceptors/auth.d.ts.map +1 -1
- package/dist/pipeline/interceptors/auth.js +9 -1
- package/dist/pipeline/interceptors/auth.js.map +1 -1
- package/package.json +4 -4
- package/src/boot/__tests__/auth-enabled-composition.test.ts +226 -2
- package/src/boot/compose.ts +118 -13
- package/src/domain/apikey/__tests__/verifier.test.ts +146 -22
- package/src/domain/apikey/verifier.ts +24 -2
- package/src/domain/identityaccount/__tests__/constants.test.ts +155 -0
- package/src/domain/identityaccount/__tests__/identityaccount.test.ts +484 -0
- package/src/domain/identityaccount/__tests__/operator.test.ts +180 -0
- package/src/domain/identityaccount/__tests__/provisioning.test.ts +281 -0
- package/src/domain/identityaccount/__tests__/resolve.test.ts +114 -0
- package/src/domain/identityaccount/__tests__/resource-store.test.ts +216 -0
- package/src/domain/identityaccount/__tests__/support.ts +58 -0
- package/src/domain/identityaccount/constants.ts +178 -0
- package/src/domain/identityaccount/controller.ts +667 -0
- package/src/domain/identityaccount/operator.ts +94 -0
- package/src/domain/identityaccount/provisioning.ts +182 -0
- package/src/domain/identityaccount/resolve.ts +52 -0
- package/src/domain/identityaccount/resource-store.ts +157 -0
- package/src/domain/identityaccount/steps.ts +377 -0
- package/src/domain/identityaccount/store-contract.ts +471 -0
- package/src/domain/identityaccount/store.ts +70 -0
- package/src/extensions/__tests__/identity-account-composed.test.ts +803 -0
- package/src/extensions/__tests__/identity-account-points.test.ts +129 -0
- package/src/extensions/__tests__/registry.test.ts +4 -0
- package/src/extensions/__tests__/tier-truthfulness.test.ts +299 -0
- package/src/extensions/drivers.ts +26 -0
- package/src/extensions/gate-slots.ts +16 -0
- package/src/extensions/identity-federation.ts +58 -0
- package/src/extensions/registry.ts +44 -1
- package/src/identity/__tests__/oidc-discovery.test.ts +122 -0
- package/src/identity/__tests__/oidc-userinfo.test.ts +103 -0
- package/src/identity/__tests__/oidc-verifier.test.ts +173 -3
- package/src/identity/oidc-discovery.ts +84 -0
- package/src/identity/oidc-userinfo.ts +64 -0
- package/src/identity/oidc-verifier.ts +42 -45
- package/src/index.ts +19 -0
- package/src/pipeline/interceptors/auth.ts +13 -1
- package/src/pipeline/steps/__tests__/authorize-annotation-completeness.test.ts +184 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The IdentityAccountStore PORT (20260911.11, T01_0_plan.md §3a; Q-IA-4):
|
|
3
|
+
* the storage contract the identity-account domain writes and reads
|
|
4
|
+
* through, cut from the cloud's row store (iam/account/store.ts) to its
|
|
5
|
+
* DIRECT subset. This is the first OSS domain whose persistence is a port
|
|
6
|
+
* rather than the generic Store: the cloud serves the same controller
|
|
7
|
+
* over its own `cloud.iam_identity_account` table by registering an
|
|
8
|
+
* implementation as `drivers.identityAccountStore`, so the domain's
|
|
9
|
+
* pipeline steps take this interface, never `Store`. Open source's own
|
|
10
|
+
* implementation is resource-store.ts over the generic Store.
|
|
11
|
+
*
|
|
12
|
+
* What the port deliberately does not carry: the two federation lookups
|
|
13
|
+
* (`findByProviderAndIdpId`, `findByOrgAndSlug`) stay on the cloud's own
|
|
14
|
+
* store behind the IdentityFederation capability — a port does not carry
|
|
15
|
+
* methods only one edition calls.
|
|
16
|
+
*
|
|
17
|
+
* Contract every implementation must satisfy — proven by the port-contract
|
|
18
|
+
* kit (store-contract.ts, exported), which the OSS adapter's test iterates
|
|
19
|
+
* on both drivers and a composition's driver test iterates too:
|
|
20
|
+
* - `save` is create-only in effect: a save under a held id raises
|
|
21
|
+
* DuplicateAccountError, never a silent overwrite; a direct account
|
|
22
|
+
* with an empty `idp_id` is refused, since no lookup could reach it;
|
|
23
|
+
* - `update` replaces, never creates: an unknown id writes nothing;
|
|
24
|
+
* - `deleteById` of an unknown id resolves;
|
|
25
|
+
* - `findDirectByIdpId` answers only non-federated accounts (the
|
|
26
|
+
* platform's own subjects) — a customer's federated IdP may mint the
|
|
27
|
+
* same `auth0|…` shape and the platform lane must never resolve to it;
|
|
28
|
+
* - `findDirectByEmail` answers direct accounts only, by exact match:
|
|
29
|
+
* federation legitimately duplicates emails, so the email axis is
|
|
30
|
+
* non-unique;
|
|
31
|
+
* - `findByIds` answers one row per distinct id, in first-occurrence
|
|
32
|
+
* order, and skips unknown ids;
|
|
33
|
+
* - a typed not-found reads as `undefined`; any other storage failure
|
|
34
|
+
* propagates as the infrastructure fault it is (the ratified
|
|
35
|
+
* store-fault mapping — an outage must never read as "no account").
|
|
36
|
+
*/
|
|
37
|
+
import type { IdentityAccount } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/api_pb";
|
|
38
|
+
/**
|
|
39
|
+
* Raised by `save` when the id is already held, so callers run their own
|
|
40
|
+
* race arms (provisioning resolves the winner by subject; the create RPC
|
|
41
|
+
* answers ALREADY_EXISTS). `cause` carries a driver's own error (the
|
|
42
|
+
* cloud's SQLSTATE 23505) for the logs; the message is the port's.
|
|
43
|
+
*/
|
|
44
|
+
export declare class DuplicateAccountError extends Error {
|
|
45
|
+
constructor(message: string, options?: {
|
|
46
|
+
cause?: unknown;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export interface IdentityAccountStore {
|
|
50
|
+
/** Insert; a held id raises DuplicateAccountError; a direct account with no idp_id is refused. */
|
|
51
|
+
save(account: IdentityAccount): Promise<void>;
|
|
52
|
+
/** Full-row replace by id (profile updates, preference writes); an unknown id writes nothing. */
|
|
53
|
+
update(account: IdentityAccount): Promise<void>;
|
|
54
|
+
/** Removes the row; no error when it does not exist. */
|
|
55
|
+
deleteById(id: string): Promise<void>;
|
|
56
|
+
findById(id: string): Promise<IdentityAccount | undefined>;
|
|
57
|
+
/** Any provisioning mode — the getByIdpId RPC's lookup. */
|
|
58
|
+
findByIdpId(idpId: string): Promise<IdentityAccount | undefined>;
|
|
59
|
+
/** Non-federated accounts only — the verifiers' and whoAmI's lookup. */
|
|
60
|
+
findDirectByIdpId(idpId: string): Promise<IdentityAccount | undefined>;
|
|
61
|
+
/** Direct accounts only, exact match — the getByEmail RPC's lookup. */
|
|
62
|
+
findDirectByEmail(email: string): Promise<IdentityAccount | undefined>;
|
|
63
|
+
/** The present ones, once per distinct id, in first-occurrence order; unknown ids are skipped. */
|
|
64
|
+
findByIds(ids: ReadonlyArray<string>): Promise<ReadonlyArray<IdentityAccount>>;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/domain/identityaccount/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAEhG;;;;;GAKG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;gBAClC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAI3D;AAED,MAAM,WAAW,oBAAoB;IACnC,kGAAkG;IAClG,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,iGAAiG;IACjG,MAAM,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,wDAAwD;IACxD,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAAC;IAC3D,2DAA2D;IAC3D,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAAC;IACjE,wEAAwE;IACxE,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAAC;IACvE,uEAAuE;IACvE,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAAC;IACvE,kGAAkG;IAClG,SAAS,CACP,GAAG,EAAE,aAAa,CAAC,MAAM,CAAC,GACzB,OAAO,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC;CAC5C"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Raised by `save` when the id is already held, so callers run their own
|
|
3
|
+
* race arms (provisioning resolves the winner by subject; the create RPC
|
|
4
|
+
* answers ALREADY_EXISTS). `cause` carries a driver's own error (the
|
|
5
|
+
* cloud's SQLSTATE 23505) for the logs; the message is the port's.
|
|
6
|
+
*/
|
|
7
|
+
export class DuplicateAccountError extends Error {
|
|
8
|
+
constructor(message, options) {
|
|
9
|
+
super(message, options);
|
|
10
|
+
this.name = "DuplicateAccountError";
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../../src/domain/identityaccount/store.ts"],"names":[],"mappings":"AAsCA;;;;;GAKG;AACH,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC9C,YAAY,OAAe,EAAE,OAA6B;QACxD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,CAAC;CACF"}
|
|
@@ -23,6 +23,9 @@
|
|
|
23
23
|
* - schedule-fire caller (who a schedule fire acts as) — landed with
|
|
24
24
|
* the stigmer-cloud#572 fix (the Java schedule-token mechanism's
|
|
25
25
|
* seam; ruled 2026-09-01)
|
|
26
|
+
* - identity-account store + identity federation (the first domain
|
|
27
|
+
* whose persistence is a PORT, and the four federated RPC arms only
|
|
28
|
+
* one edition serves) — landed with 20260911.11, gate ruling Q-IA-9
|
|
26
29
|
*
|
|
27
30
|
* Merge rules (enforced by resolveExtensions, DD-006 §2b): the two
|
|
28
31
|
* provider kinds are single-instance points — a second declaring unit is
|
|
@@ -36,11 +39,13 @@
|
|
|
36
39
|
*/
|
|
37
40
|
import type { ArtifactStorageDriverFactory } from "../artifactstorage/artifact-storage.js";
|
|
38
41
|
import type { ChannelRuntime } from "../domain/agentchannel/channel-runtime.js";
|
|
42
|
+
import type { IdentityAccountStore } from "../domain/identityaccount/store.js";
|
|
39
43
|
import type { SecretCodec } from "../encryption/codec.js";
|
|
40
44
|
import type { ModelCatalogProvider } from "../domain/workflow/registry/model-catalog-provider.js";
|
|
41
45
|
import type { VisitorErrorPolicy } from "../pipeline/interceptors/error-boundary.js";
|
|
42
46
|
import type { RunnerCredentialProvider } from "../runnerauth/runner-credential-provider.js";
|
|
43
47
|
import type { SandboxProvisionerFactory } from "../sandbox/provisioner.js";
|
|
48
|
+
import type { IdentityFederation } from "./identity-federation.js";
|
|
44
49
|
import type { ListReadScope } from "./list-read-scope.js";
|
|
45
50
|
import type { OrganizationDirectory } from "./organization-directory.js";
|
|
46
51
|
import type { ResourceAuthorizationLifecycle } from "./resource-authorization.js";
|
|
@@ -136,5 +141,26 @@ export interface ExtensionDrivers {
|
|
|
136
141
|
* the `internal` class — OSS behavior byte-identical.
|
|
137
142
|
*/
|
|
138
143
|
readonly scheduleFireCaller?: ScheduleFireCallerMint;
|
|
144
|
+
/**
|
|
145
|
+
* The identity-account store driver (20260911.11, Q-IA-9;
|
|
146
|
+
* single-instance point). The identity-account domain is the first
|
|
147
|
+
* whose persistence is a PORT rather than the generic Store: when
|
|
148
|
+
* composed, the domain's every read and write — the create path, the
|
|
149
|
+
* provisioner, the boot-time operator ensure and BOTH OSS verifiers'
|
|
150
|
+
* subject resolution — goes through this driver (the cloud serves the
|
|
151
|
+
* domain over its own `cloud.iam_identity_account` table this way).
|
|
152
|
+
* When absent, the OSS adapter over the generic Store installs at the
|
|
153
|
+
* compose.ts consumption site — OSS behavior byte-identical.
|
|
154
|
+
*/
|
|
155
|
+
readonly identityAccountStore?: IdentityAccountStore;
|
|
156
|
+
/**
|
|
157
|
+
* The identity-federation capability (20260911.11, Q-IA-9;
|
|
158
|
+
* single-instance point): the four federated-account RPC arms plus the
|
|
159
|
+
* IdP-exists probe their shared precondition rides. When composed, the
|
|
160
|
+
* identity-account controller dispatches to it after its own shared
|
|
161
|
+
* checks; when absent, the four RPCs refuse UNIMPLEMENTED with the
|
|
162
|
+
* edition reason — the organizationDirectory absent-method shape.
|
|
163
|
+
*/
|
|
164
|
+
readonly identityFederation?: IdentityFederation;
|
|
139
165
|
}
|
|
140
166
|
//# sourceMappingURL=drivers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drivers.d.ts","sourceRoot":"","sources":["../../src/extensions/drivers.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"drivers.d.ts","sourceRoot":"","sources":["../../src/extensions/drivers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AAC3F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uDAAuD,CAAC;AAClG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAC5F,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,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— its capacity gates ride the two declared agent-execution
|
|
20
20
|
* slots, whose positions coincide exactly with the Java session gate.
|
|
21
21
|
*
|
|
22
|
+
* 20260911.11 (Q-IA-9) declares the seventh,
|
|
23
|
+
* `identity-account-provision:post-persist`: inside provisionMyAccount,
|
|
24
|
+
* after the provisioner has answered the caller's row — created on this
|
|
25
|
+
* call or found by the idempotent early return — and before the reply,
|
|
26
|
+
* with the caller RE-STAMPED as the account (the position-1 identity was
|
|
27
|
+
* idp-shaped because no row existed when the verifier ran). It fires on
|
|
28
|
+
* EVERY provisionMyAccount, not only the creating one: the cloud's
|
|
29
|
+
* personal-organization step backfills accounts that predate personal
|
|
30
|
+
* organizations on the idempotent path, which is exactly why a slot was
|
|
31
|
+
* chosen over the tuple lifecycle's onResourceCreated (never fired for a
|
|
32
|
+
* row that already exists). Never on the create RPC and never at the
|
|
33
|
+
* boot-time operator ensure, which take the create path, not this one.
|
|
34
|
+
* Non-transactional in the `org-create:post-persist` sense: a gate
|
|
35
|
+
* failure fails the request, the row survives, the next call heals.
|
|
36
|
+
*
|
|
22
37
|
* Two enforcement layers, deliberately redundant, both derived from the
|
|
23
38
|
* ONE literal tuple below (lockstep by construction):
|
|
24
39
|
* - GateSlotName (compile time): the union of declared slot literals.
|
|
@@ -46,7 +61,7 @@ import type { PipelineStep } from "../pipeline/pipeline.js";
|
|
|
46
61
|
* owner-visible slot additions — each entry cites its chain position in
|
|
47
62
|
* the guidelines' slot table, which must match the splice sites exactly.
|
|
48
63
|
*/
|
|
49
|
-
export declare const GATE_SLOT_NAMES: readonly ["agent-execution-create:pre-side-effect-gate", "agent-execution-recover:pre-side-effect-gate", "agent-execution-submit-approval:gate", "session-create:pre-side-effect-gate", "org-create:post-persist", "sandbox-acquisition:gate"];
|
|
64
|
+
export declare const GATE_SLOT_NAMES: readonly ["agent-execution-create:pre-side-effect-gate", "agent-execution-recover:pre-side-effect-gate", "agent-execution-submit-approval:gate", "session-create:pre-side-effect-gate", "org-create:post-persist", "sandbox-acquisition:gate", "identity-account-provision:post-persist"];
|
|
50
65
|
/** The declared slot-name union — a registration outside it fails tsc. */
|
|
51
66
|
export type GateSlotName = (typeof GATE_SLOT_NAMES)[number];
|
|
52
67
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gate-slots.d.ts","sourceRoot":"","sources":["../../src/extensions/gate-slots.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"gate-slots.d.ts","sourceRoot":"","sources":["../../src/extensions/gate-slots.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D;;;;GAIG;AACH,eAAO,MAAM,eAAe,2RAQlB,CAAC;AAEX,0EAA0E;AAC1E,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,WAAW,CAAC,MAAM,CAEnD,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,WAAW,CACzC,MAAM,EACN,aAAa,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CACzC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,SAAS,WAAW,EACnD,SAAS,EAAE,iBAAiB,EAC5B,IAAI,EAAE,YAAY,GACjB,aAAa,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAOnC"}
|
|
@@ -10,6 +10,7 @@ export const GATE_SLOT_NAMES = [
|
|
|
10
10
|
"session-create:pre-side-effect-gate",
|
|
11
11
|
"org-create:post-persist",
|
|
12
12
|
"sandbox-acquisition:gate",
|
|
13
|
+
"identity-account-provision:post-persist",
|
|
13
14
|
];
|
|
14
15
|
/**
|
|
15
16
|
* The boot-time declared-slot set — resolveExtensions validates every
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gate-slots.js","sourceRoot":"","sources":["../../src/extensions/gate-slots.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gate-slots.js","sourceRoot":"","sources":["../../src/extensions/gate-slots.ts"],"names":[],"mappings":"AA4DA;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,6CAA6C;IAC7C,8CAA8C;IAC9C,sCAAsC;IACtC,qCAAqC;IACrC,yBAAyB;IACzB,0BAA0B;IAC1B,yCAAyC;CACjC,CAAC;AAKX;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAwB,IAAI,GAAG,CAC7D,eAAe,CAChB,CAAC;AAWF;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAC1B,SAA4B,EAC5B,IAAkB;IAElB,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACxC,kDAAkD;IAClD,oEAAoE;IACpE,sEAAsE;IACtE,cAAc;IACd,OAAO,KAA0C,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The identity-federation capability (20260911.11, Q-IA-9): the four
|
|
3
|
+
* federated-account RPC arms the identity-account controller dispatches
|
|
4
|
+
* to when a composed unit provides them, plus the identity-provider
|
|
5
|
+
* existence check their shared precondition rides. Single instance,
|
|
6
|
+
* registered as `drivers.identityFederation` (the organizationDirectory
|
|
7
|
+
* shape: a driver point that is byte-identical OSS behaviour when absent).
|
|
8
|
+
*
|
|
9
|
+
* Absent, the controller refuses the four RPCs UNIMPLEMENTED with the
|
|
10
|
+
* edition reason (domain/identityaccount/constants.ts) — never INTERNAL,
|
|
11
|
+
* the organization directory's absent-method precedent. Present, the
|
|
12
|
+
* controller still owns what is shared: the annotation's Authorize step
|
|
13
|
+
* on the organization, the ref-with-slug and org-match checks, and the
|
|
14
|
+
* IdP-exists refusal through `providerExists`; the arm receives the
|
|
15
|
+
* RESOLVED ref (org filled from the input when the ref left it empty)
|
|
16
|
+
* and the authenticated caller, and owns only what differs per edition —
|
|
17
|
+
* the natural-key lookups and writes on the federated rows.
|
|
18
|
+
*
|
|
19
|
+
* The federated natural key (provider ref + external subject) and its
|
|
20
|
+
* lookups stay on the unit's own store: the IdentityAccountStore port
|
|
21
|
+
* carries direct-account methods only, because a port does not carry
|
|
22
|
+
* methods only one edition calls.
|
|
23
|
+
*/
|
|
24
|
+
import type { ApiResourceReference } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
25
|
+
import type { IdentityAccount } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/api_pb";
|
|
26
|
+
import type { CreateFederatedAccountInput, DeprovisionFederatedAccountInput, ExternalSubLookup, UpdateFederatedAccountInput } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/io_pb";
|
|
27
|
+
import type { CallerIdentity } from "./identity.js";
|
|
28
|
+
export interface IdentityFederation {
|
|
29
|
+
createFederatedAccount(input: CreateFederatedAccountInput, ref: ApiResourceReference, caller: CallerIdentity): Promise<IdentityAccount>;
|
|
30
|
+
updateFederatedAccount(input: UpdateFederatedAccountInput, ref: ApiResourceReference, caller: CallerIdentity): Promise<IdentityAccount>;
|
|
31
|
+
deprovisionFederatedAccount(input: DeprovisionFederatedAccountInput, ref: ApiResourceReference, caller: CallerIdentity): Promise<IdentityAccount>;
|
|
32
|
+
getByExternalSub(lookup: ExternalSubLookup, ref: ApiResourceReference, caller: CallerIdentity): Promise<IdentityAccount>;
|
|
33
|
+
/** Whether the IdentityProvider `org/slug` exists — the arms' shared precondition. */
|
|
34
|
+
providerExists(org: string, slug: string): Promise<boolean>;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=identity-federation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity-federation.d.ts","sourceRoot":"","sources":["../../src/extensions/identity-federation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sDAAsD,CAAC;AACjG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAChG,OAAO,KAAK,EACV,2BAA2B,EAC3B,gCAAgC,EAChC,iBAAiB,EACjB,2BAA2B,EAC5B,MAAM,yDAAyD,CAAC;AAEjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,MAAM,WAAW,kBAAkB;IACjC,sBAAsB,CACpB,KAAK,EAAE,2BAA2B,EAClC,GAAG,EAAE,oBAAoB,EACzB,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,eAAe,CAAC,CAAC;IAC5B,sBAAsB,CACpB,KAAK,EAAE,2BAA2B,EAClC,GAAG,EAAE,oBAAoB,EACzB,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,eAAe,CAAC,CAAC;IAC5B,2BAA2B,CACzB,KAAK,EAAE,gCAAgC,EACvC,GAAG,EAAE,oBAAoB,EACzB,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,eAAe,CAAC,CAAC;IAC5B,gBAAgB,CACd,MAAM,EAAE,iBAAiB,EACzB,GAAG,EAAE,oBAAoB,EACzB,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,eAAe,CAAC,CAAC;IAC5B,sFAAsF;IACtF,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity-federation.js","sourceRoot":"","sources":["../../src/extensions/identity-federation.ts"],"names":[],"mappings":""}
|
|
@@ -30,14 +30,20 @@
|
|
|
30
30
|
* provider) and O6's sandbox provisioners are consumed at their
|
|
31
31
|
* compose.ts construction sites; the require-authentication posture
|
|
32
32
|
* (20260904.02) is consumed where compose.ts builds the serving chain's
|
|
33
|
-
* identity source, OR'd with the OIDC-issuer arm
|
|
33
|
+
* identity source, OR'd with the OIDC-issuer arm; the identity-account
|
|
34
|
+
* points (20260911.11) at the identity-accounts stage (the store driver,
|
|
35
|
+
* ahead of the boot-time operator ensure) and the routes stage (the
|
|
36
|
+
* federation capability and the provision slot's steps, into the
|
|
37
|
+
* identity-account controller).
|
|
34
38
|
*/
|
|
35
39
|
import type { DescMessage } from "@bufbuild/protobuf";
|
|
36
40
|
import type { ConnectRouter } from "@connectrpc/connect";
|
|
37
41
|
import { ServerEdition } from "@stigmer/protos/ai/stigmer/platform/v1/server_info_pb";
|
|
38
42
|
import type { ArtifactStorageDriverFactory } from "../artifactstorage/artifact-storage.js";
|
|
39
43
|
import type { ChannelRuntime } from "../domain/agentchannel/channel-runtime.js";
|
|
44
|
+
import type { IdentityAccountStore } from "../domain/identityaccount/store.js";
|
|
40
45
|
import type { SecretCodec } from "../encryption/codec.js";
|
|
46
|
+
import type { IdentityFederation } from "./identity-federation.js";
|
|
41
47
|
import type { ListReadScope } from "./list-read-scope.js";
|
|
42
48
|
import type { ModelCatalogProvider } from "../domain/workflow/registry/model-catalog-provider.js";
|
|
43
49
|
import type { VisitorErrorPolicy } from "../pipeline/interceptors/error-boundary.js";
|
|
@@ -210,6 +216,17 @@ export interface ResolvedExtensionDrivers {
|
|
|
210
216
|
* codec in and resolves the write version fail-fast.
|
|
211
217
|
*/
|
|
212
218
|
readonly secretCodecs: ReadonlyMap<string, SecretCodec>;
|
|
219
|
+
/**
|
|
220
|
+
* The 20260911.11 identity-account store driver — undefined = the
|
|
221
|
+
* compose.ts identity-accounts stage installs the OSS adapter over the
|
|
222
|
+
* generic Store, OSS behavior byte-identical.
|
|
223
|
+
*/
|
|
224
|
+
readonly identityAccountStore: IdentityAccountStore | undefined;
|
|
225
|
+
/**
|
|
226
|
+
* The 20260911.11 identity-federation capability — undefined = the
|
|
227
|
+
* four federated RPCs refuse UNIMPLEMENTED with the edition reason.
|
|
228
|
+
*/
|
|
229
|
+
readonly identityFederation: IdentityFederation | undefined;
|
|
213
230
|
}
|
|
214
231
|
/**
|
|
215
232
|
* Merges the composed units, enforcing the §2b loud-fail rules. Runs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/extensions/registry.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/extensions/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAC;AAEtF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AAE3F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uDAAuD,CAAC;AAClG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAC5F,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AA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|
39
39
|
let visitorErrorPolicyDeclaredBy;
|
|
40
40
|
let scheduleFireCaller;
|
|
41
41
|
let scheduleFireCallerDeclaredBy;
|
|
42
|
+
let identityAccountStore;
|
|
43
|
+
let identityAccountStoreDeclaredBy;
|
|
44
|
+
let identityFederation;
|
|
45
|
+
let identityFederationDeclaredBy;
|
|
42
46
|
const artifactStorageDrivers = new Map();
|
|
43
47
|
const storageDriverDeclaredBy = new Map();
|
|
44
48
|
const sandboxProvisionerDrivers = new Map();
|
|
@@ -133,6 +137,20 @@ export function resolveExtensions(units = []) {
|
|
|
133
137
|
scheduleFireCaller = unit.drivers.scheduleFireCaller;
|
|
134
138
|
scheduleFireCallerDeclaredBy = unit.name;
|
|
135
139
|
}
|
|
140
|
+
if (unit.drivers?.identityAccountStore !== undefined) {
|
|
141
|
+
if (identityAccountStoreDeclaredBy !== undefined) {
|
|
142
|
+
throw new Error(`extension '${unit.name}' registers an IdentityAccountStore, but '${identityAccountStoreDeclaredBy}' already did — exactly one may be composed`);
|
|
143
|
+
}
|
|
144
|
+
identityAccountStore = unit.drivers.identityAccountStore;
|
|
145
|
+
identityAccountStoreDeclaredBy = unit.name;
|
|
146
|
+
}
|
|
147
|
+
if (unit.drivers?.identityFederation !== undefined) {
|
|
148
|
+
if (identityFederationDeclaredBy !== undefined) {
|
|
149
|
+
throw new Error(`extension '${unit.name}' registers an IdentityFederation, but '${identityFederationDeclaredBy}' already did — exactly one may be composed`);
|
|
150
|
+
}
|
|
151
|
+
identityFederation = unit.drivers.identityFederation;
|
|
152
|
+
identityFederationDeclaredBy = unit.name;
|
|
153
|
+
}
|
|
136
154
|
if (unit.drivers?.artifactStorageDrivers !== undefined) {
|
|
137
155
|
for (const [name, factory] of unit.drivers.artifactStorageDrivers) {
|
|
138
156
|
if (BUILT_IN_STORAGE_TYPES.includes(name)) {
|
|
@@ -222,6 +240,8 @@ export function resolveExtensions(units = []) {
|
|
|
222
240
|
visitorErrorPolicy,
|
|
223
241
|
secretCodecs,
|
|
224
242
|
scheduleFireCaller,
|
|
243
|
+
identityAccountStore,
|
|
244
|
+
identityFederation,
|
|
225
245
|
},
|
|
226
246
|
services,
|
|
227
247
|
workers,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/extensions/registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/extensions/registry.ts"],"names":[],"mappings":"AAyCA,OAAO,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAC;AAGtF,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAIhF,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AASvD,OAAO,EAAE,kCAAkC,EAAE,MAAM,2BAA2B,CAAC;AAK/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAgMtD;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAC/B,QAAwC,EAAE;IAE1C,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/B,MAAM,iBAAiB,GAAuB,EAAE,CAAC;IACjD,MAAM,YAAY,GAAkB,EAAE,CAAC;IACvC,MAAM,SAAS,GAAG,IAAI,GAAG,EAAoD,CAAC;IAC9E,MAAM,eAAe,GAAmC,EAAE,CAAC;IAC3D,MAAM,kBAAkB,GAAsC,EAAE,CAAC;IACjE,MAAM,QAAQ,GAAmC,EAAE,CAAC;IACpD,MAAM,OAAO,GAAoB,EAAE,CAAC;IAEpC,IAAI,OAAkC,CAAC;IACvC,IAAI,iBAAqC,CAAC;IAC1C,IAAI,+BAAmD,CAAC;IACxD,IAAI,UAAkC,CAAC;IACvC,IAAI,oBAAwC,CAAC;IAC7C,IAAI,oBAAsD,CAAC;IAC3D,IAAI,iBAAqC,CAAC;IAC1C,IAAI,wBAA8D,CAAC;IACnE,IAAI,oBAAwC,CAAC;IAC7C,IAAI,8BAES,CAAC;IACd,IAAI,gCAAoD,CAAC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, shared by every lane
|
|
4
|
+
* that needs an issuer's endpoints: the userinfo client (oidc-userinfo.ts)
|
|
5
|
+
* and the identity verifier's JWKS location (oidc-verifier.ts), so one
|
|
6
|
+
* issuer is discovered once and validated the same way wherever it is
|
|
7
|
+
* consumed. The composition root builds ONE instance and hands it to
|
|
8
|
+
* both.
|
|
9
|
+
*
|
|
10
|
+
* The verifier's rules, kept: the document's `issuer` must equal the
|
|
11
|
+
* requested issuer exactly (RFC 8414 §3.3 — a document that names another
|
|
12
|
+
* issuer is a misconfiguration or a redirect to somewhere else); `jwks_uri`
|
|
13
|
+
* is required (OpenID Connect Discovery 1.0 §3 says so). `userinfo_endpoint`
|
|
14
|
+
* is RECOMMENDED by the spec, so it is carried when present and its
|
|
15
|
+
* consumer decides what its absence means.
|
|
16
|
+
*
|
|
17
|
+
* Memoized per issuer ON SUCCESS only: a failed fetch is retried on the
|
|
18
|
+
* next call, so a flaky IdP at boot never permanently bricks a lane. An
|
|
19
|
+
* outage is an infrastructure fault thrown as a plain error — the caller
|
|
20
|
+
* maps it (the chassis to INTERNAL, the provisioning handler to
|
|
21
|
+
* UNAVAILABLE), never a credential rejection. The fetch is injected so
|
|
22
|
+
* tests never dial out and the composition root owns the process boundary.
|
|
23
|
+
*/
|
|
24
|
+
export interface DiscoveredIssuer {
|
|
25
|
+
readonly issuer: string;
|
|
26
|
+
readonly jwksUri: string;
|
|
27
|
+
/** Absent when the document names none. */
|
|
28
|
+
readonly userinfoEndpoint: string | undefined;
|
|
29
|
+
}
|
|
30
|
+
export interface IssuerDiscovery {
|
|
31
|
+
/** The validated document for `issuer`, from the cache after the first success. */
|
|
32
|
+
discover(issuer: string): Promise<DiscoveredIssuer>;
|
|
33
|
+
}
|
|
34
|
+
export declare function discoveryUrl(issuer: string): string;
|
|
35
|
+
export declare function newIssuerDiscovery(fetchImpl?: typeof fetch): IssuerDiscovery;
|
|
36
|
+
//# sourceMappingURL=oidc-discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oidc-discovery.d.ts","sourceRoot":"","sources":["../../src/identity/oidc-discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,2CAA2C;IAC3C,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/C;AAED,MAAM,WAAW,eAAe;IAC9B,mFAAmF;IACnF,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACrD;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,wBAAgB,kBAAkB,CAChC,SAAS,GAAE,OAAO,KAAa,GAC9B,eAAe,CAyCjB"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OIDC issuer discovery (20260911.11, T01_1_review.md A8) — the one
|
|
3
|
+
* reader of `/.well-known/openid-configuration`, shared by every lane
|
|
4
|
+
* that needs an issuer's endpoints: the userinfo client (oidc-userinfo.ts)
|
|
5
|
+
* and the identity verifier's JWKS location (oidc-verifier.ts), so one
|
|
6
|
+
* issuer is discovered once and validated the same way wherever it is
|
|
7
|
+
* consumed. The composition root builds ONE instance and hands it to
|
|
8
|
+
* both.
|
|
9
|
+
*
|
|
10
|
+
* The verifier's rules, kept: the document's `issuer` must equal the
|
|
11
|
+
* requested issuer exactly (RFC 8414 §3.3 — a document that names another
|
|
12
|
+
* issuer is a misconfiguration or a redirect to somewhere else); `jwks_uri`
|
|
13
|
+
* is required (OpenID Connect Discovery 1.0 §3 says so). `userinfo_endpoint`
|
|
14
|
+
* is RECOMMENDED by the spec, so it is carried when present and its
|
|
15
|
+
* consumer decides what its absence means.
|
|
16
|
+
*
|
|
17
|
+
* Memoized per issuer ON SUCCESS only: a failed fetch is retried on the
|
|
18
|
+
* next call, so a flaky IdP at boot never permanently bricks a lane. An
|
|
19
|
+
* outage is an infrastructure fault thrown as a plain error — the caller
|
|
20
|
+
* maps it (the chassis to INTERNAL, the provisioning handler to
|
|
21
|
+
* UNAVAILABLE), never a credential rejection. The fetch is injected so
|
|
22
|
+
* tests never dial out and the composition root owns the process boundary.
|
|
23
|
+
*/
|
|
24
|
+
export function discoveryUrl(issuer) {
|
|
25
|
+
return `${issuer.replace(/\/$/, "")}/.well-known/openid-configuration`;
|
|
26
|
+
}
|
|
27
|
+
export function newIssuerDiscovery(fetchImpl = fetch) {
|
|
28
|
+
const discovered = new Map();
|
|
29
|
+
return {
|
|
30
|
+
async discover(issuer) {
|
|
31
|
+
const cached = discovered.get(issuer);
|
|
32
|
+
if (cached !== undefined) {
|
|
33
|
+
return cached;
|
|
34
|
+
}
|
|
35
|
+
const url = discoveryUrl(issuer);
|
|
36
|
+
const response = await fetchImpl(url);
|
|
37
|
+
if (!response.ok) {
|
|
38
|
+
throw new Error(`OIDC discovery failed: ${url} answered HTTP ${response.status}`);
|
|
39
|
+
}
|
|
40
|
+
const document = (await response.json());
|
|
41
|
+
if (document.issuer !== issuer) {
|
|
42
|
+
throw new Error(`OIDC discovery failed: document issuer '${typeof document.issuer === "string" ? document.issuer : ""}' does not match configured issuer '${issuer}'`);
|
|
43
|
+
}
|
|
44
|
+
if (typeof document.jwks_uri !== "string" || document.jwks_uri === "") {
|
|
45
|
+
throw new Error(`OIDC discovery failed: ${url} carries no jwks_uri`);
|
|
46
|
+
}
|
|
47
|
+
const result = {
|
|
48
|
+
issuer,
|
|
49
|
+
jwksUri: document.jwks_uri,
|
|
50
|
+
userinfoEndpoint: typeof document.userinfo_endpoint === "string" &&
|
|
51
|
+
document.userinfo_endpoint !== ""
|
|
52
|
+
? document.userinfo_endpoint
|
|
53
|
+
: undefined,
|
|
54
|
+
};
|
|
55
|
+
discovered.set(issuer, result);
|
|
56
|
+
return result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;YACD,IAAI,OAAO,QAAQ,CAAC,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,QAAQ,KAAK,EAAE,EAAE,CAAC;gBACtE,MAAM,IAAI,KAAK,CAAC,0BAA0B,GAAG,sBAAsB,CAAC,CAAC;YACvE,CAAC;YACD,MAAM,MAAM,GAAqB;gBAC/B,MAAM;gBACN,OAAO,EAAE,QAAQ,CAAC,QAAQ;gBAC1B,gBAAgB,EACd,OAAO,QAAQ,CAAC,iBAAiB,KAAK,QAAQ;oBAC9C,QAAQ,CAAC,iBAAiB,KAAK,EAAE;oBAC/B,CAAC,CAAC,QAAQ,CAAC,iBAAiB;oBAC5B,CAAC,CAAC,SAAS;aAChB,CAAC;YACF,UAAU,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAC/B,OAAO,MAAM,CAAC;QAChB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The OIDC userinfo client (20260911.11, T01_1_review.md A8) — the
|
|
3
|
+
* infrastructure behind the identity-account domain's UserInfoClient
|
|
4
|
+
* port (domain/identityaccount/provisioning.ts): the profile of the
|
|
5
|
+
* bearer of an access token, from the `userinfo_endpoint` the token's
|
|
6
|
+
* ISSUER publishes, fetched with that very token.
|
|
7
|
+
*
|
|
8
|
+
* The issuer is a per-call argument, not a construction-time binding,
|
|
9
|
+
* because the composition does not know which issuer will vouch for a
|
|
10
|
+
* caller: open source's own OIDC lane names one in STIGMER_OIDC_ISSUER,
|
|
11
|
+
* the cloud's verifiers name theirs on the CallerIdentity they mint. The
|
|
12
|
+
* one issuer whose userinfo can answer for a token is the one that issued
|
|
13
|
+
* it — and a verifier already trusted it, so the token goes only where it
|
|
14
|
+
* came from.
|
|
15
|
+
*
|
|
16
|
+
* The endpoint is the discovery document's word, never a guessed
|
|
17
|
+
* `<issuer>/userinfo`: a document that names no `userinfo_endpoint` is
|
|
18
|
+
* refused as a fetch failure (the domain maps it UNAVAILABLE with the
|
|
19
|
+
* cloud's copy), so a misconfigured issuer fails loudly at the first
|
|
20
|
+
* sign-in rather than silently against a wrong URL.
|
|
21
|
+
*
|
|
22
|
+
* Claims read as the cloud's client reads them: `email`, `given_name`,
|
|
23
|
+
* `family_name`, `picture`; a missing or non-string claim is the empty
|
|
24
|
+
* string. Any non-2xx or malformed answer throws; the domain's
|
|
25
|
+
* UserInfoFetchError wraps it.
|
|
26
|
+
*/
|
|
27
|
+
import type { UserInfoClient } from "../domain/identityaccount/provisioning.js";
|
|
28
|
+
import type { IssuerDiscovery } from "./oidc-discovery.js";
|
|
29
|
+
export declare function newOidcUserInfoClient(discovery: IssuerDiscovery, fetchImpl?: typeof fetch): UserInfoClient;
|
|
30
|
+
//# sourceMappingURL=oidc-userinfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oidc-userinfo.d.ts","sourceRoot":"","sources":["../../src/identity/oidc-userinfo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,KAAK,EACV,cAAc,EAEf,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,eAAe,EAC1B,SAAS,GAAE,OAAO,KAAa,GAC9B,cAAc,CA4BhB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export function newOidcUserInfoClient(discovery, fetchImpl = fetch) {
|
|
2
|
+
return {
|
|
3
|
+
async fetchUserProfile(issuer, accessToken) {
|
|
4
|
+
const { userinfoEndpoint } = await discovery.discover(issuer);
|
|
5
|
+
if (userinfoEndpoint === undefined) {
|
|
6
|
+
throw new Error(`issuer '${issuer}' publishes no userinfo_endpoint in its discovery document`);
|
|
7
|
+
}
|
|
8
|
+
const response = await fetchImpl(userinfoEndpoint, {
|
|
9
|
+
headers: { authorization: `Bearer ${accessToken}` },
|
|
10
|
+
});
|
|
11
|
+
if (!response.ok) {
|
|
12
|
+
throw new Error(`userinfo answered ${response.status}`);
|
|
13
|
+
}
|
|
14
|
+
const claims = (await response.json());
|
|
15
|
+
const text = (key) => {
|
|
16
|
+
const value = claims[key];
|
|
17
|
+
return typeof value === "string" ? value : "";
|
|
18
|
+
};
|
|
19
|
+
return {
|
|
20
|
+
email: text("email"),
|
|
21
|
+
firstName: text("given_name"),
|
|
22
|
+
lastName: text("family_name"),
|
|
23
|
+
pictureUrl: text("picture"),
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=oidc-userinfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oidc-userinfo.js","sourceRoot":"","sources":["../../src/identity/oidc-userinfo.ts"],"names":[],"mappings":"AAgCA,MAAM,UAAU,qBAAqB,CACnC,SAA0B,EAC1B,YAA0B,KAAK;IAE/B,OAAO;QACL,KAAK,CAAC,gBAAgB,CAAC,MAAM,EAAE,WAAW;YACxC,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC9D,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;gBACnC,MAAM,IAAI,KAAK,CACb,WAAW,MAAM,4DAA4D,CAC9E,CAAC;YACJ,CAAC;YACD,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,gBAAgB,EAAE;gBACjD,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,WAAW,EAAE,EAAE;aACpD,CAAC,CAAC;YACH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;gBACjB,MAAM,IAAI,KAAK,CAAC,qBAAqB,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;YAC1D,CAAC;YACD,MAAM,MAAM,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAA4B,CAAC;YAClE,MAAM,IAAI,GAAG,CAAC,GAAW,EAAU,EAAE;gBACnC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;gBAC1B,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YAChD,CAAC,CAAC;YACF,OAAO;gBACL,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC;gBACpB,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC;gBAC7B,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC;gBAC7B,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC;aAC5B,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { AccountsBySubject } from "../domain/identityaccount/resolve.js";
|
|
1
2
|
import type { IdentityVerifier } from "../extensions/identity.js";
|
|
3
|
+
import type { IssuerDiscovery } from "./oidc-discovery.js";
|
|
2
4
|
/** Java classifyAuthError arms — byte-pinned cross-edition copy. */
|
|
3
5
|
export declare const TOKEN_EXPIRED_MESSAGE = "token has expired";
|
|
4
6
|
export declare const TOKEN_AUDIENCE_MESSAGE = "token audience does not match the expected audience";
|
|
@@ -9,6 +11,10 @@ export interface OidcVerifierConfig {
|
|
|
9
11
|
readonly issuer: string;
|
|
10
12
|
/** The audience access tokens must carry. */
|
|
11
13
|
readonly audience: string;
|
|
14
|
+
/** The identity-account domain's subject lookup — REQUIRED: what identityId means depends on it. */
|
|
15
|
+
readonly accounts: AccountsBySubject;
|
|
16
|
+
/** The composition root's one discovery for every lane (A8). */
|
|
17
|
+
readonly discovery: IssuerDiscovery;
|
|
12
18
|
}
|
|
13
19
|
export declare function newOidcIdentityVerifier(config: OidcVerifierConfig): IdentityVerifier;
|
|
14
20
|
//# sourceMappingURL=oidc-verifier.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oidc-verifier.d.ts","sourceRoot":"","sources":["../../src/identity/oidc-verifier.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"oidc-verifier.d.ts","sourceRoot":"","sources":["../../src/identity/oidc-verifier.ts"],"names":[],"mappings":"AAmDA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,KAAK,EAEV,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,oEAAoE;AACpE,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AACzD,eAAO,MAAM,sBAAsB,wDACoB,CAAC;AACxD,eAAO,MAAM,uBAAuB,wCAAwC,CAAC;AAC7E,eAAO,MAAM,qBAAqB,kBAAkB,CAAC;AAErD,MAAM,WAAW,kBAAkB;IACjC,mEAAmE;IACnE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,6CAA6C;IAC7C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,oGAAoG;IACpG,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,gEAAgE;IAChE,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;CACrC;AAID,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,kBAAkB,GACzB,gBAAgB,CA+ClB"}
|