@wildo-ai/saas-backend-lib 1.0.1
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/esm/__tests__/setup.d.ts +7 -0
- package/dist/esm/__tests__/setup.d.ts.map +1 -0
- package/dist/esm/__tests__/setup.js +14 -0
- package/dist/esm/__tests__/setup.js.map +1 -0
- package/dist/esm/__tests__/test-container.d.ts +39 -0
- package/dist/esm/__tests__/test-container.d.ts.map +1 -0
- package/dist/esm/__tests__/test-container.js +94 -0
- package/dist/esm/__tests__/test-container.js.map +1 -0
- package/dist/esm/applications/models/applications.backend.schemas.d.ts +11 -0
- package/dist/esm/applications/models/applications.backend.schemas.d.ts.map +1 -0
- package/dist/esm/applications/models/applications.backend.schemas.js +15 -0
- package/dist/esm/applications/models/applications.backend.schemas.js.map +1 -0
- package/dist/esm/base-classes/models/manual-controllers.backend.definition.d.ts +12 -0
- package/dist/esm/base-classes/models/manual-controllers.backend.definition.d.ts.map +1 -0
- package/dist/esm/base-classes/models/manual-controllers.backend.definition.js +30 -0
- package/dist/esm/base-classes/models/manual-controllers.backend.definition.js.map +1 -0
- package/dist/esm/base-classes/models/repositories.backend.schemas.d.ts +98 -0
- package/dist/esm/base-classes/models/repositories.backend.schemas.d.ts.map +1 -0
- package/dist/esm/base-classes/models/repositories.backend.schemas.js +11 -0
- package/dist/esm/base-classes/models/repositories.backend.schemas.js.map +1 -0
- package/dist/esm/base-classes/services/__tests__/mock-resource-operation-helper.service.d.ts +31 -0
- package/dist/esm/base-classes/services/__tests__/mock-resource-operation-helper.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/__tests__/mock-resource-operation-helper.service.js +52 -0
- package/dist/esm/base-classes/services/__tests__/mock-resource-operation-helper.service.js.map +1 -0
- package/dist/esm/base-classes/services/batches/batches-cronjobs-custom-execution.service.d.ts +56 -0
- package/dist/esm/base-classes/services/batches/batches-cronjobs-custom-execution.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/batches/batches-cronjobs-custom-execution.service.js +52 -0
- package/dist/esm/base-classes/services/batches/batches-cronjobs-custom-execution.service.js.map +1 -0
- package/dist/esm/base-classes/services/batches/batches-cronjobs-executor.backend.service.d.ts +33 -0
- package/dist/esm/base-classes/services/batches/batches-cronjobs-executor.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/batches/batches-cronjobs-executor.backend.service.js +125 -0
- package/dist/esm/base-classes/services/batches/batches-cronjobs-executor.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/batches/batches-cronjobs-resource-execution.backend.service.d.ts +20 -0
- package/dist/esm/base-classes/services/batches/batches-cronjobs-resource-execution.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/batches/batches-cronjobs-resource-execution.backend.service.js +45 -0
- package/dist/esm/base-classes/services/batches/batches-cronjobs-resource-execution.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/controllers/abstract-controller.backend.service.d.ts +133 -0
- package/dist/esm/base-classes/services/controllers/abstract-controller.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/controllers/abstract-controller.backend.service.js +280 -0
- package/dist/esm/base-classes/services/controllers/abstract-controller.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.d.ts +147 -0
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.js +1320 -0
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.d.ts +107 -0
- package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.js +369 -0
- package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/controllers/validate-field-handler.backend.service.d.ts +194 -0
- package/dist/esm/base-classes/services/controllers/validate-field-handler.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/controllers/validate-field-handler.backend.service.js +417 -0
- package/dist/esm/base-classes/services/controllers/validate-field-handler.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/repositories/__tests__/mock-repositories-registry-handler.service.d.ts +9 -0
- package/dist/esm/base-classes/services/repositories/__tests__/mock-repositories-registry-handler.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/repositories/__tests__/mock-repositories-registry-handler.service.js +35 -0
- package/dist/esm/base-classes/services/repositories/__tests__/mock-repositories-registry-handler.service.js.map +1 -0
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts +107 -0
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js +800 -0
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.d.ts +181 -0
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js +529 -0
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts +245 -0
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js +1509 -0
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/resource-operations-helper.backend.service.d.ts +134 -0
- package/dist/esm/base-classes/services/resource-operations-helper.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/resource-operations-helper.backend.service.js +388 -0
- package/dist/esm/base-classes/services/resource-operations-helper.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/services/__tests__/mock-services-registry-handler.service.d.ts +9 -0
- package/dist/esm/base-classes/services/services/__tests__/mock-services-registry-handler.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/services/__tests__/mock-services-registry-handler.service.js +26 -0
- package/dist/esm/base-classes/services/services/__tests__/mock-services-registry-handler.service.js.map +1 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.d.ts +144 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.js +49 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-registry.backend.service.d.ts +84 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-registry.backend.service.js +156 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-registry.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation.factory.backend.d.ts +42 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation.factory.backend.d.ts.map +1 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation.factory.backend.js +94 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation.factory.backend.js.map +1 -0
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.d.ts +593 -0
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js +4015 -0
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js.map +1 -0
- package/dist/esm/base-classes/utils/backend-type-utils.d.ts +43 -0
- package/dist/esm/base-classes/utils/backend-type-utils.d.ts.map +1 -0
- package/dist/esm/base-classes/utils/backend-type-utils.js +10 -0
- package/dist/esm/base-classes/utils/backend-type-utils.js.map +1 -0
- package/dist/esm/billing/services/back-office/abstract-billing.backend.service.d.ts +44 -0
- package/dist/esm/billing/services/back-office/abstract-billing.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/back-office/abstract-billing.backend.service.js +94 -0
- package/dist/esm/billing/services/back-office/abstract-billing.backend.service.js.map +1 -0
- package/dist/esm/billing/services/back-office/billing-feature-sync.backend.service.d.ts +102 -0
- package/dist/esm/billing/services/back-office/billing-feature-sync.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/back-office/billing-feature-sync.backend.service.js +405 -0
- package/dist/esm/billing/services/back-office/billing-feature-sync.backend.service.js.map +1 -0
- package/dist/esm/billing/services/back-office/billing-state.backend.service.d.ts +55 -0
- package/dist/esm/billing/services/back-office/billing-state.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/back-office/billing-state.backend.service.js +268 -0
- package/dist/esm/billing/services/back-office/billing-state.backend.service.js.map +1 -0
- package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.d.ts +83 -0
- package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.js +371 -0
- package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.js.map +1 -0
- package/dist/esm/billing/services/back-office/usage-metering.backend.service.d.ts +80 -0
- package/dist/esm/billing/services/back-office/usage-metering.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/back-office/usage-metering.backend.service.js +255 -0
- package/dist/esm/billing/services/back-office/usage-metering.backend.service.js.map +1 -0
- package/dist/esm/billing/services/billing.utils.d.ts +17 -0
- package/dist/esm/billing/services/billing.utils.d.ts.map +1 -0
- package/dist/esm/billing/services/billing.utils.js +25 -0
- package/dist/esm/billing/services/billing.utils.js.map +1 -0
- package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.d.ts +50 -0
- package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.js +290 -0
- package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.d.ts +92 -0
- package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.d.ts.map +1 -0
- package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.js +193 -0
- package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.js.map +1 -0
- package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.d.ts +66 -0
- package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.d.ts.map +1 -0
- package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.js +180 -0
- package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.js.map +1 -0
- package/dist/esm/billing/services/custom-impl/credit-pool.custom-ops.custom-impl.backend.service.d.ts +31 -0
- package/dist/esm/billing/services/custom-impl/credit-pool.custom-ops.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/custom-impl/credit-pool.custom-ops.custom-impl.backend.service.js +100 -0
- package/dist/esm/billing/services/custom-impl/credit-pool.custom-ops.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.d.ts +33 -0
- package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.js +200 -0
- package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.d.ts +58 -0
- package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.js +362 -0
- package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-adapter.backend.service.d.ts +19 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-adapter.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-adapter.backend.service.js +50 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-adapter.backend.service.js.map +1 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-capability-handler.backend.service.d.ts +21 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-capability-handler.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-capability-handler.backend.service.js +32 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-capability-handler.backend.service.js.map +1 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.d.ts +114 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.js +569 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.js.map +1 -0
- package/dist/esm/billing/testing/billing-test-fixtures.d.ts +109 -0
- package/dist/esm/billing/testing/billing-test-fixtures.d.ts.map +1 -0
- package/dist/esm/billing/testing/billing-test-fixtures.js +200 -0
- package/dist/esm/billing/testing/billing-test-fixtures.js.map +1 -0
- package/dist/esm/billing/testing/mock-billing-provider.d.ts +152 -0
- package/dist/esm/billing/testing/mock-billing-provider.d.ts.map +1 -0
- package/dist/esm/billing/testing/mock-billing-provider.js +394 -0
- package/dist/esm/billing/testing/mock-billing-provider.js.map +1 -0
- package/dist/esm/charts/controllers/chart.backend.controller.d.ts +46 -0
- package/dist/esm/charts/controllers/chart.backend.controller.d.ts.map +1 -0
- package/dist/esm/charts/controllers/chart.backend.controller.js +214 -0
- package/dist/esm/charts/controllers/chart.backend.controller.js.map +1 -0
- package/dist/esm/charts/services/chart-registry.backend.service.d.ts +55 -0
- package/dist/esm/charts/services/chart-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/charts/services/chart-registry.backend.service.js +102 -0
- package/dist/esm/charts/services/chart-registry.backend.service.js.map +1 -0
- package/dist/esm/compliance/audit-trails/audit-logs.custom-impl.backend.service.d.ts +9 -0
- package/dist/esm/compliance/audit-trails/audit-logs.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/compliance/audit-trails/audit-logs.custom-impl.backend.service.js +80 -0
- package/dist/esm/compliance/audit-trails/audit-logs.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/compliance/audit-trails/services/__tests__/mock-audit-logs.service.d.ts +23 -0
- package/dist/esm/compliance/audit-trails/services/__tests__/mock-audit-logs.service.d.ts.map +1 -0
- package/dist/esm/compliance/audit-trails/services/__tests__/mock-audit-logs.service.js +46 -0
- package/dist/esm/compliance/audit-trails/services/__tests__/mock-audit-logs.service.js.map +1 -0
- package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.d.ts +73 -0
- package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.d.ts.map +1 -0
- package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.js +291 -0
- package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.js.map +1 -0
- package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts +447 -0
- package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts.map +1 -0
- package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js +898 -0
- package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js.map +1 -0
- package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.d.ts +127 -0
- package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.d.ts.map +1 -0
- package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.js +462 -0
- package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.js.map +1 -0
- package/dist/esm/compliance/index.d.ts +2 -0
- package/dist/esm/compliance/index.d.ts.map +1 -0
- package/dist/esm/compliance/index.js +1 -0
- package/dist/esm/compliance/index.js.map +1 -0
- package/dist/esm/config/custom/application-config-controller.backend.service.d.ts +31 -0
- package/dist/esm/config/custom/application-config-controller.backend.service.d.ts.map +1 -0
- package/dist/esm/config/custom/application-config-controller.backend.service.js +112 -0
- package/dist/esm/config/custom/application-config-controller.backend.service.js.map +1 -0
- package/dist/esm/config/models/app-config-overrides.backend.definitions.d.ts +29 -0
- package/dist/esm/config/models/app-config-overrides.backend.definitions.d.ts.map +1 -0
- package/dist/esm/config/models/app-config-overrides.backend.definitions.js +143 -0
- package/dist/esm/config/models/app-config-overrides.backend.definitions.js.map +1 -0
- package/dist/esm/config/models/app-config-secrets.backend.schemas.d.ts +56 -0
- package/dist/esm/config/models/app-config-secrets.backend.schemas.d.ts.map +1 -0
- package/dist/esm/config/models/app-config-secrets.backend.schemas.js +121 -0
- package/dist/esm/config/models/app-config-secrets.backend.schemas.js.map +1 -0
- package/dist/esm/config/models/app-config.backend-authored.definitions.d.ts +35 -0
- package/dist/esm/config/models/app-config.backend-authored.definitions.d.ts.map +1 -0
- package/dist/esm/config/models/app-config.backend-authored.definitions.js +89 -0
- package/dist/esm/config/models/app-config.backend-authored.definitions.js.map +1 -0
- package/dist/esm/config/models/app-config.backend.schemas.d.ts +1651 -0
- package/dist/esm/config/models/app-config.backend.schemas.d.ts.map +1 -0
- package/dist/esm/config/models/app-config.backend.schemas.js +478 -0
- package/dist/esm/config/models/app-config.backend.schemas.js.map +1 -0
- package/dist/esm/config/models/app-env-config.backend.schemas.d.ts +74 -0
- package/dist/esm/config/models/app-env-config.backend.schemas.d.ts.map +1 -0
- package/dist/esm/config/models/app-env-config.backend.schemas.js +115 -0
- package/dist/esm/config/models/app-env-config.backend.schemas.js.map +1 -0
- package/dist/esm/config/models/config-mutation-boundary.utils.d.ts +11 -0
- package/dist/esm/config/models/config-mutation-boundary.utils.d.ts.map +1 -0
- package/dist/esm/config/models/config-mutation-boundary.utils.js +50 -0
- package/dist/esm/config/models/config-mutation-boundary.utils.js.map +1 -0
- package/dist/esm/config/models/postgresql-env-config.backend.schemas.d.ts +48 -0
- package/dist/esm/config/models/postgresql-env-config.backend.schemas.d.ts.map +1 -0
- package/dist/esm/config/models/postgresql-env-config.backend.schemas.js +106 -0
- package/dist/esm/config/models/postgresql-env-config.backend.schemas.js.map +1 -0
- package/dist/esm/config/models/runtime-topology.backend.contracts.d.ts +12 -0
- package/dist/esm/config/models/runtime-topology.backend.contracts.d.ts.map +1 -0
- package/dist/esm/config/models/runtime-topology.backend.contracts.js +23 -0
- package/dist/esm/config/models/runtime-topology.backend.contracts.js.map +1 -0
- package/dist/esm/config/services/__tests__/mock-app-configuration.service.d.ts +39 -0
- package/dist/esm/config/services/__tests__/mock-app-configuration.service.d.ts.map +1 -0
- package/dist/esm/config/services/__tests__/mock-app-configuration.service.js +124 -0
- package/dist/esm/config/services/__tests__/mock-app-configuration.service.js.map +1 -0
- package/dist/esm/config/services/app-configuration-loader.backend.service.d.ts +76 -0
- package/dist/esm/config/services/app-configuration-loader.backend.service.d.ts.map +1 -0
- package/dist/esm/config/services/app-configuration-loader.backend.service.js +375 -0
- package/dist/esm/config/services/app-configuration-loader.backend.service.js.map +1 -0
- package/dist/esm/config/services/app-configuration.backend.service.d.ts +148 -0
- package/dist/esm/config/services/app-configuration.backend.service.d.ts.map +1 -0
- package/dist/esm/config/services/app-configuration.backend.service.js +494 -0
- package/dist/esm/config/services/app-configuration.backend.service.js.map +1 -0
- package/dist/esm/config/services/app-configuration.backend.utils.d.ts +17 -0
- package/dist/esm/config/services/app-configuration.backend.utils.d.ts.map +1 -0
- package/dist/esm/config/services/app-configuration.backend.utils.js +61 -0
- package/dist/esm/config/services/app-configuration.backend.utils.js.map +1 -0
- package/dist/esm/config/services/application-startup-config-validator.backend.service.d.ts +70 -0
- package/dist/esm/config/services/application-startup-config-validator.backend.service.d.ts.map +1 -0
- package/dist/esm/config/services/application-startup-config-validator.backend.service.js +470 -0
- package/dist/esm/config/services/application-startup-config-validator.backend.service.js.map +1 -0
- package/dist/esm/databases/models/aggregation.backend.schemas.d.ts +136 -0
- package/dist/esm/databases/models/aggregation.backend.schemas.d.ts.map +1 -0
- package/dist/esm/databases/models/aggregation.backend.schemas.js +9 -0
- package/dist/esm/databases/models/aggregation.backend.schemas.js.map +1 -0
- package/dist/esm/databases/models/databases.backend.schemas.d.ts +32 -0
- package/dist/esm/databases/models/databases.backend.schemas.d.ts.map +1 -0
- package/dist/esm/databases/models/databases.backend.schemas.js +60 -0
- package/dist/esm/databases/models/databases.backend.schemas.js.map +1 -0
- package/dist/esm/databases/models/filter.backend.schemas.d.ts +83 -0
- package/dist/esm/databases/models/filter.backend.schemas.d.ts.map +1 -0
- package/dist/esm/databases/models/filter.backend.schemas.js +27 -0
- package/dist/esm/databases/models/filter.backend.schemas.js.map +1 -0
- package/dist/esm/databases/models/sql.backend.schemas.d.ts +75 -0
- package/dist/esm/databases/models/sql.backend.schemas.d.ts.map +1 -0
- package/dist/esm/databases/models/sql.backend.schemas.js +31 -0
- package/dist/esm/databases/models/sql.backend.schemas.js.map +1 -0
- package/dist/esm/databases/models/transaction.shared.schemas.d.ts +120 -0
- package/dist/esm/databases/models/transaction.shared.schemas.d.ts.map +1 -0
- package/dist/esm/databases/models/transaction.shared.schemas.js +30 -0
- package/dist/esm/databases/models/transaction.shared.schemas.js.map +1 -0
- package/dist/esm/databases/services/__tests__/mock-mongo-transaction-registry.service.d.ts +15 -0
- package/dist/esm/databases/services/__tests__/mock-mongo-transaction-registry.service.d.ts.map +1 -0
- package/dist/esm/databases/services/__tests__/mock-mongo-transaction-registry.service.js +60 -0
- package/dist/esm/databases/services/__tests__/mock-mongo-transaction-registry.service.js.map +1 -0
- package/dist/esm/databases/services/__tests__/mock-mongodb.service.d.ts +19 -0
- package/dist/esm/databases/services/__tests__/mock-mongodb.service.d.ts.map +1 -0
- package/dist/esm/databases/services/__tests__/mock-mongodb.service.js +69 -0
- package/dist/esm/databases/services/__tests__/mock-mongodb.service.js.map +1 -0
- package/dist/esm/databases/services/__tests__/mock-mongoose-model.service.d.ts +11 -0
- package/dist/esm/databases/services/__tests__/mock-mongoose-model.service.d.ts.map +1 -0
- package/dist/esm/databases/services/__tests__/mock-mongoose-model.service.js +315 -0
- package/dist/esm/databases/services/__tests__/mock-mongoose-model.service.js.map +1 -0
- package/dist/esm/databases/services/__tests__/mock-redis.service.d.ts +29 -0
- package/dist/esm/databases/services/__tests__/mock-redis.service.d.ts.map +1 -0
- package/dist/esm/databases/services/__tests__/mock-redis.service.js +65 -0
- package/dist/esm/databases/services/__tests__/mock-redis.service.js.map +1 -0
- package/dist/esm/databases/services/__tests__/mock-zod-mongoose-schema-convertor.service.d.ts +19 -0
- package/dist/esm/databases/services/__tests__/mock-zod-mongoose-schema-convertor.service.d.ts.map +1 -0
- package/dist/esm/databases/services/__tests__/mock-zod-mongoose-schema-convertor.service.js +44 -0
- package/dist/esm/databases/services/__tests__/mock-zod-mongoose-schema-convertor.service.js.map +1 -0
- package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.d.ts +74 -0
- package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.d.ts.map +1 -0
- package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.js +369 -0
- package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.js.map +1 -0
- package/dist/esm/databases/services/aggregation/aggregation-query.backend.service.d.ts +110 -0
- package/dist/esm/databases/services/aggregation/aggregation-query.backend.service.d.ts.map +1 -0
- package/dist/esm/databases/services/aggregation/aggregation-query.backend.service.js +444 -0
- package/dist/esm/databases/services/aggregation/aggregation-query.backend.service.js.map +1 -0
- package/dist/esm/databases/services/aggregation/computed-measure-evaluator.backend.service.d.ts +38 -0
- package/dist/esm/databases/services/aggregation/computed-measure-evaluator.backend.service.d.ts.map +1 -0
- package/dist/esm/databases/services/aggregation/computed-measure-evaluator.backend.service.js +180 -0
- package/dist/esm/databases/services/aggregation/computed-measure-evaluator.backend.service.js.map +1 -0
- package/dist/esm/databases/services/aggregation/field-access-validator.backend.service.d.ts +42 -0
- package/dist/esm/databases/services/aggregation/field-access-validator.backend.service.d.ts.map +1 -0
- package/dist/esm/databases/services/aggregation/field-access-validator.backend.service.js +183 -0
- package/dist/esm/databases/services/aggregation/field-access-validator.backend.service.js.map +1 -0
- package/dist/esm/databases/services/aggregation/time-series-densifier.backend.service.d.ts +48 -0
- package/dist/esm/databases/services/aggregation/time-series-densifier.backend.service.d.ts.map +1 -0
- package/dist/esm/databases/services/aggregation/time-series-densifier.backend.service.js +320 -0
- package/dist/esm/databases/services/aggregation/time-series-densifier.backend.service.js.map +1 -0
- package/dist/esm/databases/services/aggregation/topn-processor.backend.service.d.ts +47 -0
- package/dist/esm/databases/services/aggregation/topn-processor.backend.service.d.ts.map +1 -0
- package/dist/esm/databases/services/aggregation/topn-processor.backend.service.js +187 -0
- package/dist/esm/databases/services/aggregation/topn-processor.backend.service.js.map +1 -0
- package/dist/esm/databases/services/aggregation/window-function-processor.backend.service.d.ts +47 -0
- package/dist/esm/databases/services/aggregation/window-function-processor.backend.service.d.ts.map +1 -0
- package/dist/esm/databases/services/aggregation/window-function-processor.backend.service.js +250 -0
- package/dist/esm/databases/services/aggregation/window-function-processor.backend.service.js.map +1 -0
- package/dist/esm/databases/services/db-utils.d.ts +56 -0
- package/dist/esm/databases/services/db-utils.d.ts.map +1 -0
- package/dist/esm/databases/services/db-utils.js +66 -0
- package/dist/esm/databases/services/db-utils.js.map +1 -0
- package/dist/esm/databases/services/mongo-aggregation.backend.service.d.ts +91 -0
- package/dist/esm/databases/services/mongo-aggregation.backend.service.d.ts.map +1 -0
- package/dist/esm/databases/services/mongo-aggregation.backend.service.js +652 -0
- package/dist/esm/databases/services/mongo-aggregation.backend.service.js.map +1 -0
- package/dist/esm/databases/services/mongodb.service.d.ts +132 -0
- package/dist/esm/databases/services/mongodb.service.d.ts.map +1 -0
- package/dist/esm/databases/services/mongodb.service.js +630 -0
- package/dist/esm/databases/services/mongodb.service.js.map +1 -0
- package/dist/esm/databases/services/postgresql-aggregation.backend.service.d.ts +113 -0
- package/dist/esm/databases/services/postgresql-aggregation.backend.service.d.ts.map +1 -0
- package/dist/esm/databases/services/postgresql-aggregation.backend.service.js +635 -0
- package/dist/esm/databases/services/postgresql-aggregation.backend.service.js.map +1 -0
- package/dist/esm/databases/services/postgresql-database.backend.service.d.ts +75 -0
- package/dist/esm/databases/services/postgresql-database.backend.service.d.ts.map +1 -0
- package/dist/esm/databases/services/postgresql-database.backend.service.js +255 -0
- package/dist/esm/databases/services/postgresql-database.backend.service.js.map +1 -0
- package/dist/esm/databases/services/postgresql-filter.backend.service.d.ts +116 -0
- package/dist/esm/databases/services/postgresql-filter.backend.service.d.ts.map +1 -0
- package/dist/esm/databases/services/postgresql-filter.backend.service.js +624 -0
- package/dist/esm/databases/services/postgresql-filter.backend.service.js.map +1 -0
- package/dist/esm/databases/services/redis.service.d.ts +143 -0
- package/dist/esm/databases/services/redis.service.d.ts.map +1 -0
- package/dist/esm/databases/services/redis.service.js +429 -0
- package/dist/esm/databases/services/redis.service.js.map +1 -0
- package/dist/esm/databases/services/zod-to-mongoose-schema-convertor.backend.service.d.ts +302 -0
- package/dist/esm/databases/services/zod-to-mongoose-schema-convertor.backend.service.d.ts.map +1 -0
- package/dist/esm/databases/services/zod-to-mongoose-schema-convertor.backend.service.js +1787 -0
- package/dist/esm/databases/services/zod-to-mongoose-schema-convertor.backend.service.js.map +1 -0
- package/dist/esm/databases/services/zod-to-sql-hybrid-schema.planner.d.ts +65 -0
- package/dist/esm/databases/services/zod-to-sql-hybrid-schema.planner.d.ts.map +1 -0
- package/dist/esm/databases/services/zod-to-sql-hybrid-schema.planner.js +237 -0
- package/dist/esm/databases/services/zod-to-sql-hybrid-schema.planner.js.map +1 -0
- package/dist/esm/errors/services/__tests__/mock-error-builder.service.d.ts +339 -0
- package/dist/esm/errors/services/__tests__/mock-error-builder.service.d.ts.map +1 -0
- package/dist/esm/errors/services/__tests__/mock-error-builder.service.js +209 -0
- package/dist/esm/errors/services/__tests__/mock-error-builder.service.js.map +1 -0
- package/dist/esm/errors/services/error-builder.backend.service.d.ts +95 -0
- package/dist/esm/errors/services/error-builder.backend.service.d.ts.map +1 -0
- package/dist/esm/errors/services/error-builder.backend.service.js +334 -0
- package/dist/esm/errors/services/error-builder.backend.service.js.map +1 -0
- package/dist/esm/errors/services/error-handler.backend.service.d.ts +43 -0
- package/dist/esm/errors/services/error-handler.backend.service.d.ts.map +1 -0
- package/dist/esm/errors/services/error-handler.backend.service.js +219 -0
- package/dist/esm/errors/services/error-handler.backend.service.js.map +1 -0
- package/dist/esm/errors/services/rate-limit.backend.service.d.ts +23 -0
- package/dist/esm/errors/services/rate-limit.backend.service.d.ts.map +1 -0
- package/dist/esm/errors/services/rate-limit.backend.service.js +59 -0
- package/dist/esm/errors/services/rate-limit.backend.service.js.map +1 -0
- package/dist/esm/external-providers/models/external-providers.backend.schemas.d.ts +135 -0
- package/dist/esm/external-providers/models/external-providers.backend.schemas.d.ts.map +1 -0
- package/dist/esm/external-providers/models/external-providers.backend.schemas.js +129 -0
- package/dist/esm/external-providers/models/external-providers.backend.schemas.js.map +1 -0
- package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.d.ts +18 -0
- package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.d.ts.map +1 -0
- package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.js +38 -0
- package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.js.map +1 -0
- package/dist/esm/external-providers/services/__tests__/mock-lazy-provider-registry.service.d.ts +20 -0
- package/dist/esm/external-providers/services/__tests__/mock-lazy-provider-registry.service.d.ts.map +1 -0
- package/dist/esm/external-providers/services/__tests__/mock-lazy-provider-registry.service.js +44 -0
- package/dist/esm/external-providers/services/__tests__/mock-lazy-provider-registry.service.js.map +1 -0
- package/dist/esm/external-providers/services/external-api-handler.backend.service.d.ts +9 -0
- package/dist/esm/external-providers/services/external-api-handler.backend.service.d.ts.map +1 -0
- package/dist/esm/external-providers/services/external-api-handler.backend.service.js +36 -0
- package/dist/esm/external-providers/services/external-api-handler.backend.service.js.map +1 -0
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts +83 -0
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.js +422 -0
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.js.map +1 -0
- package/dist/esm/external-providers/services/feature-bindings.backend.service.d.ts +102 -0
- package/dist/esm/external-providers/services/feature-bindings.backend.service.d.ts.map +1 -0
- package/dist/esm/external-providers/services/feature-bindings.backend.service.js +352 -0
- package/dist/esm/external-providers/services/feature-bindings.backend.service.js.map +1 -0
- package/dist/esm/external-providers/services/lazy-provider-registry.backend.service.d.ts +141 -0
- package/dist/esm/external-providers/services/lazy-provider-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/external-providers/services/lazy-provider-registry.backend.service.js +391 -0
- package/dist/esm/external-providers/services/lazy-provider-registry.backend.service.js.map +1 -0
- package/dist/esm/features/controllers/features.backend.controller.d.ts +35 -0
- package/dist/esm/features/controllers/features.backend.controller.d.ts.map +1 -0
- package/dist/esm/features/controllers/features.backend.controller.js +179 -0
- package/dist/esm/features/controllers/features.backend.controller.js.map +1 -0
- package/dist/esm/features/services/__tests__/mock-capability-bindings.service.d.ts +8 -0
- package/dist/esm/features/services/__tests__/mock-capability-bindings.service.d.ts.map +1 -0
- package/dist/esm/features/services/__tests__/mock-capability-bindings.service.js +31 -0
- package/dist/esm/features/services/__tests__/mock-capability-bindings.service.js.map +1 -0
- package/dist/esm/features/services/__tests__/mock-feature-definition-registry.service.d.ts +22 -0
- package/dist/esm/features/services/__tests__/mock-feature-definition-registry.service.d.ts.map +1 -0
- package/dist/esm/features/services/__tests__/mock-feature-definition-registry.service.js +52 -0
- package/dist/esm/features/services/__tests__/mock-feature-definition-registry.service.js.map +1 -0
- package/dist/esm/features/services/__tests__/mock-feature-resolution.service.d.ts +13 -0
- package/dist/esm/features/services/__tests__/mock-feature-resolution.service.d.ts.map +1 -0
- package/dist/esm/features/services/__tests__/mock-feature-resolution.service.js +36 -0
- package/dist/esm/features/services/__tests__/mock-feature-resolution.service.js.map +1 -0
- package/dist/esm/features/services/feature-definition-registry.backend.service.d.ts +111 -0
- package/dist/esm/features/services/feature-definition-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/features/services/feature-definition-registry.backend.service.js +437 -0
- package/dist/esm/features/services/feature-definition-registry.backend.service.js.map +1 -0
- package/dist/esm/features/services/feature-gate.backend.service.d.ts +110 -0
- package/dist/esm/features/services/feature-gate.backend.service.d.ts.map +1 -0
- package/dist/esm/features/services/feature-gate.backend.service.js +414 -0
- package/dist/esm/features/services/feature-gate.backend.service.js.map +1 -0
- package/dist/esm/features/services/feature-resolution.backend.service.d.ts +163 -0
- package/dist/esm/features/services/feature-resolution.backend.service.d.ts.map +1 -0
- package/dist/esm/features/services/feature-resolution.backend.service.js +550 -0
- package/dist/esm/features/services/feature-resolution.backend.service.js.map +1 -0
- package/dist/esm/features/testing/feature-test-utils.d.ts +85 -0
- package/dist/esm/features/testing/feature-test-utils.d.ts.map +1 -0
- package/dist/esm/features/testing/feature-test-utils.js +127 -0
- package/dist/esm/features/testing/feature-test-utils.js.map +1 -0
- package/dist/esm/files/batches/files-cleanup.batch.backend.service.d.ts +34 -0
- package/dist/esm/files/batches/files-cleanup.batch.backend.service.d.ts.map +1 -0
- package/dist/esm/files/batches/files-cleanup.batch.backend.service.js +226 -0
- package/dist/esm/files/batches/files-cleanup.batch.backend.service.js.map +1 -0
- package/dist/esm/files/constraints/file-analyzers.types.d.ts +76 -0
- package/dist/esm/files/constraints/file-analyzers.types.d.ts.map +1 -0
- package/dist/esm/files/constraints/file-analyzers.types.js +16 -0
- package/dist/esm/files/constraints/file-analyzers.types.js.map +1 -0
- package/dist/esm/files/constraints/file-constraint-resolver-chain.backend.service.d.ts +38 -0
- package/dist/esm/files/constraints/file-constraint-resolver-chain.backend.service.d.ts.map +1 -0
- package/dist/esm/files/constraints/file-constraint-resolver-chain.backend.service.js +99 -0
- package/dist/esm/files/constraints/file-constraint-resolver-chain.backend.service.js.map +1 -0
- package/dist/esm/files/constraints/file-constraint.types.d.ts +77 -0
- package/dist/esm/files/constraints/file-constraint.types.d.ts.map +1 -0
- package/dist/esm/files/constraints/file-constraint.types.js +16 -0
- package/dist/esm/files/constraints/file-constraint.types.js.map +1 -0
- package/dist/esm/files/constraints/file-validation.backend.service.d.ts +63 -0
- package/dist/esm/files/constraints/file-validation.backend.service.d.ts.map +1 -0
- package/dist/esm/files/constraints/file-validation.backend.service.js +317 -0
- package/dist/esm/files/constraints/file-validation.backend.service.js.map +1 -0
- package/dist/esm/files/constraints/resource-field-constraint-resolver.backend.service.d.ts +33 -0
- package/dist/esm/files/constraints/resource-field-constraint-resolver.backend.service.d.ts.map +1 -0
- package/dist/esm/files/constraints/resource-field-constraint-resolver.backend.service.js +126 -0
- package/dist/esm/files/constraints/resource-field-constraint-resolver.backend.service.js.map +1 -0
- package/dist/esm/files/controllers/file.controller.d.ts +145 -0
- package/dist/esm/files/controllers/file.controller.d.ts.map +1 -0
- package/dist/esm/files/controllers/file.controller.js +806 -0
- package/dist/esm/files/controllers/file.controller.js.map +1 -0
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts +85 -0
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts.map +1 -0
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js +512 -0
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js.map +1 -0
- package/dist/esm/files/rag/weaviate-vector-store.backend.service.d.ts +84 -0
- package/dist/esm/files/rag/weaviate-vector-store.backend.service.d.ts.map +1 -0
- package/dist/esm/files/rag/weaviate-vector-store.backend.service.js +224 -0
- package/dist/esm/files/rag/weaviate-vector-store.backend.service.js.map +1 -0
- package/dist/esm/files/scanning/clamav-scanner.backend.service.d.ts +55 -0
- package/dist/esm/files/scanning/clamav-scanner.backend.service.d.ts.map +1 -0
- package/dist/esm/files/scanning/clamav-scanner.backend.service.js +202 -0
- package/dist/esm/files/scanning/clamav-scanner.backend.service.js.map +1 -0
- package/dist/esm/files/scanning/file-scan.types.d.ts +17 -0
- package/dist/esm/files/scanning/file-scan.types.d.ts.map +1 -0
- package/dist/esm/files/scanning/file-scan.types.js +7 -0
- package/dist/esm/files/scanning/file-scan.types.js.map +1 -0
- package/dist/esm/files/scanning/yara-scanner.backend.service.d.ts +73 -0
- package/dist/esm/files/scanning/yara-scanner.backend.service.d.ts.map +1 -0
- package/dist/esm/files/scanning/yara-scanner.backend.service.js +184 -0
- package/dist/esm/files/scanning/yara-scanner.backend.service.js.map +1 -0
- package/dist/esm/files/services/__tests__/mock-file-field-detection.service.d.ts +12 -0
- package/dist/esm/files/services/__tests__/mock-file-field-detection.service.d.ts.map +1 -0
- package/dist/esm/files/services/__tests__/mock-file-field-detection.service.js +41 -0
- package/dist/esm/files/services/__tests__/mock-file-field-detection.service.js.map +1 -0
- package/dist/esm/files/services/__tests__/mock-file-operation-handler.service.d.ts +33 -0
- package/dist/esm/files/services/__tests__/mock-file-operation-handler.service.d.ts.map +1 -0
- package/dist/esm/files/services/__tests__/mock-file-operation-handler.service.js +71 -0
- package/dist/esm/files/services/__tests__/mock-file-operation-handler.service.js.map +1 -0
- package/dist/esm/files/services/__tests__/mock-file-repository.service.d.ts +16 -0
- package/dist/esm/files/services/__tests__/mock-file-repository.service.d.ts.map +1 -0
- package/dist/esm/files/services/__tests__/mock-file-repository.service.js +95 -0
- package/dist/esm/files/services/__tests__/mock-file-repository.service.js.map +1 -0
- package/dist/esm/files/services/file-field-detection.backend.service.d.ts +57 -0
- package/dist/esm/files/services/file-field-detection.backend.service.d.ts.map +1 -0
- package/dist/esm/files/services/file-field-detection.backend.service.js +145 -0
- package/dist/esm/files/services/file-field-detection.backend.service.js.map +1 -0
- package/dist/esm/files/services/file-operation-handler.backend.service.d.ts +103 -0
- package/dist/esm/files/services/file-operation-handler.backend.service.d.ts.map +1 -0
- package/dist/esm/files/services/file-operation-handler.backend.service.js +604 -0
- package/dist/esm/files/services/file-operation-handler.backend.service.js.map +1 -0
- package/dist/esm/files/services/file-population.backend.service.d.ts +73 -0
- package/dist/esm/files/services/file-population.backend.service.d.ts.map +1 -0
- package/dist/esm/files/services/file-population.backend.service.js +367 -0
- package/dist/esm/files/services/file-population.backend.service.js.map +1 -0
- package/dist/esm/files/services/file-rag-indexing.backend.service.d.ts +64 -0
- package/dist/esm/files/services/file-rag-indexing.backend.service.d.ts.map +1 -0
- package/dist/esm/files/services/file-rag-indexing.backend.service.js +188 -0
- package/dist/esm/files/services/file-rag-indexing.backend.service.js.map +1 -0
- package/dist/esm/files/services/file-scanning.backend.service.d.ts +97 -0
- package/dist/esm/files/services/file-scanning.backend.service.d.ts.map +1 -0
- package/dist/esm/files/services/file-scanning.backend.service.js +323 -0
- package/dist/esm/files/services/file-scanning.backend.service.js.map +1 -0
- package/dist/esm/files/services/file-text-extraction.backend.service.d.ts +52 -0
- package/dist/esm/files/services/file-text-extraction.backend.service.d.ts.map +1 -0
- package/dist/esm/files/services/file-text-extraction.backend.service.js +168 -0
- package/dist/esm/files/services/file-text-extraction.backend.service.js.map +1 -0
- package/dist/esm/files/services/files.backend.service.d.ts +235 -0
- package/dist/esm/files/services/files.backend.service.d.ts.map +1 -0
- package/dist/esm/files/services/files.backend.service.js +987 -0
- package/dist/esm/files/services/files.backend.service.js.map +1 -0
- package/dist/esm/files/storage/file-storage-path-resolver.backend.service.d.ts +50 -0
- package/dist/esm/files/storage/file-storage-path-resolver.backend.service.d.ts.map +1 -0
- package/dist/esm/files/storage/file-storage-path-resolver.backend.service.js +253 -0
- package/dist/esm/files/storage/file-storage-path-resolver.backend.service.js.map +1 -0
- package/dist/esm/files/storage/file-storage-provider.types.d.ts +156 -0
- package/dist/esm/files/storage/file-storage-provider.types.d.ts.map +1 -0
- package/dist/esm/files/storage/file-storage-provider.types.js +10 -0
- package/dist/esm/files/storage/file-storage-provider.types.js.map +1 -0
- package/dist/esm/files/storage/file-storage-router.backend.service.d.ts +68 -0
- package/dist/esm/files/storage/file-storage-router.backend.service.d.ts.map +1 -0
- package/dist/esm/files/storage/file-storage-router.backend.service.js +168 -0
- package/dist/esm/files/storage/file-storage-router.backend.service.js.map +1 -0
- package/dist/esm/files/storage/local-directory-storage-provider.backend.service.d.ts +57 -0
- package/dist/esm/files/storage/local-directory-storage-provider.backend.service.d.ts.map +1 -0
- package/dist/esm/files/storage/local-directory-storage-provider.backend.service.js +307 -0
- package/dist/esm/files/storage/local-directory-storage-provider.backend.service.js.map +1 -0
- package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.d.ts +41 -0
- package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.d.ts.map +1 -0
- package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.js +397 -0
- package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.js.map +1 -0
- package/dist/esm/files/utils/file-field-schema-path.backend.utils.d.ts +30 -0
- package/dist/esm/files/utils/file-field-schema-path.backend.utils.d.ts.map +1 -0
- package/dist/esm/files/utils/file-field-schema-path.backend.utils.js +251 -0
- package/dist/esm/files/utils/file-field-schema-path.backend.utils.js.map +1 -0
- package/dist/esm/files/utils/file-upload.utils.d.ts +74 -0
- package/dist/esm/files/utils/file-upload.utils.d.ts.map +1 -0
- package/dist/esm/files/utils/file-upload.utils.js +116 -0
- package/dist/esm/files/utils/file-upload.utils.js.map +1 -0
- package/dist/esm/files/utils/file-uploader.utils.d.ts +15 -0
- package/dist/esm/files/utils/file-uploader.utils.d.ts.map +1 -0
- package/dist/esm/files/utils/file-uploader.utils.js +47 -0
- package/dist/esm/files/utils/file-uploader.utils.js.map +1 -0
- package/dist/esm/files/utils/file-validation.utils.d.ts +111 -0
- package/dist/esm/files/utils/file-validation.utils.d.ts.map +1 -0
- package/dist/esm/files/utils/file-validation.utils.js +516 -0
- package/dist/esm/files/utils/file-validation.utils.js.map +1 -0
- package/dist/esm/flows-actors/agent-catalogs.backend.d.ts +222 -0
- package/dist/esm/flows-actors/agent-catalogs.backend.d.ts.map +1 -0
- package/dist/esm/flows-actors/agent-catalogs.backend.js +320 -0
- package/dist/esm/flows-actors/agent-catalogs.backend.js.map +1 -0
- package/dist/esm/flows-actors/controllers/flows-actors.controller.d.ts +33 -0
- package/dist/esm/flows-actors/controllers/flows-actors.controller.d.ts.map +1 -0
- package/dist/esm/flows-actors/controllers/flows-actors.controller.js +96 -0
- package/dist/esm/flows-actors/controllers/flows-actors.controller.js.map +1 -0
- package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.d.ts +225 -0
- package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.d.ts.map +1 -0
- package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.js +323 -0
- package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.js.map +1 -0
- package/dist/esm/flows-actors/models/agent-facets.backend.definitions.d.ts +77 -0
- package/dist/esm/flows-actors/models/agent-facets.backend.definitions.d.ts.map +1 -0
- package/dist/esm/flows-actors/models/agent-facets.backend.definitions.js +28 -0
- package/dist/esm/flows-actors/models/agent-facets.backend.definitions.js.map +1 -0
- package/dist/esm/flows-actors/models/agents.backend.definitions.d.ts +1 -0
- package/dist/esm/flows-actors/models/agents.backend.definitions.d.ts.map +1 -0
- package/dist/esm/flows-actors/models/agents.backend.definitions.js +1 -0
- package/dist/esm/flows-actors/models/agents.backend.definitions.js.map +1 -0
- package/dist/esm/flows-actors/models/core-facets.backend.definitions.d.ts +52 -0
- package/dist/esm/flows-actors/models/core-facets.backend.definitions.d.ts.map +1 -0
- package/dist/esm/flows-actors/models/core-facets.backend.definitions.js +307 -0
- package/dist/esm/flows-actors/models/core-facets.backend.definitions.js.map +1 -0
- package/dist/esm/flows-actors/models/flows-actors.backend.definitions.d.ts +7 -0
- package/dist/esm/flows-actors/models/flows-actors.backend.definitions.d.ts.map +1 -0
- package/dist/esm/flows-actors/models/flows-actors.backend.definitions.js +8 -0
- package/dist/esm/flows-actors/models/flows-actors.backend.definitions.js.map +1 -0
- package/dist/esm/flows-actors/models/flows-actors.backend.schemas.d.ts +30 -0
- package/dist/esm/flows-actors/models/flows-actors.backend.schemas.d.ts.map +1 -0
- package/dist/esm/flows-actors/models/flows-actors.backend.schemas.js +7 -0
- package/dist/esm/flows-actors/models/flows-actors.backend.schemas.js.map +1 -0
- package/dist/esm/flows-actors/services/actors-system.backend.service.d.ts +72 -0
- package/dist/esm/flows-actors/services/actors-system.backend.service.d.ts.map +1 -0
- package/dist/esm/flows-actors/services/actors-system.backend.service.js +229 -0
- package/dist/esm/flows-actors/services/actors-system.backend.service.js.map +1 -0
- package/dist/esm/flows-actors/services/agent-facets.backend.service.d.ts +95 -0
- package/dist/esm/flows-actors/services/agent-facets.backend.service.d.ts.map +1 -0
- package/dist/esm/flows-actors/services/agent-facets.backend.service.js +276 -0
- package/dist/esm/flows-actors/services/agent-facets.backend.service.js.map +1 -0
- package/dist/esm/flows-actors/services/agents.backend.service.d.ts +183 -0
- package/dist/esm/flows-actors/services/agents.backend.service.d.ts.map +1 -0
- package/dist/esm/flows-actors/services/agents.backend.service.js +2095 -0
- package/dist/esm/flows-actors/services/agents.backend.service.js.map +1 -0
- package/dist/esm/flows-actors/services/context-curation.backend.service.d.ts +64 -0
- package/dist/esm/flows-actors/services/context-curation.backend.service.d.ts.map +1 -0
- package/dist/esm/flows-actors/services/context-curation.backend.service.js +180 -0
- package/dist/esm/flows-actors/services/context-curation.backend.service.js.map +1 -0
- package/dist/esm/flows-actors/services/flows-actors-registry.service.d.ts +101 -0
- package/dist/esm/flows-actors/services/flows-actors-registry.service.d.ts.map +1 -0
- package/dist/esm/flows-actors/services/flows-actors-registry.service.js +313 -0
- package/dist/esm/flows-actors/services/flows-actors-registry.service.js.map +1 -0
- package/dist/esm/flows-actors/services/flows.backend.services.d.ts +64 -0
- package/dist/esm/flows-actors/services/flows.backend.services.d.ts.map +1 -0
- package/dist/esm/flows-actors/services/flows.backend.services.js +203 -0
- package/dist/esm/flows-actors/services/flows.backend.services.js.map +1 -0
- package/dist/esm/flows-actors/services/prompt-compiler.backend.service.d.ts +91 -0
- package/dist/esm/flows-actors/services/prompt-compiler.backend.service.d.ts.map +1 -0
- package/dist/esm/flows-actors/services/prompt-compiler.backend.service.js +629 -0
- package/dist/esm/flows-actors/services/prompt-compiler.backend.service.js.map +1 -0
- package/dist/esm/flows-actors/utils/cli-runtime-operation-support.backend.utils.d.ts +15 -0
- package/dist/esm/flows-actors/utils/cli-runtime-operation-support.backend.utils.d.ts.map +1 -0
- package/dist/esm/flows-actors/utils/cli-runtime-operation-support.backend.utils.js +55 -0
- package/dist/esm/flows-actors/utils/cli-runtime-operation-support.backend.utils.js.map +1 -0
- package/dist/esm/flows-actors/utils/cli-runtime-runner.backend.utils.d.ts +22 -0
- package/dist/esm/flows-actors/utils/cli-runtime-runner.backend.utils.d.ts.map +1 -0
- package/dist/esm/flows-actors/utils/cli-runtime-runner.backend.utils.js +131 -0
- package/dist/esm/flows-actors/utils/cli-runtime-runner.backend.utils.js.map +1 -0
- package/dist/esm/flows-actors/utils/flows-actors-frontend-extractor.utils.d.ts +15 -0
- package/dist/esm/flows-actors/utils/flows-actors-frontend-extractor.utils.d.ts.map +1 -0
- package/dist/esm/flows-actors/utils/flows-actors-frontend-extractor.utils.js +43 -0
- package/dist/esm/flows-actors/utils/flows-actors-frontend-extractor.utils.js.map +1 -0
- package/dist/esm/flows-actors/utils/prompt-ir-adapters.backend.utils.d.ts +66 -0
- package/dist/esm/flows-actors/utils/prompt-ir-adapters.backend.utils.d.ts.map +1 -0
- package/dist/esm/flows-actors/utils/prompt-ir-adapters.backend.utils.js +219 -0
- package/dist/esm/flows-actors/utils/prompt-ir-adapters.backend.utils.js.map +1 -0
- package/dist/esm/guidance/batches/dormancy-detection.batch.backend.service.d.ts +17 -0
- package/dist/esm/guidance/batches/dormancy-detection.batch.backend.service.d.ts.map +1 -0
- package/dist/esm/guidance/batches/dormancy-detection.batch.backend.service.js +110 -0
- package/dist/esm/guidance/batches/dormancy-detection.batch.backend.service.js.map +1 -0
- package/dist/esm/guidance/services/guidance-trigger-evaluator.backend.service.d.ts +41 -0
- package/dist/esm/guidance/services/guidance-trigger-evaluator.backend.service.d.ts.map +1 -0
- package/dist/esm/guidance/services/guidance-trigger-evaluator.backend.service.js +135 -0
- package/dist/esm/guidance/services/guidance-trigger-evaluator.backend.service.js.map +1 -0
- package/dist/esm/guidance/services/lifecycle-custom-implementations.backend.d.ts +33 -0
- package/dist/esm/guidance/services/lifecycle-custom-implementations.backend.d.ts.map +1 -0
- package/dist/esm/guidance/services/lifecycle-custom-implementations.backend.js +105 -0
- package/dist/esm/guidance/services/lifecycle-custom-implementations.backend.js.map +1 -0
- package/dist/esm/guidance/services/lifecycle-evaluator.backend.service.d.ts +103 -0
- package/dist/esm/guidance/services/lifecycle-evaluator.backend.service.d.ts.map +1 -0
- package/dist/esm/guidance/services/lifecycle-evaluator.backend.service.js +685 -0
- package/dist/esm/guidance/services/lifecycle-evaluator.backend.service.js.map +1 -0
- package/dist/esm/guidance/services/milestone-condition-registry.backend.service.d.ts +23 -0
- package/dist/esm/guidance/services/milestone-condition-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/guidance/services/milestone-condition-registry.backend.service.js +57 -0
- package/dist/esm/guidance/services/milestone-condition-registry.backend.service.js.map +1 -0
- package/dist/esm/guidance/services/milestone-definition-registry.backend.service.d.ts +49 -0
- package/dist/esm/guidance/services/milestone-definition-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/guidance/services/milestone-definition-registry.backend.service.js +248 -0
- package/dist/esm/guidance/services/milestone-definition-registry.backend.service.js.map +1 -0
- package/dist/esm/guidance/services/milestone-evaluator.backend.service.d.ts +64 -0
- package/dist/esm/guidance/services/milestone-evaluator.backend.service.d.ts.map +1 -0
- package/dist/esm/guidance/services/milestone-evaluator.backend.service.js +487 -0
- package/dist/esm/guidance/services/milestone-evaluator.backend.service.js.map +1 -0
- package/dist/esm/i18n/controllers/i18n-controller.backend.service.d.ts +55 -0
- package/dist/esm/i18n/controllers/i18n-controller.backend.service.d.ts.map +1 -0
- package/dist/esm/i18n/controllers/i18n-controller.backend.service.js +208 -0
- package/dist/esm/i18n/controllers/i18n-controller.backend.service.js.map +1 -0
- package/dist/esm/i18n/services/i18n.backend.service.d.ts +43 -0
- package/dist/esm/i18n/services/i18n.backend.service.d.ts.map +1 -0
- package/dist/esm/i18n/services/i18n.backend.service.js +83 -0
- package/dist/esm/i18n/services/i18n.backend.service.js.map +1 -0
- package/dist/esm/index.d.ts +203 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +239 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/inject/models/container.d.ts +44 -0
- package/dist/esm/inject/models/container.d.ts.map +1 -0
- package/dist/esm/inject/models/container.js +489 -0
- package/dist/esm/inject/models/container.js.map +1 -0
- package/dist/esm/inject/models/service-types.d.ts +198 -0
- package/dist/esm/inject/models/service-types.d.ts.map +1 -0
- package/dist/esm/inject/models/service-types.js +226 -0
- package/dist/esm/inject/models/service-types.js.map +1 -0
- package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.d.ts +34 -0
- package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.d.ts.map +1 -0
- package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.js +122 -0
- package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.js.map +1 -0
- package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.d.ts +41 -0
- package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.d.ts.map +1 -0
- package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.js +62 -0
- package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.js.map +1 -0
- package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.d.ts +18 -0
- package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.js +43 -0
- package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.js.map +1 -0
- package/dist/esm/monitoring/logger/middleware/logging.middleware.d.ts +12 -0
- package/dist/esm/monitoring/logger/middleware/logging.middleware.d.ts.map +1 -0
- package/dist/esm/monitoring/logger/middleware/logging.middleware.js +25 -0
- package/dist/esm/monitoring/logger/middleware/logging.middleware.js.map +1 -0
- package/dist/esm/monitoring/logger/models/logger.backend.schemas.d.ts +41 -0
- package/dist/esm/monitoring/logger/models/logger.backend.schemas.d.ts.map +1 -0
- package/dist/esm/monitoring/logger/models/logger.backend.schemas.js +29 -0
- package/dist/esm/monitoring/logger/models/logger.backend.schemas.js.map +1 -0
- package/dist/esm/monitoring/logger/services/__tests__/mock-logger.service.d.ts +22 -0
- package/dist/esm/monitoring/logger/services/__tests__/mock-logger.service.d.ts.map +1 -0
- package/dist/esm/monitoring/logger/services/__tests__/mock-logger.service.js +53 -0
- package/dist/esm/monitoring/logger/services/__tests__/mock-logger.service.js.map +1 -0
- package/dist/esm/monitoring/logger/services/logger.service.d.ts +37 -0
- package/dist/esm/monitoring/logger/services/logger.service.d.ts.map +1 -0
- package/dist/esm/monitoring/logger/services/logger.service.js +189 -0
- package/dist/esm/monitoring/logger/services/logger.service.js.map +1 -0
- package/dist/esm/monitoring/observability/middleware/metrics.middleware.d.ts +38 -0
- package/dist/esm/monitoring/observability/middleware/metrics.middleware.d.ts.map +1 -0
- package/dist/esm/monitoring/observability/middleware/metrics.middleware.js +147 -0
- package/dist/esm/monitoring/observability/middleware/metrics.middleware.js.map +1 -0
- package/dist/esm/monitoring/observability/middleware/telemetry.middleware.d.ts +26 -0
- package/dist/esm/monitoring/observability/middleware/telemetry.middleware.d.ts.map +1 -0
- package/dist/esm/monitoring/observability/middleware/telemetry.middleware.js +117 -0
- package/dist/esm/monitoring/observability/middleware/telemetry.middleware.js.map +1 -0
- package/dist/esm/monitoring/observability/middleware/tracing.middleware.d.ts +28 -0
- package/dist/esm/monitoring/observability/middleware/tracing.middleware.d.ts.map +1 -0
- package/dist/esm/monitoring/observability/middleware/tracing.middleware.js +182 -0
- package/dist/esm/monitoring/observability/middleware/tracing.middleware.js.map +1 -0
- package/dist/esm/monitoring/observability/models/observability.backend.schemas.d.ts +86 -0
- package/dist/esm/monitoring/observability/models/observability.backend.schemas.d.ts.map +1 -0
- package/dist/esm/monitoring/observability/models/observability.backend.schemas.js +1 -0
- package/dist/esm/monitoring/observability/models/observability.backend.schemas.js.map +1 -0
- package/dist/esm/monitoring/observability/services/instrumentations/custom.instrumentations.d.ts +57 -0
- package/dist/esm/monitoring/observability/services/instrumentations/custom.instrumentations.d.ts.map +1 -0
- package/dist/esm/monitoring/observability/services/instrumentations/custom.instrumentations.js +77 -0
- package/dist/esm/monitoring/observability/services/instrumentations/custom.instrumentations.js.map +1 -0
- package/dist/esm/monitoring/observability/services/metrics.service.d.ts +27 -0
- package/dist/esm/monitoring/observability/services/metrics.service.d.ts.map +1 -0
- package/dist/esm/monitoring/observability/services/metrics.service.js +236 -0
- package/dist/esm/monitoring/observability/services/metrics.service.js.map +1 -0
- package/dist/esm/monitoring/observability/services/telemetry.service.d.ts +28 -0
- package/dist/esm/monitoring/observability/services/telemetry.service.d.ts.map +1 -0
- package/dist/esm/monitoring/observability/services/telemetry.service.js +144 -0
- package/dist/esm/monitoring/observability/services/telemetry.service.js.map +1 -0
- package/dist/esm/monitoring/observability/services/tracer.service.d.ts +24 -0
- package/dist/esm/monitoring/observability/services/tracer.service.d.ts.map +1 -0
- package/dist/esm/monitoring/observability/services/tracer.service.js +287 -0
- package/dist/esm/monitoring/observability/services/tracer.service.js.map +1 -0
- package/dist/esm/notifications/email/components/email-components.d.ts +90 -0
- package/dist/esm/notifications/email/components/email-components.d.ts.map +1 -0
- package/dist/esm/notifications/email/components/email-components.js +171 -0
- package/dist/esm/notifications/email/components/email-components.js.map +1 -0
- package/dist/esm/notifications/email/models/email-context-provider.interface.d.ts +80 -0
- package/dist/esm/notifications/email/models/email-context-provider.interface.d.ts.map +1 -0
- package/dist/esm/notifications/email/models/email-context-provider.interface.js +25 -0
- package/dist/esm/notifications/email/models/email-context-provider.interface.js.map +1 -0
- package/dist/esm/notifications/email/models/email-template-definition.d.ts +68 -0
- package/dist/esm/notifications/email/models/email-template-definition.d.ts.map +1 -0
- package/dist/esm/notifications/email/models/email-template-definition.js +12 -0
- package/dist/esm/notifications/email/models/email-template-definition.js.map +1 -0
- package/dist/esm/notifications/email/models/email-template.actors-system.backend.definitions.d.ts +19 -0
- package/dist/esm/notifications/email/models/email-template.actors-system.backend.definitions.d.ts.map +1 -0
- package/dist/esm/notifications/email/models/email-template.actors-system.backend.definitions.js +66 -0
- package/dist/esm/notifications/email/models/email-template.actors-system.backend.definitions.js.map +1 -0
- package/dist/esm/notifications/email/models/email.backend.scheamas.d.ts +1 -0
- package/dist/esm/notifications/email/models/email.backend.scheamas.d.ts.map +1 -0
- package/dist/esm/notifications/email/models/email.backend.scheamas.js +1 -0
- package/dist/esm/notifications/email/models/email.backend.scheamas.js.map +1 -0
- package/dist/esm/notifications/email/services/email-batch-send.batch.backend.service.d.ts +74 -0
- package/dist/esm/notifications/email/services/email-batch-send.batch.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/email/services/email-batch-send.batch.backend.service.js +196 -0
- package/dist/esm/notifications/email/services/email-batch-send.batch.backend.service.js.map +1 -0
- package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.d.ts +49 -0
- package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.js +141 -0
- package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.js.map +1 -0
- package/dist/esm/notifications/email/services/email-renderer.backend.service.d.ts +74 -0
- package/dist/esm/notifications/email/services/email-renderer.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/email/services/email-renderer.backend.service.js +215 -0
- package/dist/esm/notifications/email/services/email-renderer.backend.service.js.map +1 -0
- package/dist/esm/notifications/email/services/email-template-compiler.backend.service.d.ts +37 -0
- package/dist/esm/notifications/email/services/email-template-compiler.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/email/services/email-template-compiler.backend.service.js +121 -0
- package/dist/esm/notifications/email/services/email-template-compiler.backend.service.js.map +1 -0
- package/dist/esm/notifications/email/services/email-template-generation.backend.service.d.ts +115 -0
- package/dist/esm/notifications/email/services/email-template-generation.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/email/services/email-template-generation.backend.service.js +634 -0
- package/dist/esm/notifications/email/services/email-template-generation.backend.service.js.map +1 -0
- package/dist/esm/notifications/email/services/email-template-registry.backend.service.d.ts +48 -0
- package/dist/esm/notifications/email/services/email-template-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/email/services/email-template-registry.backend.service.js +146 -0
- package/dist/esm/notifications/email/services/email-template-registry.backend.service.js.map +1 -0
- package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.d.ts +58 -0
- package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.js +223 -0
- package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.js.map +1 -0
- package/dist/esm/notifications/email/services/email-template-validator.backend.service.d.ts +49 -0
- package/dist/esm/notifications/email/services/email-template-validator.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/email/services/email-template-validator.backend.service.js +204 -0
- package/dist/esm/notifications/email/services/email-template-validator.backend.service.js.map +1 -0
- package/dist/esm/notifications/email/services/email.backend.service.d.ts +76 -0
- package/dist/esm/notifications/email/services/email.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/email/services/email.backend.service.js +294 -0
- package/dist/esm/notifications/email/services/email.backend.service.js.map +1 -0
- package/dist/esm/notifications/email/utils/color-conversion.utils.d.ts +56 -0
- package/dist/esm/notifications/email/utils/color-conversion.utils.d.ts.map +1 -0
- package/dist/esm/notifications/email/utils/color-conversion.utils.js +108 -0
- package/dist/esm/notifications/email/utils/color-conversion.utils.js.map +1 -0
- package/dist/esm/notifications/email/utils/interpolate-email-label.utils.d.ts +8 -0
- package/dist/esm/notifications/email/utils/interpolate-email-label.utils.d.ts.map +1 -0
- package/dist/esm/notifications/email/utils/interpolate-email-label.utils.js +15 -0
- package/dist/esm/notifications/email/utils/interpolate-email-label.utils.js.map +1 -0
- package/dist/esm/notifications/email/utils/zod-to-typescript.utils.d.ts +50 -0
- package/dist/esm/notifications/email/utils/zod-to-typescript.utils.d.ts.map +1 -0
- package/dist/esm/notifications/email/utils/zod-to-typescript.utils.js +281 -0
- package/dist/esm/notifications/email/utils/zod-to-typescript.utils.js.map +1 -0
- package/dist/esm/notifications/services/notification-badge.backend.service.d.ts +94 -0
- package/dist/esm/notifications/services/notification-badge.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/services/notification-badge.backend.service.js +292 -0
- package/dist/esm/notifications/services/notification-badge.backend.service.js.map +1 -0
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.d.ts +202 -0
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.js +1290 -0
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.js.map +1 -0
- package/dist/esm/notifications/sms/services/sms.backend.service.d.ts +50 -0
- package/dist/esm/notifications/sms/services/sms.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/sms/services/sms.backend.service.js +209 -0
- package/dist/esm/notifications/sms/services/sms.backend.service.js.map +1 -0
- package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.d.ts +58 -0
- package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.js +184 -0
- package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.js.map +1 -0
- package/dist/esm/notifications/webhooks/services/polymorphic-lookup.backend.service.d.ts +56 -0
- package/dist/esm/notifications/webhooks/services/polymorphic-lookup.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/webhooks/services/polymorphic-lookup.backend.service.js +109 -0
- package/dist/esm/notifications/webhooks/services/polymorphic-lookup.backend.service.js.map +1 -0
- package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.d.ts +96 -0
- package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.js +396 -0
- package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.js.map +1 -0
- package/dist/esm/organizations/services/org-creation-on-registration.backend.utils.d.ts +39 -0
- package/dist/esm/organizations/services/org-creation-on-registration.backend.utils.d.ts.map +1 -0
- package/dist/esm/organizations/services/org-creation-on-registration.backend.utils.js +73 -0
- package/dist/esm/organizations/services/org-creation-on-registration.backend.utils.js.map +1 -0
- package/dist/esm/organizations/services/org-member-roles-validation.backend.utils.d.ts +22 -0
- package/dist/esm/organizations/services/org-member-roles-validation.backend.utils.d.ts.map +1 -0
- package/dist/esm/organizations/services/org-member-roles-validation.backend.utils.js +35 -0
- package/dist/esm/organizations/services/org-member-roles-validation.backend.utils.js.map +1 -0
- package/dist/esm/organizations/services/organization-custom-implementation.backend.service.d.ts +10 -0
- package/dist/esm/organizations/services/organization-custom-implementation.backend.service.d.ts.map +1 -0
- package/dist/esm/organizations/services/organization-custom-implementation.backend.service.js +77 -0
- package/dist/esm/organizations/services/organization-custom-implementation.backend.service.js.map +1 -0
- package/dist/esm/organizations/services/organization-member-custom-implementation.backend.service.d.ts +10 -0
- package/dist/esm/organizations/services/organization-member-custom-implementation.backend.service.d.ts.map +1 -0
- package/dist/esm/organizations/services/organization-member-custom-implementation.backend.service.js +131 -0
- package/dist/esm/organizations/services/organization-member-custom-implementation.backend.service.js.map +1 -0
- package/dist/esm/organizations/services/scim-provisioning-gate.backend.utils.d.ts +22 -0
- package/dist/esm/organizations/services/scim-provisioning-gate.backend.utils.d.ts.map +1 -0
- package/dist/esm/organizations/services/scim-provisioning-gate.backend.utils.js +21 -0
- package/dist/esm/organizations/services/scim-provisioning-gate.backend.utils.js.map +1 -0
- package/dist/esm/organizations/services/user-org-type-grant.backend.utils.d.ts +25 -0
- package/dist/esm/organizations/services/user-org-type-grant.backend.utils.d.ts.map +1 -0
- package/dist/esm/organizations/services/user-org-type-grant.backend.utils.js +34 -0
- package/dist/esm/organizations/services/user-org-type-grant.backend.utils.js.map +1 -0
- package/dist/esm/organizations/services/user-type-revocation-on-org-leave.backend.utils.d.ts +32 -0
- package/dist/esm/organizations/services/user-type-revocation-on-org-leave.backend.utils.d.ts.map +1 -0
- package/dist/esm/organizations/services/user-type-revocation-on-org-leave.backend.utils.js +66 -0
- package/dist/esm/organizations/services/user-type-revocation-on-org-leave.backend.utils.js.map +1 -0
- package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.d.ts +126 -0
- package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.js +370 -0
- package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.js.map +1 -0
- package/dist/esm/queue/apps-crontabs-manager.backend.service.d.ts +86 -0
- package/dist/esm/queue/apps-crontabs-manager.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/apps-crontabs-manager.backend.service.js +176 -0
- package/dist/esm/queue/apps-crontabs-manager.backend.service.js.map +1 -0
- package/dist/esm/queue/cron-job-sync.backend.service.d.ts +42 -0
- package/dist/esm/queue/cron-job-sync.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/cron-job-sync.backend.service.js +181 -0
- package/dist/esm/queue/cron-job-sync.backend.service.js.map +1 -0
- package/dist/esm/queue/domain-queue-consumer.backend.service.d.ts +84 -0
- package/dist/esm/queue/domain-queue-consumer.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/domain-queue-consumer.backend.service.js +275 -0
- package/dist/esm/queue/domain-queue-consumer.backend.service.js.map +1 -0
- package/dist/esm/queue/job-completion-registry.backend.service.d.ts +111 -0
- package/dist/esm/queue/job-completion-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/job-completion-registry.backend.service.js +237 -0
- package/dist/esm/queue/job-completion-registry.backend.service.js.map +1 -0
- package/dist/esm/queue/job-consumer.backend.service.d.ts +109 -0
- package/dist/esm/queue/job-consumer.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/job-consumer.backend.service.js +515 -0
- package/dist/esm/queue/job-consumer.backend.service.js.map +1 -0
- package/dist/esm/queue/job-executor.backend.service.d.ts +53 -0
- package/dist/esm/queue/job-executor.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/job-executor.backend.service.js +278 -0
- package/dist/esm/queue/job-executor.backend.service.js.map +1 -0
- package/dist/esm/queue/job-payload-storage.backend.service.d.ts +86 -0
- package/dist/esm/queue/job-payload-storage.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/job-payload-storage.backend.service.js +250 -0
- package/dist/esm/queue/job-payload-storage.backend.service.js.map +1 -0
- package/dist/esm/queue/job-status-tracking.backend.service.d.ts +97 -0
- package/dist/esm/queue/job-status-tracking.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/job-status-tracking.backend.service.js +281 -0
- package/dist/esm/queue/job-status-tracking.backend.service.js.map +1 -0
- package/dist/esm/queue/queue-monitoring.backend.service.d.ts +71 -0
- package/dist/esm/queue/queue-monitoring.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/queue-monitoring.backend.service.js +297 -0
- package/dist/esm/queue/queue-monitoring.backend.service.js.map +1 -0
- package/dist/esm/queue/queue-worker-initializer.backend.service.d.ts +63 -0
- package/dist/esm/queue/queue-worker-initializer.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/queue-worker-initializer.backend.service.js +171 -0
- package/dist/esm/queue/queue-worker-initializer.backend.service.js.map +1 -0
- package/dist/esm/queue/queue.backend.service.d.ts +108 -0
- package/dist/esm/queue/queue.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/queue.backend.service.js +419 -0
- package/dist/esm/queue/queue.backend.service.js.map +1 -0
- package/dist/esm/queue/scheduled-message-verifier.backend.service.d.ts +74 -0
- package/dist/esm/queue/scheduled-message-verifier.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/scheduled-message-verifier.backend.service.js +189 -0
- package/dist/esm/queue/scheduled-message-verifier.backend.service.js.map +1 -0
- package/dist/esm/queue/worker-shutdown-manager.backend.service.d.ts +124 -0
- package/dist/esm/queue/worker-shutdown-manager.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/worker-shutdown-manager.backend.service.js +250 -0
- package/dist/esm/queue/worker-shutdown-manager.backend.service.js.map +1 -0
- package/dist/esm/requests/models/api-routes.backend.defintions.d.ts +34 -0
- package/dist/esm/requests/models/api-routes.backend.defintions.d.ts.map +1 -0
- package/dist/esm/requests/models/api-routes.backend.defintions.js +42 -0
- package/dist/esm/requests/models/api-routes.backend.defintions.js.map +1 -0
- package/dist/esm/requests/models/requests.backend.schemas.d.ts +48 -0
- package/dist/esm/requests/models/requests.backend.schemas.d.ts.map +1 -0
- package/dist/esm/requests/models/requests.backend.schemas.js +7 -0
- package/dist/esm/requests/models/requests.backend.schemas.js.map +1 -0
- package/dist/esm/requests/service/__tests__/mock-apps-shared-resources-gateway.service.d.ts +6 -0
- package/dist/esm/requests/service/__tests__/mock-apps-shared-resources-gateway.service.d.ts.map +1 -0
- package/dist/esm/requests/service/__tests__/mock-apps-shared-resources-gateway.service.js +20 -0
- package/dist/esm/requests/service/__tests__/mock-apps-shared-resources-gateway.service.js.map +1 -0
- package/dist/esm/requests/service/apps-shared-resources-gateway.backend.service.d.ts +84 -0
- package/dist/esm/requests/service/apps-shared-resources-gateway.backend.service.d.ts.map +1 -0
- package/dist/esm/requests/service/apps-shared-resources-gateway.backend.service.js +462 -0
- package/dist/esm/requests/service/apps-shared-resources-gateway.backend.service.js.map +1 -0
- package/dist/esm/requests/service/platform-mutualized-handler.backend.service.d.ts +9 -0
- package/dist/esm/requests/service/platform-mutualized-handler.backend.service.d.ts.map +1 -0
- package/dist/esm/requests/service/platform-mutualized-handler.backend.service.js +36 -0
- package/dist/esm/requests/service/platform-mutualized-handler.backend.service.js.map +1 -0
- package/dist/esm/requests/service/platform-requests.backend.utils.d.ts +6 -0
- package/dist/esm/requests/service/platform-requests.backend.utils.d.ts.map +1 -0
- package/dist/esm/requests/service/platform-requests.backend.utils.js +47 -0
- package/dist/esm/requests/service/platform-requests.backend.utils.js.map +1 -0
- package/dist/esm/requests/service/remote-client-base.backend.service.d.ts +111 -0
- package/dist/esm/requests/service/remote-client-base.backend.service.d.ts.map +1 -0
- package/dist/esm/requests/service/remote-client-base.backend.service.js +354 -0
- package/dist/esm/requests/service/remote-client-base.backend.service.js.map +1 -0
- package/dist/esm/requests/service/serverless-services-handler.backend.service.d.ts +9 -0
- package/dist/esm/requests/service/serverless-services-handler.backend.service.d.ts.map +1 -0
- package/dist/esm/requests/service/serverless-services-handler.backend.service.js +36 -0
- package/dist/esm/requests/service/serverless-services-handler.backend.service.js.map +1 -0
- package/dist/esm/requests/service/websocket.service.d.ts +507 -0
- package/dist/esm/requests/service/websocket.service.d.ts.map +1 -0
- package/dist/esm/requests/service/websocket.service.js +2222 -0
- package/dist/esm/requests/service/websocket.service.js.map +1 -0
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.d.ts +3 -0
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.d.ts.map +1 -0
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.js +17 -0
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.js.map +1 -0
- package/dist/esm/resources/models/index.d.ts +7 -0
- package/dist/esm/resources/models/index.d.ts.map +1 -0
- package/dist/esm/resources/models/index.js +7 -0
- package/dist/esm/resources/models/index.js.map +1 -0
- package/dist/esm/resources/models/resources-operations.backend.definitions.d.ts +4 -0
- package/dist/esm/resources/models/resources-operations.backend.definitions.d.ts.map +1 -0
- package/dist/esm/resources/models/resources-operations.backend.definitions.js +7 -0
- package/dist/esm/resources/models/resources-operations.backend.definitions.js.map +1 -0
- package/dist/esm/resources/models/resources-relationships.backend.definitions.d.ts +3 -0
- package/dist/esm/resources/models/resources-relationships.backend.definitions.d.ts.map +1 -0
- package/dist/esm/resources/models/resources-relationships.backend.definitions.js +19 -0
- package/dist/esm/resources/models/resources-relationships.backend.definitions.js.map +1 -0
- package/dist/esm/resources/models/resources-types.backend.schemas.d.ts +13 -0
- package/dist/esm/resources/models/resources-types.backend.schemas.d.ts.map +1 -0
- package/dist/esm/resources/models/resources-types.backend.schemas.js +14 -0
- package/dist/esm/resources/models/resources-types.backend.schemas.js.map +1 -0
- package/dist/esm/resources/models/resources.backend.schemas.d.ts +7 -0
- package/dist/esm/resources/models/resources.backend.schemas.d.ts.map +1 -0
- package/dist/esm/resources/models/resources.backend.schemas.js +8 -0
- package/dist/esm/resources/models/resources.backend.schemas.js.map +1 -0
- package/dist/esm/resources/models/virtual-fields.backend.types.d.ts +121 -0
- package/dist/esm/resources/models/virtual-fields.backend.types.d.ts.map +1 -0
- package/dist/esm/resources/models/virtual-fields.backend.types.js +10 -0
- package/dist/esm/resources/models/virtual-fields.backend.types.js.map +1 -0
- package/dist/esm/resources/services/__tests__/mock-resources-registry.service.d.ts +25 -0
- package/dist/esm/resources/services/__tests__/mock-resources-registry.service.d.ts.map +1 -0
- package/dist/esm/resources/services/__tests__/mock-resources-registry.service.js +59 -0
- package/dist/esm/resources/services/__tests__/mock-resources-registry.service.js.map +1 -0
- package/dist/esm/resources/services/resource-context.backend.service.d.ts +321 -0
- package/dist/esm/resources/services/resource-context.backend.service.d.ts.map +1 -0
- package/dist/esm/resources/services/resource-context.backend.service.js +723 -0
- package/dist/esm/resources/services/resource-context.backend.service.js.map +1 -0
- package/dist/esm/resources/services/resource-id.backend.service.d.ts +110 -0
- package/dist/esm/resources/services/resource-id.backend.service.d.ts.map +1 -0
- package/dist/esm/resources/services/resource-id.backend.service.js +267 -0
- package/dist/esm/resources/services/resource-id.backend.service.js.map +1 -0
- package/dist/esm/resources/services/resource-population.backend.service.d.ts +149 -0
- package/dist/esm/resources/services/resource-population.backend.service.d.ts.map +1 -0
- package/dist/esm/resources/services/resource-population.backend.service.js +543 -0
- package/dist/esm/resources/services/resource-population.backend.service.js.map +1 -0
- package/dist/esm/resources/services/resources-registry.backend.service.d.ts +151 -0
- package/dist/esm/resources/services/resources-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/resources/services/resources-registry.backend.service.js +867 -0
- package/dist/esm/resources/services/resources-registry.backend.service.js.map +1 -0
- package/dist/esm/resources/services/virtual-fields.backend.service.d.ts +72 -0
- package/dist/esm/resources/services/virtual-fields.backend.service.d.ts.map +1 -0
- package/dist/esm/resources/services/virtual-fields.backend.service.js +254 -0
- package/dist/esm/resources/services/virtual-fields.backend.service.js.map +1 -0
- package/dist/esm/runtime/controllers/health-controller.backend.service.d.ts +73 -0
- package/dist/esm/runtime/controllers/health-controller.backend.service.d.ts.map +1 -0
- package/dist/esm/runtime/controllers/health-controller.backend.service.js +275 -0
- package/dist/esm/runtime/controllers/health-controller.backend.service.js.map +1 -0
- package/dist/esm/runtime/domain-module.backend.definitions.d.ts +43 -0
- package/dist/esm/runtime/domain-module.backend.definitions.d.ts.map +1 -0
- package/dist/esm/runtime/domain-module.backend.definitions.js +70 -0
- package/dist/esm/runtime/domain-module.backend.definitions.js.map +1 -0
- package/dist/esm/runtime/models/execution-context.backend.schemas.d.ts +253 -0
- package/dist/esm/runtime/models/execution-context.backend.schemas.d.ts.map +1 -0
- package/dist/esm/runtime/models/execution-context.backend.schemas.js +329 -0
- package/dist/esm/runtime/models/execution-context.backend.schemas.js.map +1 -0
- package/dist/esm/runtime/models/runtime.backend.schemas.d.ts +45 -0
- package/dist/esm/runtime/models/runtime.backend.schemas.d.ts.map +1 -0
- package/dist/esm/runtime/models/runtime.backend.schemas.js +73 -0
- package/dist/esm/runtime/models/runtime.backend.schemas.js.map +1 -0
- package/dist/esm/runtime/services/execution-context-creator.backend.service.d.ts +315 -0
- package/dist/esm/runtime/services/execution-context-creator.backend.service.d.ts.map +1 -0
- package/dist/esm/runtime/services/execution-context-creator.backend.service.js +1525 -0
- package/dist/esm/runtime/services/execution-context-creator.backend.service.js.map +1 -0
- package/dist/esm/runtime/services/execution-context-handler.backend.service.d.ts +60 -0
- package/dist/esm/runtime/services/execution-context-handler.backend.service.d.ts.map +1 -0
- package/dist/esm/runtime/services/execution-context-handler.backend.service.js +150 -0
- package/dist/esm/runtime/services/execution-context-handler.backend.service.js.map +1 -0
- package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.d.ts +11 -0
- package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.d.ts.map +1 -0
- package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.js +1 -0
- package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.js.map +1 -0
- package/dist/esm/runtime/services/http-server.backend.service.d.ts +188 -0
- package/dist/esm/runtime/services/http-server.backend.service.d.ts.map +1 -0
- package/dist/esm/runtime/services/http-server.backend.service.js +755 -0
- package/dist/esm/runtime/services/http-server.backend.service.js.map +1 -0
- package/dist/esm/runtime/services/start-application.backend.service.d.ts +240 -0
- package/dist/esm/runtime/services/start-application.backend.service.d.ts.map +1 -0
- package/dist/esm/runtime/services/start-application.backend.service.js +977 -0
- package/dist/esm/runtime/services/start-application.backend.service.js.map +1 -0
- package/dist/esm/runtime/testing/execution-context-test-fixtures.d.ts +10 -0
- package/dist/esm/runtime/testing/execution-context-test-fixtures.d.ts.map +1 -0
- package/dist/esm/runtime/testing/execution-context-test-fixtures.js +13 -0
- package/dist/esm/runtime/testing/execution-context-test-fixtures.js.map +1 -0
- package/dist/esm/runtime/testing/mock-execution-context-creator.service.d.ts +15 -0
- package/dist/esm/runtime/testing/mock-execution-context-creator.service.d.ts.map +1 -0
- package/dist/esm/runtime/testing/mock-execution-context-creator.service.js +42 -0
- package/dist/esm/runtime/testing/mock-execution-context-creator.service.js.map +1 -0
- package/dist/esm/runtime/utils/scan-default-exports.backend.utils.d.ts +85 -0
- package/dist/esm/runtime/utils/scan-default-exports.backend.utils.d.ts.map +1 -0
- package/dist/esm/runtime/utils/scan-default-exports.backend.utils.js +171 -0
- package/dist/esm/runtime/utils/scan-default-exports.backend.utils.js.map +1 -0
- package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.d.ts +19 -0
- package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.js +59 -0
- package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/controllers/auth-method-management-controller.backend.service.d.ts +31 -0
- package/dist/esm/security/authentications/controllers/auth-method-management-controller.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/controllers/auth-method-management-controller.backend.service.js +215 -0
- package/dist/esm/security/authentications/controllers/auth-method-management-controller.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.d.ts +493 -0
- package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.js +2371 -0
- package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/models/auth-constants.backend.d.ts +83 -0
- package/dist/esm/security/authentications/models/auth-constants.backend.d.ts.map +1 -0
- package/dist/esm/security/authentications/models/auth-constants.backend.js +113 -0
- package/dist/esm/security/authentications/models/auth-constants.backend.js.map +1 -0
- package/dist/esm/security/authentications/models/authentications.backend.schemas.d.ts +98 -0
- package/dist/esm/security/authentications/models/authentications.backend.schemas.d.ts.map +1 -0
- package/dist/esm/security/authentications/models/authentications.backend.schemas.js +59 -0
- package/dist/esm/security/authentications/models/authentications.backend.schemas.js.map +1 -0
- package/dist/esm/security/authentications/models/jwt.backend.schemas.d.ts +42 -0
- package/dist/esm/security/authentications/models/jwt.backend.schemas.d.ts.map +1 -0
- package/dist/esm/security/authentications/models/jwt.backend.schemas.js +98 -0
- package/dist/esm/security/authentications/models/jwt.backend.schemas.js.map +1 -0
- package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.d.ts +163 -0
- package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.d.ts.map +1 -0
- package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.js +12 -0
- package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.js.map +1 -0
- package/dist/esm/security/authentications/models/saml-authentication.backend.schemas.d.ts +102 -0
- package/dist/esm/security/authentications/models/saml-authentication.backend.schemas.d.ts.map +1 -0
- package/dist/esm/security/authentications/models/saml-authentication.backend.schemas.js +7 -0
- package/dist/esm/security/authentications/models/saml-authentication.backend.schemas.js.map +1 -0
- package/dist/esm/security/authentications/models/sso-connection.backend.schemas.d.ts +88 -0
- package/dist/esm/security/authentications/models/sso-connection.backend.schemas.d.ts.map +1 -0
- package/dist/esm/security/authentications/models/sso-connection.backend.schemas.js +17 -0
- package/dist/esm/security/authentications/models/sso-connection.backend.schemas.js.map +1 -0
- package/dist/esm/security/authentications/services/__tests__/mock-auth-execution-context-factory.service.d.ts +27 -0
- package/dist/esm/security/authentications/services/__tests__/mock-auth-execution-context-factory.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/__tests__/mock-auth-execution-context-factory.service.js +66 -0
- package/dist/esm/security/authentications/services/__tests__/mock-auth-execution-context-factory.service.js.map +1 -0
- package/dist/esm/security/authentications/services/__tests__/mock-auth-token-issuer.service.d.ts +30 -0
- package/dist/esm/security/authentications/services/__tests__/mock-auth-token-issuer.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/__tests__/mock-auth-token-issuer.service.js +44 -0
- package/dist/esm/security/authentications/services/__tests__/mock-auth-token-issuer.service.js.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/__tests__/mock-domain-to-org-lookup.service.d.ts +19 -0
- package/dist/esm/security/authentications/services/admin-config/__tests__/mock-domain-to-org-lookup.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/__tests__/mock-domain-to-org-lookup.service.js +43 -0
- package/dist/esm/security/authentications/services/admin-config/__tests__/mock-domain-to-org-lookup.service.js.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/__tests__/mock-enterprise-user-provisioning.service.d.ts +37 -0
- package/dist/esm/security/authentications/services/admin-config/__tests__/mock-enterprise-user-provisioning.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/__tests__/mock-enterprise-user-provisioning.service.js +58 -0
- package/dist/esm/security/authentications/services/admin-config/__tests__/mock-enterprise-user-provisioning.service.js.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.d.ts +85 -0
- package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.js +379 -0
- package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.js.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.d.ts +79 -0
- package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.js +205 -0
- package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.d.ts +59 -0
- package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.js +179 -0
- package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.d.ts +116 -0
- package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.js +436 -0
- package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/oidc-discovery.backend.service.d.ts +67 -0
- package/dist/esm/security/authentications/services/admin-config/oidc-discovery.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/oidc-discovery.backend.service.js +222 -0
- package/dist/esm/security/authentications/services/admin-config/oidc-discovery.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/anonymous-session.backend.service.d.ts +80 -0
- package/dist/esm/security/authentications/services/anonymous-session.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/anonymous-session.backend.service.js +368 -0
- package/dist/esm/security/authentications/services/anonymous-session.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-credential-verifier.backend.service.d.ts +75 -0
- package/dist/esm/security/authentications/services/auth-credential-verifier.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-credential-verifier.backend.service.js +139 -0
- package/dist/esm/security/authentications/services/auth-credential-verifier.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-execution-context-factory.backend.service.d.ts +72 -0
- package/dist/esm/security/authentications/services/auth-execution-context-factory.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-execution-context-factory.backend.service.js +127 -0
- package/dist/esm/security/authentications/services/auth-execution-context-factory.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.d.ts +57 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.js +459 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.d.ts +44 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.js +131 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-password-reset.backend.service.d.ts +58 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-password-reset.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-password-reset.backend.service.js +209 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-password-reset.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-phone-verification.backend.service.d.ts +46 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-phone-verification.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-phone-verification.backend.service.js +124 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-phone-verification.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.d.ts +165 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.js +816 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.d.ts +218 -0
- package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.js +1026 -0
- package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.d.ts +150 -0
- package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.js +737 -0
- package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-assertion-validator.backend.service.d.ts +224 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-assertion-validator.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-assertion-validator.backend.service.js +593 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-assertion-validator.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-authentication.backend.service.d.ts +267 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-authentication.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-authentication.backend.service.js +1376 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-authentication.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-metadata.backend.service.d.ts +93 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-metadata.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-metadata.backend.service.js +396 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-metadata.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-replay-guard.backend.service.d.ts +40 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-replay-guard.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-replay-guard.backend.service.js +92 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-replay-guard.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.d.ts +82 -0
- package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.js +325 -0
- package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-session-store.backend.service.d.ts +66 -0
- package/dist/esm/security/authentications/services/auth-session-store.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-session-store.backend.service.js +198 -0
- package/dist/esm/security/authentications/services/auth-session-store.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.d.ts +108 -0
- package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.js +406 -0
- package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.d.ts +366 -0
- package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.js +2631 -0
- package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.d.ts +13 -0
- package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.js +53 -0
- package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.js.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/auth-policy.custom-impl.backend.service.d.ts +12 -0
- package/dist/esm/security/authentications/services/custom-impls/auth-policy.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/auth-policy.custom-impl.backend.service.js +41 -0
- package/dist/esm/security/authentications/services/custom-impls/auth-policy.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/scim-provisioning-config.custom-impl.backend.service.d.ts +18 -0
- package/dist/esm/security/authentications/services/custom-impls/scim-provisioning-config.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/scim-provisioning-config.custom-impl.backend.service.js +140 -0
- package/dist/esm/security/authentications/services/custom-impls/scim-provisioning-config.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/scim-tokens.custom-impl.backend.service.d.ts +16 -0
- package/dist/esm/security/authentications/services/custom-impls/scim-tokens.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/scim-tokens.custom-impl.backend.service.js +112 -0
- package/dist/esm/security/authentications/services/custom-impls/scim-tokens.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/siem-delivery-dlq.custom-impl.backend.service.d.ts +16 -0
- package/dist/esm/security/authentications/services/custom-impls/siem-delivery-dlq.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/siem-delivery-dlq.custom-impl.backend.service.js +101 -0
- package/dist/esm/security/authentications/services/custom-impls/siem-delivery-dlq.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/siem-export-config.custom-impl.backend.service.d.ts +18 -0
- package/dist/esm/security/authentications/services/custom-impls/siem-export-config.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/siem-export-config.custom-impl.backend.service.js +136 -0
- package/dist/esm/security/authentications/services/custom-impls/siem-export-config.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.d.ts +19 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.js +154 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-connection.custom-impl.backend.service.d.ts +26 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-connection.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-connection.custom-impl.backend.service.js +657 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-connection.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/utils/__tests__/mock-auth-user-lookup.service.d.ts +27 -0
- package/dist/esm/security/authentications/services/utils/__tests__/mock-auth-user-lookup.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/utils/__tests__/mock-auth-user-lookup.service.js +60 -0
- package/dist/esm/security/authentications/services/utils/__tests__/mock-auth-user-lookup.service.js.map +1 -0
- package/dist/esm/security/authentications/services/utils/auth-controller.utils.d.ts +23 -0
- package/dist/esm/security/authentications/services/utils/auth-controller.utils.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/utils/auth-controller.utils.js +44 -0
- package/dist/esm/security/authentications/services/utils/auth-controller.utils.js.map +1 -0
- package/dist/esm/security/authentications/services/utils/auth-credential-ops.backend.service.d.ts +89 -0
- package/dist/esm/security/authentications/services/utils/auth-credential-ops.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/utils/auth-credential-ops.backend.service.js +192 -0
- package/dist/esm/security/authentications/services/utils/auth-credential-ops.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/utils/auth-response-helper.backend.service.d.ts +20 -0
- package/dist/esm/security/authentications/services/utils/auth-response-helper.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/utils/auth-response-helper.backend.service.js +55 -0
- package/dist/esm/security/authentications/services/utils/auth-response-helper.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.d.ts +50 -0
- package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.js +135 -0
- package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/utils/saml-java-availability.d.ts +26 -0
- package/dist/esm/security/authentications/services/utils/saml-java-availability.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/utils/saml-java-availability.js +59 -0
- package/dist/esm/security/authentications/services/utils/saml-java-availability.js.map +1 -0
- package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts +137 -0
- package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authorizations/services/authorizations.backend.service.js +723 -0
- package/dist/esm/security/authorizations/services/authorizations.backend.service.js.map +1 -0
- package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.d.ts +28 -0
- package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.d.ts.map +1 -0
- package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.js +156 -0
- package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.js.map +1 -0
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.d.ts +4 -0
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.d.ts.map +1 -0
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.js +72 -0
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.js.map +1 -0
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.shared.schemas.d.ts +125 -0
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.shared.schemas.d.ts.map +1 -0
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.shared.schemas.js +69 -0
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.shared.schemas.js.map +1 -0
- package/dist/esm/security/consumable-tokens/models/index.d.ts +3 -0
- package/dist/esm/security/consumable-tokens/models/index.d.ts.map +1 -0
- package/dist/esm/security/consumable-tokens/models/index.js +3 -0
- package/dist/esm/security/consumable-tokens/models/index.js.map +1 -0
- package/dist/esm/security/consumable-tokens/services/__tests__/mock-consumable-token.service.d.ts +26 -0
- package/dist/esm/security/consumable-tokens/services/__tests__/mock-consumable-token.service.d.ts.map +1 -0
- package/dist/esm/security/consumable-tokens/services/__tests__/mock-consumable-token.service.js +55 -0
- package/dist/esm/security/consumable-tokens/services/__tests__/mock-consumable-token.service.js.map +1 -0
- package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.d.ts +142 -0
- package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.d.ts.map +1 -0
- package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.js +446 -0
- package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.js.map +1 -0
- package/dist/esm/security/jwt/services/auth-jwt-guard.backend.service.d.ts +46 -0
- package/dist/esm/security/jwt/services/auth-jwt-guard.backend.service.d.ts.map +1 -0
- package/dist/esm/security/jwt/services/auth-jwt-guard.backend.service.js +147 -0
- package/dist/esm/security/jwt/services/auth-jwt-guard.backend.service.js.map +1 -0
- package/dist/esm/security/jwt/services/jwt.backend.service.d.ts +75 -0
- package/dist/esm/security/jwt/services/jwt.backend.service.d.ts.map +1 -0
- package/dist/esm/security/jwt/services/jwt.backend.service.js +368 -0
- package/dist/esm/security/jwt/services/jwt.backend.service.js.map +1 -0
- package/dist/esm/security/scim/controllers/scim.backend.controller.d.ts +71 -0
- package/dist/esm/security/scim/controllers/scim.backend.controller.d.ts.map +1 -0
- package/dist/esm/security/scim/controllers/scim.backend.controller.js +863 -0
- package/dist/esm/security/scim/controllers/scim.backend.controller.js.map +1 -0
- package/dist/esm/security/scim/models/scim-protocol.backend.schemas.d.ts +275 -0
- package/dist/esm/security/scim/models/scim-protocol.backend.schemas.d.ts.map +1 -0
- package/dist/esm/security/scim/models/scim-protocol.backend.schemas.js +139 -0
- package/dist/esm/security/scim/models/scim-protocol.backend.schemas.js.map +1 -0
- package/dist/esm/security/scim/utils/scim-filter-parser.d.ts +35 -0
- package/dist/esm/security/scim/utils/scim-filter-parser.d.ts.map +1 -0
- package/dist/esm/security/scim/utils/scim-filter-parser.js +232 -0
- package/dist/esm/security/scim/utils/scim-filter-parser.js.map +1 -0
- package/dist/esm/security/scim/utils/scim-response-formatter.d.ts +42 -0
- package/dist/esm/security/scim/utils/scim-response-formatter.d.ts.map +1 -0
- package/dist/esm/security/scim/utils/scim-response-formatter.js +89 -0
- package/dist/esm/security/scim/utils/scim-response-formatter.js.map +1 -0
- package/dist/esm/testing.d.ts +31 -0
- package/dist/esm/testing.d.ts.map +1 -0
- package/dist/esm/testing.js +31 -0
- package/dist/esm/testing.js.map +1 -0
- package/dist/esm/users/services/user-self-custom-implementations.backend.d.ts +9 -0
- package/dist/esm/users/services/user-self-custom-implementations.backend.d.ts.map +1 -0
- package/dist/esm/users/services/user-self-custom-implementations.backend.js +48 -0
- package/dist/esm/users/services/user-self-custom-implementations.backend.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +163 -0
- package/src/__tests__/integration/bulk-repository-write-contract.integration.test.ts +373 -0
- package/src/__tests__/integration/custom-batch-job-execution.integration.test.ts +147 -0
- package/src/__tests__/integration/delete-file-rollback-persistence.integration.test.ts +551 -0
- package/src/__tests__/integration/file-management-nested-persistence.integration.test.ts +487 -0
- package/src/__tests__/integration/file-management-postgresql-persistence.integration.test.ts +466 -0
- package/src/__tests__/integration/files-cleanup-persistence.integration.test.ts +335 -0
- package/src/__tests__/integration/generated-bulk-relationship-runtime.integration.test.ts +545 -0
- package/src/__tests__/integration/lifecycle-delete-rollback-persistence.integration.test.ts +537 -0
- package/src/__tests__/integration/postgresql-contextual-filter-enforcement.integration.test.ts +170 -0
- package/src/__tests__/integration/postgresql-delete-best-effort-boundary.integration.test.ts +604 -0
- package/src/__tests__/integration/prompt-compiler.integration.test.ts +723 -0
- package/src/__tests__/integration/relationship-service-semantics.integration.test.ts +2086 -0
- package/src/__tests__/integration/repositories-registry.integration.test.ts +296 -0
- package/src/__tests__/integration/resource-factory-pipeline.integration.test.ts +556 -0
- package/src/__tests__/integration/resource-services.integration.test.ts +265 -0
- package/src/__tests__/integration/resources-registry.integration.test.ts +327 -0
- package/src/__tests__/integration/services-registry.integration.test.ts +231 -0
- package/src/__tests__/integration/update-many-runtime-guards.integration.test.ts +290 -0
- package/src/__tests__/setup.ts +15 -0
- package/src/__tests__/test-container.ts +120 -0
- package/src/applications/models/applications.backend.schemas.ts +18 -0
- package/src/base-classes/__tests__/batches-cronjobs-executor.test.ts +63 -0
- package/src/base-classes/__tests__/bulk-delete-child-file-guard.test.ts +152 -0
- package/src/base-classes/__tests__/bulk-nested-file-update-coordination.test.ts +171 -0
- package/src/base-classes/__tests__/delete-file-coordination.test.ts +185 -0
- package/src/base-classes/__tests__/postgresql-file-transaction-coordination.test.ts +424 -0
- package/src/base-classes/__tests__/postgresql-repository-contextual-filter-enforcement.test.ts +88 -0
- package/src/base-classes/__tests__/repository-contextual-filter-enforcement.test.ts +87 -0
- package/src/base-classes/__tests__/resource-operation-helper-context-enforcement.test.ts +74 -0
- package/src/base-classes/__tests__/transaction-boundaries.test.ts +153 -0
- package/src/base-classes/models/manual-controllers.backend.definition.ts +56 -0
- package/src/base-classes/models/repositories.backend.schemas.ts +105 -0
- package/src/base-classes/services/__tests__/mock-resource-operation-helper.service.ts +61 -0
- package/src/base-classes/services/batches/batches-cronjobs-custom-execution.service.ts +148 -0
- package/src/base-classes/services/batches/batches-cronjobs-executor.backend.service.ts +115 -0
- package/src/base-classes/services/batches/batches-cronjobs-resource-execution.backend.service.ts +58 -0
- package/src/base-classes/services/controllers/__tests__/controller-request-validation.utils.test.ts +292 -0
- package/src/base-classes/services/controllers/__tests__/controller-resource-file-upload-routes.test.ts +1335 -0
- package/src/base-classes/services/controllers/__tests__/controller-resource.version-conflict.test.ts +372 -0
- package/src/base-classes/services/controllers/abstract-controller.backend.service.ts +302 -0
- package/src/base-classes/services/controllers/controller-resource.backend.service.ts +1833 -0
- package/src/base-classes/services/controllers/controllers-registry-handler.backend.service.ts +494 -0
- package/src/base-classes/services/controllers/validate-field-handler.backend.service.ts +613 -0
- package/src/base-classes/services/repositories/__tests__/mock-repositories-registry-handler.service.ts +31 -0
- package/src/base-classes/services/repositories/__tests__/repository-resource.singleton-read.test.ts +50 -0
- package/src/base-classes/services/repositories/postgresql-resource-repository.backend.service.ts +1207 -0
- package/src/base-classes/services/repositories/repositories-registry-handler.backend.service.ts +804 -0
- package/src/base-classes/services/repositories/repository-resource.backend.service.ts +2186 -0
- package/src/base-classes/services/resource-operations-helper.backend.service.ts +468 -0
- package/src/base-classes/services/services/__tests__/mock-services-registry-handler.service.ts +21 -0
- package/src/base-classes/services/services/__tests__/services-registry-handler.notifications.test.ts +65 -0
- package/src/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.ts +305 -0
- package/src/base-classes/services/services/resource-operation-custom-implementation-registry.backend.service.ts +224 -0
- package/src/base-classes/services/services/resource-operation-custom-implementation.factory.backend.ts +331 -0
- package/src/base-classes/services/services/services-registry-handler.backend.service.ts +6288 -0
- package/src/base-classes/utils/backend-type-utils.ts +64 -0
- package/src/billing/services/back-office/__tests__/billing-feature-sync.backend.service.test.ts +132 -0
- package/src/billing/services/back-office/__tests__/billing-state.backend.service.test.ts +245 -0
- package/src/billing/services/back-office/__tests__/product-catalog-sync.backend.service.test.ts +238 -0
- package/src/billing/services/back-office/abstract-billing.backend.service.ts +89 -0
- package/src/billing/services/back-office/billing-feature-sync.backend.service.ts +473 -0
- package/src/billing/services/back-office/billing-state.backend.service.ts +348 -0
- package/src/billing/services/back-office/product-catalog-sync.backend.service.ts +415 -0
- package/src/billing/services/back-office/usage-metering.backend.service.ts +326 -0
- package/src/billing/services/billing.utils.ts +26 -0
- package/src/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.ts +342 -0
- package/src/billing/services/custom-impl/billing-custom-impl-utils.backend.ts +274 -0
- package/src/billing/services/custom-impl/billing-custom-implementations.backend.ts +236 -0
- package/src/billing/services/custom-impl/credit-pool.custom-ops.custom-impl.backend.service.ts +133 -0
- package/src/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.ts +242 -0
- package/src/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.ts +434 -0
- package/src/billing/services/webhooks/billing-webhook-adapter.backend.service.ts +70 -0
- package/src/billing/services/webhooks/billing-webhook-capability-handler.backend.service.ts +46 -0
- package/src/billing/services/webhooks/billing-webhook-event-router.backend.service.ts +727 -0
- package/src/billing/testing/billing-test-fixtures.ts +296 -0
- package/src/billing/testing/mock-billing-provider.ts +548 -0
- package/src/charts/controllers/__tests__/chart.backend.controller.test.ts +403 -0
- package/src/charts/controllers/chart.backend.controller.ts +238 -0
- package/src/charts/services/__tests__/chart-registry.backend.service.test.ts +120 -0
- package/src/charts/services/chart-registry.backend.service.ts +109 -0
- package/src/compliance/audit-trails/audit-logs.custom-impl.backend.service.ts +104 -0
- package/src/compliance/audit-trails/services/__tests__/mock-audit-logs.service.ts +48 -0
- package/src/compliance/audit-trails/services/audit-event-dispatcher.backend.service.ts +325 -0
- package/src/compliance/audit-trails/services/audit-logs.backend.service.ts +1313 -0
- package/src/compliance/audit-trails/services/siem-webhook-delivery.backend.service.ts +542 -0
- package/src/compliance/index.ts +1 -0
- package/src/config/custom/application-config-controller.backend.service.ts +119 -0
- package/src/config/models/__tests__/app-config-secrets.boundaries.test.ts +56 -0
- package/src/config/models/__tests__/app-config.backend-authored.definitions.test.ts +286 -0
- package/src/config/models/app-config-secrets.backend.schemas.ts +154 -0
- package/src/config/models/app-config.backend-authored.definitions.ts +165 -0
- package/src/config/models/app-config.backend.schemas.ts +614 -0
- package/src/config/models/app-env-config.backend.schemas.ts +135 -0
- package/src/config/models/config-mutation-boundary.utils.ts +76 -0
- package/src/config/models/postgresql-env-config.backend.schemas.ts +126 -0
- package/src/config/models/runtime-topology.backend.contracts.ts +42 -0
- package/src/config/services/__tests__/app-configuration-loader.backend.service.test.ts +118 -0
- package/src/config/services/__tests__/app-configuration.backend.service.test.ts +40 -0
- package/src/config/services/__tests__/app-configuration.backend.utils.test.ts +72 -0
- package/src/config/services/__tests__/application-startup-config-validator.backend.service.test.ts +404 -0
- package/src/config/services/__tests__/mock-app-configuration.service.ts +131 -0
- package/src/config/services/app-configuration-loader.backend.service.ts +443 -0
- package/src/config/services/app-configuration.backend.service.ts +570 -0
- package/src/config/services/app-configuration.backend.utils.ts +94 -0
- package/src/config/services/application-startup-config-validator.backend.service.ts +611 -0
- package/src/databases/models/aggregation.backend.schemas.ts +174 -0
- package/src/databases/models/databases.backend.schemas.ts +70 -0
- package/src/databases/models/filter.backend.schemas.ts +101 -0
- package/src/databases/models/sql.backend.schemas.ts +111 -0
- package/src/databases/models/transaction.shared.schemas.ts +172 -0
- package/src/databases/services/__tests__/mock-mongo-transaction-registry.service.ts +90 -0
- package/src/databases/services/__tests__/mock-mongodb.service.ts +86 -0
- package/src/databases/services/__tests__/mock-mongoose-model.service.ts +411 -0
- package/src/databases/services/__tests__/mock-redis.service.ts +72 -0
- package/src/databases/services/__tests__/mock-zod-mongoose-schema-convertor.service.ts +41 -0
- package/src/databases/services/__tests__/mongo-aggregation-compiler.test.ts +918 -0
- package/src/databases/services/__tests__/postgresql-filter.backend.service.test.ts +180 -0
- package/src/databases/services/__tests__/sql-hybrid-transform.test.ts +73 -0
- package/src/databases/services/aggregation/__tests__/aggregation-authorization.backend.service.test.ts +444 -0
- package/src/databases/services/aggregation/__tests__/aggregation-query.backend.service.test.ts +150 -0
- package/src/databases/services/aggregation/__tests__/computed-measure-evaluator.test.ts +525 -0
- package/src/databases/services/aggregation/__tests__/field-access-validator.test.ts +458 -0
- package/src/databases/services/aggregation/__tests__/time-series-densifier.test.ts +631 -0
- package/src/databases/services/aggregation/__tests__/window-function-processor.test.ts +598 -0
- package/src/databases/services/aggregation/aggregation-authorization.backend.service.ts +516 -0
- package/src/databases/services/aggregation/aggregation-query.backend.service.ts +514 -0
- package/src/databases/services/aggregation/computed-measure-evaluator.backend.service.ts +196 -0
- package/src/databases/services/aggregation/field-access-validator.backend.service.ts +225 -0
- package/src/databases/services/aggregation/time-series-densifier.backend.service.ts +389 -0
- package/src/databases/services/aggregation/topn-processor.backend.service.ts +221 -0
- package/src/databases/services/aggregation/window-function-processor.backend.service.ts +301 -0
- package/src/databases/services/db-utils.ts +96 -0
- package/src/databases/services/mongo-aggregation.backend.service.ts +762 -0
- package/src/databases/services/mongodb.service.ts +736 -0
- package/src/databases/services/postgresql-aggregation.backend.service.ts +794 -0
- package/src/databases/services/postgresql-database.backend.service.ts +288 -0
- package/src/databases/services/postgresql-filter.backend.service.ts +673 -0
- package/src/databases/services/redis.service.ts +531 -0
- package/src/databases/services/zod-to-mongoose-schema-convertor.backend.service.ts +2486 -0
- package/src/databases/services/zod-to-sql-hybrid-schema.planner.ts +312 -0
- package/src/errors/services/__tests__/error-builder.backend.service.test.ts +31 -0
- package/src/errors/services/__tests__/error-handler.backend.service.test.ts +82 -0
- package/src/errors/services/__tests__/mock-error-builder.service.ts +288 -0
- package/src/errors/services/error-builder.backend.service.ts +403 -0
- package/src/errors/services/error-handler.backend.service.ts +236 -0
- package/src/errors/services/rate-limit.backend.service.ts +45 -0
- package/src/external-providers/models/external-providers.backend.schemas.ts +243 -0
- package/src/external-providers/services/__tests__/external-providers-registry.backend.service.test.ts +136 -0
- package/src/external-providers/services/__tests__/feature-bindings.backend.service.test.ts +40 -0
- package/src/external-providers/services/__tests__/mock-external-providers-registry.service.ts +33 -0
- package/src/external-providers/services/__tests__/mock-lazy-provider-registry.service.ts +45 -0
- package/src/external-providers/services/external-api-handler.backend.service.ts +19 -0
- package/src/external-providers/services/external-providers-registry.backend.service.ts +534 -0
- package/src/external-providers/services/feature-bindings.backend.service.ts +422 -0
- package/src/external-providers/services/lazy-provider-registry.backend.service.ts +486 -0
- package/src/features/__tests__/feature-builders.test.ts +152 -0
- package/src/features/controllers/__tests__/features.backend.controller.test.ts +173 -0
- package/src/features/controllers/features.backend.controller.ts +200 -0
- package/src/features/services/__tests__/feature-definition-registry.backend.service.test.ts +152 -0
- package/src/features/services/__tests__/feature-gate.test.ts +484 -0
- package/src/features/services/__tests__/feature-resolution.backend.service.test.ts +203 -0
- package/src/features/services/__tests__/mock-capability-bindings.service.ts +26 -0
- package/src/features/services/__tests__/mock-feature-definition-registry.service.ts +56 -0
- package/src/features/services/__tests__/mock-feature-resolution.service.ts +36 -0
- package/src/features/services/feature-definition-registry.backend.service.ts +537 -0
- package/src/features/services/feature-gate.backend.service.ts +522 -0
- package/src/features/services/feature-resolution.backend.service.ts +652 -0
- package/src/features/testing/feature-test-utils.ts +200 -0
- package/src/files/batches/__tests__/files-cleanup.batch.backend.service.test.ts +186 -0
- package/src/files/batches/files-cleanup.batch.backend.service.ts +259 -0
- package/src/files/constraints/file-analyzers.types.ts +85 -0
- package/src/files/constraints/file-constraint-resolver-chain.backend.service.ts +99 -0
- package/src/files/constraints/file-constraint.types.ts +104 -0
- package/src/files/constraints/file-validation.backend.service.ts +359 -0
- package/src/files/constraints/resource-field-constraint-resolver.backend.service.ts +138 -0
- package/src/files/controllers/__tests__/file.controller.behavior.test.ts +655 -0
- package/src/files/controllers/file.controller.ts +1030 -0
- package/src/files/handlers/__tests__/resource-file-upload-handler.backend.service.test.ts +392 -0
- package/src/files/handlers/resource-file-upload-handler.backend.service.ts +605 -0
- package/src/files/rag/weaviate-vector-store.backend.service.ts +271 -0
- package/src/files/scanning/clamav-scanner.backend.service.ts +214 -0
- package/src/files/scanning/file-scan.types.ts +17 -0
- package/src/files/scanning/yara-scanner.backend.service.ts +212 -0
- package/src/files/services/__tests__/file-field-detection.backend.service.test.ts +91 -0
- package/src/files/services/__tests__/file-operation-handler.backend.service.test.ts +272 -0
- package/src/files/services/__tests__/file-population.backend.service.test.ts +120 -0
- package/src/files/services/__tests__/file-scanning.backend.service.test.ts +163 -0
- package/src/files/services/__tests__/files.backend.service.test.ts +885 -0
- package/src/files/services/__tests__/mock-file-field-detection.service.ts +43 -0
- package/src/files/services/__tests__/mock-file-operation-handler.service.ts +113 -0
- package/src/files/services/__tests__/mock-file-repository.service.ts +104 -0
- package/src/files/services/file-field-detection.backend.service.ts +156 -0
- package/src/files/services/file-operation-handler.backend.service.ts +861 -0
- package/src/files/services/file-population.backend.service.ts +485 -0
- package/src/files/services/file-rag-indexing.backend.service.ts +229 -0
- package/src/files/services/file-scanning.backend.service.ts +373 -0
- package/src/files/services/file-text-extraction.backend.service.ts +193 -0
- package/src/files/services/files.backend.service.ts +1356 -0
- package/src/files/storage/file-storage-path-resolver.backend.service.ts +289 -0
- package/src/files/storage/file-storage-provider.types.ts +188 -0
- package/src/files/storage/file-storage-router.backend.service.ts +172 -0
- package/src/files/storage/local-directory-storage-provider.backend.service.ts +417 -0
- package/src/files/storage/wildo-managed-storage-provider.backend.service.ts +530 -0
- package/src/files/utils/__tests__/file-field-schema-path.backend.utils.test.ts +44 -0
- package/src/files/utils/__tests__/file-uploader.utils.test.ts +57 -0
- package/src/files/utils/__tests__/file-validation.utils.test.ts +559 -0
- package/src/files/utils/file-field-schema-path.backend.utils.ts +385 -0
- package/src/files/utils/file-upload.utils.ts +146 -0
- package/src/files/utils/file-uploader.utils.ts +65 -0
- package/src/files/utils/file-validation.utils.ts +753 -0
- package/src/flows-actors/agent-catalogs.backend.ts +427 -0
- package/src/flows-actors/controllers/flows-actors.controller.ts +91 -0
- package/src/flows-actors/models/agent-catalogs.backend.definitions.ts +430 -0
- package/src/flows-actors/models/agent-facets.backend.definitions.ts +120 -0
- package/src/flows-actors/models/agents.backend.definitions.ts +4 -0
- package/src/flows-actors/models/core-facets.backend.definitions.ts +348 -0
- package/src/flows-actors/models/flows-actors.backend.definitions.ts +13 -0
- package/src/flows-actors/models/flows-actors.backend.schemas.ts +44 -0
- package/src/flows-actors/services/__tests__/agent-facets-catalogs.test.ts +544 -0
- package/src/flows-actors/services/__tests__/agents.backend.service.cli-runtime.test.ts +234 -0
- package/src/flows-actors/services/actors-system.backend.service.ts +270 -0
- package/src/flows-actors/services/agent-facets.backend.service.ts +350 -0
- package/src/flows-actors/services/agents.backend.service.ts +2730 -0
- package/src/flows-actors/services/context-curation.backend.service.ts +203 -0
- package/src/flows-actors/services/flows-actors-registry.service.ts +374 -0
- package/src/flows-actors/services/flows.backend.services.ts +237 -0
- package/src/flows-actors/services/prompt-compiler.backend.service.ts +734 -0
- package/src/flows-actors/utils/__tests__/cli-runtime-operation-support.backend.utils.test.ts +95 -0
- package/src/flows-actors/utils/cli-runtime-operation-support.backend.utils.ts +87 -0
- package/src/flows-actors/utils/cli-runtime-runner.backend.utils.ts +171 -0
- package/src/flows-actors/utils/flows-actors-frontend-extractor.utils.ts +63 -0
- package/src/flows-actors/utils/prompt-ir-adapters.backend.utils.ts +257 -0
- package/src/guidance/batches/dormancy-detection.batch.backend.service.ts +126 -0
- package/src/guidance/services/__tests__/guidance-trigger-evaluator.backend.service.test.ts +49 -0
- package/src/guidance/services/__tests__/lifecycle-evaluator.backend.service.test.ts +85 -0
- package/src/guidance/services/__tests__/milestone-definition-registry.backend.service.test.ts +211 -0
- package/src/guidance/services/__tests__/milestone-evaluator.backend.service.test.ts +561 -0
- package/src/guidance/services/guidance-trigger-evaluator.backend.service.ts +151 -0
- package/src/guidance/services/lifecycle-custom-implementations.backend.ts +139 -0
- package/src/guidance/services/lifecycle-evaluator.backend.service.ts +908 -0
- package/src/guidance/services/milestone-condition-registry.backend.service.ts +57 -0
- package/src/guidance/services/milestone-definition-registry.backend.service.ts +265 -0
- package/src/guidance/services/milestone-evaluator.backend.service.ts +611 -0
- package/src/i18n/controllers/i18n-controller.backend.service.ts +227 -0
- package/src/i18n/services/i18n.backend.service.ts +88 -0
- package/src/index.ts +286 -0
- package/src/inject/models/container.ts +586 -0
- package/src/inject/models/service-types.ts +488 -0
- package/src/monitoring/analytics/controllers/analytics.backend.controller.ts +114 -0
- package/src/monitoring/analytics/services/value-moment-engine.backend.service.ts +53 -0
- package/src/monitoring/analytics/services/value-moment-handler-registry.backend.service.ts +38 -0
- package/src/monitoring/logger/middleware/logging.middleware.ts +40 -0
- package/src/monitoring/logger/models/logger.backend.schemas.ts +56 -0
- package/src/monitoring/logger/services/__tests__/mock-logger.service.ts +49 -0
- package/src/monitoring/logger/services/logger.service.ts +214 -0
- package/src/monitoring/observability/middleware/metrics.middleware.ts +205 -0
- package/src/monitoring/observability/middleware/telemetry.middleware.ts +188 -0
- package/src/monitoring/observability/middleware/tracing.middleware.ts +265 -0
- package/src/monitoring/observability/models/observability.backend.schemas.ts +96 -0
- package/src/monitoring/observability/services/instrumentations/custom.instrumentations.ts +132 -0
- package/src/monitoring/observability/services/metrics.service.ts +266 -0
- package/src/monitoring/observability/services/telemetry.service.ts +157 -0
- package/src/monitoring/observability/services/tracer.service.ts +334 -0
- package/src/notifications/email/components/email-components.ts +341 -0
- package/src/notifications/email/models/email-context-provider.interface.ts +107 -0
- package/src/notifications/email/models/email-template-definition.ts +74 -0
- package/src/notifications/email/models/email-template.actors-system.backend.definitions.ts +80 -0
- package/src/notifications/email/models/email.backend.scheamas.ts +0 -0
- package/src/notifications/email/services/email-batch-send.batch.backend.service.ts +236 -0
- package/src/notifications/email/services/email-context-provider-registry.backend.service.ts +157 -0
- package/src/notifications/email/services/email-renderer.backend.service.ts +274 -0
- package/src/notifications/email/services/email-template-compiler.backend.service.ts +136 -0
- package/src/notifications/email/services/email-template-generation.backend.service.ts +811 -0
- package/src/notifications/email/services/email-template-registry.backend.service.ts +166 -0
- package/src/notifications/email/services/email-template-sandbox.backend.service.ts +255 -0
- package/src/notifications/email/services/email-template-validator.backend.service.ts +229 -0
- package/src/notifications/email/services/email.backend.service.ts +429 -0
- package/src/notifications/email/utils/color-conversion.utils.ts +142 -0
- package/src/notifications/email/utils/interpolate-email-label.utils.ts +16 -0
- package/src/notifications/email/utils/zod-to-typescript.utils.ts +352 -0
- package/src/notifications/services/__tests__/notifications-dispatcher.operation-semantics.test.ts +773 -0
- package/src/notifications/services/__tests__/notifications-dispatcher.websocket-integration.test.ts +173 -0
- package/src/notifications/services/notification-badge.backend.service.ts +412 -0
- package/src/notifications/services/notifications-dispatcher.backend.service.ts +1696 -0
- package/src/notifications/sms/services/sms.backend.service.ts +283 -0
- package/src/notifications/webhooks/controllers/webhook-auto-controller.backend.service.ts +220 -0
- package/src/notifications/webhooks/services/polymorphic-lookup.backend.service.ts +131 -0
- package/src/notifications/webhooks/services/webhook-handler.backend.service.ts +481 -0
- package/src/organizations/services/__tests__/org-creation-on-registration.backend.utils.test.ts +193 -0
- package/src/organizations/services/__tests__/org-member-roles-validation.backend.utils.test.ts +101 -0
- package/src/organizations/services/__tests__/organization-custom-implementation.backend.service.test.ts +113 -0
- package/src/organizations/services/__tests__/scim-provisioning-gate.backend.utils.test.ts +94 -0
- package/src/organizations/services/__tests__/user-org-type-grant.backend.utils.test.ts +164 -0
- package/src/organizations/services/__tests__/user-type-revocation-on-org-leave.backend.utils.test.ts +161 -0
- package/src/organizations/services/org-creation-on-registration.backend.utils.ts +119 -0
- package/src/organizations/services/org-member-roles-validation.backend.utils.ts +51 -0
- package/src/organizations/services/organization-custom-implementation.backend.service.ts +106 -0
- package/src/organizations/services/organization-member-custom-implementation.backend.service.ts +150 -0
- package/src/organizations/services/scim-provisioning-gate.backend.utils.ts +34 -0
- package/src/organizations/services/user-org-type-grant.backend.utils.ts +49 -0
- package/src/organizations/services/user-type-revocation-on-org-leave.backend.utils.ts +102 -0
- package/src/queue/adapters/rabbitmq-adapter.backend.service.ts +494 -0
- package/src/queue/apps-crontabs-manager.backend.service.ts +258 -0
- package/src/queue/cron-job-sync.backend.service.ts +184 -0
- package/src/queue/domain-queue-consumer.backend.service.ts +333 -0
- package/src/queue/job-completion-registry.backend.service.ts +342 -0
- package/src/queue/job-consumer.backend.service.ts +646 -0
- package/src/queue/job-executor.backend.service.ts +315 -0
- package/src/queue/job-payload-storage.backend.service.ts +297 -0
- package/src/queue/job-status-tracking.backend.service.ts +376 -0
- package/src/queue/queue-monitoring.backend.service.ts +333 -0
- package/src/queue/queue-worker-initializer.backend.service.ts +179 -0
- package/src/queue/queue.backend.service.ts +530 -0
- package/src/queue/scheduled-message-verifier.backend.service.ts +228 -0
- package/src/queue/worker-shutdown-manager.backend.service.ts +298 -0
- package/src/requests/models/api-routes.backend.defintions.ts +45 -0
- package/src/requests/models/requests.backend.schemas.ts +73 -0
- package/src/requests/service/__tests__/websocket.service.auth-refresh.test.ts +361 -0
- package/src/requests/service/__tests__/websocket.service.resource-room-validation.test.ts +234 -0
- package/src/requests/service/__tests__/websocket.service.variant-authorization.test.ts +94 -0
- package/src/requests/service/platform-mutualized-handler.backend.service.ts +19 -0
- package/src/requests/service/platform-requests.backend.utils.ts +54 -0
- package/src/requests/service/remote-client-base.backend.service.ts +485 -0
- package/src/requests/service/serverless-services-handler.backend.service.ts +19 -0
- package/src/requests/service/websocket.service.ts +2844 -0
- package/src/resources/models/custom-service-implementations.backend.definition.ts +22 -0
- package/src/resources/models/index.ts +7 -0
- package/src/resources/models/resources-operations.backend.definitions.ts +9 -0
- package/src/resources/models/resources-relationships.backend.definitions.ts +30 -0
- package/src/resources/models/resources-types.backend.schemas.ts +14 -0
- package/src/resources/models/resources.backend.schemas.ts +6 -0
- package/src/resources/models/virtual-fields.backend.types.ts +132 -0
- package/src/resources/services/__tests__/mock-resources-registry.service.ts +69 -0
- package/src/resources/services/__tests__/resource-id.backend.service.test.ts +69 -0
- package/src/resources/services/resource-context.backend.service.ts +1107 -0
- package/src/resources/services/resource-id.backend.service.ts +280 -0
- package/src/resources/services/resource-population.backend.service.ts +761 -0
- package/src/resources/services/resources-registry.backend.service.ts +1126 -0
- package/src/resources/services/virtual-fields.backend.service.ts +303 -0
- package/src/runtime/__tests__/execution-context-creator.backend.service.test.ts +469 -0
- package/src/runtime/controllers/health-controller.backend.service.ts +297 -0
- package/src/runtime/domain-module.backend.definitions.test.ts +83 -0
- package/src/runtime/domain-module.backend.definitions.ts +161 -0
- package/src/runtime/models/execution-context.backend.schemas.ts +456 -0
- package/src/runtime/models/runtime.backend.schemas.ts +82 -0
- package/src/runtime/services/execution-context-creator.backend.service.ts +2102 -0
- package/src/runtime/services/execution-context-handler.backend.service.ts +224 -0
- package/src/runtime/services/health-readiness-contributor.backend.interface.ts +11 -0
- package/src/runtime/services/http-server.backend.service.ts +870 -0
- package/src/runtime/services/start-application.backend.service.ts +1109 -0
- package/src/runtime/testing/execution-context-test-fixtures.ts +14 -0
- package/src/runtime/testing/mock-execution-context-creator.service.ts +46 -0
- package/src/runtime/utils/scan-default-exports.backend.utils.ts +247 -0
- package/src/security/authentications/__tests__/auth-registration.test.ts +338 -0
- package/src/security/authentications/__tests__/authentication-controller.test.ts +31 -0
- package/src/security/authentications/__tests__/authentication-orchestrator.test.ts +27 -0
- package/src/security/authentications/__tests__/saml-assertion-validator.test.ts +631 -0
- package/src/security/authentications/__tests__/saml-authentication.test.ts +126 -0
- package/src/security/authentications/__tests__/saml-integration-test-helpers.test.ts +234 -0
- package/src/security/authentications/__tests__/saml-metadata.test.ts +185 -0
- package/src/security/authentications/__tests__/saml-replay-guard.test.ts +99 -0
- package/src/security/authentications/__tests__/saml-sso-flow.integration.test.ts +355 -0
- package/src/security/authentications/__tests__/saml-test-fixtures.test.ts +433 -0
- package/src/security/authentications/__tests__/saml-test-parser.test.ts +117 -0
- package/src/security/authentications/__tests__/sso-connection-custom-ops.integration.test.ts +236 -0
- package/src/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.ts +71 -0
- package/src/security/authentications/controllers/auth-method-management-controller.backend.service.ts +205 -0
- package/src/security/authentications/controllers/authentication-controller.backend.service.ts +2712 -0
- package/src/security/authentications/models/auth-constants.backend.ts +141 -0
- package/src/security/authentications/models/authentications.backend.schemas.ts +106 -0
- package/src/security/authentications/models/jwt.backend.schemas.ts +107 -0
- package/src/security/authentications/models/oauth2-connection.backend.schemas.ts +196 -0
- package/src/security/authentications/models/saml-authentication.backend.schemas.ts +124 -0
- package/src/security/authentications/models/sso-connection.backend.schemas.ts +104 -0
- package/src/security/authentications/services/__tests__/mock-auth-execution-context-factory.service.ts +73 -0
- package/src/security/authentications/services/__tests__/mock-auth-token-issuer.service.ts +46 -0
- package/src/security/authentications/services/admin-config/__tests__/mock-domain-to-org-lookup.service.ts +40 -0
- package/src/security/authentications/services/admin-config/__tests__/mock-enterprise-user-provisioning.service.ts +67 -0
- package/src/security/authentications/services/admin-config/auth-organization-configuration.service.ts +424 -0
- package/src/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.ts +244 -0
- package/src/security/authentications/services/admin-config/domain-verification.backend.service.ts +215 -0
- package/src/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.ts +509 -0
- package/src/security/authentications/services/admin-config/oidc-discovery.backend.service.ts +250 -0
- package/src/security/authentications/services/anonymous-session.backend.service.ts +442 -0
- package/src/security/authentications/services/auth-credential-verifier.backend.service.ts +147 -0
- package/src/security/authentications/services/auth-execution-context-factory.backend.service.ts +132 -0
- package/src/security/authentications/services/auth-methods/auth-method-management.backend.service.ts +532 -0
- package/src/security/authentications/services/auth-methods/auth-mfa.backend.service.ts +141 -0
- package/src/security/authentications/services/auth-methods/auth-password-reset.backend.service.ts +215 -0
- package/src/security/authentications/services/auth-methods/auth-phone-verification.backend.service.ts +136 -0
- package/src/security/authentications/services/auth-methods/auth-registration.backend.service.ts +994 -0
- package/src/security/authentications/services/auth-methods/oauth2-authentication.backend.service.ts +1210 -0
- package/src/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.ts +903 -0
- package/src/security/authentications/services/auth-methods/saml-assertion-validator.backend.service.ts +791 -0
- package/src/security/authentications/services/auth-methods/saml-authentication.backend.service.ts +1727 -0
- package/src/security/authentications/services/auth-methods/saml-metadata.backend.service.ts +432 -0
- package/src/security/authentications/services/auth-methods/saml-replay-guard.backend.service.ts +90 -0
- package/src/security/authentications/services/auth-methods/webauthn.backend.service.ts +393 -0
- package/src/security/authentications/services/auth-session-store.backend.service.ts +211 -0
- package/src/security/authentications/services/auth-token-issuer.backend.service.ts +496 -0
- package/src/security/authentications/services/authentication-orchestrator.backend.service.ts +3156 -0
- package/src/security/authentications/services/custom-impls/auth-custom-implementations.backend.ts +88 -0
- package/src/security/authentications/services/custom-impls/auth-policy.custom-impl.backend.service.ts +54 -0
- package/src/security/authentications/services/custom-impls/scim-provisioning-config.custom-impl.backend.service.ts +167 -0
- package/src/security/authentications/services/custom-impls/scim-tokens.custom-impl.backend.service.ts +136 -0
- package/src/security/authentications/services/custom-impls/siem-delivery-dlq.custom-impl.backend.service.ts +123 -0
- package/src/security/authentications/services/custom-impls/siem-export-config.custom-impl.backend.service.ts +161 -0
- package/src/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.ts +185 -0
- package/src/security/authentications/services/custom-impls/sso-connection.custom-impl.backend.service.ts +792 -0
- package/src/security/authentications/services/utils/__tests__/mock-auth-user-lookup.service.ts +62 -0
- package/src/security/authentications/services/utils/auth-controller.utils.ts +51 -0
- package/src/security/authentications/services/utils/auth-credential-ops.backend.service.ts +202 -0
- package/src/security/authentications/services/utils/auth-response-helper.backend.service.ts +38 -0
- package/src/security/authentications/services/utils/auth-user-lookup.backend.service.ts +128 -0
- package/src/security/authentications/services/utils/saml-java-availability.ts +64 -0
- package/src/security/authorizations/__tests__/authorizations.backend.service.test.ts +82 -0
- package/src/security/authorizations/services/authorizations.backend.service.ts +934 -0
- package/src/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.ts +168 -0
- package/src/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.ts +92 -0
- package/src/security/consumable-tokens/models/consumable-tokens.shared.schemas.ts +86 -0
- package/src/security/consumable-tokens/models/index.ts +3 -0
- package/src/security/consumable-tokens/services/__tests__/mock-consumable-token.service.ts +63 -0
- package/src/security/consumable-tokens/services/consumable-token.backend.service.ts +568 -0
- package/src/security/jwt/services/auth-jwt-guard.backend.service.ts +137 -0
- package/src/security/jwt/services/jwt.backend.service.ts +397 -0
- package/src/security/scim/__tests__/scim-filter-parser.test.ts +121 -0
- package/src/security/scim/controllers/scim.backend.controller.ts +1066 -0
- package/src/security/scim/models/scim-protocol.backend.schemas.ts +258 -0
- package/src/security/scim/utils/scim-filter-parser.ts +289 -0
- package/src/security/scim/utils/scim-response-formatter.ts +122 -0
- package/src/testing.ts +30 -0
- package/src/types/xmldom.d.ts +9 -0
- package/src/users/services/user-self-custom-implementations.backend.ts +62 -0
package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.js
ADDED
|
@@ -0,0 +1,2371 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import 'reflect-metadata';
|
|
14
|
+
import { injectable, inject } from 'inversify';
|
|
15
|
+
import express from 'express';
|
|
16
|
+
import { AbstractControllerBackendService } from '../../../base-classes/services/controllers/abstract-controller.backend.service.js';
|
|
17
|
+
import { LoggerService } from '../../../monitoring/logger/services/logger.service.js';
|
|
18
|
+
import { ErrorBuilderBackendService } from '../../../errors/services/error-builder.backend.service.js';
|
|
19
|
+
import { ErrorHandlerService } from '../../../errors/services/error-handler.backend.service.js';
|
|
20
|
+
import { AppConfigurationService } from '../../../config/services/app-configuration.backend.service.js';
|
|
21
|
+
import { AuditLogsBackendService } from '../../../compliance/audit-trails/services/audit-logs.backend.service.js';
|
|
22
|
+
import { SAAS_SERVICE_TYPES } from '../../../inject/models/service-types.js';
|
|
23
|
+
import { AuthenticationOrchestratorBackendService } from '../../../security/authentications/services/authentication-orchestrator.backend.service.js';
|
|
24
|
+
import { AuthTokenIssuerBackendService } from '../../../security/authentications/services/auth-token-issuer.backend.service.js';
|
|
25
|
+
import { OAuth2AuthenticationBackendService } from '../../../security/authentications/services/auth-methods/oauth2-authentication.backend.service.js';
|
|
26
|
+
import { OAuth2ConnectionResolverBackendService } from '../../../security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.js';
|
|
27
|
+
import { ConsumableTokenBackendService } from '../../../security/consumable-tokens/services/consumable-token.backend.service.js';
|
|
28
|
+
import { JwtBackendService } from '../../../security/jwt/services/jwt.backend.service.js';
|
|
29
|
+
import { WebAuthnBackendService } from '../../../security/authentications/services/auth-methods/webauthn.backend.service.js';
|
|
30
|
+
import { DomainToOrgLookupBackendService } from '../../../security/authentications/services/admin-config/domain-to-org-lookup.backend.service.js';
|
|
31
|
+
import { SAMLAuthenticationBackendService } from '../../../security/authentications/services/auth-methods/saml-authentication.backend.service.js';
|
|
32
|
+
import { SAMLMetadataBackendService } from '../../../security/authentications/services/auth-methods/saml-metadata.backend.service.js';
|
|
33
|
+
import { EmailBackendService } from '../../../notifications/email/services/email.backend.service.js';
|
|
34
|
+
import { SMSBackendService } from '../../../notifications/sms/services/sms.backend.service.js';
|
|
35
|
+
import { AuthExecutionContextFactoryBackendService } from '../../../security/authentications/services/auth-execution-context-factory.backend.service.js';
|
|
36
|
+
import { AUTH_REDIS_KEYS, AUTH_OPERATION, AuthSource } from '../../../security/authentications/models/auth-constants.backend.js';
|
|
37
|
+
import { AuthControllerUtils } from '../../../security/authentications/services/utils/auth-controller.utils.js';
|
|
38
|
+
import { AuthResponseHelperBackendService } from '../../../security/authentications/services/utils/auth-response-helper.backend.service.js';
|
|
39
|
+
import { AuthJwtGuardBackendService } from '../../../security/jwt/services/auth-jwt-guard.backend.service.js';
|
|
40
|
+
import { AuthPasswordResetBackendService } from '../../../security/authentications/services/auth-methods/auth-password-reset.backend.service.js';
|
|
41
|
+
import { AuthRegistrationBackendService } from '../../../security/authentications/services/auth-methods/auth-registration.backend.service.js';
|
|
42
|
+
import { AuthMfaBackendService } from '../../../security/authentications/services/auth-methods/auth-mfa.backend.service.js';
|
|
43
|
+
import { AuthPhoneVerificationBackendService } from '../../../security/authentications/services/auth-methods/auth-phone-verification.backend.service.js';
|
|
44
|
+
import { AuthMethodManagementBackendService } from '../../../security/authentications/services/auth-methods/auth-method-management.backend.service.js';
|
|
45
|
+
import { AnonymousSessionBackendService } from '../../../security/authentications/services/anonymous-session.backend.service.js';
|
|
46
|
+
import { AuthUserLookupBackendService } from '../../../security/authentications/services/utils/auth-user-lookup.backend.service.js';
|
|
47
|
+
import { RateLimitBackendService } from '../../../errors/services/rate-limit.backend.service.js';
|
|
48
|
+
import { z } from 'zod';
|
|
49
|
+
import { AuthIdentificationRequestSchema, AuthenticationRequestSchema, AuthLoginFormDtoSchema, PasswordResetRequestDtoSchema, PasswordResetCompleteDtoSchema, UserRegisterApiDtoSchema, UserInvitationApiDtoSchema, UserInvitationRejectApiDtoSchema, EmailVerifyDtoSchema, NativeTokenExchangeRequestSchema, AuthMethod, AuthFactorLevel, AuthenticationSessionState, CoreConsumableTokenTypes, ConsumableToken_ConsumptionMode, ConsumableTokenTypesSchema, CoreResourceType, CoreAuditableEventType, ResourceOperationRiskLevel, ResourcePrimaryScope, CORE_APP_ROLES, UserStatus, SsoConnectionType, EmailTemplateType, SystemEmailTemplateRef, ErrorType, ErrorCustomMessageReference, isWildoBackendError, MANUAL_CONTROLLER_ROUTES_URLS, ManualControllerRouteKey, AuthRedirectErrorCode, AuthScopeType, SessionType, WildoHeaderKeys, } from '@wildo-ai/saas-models';
|
|
50
|
+
import { DurationUnit } from '@wildo-ai/zod-decorators';
|
|
51
|
+
import { MagicLinkSendRequestSchema, MagicLinkVerifyRequestSchema, PhoneVerifySendRequestSchema, PhoneVerifyConfirmRequestSchema } from '@wildo-ai/saas-models';
|
|
52
|
+
import { AvailableLanguage, AuthResponseMessageRef, BackendSmsMessageRef } from '@wildo-ai/presets-components-models';
|
|
53
|
+
// Password auth body extends the shared login form DTO with session/method/factor fields
|
|
54
|
+
// that are added programmatically by the frontend service layer.
|
|
55
|
+
const PasswordAuthBodySchema = AuthLoginFormDtoSchema.extend({
|
|
56
|
+
sessionId: z.string(),
|
|
57
|
+
method: z.literal(AuthMethod.PASSWORD),
|
|
58
|
+
factorLevel: z.literal(AuthFactorLevel.FIRST),
|
|
59
|
+
});
|
|
60
|
+
const RefreshTokenBodySchema = z.object({
|
|
61
|
+
refreshToken: z.string().min(1),
|
|
62
|
+
});
|
|
63
|
+
const TokenExchangeBodySchema = z.object({
|
|
64
|
+
code: z.string().min(1),
|
|
65
|
+
});
|
|
66
|
+
const LogoutBodySchema = z.object({
|
|
67
|
+
refreshToken: z.string().min(1),
|
|
68
|
+
});
|
|
69
|
+
const CreateOneOffTokenRequestSchema = z.object({
|
|
70
|
+
userId: z.string().min(1),
|
|
71
|
+
tokenType: ConsumableTokenTypesSchema,
|
|
72
|
+
consumeAt: z.enum(['EXCHANGE', 'TARGET_OPERATION']),
|
|
73
|
+
consumptionMode: z.enum(ConsumableToken_ConsumptionMode).optional().default(ConsumableToken_ConsumptionMode.SINGLE_USE),
|
|
74
|
+
maxUses: z.number().int().min(1).optional(),
|
|
75
|
+
expiresIn: z.object({
|
|
76
|
+
value: z.number().int().min(1),
|
|
77
|
+
unit: z.enum(['minutes', 'hours', 'days']),
|
|
78
|
+
}).optional().default({ value: 24, unit: 'hours' }),
|
|
79
|
+
resourceIdentifier: z.string().optional(),
|
|
80
|
+
relatedId: z.string().optional(),
|
|
81
|
+
metadata: z.record(z.string(), z.any()).optional(),
|
|
82
|
+
targeting: z.object({
|
|
83
|
+
initiatorIds: z.record(z.string(), z.string()).optional(),
|
|
84
|
+
}).optional(),
|
|
85
|
+
});
|
|
86
|
+
const OneOffSessionExchangeBodySchema = z.object({
|
|
87
|
+
token: z.string().min(1),
|
|
88
|
+
});
|
|
89
|
+
let AuthenticationControllerBackendService = class AuthenticationControllerBackendService extends AbstractControllerBackendService {
|
|
90
|
+
authEcFactory;
|
|
91
|
+
authService;
|
|
92
|
+
tokenIssuer;
|
|
93
|
+
oauth2Service;
|
|
94
|
+
oauth2Resolver;
|
|
95
|
+
consumableTokenService;
|
|
96
|
+
jwtService;
|
|
97
|
+
emailService;
|
|
98
|
+
appConfigService;
|
|
99
|
+
auditLogsService;
|
|
100
|
+
rateLimitService;
|
|
101
|
+
webAuthnService;
|
|
102
|
+
smsService;
|
|
103
|
+
domainToOrgLookup;
|
|
104
|
+
samlAuthService;
|
|
105
|
+
samlMetadataService;
|
|
106
|
+
authResponseHelper;
|
|
107
|
+
authJwtGuard;
|
|
108
|
+
passwordResetService;
|
|
109
|
+
registrationService;
|
|
110
|
+
mfaService;
|
|
111
|
+
phoneVerificationService;
|
|
112
|
+
methodManagementService;
|
|
113
|
+
anonymousSessionService;
|
|
114
|
+
userLookup;
|
|
115
|
+
constructor(logger, errorBuilder, errorHandler, authService, tokenIssuer, oauth2Service, oauth2Resolver, consumableTokenService, jwtService, emailService, authEcFactory, appConfigService, auditLogsService, rateLimitService, webAuthnService, smsService, domainToOrgLookup, samlAuthService, samlMetadataService, authResponseHelper, authJwtGuard, passwordResetService, registrationService, mfaService, phoneVerificationService, methodManagementService, anonymousSessionService, userLookup) {
|
|
116
|
+
super(logger, errorBuilder, errorHandler, 'AuthenticationController');
|
|
117
|
+
this.authEcFactory = authEcFactory;
|
|
118
|
+
this.authService = authService;
|
|
119
|
+
this.tokenIssuer = tokenIssuer;
|
|
120
|
+
this.oauth2Service = oauth2Service;
|
|
121
|
+
this.oauth2Resolver = oauth2Resolver;
|
|
122
|
+
this.consumableTokenService = consumableTokenService;
|
|
123
|
+
this.jwtService = jwtService;
|
|
124
|
+
this.emailService = emailService;
|
|
125
|
+
this.appConfigService = appConfigService;
|
|
126
|
+
this.auditLogsService = auditLogsService;
|
|
127
|
+
this.rateLimitService = rateLimitService;
|
|
128
|
+
this.webAuthnService = webAuthnService;
|
|
129
|
+
this.smsService = smsService;
|
|
130
|
+
this.domainToOrgLookup = domainToOrgLookup;
|
|
131
|
+
this.samlAuthService = samlAuthService;
|
|
132
|
+
this.samlMetadataService = samlMetadataService;
|
|
133
|
+
this.authResponseHelper = authResponseHelper;
|
|
134
|
+
this.authJwtGuard = authJwtGuard;
|
|
135
|
+
this.passwordResetService = passwordResetService;
|
|
136
|
+
this.registrationService = registrationService;
|
|
137
|
+
this.mfaService = mfaService;
|
|
138
|
+
this.phoneVerificationService = phoneVerificationService;
|
|
139
|
+
this.methodManagementService = methodManagementService;
|
|
140
|
+
this.anonymousSessionService = anonymousSessionService;
|
|
141
|
+
this.userLookup = userLookup;
|
|
142
|
+
}
|
|
143
|
+
setupRoutes() {
|
|
144
|
+
// ─── Existing Authentication Routes ───
|
|
145
|
+
// User/Customer identification
|
|
146
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_IDENTIFY], this.asyncHandler(this.identify.bind(this)));
|
|
147
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_IDENTIFY], 'Identify user/customer and get available methods');
|
|
148
|
+
// Authentication methods
|
|
149
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_AUTHENTICATE_PASSWORD], this.asyncHandler(this.authenticatePassword.bind(this)));
|
|
150
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_AUTHENTICATE_PASSWORD], 'Authenticate with password');
|
|
151
|
+
// Generic authentication endpoint for all methods
|
|
152
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_AUTHENTICATE], this.asyncHandler(this.authenticate.bind(this)));
|
|
153
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_AUTHENTICATE], 'Universal authentication endpoint (all methods)');
|
|
154
|
+
// Token refresh (TRAP 11: NOT behind JWT auth — user's access token may be expired)
|
|
155
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_TOKEN_REFRESH], this.asyncHandler(this.refreshToken.bind(this)));
|
|
156
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_TOKEN_REFRESH], 'Refresh access token using refresh token');
|
|
157
|
+
// Session management
|
|
158
|
+
this.router.get(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_SESSION_STATE], this.asyncHandler(this.getSessionState.bind(this)));
|
|
159
|
+
this.logRouteRegistration('GET', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_SESSION_STATE], 'Get authentication session state');
|
|
160
|
+
// ─── OAuth2 Routes (Step 5) ───
|
|
161
|
+
// [Capacitor] [OAuth2] [SAML]
|
|
162
|
+
// These routes serve both web and Capacitor clients:
|
|
163
|
+
// - oauth2Authorize: returns authorizationUrl — web uses window.location.href, Capacitor uses Browser.open()
|
|
164
|
+
// - oauth2Callback: IdP redirects here (server-to-server) — unaffected by Capacitor
|
|
165
|
+
// - tokenExchange: frontend/Capacitor app exchanges one-time code for JWT — works identically
|
|
166
|
+
// When Capacitor introduces native Apple/Google SDKs, a new POST /auth/native-token/exchange
|
|
167
|
+
// route will be needed to accept native SDK tokens (Apple identityToken, Google idToken)
|
|
168
|
+
// and issue JWT tokens. The existing oauth2Callback route is NOT used for native SDK flows.
|
|
169
|
+
// OAuth2 authorize — returns authorization URL for frontend to redirect
|
|
170
|
+
this.router.get(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_OAUTH2_AUTHORIZE], this.asyncHandler(this.oauth2Authorize.bind(this)));
|
|
171
|
+
this.logRouteRegistration('GET', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_OAUTH2_AUTHORIZE], 'OAuth2 authorize — get IdP authorization URL');
|
|
172
|
+
// OAuth2 callback — accepts GET and POST only (L7 fix: was router.all(), narrowed to reduce attack surface)
|
|
173
|
+
// GET: standard OAuth2 authorization code flow
|
|
174
|
+
// POST: Apple uses response_mode=form_post (TRAP 5)
|
|
175
|
+
const oauth2CallbackHandler = this.asyncHandler(this.oauth2Callback.bind(this));
|
|
176
|
+
const oauth2CallbackUrl = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_OAUTH2_CALLBACK];
|
|
177
|
+
this.router.get(oauth2CallbackUrl, oauth2CallbackHandler);
|
|
178
|
+
this.router.post(oauth2CallbackUrl, oauth2CallbackHandler);
|
|
179
|
+
this.logRouteRegistration('GET+POST', oauth2CallbackUrl, 'OAuth2 callback — handle IdP redirect (GET+POST for Apple form_post)');
|
|
180
|
+
// Token exchange — frontend exchanges one-time code for JWT tokens (Decision 7)
|
|
181
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_TOKEN_EXCHANGE], this.asyncHandler(this.tokenExchange.bind(this)));
|
|
182
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_TOKEN_EXCHANGE], 'Exchange one-time code for JWT tokens');
|
|
183
|
+
// Logout — revoke refresh token
|
|
184
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_LOGOUT], this.asyncHandler(this.logout.bind(this)));
|
|
185
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_LOGOUT], 'Logout — revoke refresh token');
|
|
186
|
+
// ─── Password Reset Routes (Step 7) ───
|
|
187
|
+
// Request password reset — sends email with reset link
|
|
188
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_PASSWORD_RESET_REQUEST], this.asyncHandler(this.passwordResetRequest.bind(this)));
|
|
189
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_PASSWORD_RESET_REQUEST], 'Request password reset — send email with reset link');
|
|
190
|
+
// Complete password reset — validate token and update password
|
|
191
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_PASSWORD_RESET_COMPLETE], this.asyncHandler(this.passwordResetComplete.bind(this)));
|
|
192
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_PASSWORD_RESET_COMPLETE], 'Complete password reset — validate token and set new password');
|
|
193
|
+
// ─── Registration Routes (Step 8) ───
|
|
194
|
+
// Register — create account with email verification
|
|
195
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_REGISTER], this.asyncHandler(this.register.bind(this)));
|
|
196
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_REGISTER], 'Register — create user account with email verification');
|
|
197
|
+
// Accept invitation — public token-driven invitation completion
|
|
198
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_ACCEPT_INVITATION], this.asyncHandler(this.acceptInvitation.bind(this)));
|
|
199
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_ACCEPT_INVITATION], 'Accept invitation — create/link account and continue auth flow');
|
|
200
|
+
// Reject invitation — public token-driven invitation decline
|
|
201
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_REJECT_INVITATION], this.asyncHandler(this.rejectInvitation.bind(this)));
|
|
202
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_REJECT_INVITATION], 'Reject invitation — mark invitee decline explicitly');
|
|
203
|
+
// Verify email — confirm email and auto-login
|
|
204
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_VERIFY_EMAIL], this.asyncHandler(this.verifyEmail.bind(this)));
|
|
205
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_VERIFY_EMAIL], 'Verify email — confirm email address and issue tokens');
|
|
206
|
+
// Resend verification email (F5)
|
|
207
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_RESEND_VERIFICATION], this.asyncHandler(this.resendVerificationEmail.bind(this)));
|
|
208
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_RESEND_VERIFICATION], 'Resend verification email — re-send email verification link');
|
|
209
|
+
// W5.7: Complete org onboarding (deferred org creation)
|
|
210
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_COMPLETE_ORG_ONBOARDING], this.asyncHandler(this.completeOrgOnboarding.bind(this)));
|
|
211
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_COMPLETE_ORG_ONBOARDING], 'Complete org onboarding — create deferred organization');
|
|
212
|
+
// ─── MFA: Email OTP Routes (Step 10) ───
|
|
213
|
+
// Send email OTP — generates OTP and sends via email
|
|
214
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_MFA_EMAIL_OTP_SEND], this.asyncHandler(this.mfaEmailOTPSend.bind(this)));
|
|
215
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_MFA_EMAIL_OTP_SEND], 'Send email OTP for MFA second factor');
|
|
216
|
+
// Verify email OTP — validates the submitted OTP code
|
|
217
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_MFA_EMAIL_OTP_VERIFY], this.asyncHandler(this.mfaEmailOTPVerify.bind(this)));
|
|
218
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_MFA_EMAIL_OTP_VERIFY], 'Verify email OTP for MFA second factor');
|
|
219
|
+
// ─── MFA: TOTP Routes (Step 11) ───
|
|
220
|
+
// TOTP setup — generate secret + QR URI for enrollment
|
|
221
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_MFA_TOTP_SETUP], this.asyncHandler(this.mfaTOTPSetup.bind(this)));
|
|
222
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_MFA_TOTP_SETUP], 'Setup TOTP — generate secret and QR code URI');
|
|
223
|
+
// TOTP verify setup — confirm enrollment with a code from the authenticator app
|
|
224
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_MFA_TOTP_VERIFY_SETUP], this.asyncHandler(this.mfaTOTPVerifySetup.bind(this)));
|
|
225
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_MFA_TOTP_VERIFY_SETUP], 'Verify TOTP setup — confirm enrollment with code');
|
|
226
|
+
// TOTP verify — validate TOTP code during login MFA
|
|
227
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_MFA_TOTP_VERIFY], this.asyncHandler(this.mfaTOTPVerify.bind(this)));
|
|
228
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_MFA_TOTP_VERIFY], 'Verify TOTP code for MFA second factor');
|
|
229
|
+
// ─── Enterprise SSO Routes (Step 15) ───
|
|
230
|
+
// Enterprise OIDC authorize — initiate SSO flow for an org's OIDC connection
|
|
231
|
+
// Callback reuses the same /auth/oauth2/callback/:providerRef route — state token carries enterprise context
|
|
232
|
+
this.router.get(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_ENTERPRISE_SSO_AUTHORIZE], this.asyncHandler(this.enterpriseSSOAuthorize.bind(this)));
|
|
233
|
+
this.logRouteRegistration('GET', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_ENTERPRISE_SSO_AUTHORIZE], 'Enterprise SSO authorize — get IdP authorization URL for org OIDC connection');
|
|
234
|
+
// App-enterprise OIDC authorize — initiate SSO flow for an APPLICATION-scoped connection
|
|
235
|
+
this.router.get(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_APP_ENTERPRISE_AUTHORIZE], this.asyncHandler(this.appEnterpriseSSOAuthorize.bind(this)));
|
|
236
|
+
this.logRouteRegistration('GET', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_APP_ENTERPRISE_AUTHORIZE], 'App-enterprise SSO authorize — get IdP authorization URL for app OIDC connection');
|
|
237
|
+
// ─── SAML Routes (AUTH-2) ───
|
|
238
|
+
this.router.get(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_SAML_LOGIN], this.asyncHandler(this.handleSAMLLogin.bind(this)));
|
|
239
|
+
this.logRouteRegistration('GET', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_SAML_LOGIN], 'SAML login — initiate SP-initiated SSO');
|
|
240
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_SAML_ACS], express.urlencoded({ extended: false, limit: '2mb' }), this.asyncHandler(this.handleSAMLACS.bind(this)));
|
|
241
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_SAML_ACS], 'SAML ACS — process IdP response (SC-30: 2mb urlencoded)');
|
|
242
|
+
this.router.get(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_SAML_METADATA], this.asyncHandler(this.handleSAMLMetadata.bind(this)));
|
|
243
|
+
this.logRouteRegistration('GET', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_SAML_METADATA], 'SAML SP metadata — public XML endpoint');
|
|
244
|
+
this.router.get(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_SAML_SLO], this.asyncHandler(this.handleSAMLSLO_GET.bind(this)));
|
|
245
|
+
this.logRouteRegistration('GET', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_SAML_SLO], 'SAML SLO — IdP-initiated via HTTP-Redirect or SP-initiated LogoutResponse');
|
|
246
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_SAML_SLO], express.urlencoded({ extended: false, limit: '2mb' }), this.asyncHandler(this.handleSAMLSLO_POST.bind(this)));
|
|
247
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_SAML_SLO], 'SAML SLO — IdP-initiated via HTTP-POST');
|
|
248
|
+
// ─── WebAuthn/Passkey Routes (Phase G1) ───
|
|
249
|
+
// Registration (JWT-authenticated)
|
|
250
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_PASSKEY_REGISTER_OPTIONS], this.asyncHandler(this.handlePasskeyRegisterOptions.bind(this)));
|
|
251
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_PASSKEY_REGISTER_OPTIONS], 'Passkey register options — generate registration challenge');
|
|
252
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_PASSKEY_REGISTER_VERIFY], this.asyncHandler(this.handlePasskeyRegisterVerify.bind(this)));
|
|
253
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_PASSKEY_REGISTER_VERIFY], 'Passkey register verify — verify and store credential');
|
|
254
|
+
// Authentication (unauthenticated — part of login flow)
|
|
255
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_PASSKEY_AUTH_OPTIONS], this.asyncHandler(this.handlePasskeyAuthOptions.bind(this)));
|
|
256
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_PASSKEY_AUTH_OPTIONS], 'Passkey auth options — generate authentication challenge');
|
|
257
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_PASSKEY_AUTH_VERIFY], this.asyncHandler(this.handlePasskeyAuthVerify.bind(this)));
|
|
258
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_PASSKEY_AUTH_VERIFY], 'Passkey auth verify — verify assertion and complete login');
|
|
259
|
+
// Management (JWT-authenticated)
|
|
260
|
+
this.router.get(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_PASSKEY_LIST], this.asyncHandler(this.handlePasskeyList.bind(this)));
|
|
261
|
+
this.logRouteRegistration('GET', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_PASSKEY_LIST], 'Passkey list — list registered passkeys');
|
|
262
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_PASSKEY_REMOVE], this.asyncHandler(this.handlePasskeyRemove.bind(this)));
|
|
263
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_PASSKEY_REMOVE], 'Passkey remove — remove a passkey');
|
|
264
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_PASSKEY_RENAME], this.asyncHandler(this.handlePasskeyRename.bind(this)));
|
|
265
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_PASSKEY_RENAME], 'Passkey rename — rename a passkey');
|
|
266
|
+
// ─── Magic Link Routes (Phase G2) ───
|
|
267
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_MAGIC_LINK_SEND], this.asyncHandler(this.magicLinkSend.bind(this)));
|
|
268
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_MAGIC_LINK_SEND], 'Magic link send — send passwordless login link via email');
|
|
269
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_MAGIC_LINK_VERIFY], this.asyncHandler(this.magicLinkVerify.bind(this)));
|
|
270
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_MAGIC_LINK_VERIFY], 'Magic link verify — verify token and issue auth tokens');
|
|
271
|
+
// ─── SMS OTP Routes (Phase G2) ───
|
|
272
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_SMS_OTP_SEND], this.asyncHandler(this.smsOTPSend.bind(this)));
|
|
273
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_SMS_OTP_SEND], 'SMS OTP send — send OTP code via SMS');
|
|
274
|
+
// Note: SMS OTP verify goes through the generic /auth/authenticate endpoint via SMS_OTP method
|
|
275
|
+
// ─── Phone Verification Routes (Phase G2) ───
|
|
276
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_PHONE_VERIFY_SEND], this.asyncHandler(this.phoneVerifySend.bind(this)));
|
|
277
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_PHONE_VERIFY_SEND], 'Phone verify send — send verification code via SMS');
|
|
278
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_PHONE_VERIFY_CONFIRM], this.asyncHandler(this.phoneVerifyConfirm.bind(this)));
|
|
279
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_PHONE_VERIFY_CONFIRM], 'Phone verify confirm — confirm phone ownership with code');
|
|
280
|
+
// ─── Native SDK Token Exchange (F2) ───
|
|
281
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_NATIVE_TOKEN_EXCHANGE], this.asyncHandler(this.nativeTokenExchange.bind(this)));
|
|
282
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_NATIVE_TOKEN_EXCHANGE], 'Exchange native SDK identity token for Wildo JWT');
|
|
283
|
+
// ─── One-Off Session Routes (W7.3b) ───
|
|
284
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_ONE_OFF_SESSION_CREATE], this.asyncHandler(this.createOneOffToken.bind(this)));
|
|
285
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_ONE_OFF_SESSION_CREATE], 'Create one-off session token (app-scoped)');
|
|
286
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_ONE_OFF_SESSION_CREATE_ORG], this.asyncHandler(this.createOneOffToken.bind(this)));
|
|
287
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_ONE_OFF_SESSION_CREATE_ORG], 'Create one-off session token (org+app-scoped)');
|
|
288
|
+
this.router.post(MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_ONE_OFF_SESSION_EXCHANGE], this.asyncHandler(this.exchangeOneOffToken.bind(this)));
|
|
289
|
+
this.logRouteRegistration('POST', MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.AUTH_ONE_OFF_SESSION_EXCHANGE], 'Exchange one-off token for JWT session');
|
|
290
|
+
}
|
|
291
|
+
// ═══════════════════════════════════════════════════════════════
|
|
292
|
+
// Existing Authentication Route Handlers
|
|
293
|
+
// ═══════════════════════════════════════════════════════════════
|
|
294
|
+
async identify(req, res) {
|
|
295
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
296
|
+
const body = AuthIdentificationRequestSchema.parse(req.body || {});
|
|
297
|
+
// Capture device information from request headers (consistent IP extraction)
|
|
298
|
+
const deviceInfo = {
|
|
299
|
+
userAgent: req.headers[WildoHeaderKeys.USER_AGENT] || 'unknown',
|
|
300
|
+
ipAddress: AuthControllerUtils.getClientIpFromRequest(req),
|
|
301
|
+
};
|
|
302
|
+
const identificationRequest = {
|
|
303
|
+
...body,
|
|
304
|
+
deviceInfo
|
|
305
|
+
};
|
|
306
|
+
// W3.5 + W3.11: Resolve activeUserType hint from X-Frontend-Service-Name header.
|
|
307
|
+
// AUTH-10: This is only a hint for pre-identification flows (unknown users).
|
|
308
|
+
// For known users, the orchestrator overrides with the DB-stored userTypes[0].
|
|
309
|
+
// AUTH-10: Cross-validate Origin against claimed frontend service identity (defense-in-depth).
|
|
310
|
+
const frontendServiceName = req.headers[WildoHeaderKeys.FRONTEND_SERVICE_NAME];
|
|
311
|
+
this._validateFrontendAppOrigin(req, frontendServiceName);
|
|
312
|
+
const activeUserType = frontendServiceName
|
|
313
|
+
? this.appConfigService.resolveUserTypeFromFrontendServiceName(frontendServiceName) ?? undefined
|
|
314
|
+
: undefined;
|
|
315
|
+
const result = await this.authService.identify(ec, identificationRequest, activeUserType, frontendServiceName);
|
|
316
|
+
this.jsonSuccess(res, result);
|
|
317
|
+
}
|
|
318
|
+
async authenticatePassword(req, res) {
|
|
319
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
320
|
+
const body = PasswordAuthBodySchema.parse(req.body || {});
|
|
321
|
+
const passwordRequest = {
|
|
322
|
+
sessionId: body.sessionId,
|
|
323
|
+
method: body.method,
|
|
324
|
+
factorLevel: body.factorLevel,
|
|
325
|
+
password: body.password,
|
|
326
|
+
email: body.email, // Email should be available from session, but included for compatibility
|
|
327
|
+
rememberMe: false,
|
|
328
|
+
requestedIntegrations: []
|
|
329
|
+
};
|
|
330
|
+
const result = await this.authService.authenticatePassword(ec, passwordRequest);
|
|
331
|
+
await this.handleAnonymousTransposition(req, result);
|
|
332
|
+
this.jsonSuccess(res, result);
|
|
333
|
+
}
|
|
334
|
+
// Generic authenticate endpoint for future extensibility (SSO/MFA/etc.)
|
|
335
|
+
async authenticate(req, res) {
|
|
336
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
337
|
+
const request = AuthenticationRequestSchema.parse(req.body || {});
|
|
338
|
+
const result = await this.authService.authenticate(ec, request);
|
|
339
|
+
await this.handleAnonymousTransposition(req, result);
|
|
340
|
+
this.jsonSuccess(res, result);
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Refresh access token using a valid refresh token.
|
|
344
|
+
* POST /auth/token/refresh
|
|
345
|
+
* Body: { refreshToken: string }
|
|
346
|
+
* Response: { accessToken, refreshToken?, expiresIn }
|
|
347
|
+
*
|
|
348
|
+
* TRAP 11: This endpoint is NOT behind JWT auth middleware.
|
|
349
|
+
* The user's access token is expired — that's why they're calling refresh.
|
|
350
|
+
*/
|
|
351
|
+
async refreshToken(req, res) {
|
|
352
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
353
|
+
const body = RefreshTokenBodySchema.parse(req.body || {});
|
|
354
|
+
const tokens = await this.tokenIssuer.refreshAccessToken(body.refreshToken);
|
|
355
|
+
// H5: Audit token refresh
|
|
356
|
+
try {
|
|
357
|
+
const decoded = await this.jwtService.verify(tokens.accessToken);
|
|
358
|
+
if (typeof decoded === 'object' && decoded !== null) {
|
|
359
|
+
const payload = decoded;
|
|
360
|
+
const refreshUserId = typeof payload.userId === 'string' ? payload.userId : undefined;
|
|
361
|
+
const sessionId = typeof payload.sessionId === 'string' ? payload.sessionId : 'unknown';
|
|
362
|
+
if (refreshUserId) {
|
|
363
|
+
this.auditLogsService.logUserTokenRefreshed({
|
|
364
|
+
userId: refreshUserId,
|
|
365
|
+
sessionId,
|
|
366
|
+
ipAddress: AuthControllerUtils.getClientIpFromRequest(req),
|
|
367
|
+
userAgent: req.headers[WildoHeaderKeys.USER_AGENT] || 'unknown',
|
|
368
|
+
}).catch(() => { });
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
catch { /* token decode failure — don't block the response */ }
|
|
373
|
+
this.jsonSuccess(res, tokens);
|
|
374
|
+
}
|
|
375
|
+
// Get current authentication session state
|
|
376
|
+
async getSessionState(req, res) {
|
|
377
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
378
|
+
const sessionId = req.params.sessionId;
|
|
379
|
+
if (!sessionId) {
|
|
380
|
+
return this.jsonError(res, 'Session ID is required');
|
|
381
|
+
}
|
|
382
|
+
const sessionState = await this.authService.getAuthenticationSessionState(ec, sessionId);
|
|
383
|
+
if (!sessionState) {
|
|
384
|
+
return this.jsonError(res, 'Session not found or expired');
|
|
385
|
+
}
|
|
386
|
+
// H2 fix: Strip sensitive fields from public endpoint to prevent enumeration.
|
|
387
|
+
// Removed: email, userExists, userId (H2), remainingAttempts, lockedUntil (review fix #5).
|
|
388
|
+
// Frontend uses error responses (customMessageReference, authResponse) for retry/lockout UI.
|
|
389
|
+
const publicSessionState = {
|
|
390
|
+
sessionId: sessionState.sessionId,
|
|
391
|
+
state: sessionState.state,
|
|
392
|
+
completedFactors: sessionState.completedFactors,
|
|
393
|
+
currentFactor: sessionState.currentFactor,
|
|
394
|
+
availableFirstFactorMethods: sessionState.availableFirstFactorMethods,
|
|
395
|
+
availableSecondFactorMethods: sessionState.availableSecondFactorMethods,
|
|
396
|
+
enrolledSecondFactorMethods: sessionState.enrolledSecondFactorMethods,
|
|
397
|
+
usableSecondFactorMethods: sessionState.usableSecondFactorMethods,
|
|
398
|
+
requiresMFA: sessionState.requiresMFA,
|
|
399
|
+
requireStrongMFA: sessionState.requireStrongMFA,
|
|
400
|
+
mfaMethodsRequired: sessionState.mfaMethodsRequired,
|
|
401
|
+
expiresAt: sessionState.expiresAt,
|
|
402
|
+
};
|
|
403
|
+
this.jsonSuccess(res, publicSessionState);
|
|
404
|
+
}
|
|
405
|
+
// ═══════════════════════════════════════════════════════════════
|
|
406
|
+
// OAuth2 Route Handlers (Step 5)
|
|
407
|
+
// ═══════════════════════════════════════════════════════════════
|
|
408
|
+
/**
|
|
409
|
+
* GET /auth/oauth2/authorize/:providerRef
|
|
410
|
+
*
|
|
411
|
+
* Initiates an OAuth2 authorization flow for a social SSO provider.
|
|
412
|
+
* Returns the IdP authorization URL for the frontend to redirect to.
|
|
413
|
+
*
|
|
414
|
+
* Enterprise-ready: In Step 14/15, a query param (?org=...&connection=...)
|
|
415
|
+
* will trigger resolveEnterpriseConnection() instead.
|
|
416
|
+
*/
|
|
417
|
+
async oauth2Authorize(req, res) {
|
|
418
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
419
|
+
const providerRef = req.params.providerRef;
|
|
420
|
+
if (!providerRef) {
|
|
421
|
+
throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {
|
|
422
|
+
customMessageReference: ErrorCustomMessageReference.VALIDATION,
|
|
423
|
+
context: { message: 'providerRef parameter is required' },
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
// G3 + P3: Determine scope context from email hint before resolving credentials.
|
|
427
|
+
// Used for both provider restriction checks (G3) and social credential overrides (P3).
|
|
428
|
+
const emailHint = req.query.email;
|
|
429
|
+
let scopeContext;
|
|
430
|
+
if (emailHint) {
|
|
431
|
+
const emailDomain = emailHint.split('@')[1]?.toLowerCase();
|
|
432
|
+
if (emailDomain) {
|
|
433
|
+
const orgLookup = await this.domainToOrgLookup.findOrgByDomain(ec, emailDomain);
|
|
434
|
+
if (orgLookup) {
|
|
435
|
+
scopeContext = { scopeType: orgLookup.scopeType, scopeId: orgLookup.scopeId };
|
|
436
|
+
// G3: Check org-level provider restrictions (UX optimization — hard enforcement in callback G3-M5)
|
|
437
|
+
const { allowed, reason } = await this.oauth2Resolver.isProviderAllowed(ec, orgLookup.scopeType, orgLookup.scopeId, providerRef);
|
|
438
|
+
if (!allowed) {
|
|
439
|
+
await this.auditLogsService.logOAuth2ProviderBlocked({
|
|
440
|
+
email: emailHint,
|
|
441
|
+
providerRef,
|
|
442
|
+
organizationId: orgLookup.scopeId,
|
|
443
|
+
reason: reason || 'Organization policy',
|
|
444
|
+
ipAddress: AuthControllerUtils.getClientIpFromRequest(req),
|
|
445
|
+
userAgent: req.headers[WildoHeaderKeys.USER_AGENT] || 'unknown',
|
|
446
|
+
});
|
|
447
|
+
throw this.errorBuilder.buildError(ErrorType.AUTHENTICATION, undefined, {
|
|
448
|
+
customMessageReference: ErrorCustomMessageReference.AUTHENTICATION_INVALID_TOKEN,
|
|
449
|
+
context: { message: reason || 'This login provider is not allowed for your organization.' },
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
// Resolve connection config from catalog + app config + secrets + scope overrides (P3)
|
|
456
|
+
const connection = await this.oauth2Resolver.resolveSocialConnection(providerRef, scopeContext ? { ec, ...scopeContext } : undefined);
|
|
457
|
+
// Validate the frontend originator early — fail now with a clear error instead of
|
|
458
|
+
// silently storing undefined in the state token and getting a confusing error on callback.
|
|
459
|
+
// resolveFrontendAppPublicUrl throws if the header is missing or the frontend service is unknown.
|
|
460
|
+
const frontendUrl = this.resolveFrontendAppPublicUrl(req);
|
|
461
|
+
const frontendServiceName = req.headers[WildoHeaderKeys.FRONTEND_SERVICE_NAME];
|
|
462
|
+
const returnUrl = typeof req.query.returnUrl === 'string' ? req.query.returnUrl : undefined;
|
|
463
|
+
void frontendUrl; // validated and discarded — the URL is resolved again on callback from the state token
|
|
464
|
+
if (returnUrl) {
|
|
465
|
+
this.validateFrontendReturnUrl(returnUrl, frontendUrl);
|
|
466
|
+
}
|
|
467
|
+
// Build the authorization URL with PKCE + state token (includes frontendServiceName + scope in state)
|
|
468
|
+
const { authorizationUrl } = await this.oauth2Service.buildAuthorizationUrl(connection, {
|
|
469
|
+
frontendServiceName,
|
|
470
|
+
scopeType: scopeContext?.scopeType,
|
|
471
|
+
scopeId: scopeContext?.scopeId,
|
|
472
|
+
returnUrl,
|
|
473
|
+
});
|
|
474
|
+
this.logDebug('OAuth2 authorize URL generated', {
|
|
475
|
+
providerRef,
|
|
476
|
+
connectionType: connection.connectionType,
|
|
477
|
+
});
|
|
478
|
+
this.jsonSuccess(res, { authorizationUrl });
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* GET /auth/enterprise/authorize/:orgId/:connectionId
|
|
482
|
+
*
|
|
483
|
+
* Initiates an enterprise SSO OIDC flow for an organization's connection.
|
|
484
|
+
* Uses the same OAuth2 engine — only the resolver path is different.
|
|
485
|
+
* The callback reuses /auth/oauth2/callback/:providerRef — the state token
|
|
486
|
+
* carries connectionType='enterprise', organizationId, and connectionId.
|
|
487
|
+
*
|
|
488
|
+
* Step 15: Enterprise SSO authorize route.
|
|
489
|
+
*/
|
|
490
|
+
async enterpriseSSOAuthorize(req, res) {
|
|
491
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
492
|
+
const orgId = req.params.orgId;
|
|
493
|
+
const connectionId = req.params.connectionId;
|
|
494
|
+
if (!orgId || !connectionId) {
|
|
495
|
+
throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {
|
|
496
|
+
customMessageReference: ErrorCustomMessageReference.VALIDATION,
|
|
497
|
+
context: { message: 'orgId and connectionId parameters are required' },
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
// Resolve enterprise connection from org config
|
|
501
|
+
const connection = await this.oauth2Resolver.resolveEnterpriseConnection(ec, AuthScopeType.ORGANIZATION, orgId, connectionId);
|
|
502
|
+
// Validate the frontend originator
|
|
503
|
+
const frontendUrl = this.resolveFrontendAppPublicUrl(req);
|
|
504
|
+
const frontendServiceName = req.headers[WildoHeaderKeys.FRONTEND_SERVICE_NAME];
|
|
505
|
+
const returnUrl = typeof req.query.returnUrl === 'string' ? req.query.returnUrl : undefined;
|
|
506
|
+
void frontendUrl;
|
|
507
|
+
if (returnUrl) {
|
|
508
|
+
this.validateFrontendReturnUrl(returnUrl, frontendUrl);
|
|
509
|
+
}
|
|
510
|
+
// Build the authorization URL using the same OAuth2 engine
|
|
511
|
+
const { authorizationUrl } = await this.oauth2Service.buildAuthorizationUrl(connection, {
|
|
512
|
+
frontendServiceName,
|
|
513
|
+
returnUrl,
|
|
514
|
+
});
|
|
515
|
+
this.logDebug('Enterprise SSO authorize URL generated', {
|
|
516
|
+
orgId,
|
|
517
|
+
connectionId,
|
|
518
|
+
connectionType: connection.connectionType,
|
|
519
|
+
providerRef: connection.providerRef,
|
|
520
|
+
});
|
|
521
|
+
this.jsonSuccess(res, { authorizationUrl });
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* GET /auth/app-enterprise/authorize/:connectionId
|
|
525
|
+
*
|
|
526
|
+
* Application-scoped enterprise SSO authorize route.
|
|
527
|
+
* Same flow as org-scoped enterpriseSSOAuthorize but resolves from APPLICATION scope.
|
|
528
|
+
*/
|
|
529
|
+
async appEnterpriseSSOAuthorize(req, res) {
|
|
530
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
531
|
+
const connectionId = req.params.connectionId;
|
|
532
|
+
if (!connectionId) {
|
|
533
|
+
throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {
|
|
534
|
+
customMessageReference: ErrorCustomMessageReference.VALIDATION,
|
|
535
|
+
context: { message: 'connectionId parameter is required' },
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
const appId = req.headers[WildoHeaderKeys.APPLICATION_ID];
|
|
539
|
+
if (!appId) {
|
|
540
|
+
throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {
|
|
541
|
+
customMessageReference: ErrorCustomMessageReference.VALIDATION,
|
|
542
|
+
context: { message: 'Application ID header is required for app-enterprise SSO' },
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
const connection = await this.oauth2Resolver.resolveEnterpriseConnection(ec, AuthScopeType.APPLICATION, appId, connectionId);
|
|
546
|
+
// Validate the frontend originator early so OAuth state always carries
|
|
547
|
+
// a usable frontendServiceName for callback redirection.
|
|
548
|
+
const frontendUrl = this.resolveFrontendAppPublicUrl(req);
|
|
549
|
+
const frontendServiceName = req.headers[WildoHeaderKeys.FRONTEND_SERVICE_NAME];
|
|
550
|
+
const returnUrl = typeof req.query.returnUrl === 'string' ? req.query.returnUrl : undefined;
|
|
551
|
+
void frontendUrl;
|
|
552
|
+
if (returnUrl) {
|
|
553
|
+
this.validateFrontendReturnUrl(returnUrl, frontendUrl);
|
|
554
|
+
}
|
|
555
|
+
const { authorizationUrl } = await this.oauth2Service.buildAuthorizationUrl(connection, {
|
|
556
|
+
frontendServiceName,
|
|
557
|
+
returnUrl,
|
|
558
|
+
});
|
|
559
|
+
this.logDebug('App-enterprise SSO authorize URL generated', {
|
|
560
|
+
appId,
|
|
561
|
+
connectionId,
|
|
562
|
+
connectionType: connection.connectionType,
|
|
563
|
+
providerRef: connection.providerRef,
|
|
564
|
+
});
|
|
565
|
+
this.jsonSuccess(res, { authorizationUrl });
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* GET /auth/saml/login/:connectionId
|
|
569
|
+
*
|
|
570
|
+
* Initiate SP-initiated SAML SSO. Generates an AuthnRequest,
|
|
571
|
+
* creates a state token, and redirects the browser to the IdP SSO URL.
|
|
572
|
+
*
|
|
573
|
+
* Rate limit: SC-38 — 10 req/min per IP.
|
|
574
|
+
*/
|
|
575
|
+
async handleSAMLLogin(req, res) {
|
|
576
|
+
const clientIp = AuthControllerUtils.getClientIpFromRequest(req);
|
|
577
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.SAML_LOGIN_IP}${clientIp}`, 10, 60);
|
|
578
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
579
|
+
const connectionId = req.params.connectionId;
|
|
580
|
+
const returnUrl = req.query.returnUrl || '/';
|
|
581
|
+
try {
|
|
582
|
+
const { redirectUrl } = await this.samlAuthService.initiateLogin(ec, connectionId, returnUrl);
|
|
583
|
+
res.redirect(302, redirectUrl);
|
|
584
|
+
}
|
|
585
|
+
catch (error) {
|
|
586
|
+
if (isWildoBackendError(error)) {
|
|
587
|
+
this.logger.warn('SAML login initiation failed', { connectionId });
|
|
588
|
+
}
|
|
589
|
+
else {
|
|
590
|
+
this.logger.error('SAML login initiation failed with unexpected error', {
|
|
591
|
+
connectionId,
|
|
592
|
+
error: error instanceof Error ? error.message : String(error),
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
const frontendUrl = this._resolveSAMLRedirectUrl();
|
|
596
|
+
return this.redirectToFrontendWithError(res, AuthRedirectErrorCode.SAML_LOGIN_FAILED, 'Authentication failed. Please try again.', frontendUrl);
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* POST /auth/saml/acs
|
|
601
|
+
*
|
|
602
|
+
* Assertion Consumer Service — processes the SAML Response from the IdP.
|
|
603
|
+
* Route-specific body parser: `express.urlencoded({ extended: false, limit: '2mb' })` (SC-30).
|
|
604
|
+
*
|
|
605
|
+
* Rate limit: SC-39 — 20 req/min per IP (higher because IdPs may retry).
|
|
606
|
+
* E16: POST-only (enforced by route registration).
|
|
607
|
+
* E19: RelayState size check — accept up to 1024 bytes, warn if >80.
|
|
608
|
+
*/
|
|
609
|
+
async handleSAMLACS(req, res) {
|
|
610
|
+
const clientIp = AuthControllerUtils.getClientIpFromRequest(req);
|
|
611
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.SAML_ACS_IP}${clientIp}`, 20, 60);
|
|
612
|
+
const samlResponse = req.body?.SAMLResponse;
|
|
613
|
+
const relayState = req.body?.RelayState;
|
|
614
|
+
if (!samlResponse) {
|
|
615
|
+
const frontendUrl = this._resolveSAMLRedirectUrl();
|
|
616
|
+
return this.redirectToFrontendWithError(res, AuthRedirectErrorCode.SAML_AUTH_FAILED, 'Authentication failed.', frontendUrl);
|
|
617
|
+
}
|
|
618
|
+
if (relayState && relayState.length > 1024) {
|
|
619
|
+
this.logger.warn('SAML RelayState exceeds 1024 bytes, rejecting', { length: relayState.length });
|
|
620
|
+
const frontendUrl = this._resolveSAMLRedirectUrl();
|
|
621
|
+
return this.redirectToFrontendWithError(res, AuthRedirectErrorCode.SAML_AUTH_FAILED, 'Authentication failed.', frontendUrl);
|
|
622
|
+
}
|
|
623
|
+
if (relayState && relayState.length > 80) {
|
|
624
|
+
this.logger.warn('SAML RelayState exceeds 80-byte spec limit (accepted)', { length: relayState.length });
|
|
625
|
+
}
|
|
626
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
627
|
+
try {
|
|
628
|
+
const clientContext = {
|
|
629
|
+
ipAddress: clientIp,
|
|
630
|
+
userAgent: req.headers[WildoHeaderKeys.USER_AGENT] || 'unknown',
|
|
631
|
+
};
|
|
632
|
+
const result = await this.samlAuthService.handleACS(ec, samlResponse, relayState, clientContext);
|
|
633
|
+
res.redirect(302, result.redirectUrl);
|
|
634
|
+
}
|
|
635
|
+
catch (error) {
|
|
636
|
+
if (isWildoBackendError(error)) {
|
|
637
|
+
this.logger.warn('SAML ACS processing failed', {
|
|
638
|
+
errorRef: error.customMessageReference || 'unknown',
|
|
639
|
+
});
|
|
640
|
+
}
|
|
641
|
+
else {
|
|
642
|
+
this.logger.error('SAML ACS failed with unexpected error', {
|
|
643
|
+
error: error instanceof Error ? error.message : String(error),
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
const frontendUrl = this._resolveSAMLRedirectUrl();
|
|
647
|
+
return this.redirectToFrontendWithError(res, AuthRedirectErrorCode.SAML_AUTH_FAILED, 'Authentication failed. Please try again.', frontendUrl);
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* GET /auth/saml/metadata/:scopeType/:scopeId
|
|
652
|
+
*
|
|
653
|
+
* Public endpoint — returns SP metadata XML for IdP admins to configure their IdP.
|
|
654
|
+
* No auth middleware required (D16).
|
|
655
|
+
* Content-Type: application/samlmetadata+xml
|
|
656
|
+
*/
|
|
657
|
+
async handleSAMLMetadata(req, res) {
|
|
658
|
+
const scopeType = req.params.scopeType;
|
|
659
|
+
const scopeId = req.params.scopeId;
|
|
660
|
+
const metadataXml = this.samlMetadataService.generateSPMetadata(scopeType, scopeId);
|
|
661
|
+
res.set(WildoHeaderKeys.CONTENT_TYPE, 'application/samlmetadata+xml');
|
|
662
|
+
res.status(200).send(metadataXml);
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* GET /auth/saml/slo
|
|
666
|
+
*
|
|
667
|
+
* Handles two distinct cases via query params:
|
|
668
|
+
* - `SAMLRequest` present → IdP-initiated SLO (HTTP-Redirect binding)
|
|
669
|
+
* - `SAMLResponse` present → IdP's response to our SP-initiated SLO
|
|
670
|
+
*
|
|
671
|
+
* Rate limit: SC-40 — 10 req/min per IP.
|
|
672
|
+
*/
|
|
673
|
+
async handleSAMLSLO_GET(req, res) {
|
|
674
|
+
const clientIp = AuthControllerUtils.getClientIpFromRequest(req);
|
|
675
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.SAML_SLO_IP}${clientIp}`, 10, 60);
|
|
676
|
+
const samlRequest = req.query.SAMLRequest;
|
|
677
|
+
const samlResponse = req.query.SAMLResponse;
|
|
678
|
+
const relayState = req.query.RelayState;
|
|
679
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
680
|
+
if (samlRequest) {
|
|
681
|
+
try {
|
|
682
|
+
const result = await this.samlAuthService.handleIdPInitiatedSLO(ec, 'redirect', samlRequest, relayState);
|
|
683
|
+
res.redirect(302, result.logoutResponseUrl);
|
|
684
|
+
}
|
|
685
|
+
catch (error) {
|
|
686
|
+
this.logger.warn('SAML SLO (IdP-initiated GET) failed', {
|
|
687
|
+
errorRef: isWildoBackendError(error) ? error.customMessageReference : 'unknown',
|
|
688
|
+
error: error instanceof Error ? error.message : String(error),
|
|
689
|
+
});
|
|
690
|
+
const frontendUrl = this._resolveSAMLRedirectUrl();
|
|
691
|
+
return this.redirectToFrontendWithError(res, AuthRedirectErrorCode.SAML_SLO_FAILED, 'Logout failed.', frontendUrl);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
else if (samlResponse) {
|
|
695
|
+
try {
|
|
696
|
+
await this.samlAuthService.handleSLOResponse(ec, 'redirect', samlResponse);
|
|
697
|
+
}
|
|
698
|
+
catch (error) {
|
|
699
|
+
this.logger.warn('SAML SLO LogoutResponse processing failed (GET)', {
|
|
700
|
+
error: error instanceof Error ? error.message : String(error),
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
const frontendUrl = this._resolveSAMLRedirectUrl() || '/';
|
|
704
|
+
res.redirect(302, `${frontendUrl}/auth/login?slo=success`);
|
|
705
|
+
}
|
|
706
|
+
else {
|
|
707
|
+
res.status(400).json({ error: 'Missing SAMLRequest or SAMLResponse parameter' });
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
/**
|
|
711
|
+
* POST /auth/saml/slo
|
|
712
|
+
*
|
|
713
|
+
* IdP-initiated SLO via HTTP-POST binding.
|
|
714
|
+
* Route-specific body parser: `express.urlencoded({ extended: false, limit: '2mb' })`.
|
|
715
|
+
*
|
|
716
|
+
* Rate limit: SC-40 — 10 req/min per IP.
|
|
717
|
+
*/
|
|
718
|
+
async handleSAMLSLO_POST(req, res) {
|
|
719
|
+
const clientIp = AuthControllerUtils.getClientIpFromRequest(req);
|
|
720
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.SAML_SLO_IP}${clientIp}`, 10, 60);
|
|
721
|
+
const samlRequest = req.body?.SAMLRequest;
|
|
722
|
+
const samlResponse = req.body?.SAMLResponse;
|
|
723
|
+
const relayState = req.body?.RelayState;
|
|
724
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
725
|
+
if (samlRequest) {
|
|
726
|
+
try {
|
|
727
|
+
const result = await this.samlAuthService.handleIdPInitiatedSLO(ec, 'post', samlRequest, relayState);
|
|
728
|
+
res.redirect(302, result.logoutResponseUrl);
|
|
729
|
+
}
|
|
730
|
+
catch (error) {
|
|
731
|
+
this.logger.warn('SAML SLO (IdP-initiated POST) failed', {
|
|
732
|
+
errorRef: isWildoBackendError(error) ? error.customMessageReference : 'unknown',
|
|
733
|
+
error: error instanceof Error ? error.message : String(error),
|
|
734
|
+
});
|
|
735
|
+
const frontendUrl = this._resolveSAMLRedirectUrl();
|
|
736
|
+
return this.redirectToFrontendWithError(res, AuthRedirectErrorCode.SAML_SLO_FAILED, 'Logout failed.', frontendUrl);
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
else if (samlResponse) {
|
|
740
|
+
try {
|
|
741
|
+
await this.samlAuthService.handleSLOResponse(ec, 'post', samlResponse);
|
|
742
|
+
}
|
|
743
|
+
catch (error) {
|
|
744
|
+
this.logger.warn('SAML SLO LogoutResponse processing failed (POST)', {
|
|
745
|
+
error: error instanceof Error ? error.message : String(error),
|
|
746
|
+
});
|
|
747
|
+
}
|
|
748
|
+
const frontendUrl = this._resolveSAMLRedirectUrl() || '/';
|
|
749
|
+
res.redirect(302, `${frontendUrl}/auth/login?slo=success`);
|
|
750
|
+
}
|
|
751
|
+
else {
|
|
752
|
+
res.status(400).json({ error: 'Missing SAMLRequest or SAMLResponse parameter' });
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
/**
|
|
756
|
+
* Resolve a frontend URL for SAML redirects.
|
|
757
|
+
* Uses the user-type → frontend-service reverse lookup from `frontendServices.usersManagement`.
|
|
758
|
+
* When `userType` is provided (post-identification), resolves the frontend service that serves that user type.
|
|
759
|
+
* Falls back to the config's default frontend service (first with any `isDefault` entry).
|
|
760
|
+
*/
|
|
761
|
+
_resolveSAMLRedirectUrl(userType) {
|
|
762
|
+
try {
|
|
763
|
+
const frontendServiceName = userType
|
|
764
|
+
? this.appConfigService.resolveFrontendServiceNameFromUserType(userType)
|
|
765
|
+
: this.appConfigService.resolveDefaultFrontendServiceName();
|
|
766
|
+
if (!frontendServiceName)
|
|
767
|
+
return undefined;
|
|
768
|
+
return this.resolveFrontendAppPublicUrlFromFrontendServiceName(frontendServiceName);
|
|
769
|
+
}
|
|
770
|
+
catch {
|
|
771
|
+
return undefined;
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
/**
|
|
775
|
+
* GET+POST /auth/oauth2/callback/:providerRef
|
|
776
|
+
*
|
|
777
|
+
* Handles the IdP redirect after user authentication.
|
|
778
|
+
* Accepts both GET and POST — TRAP 5: Apple uses response_mode=form_post.
|
|
779
|
+
*
|
|
780
|
+
* Flow:
|
|
781
|
+
* 1. Extract code/state from query (GET) or body (POST)
|
|
782
|
+
* 2. handleCallback() — validate state, exchange code, extract profile
|
|
783
|
+
* 3. provisionOrLinkUser() — find/create user, create identity link
|
|
784
|
+
* 4. Issue JWT tokens via AuthTokenIssuer.issueTokensForUser() (TRAP 12)
|
|
785
|
+
* 5. Create AUTH_CODE_EXCHANGE consumable token containing JWT tokens
|
|
786
|
+
* 6. Redirect to frontend /auth/callback?code={consumableTokenCode}
|
|
787
|
+
*
|
|
788
|
+
* [Capacitor] [OAuth2] [SAML]
|
|
789
|
+
* The final redirect URL ({frontendUrl}/auth/callback?code=xxx) must be reachable by
|
|
790
|
+
* the client. On web, it's a normal navigation. On Capacitor, this URL must be configured
|
|
791
|
+
* as a Universal Link (iOS) / App Link (Android) so the OS routes it to the native app.
|
|
792
|
+
* The frontendUrl in app config may need a platform-aware variant (e.g., a custom URL scheme
|
|
793
|
+
* fallback: com.wildo.app://auth/callback?code=xxx) if Universal Links are not configured.
|
|
794
|
+
*
|
|
795
|
+
* TRAP 13: Audit logging for OAuth2 logins happens HERE (not in the engine).
|
|
796
|
+
*/
|
|
797
|
+
async oauth2Callback(req, res) {
|
|
798
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
799
|
+
// M10 fix: Check for IdP error parameters FIRST, before extracting code/state.
|
|
800
|
+
// If the IdP sends both error and code/state (some IdPs do this), we must handle
|
|
801
|
+
// the error rather than consuming the state token and attempting a code exchange
|
|
802
|
+
// that will fail with an opaque error.
|
|
803
|
+
const idpError = req.query.error || req.body?.error;
|
|
804
|
+
if (idpError) {
|
|
805
|
+
const errorDescription = req.query.error_description || req.body?.error_description || 'Authentication denied by identity provider';
|
|
806
|
+
// Try to peek at the state token (without consuming it) to resolve the frontendUrl
|
|
807
|
+
// for a user-friendly redirect instead of a raw JSON 400 response.
|
|
808
|
+
// The state token expires naturally — not consuming it is safe.
|
|
809
|
+
let errorRedirectUrl;
|
|
810
|
+
let errorReturnUrl;
|
|
811
|
+
const stateValue = req.query.state || req.body?.state;
|
|
812
|
+
if (stateValue) {
|
|
813
|
+
try {
|
|
814
|
+
const stateToken = await this.consumableTokenService.validateToken(stateValue);
|
|
815
|
+
const stateMetadata = stateToken.metadata;
|
|
816
|
+
const frontendServiceName = stateMetadata?.frontendServiceName;
|
|
817
|
+
errorReturnUrl = typeof stateMetadata?.returnUrl === 'string'
|
|
818
|
+
? stateMetadata.returnUrl
|
|
819
|
+
: undefined;
|
|
820
|
+
if (frontendServiceName) {
|
|
821
|
+
errorRedirectUrl = this.resolveFrontendAppPublicUrlFromFrontendServiceName(frontendServiceName);
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
catch {
|
|
825
|
+
// State token invalid/expired — fall through to JSON fallback
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
return this.redirectToFrontendWithError(res, idpError, errorDescription, errorRedirectUrl, errorReturnUrl);
|
|
829
|
+
}
|
|
830
|
+
// 1. Extract code and state from query (GET) or body (POST)
|
|
831
|
+
const code = req.query.code || req.body?.code;
|
|
832
|
+
const state = req.query.state || req.body?.state;
|
|
833
|
+
if (!code || !state) {
|
|
834
|
+
return this.redirectToFrontendWithError(res, AuthRedirectErrorCode.MISSING_PARAMS, 'Missing code or state parameter');
|
|
835
|
+
}
|
|
836
|
+
// Hoisted so the catch block can use it for error redirects
|
|
837
|
+
let frontendUrl;
|
|
838
|
+
let callbackReturnUrl;
|
|
839
|
+
try {
|
|
840
|
+
// 2. Handle callback — validate state, exchange code, extract profile
|
|
841
|
+
const callbackParams = {
|
|
842
|
+
code,
|
|
843
|
+
state,
|
|
844
|
+
body: req.method === 'POST' ? req.body : undefined, // Apple form_post: body contains `user` JSON
|
|
845
|
+
};
|
|
846
|
+
const { normalizedProfile, connection, stateMetadata } = await this.oauth2Service.handleCallback(callbackParams);
|
|
847
|
+
// Resolve the frontend URL from the state token's frontendServiceName field.
|
|
848
|
+
// This is the frontend that initiated the OAuth2 flow — redirects must go back there.
|
|
849
|
+
frontendUrl = stateMetadata.frontendServiceName
|
|
850
|
+
? this.resolveFrontendAppPublicUrlFromFrontendServiceName(stateMetadata.frontendServiceName)
|
|
851
|
+
: undefined;
|
|
852
|
+
callbackReturnUrl = stateMetadata.returnUrl;
|
|
853
|
+
// 3. Provision or link user
|
|
854
|
+
const { userId, isNewUser } = await this.oauth2Service.provisionOrLinkUser(normalizedProfile, connection);
|
|
855
|
+
const frontendServiceName = stateMetadata.frontendServiceName;
|
|
856
|
+
if (frontendServiceName) {
|
|
857
|
+
const authenticatedUser = await this.userLookup.findUserById(ec, userId);
|
|
858
|
+
const authenticatedUserType = authenticatedUser?.userTypes?.[0];
|
|
859
|
+
const userManagement = authenticatedUserType
|
|
860
|
+
? this.appConfigService.getFrontendServiceUserManagementEntry(frontendServiceName, authenticatedUserType)
|
|
861
|
+
: null;
|
|
862
|
+
if (!authenticatedUserType || !userManagement?.auth) {
|
|
863
|
+
throw this.errorBuilder.buildError(ErrorType.AUTHORIZATION, undefined, {
|
|
864
|
+
customMessageReference: ErrorCustomMessageReference.AUTHORIZATION,
|
|
865
|
+
context: {
|
|
866
|
+
message: `Authentication is disabled for frontend service "${frontendServiceName}"` +
|
|
867
|
+
(authenticatedUserType ? ` and user type "${authenticatedUserType}"` : ''),
|
|
868
|
+
frontendServiceName,
|
|
869
|
+
activeUserType: authenticatedUserType,
|
|
870
|
+
},
|
|
871
|
+
});
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
const tokens = await this.tokenIssuer.issueTokensForUser(userId, undefined, {
|
|
875
|
+
lastAuthenticatedAt: Math.floor(Date.now() / 1000),
|
|
876
|
+
});
|
|
877
|
+
// 5. Create AUTH_CODE_EXCHANGE consumable token with JWT tokens as metadata
|
|
878
|
+
const exchangeToken = await this.consumableTokenService.createToken({
|
|
879
|
+
tokenType: CoreConsumableTokenTypes.AUTH_CODE_EXCHANGE,
|
|
880
|
+
consumptionMode: ConsumableToken_ConsumptionMode.SINGLE_USE,
|
|
881
|
+
expiresIn: { value: 5, unit: DurationUnit.MINUTES },
|
|
882
|
+
userId: userId,
|
|
883
|
+
resourceIdentifier: CoreResourceType.USERS,
|
|
884
|
+
metadata: {
|
|
885
|
+
accessToken: tokens.accessToken,
|
|
886
|
+
refreshToken: tokens.refreshToken,
|
|
887
|
+
expiresIn: tokens.expiresIn,
|
|
888
|
+
providerRef: connection.providerRef,
|
|
889
|
+
isNewUser: isNewUser,
|
|
890
|
+
},
|
|
891
|
+
});
|
|
892
|
+
// TRAP 13: Audit log OAuth2 login (audit stays in the route handler, not engine)
|
|
893
|
+
const deviceInfo = {
|
|
894
|
+
ipAddress: AuthControllerUtils.getClientIpFromRequest(req),
|
|
895
|
+
userAgent: req.headers[WildoHeaderKeys.USER_AGENT] || 'unknown',
|
|
896
|
+
};
|
|
897
|
+
await this.auditLogsService.logUserSSOLogin({
|
|
898
|
+
userId: userId,
|
|
899
|
+
email: normalizedProfile.email,
|
|
900
|
+
providerRef: connection.providerRef,
|
|
901
|
+
connectionType: connection.connectionType,
|
|
902
|
+
authSource: AuthSource.OIDC,
|
|
903
|
+
organizationId: connection.organization?.organizationId,
|
|
904
|
+
ipAddress: deviceInfo.ipAddress,
|
|
905
|
+
userAgent: deviceInfo.userAgent,
|
|
906
|
+
sessionId: `oauth2:${connection.providerRef}:${userId}`,
|
|
907
|
+
});
|
|
908
|
+
this.logDebug('OAuth2 callback processed successfully', {
|
|
909
|
+
providerRef: connection.providerRef,
|
|
910
|
+
userId,
|
|
911
|
+
isNewUser,
|
|
912
|
+
});
|
|
913
|
+
// 6. Redirect to frontend with the one-time exchange code (Decision 7)
|
|
914
|
+
this.redirectToFrontendWithCode(res, exchangeToken.token, frontendUrl, stateMetadata.returnUrl);
|
|
915
|
+
}
|
|
916
|
+
catch (error) {
|
|
917
|
+
// Redirect to frontend with error instead of returning JSON.
|
|
918
|
+
// frontendUrl may be set if handleCallback succeeded but a later step failed.
|
|
919
|
+
// If handleCallback itself failed, frontendUrl is undefined → JSON fallback.
|
|
920
|
+
const message = error instanceof Error ? error.message : 'OAuth2 authentication failed';
|
|
921
|
+
this.logDebug('OAuth2 callback failed', { error: message });
|
|
922
|
+
return this.redirectToFrontendWithError(res, AuthRedirectErrorCode.OAUTH_FAILED, message, frontendUrl, callbackReturnUrl);
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
/**
|
|
926
|
+
* POST /auth/token/exchange
|
|
927
|
+
* Body: { code: string }
|
|
928
|
+
* Response: { accessToken, refreshToken, expiresIn }
|
|
929
|
+
*
|
|
930
|
+
* The frontend calls this after receiving the one-time code from the OAuth2 callback redirect.
|
|
931
|
+
* Validates and consumes the AUTH_CODE_EXCHANGE consumable token, returns the JWT tokens.
|
|
932
|
+
*
|
|
933
|
+
* Decision 7: Tokens never appear in URL — only a one-time code.
|
|
934
|
+
*/
|
|
935
|
+
async tokenExchange(req, res) {
|
|
936
|
+
const { code } = TokenExchangeBodySchema.parse(req.body || {});
|
|
937
|
+
// Consume the token atomically (prevents race conditions vs separate validate+consume)
|
|
938
|
+
let consumedToken;
|
|
939
|
+
try {
|
|
940
|
+
consumedToken = await this.consumableTokenService.consumeToken(code);
|
|
941
|
+
}
|
|
942
|
+
catch {
|
|
943
|
+
throw this.errorBuilder.buildError(ErrorType.AUTHENTICATION, undefined, {
|
|
944
|
+
customMessageReference: ErrorCustomMessageReference.AUTHENTICATION_INVALID_TOKEN,
|
|
945
|
+
context: { message: 'Invalid or expired exchange code' },
|
|
946
|
+
});
|
|
947
|
+
}
|
|
948
|
+
// Defense-in-depth: verify the token type is AUTH_CODE_EXCHANGE (same pattern as Step 4 OAUTH2_STATE check)
|
|
949
|
+
if (consumedToken.tokenType !== CoreConsumableTokenTypes.AUTH_CODE_EXCHANGE) {
|
|
950
|
+
throw this.errorBuilder.buildError(ErrorType.AUTHENTICATION, undefined, {
|
|
951
|
+
customMessageReference: ErrorCustomMessageReference.AUTHENTICATION_INVALID_TOKEN,
|
|
952
|
+
context: { message: 'Invalid token type for code exchange' },
|
|
953
|
+
});
|
|
954
|
+
}
|
|
955
|
+
const metadata = consumedToken.metadata;
|
|
956
|
+
if (consumedToken.userId) {
|
|
957
|
+
await this.handleAnonymousTranspositionForTokenExchange(req, consumedToken.userId);
|
|
958
|
+
}
|
|
959
|
+
this.jsonSuccess(res, {
|
|
960
|
+
accessToken: metadata.accessToken,
|
|
961
|
+
refreshToken: metadata.refreshToken,
|
|
962
|
+
expiresIn: metadata.expiresIn,
|
|
963
|
+
});
|
|
964
|
+
}
|
|
965
|
+
/**
|
|
966
|
+
* POST /auth/logout
|
|
967
|
+
* Body: { refreshToken: string }
|
|
968
|
+
* Response: 204 No Content
|
|
969
|
+
*
|
|
970
|
+
* Revokes the refresh token. Accessible both with and without a valid JWT
|
|
971
|
+
* (user's access token may be expired when they logout).
|
|
972
|
+
*/
|
|
973
|
+
async logout(req, res) {
|
|
974
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
975
|
+
const { refreshToken } = LogoutBodySchema.parse(req.body || {});
|
|
976
|
+
// Try to decode the refresh token to get identity for audit (best-effort, don't fail logout if decode fails)
|
|
977
|
+
let logoutUserId;
|
|
978
|
+
try {
|
|
979
|
+
const decoded = await this.jwtService.verifyRefreshToken(refreshToken);
|
|
980
|
+
if (typeof decoded === 'object' && decoded !== null) {
|
|
981
|
+
const payload = decoded;
|
|
982
|
+
logoutUserId = typeof payload.userId === 'string' ? payload.userId : undefined;
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
catch { /* token may be expired — that's fine */ }
|
|
986
|
+
// Revoke the refresh token by adding its JTI to the Redis blacklist.
|
|
987
|
+
// The token issuer's refreshAccessToken() checks this blacklist before issuing new tokens.
|
|
988
|
+
await this.tokenIssuer.revokeRefreshToken(refreshToken);
|
|
989
|
+
// H5: Audit logout
|
|
990
|
+
this.auditLogsService.logUserLogout({
|
|
991
|
+
userId: logoutUserId || 'unknown',
|
|
992
|
+
ipAddress: AuthControllerUtils.getClientIpFromRequest(req),
|
|
993
|
+
userAgent: req.headers[WildoHeaderKeys.USER_AGENT] || 'unknown',
|
|
994
|
+
}).catch(() => { }); // fire-and-forget
|
|
995
|
+
this.logDebug('Logout completed — refresh token revoked');
|
|
996
|
+
res.status(204).send();
|
|
997
|
+
}
|
|
998
|
+
// ═══════════════════════════════════════════════════════════════
|
|
999
|
+
// Password Reset Route Handlers (Step 7)
|
|
1000
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1001
|
+
/**
|
|
1002
|
+
* POST /auth/password-reset/request → AuthPasswordResetService.requestPasswordReset
|
|
1003
|
+
*/
|
|
1004
|
+
async passwordResetRequest(req, res) {
|
|
1005
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
1006
|
+
const { email } = PasswordResetRequestDtoSchema.parse(req.body || {});
|
|
1007
|
+
const ipAddress = AuthControllerUtils.getClientIpFromRequest(req);
|
|
1008
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.RESET_EMAIL}${email.toLowerCase()}`, 3, 3600);
|
|
1009
|
+
if (ipAddress !== 'unknown') {
|
|
1010
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.RESET_IP}${ipAddress}`, 5, 3600);
|
|
1011
|
+
}
|
|
1012
|
+
const frontendUrl = this.resolveFrontendAppPublicUrl(req);
|
|
1013
|
+
const result = await this.passwordResetService.requestPasswordReset(ec, {
|
|
1014
|
+
email, frontendUrl, ipAddress, userAgent: req.headers[WildoHeaderKeys.USER_AGENT] || 'unknown',
|
|
1015
|
+
});
|
|
1016
|
+
this.jsonSuccess(res, result);
|
|
1017
|
+
}
|
|
1018
|
+
/**
|
|
1019
|
+
* POST /auth/password-reset/complete → AuthPasswordResetService.completePasswordReset
|
|
1020
|
+
*/
|
|
1021
|
+
async passwordResetComplete(req, res) {
|
|
1022
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
1023
|
+
const { token, newPassword } = PasswordResetCompleteDtoSchema.parse(req.body || {});
|
|
1024
|
+
const result = await this.passwordResetService.completePasswordReset(ec, {
|
|
1025
|
+
token, newPassword,
|
|
1026
|
+
ipAddress: AuthControllerUtils.getClientIpFromRequest(req),
|
|
1027
|
+
userAgent: req.headers[WildoHeaderKeys.USER_AGENT] || 'unknown',
|
|
1028
|
+
});
|
|
1029
|
+
this.jsonSuccess(res, result);
|
|
1030
|
+
}
|
|
1031
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1032
|
+
// Registration Route Handlers (Step 8) → AuthRegistrationService
|
|
1033
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1034
|
+
/**
|
|
1035
|
+
* POST /auth/register → AuthRegistrationService.registerUser
|
|
1036
|
+
*/
|
|
1037
|
+
async register(req, res) {
|
|
1038
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
1039
|
+
const { email, firstName, lastName, password, organizationName } = UserRegisterApiDtoSchema.parse(req.body || {});
|
|
1040
|
+
const ipAddress = AuthControllerUtils.getClientIpFromRequest(req);
|
|
1041
|
+
if (ipAddress !== 'unknown')
|
|
1042
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.REGISTER_IP}${ipAddress}`, 3, 60);
|
|
1043
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.REGISTER_EMAIL}${email.toLowerCase()}`, 3, 3600);
|
|
1044
|
+
const frontendUrl = this.resolveFrontendAppPublicUrl(req);
|
|
1045
|
+
// W3.4 + AUTH-10: Resolve activeUserType for registration context.
|
|
1046
|
+
// For registration, the header is the authoritative source since the user doesn't exist yet.
|
|
1047
|
+
// The registration service validates the resolved type allows registration (mode != disabled).
|
|
1048
|
+
// AUTH-10: Cross-validate Origin against the claimed frontend service to prevent user-type spoofing.
|
|
1049
|
+
const frontendServiceNameReg = req.headers[WildoHeaderKeys.FRONTEND_SERVICE_NAME];
|
|
1050
|
+
this._validateFrontendAppOrigin(req, frontendServiceNameReg);
|
|
1051
|
+
const activeUserTypeReg = frontendServiceNameReg
|
|
1052
|
+
? this.appConfigService.resolveUserTypeFromFrontendServiceName(frontendServiceNameReg) ?? undefined
|
|
1053
|
+
: undefined;
|
|
1054
|
+
const result = await this.registrationService.registerUser(ec, { email, firstName, lastName, password, organizationName }, { frontendUrl, ipAddress, userAgent: req.headers[WildoHeaderKeys.USER_AGENT] || 'unknown', frontendServiceName: frontendServiceNameReg, activeUserType: activeUserTypeReg });
|
|
1055
|
+
this.jsonSuccess(res, result);
|
|
1056
|
+
}
|
|
1057
|
+
/**
|
|
1058
|
+
* POST /auth/invitation/accept → AuthRegistrationService.acceptInvitation
|
|
1059
|
+
*/
|
|
1060
|
+
async acceptInvitation(req, res) {
|
|
1061
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
1062
|
+
const { invitationToken, firstName, lastName, password } = UserInvitationApiDtoSchema.parse(req.body || {});
|
|
1063
|
+
const ipAddress = AuthControllerUtils.getClientIpFromRequest(req);
|
|
1064
|
+
if (ipAddress !== 'unknown') {
|
|
1065
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.INVITATION_ACCEPT_IP}${ipAddress}`, 10, 60);
|
|
1066
|
+
}
|
|
1067
|
+
const result = await this.registrationService.acceptInvitation(ec, {
|
|
1068
|
+
invitationToken,
|
|
1069
|
+
firstName,
|
|
1070
|
+
lastName,
|
|
1071
|
+
password,
|
|
1072
|
+
ipAddress,
|
|
1073
|
+
userAgent: req.headers[WildoHeaderKeys.USER_AGENT] || 'unknown',
|
|
1074
|
+
});
|
|
1075
|
+
if (result.accessToken && result.userId) {
|
|
1076
|
+
await this.handleAnonymousTranspositionForTokenExchange(req, result.userId);
|
|
1077
|
+
}
|
|
1078
|
+
this.jsonSuccess(res, result);
|
|
1079
|
+
}
|
|
1080
|
+
/**
|
|
1081
|
+
* POST /auth/invitation/reject → AuthRegistrationService.rejectInvitation
|
|
1082
|
+
*/
|
|
1083
|
+
async rejectInvitation(req, res) {
|
|
1084
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
1085
|
+
const { invitationToken, rejectionReason } = UserInvitationRejectApiDtoSchema.parse(req.body || {});
|
|
1086
|
+
const ipAddress = AuthControllerUtils.getClientIpFromRequest(req);
|
|
1087
|
+
if (ipAddress !== 'unknown') {
|
|
1088
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.INVITATION_REJECT_IP}${ipAddress}`, 10, 60);
|
|
1089
|
+
}
|
|
1090
|
+
const result = await this.registrationService.rejectInvitation(ec, {
|
|
1091
|
+
invitationToken,
|
|
1092
|
+
rejectionReason,
|
|
1093
|
+
});
|
|
1094
|
+
this.jsonSuccess(res, result);
|
|
1095
|
+
}
|
|
1096
|
+
/**
|
|
1097
|
+
* POST /auth/verify-email → AuthRegistrationService.verifyEmail
|
|
1098
|
+
*/
|
|
1099
|
+
async verifyEmail(req, res) {
|
|
1100
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
1101
|
+
const { token, email } = EmailVerifyDtoSchema.parse(req.body || {});
|
|
1102
|
+
const result = await this.registrationService.verifyEmail(ec, {
|
|
1103
|
+
token, email,
|
|
1104
|
+
ipAddress: AuthControllerUtils.getClientIpFromRequest(req),
|
|
1105
|
+
userAgent: req.headers[WildoHeaderKeys.USER_AGENT] || 'unknown',
|
|
1106
|
+
});
|
|
1107
|
+
if (result.accessToken && result.userId) {
|
|
1108
|
+
await this.handleAnonymousTranspositionForTokenExchange(req, result.userId);
|
|
1109
|
+
}
|
|
1110
|
+
this.jsonSuccess(res, result);
|
|
1111
|
+
}
|
|
1112
|
+
/**
|
|
1113
|
+
* POST /auth/resend-verification → AuthRegistrationService.resendVerificationEmail
|
|
1114
|
+
*/
|
|
1115
|
+
async resendVerificationEmail(req, res) {
|
|
1116
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
1117
|
+
const { email } = z.object({
|
|
1118
|
+
email: z.string().email(),
|
|
1119
|
+
}).parse(req.body || {});
|
|
1120
|
+
const ipAddress = AuthControllerUtils.getClientIpFromRequest(req);
|
|
1121
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.RESEND_VERIF_EMAIL}${email.toLowerCase()}`, 3, 600);
|
|
1122
|
+
if (ipAddress !== 'unknown')
|
|
1123
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.RESEND_VERIF_IP}${ipAddress}`, 5, 600);
|
|
1124
|
+
const frontendUrl = this.resolveFrontendAppPublicUrl(req);
|
|
1125
|
+
const result = await this.registrationService.resendVerificationEmail(ec, {
|
|
1126
|
+
email, frontendUrl, ipAddress,
|
|
1127
|
+
userAgent: req.headers[WildoHeaderKeys.USER_AGENT] || 'unknown',
|
|
1128
|
+
});
|
|
1129
|
+
this.jsonSuccess(res, result);
|
|
1130
|
+
}
|
|
1131
|
+
/**
|
|
1132
|
+
* POST /auth/onboarding/complete-org → AuthRegistrationService.completeOrgOnboarding
|
|
1133
|
+
*/
|
|
1134
|
+
async completeOrgOnboarding(req, res) {
|
|
1135
|
+
const clientIp = AuthControllerUtils.getClientIpFromRequest(req);
|
|
1136
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.ORG_ONBOARDING_IP}${clientIp}`, 10, 60);
|
|
1137
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
1138
|
+
const { sessionId, organizationName } = z.object({
|
|
1139
|
+
sessionId: z.string(),
|
|
1140
|
+
organizationName: z.string().min(1).max(200)
|
|
1141
|
+
.regex(/^[^<>"'`;{}()\\]+$/, 'Organization name contains disallowed characters'),
|
|
1142
|
+
}).parse(req.body || {});
|
|
1143
|
+
const result = await this.registrationService.completeOrgOnboarding(ec, {
|
|
1144
|
+
sessionId,
|
|
1145
|
+
organizationName: organizationName.trim(),
|
|
1146
|
+
});
|
|
1147
|
+
this.jsonSuccess(res, result);
|
|
1148
|
+
}
|
|
1149
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1150
|
+
// MFA: Email OTP Route Handlers (Step 10)
|
|
1151
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1152
|
+
/**
|
|
1153
|
+
* POST /auth/mfa/email-otp/send
|
|
1154
|
+
* Body: { sessionId: string }
|
|
1155
|
+
* Response: { message: string }
|
|
1156
|
+
*
|
|
1157
|
+
* Generates a 6-digit OTP, stores as consumable token, sends email to user.
|
|
1158
|
+
* Must be called after first factor completion (session state = FIRST_FACTOR_COMPLETED).
|
|
1159
|
+
*/
|
|
1160
|
+
async mfaEmailOTPSend(req, res) {
|
|
1161
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
1162
|
+
const body = z.object({ sessionId: z.string().min(1) }).parse(req.body || {});
|
|
1163
|
+
this.logDebug('MFA Email OTP send requested', { sessionId: body.sessionId });
|
|
1164
|
+
// Orchestrator handles validation, rate limiting, OTP generation, and token storage.
|
|
1165
|
+
// It returns the OTP code and the user's email — we send the email here.
|
|
1166
|
+
const { otpToken, email, expiryMinutes } = await this.authService.sendEmailOTP(ec, body.sessionId);
|
|
1167
|
+
// Send the OTP email
|
|
1168
|
+
try {
|
|
1169
|
+
const appIdentity = this.appConfigService.config.appIdentity;
|
|
1170
|
+
await this.emailService.send({
|
|
1171
|
+
templateRef: SystemEmailTemplateRef.EMAIL_OTP,
|
|
1172
|
+
locale: AvailableLanguage.EN,
|
|
1173
|
+
type: EmailTemplateType.TRANSACTIONAL,
|
|
1174
|
+
to: email,
|
|
1175
|
+
context: {
|
|
1176
|
+
currentObject: { email },
|
|
1177
|
+
objectContext: {
|
|
1178
|
+
primaryScopeContext: {
|
|
1179
|
+
appName: appIdentity.appName,
|
|
1180
|
+
applicationId: this.appConfigService.applicationId,
|
|
1181
|
+
},
|
|
1182
|
+
},
|
|
1183
|
+
userContext: { userId: '', email }, // userId not available in pre-auth flow; email is the key identifier
|
|
1184
|
+
additionalContext: { otpCode: otpToken, expiresInMinutes: expiryMinutes },
|
|
1185
|
+
},
|
|
1186
|
+
});
|
|
1187
|
+
this.logDebug('MFA Email OTP sent', { email });
|
|
1188
|
+
}
|
|
1189
|
+
catch (emailError) {
|
|
1190
|
+
this.logger.error('Failed to send MFA email OTP', {
|
|
1191
|
+
error: emailError instanceof Error ? emailError.message : String(emailError),
|
|
1192
|
+
});
|
|
1193
|
+
// Still return success — the OTP was generated and stored.
|
|
1194
|
+
// User can retry sending if email delivery fails.
|
|
1195
|
+
}
|
|
1196
|
+
// H5: Audit MFA email OTP sent
|
|
1197
|
+
this.auditLogsService.logUserMFAEmailOTPSent({
|
|
1198
|
+
email,
|
|
1199
|
+
sessionId: body.sessionId,
|
|
1200
|
+
ipAddress: AuthControllerUtils.getClientIpFromRequest(req),
|
|
1201
|
+
userAgent: req.headers[WildoHeaderKeys.USER_AGENT] || 'unknown',
|
|
1202
|
+
}).catch(() => { });
|
|
1203
|
+
this.jsonSuccess(res, this.authResponseHelper.getAuthResponse(AuthResponseMessageRef.MFA_EMAIL_OTP_SENT));
|
|
1204
|
+
}
|
|
1205
|
+
/**
|
|
1206
|
+
* POST /auth/mfa/email-otp/verify
|
|
1207
|
+
* Body: { sessionId: string, code: string }
|
|
1208
|
+
* Response: AuthenticationResponse (from orchestrator)
|
|
1209
|
+
*
|
|
1210
|
+
* Verifies the submitted OTP code against stored consumable tokens.
|
|
1211
|
+
* On success, returns authentication result (may complete auth or require more factors).
|
|
1212
|
+
*/
|
|
1213
|
+
async mfaEmailOTPVerify(req, res) {
|
|
1214
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
1215
|
+
const body = z.object({
|
|
1216
|
+
sessionId: z.string().min(1),
|
|
1217
|
+
code: z.string().regex(/^\d{4,8}$/, { error: 'Invalid OTP code' }),
|
|
1218
|
+
}).parse(req.body || {});
|
|
1219
|
+
this.logDebug('MFA Email OTP verify requested', { sessionId: body.sessionId });
|
|
1220
|
+
// Build an EmailOTPAuthRequest and route through the main authenticate method
|
|
1221
|
+
// so that completion logic (token issuance) is handled uniformly.
|
|
1222
|
+
const authRequest = {
|
|
1223
|
+
sessionId: body.sessionId,
|
|
1224
|
+
method: AuthMethod.EMAIL_OTP,
|
|
1225
|
+
factorLevel: AuthFactorLevel.SECOND,
|
|
1226
|
+
token: body.code,
|
|
1227
|
+
rememberMe: false,
|
|
1228
|
+
requestedIntegrations: [],
|
|
1229
|
+
};
|
|
1230
|
+
const result = await this.authService.authenticate(ec, authRequest);
|
|
1231
|
+
this.jsonSuccess(res, result);
|
|
1232
|
+
}
|
|
1233
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1234
|
+
// MFA: TOTP Route Handlers (Step 11)
|
|
1235
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1236
|
+
/**
|
|
1237
|
+
* POST /auth/mfa/totp/setup
|
|
1238
|
+
* Headers: Authorization: Bearer <accessToken>
|
|
1239
|
+
* Response: { secret: string, qrCodeUri: string, backupCodes: string[] }
|
|
1240
|
+
*
|
|
1241
|
+
* Uses `extractFromSessionOrJwt` — the caller may be fully authenticated (JWT)
|
|
1242
|
+
* or partially authenticated (MFA_REQUIRED / MFA_ENROLLMENT_REQUIRED session).
|
|
1243
|
+
* In the partial-auth path, identity is not yet fully proven, so we intentionally
|
|
1244
|
+
* use a pre-auth EC (no userId attribution). Security relies on the JWT guard /
|
|
1245
|
+
* session state validation in `extractFromSessionOrJwt`, not on the EC's role.
|
|
1246
|
+
*/
|
|
1247
|
+
async mfaTOTPSetup(req, res) {
|
|
1248
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
1249
|
+
const { userId, email } = await this.authJwtGuard.extractFromSessionOrJwt(ec, req);
|
|
1250
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.TOTP_SETUP}${userId}`, 5, 3600);
|
|
1251
|
+
const result = await this.mfaService.setupTOTP(ec, {
|
|
1252
|
+
userId,
|
|
1253
|
+
email,
|
|
1254
|
+
ipAddress: AuthControllerUtils.getClientIpFromRequest(req),
|
|
1255
|
+
userAgent: req.headers[WildoHeaderKeys.USER_AGENT] || 'unknown',
|
|
1256
|
+
});
|
|
1257
|
+
this.jsonSuccess(res, result);
|
|
1258
|
+
}
|
|
1259
|
+
/**
|
|
1260
|
+
* POST /auth/mfa/totp/verify-setup
|
|
1261
|
+
* Headers: Authorization: Bearer <accessToken>
|
|
1262
|
+
* Body: { code: string }
|
|
1263
|
+
* Response: { verified: boolean }
|
|
1264
|
+
*
|
|
1265
|
+
* Uses `extractFromSessionOrJwt` — caller may be partially authenticated
|
|
1266
|
+
* (mid-MFA enrollment). Pre-auth EC used intentionally: identity is not
|
|
1267
|
+
* fully proven until MFA setup completes. See mfaTOTPSetup JSDoc.
|
|
1268
|
+
*/
|
|
1269
|
+
async mfaTOTPVerifySetup(req, res) {
|
|
1270
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
1271
|
+
const { userId } = await this.authJwtGuard.extractFromSessionOrJwt(ec, req);
|
|
1272
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.TOTP_SETUP}${userId}`, 5, 3600);
|
|
1273
|
+
const body = z.object({
|
|
1274
|
+
code: z.string().regex(/^\d{6}$/, { error: 'Invalid TOTP code — must be 6 digits' }),
|
|
1275
|
+
}).parse(req.body || {});
|
|
1276
|
+
const result = await this.mfaService.verifyTOTPSetup(ec, {
|
|
1277
|
+
userId,
|
|
1278
|
+
code: body.code,
|
|
1279
|
+
ipAddress: AuthControllerUtils.getClientIpFromRequest(req),
|
|
1280
|
+
userAgent: req.headers[WildoHeaderKeys.USER_AGENT] || 'unknown',
|
|
1281
|
+
});
|
|
1282
|
+
this.jsonSuccess(res, result);
|
|
1283
|
+
}
|
|
1284
|
+
/**
|
|
1285
|
+
* POST /auth/mfa/totp/verify
|
|
1286
|
+
* Body: { sessionId: string, code: string }
|
|
1287
|
+
* Response: AuthenticationResponse (from orchestrator)
|
|
1288
|
+
*
|
|
1289
|
+
* Verifies a TOTP code during login MFA flow.
|
|
1290
|
+
* Routes through the main authenticate method for uniform completion logic.
|
|
1291
|
+
*/
|
|
1292
|
+
async mfaTOTPVerify(req, res) {
|
|
1293
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
1294
|
+
const body = z.object({
|
|
1295
|
+
sessionId: z.string().min(1),
|
|
1296
|
+
code: z.string().min(1, { error: 'TOTP code is required' }),
|
|
1297
|
+
}).parse(req.body || {});
|
|
1298
|
+
this.logDebug('MFA TOTP verify requested', { sessionId: body.sessionId });
|
|
1299
|
+
const authRequest = {
|
|
1300
|
+
sessionId: body.sessionId,
|
|
1301
|
+
method: AuthMethod.TOTP,
|
|
1302
|
+
factorLevel: AuthFactorLevel.SECOND,
|
|
1303
|
+
token: body.code,
|
|
1304
|
+
rememberMe: false,
|
|
1305
|
+
requestedIntegrations: [],
|
|
1306
|
+
};
|
|
1307
|
+
const result = await this.authService.authenticate(ec, authRequest);
|
|
1308
|
+
this.jsonSuccess(res, result);
|
|
1309
|
+
}
|
|
1310
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1311
|
+
// WebAuthn/Passkey Route Handlers (Phase G1)
|
|
1312
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1313
|
+
/**
|
|
1314
|
+
* POST /auth/passkey/register/options
|
|
1315
|
+
* Headers: Authorization: Bearer <accessToken>
|
|
1316
|
+
* Response: PublicKeyCredentialCreationOptionsJSON
|
|
1317
|
+
*
|
|
1318
|
+
* Uses `extractFromSessionOrJwt` — caller may be partially authenticated
|
|
1319
|
+
* (mid-MFA enrollment, registering a passkey as their MFA method).
|
|
1320
|
+
* Pre-auth EC used intentionally: identity not fully proven until
|
|
1321
|
+
* MFA enrollment completes. See mfaTOTPSetup JSDoc.
|
|
1322
|
+
*/
|
|
1323
|
+
async handlePasskeyRegisterOptions(req, res) {
|
|
1324
|
+
try {
|
|
1325
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
1326
|
+
const { userId, email } = await this.authJwtGuard.extractFromSessionOrJwt(ec, req);
|
|
1327
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.PASSKEY_REGISTER}${userId}`, 10, 3600);
|
|
1328
|
+
const options = await this.webAuthnService.generateRegistrationOptions(ec, userId, email);
|
|
1329
|
+
this.jsonSuccess(res, options);
|
|
1330
|
+
}
|
|
1331
|
+
catch (error) {
|
|
1332
|
+
if (isWildoBackendError(error))
|
|
1333
|
+
throw error;
|
|
1334
|
+
throw this.errorBuilder.buildError(ErrorType.INTERNAL, undefined, {
|
|
1335
|
+
context: { operation: AUTH_OPERATION.PASSKEY_REGISTER_OPTIONS },
|
|
1336
|
+
});
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
/**
|
|
1340
|
+
* POST /auth/passkey/register/verify
|
|
1341
|
+
* Headers: Authorization: Bearer <accessToken>
|
|
1342
|
+
* Body: { response: RegistrationResponseJSON, name?: string }
|
|
1343
|
+
* Response: { registered: boolean, credential: { credentialId, name, createdAt } }
|
|
1344
|
+
*
|
|
1345
|
+
* Uses `extractFromSessionOrJwt` — caller may be partially authenticated
|
|
1346
|
+
* (mid-MFA enrollment). Pre-auth EC used intentionally: identity not fully
|
|
1347
|
+
* proven until MFA enrollment completes. See mfaTOTPSetup JSDoc.
|
|
1348
|
+
*/
|
|
1349
|
+
async handlePasskeyRegisterVerify(req, res) {
|
|
1350
|
+
try {
|
|
1351
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
1352
|
+
const { userId, email } = await this.authJwtGuard.extractFromSessionOrJwt(ec, req);
|
|
1353
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.PASSKEY_REGISTER}${userId}`, 10, 3600);
|
|
1354
|
+
const PasskeyRegisterVerifyBodySchema = z.object({
|
|
1355
|
+
response: z.object({
|
|
1356
|
+
id: z.string(),
|
|
1357
|
+
rawId: z.string(),
|
|
1358
|
+
response: z.object({
|
|
1359
|
+
attestationObject: z.string(),
|
|
1360
|
+
clientDataJSON: z.string(),
|
|
1361
|
+
}),
|
|
1362
|
+
authenticatorAttachment: z.enum(['cross-platform', 'platform']).optional(),
|
|
1363
|
+
clientExtensionResults: z.record(z.string(), z.any()).default({}),
|
|
1364
|
+
type: z.literal('public-key'),
|
|
1365
|
+
}),
|
|
1366
|
+
name: z.string().max(100).optional(),
|
|
1367
|
+
});
|
|
1368
|
+
const { response, name } = PasskeyRegisterVerifyBodySchema.parse(req.body || {});
|
|
1369
|
+
const credential = await this.webAuthnService.verifyRegistrationResponse(ec, userId, response, name);
|
|
1370
|
+
await this.auditLogsService.logUserPasskeyRegistered({
|
|
1371
|
+
userId: userId,
|
|
1372
|
+
email,
|
|
1373
|
+
credentialId: credential.credentialId,
|
|
1374
|
+
credentialName: credential.name,
|
|
1375
|
+
credentialDeviceType: credential.credentialDeviceType,
|
|
1376
|
+
ipAddress: AuthControllerUtils.getClientIpFromRequest(req),
|
|
1377
|
+
userAgent: req.headers[WildoHeaderKeys.USER_AGENT] || 'unknown',
|
|
1378
|
+
});
|
|
1379
|
+
this.jsonSuccess(res, {
|
|
1380
|
+
registered: true,
|
|
1381
|
+
credential: {
|
|
1382
|
+
credentialId: credential.credentialId,
|
|
1383
|
+
name: credential.name,
|
|
1384
|
+
createdAt: credential.createdAt,
|
|
1385
|
+
},
|
|
1386
|
+
});
|
|
1387
|
+
}
|
|
1388
|
+
catch (error) {
|
|
1389
|
+
if (isWildoBackendError(error))
|
|
1390
|
+
throw error;
|
|
1391
|
+
throw this.errorBuilder.buildError(ErrorType.INTERNAL, undefined, {
|
|
1392
|
+
context: { operation: AUTH_OPERATION.PASSKEY_REGISTER_VERIFY },
|
|
1393
|
+
});
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
/**
|
|
1397
|
+
* POST /auth/passkey/authenticate/options
|
|
1398
|
+
* Body: { sessionId: string }
|
|
1399
|
+
* Response: PublicKeyCredentialRequestOptionsJSON
|
|
1400
|
+
*
|
|
1401
|
+
* Unauthenticated. Part of login flow. Generates authentication options for the session's user.
|
|
1402
|
+
*/
|
|
1403
|
+
async handlePasskeyAuthOptions(req, res) {
|
|
1404
|
+
try {
|
|
1405
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
1406
|
+
const { sessionId } = req.body;
|
|
1407
|
+
if (!sessionId) {
|
|
1408
|
+
throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {
|
|
1409
|
+
context: { reason: 'sessionId is required' },
|
|
1410
|
+
});
|
|
1411
|
+
}
|
|
1412
|
+
const session = await this.authService.getAuthenticationSessionState(ec, sessionId);
|
|
1413
|
+
if (!session) {
|
|
1414
|
+
throw this.errorBuilder.buildError(ErrorType.AUTHENTICATION, undefined, {
|
|
1415
|
+
customMessageReference: ErrorCustomMessageReference.AUTHENTICATION_SESSION_INVALID,
|
|
1416
|
+
context: { sessionId },
|
|
1417
|
+
});
|
|
1418
|
+
}
|
|
1419
|
+
const validStatesForPasskeyAuth = new Set([
|
|
1420
|
+
AuthenticationSessionState.IDENTIFIED,
|
|
1421
|
+
AuthenticationSessionState.FIRST_FACTOR_IN_PROGRESS,
|
|
1422
|
+
AuthenticationSessionState.FIRST_FACTOR_COMPLETED,
|
|
1423
|
+
AuthenticationSessionState.MFA_REQUIRED,
|
|
1424
|
+
]);
|
|
1425
|
+
if (!validStatesForPasskeyAuth.has(session.state)) {
|
|
1426
|
+
throw this.errorBuilder.buildError(ErrorType.AUTHENTICATION, undefined, {
|
|
1427
|
+
context: { reason: 'Invalid session state for passkey authentication' },
|
|
1428
|
+
});
|
|
1429
|
+
}
|
|
1430
|
+
const userId = session.userId;
|
|
1431
|
+
if (!userId) {
|
|
1432
|
+
throw this.errorBuilder.buildError(ErrorType.AUTHENTICATION, undefined, {
|
|
1433
|
+
context: { reason: 'No user associated with session' },
|
|
1434
|
+
});
|
|
1435
|
+
}
|
|
1436
|
+
const options = await this.webAuthnService.generateAuthenticationOptions(ec, userId);
|
|
1437
|
+
this.jsonSuccess(res, options);
|
|
1438
|
+
}
|
|
1439
|
+
catch (error) {
|
|
1440
|
+
if (isWildoBackendError(error))
|
|
1441
|
+
throw error;
|
|
1442
|
+
throw this.errorBuilder.buildError(ErrorType.INTERNAL, undefined, {
|
|
1443
|
+
context: { operation: AUTH_OPERATION.PASSKEY_AUTH_OPTIONS },
|
|
1444
|
+
});
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
/**
|
|
1448
|
+
* POST /auth/passkey/authenticate/verify
|
|
1449
|
+
* Body: { sessionId: string, response: AuthenticationResponseJSON, factorLevel?: AuthFactorLevel }
|
|
1450
|
+
* Response: AuthenticationResponse (from orchestrator)
|
|
1451
|
+
*
|
|
1452
|
+
* Unauthenticated. Routes through authService.authenticate() for uniform completion logic.
|
|
1453
|
+
*/
|
|
1454
|
+
async handlePasskeyAuthVerify(req, res) {
|
|
1455
|
+
try {
|
|
1456
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
1457
|
+
const PasskeyAuthVerifyBodySchema = z.object({
|
|
1458
|
+
sessionId: z.string().min(1),
|
|
1459
|
+
response: z.object({
|
|
1460
|
+
id: z.string(),
|
|
1461
|
+
rawId: z.string(),
|
|
1462
|
+
response: z.object({
|
|
1463
|
+
authenticatorData: z.string(),
|
|
1464
|
+
clientDataJSON: z.string(),
|
|
1465
|
+
signature: z.string(),
|
|
1466
|
+
userHandle: z.string().optional(),
|
|
1467
|
+
}),
|
|
1468
|
+
authenticatorAttachment: z.enum(['cross-platform', 'platform']).optional(),
|
|
1469
|
+
clientExtensionResults: z.record(z.string(), z.any()).default({}),
|
|
1470
|
+
type: z.literal('public-key'),
|
|
1471
|
+
}),
|
|
1472
|
+
factorLevel: z.string().optional(),
|
|
1473
|
+
});
|
|
1474
|
+
const { sessionId, response, factorLevel } = PasskeyAuthVerifyBodySchema.parse(req.body || {});
|
|
1475
|
+
const authResponse = await this.authService.authenticate(ec, {
|
|
1476
|
+
sessionId,
|
|
1477
|
+
method: AuthMethod.PASSKEY,
|
|
1478
|
+
factorLevel: factorLevel || AuthFactorLevel.FIRST,
|
|
1479
|
+
response,
|
|
1480
|
+
rememberMe: false,
|
|
1481
|
+
requestedIntegrations: [],
|
|
1482
|
+
});
|
|
1483
|
+
await this.handleAnonymousTransposition(req, authResponse);
|
|
1484
|
+
this.jsonSuccess(res, authResponse);
|
|
1485
|
+
}
|
|
1486
|
+
catch (error) {
|
|
1487
|
+
if (isWildoBackendError(error))
|
|
1488
|
+
throw error;
|
|
1489
|
+
throw this.errorBuilder.buildError(ErrorType.INTERNAL, undefined, {
|
|
1490
|
+
context: { operation: AUTH_OPERATION.PASSKEY_AUTH_VERIFY },
|
|
1491
|
+
});
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
/**
|
|
1495
|
+
* GET /auth/passkey/list
|
|
1496
|
+
* Headers: Authorization: Bearer <accessToken>
|
|
1497
|
+
* Response: { credentials: PasskeyCredentialEntry[] } (safe fields only)
|
|
1498
|
+
*
|
|
1499
|
+
* JWT-authenticated. Lists registered passkeys for the authenticated user.
|
|
1500
|
+
*/
|
|
1501
|
+
async handlePasskeyList(req, res) {
|
|
1502
|
+
try {
|
|
1503
|
+
const preAuthEc = await this._getPreAuthExecutionContext();
|
|
1504
|
+
const { userId } = await this.authJwtGuard.extractAuthenticatedUser(preAuthEc, req);
|
|
1505
|
+
const ec = await this._getAuthenticatedExecutionContext(userId);
|
|
1506
|
+
const credentials = await this.webAuthnService.getCredentials(ec, userId);
|
|
1507
|
+
const safeCredentials = credentials.map((c) => ({
|
|
1508
|
+
credentialId: c.credentialId,
|
|
1509
|
+
name: c.name,
|
|
1510
|
+
createdAt: c.createdAt,
|
|
1511
|
+
lastUsedAt: c.lastUsedAt,
|
|
1512
|
+
credentialDeviceType: c.credentialDeviceType,
|
|
1513
|
+
credentialBackedUp: c.credentialBackedUp,
|
|
1514
|
+
}));
|
|
1515
|
+
this.jsonSuccess(res, { credentials: safeCredentials });
|
|
1516
|
+
}
|
|
1517
|
+
catch (error) {
|
|
1518
|
+
if (isWildoBackendError(error))
|
|
1519
|
+
throw error;
|
|
1520
|
+
throw this.errorBuilder.buildError(ErrorType.INTERNAL, undefined, {
|
|
1521
|
+
context: { operation: AUTH_OPERATION.PASSKEY_LIST },
|
|
1522
|
+
});
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
/**
|
|
1526
|
+
* POST /auth/passkey/remove
|
|
1527
|
+
* Headers: Authorization: Bearer <accessToken>
|
|
1528
|
+
* Body: { credentialId: string }
|
|
1529
|
+
* Response: { removed: boolean }
|
|
1530
|
+
*
|
|
1531
|
+
* JWT-authenticated. Removes a passkey from the authenticated user.
|
|
1532
|
+
*/
|
|
1533
|
+
async handlePasskeyRemove(req, res) {
|
|
1534
|
+
try {
|
|
1535
|
+
const preAuthEc = await this._getPreAuthExecutionContext();
|
|
1536
|
+
const { userId, email } = await this.authJwtGuard.extractAuthenticatedUser(preAuthEc, req);
|
|
1537
|
+
const ec = await this._getAuthenticatedExecutionContext(userId);
|
|
1538
|
+
const { credentialId } = req.body;
|
|
1539
|
+
if (!credentialId) {
|
|
1540
|
+
throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {
|
|
1541
|
+
context: { reason: 'credentialId is required' },
|
|
1542
|
+
});
|
|
1543
|
+
}
|
|
1544
|
+
await this.methodManagementService.enforceUserMethodRemovalAllowed(ec, userId);
|
|
1545
|
+
const credentials = await this.webAuthnService.getCredentials(ec, userId);
|
|
1546
|
+
const target = credentials.find((c) => c.credentialId === credentialId);
|
|
1547
|
+
// D9 safety check: count password + passkeys + identity links
|
|
1548
|
+
const authMethodCounts = await this.methodManagementService.countAuthMethods(ec, userId);
|
|
1549
|
+
if (authMethodCounts.total <= 1) {
|
|
1550
|
+
throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {
|
|
1551
|
+
context: { reason: 'Cannot remove your only authentication method' },
|
|
1552
|
+
});
|
|
1553
|
+
}
|
|
1554
|
+
await this.webAuthnService.removeCredential(ec, userId, credentialId);
|
|
1555
|
+
await this.auditLogsService.logUserPasskeyRemoved({
|
|
1556
|
+
userId: userId,
|
|
1557
|
+
email,
|
|
1558
|
+
credentialId,
|
|
1559
|
+
credentialName: target?.name || 'Unknown',
|
|
1560
|
+
ipAddress: AuthControllerUtils.getClientIpFromRequest(req),
|
|
1561
|
+
userAgent: req.headers[WildoHeaderKeys.USER_AGENT] || 'unknown',
|
|
1562
|
+
});
|
|
1563
|
+
this.jsonSuccess(res, { removed: true });
|
|
1564
|
+
}
|
|
1565
|
+
catch (error) {
|
|
1566
|
+
if (isWildoBackendError(error))
|
|
1567
|
+
throw error;
|
|
1568
|
+
throw this.errorBuilder.buildError(ErrorType.INTERNAL, undefined, {
|
|
1569
|
+
context: { operation: AUTH_OPERATION.PASSKEY_REMOVE },
|
|
1570
|
+
});
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1573
|
+
/**
|
|
1574
|
+
* POST /auth/passkey/rename
|
|
1575
|
+
* Headers: Authorization: Bearer <accessToken>
|
|
1576
|
+
* Body: { credentialId: string, name: string }
|
|
1577
|
+
* Response: { renamed: boolean }
|
|
1578
|
+
*
|
|
1579
|
+
* JWT-authenticated. Renames a passkey for the authenticated user.
|
|
1580
|
+
*/
|
|
1581
|
+
async handlePasskeyRename(req, res) {
|
|
1582
|
+
try {
|
|
1583
|
+
const preAuthEc = await this._getPreAuthExecutionContext();
|
|
1584
|
+
const { userId } = await this.authJwtGuard.extractAuthenticatedUser(preAuthEc, req);
|
|
1585
|
+
const ec = await this._getAuthenticatedExecutionContext(userId);
|
|
1586
|
+
const { credentialId, name } = req.body;
|
|
1587
|
+
if (!credentialId || !name) {
|
|
1588
|
+
throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {
|
|
1589
|
+
context: { reason: 'credentialId and name are required' },
|
|
1590
|
+
});
|
|
1591
|
+
}
|
|
1592
|
+
await this.webAuthnService.renameCredential(ec, userId, credentialId, name);
|
|
1593
|
+
this.jsonSuccess(res, { renamed: true });
|
|
1594
|
+
}
|
|
1595
|
+
catch (error) {
|
|
1596
|
+
if (isWildoBackendError(error))
|
|
1597
|
+
throw error;
|
|
1598
|
+
throw this.errorBuilder.buildError(ErrorType.INTERNAL, undefined, {
|
|
1599
|
+
context: { operation: AUTH_OPERATION.PASSKEY_RENAME },
|
|
1600
|
+
});
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
/**
|
|
1604
|
+
* Pre-auth EC for operations where the caller is not yet authenticated.
|
|
1605
|
+
* Uses PUBLIC_EXECUTION with APP_PUBLIC (minimal privilege, no initiator).
|
|
1606
|
+
* Primary intent: user identification/lookup across auth handlers.
|
|
1607
|
+
*
|
|
1608
|
+
* Also used as the bootstrap EC for JWT/session extraction calls
|
|
1609
|
+
* (`extractAuthenticatedUser`, `extractFromSessionOrJwt`) since identity
|
|
1610
|
+
* is unknown at that point.
|
|
1611
|
+
*/
|
|
1612
|
+
async _getPreAuthExecutionContext() {
|
|
1613
|
+
return this.authEcFactory.createForPreAuthOperation(this.authEcFactory.getUsersReadOperationPath());
|
|
1614
|
+
}
|
|
1615
|
+
/**
|
|
1616
|
+
* Authenticated EC for operations where the caller's identity has been
|
|
1617
|
+
* confirmed via JWT. Carries userId attribution for audit trail and
|
|
1618
|
+
* uses APP_USER role.
|
|
1619
|
+
*
|
|
1620
|
+
* Endpoints that call `extractAuthenticatedUser` (requiring a valid JWT)
|
|
1621
|
+
* should use this for all downstream service calls after extraction.
|
|
1622
|
+
*/
|
|
1623
|
+
async _getAuthenticatedExecutionContext(userId) {
|
|
1624
|
+
return this.authEcFactory.createForAuthenticatedAuthOperation(userId, this.authEcFactory.getUsersReadOperationPath());
|
|
1625
|
+
}
|
|
1626
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1627
|
+
// Private: Frontend Redirect Helpers
|
|
1628
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1629
|
+
/**
|
|
1630
|
+
* Redirect to the frontend callback page with the one-time exchange code.
|
|
1631
|
+
* URL: {frontendUrl}/auth/callback?code={exchangeCode}
|
|
1632
|
+
*
|
|
1633
|
+
* @param frontendUrl - The resolved frontend publicUrl from the OAuth2 state token.
|
|
1634
|
+
* If undefined (state token didn't carry frontendServiceName — legacy flows), throws.
|
|
1635
|
+
*/
|
|
1636
|
+
redirectToFrontendWithCode(res, exchangeCode, frontendUrl, returnUrl) {
|
|
1637
|
+
if (!frontendUrl) {
|
|
1638
|
+
throw this.errorBuilder.buildError(ErrorType.INTERNAL, undefined, {
|
|
1639
|
+
context: { message: 'Cannot redirect: frontendServiceName was not stored in OAuth2 state token. The originating frontend is unknown.' },
|
|
1640
|
+
});
|
|
1641
|
+
}
|
|
1642
|
+
const searchParams = new URLSearchParams({
|
|
1643
|
+
code: exchangeCode,
|
|
1644
|
+
});
|
|
1645
|
+
if (returnUrl) {
|
|
1646
|
+
searchParams.set('redirect', returnUrl);
|
|
1647
|
+
}
|
|
1648
|
+
const redirectUrl = `${frontendUrl}/auth/callback?${searchParams.toString()}`;
|
|
1649
|
+
res.redirect(302, redirectUrl);
|
|
1650
|
+
}
|
|
1651
|
+
/**
|
|
1652
|
+
* Redirect to the frontend login page with an error.
|
|
1653
|
+
* URL: {frontendUrl}/login?error={error}&reason={description}
|
|
1654
|
+
*
|
|
1655
|
+
* TRAP 6: Error redirect goes to login page (not generic error page)
|
|
1656
|
+
* so the user can retry.
|
|
1657
|
+
*
|
|
1658
|
+
* If frontendUrl is undefined (state token didn't carry frontendServiceName, or error
|
|
1659
|
+
* occurred before state could be read), falls back to a plain JSON error
|
|
1660
|
+
* since we can't redirect to an unknown frontend.
|
|
1661
|
+
*/
|
|
1662
|
+
redirectToFrontendWithError(res, error, description, frontendUrl, returnUrl) {
|
|
1663
|
+
if (!frontendUrl) {
|
|
1664
|
+
res.status(400).json({ error, error_description: description });
|
|
1665
|
+
return;
|
|
1666
|
+
}
|
|
1667
|
+
const searchParams = new URLSearchParams({
|
|
1668
|
+
error,
|
|
1669
|
+
reason: description,
|
|
1670
|
+
});
|
|
1671
|
+
if (returnUrl) {
|
|
1672
|
+
searchParams.set('redirect', returnUrl);
|
|
1673
|
+
}
|
|
1674
|
+
const redirectUrl = `${frontendUrl}/login?${searchParams.toString()}`;
|
|
1675
|
+
res.redirect(302, redirectUrl);
|
|
1676
|
+
}
|
|
1677
|
+
validateFrontendReturnUrl(returnUrl, frontendUrl) {
|
|
1678
|
+
if (returnUrl.startsWith('/') && !returnUrl.startsWith('//')) {
|
|
1679
|
+
return;
|
|
1680
|
+
}
|
|
1681
|
+
const allowedOrigins = new Set();
|
|
1682
|
+
try {
|
|
1683
|
+
allowedOrigins.add(new URL(frontendUrl).origin);
|
|
1684
|
+
}
|
|
1685
|
+
catch {
|
|
1686
|
+
// frontendUrl comes from validated config, but keep the helper defensive.
|
|
1687
|
+
}
|
|
1688
|
+
for (const frontendServiceName of Object.keys(this.appConfigService.config.frontendServices ?? {})) {
|
|
1689
|
+
const publicUrl = AuthControllerUtils.lookupFrontendPublicUrl(this.appConfigService.config, frontendServiceName);
|
|
1690
|
+
if (!publicUrl) {
|
|
1691
|
+
continue;
|
|
1692
|
+
}
|
|
1693
|
+
allowedOrigins.add(new URL(publicUrl).origin);
|
|
1694
|
+
}
|
|
1695
|
+
try {
|
|
1696
|
+
const parsed = new URL(returnUrl);
|
|
1697
|
+
if (allowedOrigins.has(parsed.origin)) {
|
|
1698
|
+
return;
|
|
1699
|
+
}
|
|
1700
|
+
}
|
|
1701
|
+
catch {
|
|
1702
|
+
// Invalid absolute URL — reject below.
|
|
1703
|
+
}
|
|
1704
|
+
throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {
|
|
1705
|
+
customMessageReference: ErrorCustomMessageReference.VALIDATION,
|
|
1706
|
+
context: {
|
|
1707
|
+
message: 'Invalid returnUrl: must be a relative path or an allowed frontend origin',
|
|
1708
|
+
returnUrl,
|
|
1709
|
+
},
|
|
1710
|
+
});
|
|
1711
|
+
}
|
|
1712
|
+
/**
|
|
1713
|
+
* Resolve the public URL of the frontend app that initiated this request.
|
|
1714
|
+
*
|
|
1715
|
+
* Reads the X-Frontend-Service-Name header (a configured frontend service identity),
|
|
1716
|
+
* then looks up the
|
|
1717
|
+
* corresponding publicUrl from the configured runtime endpoints.
|
|
1718
|
+
*
|
|
1719
|
+
* Fail-fast: throws if the header is missing, the frontend service is unknown,
|
|
1720
|
+
* or no publicUrl is configured for that frontend service.
|
|
1721
|
+
*/
|
|
1722
|
+
resolveFrontendAppPublicUrl(req) {
|
|
1723
|
+
const frontendServiceName = req.headers[WildoHeaderKeys.FRONTEND_SERVICE_NAME];
|
|
1724
|
+
if (!frontendServiceName) {
|
|
1725
|
+
throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {
|
|
1726
|
+
context: {
|
|
1727
|
+
message: 'X-Frontend-Service-Name header is required. The frontend must identify itself.',
|
|
1728
|
+
header: WildoHeaderKeys.FRONTEND_SERVICE_NAME,
|
|
1729
|
+
},
|
|
1730
|
+
});
|
|
1731
|
+
}
|
|
1732
|
+
return this._lookupFrontendPublicUrl(frontendServiceName);
|
|
1733
|
+
}
|
|
1734
|
+
/**
|
|
1735
|
+
* Resolve the frontend service identity from a raw string (e.g., from state token metadata).
|
|
1736
|
+
* Returns the publicUrl for that frontend service. Throws if invalid or not configured.
|
|
1737
|
+
*/
|
|
1738
|
+
resolveFrontendAppPublicUrlFromFrontendServiceName(frontendServiceName) {
|
|
1739
|
+
return this._lookupFrontendPublicUrl(frontendServiceName);
|
|
1740
|
+
}
|
|
1741
|
+
/**
|
|
1742
|
+
* Core lookup: delegates to AuthControllerUtils.lookupFrontendPublicUrl (returns null on failure),
|
|
1743
|
+
* then throws if null. Preserves the original fail-fast behavior in the controller.
|
|
1744
|
+
*/
|
|
1745
|
+
_lookupFrontendPublicUrl(frontendServiceName) {
|
|
1746
|
+
const url = AuthControllerUtils.lookupFrontendPublicUrl(this.appConfigService.config, frontendServiceName);
|
|
1747
|
+
if (!url) {
|
|
1748
|
+
throw this.errorBuilder.buildError(ErrorType.INTERNAL, undefined, {
|
|
1749
|
+
context: {
|
|
1750
|
+
message: `Cannot resolve publicUrl for frontend service "${frontendServiceName}".`,
|
|
1751
|
+
frontendServiceName,
|
|
1752
|
+
},
|
|
1753
|
+
});
|
|
1754
|
+
}
|
|
1755
|
+
return url;
|
|
1756
|
+
}
|
|
1757
|
+
/**
|
|
1758
|
+
* AUTH-10: Cross-validate X-Frontend-Service-Name header against the browser Origin header.
|
|
1759
|
+
*
|
|
1760
|
+
* The Origin header is browser-enforced (forbidden header per Fetch spec) and cannot
|
|
1761
|
+
* be spoofed by client-side JavaScript. If the Origin doesn't match the configured
|
|
1762
|
+
* publicUrl for the claimed frontend service, the request is rejected.
|
|
1763
|
+
*
|
|
1764
|
+
* Non-browser clients (curl, Postman, mobile SDKs) do not send the Origin header,
|
|
1765
|
+
* so this validation is skipped for them. This is acceptable because:
|
|
1766
|
+
* - Rate limiting gates all registration/identify endpoints
|
|
1767
|
+
* - Registration policy enforcement (mode, password policy) applies regardless
|
|
1768
|
+
* - The DB override in the orchestrator protects known users independently
|
|
1769
|
+
* If non-browser registration restriction is needed, use invitation tokens or API keys.
|
|
1770
|
+
*/
|
|
1771
|
+
_validateFrontendAppOrigin(req, claimedFrontendServiceName) {
|
|
1772
|
+
if (!claimedFrontendServiceName)
|
|
1773
|
+
return;
|
|
1774
|
+
const configuredUrl = AuthControllerUtils.lookupFrontendPublicUrl(this.appConfigService.config, claimedFrontendServiceName);
|
|
1775
|
+
if (!configuredUrl) {
|
|
1776
|
+
throw this.errorBuilder.buildError(ErrorType.AUTHORIZATION, undefined, {
|
|
1777
|
+
customMessageReference: ErrorCustomMessageReference.AUTHORIZATION,
|
|
1778
|
+
context: {
|
|
1779
|
+
message: `Unknown or unbound frontend service identity "${claimedFrontendServiceName}". ` +
|
|
1780
|
+
`Declare it in frontendServices and materialize runtime.endPoints.${claimedFrontendServiceName}.publicUrl before using it at runtime.`,
|
|
1781
|
+
frontendServiceName: claimedFrontendServiceName,
|
|
1782
|
+
},
|
|
1783
|
+
});
|
|
1784
|
+
}
|
|
1785
|
+
// Origin absent → non-browser client or same-origin; skip (see JSDoc for rationale)
|
|
1786
|
+
const origin = req.headers[WildoHeaderKeys.ORIGIN];
|
|
1787
|
+
if (!origin)
|
|
1788
|
+
return;
|
|
1789
|
+
try {
|
|
1790
|
+
const configuredOrigin = new URL(configuredUrl).origin;
|
|
1791
|
+
if (origin !== configuredOrigin) {
|
|
1792
|
+
this.logDebug('Origin mismatch — X-Frontend-Service-Name header does not match request Origin', {
|
|
1793
|
+
claimedFrontendServiceName,
|
|
1794
|
+
requestOrigin: origin,
|
|
1795
|
+
configuredOrigin,
|
|
1796
|
+
});
|
|
1797
|
+
throw this.errorBuilder.buildError(ErrorType.AUTHORIZATION, undefined, {
|
|
1798
|
+
customMessageReference: ErrorCustomMessageReference.AUTHORIZATION,
|
|
1799
|
+
context: { message: 'Request origin does not match the claimed frontend service identity.' },
|
|
1800
|
+
});
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
catch (e) {
|
|
1804
|
+
if (isWildoBackendError(e))
|
|
1805
|
+
throw e;
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1808
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1809
|
+
// Magic Link Route Handlers (Phase G2)
|
|
1810
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1811
|
+
/**
|
|
1812
|
+
* POST /auth/magic-link/send
|
|
1813
|
+
* Body: { email: string }
|
|
1814
|
+
* Response: { message: string }
|
|
1815
|
+
*
|
|
1816
|
+
* Generates a magic link token and sends an email containing the link.
|
|
1817
|
+
* Always returns success to prevent email enumeration.
|
|
1818
|
+
*/
|
|
1819
|
+
async magicLinkSend(req, res) {
|
|
1820
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
1821
|
+
const body = MagicLinkSendRequestSchema.parse(req.body || {});
|
|
1822
|
+
const ipAddress = AuthControllerUtils.getClientIpFromRequest(req);
|
|
1823
|
+
const userAgent = req.headers[WildoHeaderKeys.USER_AGENT] || 'unknown';
|
|
1824
|
+
this.logDebug('Magic link send requested', { email: body.email });
|
|
1825
|
+
// IP-based rate limit to prevent email flooding from a single source
|
|
1826
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.MAGIC_LINK_SEND_IP}${ipAddress}`, 10, 3600);
|
|
1827
|
+
const result = await this.authService.sendMagicLink(ec, body, { ipAddress, userAgent });
|
|
1828
|
+
if (result.token && result.email) {
|
|
1829
|
+
try {
|
|
1830
|
+
const frontendUrl = this.resolveFrontendAppPublicUrl(req);
|
|
1831
|
+
const magicLinkUrl = `${frontendUrl}/auth/magic-link/verify?token=${encodeURIComponent(result.token)}&email=${encodeURIComponent(result.email)}`;
|
|
1832
|
+
const appIdentity = this.appConfigService.config.appIdentity;
|
|
1833
|
+
await this.emailService.send({
|
|
1834
|
+
templateRef: SystemEmailTemplateRef.MAGIC_LINK,
|
|
1835
|
+
locale: AvailableLanguage.EN,
|
|
1836
|
+
type: EmailTemplateType.TRANSACTIONAL,
|
|
1837
|
+
to: result.email,
|
|
1838
|
+
context: {
|
|
1839
|
+
currentObject: { email: result.email },
|
|
1840
|
+
objectContext: {
|
|
1841
|
+
primaryScopeContext: {
|
|
1842
|
+
appName: appIdentity.appName,
|
|
1843
|
+
applicationId: this.appConfigService.applicationId,
|
|
1844
|
+
},
|
|
1845
|
+
},
|
|
1846
|
+
userContext: { userId: result.userId || 'unknown', email: result.email },
|
|
1847
|
+
additionalContext: { magicLinkUrl, tokenValue: result.token, expiresInMinutes: result.expiresInMinutes },
|
|
1848
|
+
},
|
|
1849
|
+
});
|
|
1850
|
+
}
|
|
1851
|
+
catch (error) {
|
|
1852
|
+
this.logger.error('Failed to send magic link email', {
|
|
1853
|
+
email: result.email,
|
|
1854
|
+
error: error instanceof Error ? error.message : String(error),
|
|
1855
|
+
});
|
|
1856
|
+
// Don't reveal email delivery failure (anti-enumeration)
|
|
1857
|
+
}
|
|
1858
|
+
}
|
|
1859
|
+
this.jsonSuccess(res, this.authResponseHelper.getAuthResponse(AuthResponseMessageRef.MAGIC_LINK_SENT));
|
|
1860
|
+
}
|
|
1861
|
+
/**
|
|
1862
|
+
* POST /auth/magic-link/verify
|
|
1863
|
+
* Body: { token: string, email: string }
|
|
1864
|
+
* Response: AuthenticationResponse
|
|
1865
|
+
*
|
|
1866
|
+
* Validates a magic link token and returns auth tokens on success.
|
|
1867
|
+
* Email is included for defense-in-depth constant-time comparison against token metadata.
|
|
1868
|
+
* This is a standalone auth endpoint (not dispatched through authenticate()).
|
|
1869
|
+
*/
|
|
1870
|
+
async magicLinkVerify(req, res) {
|
|
1871
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
1872
|
+
const body = MagicLinkVerifyRequestSchema.parse(req.body || {});
|
|
1873
|
+
const ipAddress = AuthControllerUtils.getClientIpFromRequest(req);
|
|
1874
|
+
const userAgent = req.headers[WildoHeaderKeys.USER_AGENT] || 'unknown';
|
|
1875
|
+
// IP-based rate limit for resource protection
|
|
1876
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.MAGIC_LINK_VERIFY_IP}${ipAddress}`, 20, 60);
|
|
1877
|
+
this.logDebug('Magic link verify requested');
|
|
1878
|
+
const authResponse = await this.authService.verifyMagicLink(ec, body, { ipAddress, userAgent });
|
|
1879
|
+
await this.handleAnonymousTransposition(req, authResponse);
|
|
1880
|
+
this.jsonSuccess(res, authResponse);
|
|
1881
|
+
}
|
|
1882
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1883
|
+
// SMS OTP Route Handlers (Phase G2)
|
|
1884
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1885
|
+
/**
|
|
1886
|
+
* POST /auth/sms-otp/send
|
|
1887
|
+
* Body: { sessionId: string, phoneNumber?: string }
|
|
1888
|
+
* Response: { message: string }
|
|
1889
|
+
*
|
|
1890
|
+
* Generates an OTP code and sends it via SMS.
|
|
1891
|
+
* Requires an active auth session. Can be used for first or second factor.
|
|
1892
|
+
*/
|
|
1893
|
+
async smsOTPSend(req, res) {
|
|
1894
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
1895
|
+
const body = z.object({
|
|
1896
|
+
sessionId: z.string().min(1),
|
|
1897
|
+
phoneNumber: z.string().regex(/^\+?[1-9]\d{1,14}$/, { error: 'Invalid phone number' }).optional(),
|
|
1898
|
+
}).parse(req.body || {});
|
|
1899
|
+
this.logDebug('SMS OTP send requested', { sessionId: body.sessionId });
|
|
1900
|
+
// IP-based rate limit to prevent SMS pump fraud from a single source
|
|
1901
|
+
const ipAddress = AuthControllerUtils.getClientIpFromRequest(req);
|
|
1902
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.SMS_OTP_SEND_IP}${ipAddress}`, 5, 3600);
|
|
1903
|
+
const result = await this.authService.sendSMSOTP(ec, body.sessionId, body.phoneNumber);
|
|
1904
|
+
const appIdentity = this.appConfigService.config.appIdentity;
|
|
1905
|
+
const smsResult = await this.smsService.send(result.targetPhone, this.authResponseHelper.getSmsLabel(BackendSmsMessageRef.OTP_VERIFICATION_CODE, { appName: appIdentity.appName, code: result.otpCode }));
|
|
1906
|
+
if (!smsResult.success) {
|
|
1907
|
+
this.logger.error('SMS OTP delivery failed', {
|
|
1908
|
+
sessionId: body.sessionId,
|
|
1909
|
+
error: smsResult.error,
|
|
1910
|
+
});
|
|
1911
|
+
throw this.errorBuilder.buildError(ErrorType.AUTHENTICATION, undefined, {
|
|
1912
|
+
context: { message: this.authResponseHelper.getSmsLabel(BackendSmsMessageRef.VERIFICATION_SEND_FAILED) },
|
|
1913
|
+
});
|
|
1914
|
+
}
|
|
1915
|
+
this.jsonSuccess(res, { message: this.authResponseHelper.getSmsLabel(BackendSmsMessageRef.VERIFICATION_SENT) });
|
|
1916
|
+
}
|
|
1917
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1918
|
+
// Phone Verification Route Handlers (Phase G2)
|
|
1919
|
+
// ═══════════════════════════════════════════════════════════════
|
|
1920
|
+
/**
|
|
1921
|
+
* POST /auth/phone/verify/send
|
|
1922
|
+
* Body: { phoneNumber: string, sessionId?: string }
|
|
1923
|
+
* Response: { message: string }
|
|
1924
|
+
*
|
|
1925
|
+
* Sends a verification code to prove phone number ownership.
|
|
1926
|
+
* Used during account setup, not authentication.
|
|
1927
|
+
*/
|
|
1928
|
+
async phoneVerifySend(req, res) {
|
|
1929
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
1930
|
+
const body = PhoneVerifySendRequestSchema.parse(req.body || {});
|
|
1931
|
+
const ipAddress = AuthControllerUtils.getClientIpFromRequest(req);
|
|
1932
|
+
await this.authJwtGuard.extractFromSessionOrJwt(ec, req);
|
|
1933
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.PHONE_VERIFY_SEND}${body.phoneNumber}`, 3, 300);
|
|
1934
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.PHONE_VERIFY_SEND_IP}${ipAddress}`, 5, 3600);
|
|
1935
|
+
const { otpCode } = await this.phoneVerificationService.createVerificationCode(ec, {
|
|
1936
|
+
phoneNumber: body.phoneNumber,
|
|
1937
|
+
ipAddress,
|
|
1938
|
+
});
|
|
1939
|
+
const appIdentity = this.appConfigService.config.appIdentity;
|
|
1940
|
+
const smsResult = await this.smsService.send(body.phoneNumber, this.authResponseHelper.getSmsLabel(BackendSmsMessageRef.PHONE_VERIFICATION_CODE, { appName: appIdentity.appName, code: otpCode, expiry: '10' }));
|
|
1941
|
+
if (!smsResult.success) {
|
|
1942
|
+
this.logger.error('Phone verification SMS delivery failed', { phoneNumber: body.phoneNumber, error: smsResult.error });
|
|
1943
|
+
throw this.errorBuilder.buildError(ErrorType.AUTHENTICATION, undefined, {
|
|
1944
|
+
context: { message: this.authResponseHelper.getSmsLabel(BackendSmsMessageRef.VERIFICATION_SEND_FAILED) },
|
|
1945
|
+
});
|
|
1946
|
+
}
|
|
1947
|
+
this.jsonSuccess(res, { message: this.authResponseHelper.getSmsLabel(BackendSmsMessageRef.PHONE_VERIFICATION_SENT) });
|
|
1948
|
+
}
|
|
1949
|
+
/**
|
|
1950
|
+
* POST /auth/phone/verify/confirm
|
|
1951
|
+
* Body: { phoneNumber: string, code: string }
|
|
1952
|
+
* Response: { verified: boolean }
|
|
1953
|
+
*
|
|
1954
|
+
* Confirms phone ownership by validating the submitted code.
|
|
1955
|
+
* On success, marks the phone as verified on the user's credentials.
|
|
1956
|
+
*/
|
|
1957
|
+
async phoneVerifyConfirm(req, res) {
|
|
1958
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
1959
|
+
const body = PhoneVerifyConfirmRequestSchema.parse(req.body || {});
|
|
1960
|
+
const { userId } = await this.authJwtGuard.extractFromSessionOrJwt(ec, req);
|
|
1961
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.PHONE_VERIFY_CONFIRM}${body.phoneNumber}`, 5, 300);
|
|
1962
|
+
const result = await this.phoneVerificationService.confirmVerification(ec, {
|
|
1963
|
+
phoneNumber: body.phoneNumber,
|
|
1964
|
+
code: body.code,
|
|
1965
|
+
userId,
|
|
1966
|
+
ipAddress: AuthControllerUtils.getClientIpFromRequest(req),
|
|
1967
|
+
userAgent: req.headers[WildoHeaderKeys.USER_AGENT] || 'unknown',
|
|
1968
|
+
});
|
|
1969
|
+
this.jsonSuccess(res, result);
|
|
1970
|
+
}
|
|
1971
|
+
/**
|
|
1972
|
+
* POST /auth/native-token/exchange
|
|
1973
|
+
* Body: { provider: 'apple' | 'google', identityToken: string, userType?: 'user' }
|
|
1974
|
+
* Response: { accessToken, refreshToken?, expiresIn?, isNewUser }
|
|
1975
|
+
*
|
|
1976
|
+
* Exchanges a native Apple/Google SDK identity token for a Wildo JWT.
|
|
1977
|
+
* The identity token is verified against the IdP's JWKS before provisioning.
|
|
1978
|
+
*/
|
|
1979
|
+
async nativeTokenExchange(req, res) {
|
|
1980
|
+
const ipAddress = AuthControllerUtils.getClientIpFromRequest(req);
|
|
1981
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.NATIVE_EXCHANGE_IP}${ipAddress}`, 10, 60);
|
|
1982
|
+
const body = NativeTokenExchangeRequestSchema.parse(req.body || {});
|
|
1983
|
+
const { provider, identityToken, nonce } = body;
|
|
1984
|
+
const appConfig = this.appConfigService.config;
|
|
1985
|
+
const providerConfig = appConfig.externalProvidersConfigurations?.[provider]?.sso_oauth2;
|
|
1986
|
+
const nativeClientIds = providerConfig?.nativeClientIds || [];
|
|
1987
|
+
if (nativeClientIds.length === 0) {
|
|
1988
|
+
throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {
|
|
1989
|
+
customMessageReference: ErrorCustomMessageReference.APP_CONFIGURATION_NOT_INITIALIZED,
|
|
1990
|
+
context: { message: `Native SDK token exchange not configured for provider '${provider}'. Set nativeClientIds in externalProvidersConfigurations.` },
|
|
1991
|
+
});
|
|
1992
|
+
}
|
|
1993
|
+
try {
|
|
1994
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
1995
|
+
const { provisionResult, normalizedProfile } = await this.oauth2Service.exchangeNativeToken(provider, identityToken, nativeClientIds, nonce);
|
|
1996
|
+
const deviceInfo = {
|
|
1997
|
+
ipAddress,
|
|
1998
|
+
userAgent: req.headers[WildoHeaderKeys.USER_AGENT] || 'unknown',
|
|
1999
|
+
};
|
|
2000
|
+
// Resolve activeUserType hint from X-Frontend-Service-Name header.
|
|
2001
|
+
// The orchestrator overrides with the DB-stored userTypes[0] for the provisioned user.
|
|
2002
|
+
// Cross-validate Origin against the claimed frontend service (defense-in-depth).
|
|
2003
|
+
const nativeFrontendServiceName = req.headers[WildoHeaderKeys.FRONTEND_SERVICE_NAME];
|
|
2004
|
+
this._validateFrontendAppOrigin(req, nativeFrontendServiceName);
|
|
2005
|
+
const nativeActiveUserType = nativeFrontendServiceName
|
|
2006
|
+
? this.appConfigService.resolveUserTypeFromFrontendServiceName(nativeFrontendServiceName) ?? undefined
|
|
2007
|
+
: undefined;
|
|
2008
|
+
const result = await this.authService.handleNativeSDKFirstFactor(ec, provisionResult.userId, normalizedProfile.email, deviceInfo, nativeActiveUserType, nativeFrontendServiceName);
|
|
2009
|
+
await this.auditLogsService.logUserSSOLogin({
|
|
2010
|
+
userId: provisionResult.userId,
|
|
2011
|
+
email: normalizedProfile.email,
|
|
2012
|
+
providerRef: provider,
|
|
2013
|
+
connectionType: SsoConnectionType.SOCIAL,
|
|
2014
|
+
authSource: AuthSource.OIDC,
|
|
2015
|
+
ipAddress: deviceInfo.ipAddress,
|
|
2016
|
+
userAgent: deviceInfo.userAgent,
|
|
2017
|
+
sessionId: result.mfaRequired ? result.sessionId : `native-sdk:${provider}:${provisionResult.userId}`,
|
|
2018
|
+
});
|
|
2019
|
+
if (result.mfaRequired === true) {
|
|
2020
|
+
this.jsonSuccess(res, {
|
|
2021
|
+
mfaRequired: true,
|
|
2022
|
+
sessionId: result.sessionId,
|
|
2023
|
+
enrolledMethods: result.enrolledMethods,
|
|
2024
|
+
isNewUser: provisionResult.isNewUser,
|
|
2025
|
+
});
|
|
2026
|
+
}
|
|
2027
|
+
else {
|
|
2028
|
+
await this.handleAnonymousTranspositionForTokenExchange(req, provisionResult.userId);
|
|
2029
|
+
this.jsonSuccess(res, {
|
|
2030
|
+
accessToken: result.tokens.accessToken,
|
|
2031
|
+
refreshToken: result.tokens.refreshToken,
|
|
2032
|
+
expiresIn: result.tokens.expiresIn,
|
|
2033
|
+
isNewUser: provisionResult.isNewUser,
|
|
2034
|
+
});
|
|
2035
|
+
}
|
|
2036
|
+
}
|
|
2037
|
+
catch (error) {
|
|
2038
|
+
if (isWildoBackendError(error))
|
|
2039
|
+
throw error;
|
|
2040
|
+
this.logger.warn('Native token exchange failed', {
|
|
2041
|
+
provider,
|
|
2042
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2043
|
+
ipAddress,
|
|
2044
|
+
});
|
|
2045
|
+
throw this.errorBuilder.buildError(ErrorType.AUTHENTICATION, undefined, {
|
|
2046
|
+
customMessageReference: ErrorCustomMessageReference.AUTHENTICATION_INVALID_TOKEN,
|
|
2047
|
+
context: { message: 'Invalid or expired identity token' },
|
|
2048
|
+
});
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2051
|
+
// ═══════════════════════════════════════════════════════════════
|
|
2052
|
+
// W7.3b: One-Off Session Token Handlers
|
|
2053
|
+
// ═══════════════════════════════════════════════════════════════
|
|
2054
|
+
async createOneOffToken(req, res) {
|
|
2055
|
+
const preAuthEc = await this._getPreAuthExecutionContext();
|
|
2056
|
+
const ipAddress = AuthControllerUtils.getClientIpFromRequest(req);
|
|
2057
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.ONE_OFF_CREATE_IP}${ipAddress}`, 30, 60);
|
|
2058
|
+
const caller = await this.authJwtGuard.extractAuthenticatedUser(preAuthEc, req);
|
|
2059
|
+
const ec = await this._getAuthenticatedExecutionContext(caller.userId);
|
|
2060
|
+
const body = CreateOneOffTokenRequestSchema.parse(req.body || {});
|
|
2061
|
+
const callerUser = await this.userLookup.findUserById(ec, caller.userId);
|
|
2062
|
+
const callerRoles = callerUser?.appRoles || [];
|
|
2063
|
+
const isAdmin = callerRoles.includes(CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN);
|
|
2064
|
+
if (!isAdmin) {
|
|
2065
|
+
throw this.errorBuilder.buildError(ErrorType.AUTHORIZATION, undefined, {
|
|
2066
|
+
customMessageReference: ErrorCustomMessageReference.AUTHORIZATIONS_ACCESS_DENIED,
|
|
2067
|
+
context: { message: 'Only super-admin users can create one-off session tokens.' },
|
|
2068
|
+
});
|
|
2069
|
+
}
|
|
2070
|
+
if (caller.userId === body.userId) {
|
|
2071
|
+
throw this.errorBuilder.buildError(ErrorType.AUTHORIZATION, undefined, {
|
|
2072
|
+
customMessageReference: ErrorCustomMessageReference.AUTHORIZATIONS_ACCESS_DENIED,
|
|
2073
|
+
context: { message: 'Cannot create one-off token targeting self.' },
|
|
2074
|
+
});
|
|
2075
|
+
}
|
|
2076
|
+
const targetUser = await this.userLookup.findUserById(ec, body.userId);
|
|
2077
|
+
if (!targetUser) {
|
|
2078
|
+
throw this.errorBuilder.buildError(ErrorType.NOT_FOUND, undefined, {
|
|
2079
|
+
customMessageReference: ErrorCustomMessageReference.AUTHENTICATION_USER_NOT_FOUND,
|
|
2080
|
+
context: { userId: body.userId },
|
|
2081
|
+
});
|
|
2082
|
+
}
|
|
2083
|
+
if (targetUser.status !== UserStatus.ACTIVE) {
|
|
2084
|
+
throw this.errorBuilder.buildError(ErrorType.AUTHORIZATION, undefined, {
|
|
2085
|
+
customMessageReference: ErrorCustomMessageReference.AUTHENTICATION_USER_NOT_ACTIVE,
|
|
2086
|
+
context: { userId: body.userId },
|
|
2087
|
+
});
|
|
2088
|
+
}
|
|
2089
|
+
const userType = targetUser.userTypes?.[0];
|
|
2090
|
+
if (!userType) {
|
|
2091
|
+
throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {
|
|
2092
|
+
customMessageReference: ErrorCustomMessageReference.AUTHENTICATION_USER_TYPE_MISMATCH,
|
|
2093
|
+
context: { userId: body.userId, message: 'Target user has no assigned user type.' },
|
|
2094
|
+
});
|
|
2095
|
+
}
|
|
2096
|
+
const appConfig = this.appConfigService.config;
|
|
2097
|
+
const userTypeConfig = appConfig?.userTypes?.[userType];
|
|
2098
|
+
if (!userTypeConfig?.auth?.oneOffSessionAllowed) {
|
|
2099
|
+
throw this.errorBuilder.buildError(ErrorType.AUTHORIZATION, undefined, {
|
|
2100
|
+
customMessageReference: ErrorCustomMessageReference.FEATURE_NOT_AVAILABLE,
|
|
2101
|
+
context: { message: `One-off sessions not allowed for user type "${userType}".` },
|
|
2102
|
+
});
|
|
2103
|
+
}
|
|
2104
|
+
const expiresIn = body.expiresIn;
|
|
2105
|
+
const durationMs = expiresIn.unit === 'minutes' ? expiresIn.value * 60 * 1000
|
|
2106
|
+
: expiresIn.unit === 'hours' ? expiresIn.value * 3600 * 1000
|
|
2107
|
+
: expiresIn.value * 86400 * 1000;
|
|
2108
|
+
const organizationId = req.params.organizationId;
|
|
2109
|
+
const applicationId = req.params.applicationId;
|
|
2110
|
+
const tokenResult = await this.consumableTokenService.createToken({
|
|
2111
|
+
tokenType: body.tokenType,
|
|
2112
|
+
consumptionMode: body.consumptionMode,
|
|
2113
|
+
expiresIn: { value: durationMs, unit: DurationUnit.MILLISECONDS },
|
|
2114
|
+
organizationId,
|
|
2115
|
+
userId: body.userId,
|
|
2116
|
+
resourceIdentifier: body.resourceIdentifier,
|
|
2117
|
+
relatedId: body.relatedId,
|
|
2118
|
+
metadata: { ...body.metadata, ...(applicationId ? { applicationId } : {}) },
|
|
2119
|
+
roles: (targetUser.appRoles || []).map(role => ({
|
|
2120
|
+
roles: [role],
|
|
2121
|
+
relatedPrimaryScope: ResourcePrimaryScope.APPLICATION,
|
|
2122
|
+
})),
|
|
2123
|
+
maxUses: body.maxUses,
|
|
2124
|
+
createsOneOffSession: true,
|
|
2125
|
+
consumeAt: body.consumeAt,
|
|
2126
|
+
targeting: body.targeting,
|
|
2127
|
+
});
|
|
2128
|
+
try {
|
|
2129
|
+
await this.auditLogsService.logGenericEvent({
|
|
2130
|
+
userId: caller.userId,
|
|
2131
|
+
organizationId,
|
|
2132
|
+
riskLevel: ResourceOperationRiskLevel.MEDIUM,
|
|
2133
|
+
eventType: CoreAuditableEventType.ONE_OFF_TOKEN_CREATED,
|
|
2134
|
+
eventData: {
|
|
2135
|
+
tokenId: tokenResult._id,
|
|
2136
|
+
tokenType: body.tokenType,
|
|
2137
|
+
targetUserId: body.userId,
|
|
2138
|
+
consumeAt: body.consumeAt,
|
|
2139
|
+
callerUserId: caller.userId,
|
|
2140
|
+
ipAddress,
|
|
2141
|
+
userAgent: req.headers[WildoHeaderKeys.USER_AGENT] || 'unknown',
|
|
2142
|
+
},
|
|
2143
|
+
});
|
|
2144
|
+
}
|
|
2145
|
+
catch (error) {
|
|
2146
|
+
this.logger.warn('Audit log failed for one-off token creation', { error, tokenId: tokenResult._id });
|
|
2147
|
+
}
|
|
2148
|
+
this.jsonSuccess(res, {
|
|
2149
|
+
tokenValue: tokenResult.token,
|
|
2150
|
+
tokenId: tokenResult._id,
|
|
2151
|
+
expiresAt: tokenResult.expiresAt,
|
|
2152
|
+
});
|
|
2153
|
+
}
|
|
2154
|
+
async exchangeOneOffToken(req, res) {
|
|
2155
|
+
const ipAddress = AuthControllerUtils.getClientIpFromRequest(req);
|
|
2156
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.ONE_OFF_EXCHANGE_IP}${ipAddress}`, 10, 60);
|
|
2157
|
+
await this.rateLimitService.checkRateLimit(`${AUTH_REDIS_KEYS.ONE_OFF_EXCHANGE_HOUR_IP}${ipAddress}`, 100, 3600);
|
|
2158
|
+
const body = OneOffSessionExchangeBodySchema.parse(req.body || {});
|
|
2159
|
+
const consumableToken = await this.consumableTokenService.validateToken(body.token);
|
|
2160
|
+
if (!consumableToken.createsOneOffSession) {
|
|
2161
|
+
throw this.errorBuilder.buildError(ErrorType.AUTHENTICATION, undefined, {
|
|
2162
|
+
customMessageReference: ErrorCustomMessageReference.CONSUMABLE_TOKEN_TYPE_MISMATCH,
|
|
2163
|
+
context: { message: 'Token is not a one-off session token.' },
|
|
2164
|
+
});
|
|
2165
|
+
}
|
|
2166
|
+
if (!consumableToken.userId) {
|
|
2167
|
+
throw this.errorBuilder.buildError(ErrorType.AUTHENTICATION, undefined, {
|
|
2168
|
+
customMessageReference: ErrorCustomMessageReference.CONSUMABLE_TOKEN_CONTEXT_MISMATCH,
|
|
2169
|
+
context: { message: 'Token has no target user.' },
|
|
2170
|
+
});
|
|
2171
|
+
}
|
|
2172
|
+
const ec = await this._getPreAuthExecutionContext();
|
|
2173
|
+
const targetUser = await this.userLookup.findUserById(ec, consumableToken.userId);
|
|
2174
|
+
if (!targetUser || targetUser.status !== UserStatus.ACTIVE) {
|
|
2175
|
+
throw this.errorBuilder.buildError(ErrorType.AUTHENTICATION, undefined, {
|
|
2176
|
+
customMessageReference: ErrorCustomMessageReference.AUTHENTICATION_USER_NOT_ACTIVE,
|
|
2177
|
+
context: { userId: consumableToken.userId },
|
|
2178
|
+
});
|
|
2179
|
+
}
|
|
2180
|
+
const userType = targetUser.userTypes?.[0];
|
|
2181
|
+
if (!userType) {
|
|
2182
|
+
throw this.errorBuilder.buildError(ErrorType.AUTHENTICATION, undefined, {
|
|
2183
|
+
customMessageReference: ErrorCustomMessageReference.AUTHENTICATION_USER_TYPE_MISMATCH,
|
|
2184
|
+
context: { userId: consumableToken.userId },
|
|
2185
|
+
});
|
|
2186
|
+
}
|
|
2187
|
+
const appConfig = this.appConfigService.config;
|
|
2188
|
+
const userTypeConfig = appConfig?.userTypes?.[userType];
|
|
2189
|
+
if (!userTypeConfig?.auth?.oneOffSessionAllowed) {
|
|
2190
|
+
throw this.errorBuilder.buildError(ErrorType.AUTHORIZATION, undefined, {
|
|
2191
|
+
customMessageReference: ErrorCustomMessageReference.FEATURE_NOT_AVAILABLE,
|
|
2192
|
+
context: { message: `One-off sessions no longer allowed for user type "${userType}".` },
|
|
2193
|
+
});
|
|
2194
|
+
}
|
|
2195
|
+
let consumableTokenValue;
|
|
2196
|
+
if (consumableToken.consumeAt === 'EXCHANGE') {
|
|
2197
|
+
await this.consumableTokenService.consumeToken(body.token);
|
|
2198
|
+
}
|
|
2199
|
+
else {
|
|
2200
|
+
consumableTokenValue = body.token;
|
|
2201
|
+
}
|
|
2202
|
+
const tokens = await this.tokenIssuer.issueTokensForUser(consumableToken.userId, undefined, { sessionType: SessionType.ONE_OFF, activeUserType: userType }, {
|
|
2203
|
+
skipSessionTracking: true,
|
|
2204
|
+
refreshTokenExpiresAt: consumableToken.expiresAt,
|
|
2205
|
+
});
|
|
2206
|
+
try {
|
|
2207
|
+
await this.auditLogsService.logGenericEvent({
|
|
2208
|
+
userId: consumableToken.userId,
|
|
2209
|
+
organizationId: consumableToken.organizationId,
|
|
2210
|
+
riskLevel: ResourceOperationRiskLevel.MEDIUM,
|
|
2211
|
+
eventType: CoreAuditableEventType.ONE_OFF_TOKEN_EXCHANGED,
|
|
2212
|
+
eventData: {
|
|
2213
|
+
tokenId: consumableToken._id,
|
|
2214
|
+
tokenType: consumableToken.tokenType,
|
|
2215
|
+
consumeAt: consumableToken.consumeAt,
|
|
2216
|
+
consumed: consumableToken.consumeAt === 'EXCHANGE',
|
|
2217
|
+
ipAddress,
|
|
2218
|
+
userAgent: req.headers[WildoHeaderKeys.USER_AGENT] || 'unknown',
|
|
2219
|
+
},
|
|
2220
|
+
});
|
|
2221
|
+
}
|
|
2222
|
+
catch (error) {
|
|
2223
|
+
this.logger.warn('Audit log failed for one-off token exchange', { error, tokenId: consumableToken._id });
|
|
2224
|
+
}
|
|
2225
|
+
this.jsonSuccess(res, {
|
|
2226
|
+
accessToken: tokens.accessToken,
|
|
2227
|
+
refreshToken: tokens.refreshToken,
|
|
2228
|
+
sessionType: SessionType.ONE_OFF,
|
|
2229
|
+
...(consumableTokenValue ? {
|
|
2230
|
+
consumableTokenValue,
|
|
2231
|
+
tokenExpiresAt: consumableToken.expiresAt.toISOString(),
|
|
2232
|
+
} : {}),
|
|
2233
|
+
context: {
|
|
2234
|
+
tokenId: consumableToken._id,
|
|
2235
|
+
tokenType: consumableToken.tokenType,
|
|
2236
|
+
targeting: consumableToken.targeting,
|
|
2237
|
+
organizationId: consumableToken.organizationId,
|
|
2238
|
+
applicationId: consumableToken.metadata?.applicationId,
|
|
2239
|
+
userId: consumableToken.userId,
|
|
2240
|
+
},
|
|
2241
|
+
});
|
|
2242
|
+
}
|
|
2243
|
+
// ═══════════════════════════════════════════════════════════════
|
|
2244
|
+
// W7.3a: Anonymous Session Transposition on Login/Register
|
|
2245
|
+
// ═══════════════════════════════════════════════════════════════
|
|
2246
|
+
/**
|
|
2247
|
+
* Called after a successful authentication. If the request carries an
|
|
2248
|
+
* anonymous session token, verifies it and transposes ownership of
|
|
2249
|
+
* anonymous resources to the newly authenticated user.
|
|
2250
|
+
*
|
|
2251
|
+
* Errors are swallowed to avoid blocking the auth response.
|
|
2252
|
+
*/
|
|
2253
|
+
async handleAnonymousTransposition(req, authResult) {
|
|
2254
|
+
if (!authResult.success || !authResult.user?._id)
|
|
2255
|
+
return;
|
|
2256
|
+
const anonymousToken = req.headers[WildoHeaderKeys.ANONYMOUS_SESSION];
|
|
2257
|
+
if (!anonymousToken)
|
|
2258
|
+
return;
|
|
2259
|
+
try {
|
|
2260
|
+
const { anonymousUserId } = this.anonymousSessionService.verifySessionToken(anonymousToken);
|
|
2261
|
+
const userType = this.resolveUserTypeFromRequest(req)
|
|
2262
|
+
?? authResult.user.userTypes?.[0]
|
|
2263
|
+
?? 'default';
|
|
2264
|
+
const result = await this.anonymousSessionService.transposeOwnership(anonymousUserId, authResult.user._id, userType);
|
|
2265
|
+
this.logDebug('Anonymous session transposition completed', {
|
|
2266
|
+
anonymousUserId,
|
|
2267
|
+
userId: authResult.user._id,
|
|
2268
|
+
userType,
|
|
2269
|
+
status: result.status,
|
|
2270
|
+
transposedTypes: result.transposedTypes,
|
|
2271
|
+
failedCount: result.failedTypes.length,
|
|
2272
|
+
});
|
|
2273
|
+
}
|
|
2274
|
+
catch (error) {
|
|
2275
|
+
this.logger.warn('Anonymous session transposition failed (non-blocking)', {
|
|
2276
|
+
userId: authResult.user._id,
|
|
2277
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2278
|
+
});
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
/**
|
|
2282
|
+
* Simplified transposition for OAuth2 token exchange, where we have a userId
|
|
2283
|
+
* but no AuthenticationResponse. Uses header-resolved userType.
|
|
2284
|
+
*/
|
|
2285
|
+
async handleAnonymousTranspositionForTokenExchange(req, userId) {
|
|
2286
|
+
const anonymousToken = req.headers[WildoHeaderKeys.ANONYMOUS_SESSION];
|
|
2287
|
+
if (!anonymousToken)
|
|
2288
|
+
return;
|
|
2289
|
+
try {
|
|
2290
|
+
const { anonymousUserId } = this.anonymousSessionService.verifySessionToken(anonymousToken);
|
|
2291
|
+
const userType = this.resolveUserTypeFromRequest(req) ?? 'default';
|
|
2292
|
+
const result = await this.anonymousSessionService.transposeOwnership(anonymousUserId, userId, userType);
|
|
2293
|
+
this.logDebug('Anonymous session transposition completed (token exchange)', {
|
|
2294
|
+
anonymousUserId, userId, userType, status: result.status,
|
|
2295
|
+
transposedTypes: result.transposedTypes, failedCount: result.failedTypes.length,
|
|
2296
|
+
});
|
|
2297
|
+
}
|
|
2298
|
+
catch (error) {
|
|
2299
|
+
this.logger.warn('Anonymous session transposition failed in token exchange (non-blocking)', {
|
|
2300
|
+
userId, error: error instanceof Error ? error.message : String(error),
|
|
2301
|
+
});
|
|
2302
|
+
}
|
|
2303
|
+
}
|
|
2304
|
+
resolveUserTypeFromRequest(req) {
|
|
2305
|
+
const frontendServiceName = req.headers[WildoHeaderKeys.FRONTEND_SERVICE_NAME];
|
|
2306
|
+
if (!frontendServiceName)
|
|
2307
|
+
return undefined;
|
|
2308
|
+
return this.appConfigService.resolveUserTypeFromFrontendServiceName(frontendServiceName) ?? undefined;
|
|
2309
|
+
}
|
|
2310
|
+
};
|
|
2311
|
+
AuthenticationControllerBackendService = __decorate([
|
|
2312
|
+
injectable(),
|
|
2313
|
+
__param(0, inject(SAAS_SERVICE_TYPES.Logger)),
|
|
2314
|
+
__param(1, inject(SAAS_SERVICE_TYPES.ErrorBuilderService)),
|
|
2315
|
+
__param(2, inject(SAAS_SERVICE_TYPES.ErrorHandlerService)),
|
|
2316
|
+
__param(3, inject(SAAS_SERVICE_TYPES.AuthenticationOrchestratorService)),
|
|
2317
|
+
__param(4, inject(SAAS_SERVICE_TYPES.AuthTokenIssuer)),
|
|
2318
|
+
__param(5, inject(SAAS_SERVICE_TYPES.OAuth2AuthenticationService)),
|
|
2319
|
+
__param(6, inject(SAAS_SERVICE_TYPES.OAuth2ConnectionResolverService)),
|
|
2320
|
+
__param(7, inject(SAAS_SERVICE_TYPES.ConsumableTokenService)),
|
|
2321
|
+
__param(8, inject(SAAS_SERVICE_TYPES.JwtBackendService)),
|
|
2322
|
+
__param(9, inject(SAAS_SERVICE_TYPES.EmailService)),
|
|
2323
|
+
__param(10, inject(SAAS_SERVICE_TYPES.AuthExecutionContextFactory)),
|
|
2324
|
+
__param(11, inject(SAAS_SERVICE_TYPES.AppConfigService)),
|
|
2325
|
+
__param(12, inject(SAAS_SERVICE_TYPES.AuditLogsService)),
|
|
2326
|
+
__param(13, inject(SAAS_SERVICE_TYPES.RateLimitBackendService)),
|
|
2327
|
+
__param(14, inject(SAAS_SERVICE_TYPES.WebAuthnService)),
|
|
2328
|
+
__param(15, inject(SAAS_SERVICE_TYPES.SMSService)),
|
|
2329
|
+
__param(16, inject(SAAS_SERVICE_TYPES.DomainToOrgLookupService)),
|
|
2330
|
+
__param(17, inject(SAAS_SERVICE_TYPES.SAMLAuthenticationService)),
|
|
2331
|
+
__param(18, inject(SAAS_SERVICE_TYPES.SAMLMetadataService)),
|
|
2332
|
+
__param(19, inject(SAAS_SERVICE_TYPES.AuthResponseHelperService)),
|
|
2333
|
+
__param(20, inject(SAAS_SERVICE_TYPES.AuthJwtGuardService)),
|
|
2334
|
+
__param(21, inject(SAAS_SERVICE_TYPES.AuthPasswordResetService)),
|
|
2335
|
+
__param(22, inject(SAAS_SERVICE_TYPES.AuthRegistrationService)),
|
|
2336
|
+
__param(23, inject(SAAS_SERVICE_TYPES.AuthMfaService)),
|
|
2337
|
+
__param(24, inject(SAAS_SERVICE_TYPES.AuthPhoneVerificationService)),
|
|
2338
|
+
__param(25, inject(SAAS_SERVICE_TYPES.AuthMethodManagementService)),
|
|
2339
|
+
__param(26, inject(SAAS_SERVICE_TYPES.AnonymousSessionService)),
|
|
2340
|
+
__param(27, inject(SAAS_SERVICE_TYPES.AuthUserLookupService)),
|
|
2341
|
+
__metadata("design:paramtypes", [LoggerService,
|
|
2342
|
+
ErrorBuilderBackendService,
|
|
2343
|
+
ErrorHandlerService,
|
|
2344
|
+
AuthenticationOrchestratorBackendService,
|
|
2345
|
+
AuthTokenIssuerBackendService,
|
|
2346
|
+
OAuth2AuthenticationBackendService,
|
|
2347
|
+
OAuth2ConnectionResolverBackendService,
|
|
2348
|
+
ConsumableTokenBackendService,
|
|
2349
|
+
JwtBackendService,
|
|
2350
|
+
EmailBackendService,
|
|
2351
|
+
AuthExecutionContextFactoryBackendService,
|
|
2352
|
+
AppConfigurationService,
|
|
2353
|
+
AuditLogsBackendService,
|
|
2354
|
+
RateLimitBackendService,
|
|
2355
|
+
WebAuthnBackendService,
|
|
2356
|
+
SMSBackendService,
|
|
2357
|
+
DomainToOrgLookupBackendService,
|
|
2358
|
+
SAMLAuthenticationBackendService,
|
|
2359
|
+
SAMLMetadataBackendService,
|
|
2360
|
+
AuthResponseHelperBackendService,
|
|
2361
|
+
AuthJwtGuardBackendService,
|
|
2362
|
+
AuthPasswordResetBackendService,
|
|
2363
|
+
AuthRegistrationBackendService,
|
|
2364
|
+
AuthMfaBackendService,
|
|
2365
|
+
AuthPhoneVerificationBackendService,
|
|
2366
|
+
AuthMethodManagementBackendService,
|
|
2367
|
+
AnonymousSessionBackendService,
|
|
2368
|
+
AuthUserLookupBackendService])
|
|
2369
|
+
], AuthenticationControllerBackendService);
|
|
2370
|
+
export { AuthenticationControllerBackendService };
|
|
2371
|
+
//# sourceMappingURL=authentication-controller.backend.service.js.map
|