@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
|
@@ -5,82 +5,77 @@ import type { OAuthClientInformationFull, OAuthTokenRevocationRequest, OAuthToke
|
|
|
5
5
|
import { type SigningKeyProvider, type VerifiedIdentity } from '@noodle-borg/auth';
|
|
6
6
|
import { type Logger } from '@noodle-borg/transport-http';
|
|
7
7
|
import type { Request, Response } from 'express';
|
|
8
|
-
import type { SignupAuthorizer } from '../auth/deploy-gate.js';
|
|
8
|
+
import type { ControlPlaneSignupMode, SignupAuthorizer } from '../auth/deploy-gate.js';
|
|
9
|
+
import type { PlatformPrincipalResolver } from '../platform-identity.js';
|
|
9
10
|
import type { SecretEnvelope, TenantBridgeAuthConfig } from '../store.js';
|
|
10
11
|
import type { DeveloperGrantAuthorizer } from './developer-grant-authorizer.js';
|
|
11
12
|
import { DeviceAuthorizationFlow } from './device-flow.js';
|
|
12
13
|
import type { DeviceAuthorizationRecord, DeviceBrowserSessionRecord } from './device-store.js';
|
|
13
14
|
import type { GoogleAuthenticator } from './google.js';
|
|
14
15
|
import type { OAuthStore } from './store.js';
|
|
16
|
+
import { handleUpstreamHumanCallback } from './upstream-callback-handler.js';
|
|
17
|
+
import type { UpstreamHumanOAuthAuthenticator, UpstreamHumanRollout } from './upstream-human.js';
|
|
18
|
+
import type { UpstreamHumanRolloutStore } from './upstream-rollout-store.js';
|
|
15
19
|
export interface NoodleOAuthProviderConfig {
|
|
16
|
-
/** The authorization server issuer (its public origin, e.g. `https://cloud.noodleseed.dev`). */
|
|
17
20
|
readonly issuer: string;
|
|
18
21
|
readonly store: OAuthStore;
|
|
19
22
|
readonly signer: SigningKeyProvider;
|
|
20
|
-
readonly google
|
|
21
|
-
|
|
23
|
+
readonly google?: GoogleAuthenticator;
|
|
24
|
+
readonly upstreamAuthenticators?: Readonly<{
|
|
25
|
+
readonly workos?: UpstreamHumanOAuthAuthenticator;
|
|
26
|
+
}>;
|
|
27
|
+
readonly upstreamRollout?: UpstreamHumanRollout;
|
|
28
|
+
readonly upstreamRolloutStore?: UpstreamHumanRolloutStore;
|
|
29
|
+
readonly platformPrincipalResolver?: PlatformPrincipalResolver;
|
|
22
30
|
readonly allowedEmailDomain?: string;
|
|
31
|
+
readonly signupMode?: ControlPlaneSignupMode;
|
|
23
32
|
readonly signupAuthorizer?: SignupAuthorizer;
|
|
33
|
+
readonly deniedSignupDomains?: readonly string[];
|
|
34
|
+
readonly deniedSignupSubjects?: readonly string[];
|
|
35
|
+
/** Idempotently establishes platform-owned account state before any Noodle credential is issued. */
|
|
36
|
+
readonly provisionPlatformPrincipal?: NoodlePlatformPrincipalProvisioner;
|
|
24
37
|
readonly developerGrantAuthorizer?: DeveloperGrantAuthorizer;
|
|
25
|
-
/** Compatibility hook for OAuth clients that cannot send RFC 8707 `resource` during authorization. */
|
|
26
38
|
readonly defaultResourceForClient?: (client: OAuthClientInformationFull) => string | undefined;
|
|
27
|
-
/** Resolve bridge auth for a resource-bound tenant MCP URL, when the deployment uses Noodle-managed bridge auth. */
|
|
28
39
|
readonly customerBridgeAuthForResource?: (resource: string) => Promise<TenantBridgeAuthConfig | undefined>;
|
|
29
|
-
/** Verify the upstream customer credential returned by the tenant app before Noodle issues an MCP token. */
|
|
30
40
|
readonly verifyCustomerBridgeToken?: (auth: TenantBridgeAuthConfig, token: string) => Promise<VerifiedIdentity | null>;
|
|
31
41
|
readonly managedSecretForResource?: (resource: string, name: string) => Promise<string | undefined>;
|
|
32
42
|
readonly sealCustomerCredential?: (credential: string) => Promise<SecretEnvelope>;
|
|
33
43
|
readonly fetchImpl?: typeof fetch;
|
|
34
44
|
readonly accessTokenTtlSeconds?: number;
|
|
35
45
|
readonly refreshTokenTtlSeconds?: number;
|
|
36
|
-
/** Benign retry/concurrency window after refresh-token rotation. Default 30 seconds. */
|
|
37
46
|
readonly refreshTokenGraceSeconds?: number;
|
|
38
|
-
/** Recovery window for stale refresh tokens when the successor was never used. */
|
|
39
47
|
readonly refreshTokenRecoverySeconds?: number;
|
|
40
48
|
readonly authCodeTtlSeconds?: number;
|
|
41
49
|
readonly pendingTtlSeconds?: number;
|
|
42
50
|
readonly consentTtlSeconds?: number;
|
|
43
51
|
readonly logger?: Logger;
|
|
44
|
-
/** Clock injection (epoch ms), for deterministic time in tests. Defaults to `Date.now`. */
|
|
45
52
|
readonly now?: () => number;
|
|
46
53
|
}
|
|
47
|
-
/** Self-hosted OAuth authorization server provider (OA-2, ADR 0042). */
|
|
48
54
|
export declare class NoodleOAuthProvider implements OAuthServerProvider {
|
|
49
55
|
#private;
|
|
50
56
|
constructor(config: NoodleOAuthProviderConfig);
|
|
51
57
|
get clientsStore(): OAuthRegisteredClientsStore;
|
|
52
58
|
get deviceAuthorizationFlow(): DeviceAuthorizationFlow;
|
|
53
|
-
/** Begin authorization: persist the pending request and redirect the user to "Sign in with Google". */
|
|
54
59
|
authorize(client: OAuthClientInformationFull, params: AuthorizationParams, res: Response): Promise<void>;
|
|
55
|
-
/** Return the stored PKCE challenge for a code (non-destructive — the SDK validates the verifier against it). */
|
|
56
60
|
challengeForAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string): Promise<string>;
|
|
57
|
-
/** Redeem an authorization code (single-use) and mint the owner's tokens. PKCE was validated by the SDK. */
|
|
58
61
|
exchangeAuthorizationCode(client: OAuthClientInformationFull, authorizationCode: string, _codeVerifier?: string, redirectUri?: string, resource?: URL): Promise<OAuthTokens>;
|
|
59
|
-
/** Complete the server-owned authorization-code bridge used by the RFC 8628 verification page. */
|
|
60
62
|
completeDeviceAuthorization(session: DeviceBrowserSessionRecord, authorizationCode: string): Promise<boolean>;
|
|
61
|
-
/** Mint normal access/refresh tokens after the device authorization has been approved and consumed. */
|
|
62
63
|
issueDeviceTokens(record: DeviceAuthorizationRecord): Promise<OAuthTokens>;
|
|
63
|
-
/** Rotate a refresh token with grace/recovery handling for concurrent or retried refreshes. */
|
|
64
64
|
exchangeRefreshToken(client: OAuthClientInformationFull, refreshToken: string, _scopes?: string[], resource?: URL): Promise<OAuthTokens>;
|
|
65
|
-
/** Verify an access token (issuer/signature/expiry). Provided for interface completeness — the data-plane
|
|
66
|
-
* resource server verifies with its own audience-bound verifier; this is not on the AS request path. */
|
|
67
65
|
verifyAccessToken(token: string): Promise<AuthInfo>;
|
|
68
|
-
/** RFC 7009 revocation also invalidates the exact developer grant bound to this client token. */
|
|
69
66
|
revokeToken(client: OAuthClientInformationFull, request: OAuthTokenRevocationRequest): Promise<void>;
|
|
70
|
-
/** RFC 8414 authorization-server metadata (plus our `jwks_uri`), served at `/.well-known/oauth-authorization-server`. */
|
|
71
67
|
metadata(): Record<string, unknown>;
|
|
72
|
-
/** The public JWKS the resource server (and external validators) read to verify access tokens. */
|
|
73
68
|
jwks(): Promise<{
|
|
74
69
|
keys: unknown[];
|
|
75
70
|
}>;
|
|
76
|
-
/** Google callback: consume the pending auth, verify the Google identity, and render the consent page. */
|
|
77
71
|
handleGoogleCallback(req: Request, res: Response): Promise<void>;
|
|
78
|
-
|
|
72
|
+
handleWorkOSCallback(req: Request, res: Response): Promise<void>;
|
|
73
|
+
handleUpstreamProviderChoice(req: Request, res: Response): Promise<void>;
|
|
79
74
|
handleConsent(req: Request, res: Response): Promise<void>;
|
|
80
75
|
handleDeveloperGrant(req: Request, res: Response): Promise<void>;
|
|
81
|
-
/** Customer bridge callback: verify the tenant app's customer token and issue a normal OAuth code. */
|
|
82
76
|
handleFirebaseCustomerAuthorize(req: Request, res: Response): Promise<void>;
|
|
83
77
|
handleFirebaseCustomerCallback(req: Request, res: Response): Promise<void>;
|
|
84
78
|
handleMicrosoftCustomerCallback(req: Request, res: Response): Promise<void>;
|
|
85
79
|
}
|
|
80
|
+
export type NoodlePlatformPrincipalProvisioner = NonNullable<Parameters<typeof handleUpstreamHumanCallback>[0]['provisionPlatformPrincipal']>;
|
|
86
81
|
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/oauth/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAC;AAMpG,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,mDAAmD,CAAC;
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/oauth/provider.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { InvalidGrantError, InvalidRequestError, InvalidTokenError, } from '@modelcontextprotocol/sdk/server/auth/errors.js';
|
|
2
|
-
import { createOAuthMetadata } from '@modelcontextprotocol/sdk/server/auth/router.js';
|
|
3
2
|
import { createJwtVerifier, } from '@noodle-borg/auth';
|
|
4
3
|
import { noopLogger } from '@noodle-borg/transport-http';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { DeveloperGrantOAuthFlow, isDeveloperResourceForIssuer } from './developer-grant-flow.js';
|
|
4
|
+
import { initiateAuthorization } from './authorization-initiation.js';
|
|
5
|
+
import { signConsentToken, verifyConsentToken } from './consent-token.js';
|
|
6
|
+
import { customerBridgeAuthorizeFields, customerBridgeCallbackFields, microsoftCallbackUrl, renderFirebaseAuthorizePage, } from './customer-bridge.js';
|
|
7
|
+
import { DeveloperGrantOAuthFlow } from './developer-grant-flow.js';
|
|
10
8
|
import { DeviceAuthorizationFlow } from './device-flow.js';
|
|
11
9
|
import { completeDeviceAuthorization, issueDeviceTokens } from './device-provider.js';
|
|
12
10
|
import { storedOAuthOwnerPreferences, verifiedIdentityOwnerPreferences, } from './identity-preferences.js';
|
|
11
|
+
import { noodleOAuthMetadata } from './metadata.js';
|
|
13
12
|
import { exchangeMicrosoftAuthorizationCode, isConfiguredMicrosoftBridge, verifyMicrosoftIdToken, } from './microsoft.js';
|
|
14
|
-
import {
|
|
13
|
+
import { assertPlatformRefreshPrincipal } from './platform-principal-guard.js';
|
|
14
|
+
import { defaultResourceFromClient, normalizeResource, resourcePath, trimTrailingSlash, } from './provider-util.js';
|
|
15
15
|
import { mintOAuthAccessToken, OAuthTokenIssuer } from './token-issuer.js';
|
|
16
16
|
import { hashToken, randomToken } from './tokens.js';
|
|
17
|
+
import { handleUpstreamHumanCallback } from './upstream-callback-handler.js';
|
|
18
|
+
import { redirectPendingAuthorizationError } from './upstream-callback-support.js';
|
|
19
|
+
import { continueUpstreamProviderChoice } from './upstream-provider-choice.js';
|
|
17
20
|
const ONE_HOUR = 3600;
|
|
18
21
|
const THIRTY_DAYS = 30 * 24 * 3600;
|
|
19
22
|
const TEN_MINUTES = 600;
|
|
20
23
|
const FIVE_MINUTES = 300;
|
|
21
24
|
const REFRESH_GRACE = 30;
|
|
22
25
|
const REFRESH_RECOVERY = 300;
|
|
23
|
-
const CONSENT_PATH = '/oauth/consent';
|
|
24
26
|
const DEVICE_GRANT = 'urn:ietf:params:oauth:grant-type:device_code';
|
|
25
|
-
/** Self-hosted OAuth authorization server provider (OA-2, ADR 0042). */
|
|
26
27
|
export class NoodleOAuthProvider {
|
|
27
28
|
#config;
|
|
28
29
|
#accessTtl;
|
|
@@ -85,42 +86,32 @@ export class NoodleOAuthProvider {
|
|
|
85
86
|
get deviceAuthorizationFlow() {
|
|
86
87
|
return this.#deviceFlow;
|
|
87
88
|
}
|
|
88
|
-
/** Begin authorization: persist the pending request and redirect the user to "Sign in with Google". */
|
|
89
89
|
async authorize(client, params, res) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
...(
|
|
107
|
-
|
|
90
|
+
await initiateAuthorization({
|
|
91
|
+
client,
|
|
92
|
+
params,
|
|
93
|
+
res,
|
|
94
|
+
issuer: this.#config.issuer,
|
|
95
|
+
store: this.#config.store,
|
|
96
|
+
...(this.#config.google === undefined ? {} : { google: this.#config.google }),
|
|
97
|
+
...(this.#config.upstreamAuthenticators?.workos === undefined
|
|
98
|
+
? {}
|
|
99
|
+
: { workos: this.#config.upstreamAuthenticators.workos }),
|
|
100
|
+
...(this.#config.upstreamRollout === undefined
|
|
101
|
+
? {}
|
|
102
|
+
: { rollout: this.#config.upstreamRollout }),
|
|
103
|
+
...(this.#config.upstreamRolloutStore === undefined
|
|
104
|
+
? {}
|
|
105
|
+
: { rolloutStore: this.#config.upstreamRolloutStore }),
|
|
106
|
+
...(this.#config.customerBridgeAuthForResource === undefined
|
|
107
|
+
? {}
|
|
108
|
+
: { customerBridgeAuthForResource: this.#config.customerBridgeAuthForResource }),
|
|
109
|
+
...(this.#config.defaultResourceForClient === undefined
|
|
110
|
+
? {}
|
|
111
|
+
: { defaultResourceForClient: this.#config.defaultResourceForClient }),
|
|
112
|
+
pendingTtlSeconds: this.#pendingTtl,
|
|
113
|
+
nowSeconds: this.#nowSeconds(),
|
|
108
114
|
});
|
|
109
|
-
const bridgeAuth = await this.#config.customerBridgeAuthForResource?.(resource);
|
|
110
|
-
if (bridgeAuth !== undefined) {
|
|
111
|
-
const authorizeUrl = bridgeAuthorizeUrl(bridgeAuth, {
|
|
112
|
-
issuer: this.#config.issuer,
|
|
113
|
-
state: nonce,
|
|
114
|
-
resource,
|
|
115
|
-
clientId: client.client_id,
|
|
116
|
-
});
|
|
117
|
-
if (authorizeUrl === undefined) {
|
|
118
|
-
throw new InvalidRequestError('customer bridge authorization is not configured');
|
|
119
|
-
}
|
|
120
|
-
res.redirect(302, authorizeUrl);
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
res.redirect(302, this.#config.google.authorizationUrl(nonce));
|
|
124
115
|
}
|
|
125
116
|
#withDefaultResource(client) {
|
|
126
117
|
const defaultResource = this.#config.defaultResourceForClient?.(client);
|
|
@@ -128,7 +119,6 @@ export class NoodleOAuthProvider {
|
|
|
128
119
|
return client;
|
|
129
120
|
return { ...client, default_resource: defaultResource };
|
|
130
121
|
}
|
|
131
|
-
/** Return the stored PKCE challenge for a code (non-destructive — the SDK validates the verifier against it). */
|
|
132
122
|
async challengeForAuthorizationCode(client, authorizationCode) {
|
|
133
123
|
const record = await this.#config.store.getAuthorizationCode(hashToken(authorizationCode));
|
|
134
124
|
if (!record || record.clientId !== client.client_id) {
|
|
@@ -136,7 +126,6 @@ export class NoodleOAuthProvider {
|
|
|
136
126
|
}
|
|
137
127
|
return record.codeChallenge;
|
|
138
128
|
}
|
|
139
|
-
/** Redeem an authorization code (single-use) and mint the owner's tokens. PKCE was validated by the SDK. */
|
|
140
129
|
async exchangeAuthorizationCode(client, authorizationCode, _codeVerifier, redirectUri, resource) {
|
|
141
130
|
const resolvedResource = resource?.href ??
|
|
142
131
|
defaultResourceFromClient(client) ??
|
|
@@ -173,7 +162,6 @@ export class NoodleOAuthProvider {
|
|
|
173
162
|
: {}),
|
|
174
163
|
});
|
|
175
164
|
}
|
|
176
|
-
/** Complete the server-owned authorization-code bridge used by the RFC 8628 verification page. */
|
|
177
165
|
async completeDeviceAuthorization(session, authorizationCode) {
|
|
178
166
|
return completeDeviceAuthorization({
|
|
179
167
|
store: this.#config.store,
|
|
@@ -182,11 +170,9 @@ export class NoodleOAuthProvider {
|
|
|
182
170
|
authorizationCode,
|
|
183
171
|
});
|
|
184
172
|
}
|
|
185
|
-
/** Mint normal access/refresh tokens after the device authorization has been approved and consumed. */
|
|
186
173
|
issueDeviceTokens(record) {
|
|
187
174
|
return issueDeviceTokens({ tokenIssuer: this.#tokenIssuer, record });
|
|
188
175
|
}
|
|
189
|
-
/** Rotate a refresh token with grace/recovery handling for concurrent or retried refreshes. */
|
|
190
176
|
async exchangeRefreshToken(client, refreshToken, _scopes, resource) {
|
|
191
177
|
const resolvedResource = resource?.href ??
|
|
192
178
|
defaultResourceFromClient(client) ??
|
|
@@ -194,9 +180,14 @@ export class NoodleOAuthProvider {
|
|
|
194
180
|
if (resolvedResource === undefined) {
|
|
195
181
|
throw new InvalidRequestError('the resource parameter is required');
|
|
196
182
|
}
|
|
183
|
+
const oldTokenHash = hashToken(refreshToken);
|
|
184
|
+
await assertPlatformRefreshPrincipal(this.#config.store, this.#config.platformPrincipalResolver, {
|
|
185
|
+
oldTokenHash,
|
|
186
|
+
client,
|
|
187
|
+
});
|
|
197
188
|
const rawRefresh = randomToken();
|
|
198
189
|
const rotation = await this.#config.store.rotateRefreshToken({
|
|
199
|
-
oldTokenHash
|
|
190
|
+
oldTokenHash,
|
|
200
191
|
clientId: client.client_id,
|
|
201
192
|
newTokenHash: hashToken(rawRefresh),
|
|
202
193
|
newExpiresAt: this.#nowSeconds() + this.#refreshTtl,
|
|
@@ -204,7 +195,7 @@ export class NoodleOAuthProvider {
|
|
|
204
195
|
recoverySeconds: this.#refreshRecoveryTtl,
|
|
205
196
|
nowSeconds: this.#nowSeconds(),
|
|
206
197
|
});
|
|
207
|
-
if (
|
|
198
|
+
if (!('identity' in rotation)) {
|
|
208
199
|
this.#logRefresh(rotation.status, client.client_id, resolvedResource);
|
|
209
200
|
throw new InvalidGrantError('invalid refresh token');
|
|
210
201
|
}
|
|
@@ -245,8 +236,6 @@ export class NoodleOAuthProvider {
|
|
|
245
236
|
...(identity.scope !== undefined ? { scope: identity.scope } : {}),
|
|
246
237
|
};
|
|
247
238
|
}
|
|
248
|
-
/** Verify an access token (issuer/signature/expiry). Provided for interface completeness — the data-plane
|
|
249
|
-
* resource server verifies with its own audience-bound verifier; this is not on the AS request path. */
|
|
250
239
|
async verifyAccessToken(token) {
|
|
251
240
|
const identity = await this.#verify()(token);
|
|
252
241
|
if (!identity)
|
|
@@ -258,7 +247,6 @@ export class NoodleOAuthProvider {
|
|
|
258
247
|
...(identity.expiresAt !== undefined ? { expiresAt: identity.expiresAt } : {}),
|
|
259
248
|
};
|
|
260
249
|
}
|
|
261
|
-
/** RFC 7009 revocation also invalidates the exact developer grant bound to this client token. */
|
|
262
250
|
async revokeToken(client, request) {
|
|
263
251
|
try {
|
|
264
252
|
const identity = await this.#verify()(request.token);
|
|
@@ -272,120 +260,67 @@ export class NoodleOAuthProvider {
|
|
|
272
260
|
at: new Date(this.#now()).toISOString(),
|
|
273
261
|
});
|
|
274
262
|
}
|
|
275
|
-
catch {
|
|
276
|
-
// RFC 7009 requires invalid and already-revoked tokens to be indistinguishable no-ops.
|
|
277
|
-
}
|
|
263
|
+
catch { }
|
|
278
264
|
}
|
|
279
|
-
/** RFC 8414 authorization-server metadata (plus our `jwks_uri`), served at `/.well-known/oauth-authorization-server`. */
|
|
280
265
|
metadata() {
|
|
281
266
|
const issuer = trimTrailingSlash(this.#config.issuer);
|
|
282
|
-
|
|
283
|
-
// The SDK emits `issuer` as `URL.href`, which appends a trailing slash for a path-less origin
|
|
284
|
-
// (`https://h` → `https://h/`). RFC 8414 §3.3 requires the metadata `issuer` to be identical to the
|
|
285
|
-
// issuer used to build the well-known URL, and our token `iss` + the PRM `authorization_servers` entry
|
|
286
|
-
// use the no-slash form — so normalize it back for consistency across all three.
|
|
287
|
-
const grants = Array.isArray(base.grant_types_supported)
|
|
288
|
-
? base.grant_types_supported
|
|
289
|
-
: ['authorization_code', 'refresh_token'];
|
|
290
|
-
return {
|
|
291
|
-
...base,
|
|
292
|
-
issuer,
|
|
293
|
-
grant_types_supported: [...new Set([...grants, DEVICE_GRANT])],
|
|
294
|
-
device_authorization_endpoint: `${issuer}/device_authorization`,
|
|
295
|
-
jwks_uri: `${issuer}/.well-known/jwks.json`,
|
|
296
|
-
};
|
|
267
|
+
return noodleOAuthMetadata(this, issuer, DEVICE_GRANT);
|
|
297
268
|
}
|
|
298
|
-
/** The public JWKS the resource server (and external validators) read to verify access tokens. */
|
|
299
269
|
jwks() {
|
|
300
270
|
return this.#config.signer.publicJwks();
|
|
301
271
|
}
|
|
302
|
-
/** Google callback: consume the pending auth, verify the Google identity, and render the consent page. */
|
|
303
272
|
async handleGoogleCallback(req, res) {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
res
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
redirectUri: pending.redirectUri,
|
|
354
|
-
resource: pending.resource,
|
|
355
|
-
ownerSubject: identity.subject,
|
|
356
|
-
ownerEmail: identity.email,
|
|
357
|
-
...preferences,
|
|
358
|
-
...(pending.clientState !== undefined ? { clientState: pending.clientState } : {}),
|
|
359
|
-
...(pending.scope !== undefined ? { scope: pending.scope } : {}),
|
|
360
|
-
});
|
|
361
|
-
return;
|
|
362
|
-
}
|
|
363
|
-
const consentToken = await this.#signConsent({
|
|
364
|
-
kind: 'consent',
|
|
365
|
-
clientId: pending.clientId,
|
|
366
|
-
redirectUri: pending.redirectUri,
|
|
367
|
-
codeChallenge: pending.codeChallenge,
|
|
368
|
-
resource: pending.resource,
|
|
369
|
-
ownerSubject: identity.subject,
|
|
370
|
-
ownerEmail: identity.email,
|
|
371
|
-
...preferences,
|
|
372
|
-
...(pending.clientState !== undefined ? { clientState: pending.clientState } : {}),
|
|
373
|
-
...(pending.scope !== undefined ? { scope: pending.scope } : {}),
|
|
273
|
+
await this.#handleUpstreamCallback('google', req, res);
|
|
274
|
+
}
|
|
275
|
+
async handleWorkOSCallback(req, res) {
|
|
276
|
+
await this.#handleUpstreamCallback('workos', req, res);
|
|
277
|
+
}
|
|
278
|
+
async handleUpstreamProviderChoice(req, res) {
|
|
279
|
+
await continueUpstreamProviderChoice({
|
|
280
|
+
req,
|
|
281
|
+
res,
|
|
282
|
+
store: this.#config.store,
|
|
283
|
+
...(this.#config.google === undefined ? {} : { google: this.#config.google }),
|
|
284
|
+
...(this.#config.upstreamAuthenticators?.workos === undefined
|
|
285
|
+
? {}
|
|
286
|
+
: { workos: this.#config.upstreamAuthenticators.workos }),
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
async #handleUpstreamCallback(upstreamProvider, req, res) {
|
|
290
|
+
await handleUpstreamHumanCallback({
|
|
291
|
+
provider: upstreamProvider,
|
|
292
|
+
req,
|
|
293
|
+
res,
|
|
294
|
+
store: this.#config.store,
|
|
295
|
+
issuer: this.#config.issuer,
|
|
296
|
+
...(this.#config.google === undefined ? {} : { google: this.#config.google }),
|
|
297
|
+
...(this.#config.upstreamAuthenticators?.workos === undefined
|
|
298
|
+
? {}
|
|
299
|
+
: { workos: this.#config.upstreamAuthenticators.workos }),
|
|
300
|
+
...(this.#config.platformPrincipalResolver === undefined
|
|
301
|
+
? {}
|
|
302
|
+
: { resolver: this.#config.platformPrincipalResolver }),
|
|
303
|
+
...(this.#config.signupAuthorizer === undefined
|
|
304
|
+
? {}
|
|
305
|
+
: { signupAuthorizer: this.#config.signupAuthorizer }),
|
|
306
|
+
signupMode: this.#config.signupMode ?? 'restricted',
|
|
307
|
+
...(this.#config.allowedEmailDomain === undefined
|
|
308
|
+
? {}
|
|
309
|
+
: { allowedEmailDomain: this.#config.allowedEmailDomain }),
|
|
310
|
+
deniedSignupDomains: this.#config.deniedSignupDomains ?? [],
|
|
311
|
+
deniedSignupSubjects: this.#config.deniedSignupSubjects ?? [],
|
|
312
|
+
...(this.#config.provisionPlatformPrincipal === undefined
|
|
313
|
+
? {}
|
|
314
|
+
: { provisionPlatformPrincipal: this.#config.provisionPlatformPrincipal }),
|
|
315
|
+
...(this.#developerGrantFlow === undefined
|
|
316
|
+
? {}
|
|
317
|
+
: { developerGrantFlow: this.#developerGrantFlow }),
|
|
318
|
+
tokenIssuer: this.#tokenIssuer,
|
|
319
|
+
signConsent: (claims) => signConsentToken(claims, this.#config.signer, this.#config.issuer, this.#consentTtl),
|
|
320
|
+
logger: this.#logger,
|
|
321
|
+
now: this.#now,
|
|
374
322
|
});
|
|
375
|
-
const client = await this.#config.store.getClient(pending.clientId);
|
|
376
|
-
res
|
|
377
|
-
.status(200)
|
|
378
|
-
.type('html')
|
|
379
|
-
.send(renderConsentPage({
|
|
380
|
-
clientName: client?.client_name ?? pending.clientId,
|
|
381
|
-
resourceHost: hostOf(pending.resource),
|
|
382
|
-
redirectHost: hostOf(pending.redirectUri),
|
|
383
|
-
userEmail: identity.email,
|
|
384
|
-
consentToken,
|
|
385
|
-
consentAction: CONSENT_PATH,
|
|
386
|
-
}));
|
|
387
323
|
}
|
|
388
|
-
/** Consent decision: on approve, mint a PKCE-bound code and redirect to the client; on deny, redirect with an error. */
|
|
389
324
|
async handleConsent(req, res) {
|
|
390
325
|
const body = (req.body ?? {});
|
|
391
326
|
const consentToken = typeof body.consent_token === 'string' ? body.consent_token : undefined;
|
|
@@ -396,7 +331,7 @@ export class NoodleOAuthProvider {
|
|
|
396
331
|
}
|
|
397
332
|
let claims;
|
|
398
333
|
try {
|
|
399
|
-
claims = await this.#
|
|
334
|
+
claims = await verifyConsentToken(consentToken, this.#config.signer, this.#config.issuer);
|
|
400
335
|
}
|
|
401
336
|
catch {
|
|
402
337
|
res.status(400).type('text/plain').send('invalid or expired consent');
|
|
@@ -410,7 +345,6 @@ export class NoodleOAuthProvider {
|
|
|
410
345
|
res.redirect(302, redirect.href);
|
|
411
346
|
return;
|
|
412
347
|
}
|
|
413
|
-
// Remember this approval so a later authorization for the same (client, subject, resource) is silent.
|
|
414
348
|
await this.#config.store.createConsentGrant({
|
|
415
349
|
clientId: claims.clientId,
|
|
416
350
|
ownerSubject: claims.ownerSubject,
|
|
@@ -436,7 +370,6 @@ export class NoodleOAuthProvider {
|
|
|
436
370
|
}
|
|
437
371
|
await this.#developerGrantFlow.handleDecision(req, res);
|
|
438
372
|
}
|
|
439
|
-
/** Customer bridge callback: verify the tenant app's customer token and issue a normal OAuth code. */
|
|
440
373
|
async handleFirebaseCustomerAuthorize(req, res) {
|
|
441
374
|
const input = customerBridgeAuthorizeFields(req);
|
|
442
375
|
const auth = input.resource !== undefined
|
|
@@ -456,7 +389,7 @@ export class NoodleOAuthProvider {
|
|
|
456
389
|
const input = customerBridgeCallbackFields(req);
|
|
457
390
|
const state = input.state;
|
|
458
391
|
if (input.error !== undefined) {
|
|
459
|
-
await this.#redirectPendingError(res, state, input.error);
|
|
392
|
+
await this.#redirectPendingError(res, state, input.error, 'customer_firebase');
|
|
460
393
|
return;
|
|
461
394
|
}
|
|
462
395
|
const idToken = input.id_token;
|
|
@@ -464,7 +397,7 @@ export class NoodleOAuthProvider {
|
|
|
464
397
|
res.status(400).type('text/plain').send('missing state or id_token');
|
|
465
398
|
return;
|
|
466
399
|
}
|
|
467
|
-
const pending = await this.#config.store.consumePendingAuthorization(hashToken(state));
|
|
400
|
+
const pending = await this.#config.store.consumePendingAuthorization(hashToken(state), 'customer_firebase');
|
|
468
401
|
if (!pending) {
|
|
469
402
|
res.status(400).type('text/plain').send('unknown or expired authorization request');
|
|
470
403
|
return;
|
|
@@ -511,7 +444,7 @@ export class NoodleOAuthProvider {
|
|
|
511
444
|
const input = customerBridgeCallbackFields(req);
|
|
512
445
|
const state = input.state;
|
|
513
446
|
if (input.error !== undefined) {
|
|
514
|
-
await this.#redirectPendingError(res, state, input.error);
|
|
447
|
+
await this.#redirectPendingError(res, state, input.error, 'customer_microsoft');
|
|
515
448
|
return;
|
|
516
449
|
}
|
|
517
450
|
const code = input.code;
|
|
@@ -519,7 +452,7 @@ export class NoodleOAuthProvider {
|
|
|
519
452
|
res.status(400).type('text/plain').send('missing state or code');
|
|
520
453
|
return;
|
|
521
454
|
}
|
|
522
|
-
const pending = await this.#config.store.consumePendingAuthorization(hashToken(state));
|
|
455
|
+
const pending = await this.#config.store.consumePendingAuthorization(hashToken(state), 'customer_microsoft');
|
|
523
456
|
if (!pending) {
|
|
524
457
|
res.status(400).type('text/plain').send('unknown or expired authorization request');
|
|
525
458
|
return;
|
|
@@ -585,22 +518,6 @@ export class NoodleOAuthProvider {
|
|
|
585
518
|
identityProvider: 'microsoft',
|
|
586
519
|
});
|
|
587
520
|
}
|
|
588
|
-
async #signConsent(claims) {
|
|
589
|
-
const key = await this.#config.signer.signingKey();
|
|
590
|
-
return new SignJWT({ ...claims })
|
|
591
|
-
.setProtectedHeader({ alg: key.alg, kid: key.kid })
|
|
592
|
-
.setIssuer(this.#config.issuer)
|
|
593
|
-
.setIssuedAt()
|
|
594
|
-
.setExpirationTime(`${this.#consentTtl}s`)
|
|
595
|
-
.sign(key.privateKey);
|
|
596
|
-
}
|
|
597
|
-
async #verifyConsent(token) {
|
|
598
|
-
const getKey = await this.#config.signer.verifierKey();
|
|
599
|
-
const { payload } = await jwtVerify(token, getKey, { issuer: this.#config.issuer });
|
|
600
|
-
if (!isConsentClaims(payload))
|
|
601
|
-
throw new Error('not a consent token');
|
|
602
|
-
return payload;
|
|
603
|
-
}
|
|
604
521
|
#verify() {
|
|
605
522
|
if (!this.#verifier) {
|
|
606
523
|
this.#verifier = createJwtVerifier({
|
|
@@ -610,7 +527,6 @@ export class NoodleOAuthProvider {
|
|
|
610
527
|
}
|
|
611
528
|
return this.#verifier;
|
|
612
529
|
}
|
|
613
|
-
// A resolver that defers to the signer's public key on first use (the signer's key set is stable).
|
|
614
530
|
#lazyKey = async (header, input) => {
|
|
615
531
|
const getKey = await this.#config.signer.verifierKey();
|
|
616
532
|
return getKey(header, input);
|
|
@@ -624,21 +540,14 @@ export class NoodleOAuthProvider {
|
|
|
624
540
|
resourcePath: resourcePath(resource),
|
|
625
541
|
});
|
|
626
542
|
}
|
|
627
|
-
async #redirectPendingError(res, state, error) {
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
return;
|
|
636
|
-
}
|
|
637
|
-
const redirect = new URL(pending.redirectUri);
|
|
638
|
-
redirect.searchParams.set('error', error);
|
|
639
|
-
if (pending.clientState !== undefined)
|
|
640
|
-
redirect.searchParams.set('state', pending.clientState);
|
|
641
|
-
res.redirect(302, redirect.href);
|
|
543
|
+
async #redirectPendingError(res, state, error, callbackKind) {
|
|
544
|
+
return redirectPendingAuthorizationError({
|
|
545
|
+
store: this.#config.store,
|
|
546
|
+
res,
|
|
547
|
+
state,
|
|
548
|
+
error,
|
|
549
|
+
callbackKind,
|
|
550
|
+
});
|
|
642
551
|
}
|
|
643
552
|
}
|
|
644
553
|
//# sourceMappingURL=provider.js.map
|