@noodleseed/one 0.63.1 → 0.64.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/auth-discovery.d.ts +17 -0
- package/dist/auth-discovery.d.ts.map +1 -0
- package/dist/auth-discovery.js +54 -0
- package/dist/auth-discovery.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +3 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/catalog-data-platform-auth.d.ts +7 -0
- package/dist/commands/catalog-data-platform-auth.d.ts.map +1 -0
- package/dist/commands/catalog-data-platform-auth.js +47 -0
- package/dist/commands/catalog-data-platform-auth.js.map +1 -0
- package/dist/commands/catalog.d.ts.map +1 -1
- package/dist/commands/catalog.js +6 -3
- package/dist/commands/catalog.js.map +1 -1
- package/dist/commands/docs-mcp.d.ts +3 -3
- package/dist/commands/docs-mcp.js +3 -3
- package/dist/commands/platform-auth-finalization-args.d.ts +13 -0
- package/dist/commands/platform-auth-finalization-args.d.ts.map +1 -0
- package/dist/commands/platform-auth-finalization-args.js +29 -0
- package/dist/commands/platform-auth-finalization-args.js.map +1 -0
- package/dist/commands/platform-auth-migration-args.d.ts +71 -0
- package/dist/commands/platform-auth-migration-args.d.ts.map +1 -0
- package/dist/commands/platform-auth-migration-args.js +320 -0
- package/dist/commands/platform-auth-migration-args.js.map +1 -0
- package/dist/commands/platform-auth-migration-ops.d.ts +3 -0
- package/dist/commands/platform-auth-migration-ops.d.ts.map +1 -0
- package/dist/commands/platform-auth-migration-ops.js +369 -0
- package/dist/commands/platform-auth-migration-ops.js.map +1 -0
- package/dist/commands/project-setup.js +1 -1
- package/dist/commands/project-setup.js.map +1 -1
- package/dist/config.d.ts +4 -4
- package/dist/config.d.ts.map +1 -1
- package/dist/control-plane.d.ts +0 -11
- package/dist/control-plane.d.ts.map +1 -1
- package/dist/control-plane.js +1 -8
- package/dist/control-plane.js.map +1 -1
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +3 -5
- package/dist/doctor.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.d.ts.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.js +4 -0
- package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.d.ts.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js +1 -0
- package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js.map +1 -1
- package/node_modules/@noodle-borg/auth/dist/jwt-issuer.d.ts +2 -2
- package/node_modules/@noodle-borg/auth/dist/jwt-issuer.d.ts.map +1 -1
- package/node_modules/@noodle-borg/auth/dist/jwt-issuer.js +1 -1
- package/node_modules/@noodle-borg/auth/dist/verify.d.ts +1 -1
- package/node_modules/@noodle-borg/auth/dist/verify.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/auth/deploy-gate.d.ts +26 -0
- package/node_modules/@noodle-borg/service/dist/auth/deploy-gate.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/auth/deploy-gate.js +105 -1
- package/node_modules/@noodle-borg/service/dist/auth/deploy-gate.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/control-plane-auth-bootstrap.d.ts +25 -0
- package/node_modules/@noodle-borg/service/dist/control-plane-auth-bootstrap.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/control-plane-auth-bootstrap.js +99 -0
- package/node_modules/@noodle-borg/service/dist/control-plane-auth-bootstrap.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/index.d.ts +15 -0
- package/node_modules/@noodle-borg/service/dist/index.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/index.js +15 -0
- package/node_modules/@noodle-borg/service/dist/index.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/main.js +112 -19
- package/node_modules/@noodle-borg/service/dist/main.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/app.d.ts +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/app.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/app.js +9 -1
- package/node_modules/@noodle-borg/service/dist/oauth/app.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/authorization-initiation.d.ts +24 -0
- package/node_modules/@noodle-borg/service/dist/oauth/authorization-initiation.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/authorization-initiation.js +88 -0
- package/node_modules/@noodle-borg/service/dist/oauth/authorization-initiation.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/consent-claims.d.ts +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/consent-claims.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/consent-token.d.ts +5 -0
- package/node_modules/@noodle-borg/service/dist/oauth/consent-token.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/consent-token.js +19 -0
- package/node_modules/@noodle-borg/service/dist/oauth/consent-token.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/consent.js +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/first-party-client.d.ts +13 -0
- package/node_modules/@noodle-borg/service/dist/oauth/first-party-client.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/first-party-client.js +62 -0
- package/node_modules/@noodle-borg/service/dist/oauth/first-party-client.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/metadata.d.ts +4 -0
- package/node_modules/@noodle-borg/service/dist/oauth/metadata.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/metadata.js +20 -0
- package/node_modules/@noodle-borg/service/dist/oauth/metadata.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/paths.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/paths.js +2 -0
- package/node_modules/@noodle-borg/service/dist/oauth/paths.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/platform-principal-guard.d.ts +15 -0
- package/node_modules/@noodle-borg/service/dist/oauth/platform-principal-guard.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/platform-principal-guard.js +58 -0
- package/node_modules/@noodle-borg/service/dist/oauth/platform-principal-guard.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/platform-principal-postgres.d.ts +8 -0
- package/node_modules/@noodle-borg/service/dist/oauth/platform-principal-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/platform-principal-postgres.js +49 -0
- package/node_modules/@noodle-borg/service/dist/oauth/platform-principal-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/postgres-time.d.ts +3 -0
- package/node_modules/@noodle-borg/service/dist/oauth/postgres-time.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/postgres-time.js +7 -0
- package/node_modules/@noodle-borg/service/dist/oauth/postgres-time.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/provider.d.ts +20 -25
- package/node_modules/@noodle-borg/service/dist/oauth/provider.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/provider.js +105 -196
- package/node_modules/@noodle-borg/service/dist/oauth/provider.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/service-bootstrap.d.ts +36 -0
- package/node_modules/@noodle-borg/service/dist/oauth/service-bootstrap.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/service-bootstrap.js +157 -0
- package/node_modules/@noodle-borg/service/dist/oauth/service-bootstrap.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/store-postgres-schema.d.ts +4 -0
- package/node_modules/@noodle-borg/service/dist/oauth/store-postgres-schema.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/store-postgres-schema.js +110 -0
- package/node_modules/@noodle-borg/service/dist/oauth/store-postgres-schema.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.d.ts +7 -4
- package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.js +63 -120
- package/node_modules/@noodle-borg/service/dist/oauth/store-postgres.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/store.d.ts +19 -6
- package/node_modules/@noodle-borg/service/dist/oauth/store.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/store.js +24 -2
- package/node_modules/@noodle-borg/service/dist/oauth/store.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/tokens.d.ts +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/tokens.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/tokens.js +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/tokens.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-availability.d.ts +4 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-availability.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-availability.js +8 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-availability.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-handler.d.ts +34 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-handler.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-handler.js +109 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-handler.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-support.d.ts +22 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-support.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-support.js +30 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-callback-support.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-consent.d.ts +21 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-consent.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-consent.js +56 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-consent.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-federation.d.ts +30 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-federation.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-federation.js +94 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-federation.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-human.d.ts +33 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-human.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-human.js +27 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-human.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-provider-choice.d.ts +13 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-provider-choice.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-provider-choice.js +63 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-provider-choice.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-rollout-store.d.ts +20 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-rollout-store.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-rollout-store.js +40 -0
- package/node_modules/@noodle-borg/service/dist/oauth/upstream-rollout-store.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/workos-events.d.ts +115 -0
- package/node_modules/@noodle-borg/service/dist/oauth/workos-events.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/workos-events.js +310 -0
- package/node_modules/@noodle-borg/service/dist/oauth/workos-events.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/workos.d.ts +65 -0
- package/node_modules/@noodle-borg/service/dist/oauth/workos.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/oauth/workos.js +85 -0
- package/node_modules/@noodle-borg/service/dist/oauth/workos.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/options.d.ts +11 -2
- package/node_modules/@noodle-borg/service/dist/options.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/personal-workspace.d.ts +2 -0
- package/node_modules/@noodle-borg/service/dist/personal-workspace.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/personal-workspace.js +8 -2
- package/node_modules/@noodle-borg/service/dist/personal-workspace.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-auth-configuration.d.ts +67 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-configuration.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-configuration.js +54 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-configuration.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-frozen-candidate-postgres.d.ts +25 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-frozen-candidate-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-frozen-candidate-postgres.js +61 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-frozen-candidate-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-legacy-sources-postgres.d.ts +32 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-legacy-sources-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-legacy-sources-postgres.js +231 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-legacy-sources-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-local-postgres.d.ts +29 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-local-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-local-postgres.js +350 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-local-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-local-subjects-postgres.d.ts +50 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-local-subjects-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-local-subjects-postgres.js +239 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-local-subjects-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-paging.d.ts +66 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-paging.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-paging.js +77 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-paging.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-postgres.d.ts +40 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-postgres.js +355 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-progress-postgres.d.ts +41 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-progress-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-progress-postgres.js +230 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-progress-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-postgres.d.ts +20 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-postgres.js +126 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-sources.d.ts +8 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-sources.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-sources.js +86 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-sources.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-migration-postgres.d.ts +42 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-migration-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-migration-postgres.js +368 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-migration-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-migration-runs-postgres.d.ts +86 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-migration-runs-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-migration-runs-postgres.js +474 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-migration-runs-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-migration-schema.d.ts +17 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-migration-schema.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-migration-schema.js +435 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-migration-schema.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-migration.d.ts +202 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-migration.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-migration.js +313 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-migration.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-batches.d.ts +48 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-batches.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-batches.js +158 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-batches.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-effects.d.ts +43 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-effects.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-effects.js +92 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-effects.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-operation-postgres.d.ts +31 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-operation-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-operation-postgres.js +94 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-operation-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-ports.d.ts +102 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-ports.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-ports.js +2 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-ports.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-postgres.d.ts +17 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-postgres.js +367 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-remote-status.d.ts +10 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-remote-status.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-remote-status.js +37 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-remote-status.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-rollout.d.ts +36 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-rollout.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-rollout.js +156 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-rollout.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-schema.d.ts +4 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-schema.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-schema.js +162 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-schema.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-state-postgres.d.ts +92 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-state-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-state-postgres.js +271 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-state-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-state-support.d.ts +13 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-state-support.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-state-support.js +67 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-state-support.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-support.d.ts +15 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-support.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-support.js +47 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator-support.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator.d.ts +1569 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator.js +274 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-operator.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification-postgres-support.d.ts +41 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification-postgres-support.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification-postgres-support.js +163 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification-postgres-support.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification-postgres.d.ts +34 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification-postgres.js +274 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification-schema.d.ts +3 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification-schema.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification-schema.js +120 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification-schema.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification.d.ts +79 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification.js +88 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-remote-verification.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-rollback-guard.d.ts +6 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-rollback-guard.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-rollback-guard.js +38 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-rollback-guard.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-rollout-postgres.d.ts +61 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-rollout-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-rollout-postgres.js +292 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-rollout-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-rollout-readiness-postgres.d.ts +19 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-rollout-readiness-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-rollout-readiness-postgres.js +121 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-rollout-readiness-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-rollout-support.d.ts +119 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-rollout-support.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-rollout-support.js +194 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-rollout-support.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-runtime.d.ts +36 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-runtime.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-runtime.js +93 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-runtime.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-service-bootstrap.d.ts +32 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-service-bootstrap.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-service-bootstrap.js +68 -0
- package/node_modules/@noodle-borg/service/dist/platform-auth-service-bootstrap.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-maintenance.d.ts +36 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-maintenance.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-maintenance.js +92 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-maintenance.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-postgres.d.ts +23 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-postgres.js +231 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-schema-postgres.d.ts +13 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-schema-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-schema-postgres.js +399 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-schema-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-sync-enqueue.d.ts +18 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-sync-enqueue.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-sync-enqueue.js +25 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-sync-enqueue.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-sync-evidence-postgres.d.ts +15 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-sync-evidence-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-sync-evidence-postgres.js +74 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-sync-evidence-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-sync-postgres.d.ts +19 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-sync-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-sync-postgres.js +249 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-sync-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-sync-recovery-postgres.d.ts +34 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-sync-recovery-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-sync-recovery-postgres.js +275 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-sync-recovery-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-sync.d.ts +98 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-sync.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-sync.js +179 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity-sync.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity.d.ts +110 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity.js +312 -0
- package/node_modules/@noodle-borg/service/dist/platform-identity.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/auth-discovery.d.ts +6 -0
- package/node_modules/@noodle-borg/service/dist/routes/auth-discovery.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/auth-discovery.js +36 -0
- package/node_modules/@noodle-borg/service/dist/routes/auth-discovery.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/billing-read.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/billing-read.js +3 -9
- package/node_modules/@noodle-borg/service/dist/routes/billing-read.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/billing-stripe.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/billing-stripe.js +3 -3
- package/node_modules/@noodle-borg/service/dist/routes/billing-stripe.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/github-run-claim.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/github-run-claim.js +3 -1
- package/node_modules/@noodle-borg/service/dist/routes/github-run-claim.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/routes/platform-auth-migration-dispatch.d.ts +8 -0
- package/node_modules/@noodle-borg/service/dist/routes/platform-auth-migration-dispatch.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/platform-auth-migration-dispatch.js +40 -0
- package/node_modules/@noodle-borg/service/dist/routes/platform-auth-migration-dispatch.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/platform-auth-migration.d.ts +13 -0
- package/node_modules/@noodle-borg/service/dist/routes/platform-auth-migration.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/routes/platform-auth-migration.js +158 -0
- package/node_modules/@noodle-borg/service/dist/routes/platform-auth-migration.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/serve-options.d.ts +21 -3
- package/node_modules/@noodle-borg/service/dist/serve-options.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/serve.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/serve.js +61 -146
- package/node_modules/@noodle-borg/service/dist/serve.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/service-resource-cleanup.d.ts +1 -0
- package/node_modules/@noodle-borg/service/dist/service-resource-cleanup.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/service-resource-cleanup.js +3 -0
- package/node_modules/@noodle-borg/service/dist/service-resource-cleanup.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/service.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/service.js +17 -29
- package/node_modules/@noodle-borg/service/dist/service.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/control-plane.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/control-plane.js +60 -19
- package/node_modules/@noodle-borg/service/dist/store/control-plane.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-control-plane.d.ts +1 -2
- package/node_modules/@noodle-borg/service/dist/store/postgres-control-plane.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-control-plane.js +0 -40
- package/node_modules/@noodle-borg/service/dist/store/postgres-control-plane.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-personal-workspace.d.ts +5 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-personal-workspace.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-personal-workspace.js +176 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-personal-workspace.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-schema.d.ts +2 -0
- package/node_modules/@noodle-borg/service/dist/store/postgres-schema.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-schema.js +43 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-schema.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-signup.js +2 -1
- package/node_modules/@noodle-borg/service/dist/store/postgres-signup.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/workos-directory.d.ts +71 -0
- package/node_modules/@noodle-borg/service/dist/workos-directory.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/workos-directory.js +175 -0
- package/node_modules/@noodle-borg/service/dist/workos-directory.js.map +1 -0
- package/node_modules/@noodle-borg/service/package.json +1 -0
- package/node_modules/@workos-inc/node/LICENSE +21 -0
- package/node_modules/@workos-inc/node/README.md +140 -0
- package/node_modules/@workos-inc/node/lib/factory-B8vTFojy.d.cts +9727 -0
- package/node_modules/@workos-inc/node/lib/factory-B8vTFojy.d.mts +9727 -0
- package/node_modules/@workos-inc/node/lib/factory-CoKXdPX2.cjs +8426 -0
- package/node_modules/@workos-inc/node/lib/factory-CoKXdPX2.cjs.map +1 -0
- package/node_modules/@workos-inc/node/lib/factory-MKPb5Egh.mjs +8241 -0
- package/node_modules/@workos-inc/node/lib/factory-MKPb5Egh.mjs.map +1 -0
- package/node_modules/@workos-inc/node/lib/index.cjs +449 -0
- package/node_modules/@workos-inc/node/lib/index.cjs.map +1 -0
- package/node_modules/@workos-inc/node/lib/index.d.cts +478 -0
- package/node_modules/@workos-inc/node/lib/index.d.mts +478 -0
- package/node_modules/@workos-inc/node/lib/index.mjs +394 -0
- package/node_modules/@workos-inc/node/lib/index.mjs.map +1 -0
- package/node_modules/@workos-inc/node/lib/index.worker.cjs +60 -0
- package/node_modules/@workos-inc/node/lib/index.worker.cjs.map +1 -0
- package/node_modules/@workos-inc/node/lib/index.worker.d.cts +16 -0
- package/node_modules/@workos-inc/node/lib/index.worker.d.mts +16 -0
- package/node_modules/@workos-inc/node/lib/index.worker.mjs +35 -0
- package/node_modules/@workos-inc/node/lib/index.worker.mjs.map +1 -0
- package/node_modules/@workos-inc/node/lib/webapi-BgpV54gi.mjs +3224 -0
- package/node_modules/@workos-inc/node/lib/webapi-BgpV54gi.mjs.map +1 -0
- package/node_modules/@workos-inc/node/lib/webapi-BzGFatFp.cjs +3271 -0
- package/node_modules/@workos-inc/node/lib/webapi-BzGFatFp.cjs.map +1 -0
- package/node_modules/@workos-inc/node/package.json +96 -0
- package/package.json +2 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Response } from 'express';
|
|
2
|
+
import type { ConsentClaims } from './consent-claims.js';
|
|
3
|
+
import { type DeveloperGrantOAuthFlow } from './developer-grant-flow.js';
|
|
4
|
+
import type { OAuthStore, PendingAuthorizationRecord } from './store.js';
|
|
5
|
+
import type { OAuthTokenIssuer } from './token-issuer.js';
|
|
6
|
+
export declare function renderUpstreamConsent(input: {
|
|
7
|
+
readonly pending: PendingAuthorizationRecord;
|
|
8
|
+
readonly identity: {
|
|
9
|
+
readonly email: string;
|
|
10
|
+
readonly locale?: string;
|
|
11
|
+
readonly timeZone?: string;
|
|
12
|
+
};
|
|
13
|
+
readonly ownerSubject: string;
|
|
14
|
+
readonly issuer: string;
|
|
15
|
+
readonly store: OAuthStore;
|
|
16
|
+
readonly tokenIssuer: OAuthTokenIssuer;
|
|
17
|
+
readonly developerGrantFlow?: DeveloperGrantOAuthFlow;
|
|
18
|
+
readonly signConsent: (claims: ConsentClaims) => Promise<string>;
|
|
19
|
+
readonly res: Response;
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
//# sourceMappingURL=upstream-consent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upstream-consent.d.ts","sourceRoot":"","sources":["../../src/oauth/upstream-consent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,2BAA2B,CAAC;AAGnC,OAAO,KAAK,EAAE,UAAU,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,wBAAsB,qBAAqB,CAAC,KAAK,EAAE;IACjD,QAAQ,CAAC,OAAO,EAAE,0BAA0B,CAAC;IAC7C,QAAQ,CAAC,QAAQ,EAAE;QACjB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC;IACvC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,uBAAuB,CAAC;IACtD,QAAQ,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACjE,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC;CACxB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8DhB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { renderConsentPage } from './consent.js';
|
|
2
|
+
import { isDeveloperResourceForIssuer, } from './developer-grant-flow.js';
|
|
3
|
+
import { storedOAuthOwnerPreferences } from './identity-preferences.js';
|
|
4
|
+
import { hostOf } from './provider-util.js';
|
|
5
|
+
export async function renderUpstreamConsent(input) {
|
|
6
|
+
const preferences = storedOAuthOwnerPreferences(input.identity);
|
|
7
|
+
if (isDeveloperResourceForIssuer(input.pending.resource, input.issuer)) {
|
|
8
|
+
if (input.developerGrantFlow === undefined) {
|
|
9
|
+
input.res.status(400).type('text/plain').send('developer access is not configured');
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
await input.developerGrantFlow.renderSelection(input.pending, { subject: input.ownerSubject, email: input.identity.email, ...preferences }, input.res);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (await input.store.hasConsentGrant(input.pending.clientId, input.ownerSubject, input.pending.resource)) {
|
|
16
|
+
await input.tokenIssuer.issueAuthorizationCode(input.res, {
|
|
17
|
+
clientId: input.pending.clientId,
|
|
18
|
+
codeChallenge: input.pending.codeChallenge,
|
|
19
|
+
redirectUri: input.pending.redirectUri,
|
|
20
|
+
resource: input.pending.resource,
|
|
21
|
+
ownerSubject: input.ownerSubject,
|
|
22
|
+
ownerEmail: input.identity.email,
|
|
23
|
+
...preferences,
|
|
24
|
+
...(input.pending.clientState !== undefined
|
|
25
|
+
? { clientState: input.pending.clientState }
|
|
26
|
+
: {}),
|
|
27
|
+
...(input.pending.scope !== undefined ? { scope: input.pending.scope } : {}),
|
|
28
|
+
});
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const consentToken = await input.signConsent({
|
|
32
|
+
kind: 'consent',
|
|
33
|
+
clientId: input.pending.clientId,
|
|
34
|
+
redirectUri: input.pending.redirectUri,
|
|
35
|
+
codeChallenge: input.pending.codeChallenge,
|
|
36
|
+
resource: input.pending.resource,
|
|
37
|
+
ownerSubject: input.ownerSubject,
|
|
38
|
+
ownerEmail: input.identity.email,
|
|
39
|
+
...preferences,
|
|
40
|
+
...(input.pending.clientState !== undefined ? { clientState: input.pending.clientState } : {}),
|
|
41
|
+
...(input.pending.scope !== undefined ? { scope: input.pending.scope } : {}),
|
|
42
|
+
});
|
|
43
|
+
const client = await input.store.getClient(input.pending.clientId);
|
|
44
|
+
input.res
|
|
45
|
+
.status(200)
|
|
46
|
+
.type('html')
|
|
47
|
+
.send(renderConsentPage({
|
|
48
|
+
clientName: client?.client_name ?? input.pending.clientId,
|
|
49
|
+
resourceHost: hostOf(input.pending.resource),
|
|
50
|
+
redirectHost: hostOf(input.pending.redirectUri),
|
|
51
|
+
userEmail: input.identity.email,
|
|
52
|
+
consentToken,
|
|
53
|
+
consentAction: '/oauth/consent',
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=upstream-consent.js.map
|
|
@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C,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC7E,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnE,KAAK,CAAC,GAAG;SACN,MAAM,CAAC,GAAG,CAAC;SACX,IAAI,CAAC,MAAM,CAAC;SACZ,IAAI,CACH,iBAAiB,CAAC;QAChB,UAAU,EAAE,MAAM,EAAE,WAAW,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ;QACzD,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;QAC5C,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC;QAC/C,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK;QAC/B,YAAY;QACZ,aAAa,EAAE,gBAAgB;KAChC,CAAC,CACH,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ControlPlaneSignupMode, SignupAuthorizer } from '../auth/deploy-gate.js';
|
|
2
|
+
import { type PlatformPrincipalResolver, type UpstreamHumanIdentity } from '../platform-identity.js';
|
|
3
|
+
import type { GoogleAuthenticator } from './google.js';
|
|
4
|
+
import type { UpstreamHumanOAuthAuthenticator, UpstreamHumanProvider } from './upstream-human.js';
|
|
5
|
+
export declare function upstreamAuthorizationUrl(input: {
|
|
6
|
+
readonly provider: UpstreamHumanProvider;
|
|
7
|
+
readonly google?: GoogleAuthenticator;
|
|
8
|
+
readonly workos?: UpstreamHumanOAuthAuthenticator;
|
|
9
|
+
readonly state: string;
|
|
10
|
+
}): string;
|
|
11
|
+
export declare function exchangeUpstreamHumanIdentity(input: {
|
|
12
|
+
readonly provider: UpstreamHumanProvider;
|
|
13
|
+
readonly code: string;
|
|
14
|
+
readonly google?: GoogleAuthenticator;
|
|
15
|
+
readonly workos?: UpstreamHumanOAuthAuthenticator;
|
|
16
|
+
}): Promise<UpstreamHumanIdentity & {
|
|
17
|
+
readonly locale?: string;
|
|
18
|
+
readonly timeZone?: string;
|
|
19
|
+
}>;
|
|
20
|
+
export declare function resolveUpstreamHumanPrincipal(input: {
|
|
21
|
+
readonly provider: UpstreamHumanProvider;
|
|
22
|
+
readonly identity: UpstreamHumanIdentity;
|
|
23
|
+
readonly resolver?: PlatformPrincipalResolver;
|
|
24
|
+
readonly signupAuthorizer?: SignupAuthorizer;
|
|
25
|
+
readonly allowedEmailDomain?: string;
|
|
26
|
+
readonly signupMode?: ControlPlaneSignupMode;
|
|
27
|
+
readonly deniedSignupDomains?: readonly string[];
|
|
28
|
+
readonly deniedSignupSubjects?: readonly string[];
|
|
29
|
+
}): Promise<string>;
|
|
30
|
+
//# sourceMappingURL=upstream-federation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upstream-federation.d.ts","sourceRoot":"","sources":["../../src/oauth/upstream-federation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAE,+BAA+B,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAElG,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC9C,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC;IACzC,QAAQ,CAAC,MAAM,CAAC,EAAE,mBAAmB,CAAC;IACtC,QAAQ,CAAC,MAAM,CAAC,EAAE,+BAA+B,CAAC;IAClD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,GAAG,MAAM,CAMT;AAED,wBAAsB,6BAA6B,CAAC,KAAK,EAAE;IACzD,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,mBAAmB,CAAC;IACtC,QAAQ,CAAC,MAAM,CAAC,EAAE,+BAA+B,CAAC;CACnD,GAAG,OAAO,CAAC,qBAAqB,GAAG;IAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAoB5F;AAED,wBAAsB,6BAA6B,CAAC,KAAK,EAAE;IACzD,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC;IACzC,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC;IACzC,QAAQ,CAAC,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IAC9C,QAAQ,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IAC7C,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,UAAU,CAAC,EAAE,sBAAsB,CAAC;IAC7C,QAAQ,CAAC,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjD,QAAQ,CAAC,oBAAoB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACnD,GAAG,OAAO,CAAC,MAAM,CAAC,CA6ClB"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { PlatformIdentityError, } from '../platform-identity.js';
|
|
2
|
+
export function upstreamAuthorizationUrl(input) {
|
|
3
|
+
if (input.provider === 'google') {
|
|
4
|
+
if (input.google === undefined)
|
|
5
|
+
throw new Error('Google authenticator is unavailable');
|
|
6
|
+
return input.google.authorizationUrl(input.state);
|
|
7
|
+
}
|
|
8
|
+
return input.workos?.authorizationUrl(input.state) ?? '';
|
|
9
|
+
}
|
|
10
|
+
export async function exchangeUpstreamHumanIdentity(input) {
|
|
11
|
+
if (input.provider === 'workos') {
|
|
12
|
+
if (input.workos === undefined)
|
|
13
|
+
throw new Error('WorkOS authenticator is unavailable');
|
|
14
|
+
const identity = await input.workos.exchange(input.code);
|
|
15
|
+
if (identity.provider !== input.workos.provider || identity.realm !== input.workos.realm) {
|
|
16
|
+
throw new Error('WorkOS identity provider or realm mismatch');
|
|
17
|
+
}
|
|
18
|
+
return identity;
|
|
19
|
+
}
|
|
20
|
+
if (input.google === undefined)
|
|
21
|
+
throw new Error('Google authenticator is unavailable');
|
|
22
|
+
const identity = await input.google.exchange(input.code);
|
|
23
|
+
return {
|
|
24
|
+
provider: 'google',
|
|
25
|
+
realm: 'accounts.google.com',
|
|
26
|
+
subject: identity.subject,
|
|
27
|
+
email: identity.email,
|
|
28
|
+
emailVerified: true,
|
|
29
|
+
...(identity.locale !== undefined ? { locale: identity.locale } : {}),
|
|
30
|
+
...(identity.timeZone !== undefined ? { timeZone: identity.timeZone } : {}),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export async function resolveUpstreamHumanPrincipal(input) {
|
|
34
|
+
if (input.provider === 'google') {
|
|
35
|
+
// Admission is evaluated against the verified Google identity before creating canonical state or
|
|
36
|
+
// enqueueing WorkOS synchronization. Rejected callbacks must be side-effect free.
|
|
37
|
+
assertIdentityIsNotDenied(input, input.identity.subject);
|
|
38
|
+
if ((input.signupMode ?? 'restricted') === 'restricted' &&
|
|
39
|
+
input.allowedEmailDomain !== undefined &&
|
|
40
|
+
!emailMatchesDomain(input.identity.email, input.allowedEmailDomain) &&
|
|
41
|
+
!(await input.signupAuthorizer?.isSignupAllowed({
|
|
42
|
+
subject: input.identity.subject,
|
|
43
|
+
email: input.identity.email.toLowerCase(),
|
|
44
|
+
}))) {
|
|
45
|
+
throw new PlatformIdentityError('identity_link_required');
|
|
46
|
+
}
|
|
47
|
+
return input.resolver === undefined
|
|
48
|
+
? input.identity.subject
|
|
49
|
+
: (await input.resolver.resolve(input.identity)).subject;
|
|
50
|
+
}
|
|
51
|
+
if (input.resolver === undefined)
|
|
52
|
+
throw new PlatformIdentityError('identity_link_required');
|
|
53
|
+
const existing = await input.resolver.resolveLinked(input.identity);
|
|
54
|
+
// Linked identities are still observed through the resolver so a newer verified WorkOS email becomes the
|
|
55
|
+
// sole current provider/realm evidence. This is not email linking: the immutable WorkOS ID was resolved first.
|
|
56
|
+
if (existing !== undefined) {
|
|
57
|
+
assertIdentityIsNotDenied(input, existing.subject);
|
|
58
|
+
return (await input.resolver.resolve(input.identity)).subject;
|
|
59
|
+
}
|
|
60
|
+
if (await input.resolver.hasVerifiedEmailEvidence(input.identity.email)) {
|
|
61
|
+
throw new PlatformIdentityError('identity_link_required');
|
|
62
|
+
}
|
|
63
|
+
assertIdentityIsNotDenied(input);
|
|
64
|
+
if ((input.signupMode ?? 'restricted') === 'public') {
|
|
65
|
+
return (await input.resolver.resolve(input.identity)).subject;
|
|
66
|
+
}
|
|
67
|
+
const signupAllowed = await input.signupAuthorizer?.isSignupAllowed({
|
|
68
|
+
subject: input.identity.subject,
|
|
69
|
+
email: input.identity.email.toLowerCase(),
|
|
70
|
+
});
|
|
71
|
+
const domainAllowed = input.allowedEmailDomain !== undefined &&
|
|
72
|
+
emailMatchesDomain(input.identity.email, input.allowedEmailDomain);
|
|
73
|
+
if (!domainAllowed && signupAllowed !== true)
|
|
74
|
+
throw new PlatformIdentityError('identity_link_required');
|
|
75
|
+
return (await input.resolver.resolve(input.identity)).subject;
|
|
76
|
+
}
|
|
77
|
+
function assertIdentityIsNotDenied(input, canonicalSubject) {
|
|
78
|
+
const subjects = new Set((input.deniedSignupSubjects ?? []).map((subject) => subject.trim().toLowerCase()));
|
|
79
|
+
const externalSubject = input.identity.subject.toLowerCase();
|
|
80
|
+
const canonical = canonicalSubject?.toLowerCase();
|
|
81
|
+
const deniedDomain = (input.deniedSignupDomains ?? []).some((domain) => emailMatchesDomain(input.identity.email, domain));
|
|
82
|
+
if (subjects.has(externalSubject) ||
|
|
83
|
+
(canonical !== undefined && subjects.has(canonical)) ||
|
|
84
|
+
deniedDomain) {
|
|
85
|
+
throw new PlatformIdentityError('identity_signup_denied');
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function emailMatchesDomain(email, configuredDomain) {
|
|
89
|
+
const domain = configuredDomain.trim().toLowerCase();
|
|
90
|
+
if (domain.length === 0)
|
|
91
|
+
return false;
|
|
92
|
+
return email.toLowerCase().endsWith(domain.startsWith('@') ? domain : `@${domain}`);
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=upstream-federation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upstream-federation.js","sourceRoot":"","sources":["../../src/oauth/upstream-federation.ts"],"names":[],"mappings":"AACA,OAAO,EACL,qBAAqB,GAGtB,MAAM,yBAAyB,CAAC;AAIjC,MAAM,UAAU,wBAAwB,CAAC,KAKxC;IACC,IAAI,KAAK,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAChC,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;QACvF,OAAO,KAAK,CAAC,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,KAAK,CAAC,MAAM,EAAE,gBAAgB,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;AAC3D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,6BAA6B,CAAC,KAKnD;IACC,IAAI,KAAK,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAChC,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;QACvF,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI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IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CACrE,kBAAkB,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CACjD,CAAC;IACF,IACE,QAAQ,CAAC,GAAG,CAAC,eAAe,CAAC;QAC7B,CAAC,SAAS,KAAK,SAAS,IAAI,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACpD,YAAY,EACZ,CAAC;QACD,MAAM,IAAI,qBAAqB,CAAC,wBAAwB,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAa,EAAE,gBAAwB;IACjE,MAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACrD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACtC,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC;AACtF,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { UpstreamHumanIdentity } from '../platform-identity.js';
|
|
2
|
+
export type UpstreamHumanProvider = 'google' | 'workos';
|
|
3
|
+
/**
|
|
4
|
+
* The OAuth-facing federation boundary. Implementations receive an authorization code and return identity
|
|
5
|
+
* claims only: upstream access and refresh credentials are deliberately discarded at this boundary.
|
|
6
|
+
*/
|
|
7
|
+
export interface UpstreamHumanOAuthAuthenticator {
|
|
8
|
+
readonly provider: UpstreamHumanProvider;
|
|
9
|
+
readonly realm: string;
|
|
10
|
+
authorizationUrl(state: string): string;
|
|
11
|
+
exchange(code: string): Promise<UpstreamHumanIdentity & {
|
|
12
|
+
readonly locale?: string;
|
|
13
|
+
readonly timeZone?: string;
|
|
14
|
+
}>;
|
|
15
|
+
}
|
|
16
|
+
export interface UpstreamHumanRollout {
|
|
17
|
+
readonly workosPercentage: number;
|
|
18
|
+
readonly workosCanaryClientIds: readonly string[];
|
|
19
|
+
/** Recovery clients remain WorkOS-routed while the normal percentage is rolled back to zero. */
|
|
20
|
+
readonly workosRecoveryClientIds?: readonly string[];
|
|
21
|
+
/**
|
|
22
|
+
* Server-owned rollback state may offer an explicit browser choice to use WorkOS even when this
|
|
23
|
+
* transaction's normal rollout selection is Google. OAuth clients cannot set this value.
|
|
24
|
+
*/
|
|
25
|
+
readonly allowUserSelectedWorkosRecovery?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare const GOOGLE_ONLY_UPSTREAM_ROLLOUT: UpstreamHumanRollout;
|
|
28
|
+
/** Select once at authorization creation; callbacks must use the stored result, never recalculate rollout. */
|
|
29
|
+
export declare function selectUpstreamHumanProvider(input: {
|
|
30
|
+
readonly clientId: string;
|
|
31
|
+
readonly transactionNonce: string;
|
|
32
|
+
}, rollout?: UpstreamHumanRollout): UpstreamHumanProvider;
|
|
33
|
+
//# sourceMappingURL=upstream-human.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upstream-human.d.ts","sourceRoot":"","sources":["../../src/oauth/upstream-human.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAErE,MAAM,MAAM,qBAAqB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAExD;;;GAGG;AACH,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC;IACzC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACxC,QAAQ,CACN,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,qBAAqB,GAAG;QAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC9F;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,qBAAqB,EAAE,SAAS,MAAM,EAAE,CAAC;IAClD,gGAAgG;IAChG,QAAQ,CAAC,uBAAuB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrD;;;OAGG;IACH,QAAQ,CAAC,+BAA+B,CAAC,EAAE,OAAO,CAAC;CACpD;AAED,eAAO,MAAM,4BAA4B,EAAE,oBAK1C,CAAC;AAEF,8GAA8G;AAC9G,wBAAgB,2BAA2B,CACzC,KAAK,EAAE;IAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;CAAE,EACvE,OAAO,GAAE,oBAAmD,GAC3D,qBAAqB,CAavB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
export const GOOGLE_ONLY_UPSTREAM_ROLLOUT = {
|
|
3
|
+
workosPercentage: 0,
|
|
4
|
+
workosCanaryClientIds: [],
|
|
5
|
+
workosRecoveryClientIds: [],
|
|
6
|
+
allowUserSelectedWorkosRecovery: false,
|
|
7
|
+
};
|
|
8
|
+
/** Select once at authorization creation; callbacks must use the stored result, never recalculate rollout. */
|
|
9
|
+
export function selectUpstreamHumanProvider(input, rollout = GOOGLE_ONLY_UPSTREAM_ROLLOUT) {
|
|
10
|
+
if (rollout.workosRecoveryClientIds?.includes(input.clientId) === true)
|
|
11
|
+
return 'workos';
|
|
12
|
+
if (rollout.workosPercentage <= 0)
|
|
13
|
+
return 'google';
|
|
14
|
+
if (rollout.workosCanaryClientIds.includes(input.clientId))
|
|
15
|
+
return 'workos';
|
|
16
|
+
if (rollout.workosPercentage >= 100)
|
|
17
|
+
return 'workos';
|
|
18
|
+
const digest = createHash('sha256')
|
|
19
|
+
.update(`${input.clientId}:${input.transactionNonce}`)
|
|
20
|
+
.digest();
|
|
21
|
+
// Map a full uint32 into the exact [0, 2^32) range rather than reducing one byte modulo 100, whose
|
|
22
|
+
// uneven buckets bias an intermediate rollout. The threshold form needs no rejection sampling.
|
|
23
|
+
const bucket = digest.readUInt32BE(0);
|
|
24
|
+
const threshold = (rollout.workosPercentage / 100) * 0x1_0000_0000;
|
|
25
|
+
return bucket < threshold ? 'workos' : 'google';
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=upstream-human.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upstream-human.js","sourceRoot":"","sources":["../../src/oauth/upstream-human.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA8BzC,MAAM,CAAC,MAAM,4BAA4B,GAAyB;IAChE,gBAAgB,EAAE,CAAC;IACnB,qBAAqB,EAAE,EAAE;IACzB,uBAAuB,EAAE,EAAE;IAC3B,+BAA+B,EAAE,KAAK;CACvC,CAAC;AAEF,8GAA8G;AAC9G,MAAM,UAAU,2BAA2B,CACzC,KAAuE,EACvE,UAAgC,4BAA4B;IAE5D,IAAI,OAAO,CAAC,uBAAuB,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,IAAI;QAAE,OAAO,QAAQ,CAAC;IACxF,IAAI,OAAO,CAAC,gBAAgB,IAAI,CAAC;QAAE,OAAO,QAAQ,CAAC;IACnD,IAAI,OAAO,CAAC,qBAAqB,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;QAAE,OAAO,QAAQ,CAAC;IAC5E,IAAI,OAAO,CAAC,gBAAgB,IAAI,GAAG;QAAE,OAAO,QAAQ,CAAC;IACrD,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC;SAChC,MAAM,CAAC,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,gBAAgB,EAAE,CAAC;SACrD,MAAM,EAAE,CAAC;IACZ,mGAAmG;IACnG,+FAA+F;IAC/F,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,SAAS,GAAG,CAAC,OAAO,CAAC,gBAAgB,GAAG,GAAG,CAAC,GAAG,aAAa,CAAC;IACnE,OAAO,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Request, Response } from 'express';
|
|
2
|
+
import type { GoogleAuthenticator } from './google.js';
|
|
3
|
+
import type { OAuthStore } from './store.js';
|
|
4
|
+
import type { UpstreamHumanOAuthAuthenticator } from './upstream-human.js';
|
|
5
|
+
export declare function renderUpstreamProviderChoice(state: string): string;
|
|
6
|
+
export declare function continueUpstreamProviderChoice(input: {
|
|
7
|
+
readonly req: Request;
|
|
8
|
+
readonly res: Response;
|
|
9
|
+
readonly store: OAuthStore;
|
|
10
|
+
readonly google?: GoogleAuthenticator;
|
|
11
|
+
readonly workos?: UpstreamHumanOAuthAuthenticator;
|
|
12
|
+
}): Promise<void>;
|
|
13
|
+
//# sourceMappingURL=upstream-provider-choice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upstream-provider-choice.d.ts","sourceRoot":"","sources":["../../src/oauth/upstream-provider-choice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAA8B,MAAM,YAAY,CAAC;AAGzE,OAAO,KAAK,EAAE,+BAA+B,EAAyB,MAAM,qBAAqB,CAAC;AAElG,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAalE;AAED,wBAAsB,8BAA8B,CAAC,KAAK,EAAE;IAC1D,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,mBAAmB,CAAC;IACtC,QAAQ,CAAC,MAAM,CAAC,EAAE,+BAA+B,CAAC;CACnD,GAAG,OAAO,CAAC,IAAI,CAAC,CA+BhB"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { renderOAuthPage } from './branding.js';
|
|
2
|
+
import { hashToken, randomToken } from './tokens.js';
|
|
3
|
+
import { upstreamAuthorizationUrl } from './upstream-federation.js';
|
|
4
|
+
export function renderUpstreamProviderChoice(state) {
|
|
5
|
+
const escapedState = escapeHtml(state);
|
|
6
|
+
return renderOAuthPage({
|
|
7
|
+
title: 'Choose how to sign in — Noodle Seed',
|
|
8
|
+
kicker: 'Sign in',
|
|
9
|
+
heading: 'Choose how to continue',
|
|
10
|
+
contentHtml: `<p class="ns-lede">Google remains the default while authentication is in recovery mode. If your account uses email or another sign-in method, continue securely through WorkOS.</p>
|
|
11
|
+
<form method="post" action="/oauth/upstream/continue">
|
|
12
|
+
<input type="hidden" name="choice_state" value="${escapedState}" />
|
|
13
|
+
<div class="btn-glow"><button class="btn btn-primary" type="submit" name="provider" value="google">Continue with Google</button></div>
|
|
14
|
+
<div class="btn-glow"><button class="btn" type="submit" name="provider" value="workos">Use email or another sign-in method</button></div>
|
|
15
|
+
</form>`,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
export async function continueUpstreamProviderChoice(input) {
|
|
19
|
+
const body = (input.req.body ?? {});
|
|
20
|
+
const state = typeof body.choice_state === 'string' ? body.choice_state : undefined;
|
|
21
|
+
const provider = selectedProvider(body.provider);
|
|
22
|
+
if (state === undefined || provider === undefined) {
|
|
23
|
+
input.res.status(400).type('text/plain').send('invalid sign-in choice');
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if ((provider === 'google' && input.google === undefined) ||
|
|
27
|
+
(provider === 'workos' && input.workos === undefined)) {
|
|
28
|
+
input.res.status(503).set('Retry-After', '5').type('text/plain').send('sign-in unavailable');
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const choice = await input.store.consumePendingAuthorization(hashToken(state), 'upstream_choice');
|
|
32
|
+
if (choice === undefined) {
|
|
33
|
+
input.res.status(400).type('text/plain').send('unknown or expired authorization request');
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const nonce = randomToken();
|
|
37
|
+
await input.store.createPendingAuthorization(finalPending(choice, nonce, provider));
|
|
38
|
+
input.res.redirect(302, upstreamAuthorizationUrl({
|
|
39
|
+
provider,
|
|
40
|
+
...(input.google === undefined ? {} : { google: input.google }),
|
|
41
|
+
...(input.workos === undefined ? {} : { workos: input.workos }),
|
|
42
|
+
state: nonce,
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
function finalPending(choice, nonce, provider) {
|
|
46
|
+
return {
|
|
47
|
+
...choice,
|
|
48
|
+
state: hashToken(nonce),
|
|
49
|
+
upstreamProvider: provider,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function selectedProvider(value) {
|
|
53
|
+
return value === 'google' || value === 'workos' ? value : undefined;
|
|
54
|
+
}
|
|
55
|
+
function escapeHtml(value) {
|
|
56
|
+
return value
|
|
57
|
+
.replace(/&/g, '&')
|
|
58
|
+
.replace(/</g, '<')
|
|
59
|
+
.replace(/>/g, '>')
|
|
60
|
+
.replace(/"/g, '"')
|
|
61
|
+
.replace(/'/g, ''');
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=upstream-provider-choice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upstream-provider-choice.js","sourceRoot":"","sources":["../../src/oauth/upstream-provider-choice.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,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AC,CAAC,SAAS,CAAC;AACtE,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,KAAK;SACT,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;SACvB,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Pool } from 'pg';
|
|
2
|
+
import { type WorkOSConfigurationIdentity } from '../platform-auth-configuration.js';
|
|
3
|
+
import { type UpstreamHumanRollout } from './upstream-human.js';
|
|
4
|
+
/** Server-owned rollout state: callers select once, then persist the result in pending OAuth state. */
|
|
5
|
+
export interface UpstreamHumanRolloutStore {
|
|
6
|
+
get(): Promise<UpstreamHumanRollout>;
|
|
7
|
+
}
|
|
8
|
+
export interface DurableUpstreamHumanRollout extends UpstreamHumanRollout {
|
|
9
|
+
readonly lifecycle: 'google' | 'workos' | 'finalized';
|
|
10
|
+
readonly allowUserSelectedWorkosRecovery: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** Reads only additive Task 1 rollout state. Task 3 owns mutations and operator APIs. */
|
|
13
|
+
export declare class PostgresUpstreamHumanRolloutStore implements UpstreamHumanRolloutStore {
|
|
14
|
+
#private;
|
|
15
|
+
constructor(pool: Pool, options?: {
|
|
16
|
+
readonly workos?: WorkOSConfigurationIdentity;
|
|
17
|
+
});
|
|
18
|
+
get(): Promise<DurableUpstreamHumanRollout>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=upstream-rollout-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upstream-rollout-store.d.ts","sourceRoot":"","sources":["../../src/oauth/upstream-rollout-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,EAEL,KAAK,2BAA2B,EACjC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAgC,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE9F,uGAAuG;AACvG,MAAM,WAAW,yBAAyB;IACxC,GAAG,IAAI,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,2BAA4B,SAAQ,oBAAoB;IACvE,QAAQ,CAAC,SAAS,EAAE,QAAQ,GAAG,QAAQ,GAAG,WAAW,CAAC;IACtD,QAAQ,CAAC,+BAA+B,EAAE,OAAO,CAAC;CACnD;AAED,yFAAyF;AACzF,qBAAa,iCAAkC,YAAW,yBAAyB;;gBAIrE,IAAI,EAAE,IAAI,EAAE,OAAO,GAAE;QAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,2BAA2B,CAAA;KAAO;IAKjF,GAAG,IAAI,OAAO,CAAC,2BAA2B,CAAC;CAyClD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { assertWorkOSRolloutConfigurationContinuity, } from '../platform-auth-configuration.js';
|
|
2
|
+
import { GOOGLE_ONLY_UPSTREAM_ROLLOUT } from './upstream-human.js';
|
|
3
|
+
/** Reads only additive Task 1 rollout state. Task 3 owns mutations and operator APIs. */
|
|
4
|
+
export class PostgresUpstreamHumanRolloutStore {
|
|
5
|
+
#pool;
|
|
6
|
+
#workos;
|
|
7
|
+
constructor(pool, options = {}) {
|
|
8
|
+
this.#pool = pool;
|
|
9
|
+
this.#workos = options.workos;
|
|
10
|
+
}
|
|
11
|
+
async get() {
|
|
12
|
+
const result = await this.#pool.query(`SELECT workos_percentage, workos_canary_client_ids, workos_recovery_client_ids,
|
|
13
|
+
workos_recovery_enabled,
|
|
14
|
+
lifecycle, workos_client_fingerprint, workos_realm_fingerprint
|
|
15
|
+
FROM platform_auth_rollout_state WHERE singleton = true`);
|
|
16
|
+
const row = result.rows[0];
|
|
17
|
+
if (row === undefined)
|
|
18
|
+
return {
|
|
19
|
+
...GOOGLE_ONLY_UPSTREAM_ROLLOUT,
|
|
20
|
+
lifecycle: 'google',
|
|
21
|
+
allowUserSelectedWorkosRecovery: false,
|
|
22
|
+
};
|
|
23
|
+
assertWorkOSRolloutConfigurationContinuity({
|
|
24
|
+
workosPercentage: row.workos_percentage,
|
|
25
|
+
workosRecoveryClientIds: row.workos_recovery_client_ids,
|
|
26
|
+
workosRecoveryEnabled: row.workos_recovery_enabled,
|
|
27
|
+
lifecycle: row.lifecycle,
|
|
28
|
+
workosClientFingerprint: row.workos_client_fingerprint,
|
|
29
|
+
workosRealmFingerprint: row.workos_realm_fingerprint,
|
|
30
|
+
}, this.#workos);
|
|
31
|
+
return {
|
|
32
|
+
workosPercentage: row.workos_percentage,
|
|
33
|
+
workosCanaryClientIds: row.workos_canary_client_ids,
|
|
34
|
+
workosRecoveryClientIds: row.workos_recovery_client_ids,
|
|
35
|
+
allowUserSelectedWorkosRecovery: row.workos_recovery_enabled,
|
|
36
|
+
lifecycle: row.lifecycle,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=upstream-rollout-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upstream-rollout-store.js","sourceRoot":"","sources":["../../src/oauth/upstream-rollout-store.ts"],"names":[],"mappings":"AACA,OAAO,EACL,0CAA0C,GAE3C,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,4BAA4B,EAA6B,MAAM,qBAAqB,CAAC;AAY9F,yFAAyF;AACzF,MAAM,OAAO,iCAAiC;IACnC,KAAK,CAAO;IACZ,OAAO,CAA0C;IAE1D,YAAY,IAAU,EAAE,UAA6D,EAAE;QACrF,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,GAAG;QACP,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,CASnC;;;+DAGyD,CAC1D,CAAC;QACF,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAI,GAAG,KAAK,SAAS;YACnB,OAAO;gBACL,GAAG,4BAA4B;gBAC/B,SAAS,EAAE,QAAQ;gBACnB,+BAA+B,EAAE,KAAK;aACvC,CAAC;QACJ,0CAA0C,CACxC;YACE,gBAAgB,EAAE,GAAG,CAAC,iBAAiB;YACvC,uBAAuB,EAAE,GAAG,CAAC,0BAA0B;YACvD,qBAAqB,EAAE,GAAG,CAAC,uBAAuB;YAClD,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,uBAAuB,EAAE,GAAG,CAAC,yBAAyB;YACtD,sBAAsB,EAAE,GAAG,CAAC,wBAAwB;SACrD,EACD,IAAI,CAAC,OAAO,CACb,CAAC;QACF,OAAO;YACL,gBAAgB,EAAE,GAAG,CAAC,iBAAiB;YACvC,qBAAqB,EAAE,GAAG,CAAC,wBAAwB;YACnD,uBAAuB,EAAE,GAAG,CAAC,0BAA0B;YACvD,+BAA+B,EAAE,GAAG,CAAC,uBAAuB;YAC5D,SAAS,EAAE,GAAG,CAAC,SAAS;SACzB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { Pool } from 'pg';
|
|
2
|
+
declare const WORKOS_EVENT_TYPES: readonly ["user.created", "user.updated", "user.deleted", "session.revoked"];
|
|
3
|
+
type WorkOSRelevantEventType = (typeof WORKOS_EVENT_TYPES)[number];
|
|
4
|
+
/** Ordered subset of the WorkOS Events API used for upstream human-account reconciliation. */
|
|
5
|
+
export interface WorkOSPlatformEvent {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly event: string;
|
|
8
|
+
readonly data: Readonly<Record<string, unknown>>;
|
|
9
|
+
}
|
|
10
|
+
export interface WorkOSEventsClient {
|
|
11
|
+
listEvents(input: {
|
|
12
|
+
readonly events: readonly WorkOSRelevantEventType[];
|
|
13
|
+
readonly order: 'asc';
|
|
14
|
+
readonly after?: string;
|
|
15
|
+
}): Promise<{
|
|
16
|
+
readonly data: readonly WorkOSPlatformEvent[];
|
|
17
|
+
readonly listMetadata: {
|
|
18
|
+
readonly after?: string;
|
|
19
|
+
};
|
|
20
|
+
}>;
|
|
21
|
+
}
|
|
22
|
+
export interface WorkOSIdentityEventStore {
|
|
23
|
+
getCursor(): Promise<string | undefined>;
|
|
24
|
+
/** Atomically applies one effect and records its event ID as the next `after` cursor. */
|
|
25
|
+
applyAndAdvance(input: {
|
|
26
|
+
readonly event: WorkOSPlatformEvent;
|
|
27
|
+
readonly realm: string;
|
|
28
|
+
readonly expectedCursor?: string;
|
|
29
|
+
}): Promise<WorkOSIdentityEventApplyResult>;
|
|
30
|
+
}
|
|
31
|
+
export interface WorkOSIdentityEventApplyResult {
|
|
32
|
+
/** The event effect changed durable identity state. */
|
|
33
|
+
readonly applied: boolean;
|
|
34
|
+
/** The worker observed a newer cursor and must refetch instead of skipping ahead. */
|
|
35
|
+
readonly stale: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface WorkOSSdkEventsPort {
|
|
38
|
+
listEvents(input: {
|
|
39
|
+
readonly events: WorkOSRelevantEventType[];
|
|
40
|
+
readonly order: 'asc';
|
|
41
|
+
readonly after?: string | undefined;
|
|
42
|
+
}): Promise<{
|
|
43
|
+
readonly data: readonly {
|
|
44
|
+
readonly id: string;
|
|
45
|
+
readonly event: string;
|
|
46
|
+
readonly data: object;
|
|
47
|
+
}[];
|
|
48
|
+
readonly listMetadata: {
|
|
49
|
+
readonly after?: string | null;
|
|
50
|
+
};
|
|
51
|
+
}>;
|
|
52
|
+
}
|
|
53
|
+
/** Official SDK boundary for Events API reads; it has no mutation capability. */
|
|
54
|
+
export declare class WorkOSEventsSdkClient implements WorkOSEventsClient {
|
|
55
|
+
#private;
|
|
56
|
+
constructor(apiKey: string, events?: WorkOSSdkEventsPort);
|
|
57
|
+
listEvents(input: {
|
|
58
|
+
readonly events: readonly WorkOSRelevantEventType[];
|
|
59
|
+
readonly order: 'asc';
|
|
60
|
+
readonly after?: string;
|
|
61
|
+
}): Promise<{
|
|
62
|
+
readonly data: readonly WorkOSPlatformEvent[];
|
|
63
|
+
readonly listMetadata: {
|
|
64
|
+
readonly after?: string;
|
|
65
|
+
};
|
|
66
|
+
}>;
|
|
67
|
+
}
|
|
68
|
+
/** Explicit job boundary — this is never a live poller and makes no upstream mutation. */
|
|
69
|
+
export declare class WorkOSEventProcessor {
|
|
70
|
+
#private;
|
|
71
|
+
constructor(input: {
|
|
72
|
+
readonly client: WorkOSEventsClient;
|
|
73
|
+
readonly store: WorkOSIdentityEventStore;
|
|
74
|
+
readonly realm: string;
|
|
75
|
+
readonly maxPages?: number;
|
|
76
|
+
});
|
|
77
|
+
processOnce(): Promise<{
|
|
78
|
+
readonly processed: number;
|
|
79
|
+
readonly cursor?: string;
|
|
80
|
+
readonly caughtUp: true;
|
|
81
|
+
}>;
|
|
82
|
+
}
|
|
83
|
+
/** Test/local durable-behavior model. The Postgres implementation below is the production persistence port. */
|
|
84
|
+
export declare class InMemoryWorkOSIdentityEventStore implements WorkOSIdentityEventStore {
|
|
85
|
+
#private;
|
|
86
|
+
getCursor(): Promise<string | undefined>;
|
|
87
|
+
/** Convenience for focused store tests; production workers use `applyAndAdvance`. */
|
|
88
|
+
apply(event: WorkOSPlatformEvent, realm: string): Promise<boolean>;
|
|
89
|
+
applyAndAdvance(input: {
|
|
90
|
+
readonly event: WorkOSPlatformEvent;
|
|
91
|
+
readonly realm: string;
|
|
92
|
+
readonly expectedCursor?: string;
|
|
93
|
+
}): Promise<WorkOSIdentityEventApplyResult>;
|
|
94
|
+
appliedEvents(): readonly string[];
|
|
95
|
+
user(id: string): {
|
|
96
|
+
readonly email: string;
|
|
97
|
+
readonly status: 'active' | 'suspended';
|
|
98
|
+
} | undefined;
|
|
99
|
+
}
|
|
100
|
+
/** Durable Task 2 event store. Receipt, effect, freshness, and cursor move in one transaction. */
|
|
101
|
+
export declare class PostgresWorkOSIdentityEventStore implements WorkOSIdentityEventStore {
|
|
102
|
+
#private;
|
|
103
|
+
constructor(pool: Pool, options?: {
|
|
104
|
+
readonly stream?: string;
|
|
105
|
+
});
|
|
106
|
+
getCursor(): Promise<string | undefined>;
|
|
107
|
+
apply(event: WorkOSPlatformEvent, realm: string): Promise<boolean>;
|
|
108
|
+
applyAndAdvance(input: {
|
|
109
|
+
readonly event: WorkOSPlatformEvent;
|
|
110
|
+
readonly realm: string;
|
|
111
|
+
readonly expectedCursor?: string;
|
|
112
|
+
}): Promise<WorkOSIdentityEventApplyResult>;
|
|
113
|
+
}
|
|
114
|
+
export {};
|
|
115
|
+
//# sourceMappingURL=workos-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workos-events.d.ts","sourceRoot":"","sources":["../../src/oauth/workos-events.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,IAAI,CAAC;AAG3C,QAAA,MAAM,kBAAkB,8EAKd,CAAC;AAEX,KAAK,uBAAuB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnE,8FAA8F;AAC9F,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAClD;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,KAAK,EAAE;QAChB,QAAQ,CAAC,MAAM,EAAE,SAAS,uBAAuB,EAAE,CAAC;QACpD,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;QACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;KACzB,GAAG,OAAO,CAAC;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