@noodleseed/one 0.63.0 → 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/branding.d.ts +2 -0
- package/node_modules/@noodle-borg/service/dist/oauth/branding.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/branding.js +3 -2
- package/node_modules/@noodle-borg/service/dist/oauth/branding.js.map +1 -1
- 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/developer-grant-page.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/oauth/developer-grant-page.js +216 -28
- package/node_modules/@noodle-borg/service/dist/oauth/developer-grant-page.js.map +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,40 @@
|
|
|
1
|
+
import { applySecurityHeaders, enforceHttps, } from '@noodle-borg/transport-http';
|
|
2
|
+
import { sendJson } from '../http-util.js';
|
|
3
|
+
import { handlePlatformAuthMigrationRoute, } from './platform-auth-migration.js';
|
|
4
|
+
const ROUTES = {
|
|
5
|
+
'/v1/platform-auth/migration/inventory': { method: 'GET', action: 'inventory' },
|
|
6
|
+
'/v1/platform-auth/migration/preview': { method: 'POST', action: 'preview' },
|
|
7
|
+
'/v1/platform-auth/migration/start-import': { method: 'POST', action: 'start_import' },
|
|
8
|
+
'/v1/platform-auth/migration/status': { method: 'GET', action: 'status' },
|
|
9
|
+
'/v1/platform-auth/migration/reconcile': { method: 'POST', action: 'reconcile' },
|
|
10
|
+
'/v1/platform-auth/migration/recover-outbox': { method: 'POST', action: 'recover_outbox' },
|
|
11
|
+
'/v1/platform-auth/migration/activate': { method: 'POST', action: 'activate' },
|
|
12
|
+
'/v1/platform-auth/migration/rollback': { method: 'POST', action: 'rollback' },
|
|
13
|
+
'/v1/platform-auth/migration/finalize': { method: 'POST', action: 'finalize' },
|
|
14
|
+
};
|
|
15
|
+
export function dispatchPlatformAuthMigrationRoutes(req, res, url, deps) {
|
|
16
|
+
const route = ROUTES[url.pathname];
|
|
17
|
+
if (route === undefined || req.method !== route.method)
|
|
18
|
+
return false;
|
|
19
|
+
applySecurityHeaders(res, deps.tls);
|
|
20
|
+
if (enforceHttps(req, res, deps.tls))
|
|
21
|
+
return true;
|
|
22
|
+
void handlePlatformAuthMigrationRoute(req, res, deps, route.action, url.searchParams).catch(() => {
|
|
23
|
+
deps.logger.error('platform_auth.migration.error', {
|
|
24
|
+
code: 'platform_auth_dependency_failed',
|
|
25
|
+
outcome: 'failed',
|
|
26
|
+
});
|
|
27
|
+
if (!res.headersSent) {
|
|
28
|
+
sendJson(res, 500, {
|
|
29
|
+
ok: false,
|
|
30
|
+
code: 'platform_auth_dependency_failed',
|
|
31
|
+
error: 'platform authentication migration dependency failed',
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
else if (!res.writableEnded) {
|
|
35
|
+
res.end();
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=platform-auth-migration-dispatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-auth-migration-dispatch.js","sourceRoot":"","sources":["../../src/routes/platform-auth-migration-dispatch.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,YAAY,GAGb,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EACL,gCAAgC,GAEjC,MAAM,8BAA8B,CAAC;AAEtC,MAAM,MAAM,GAKR;IACF,uCAAuC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE;IAC/E,qCAAqC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE;IAC5E,0CAA0C,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE;IACtF,oCAAoC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE;IACzE,uCAAuC,EAAE,E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L,CAAC;aAAM,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;YAC9B,GAAG,CAAC,GAAG,EAAE,CAAC;QACZ,CAAC;IACH,CAAC,CACF,CAAC;IACF,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
|
+
import type { DeployAuthGate } from '../auth/deploy-gate.js';
|
|
3
|
+
import { type PlatformAuthOperator } from '../platform-auth-operator.js';
|
|
4
|
+
import type { AuditSink } from '../store/audit.js';
|
|
5
|
+
export type PlatformAuthMigrationRouteAction = 'inventory' | 'preview' | 'start_import' | 'status' | 'reconcile' | 'recover_outbox' | 'activate' | 'rollback' | 'finalize';
|
|
6
|
+
export interface PlatformAuthMigrationRouteDeps {
|
|
7
|
+
readonly gate: DeployAuthGate;
|
|
8
|
+
readonly operator?: PlatformAuthOperator;
|
|
9
|
+
readonly audit: AuditSink;
|
|
10
|
+
readonly maxBody: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function handlePlatformAuthMigrationRoute(req: IncomingMessage, res: ServerResponse, deps: PlatformAuthMigrationRouteDeps, action: PlatformAuthMigrationRouteAction, query?: import("url").URLSearchParams): Promise<void>;
|
|
13
|
+
//# sourceMappingURL=platform-auth-migration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-auth-migration.d.ts","sourceRoot":"","sources":["../../src/routes/platform-auth-migration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,KAAK,EAAwB,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGnF,OAAO,EAML,KAAK,oBAAoB,EAQ1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,MAAM,gCAAgC,GACxC,WAAW,GACX,SAAS,GACT,cAAc,GACd,QAAQ,GACR,WAAW,GACX,gBAAgB,GAChB,UAAU,GACV,UAAU,GACV,UAAU,CAAC;AAEf,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IACzC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAsB,gCAAgC,CACpD,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE,8BAA8B,EACpC,MAAM,EAAE,gCAAgC,EACxC,KAAK,gCAAwB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAkFf"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { readJsonBody, sendForbidden, sendJson, sendUnauthorized } from '../http-util.js';
|
|
3
|
+
import { PlatformAuthMigrationError } from '../platform-auth-migration.js';
|
|
4
|
+
import { PlatformAuthActivateRequestSchema, PlatformAuthFinalizeRequestSchema, PlatformAuthOperationPreviewSchema, PlatformAuthOperationResultSchema, PlatformAuthOperatorError, PlatformAuthOperatorSnapshotSchema, PlatformAuthPreviewRequestSchema, PlatformAuthReconcileRequestSchema, PlatformAuthRecoverOutboxRequestSchema, PlatformAuthRollbackRequestSchema, PlatformAuthStartImportRequestSchema, } from '../platform-auth-operator.js';
|
|
5
|
+
export async function handlePlatformAuthMigrationRoute(req, res, deps, action, query = new URLSearchParams()) {
|
|
6
|
+
const identity = await authorize(req, res, deps, action);
|
|
7
|
+
if (identity === undefined)
|
|
8
|
+
return;
|
|
9
|
+
if (deps.operator === undefined) {
|
|
10
|
+
await emit(deps.audit, action, 409, 'platform_auth_operator_unavailable');
|
|
11
|
+
return sendJson(res, 409, {
|
|
12
|
+
ok: false,
|
|
13
|
+
code: 'platform_auth_operator_unavailable',
|
|
14
|
+
error: 'platform authentication migration operator is unavailable',
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
const actorFingerprint = fingerprint(identity.subject);
|
|
18
|
+
try {
|
|
19
|
+
if (action === 'inventory') {
|
|
20
|
+
const generation = inventoryGeneration(query);
|
|
21
|
+
if (generation === undefined)
|
|
22
|
+
return await invalid(res, deps.audit, action);
|
|
23
|
+
const result = PlatformAuthOperatorSnapshotSchema.parse(await deps.operator.inventory({ actorFingerprint, generation }));
|
|
24
|
+
await emit(deps.audit, action, 200, 'completed', result.rollout.generation);
|
|
25
|
+
return sendJson(res, 200, { ok: true, data: result });
|
|
26
|
+
}
|
|
27
|
+
if (action === 'status') {
|
|
28
|
+
const result = PlatformAuthOperatorSnapshotSchema.parse(await deps.operator.status());
|
|
29
|
+
await emit(deps.audit, action, 200, 'completed', result.rollout.generation);
|
|
30
|
+
return sendJson(res, 200, { ok: true, data: result });
|
|
31
|
+
}
|
|
32
|
+
const body = await readJsonBody(req, deps.maxBody);
|
|
33
|
+
if (!body.ok) {
|
|
34
|
+
await emit(deps.audit, action, body.status, 'invalid_request');
|
|
35
|
+
return sendJson(res, body.status, {
|
|
36
|
+
ok: false,
|
|
37
|
+
code: 'invalid_request',
|
|
38
|
+
error: 'invalid platform authentication migration request',
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (action === 'preview') {
|
|
42
|
+
const parsed = PlatformAuthPreviewRequestSchema.safeParse(body.value);
|
|
43
|
+
if (!parsed.success)
|
|
44
|
+
return await invalid(res, deps.audit, action);
|
|
45
|
+
const result = PlatformAuthOperationPreviewSchema.parse(await deps.operator.preview(parsed.data));
|
|
46
|
+
if (result.operation !== parsed.data.operation) {
|
|
47
|
+
throw new Error('platform authentication operator returned mismatched preview operation');
|
|
48
|
+
}
|
|
49
|
+
await emit(deps.audit, action, 200, result.ready ? 'ready' : 'blocked', result.rollout.generation);
|
|
50
|
+
return sendJson(res, 200, { ok: true, data: result });
|
|
51
|
+
}
|
|
52
|
+
const input = parseMutation(action, body.value, actorFingerprint);
|
|
53
|
+
if (input === undefined)
|
|
54
|
+
return await invalid(res, deps.audit, action);
|
|
55
|
+
const result = PlatformAuthOperationResultSchema.parse(await deps.operator.execute(input));
|
|
56
|
+
if (result.operation !== input.operation) {
|
|
57
|
+
throw new Error('platform authentication operator returned mismatched operation');
|
|
58
|
+
}
|
|
59
|
+
const status = action === 'start_import' && !result.replayed ? 201 : 200;
|
|
60
|
+
await emit(deps.audit, action, status, result.replayed ? 'replayed' : 'completed', result.rollout.generation);
|
|
61
|
+
return sendJson(res, status, { ok: true, data: result });
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
const code = safeErrorCode(error);
|
|
65
|
+
if (code !== undefined && code !== 'platform_auth_dependency_failed') {
|
|
66
|
+
await emit(deps.audit, action, 409, code);
|
|
67
|
+
return sendJson(res, 409, {
|
|
68
|
+
ok: false,
|
|
69
|
+
code,
|
|
70
|
+
error: 'platform authentication migration operation was rejected',
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
await emit(deps.audit, action, 500, 'platform_auth_dependency_failed').catch(() => undefined);
|
|
74
|
+
throw new PlatformAuthOperatorError('platform_auth_dependency_failed');
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
async function authorize(req, res, deps, action) {
|
|
78
|
+
const auth = await deps.gate.authorize(req);
|
|
79
|
+
if (!auth.ok) {
|
|
80
|
+
await emit(deps.audit, action, auth.status, 'authorization_failed');
|
|
81
|
+
if (auth.status === 401)
|
|
82
|
+
sendUnauthorized(res, auth.message);
|
|
83
|
+
else
|
|
84
|
+
sendForbidden(res, auth.message);
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
if (auth.identity === undefined) {
|
|
88
|
+
await emit(deps.audit, action, 401, 'identity_required');
|
|
89
|
+
sendUnauthorized(res, 'identity required');
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
92
|
+
if (!auth.identity.superAdmin) {
|
|
93
|
+
await emit(deps.audit, action, 403, 'super_admin_required');
|
|
94
|
+
sendForbidden(res, 'super-admin required');
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
return auth.identity;
|
|
98
|
+
}
|
|
99
|
+
function parseMutation(action, value, actorFingerprint) {
|
|
100
|
+
const schema = action === 'start_import'
|
|
101
|
+
? PlatformAuthStartImportRequestSchema
|
|
102
|
+
: action === 'reconcile'
|
|
103
|
+
? PlatformAuthReconcileRequestSchema
|
|
104
|
+
: action === 'recover_outbox'
|
|
105
|
+
? PlatformAuthRecoverOutboxRequestSchema
|
|
106
|
+
: action === 'activate'
|
|
107
|
+
? PlatformAuthActivateRequestSchema
|
|
108
|
+
: action === 'rollback'
|
|
109
|
+
? PlatformAuthRollbackRequestSchema
|
|
110
|
+
: PlatformAuthFinalizeRequestSchema;
|
|
111
|
+
const parsed = schema.safeParse(value);
|
|
112
|
+
if (!parsed.success)
|
|
113
|
+
return undefined;
|
|
114
|
+
return { ...parsed.data, operation: action, actorFingerprint };
|
|
115
|
+
}
|
|
116
|
+
async function invalid(res, audit, action) {
|
|
117
|
+
await emit(audit, action, 400, 'invalid_request');
|
|
118
|
+
sendJson(res, 400, {
|
|
119
|
+
ok: false,
|
|
120
|
+
code: 'invalid_request',
|
|
121
|
+
error: 'invalid platform authentication migration request',
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
function safeErrorCode(error) {
|
|
125
|
+
if (error instanceof PlatformAuthOperatorError || error instanceof PlatformAuthMigrationError) {
|
|
126
|
+
return error.code;
|
|
127
|
+
}
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
130
|
+
function emit(audit, action, status, reasonCode, generation) {
|
|
131
|
+
return audit.emit({
|
|
132
|
+
eventType: `platform_auth.migration.${action}`,
|
|
133
|
+
org: 'platform',
|
|
134
|
+
decision: status < 400 ? 'allow' : 'deny',
|
|
135
|
+
status,
|
|
136
|
+
reasonCode,
|
|
137
|
+
details: {
|
|
138
|
+
operation: action,
|
|
139
|
+
outcome: reasonCode,
|
|
140
|
+
...(generation === undefined ? {} : { generation }),
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
function fingerprint(value) {
|
|
145
|
+
return createHash('sha256').update(value).digest('hex');
|
|
146
|
+
}
|
|
147
|
+
function inventoryGeneration(query) {
|
|
148
|
+
if ([...query.keys()].some((key) => key !== 'generation'))
|
|
149
|
+
return undefined;
|
|
150
|
+
const values = query.getAll('generation');
|
|
151
|
+
if (values.length === 0)
|
|
152
|
+
return 0;
|
|
153
|
+
if (values.length !== 1 || !/^(0|[1-9][0-9]*)$/.test(values[0] ?? ''))
|
|
154
|
+
return undefined;
|
|
155
|
+
const generation = Number(values[0]);
|
|
156
|
+
return Number.isSafeInteger(generation) ? generation : undefined;
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=platform-auth-migration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-auth-migration.js","sourceRoot":"","sources":["../../src/routes/platform-auth-migration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC1F,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EACL,iCAAiC,EAEjC,iCAAiC,EACjC,kCAAkC,EAClC,iCAAiC,EAEjC,yBAAyB,EACzB,kCAAkC,EAClC,gCAAgC,EAChC,kCAAkC,EAClC,sCAAsC,EACtC,iCAAiC,EACjC,oCAAoC,GACrC,MAAM,8BAA8B,CAAC;AAqBtC,MAAM,CAAC,KAAK,UAAU,gCAAgC,CACpD,GAAoB,EACpB,GAAmB,EACnB,IAAoC,EACpC,MAAwC,EACxC,KAAK,GAAG,IAAI,eAAe,EAAE;IAE7B,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,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C,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAAE,OAAO,SAAS,CAAC;IACxF,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACrC,OAAO,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;AACnE,CAAC"}
|
|
@@ -17,7 +17,11 @@ export type ServeServiceOptions = ServiceOptions & {
|
|
|
17
17
|
* OR any of these. Does not change the client id reported by `/v1/service/info`.
|
|
18
18
|
*/
|
|
19
19
|
readonly googleAdditionalAudiences?: readonly string[];
|
|
20
|
-
/** Google subjects
|
|
20
|
+
/** Exact immutable Google subjects for CI/build service-account identity tokens. */
|
|
21
|
+
readonly googleWorkloadSubjects?: readonly string[];
|
|
22
|
+
/** Temporary direct-human Google bearer compatibility. Defaults true until the fallback is finalized. */
|
|
23
|
+
readonly googleHumanAuthCompatibility?: boolean;
|
|
24
|
+
/** Canonical principal subjects allowed to manage orgs; email is legacy direct-Google-only compatibility. */
|
|
21
25
|
readonly controlPlaneAdmins?: readonly string[];
|
|
22
26
|
/** Public self-service signup mode. Default preserves internal-alpha restricted admission. */
|
|
23
27
|
readonly controlPlaneSignupMode?: ControlPlaneSignupMode;
|
|
@@ -63,7 +67,7 @@ export type ServeServiceOptions = ServiceOptions & {
|
|
|
63
67
|
/**
|
|
64
68
|
* Enable the self-hosted OAuth authorization server (OA-2,
|
|
65
69
|
* [ADR 0042](../../../docs/decisions/0042-self-hosted-oauth-authorization-server.md)). When set, the AS
|
|
66
|
-
* routes are served (DCR + PKCE, federating login
|
|
70
|
+
* routes are served (DCR + PKCE, federating human login upstream), the issuer is advertised in
|
|
67
71
|
* protected-resource metadata, and owner-only tokens are verified in-process against the signing key.
|
|
68
72
|
* The OAuth state store is the shared Postgres store when persistence is on, else in-memory.
|
|
69
73
|
*/
|
|
@@ -71,7 +75,21 @@ export type ServeServiceOptions = ServiceOptions & {
|
|
|
71
75
|
/** The AS issuer — its public origin (e.g. `https://cloud.noodleseed.dev`). HTTPS, no path/query. */
|
|
72
76
|
readonly issuer: string;
|
|
73
77
|
readonly signer: SigningKeyProvider;
|
|
74
|
-
|
|
78
|
+
/** Direct Google human federation remains optional during fallback and is removed after finalization. */
|
|
79
|
+
readonly google?: GoogleAuthenticator;
|
|
80
|
+
/** Optional complete WorkOS upstream-human configuration. Omit all fields to retain Google/0%. */
|
|
81
|
+
readonly workos?: {
|
|
82
|
+
readonly clientId?: string;
|
|
83
|
+
readonly apiKey?: string;
|
|
84
|
+
readonly realm?: string;
|
|
85
|
+
/** Defaults to GoogleOAuth + MagicAuth. Expand only through a compatibility-set rollout. */
|
|
86
|
+
readonly allowedAuthenticationMethods?: readonly ('GoogleOAuth' | 'MagicAuth' | 'GitHubOAuth' | 'Password' | 'SSO')[];
|
|
87
|
+
};
|
|
88
|
+
/** Stable first-party public client used by the hosted Console's server-side PKCE flow. */
|
|
89
|
+
readonly consoleClient?: {
|
|
90
|
+
readonly clientId: string;
|
|
91
|
+
readonly redirectUri: string;
|
|
92
|
+
};
|
|
75
93
|
/** Restrict authorizing users to this email domain during alpha (e.g. `@noodleseed.com`). */
|
|
76
94
|
readonly allowedEmailDomain?: string;
|
|
77
95
|
/** Benign retry/concurrency window for a rotated refresh token. Default: provider default. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve-options.d.ts","sourceRoot":"","sources":["../src/serve-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC3F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAA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gB,CAAC,EAAE,MAAM,CAAC;IACnC,2FAA2F;IAC3F,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;CACtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../src/serve.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../src/serve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AA8CtD,OAAO,EAAE,KAAK,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAwC9D,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,4FAA4F;IAC5F,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC;IACnC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,iGAAiG;AACjG,wBAAsB,YAAY,CAAC,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,cAAc,CAAC,CA+hB7F"}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { createServer } from 'node:http';
|
|
2
|
-
import { createJwtVerifier } from '@noodle-borg/auth';
|
|
3
2
|
import { SecretBox, staticMasterKeyProvider } from '@noodle-borg/runtime';
|
|
4
3
|
import { noopLogger } from '@noodle-borg/transport-http';
|
|
5
4
|
import { ALERT_EVALUATION_INTERVAL_MS, AlertEvaluator } from './alert-evaluator.js';
|
|
6
5
|
import { createAssetStore, resolveAssetConfig } from './asset-config.js';
|
|
7
|
-
import { CompositeControlPlaneGate, GoogleControlPlaneGate, NoodleOAuthControlPlaneGate, } from './auth/deploy-gate.js';
|
|
8
6
|
import { createPostgresBillingAuthoritativeAdmissionStore, createPostgresBillingCommercialEnforcementProjectionStore, createPostgresBillingEnforcementActivationStore, startConfiguredShadowBillingObservation, } from './billing/integration.js';
|
|
9
7
|
import { activateBillingEnforcementForRelease, assertBillingEnforcementReleaseConfiguration, } from './billing/service-enforcement-release.js';
|
|
10
8
|
import { createServicePostgresBillingMeterRuntime } from './billing/service-meter-runtime.js';
|
|
11
9
|
import { resolveBillingStripeOverageService, resolveBillingStripeService, } from './billing/stripe-integration-loader.js';
|
|
12
10
|
import { parseBillingUsageHmacKey } from './billing/usage-identity.js';
|
|
13
11
|
import { resolveBuildInfo } from './build-info.js';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
12
|
+
import { createDefaultControlPlaneGate } from './control-plane-auth-bootstrap.js';
|
|
13
|
+
import { createHostedCustomerVerifierFactory } from './customer-verifier.js';
|
|
16
14
|
import { GITHUB_RUN_RECONCILE_INTERVAL_MS, GithubDeployRunReconciler, } from './github/deploy-run-reconciler.js';
|
|
17
|
-
import { normalizeOAuthResource } from './http-util.js';
|
|
18
15
|
import { ModuleHost } from './modules/host.js';
|
|
19
16
|
import { loadModules } from './modules/loader.js';
|
|
20
|
-
import {
|
|
17
|
+
import { resolveServiceOAuthBootstrap } from './oauth/service-bootstrap.js';
|
|
21
18
|
import { assertPostgresStoreOwnership } from './persistence-options.js';
|
|
19
|
+
import { resolvePlatformAuthServiceBootstrap, } from './platform-auth-service-bootstrap.js';
|
|
20
|
+
import { startPlatformIdentityMaintenanceWorker } from './platform-identity-maintenance.js';
|
|
21
|
+
import { PostgresPlatformIdentityStore } from './platform-identity-postgres.js';
|
|
22
22
|
import { InMemoryPolicyAssignmentStore } from './policy.js';
|
|
23
23
|
import { ServerRegistry } from './registry.js';
|
|
24
|
-
import {
|
|
24
|
+
import { isLoopbackHost, openCustomerCredential, sealCustomerCredential, } from './serve-resource-auth.js';
|
|
25
25
|
import { createServiceHandler } from './service.js';
|
|
26
26
|
import { resolveServiceConfigSource } from './service-config.js';
|
|
27
27
|
import { closeHttpServer, closeServiceResources, listenHttpServer, } from './service-resource-cleanup.js';
|
|
@@ -109,6 +109,8 @@ export async function serveService(options = {}) {
|
|
|
109
109
|
let githubDeployRunStore = options.githubDeployRunStore;
|
|
110
110
|
let pendingGithubInstallationStore = options.pendingGithubInstallationStore;
|
|
111
111
|
let pgPool;
|
|
112
|
+
let platformIdentityStore = options.platformIdentityStore;
|
|
113
|
+
let platformAuth = options.platformAuthOperator === undefined ? {} : { operator: options.platformAuthOperator };
|
|
112
114
|
let billingMeterRuntime;
|
|
113
115
|
let createBillingMeterRuntime;
|
|
114
116
|
if (options.databaseUrl !== undefined || options.cloudSql !== undefined) {
|
|
@@ -120,6 +122,10 @@ export async function serveService(options = {}) {
|
|
|
120
122
|
...(options.databaseUrl !== undefined ? { databaseUrl: options.databaseUrl } : {}),
|
|
121
123
|
...(options.cloudSql !== undefined ? { cloudSql: options.cloudSql } : {}),
|
|
122
124
|
});
|
|
125
|
+
platformIdentityStore = platformIdentityStore ?? new PostgresPlatformIdentityStore(pgPool.pool);
|
|
126
|
+
if (platformIdentityStore instanceof PostgresPlatformIdentityStore) {
|
|
127
|
+
await platformIdentityStore.ensureSchema();
|
|
128
|
+
}
|
|
123
129
|
const postgres = new PostgresArtifactStore(pgPool.pool, secretBox);
|
|
124
130
|
await postgres.ensureSchema();
|
|
125
131
|
if (postgresBillingUsageHmacKey === undefined) {
|
|
@@ -156,6 +162,17 @@ export async function serveService(options = {}) {
|
|
|
156
162
|
githubDeployRunStore =
|
|
157
163
|
githubDeployRunStore ?? new JsonFileGithubDeployRunStore(options.dataDir);
|
|
158
164
|
}
|
|
165
|
+
platformAuth = await resolvePlatformAuthServiceBootstrap({
|
|
166
|
+
...(pgPool === undefined ? {} : { pool: pgPool.pool }),
|
|
167
|
+
releaseSha: buildInfo.gitSha,
|
|
168
|
+
workos: options.oauth?.workos,
|
|
169
|
+
workloadSubjects: options.googleWorkloadSubjects,
|
|
170
|
+
googleHumanAuthAvailable: options.oauth?.google !== undefined,
|
|
171
|
+
durablePlatformIdentityAvailable: platformIdentityStore instanceof PostgresPlatformIdentityStore,
|
|
172
|
+
...(options.platformAuthOperator === undefined
|
|
173
|
+
? {}
|
|
174
|
+
: { configuredOperator: options.platformAuthOperator }),
|
|
175
|
+
});
|
|
159
176
|
controlPlaneStore = controlPlaneStore ?? new InMemoryControlPlaneStore();
|
|
160
177
|
billingStripeService = await resolveBillingStripeService({
|
|
161
178
|
configured: billingStripeService,
|
|
@@ -292,152 +309,36 @@ export async function serveService(options = {}) {
|
|
|
292
309
|
for (const subject of options.signupAllowedSubjects ?? []) {
|
|
293
310
|
await controlPlaneStore.allowSignup({ kind: 'subject', value: subject });
|
|
294
311
|
}
|
|
295
|
-
// Self-hosted authorization server (OA-2): build the AS Express app + its state store (the shared Postgres
|
|
296
|
-
// store when persistence is on, else in-memory). Express + the SDK auth handlers load lazily, only here, so
|
|
297
|
-
// an AS-less deployment never pulls them in. Owner-only token verification is wired to the same signing key
|
|
298
|
-
// in-process (no JWKS round-trip), which is correct because every instance shares the static key via env.
|
|
299
|
-
let authServerApp;
|
|
300
|
-
let resolvedVerifyOwnerToken = options.verifyOwnerToken;
|
|
301
|
-
let resolvedAuthServerIssuer = options.authServerIssuer;
|
|
302
312
|
let registry;
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
...(
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
...(options.customerVerifierFirebaseJwksUri !== undefined
|
|
313
|
-
? { firebaseJwksUri: options.customerVerifierFirebaseJwksUri }
|
|
314
|
-
: {}),
|
|
313
|
+
// Self-hosted authorization server (OA-2) and upstream-human boot are isolated from the service graph.
|
|
314
|
+
const oauthBootstrap = await resolveServiceOAuthBootstrap({
|
|
315
|
+
options,
|
|
316
|
+
...(pgPool === undefined ? {} : { pool: pgPool.pool }),
|
|
317
|
+
...(secretBox === undefined ? {} : { secretBox }),
|
|
318
|
+
controlPlaneStore,
|
|
319
|
+
...(platformIdentityStore === undefined ? {} : { platformIdentityStore }),
|
|
320
|
+
platformAuth,
|
|
321
|
+
registry: () => registry,
|
|
315
322
|
});
|
|
316
|
-
|
|
317
|
-
if (pgPool) {
|
|
318
|
-
const { PostgresOAuthStore } = await import('./oauth/store-postgres.js');
|
|
319
|
-
const postgresOAuth = new PostgresOAuthStore(pgPool.pool);
|
|
320
|
-
await postgresOAuth.ensureSchema();
|
|
321
|
-
oauthStore = postgresOAuth;
|
|
322
|
-
}
|
|
323
|
-
else {
|
|
324
|
-
const { InMemoryOAuthStore } = await import('./oauth/store.js');
|
|
325
|
-
oauthStore = new InMemoryOAuthStore();
|
|
326
|
-
}
|
|
327
|
-
developerGrantStore = await resolveDeveloperGrantStore({
|
|
328
|
-
...(pgPool === undefined ? {} : { pool: pgPool.pool }),
|
|
329
|
-
...(developerGrantStore === undefined ? {} : { store: developerGrantStore }),
|
|
330
|
-
});
|
|
331
|
-
const [{ NoodleOAuthProvider }, { createOAuthApp }] = await Promise.all([
|
|
332
|
-
import('./oauth/provider.js'),
|
|
333
|
-
import('./oauth/app.js'),
|
|
334
|
-
]);
|
|
335
|
-
// Normalize once so the token `iss`, the verifier's expected issuer, and the PRM `authorization_servers`
|
|
336
|
-
// entry are byte-identical (a trailing-slash `PUBLIC_BASE_URL` would otherwise desync them).
|
|
337
|
-
const oauthIssuer = options.oauth.issuer.replace(/\/+$/, '');
|
|
338
|
-
// The same issuer/signer pair backs delegated token-exchange assertions (ADR 0152) so customer
|
|
339
|
-
// token endpoints verify them against the already-published platform JWKS.
|
|
340
|
-
delegatedExchange = { issuer: oauthIssuer, signer: options.oauth.signer };
|
|
341
|
-
const provider = new NoodleOAuthProvider({
|
|
342
|
-
issuer: oauthIssuer,
|
|
343
|
-
store: oauthStore,
|
|
344
|
-
signer: options.oauth.signer,
|
|
345
|
-
google: options.oauth.google,
|
|
346
|
-
customerBridgeAuthForResource: async (resource) => registry !== undefined
|
|
347
|
-
? bridgeAuthForResource(registry, resource, allowedMcpDomains)
|
|
348
|
-
: undefined,
|
|
349
|
-
managedSecretForResource: async (resource, name) => registry !== undefined
|
|
350
|
-
? managedSecretForResource(registry, resource, name, allowedMcpDomains)
|
|
351
|
-
: undefined,
|
|
352
|
-
verifyCustomerBridgeToken: async (auth, token) => {
|
|
353
|
-
const identity = await rawCustomerVerifierFactory(auth)(token, auth.projectId ?? '');
|
|
354
|
-
return identity === null ? null : { ...identity, scopes: identity.scopes ?? [] };
|
|
355
|
-
},
|
|
356
|
-
sealCustomerCredential: (credential) => sealCustomerCredential(secretBox, credential),
|
|
357
|
-
signupAuthorizer: controlPlaneStore,
|
|
358
|
-
developerGrantAuthorizer: createDeveloperGrantAuthorizer({
|
|
359
|
-
controlPlane: controlPlaneStore,
|
|
360
|
-
grants: developerGrantStore,
|
|
361
|
-
registry: () => registry,
|
|
362
|
-
}),
|
|
363
|
-
logger: options.logger ?? noopLogger,
|
|
364
|
-
defaultResourceForClient: (client) => geminiEnterpriseDefaultResourceForClient(client, oauthIssuer),
|
|
365
|
-
...(options.oauth.allowedEmailDomain !== undefined
|
|
366
|
-
? { allowedEmailDomain: options.oauth.allowedEmailDomain }
|
|
367
|
-
: {}),
|
|
368
|
-
...(options.oauth.refreshTokenGraceSeconds !== undefined
|
|
369
|
-
? { refreshTokenGraceSeconds: options.oauth.refreshTokenGraceSeconds }
|
|
370
|
-
: {}),
|
|
371
|
-
...(options.oauth.refreshTokenRecoverySeconds !== undefined
|
|
372
|
-
? { refreshTokenRecoverySeconds: options.oauth.refreshTokenRecoverySeconds }
|
|
373
|
-
: {}),
|
|
374
|
-
});
|
|
375
|
-
authServerApp = createOAuthApp(provider, {
|
|
376
|
-
trustProxy: options.tls?.trustProxy === true,
|
|
377
|
-
});
|
|
378
|
-
resolvedAuthServerIssuer = resolvedAuthServerIssuer ?? oauthIssuer;
|
|
379
|
-
// Resource-server verification uses the AS signing key directly (co-hosted, same process), so an
|
|
380
|
-
// owner-only endpoint validates tokens without an HTTP JWKS fetch. Multi-instance-safe because the key is
|
|
381
|
-
// shared via env.
|
|
382
|
-
resolvedVerifyOwnerToken =
|
|
383
|
-
resolvedVerifyOwnerToken ??
|
|
384
|
-
createJwtVerifier({
|
|
385
|
-
issuer: oauthIssuer,
|
|
386
|
-
keyResolver: await options.oauth.signer.verifierKey(),
|
|
387
|
-
});
|
|
388
|
-
}
|
|
323
|
+
const { authServerApp, verifyOwnerToken: resolvedVerifyOwnerToken, authServerIssuer: resolvedAuthServerIssuer, oauthStore, developerGrantStore, delegatedExchange, rawCustomerVerifierFactory, } = oauthBootstrap;
|
|
389
324
|
if (gate === undefined) {
|
|
390
|
-
//
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
`${resolvedAuthServerIssuer}/developer/cli`,
|
|
403
|
-
],
|
|
404
|
-
admins: options.controlPlaneAdmins ?? [],
|
|
405
|
-
signupMode: options.controlPlaneSignupMode ?? 'restricted',
|
|
406
|
-
signupAuthorizer: controlPlaneStore,
|
|
407
|
-
deniedSignupDomains: options.deniedSignupDomains ?? [],
|
|
408
|
-
deniedSignupSubjects: options.deniedSignupSubjects ?? [],
|
|
409
|
-
...(allowedEmailDomain !== undefined ? { allowedEmailDomain } : {}),
|
|
410
|
-
}));
|
|
411
|
-
}
|
|
412
|
-
if (options.googleClientId !== undefined) {
|
|
413
|
-
gates.push(new GoogleControlPlaneGate({
|
|
414
|
-
// Single audience stays a plain string (unchanged); only a configured additional-audience list
|
|
415
|
-
// widens it to an array. Keeps the CLI/gcloud single-client path byte-for-byte identical.
|
|
416
|
-
audience: options.googleAdditionalAudiences && options.googleAdditionalAudiences.length > 0
|
|
417
|
-
? [options.googleClientId, ...options.googleAdditionalAudiences]
|
|
418
|
-
: options.googleClientId,
|
|
419
|
-
admins: options.controlPlaneAdmins ?? [],
|
|
420
|
-
signupMode: options.controlPlaneSignupMode ?? 'restricted',
|
|
421
|
-
signupAuthorizer: controlPlaneStore,
|
|
422
|
-
deniedSignupDomains: options.deniedSignupDomains ?? [],
|
|
423
|
-
deniedSignupSubjects: options.deniedSignupSubjects ?? [],
|
|
424
|
-
...(options.controlPlaneAllowedEmailDomain !== undefined
|
|
425
|
-
? { allowedEmailDomain: options.controlPlaneAllowedEmailDomain }
|
|
426
|
-
: {}),
|
|
427
|
-
...(options.googleVerifier ? { verifier: options.googleVerifier } : {}),
|
|
428
|
-
}));
|
|
429
|
-
}
|
|
430
|
-
gate =
|
|
431
|
-
gates.length === 0
|
|
432
|
-
? gate
|
|
433
|
-
: gates.length === 1
|
|
434
|
-
? gates[0]
|
|
435
|
-
: new CompositeControlPlaneGate(gates);
|
|
325
|
+
// Noodle tokens lead temporary human-Google compatibility and the exact-subject workload gate.
|
|
326
|
+
gate = createDefaultControlPlaneGate({
|
|
327
|
+
options,
|
|
328
|
+
controlPlaneStore,
|
|
329
|
+
...(resolvedVerifyOwnerToken === undefined
|
|
330
|
+
? {}
|
|
331
|
+
: { verifyOwnerToken: resolvedVerifyOwnerToken }),
|
|
332
|
+
...(resolvedAuthServerIssuer === undefined
|
|
333
|
+
? {}
|
|
334
|
+
: { authServerIssuer: resolvedAuthServerIssuer }),
|
|
335
|
+
...(platformIdentityStore === undefined ? {} : { platformIdentityStore }),
|
|
336
|
+
});
|
|
436
337
|
}
|
|
437
338
|
// Fail closed: never expose an unauthenticated deploy endpoint on a non-loopback bind.
|
|
438
339
|
if (gate === undefined && !isLoopbackHost(host)) {
|
|
439
340
|
throw new Error(`refusing to bind a non-loopback host (${host}) without deploy authentication; ` +
|
|
440
|
-
'
|
|
341
|
+
'configure the Noodle OAuth issuer and an upstream-human provider, NOODLE_GOOGLE_CLIENT_ID, or a deployGate');
|
|
441
342
|
}
|
|
442
343
|
// `local` is a system-owned loopback namespace even when loopback auth is enabled.
|
|
443
344
|
if (isLoopbackHost(host)) {
|
|
@@ -470,6 +371,7 @@ export async function serveService(options = {}) {
|
|
|
470
371
|
? async () => {
|
|
471
372
|
try {
|
|
472
373
|
await pgPool.pool.query('SELECT 1');
|
|
374
|
+
await platformAuth.assertContinuity?.();
|
|
473
375
|
return true;
|
|
474
376
|
}
|
|
475
377
|
catch {
|
|
@@ -479,6 +381,7 @@ export async function serveService(options = {}) {
|
|
|
479
381
|
: async () => true;
|
|
480
382
|
let billingStripeReconcileTimer;
|
|
481
383
|
let billingStripeOverageSettlementTimer;
|
|
384
|
+
let platformIdentityMaintenanceTimer;
|
|
482
385
|
const closeResources = () => closeServiceResources({
|
|
483
386
|
...(retentionTimer === undefined ? {} : { retentionTimer }),
|
|
484
387
|
...(githubRunReconcileTimer === undefined ? {} : { githubRunReconcileTimer }),
|
|
@@ -487,6 +390,9 @@ export async function serveService(options = {}) {
|
|
|
487
390
|
? {}
|
|
488
391
|
: { billingStripeOverageSettlementTimer }),
|
|
489
392
|
...(welcomeEmailTimer === undefined ? {} : { welcomeEmailTimer }),
|
|
393
|
+
...(platformIdentityMaintenanceTimer === undefined
|
|
394
|
+
? {}
|
|
395
|
+
: { platformIdentityMaintenanceTimer }),
|
|
490
396
|
alertTimer,
|
|
491
397
|
requestEventBuffer,
|
|
492
398
|
...(billingMeterRuntime === undefined ? {} : { billingMeterRuntime }),
|
|
@@ -555,6 +461,7 @@ export async function serveService(options = {}) {
|
|
|
555
461
|
requestEventStore,
|
|
556
462
|
alertRuleStore,
|
|
557
463
|
...(assistantStore !== undefined ? { assistantStore } : {}),
|
|
464
|
+
...(platformAuth.operator === undefined ? {} : { platformAuthOperator: platformAuth.operator }),
|
|
558
465
|
captureRequestEvent: options.captureRequestEvent ?? ((event) => requestEventBuffer.capture(event)),
|
|
559
466
|
...(githubConnectionStore !== undefined ? { githubConnectionStore } : {}),
|
|
560
467
|
...(githubDeployRunStore !== undefined ? { githubDeployRunStore } : {}),
|
|
@@ -575,6 +482,14 @@ export async function serveService(options = {}) {
|
|
|
575
482
|
http = createServer(createServiceHandler(registry, handlerOptions));
|
|
576
483
|
await listenHttpServer(http, options.port ?? 8787, host);
|
|
577
484
|
billingMeterRuntime?.start();
|
|
485
|
+
if (platformAuth.runtime !== undefined) {
|
|
486
|
+
platformIdentityMaintenanceTimer = startPlatformIdentityMaintenanceWorker({
|
|
487
|
+
sync: platformAuth.runtime.outboxProcessor,
|
|
488
|
+
events: platformAuth.runtime.eventsProcessor,
|
|
489
|
+
readiness: platformAuth.runtime.operator,
|
|
490
|
+
logger: options.logger ?? noopLogger,
|
|
491
|
+
});
|
|
492
|
+
}
|
|
578
493
|
}
|
|
579
494
|
catch (error) {
|
|
580
495
|
if (http?.listening)
|