@wildo-ai/saas-backend-lib 1.1.2 → 1.1.3
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/applications/services/worker-remote-client-factory.backend.service.d.ts.map +1 -1
- package/dist/esm/applications/services/worker-remote-client-factory.backend.service.js +19 -1
- package/dist/esm/applications/services/worker-remote-client-factory.backend.service.js.map +1 -1
- package/dist/esm/base-classes/models/manual-controllers.backend.definition.d.ts.map +1 -1
- package/dist/esm/base-classes/models/manual-controllers.backend.definition.js +4 -0
- package/dist/esm/base-classes/models/manual-controllers.backend.definition.js.map +1 -1
- package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.d.ts +35 -0
- package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.js +111 -0
- package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.d.ts +50 -0
- package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.js +199 -0
- package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/batches/engine-custom-batch-manifests.d.ts +111 -0
- package/dist/esm/base-classes/services/batches/engine-custom-batch-manifests.d.ts.map +1 -1
- package/dist/esm/base-classes/services/batches/engine-custom-batch-manifests.js +140 -0
- package/dist/esm/base-classes/services/batches/engine-custom-batch-manifests.js.map +1 -1
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.js +27 -6
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.d.ts +124 -13
- package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.js +207 -21
- package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.d.ts +60 -8
- package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.js +174 -26
- package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.d.ts +47 -4
- package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.js +96 -29
- package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.d.ts +55 -0
- package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.d.ts.map +1 -0
- package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.js +114 -0
- package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.js.map +1 -0
- package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.d.ts +89 -14
- package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.js +84 -11
- package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.js +9 -1
- package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts +49 -0
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js +171 -18
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js +23 -3
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js +20 -0
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.d.ts +22 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/services/resource-status-transition.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-status-transition.custom-impl.backend.service.js +4 -1
- package/dist/esm/base-classes/services/services/resource-status-transition.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/services/resource-status-transition.definitions.backend.d.ts +11 -0
- package/dist/esm/base-classes/services/services/resource-status-transition.definitions.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-status-transition.definitions.backend.js +39 -5
- package/dist/esm/base-classes/services/services/resource-status-transition.definitions.backend.js.map +1 -1
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.d.ts +181 -2
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js +529 -41
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/services/system-access.backend.service.d.ts +36 -3
- package/dist/esm/base-classes/services/services/system-access.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/system-access.backend.service.js +70 -8
- package/dist/esm/base-classes/services/services/system-access.backend.service.js.map +1 -1
- package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.d.ts +28 -0
- package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.js +90 -0
- package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.js.map +1 -0
- package/dist/esm/billing/batches/usage-flush.batch.backend.service.d.ts +44 -0
- package/dist/esm/billing/batches/usage-flush.batch.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/batches/usage-flush.batch.backend.service.js +99 -0
- package/dist/esm/billing/batches/usage-flush.batch.backend.service.js.map +1 -0
- package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.d.ts +91 -0
- package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.d.ts.map +1 -0
- package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.js +152 -0
- package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.js.map +1 -0
- package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.d.ts +186 -0
- package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.js +474 -0
- package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.js.map +1 -0
- package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.d.ts +100 -0
- package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.js +209 -6
- package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.js.map +1 -1
- package/dist/esm/billing/services/back-office/usage-metering.backend.service.d.ts +200 -4
- package/dist/esm/billing/services/back-office/usage-metering.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/back-office/usage-metering.backend.service.js +593 -64
- package/dist/esm/billing/services/back-office/usage-metering.backend.service.js.map +1 -1
- package/dist/esm/billing/services/billing-adapter-registry.backend.d.ts +36 -0
- package/dist/esm/billing/services/billing-adapter-registry.backend.d.ts.map +1 -0
- package/dist/esm/billing/services/billing-adapter-registry.backend.js +83 -0
- package/dist/esm/billing/services/billing-adapter-registry.backend.js.map +1 -0
- package/dist/esm/billing/services/billing-checkout-metadata.backend.utils.d.ts +9 -0
- package/dist/esm/billing/services/billing-checkout-metadata.backend.utils.d.ts.map +1 -1
- package/dist/esm/billing/services/billing-checkout-metadata.backend.utils.js +11 -1
- package/dist/esm/billing/services/billing-checkout-metadata.backend.utils.js.map +1 -1
- package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.js +48 -7
- package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.d.ts +38 -1
- package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.d.ts.map +1 -1
- package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.js +67 -2
- package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.js.map +1 -1
- package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.d.ts +30 -1
- package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.d.ts.map +1 -1
- package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.js +43 -1
- package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.js.map +1 -1
- package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.d.ts +11 -3
- package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.js +30 -16
- package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.js +104 -25
- package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.d.ts +18 -1
- package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.js +106 -2
- package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.js.map +1 -1
- package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.d.ts +52 -0
- package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.d.ts.map +1 -0
- package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.js +74 -0
- package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.js.map +1 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.d.ts +104 -11
- package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.js +260 -26
- package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.js.map +1 -1
- package/dist/esm/billing/testing/mock-billing-provider.d.ts +30 -1
- package/dist/esm/billing/testing/mock-billing-provider.d.ts.map +1 -1
- package/dist/esm/billing/testing/mock-billing-provider.js +25 -0
- package/dist/esm/billing/testing/mock-billing-provider.js.map +1 -1
- package/dist/esm/compliance/audit-trails/batches/audit-logs-archive.batch.backend.service.js +11 -4
- package/dist/esm/compliance/audit-trails/batches/audit-logs-archive.batch.backend.service.js.map +1 -1
- package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.d.ts +225 -13
- package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.js +340 -62
- package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.js.map +1 -1
- package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts +244 -7
- package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js +386 -5
- package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js.map +1 -1
- package/dist/esm/compliance/audit-trails/services/composite-audit-log-sink.backend.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/composite-audit-log-sink.backend.js +7 -1
- package/dist/esm/compliance/audit-trails/services/composite-audit-log-sink.backend.js.map +1 -1
- package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.d.ts +6 -2
- package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.js +31 -9
- package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.d.ts +42 -0
- package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.js +57 -1
- package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.js.map +1 -1
- package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.d.ts +110 -0
- package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.d.ts.map +1 -0
- package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.js +192 -0
- package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.js.map +1 -0
- package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.js +31 -0
- package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.js.map +1 -1
- package/dist/esm/config/bootstrap/application-runtime-profile.backend.d.ts +5 -0
- package/dist/esm/config/bootstrap/application-runtime-profile.backend.d.ts.map +1 -1
- package/dist/esm/config/bootstrap/application-runtime-profile.backend.js +6 -0
- package/dist/esm/config/bootstrap/application-runtime-profile.backend.js.map +1 -1
- package/dist/esm/config/models/app-config.backend.schemas.d.ts +142 -46
- package/dist/esm/config/models/app-config.backend.schemas.d.ts.map +1 -1
- package/dist/esm/config/models/app-config.backend.schemas.js +121 -12
- package/dist/esm/config/models/app-config.backend.schemas.js.map +1 -1
- package/dist/esm/config/models/provider-runtime-artifact.backend.schemas.d.ts +38 -15
- package/dist/esm/config/models/provider-runtime-artifact.backend.schemas.d.ts.map +1 -1
- package/dist/esm/config/models/provider-runtime-artifact.backend.schemas.js +17 -2
- package/dist/esm/config/models/provider-runtime-artifact.backend.schemas.js.map +1 -1
- package/dist/esm/config/services/app-configuration-loader.backend.service.d.ts +0 -1
- package/dist/esm/config/services/app-configuration-loader.backend.service.d.ts.map +1 -1
- package/dist/esm/config/services/app-configuration-loader.backend.service.js +68 -76
- package/dist/esm/config/services/app-configuration-loader.backend.service.js.map +1 -1
- package/dist/esm/config/services/app-configuration.backend.service.d.ts.map +1 -1
- package/dist/esm/config/services/app-configuration.backend.service.js +23 -1
- package/dist/esm/config/services/app-configuration.backend.service.js.map +1 -1
- package/dist/esm/config/services/app-configuration.backend.utils.d.ts +33 -0
- package/dist/esm/config/services/app-configuration.backend.utils.d.ts.map +1 -1
- package/dist/esm/config/services/app-configuration.backend.utils.js +39 -1
- package/dist/esm/config/services/app-configuration.backend.utils.js.map +1 -1
- package/dist/esm/config/services/application-startup-config-validator.backend.service.d.ts +25 -0
- package/dist/esm/config/services/application-startup-config-validator.backend.service.d.ts.map +1 -1
- package/dist/esm/config/services/application-startup-config-validator.backend.service.js +41 -1
- package/dist/esm/config/services/application-startup-config-validator.backend.service.js.map +1 -1
- package/dist/esm/databases/services/postgresql-schema-plan-diff.backend.d.ts.map +1 -1
- package/dist/esm/databases/services/postgresql-schema-plan-diff.backend.js +48 -0
- package/dist/esm/databases/services/postgresql-schema-plan-diff.backend.js.map +1 -1
- package/dist/esm/errors/services/error-builder.backend.service.d.ts +13 -1
- package/dist/esm/errors/services/error-builder.backend.service.d.ts.map +1 -1
- package/dist/esm/errors/services/error-builder.backend.service.js +13 -1
- package/dist/esm/errors/services/error-builder.backend.service.js.map +1 -1
- package/dist/esm/errors/services/error-handler.backend.service.d.ts +70 -7
- package/dist/esm/errors/services/error-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/errors/services/error-handler.backend.service.js +129 -8
- package/dist/esm/errors/services/error-handler.backend.service.js.map +1 -1
- package/dist/esm/errors/services/rate-limit.backend.service.d.ts +66 -0
- package/dist/esm/errors/services/rate-limit.backend.service.d.ts.map +1 -1
- package/dist/esm/errors/services/rate-limit.backend.service.js +102 -25
- package/dist/esm/errors/services/rate-limit.backend.service.js.map +1 -1
- package/dist/esm/errors/utils/error-log-level-classification.backend.utils.d.ts +5 -0
- package/dist/esm/errors/utils/error-log-level-classification.backend.utils.d.ts.map +1 -1
- package/dist/esm/errors/utils/error-log-level-classification.backend.utils.js +25 -0
- package/dist/esm/errors/utils/error-log-level-classification.backend.utils.js.map +1 -1
- package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.d.ts +33 -0
- package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.d.ts.map +1 -1
- package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.js +40 -0
- package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.js.map +1 -1
- package/dist/esm/external-data/external-data-pipeline-run.backend.service.d.ts +59 -2
- package/dist/esm/external-data/external-data-pipeline-run.backend.service.d.ts.map +1 -1
- package/dist/esm/external-data/external-data-pipeline-run.backend.service.js +52 -17
- package/dist/esm/external-data/external-data-pipeline-run.backend.service.js.map +1 -1
- package/dist/esm/external-providers/models/provider-selection-resolution-evidence.backend.definitions.d.ts +4 -2
- package/dist/esm/external-providers/models/provider-selection-resolution-evidence.backend.definitions.d.ts.map +1 -1
- package/dist/esm/external-providers/models/provider-selection-resolution-evidence.backend.definitions.js.map +1 -1
- package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.d.ts +256 -0
- package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.d.ts.map +1 -0
- package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.js +333 -0
- package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.js.map +1 -0
- package/dist/esm/external-providers/operations/provider-operation-request.backend.d.ts +56 -0
- package/dist/esm/external-providers/operations/provider-operation-request.backend.d.ts.map +1 -0
- package/dist/esm/external-providers/operations/provider-operation-request.backend.js +211 -0
- package/dist/esm/external-providers/operations/provider-operation-request.backend.js.map +1 -0
- package/dist/esm/external-providers/operations/provider-request-signing.backend.d.ts +45 -0
- package/dist/esm/external-providers/operations/provider-request-signing.backend.d.ts.map +1 -0
- package/dist/esm/external-providers/operations/provider-request-signing.backend.js +216 -0
- package/dist/esm/external-providers/operations/provider-request-signing.backend.js.map +1 -0
- package/dist/esm/external-providers/operations/provider-rest-call-client.backend.d.ts +56 -0
- package/dist/esm/external-providers/operations/provider-rest-call-client.backend.d.ts.map +1 -0
- package/dist/esm/external-providers/operations/provider-rest-call-client.backend.js +78 -0
- package/dist/esm/external-providers/operations/provider-rest-call-client.backend.js.map +1 -0
- package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.d.ts +1 -1
- package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.d.ts.map +1 -1
- package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.js +2 -2
- package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.js.map +1 -1
- package/dist/esm/external-providers/services/backend-provider-loader.backend.service.d.ts +89 -0
- package/dist/esm/external-providers/services/backend-provider-loader.backend.service.d.ts.map +1 -0
- package/dist/esm/external-providers/services/backend-provider-loader.backend.service.js +164 -0
- package/dist/esm/external-providers/services/backend-provider-loader.backend.service.js.map +1 -0
- package/dist/esm/external-providers/services/backend-provider-registry.backend.service.d.ts +26 -27
- package/dist/esm/external-providers/services/backend-provider-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/external-providers/services/backend-provider-registry.backend.service.js +50 -64
- package/dist/esm/external-providers/services/backend-provider-registry.backend.service.js.map +1 -1
- package/dist/esm/external-providers/services/document-extraction.backend.service.d.ts.map +1 -1
- package/dist/esm/external-providers/services/document-extraction.backend.service.js +3 -3
- package/dist/esm/external-providers/services/document-extraction.backend.service.js.map +1 -1
- package/dist/esm/external-providers/services/embeddings.backend.service.d.ts.map +1 -1
- package/dist/esm/external-providers/services/embeddings.backend.service.js +4 -4
- package/dist/esm/external-providers/services/embeddings.backend.service.js.map +1 -1
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts +292 -7
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.js +533 -45
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.js.map +1 -1
- package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.d.ts.map +1 -1
- package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.js +25 -2
- package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.js.map +1 -1
- package/dist/esm/files/controllers/file.controller.d.ts.map +1 -1
- package/dist/esm/files/controllers/file.controller.js +21 -13
- package/dist/esm/files/controllers/file.controller.js.map +1 -1
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js +39 -15
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js.map +1 -1
- package/dist/esm/files/services/file-scanning.backend.service.d.ts +94 -9
- package/dist/esm/files/services/file-scanning.backend.service.d.ts.map +1 -1
- package/dist/esm/files/services/file-scanning.backend.service.js +197 -17
- package/dist/esm/files/services/file-scanning.backend.service.js.map +1 -1
- package/dist/esm/files/services/file-text-extraction.backend.service.d.ts +60 -1
- package/dist/esm/files/services/file-text-extraction.backend.service.d.ts.map +1 -1
- package/dist/esm/files/services/file-text-extraction.backend.service.js +167 -8
- package/dist/esm/files/services/file-text-extraction.backend.service.js.map +1 -1
- package/dist/esm/files/services/file-upload-grant.backend.service.d.ts +53 -2
- package/dist/esm/files/services/file-upload-grant.backend.service.d.ts.map +1 -1
- package/dist/esm/files/services/file-upload-grant.backend.service.js +127 -3
- package/dist/esm/files/services/file-upload-grant.backend.service.js.map +1 -1
- package/dist/esm/files/services/files.backend.service.d.ts +68 -0
- package/dist/esm/files/services/files.backend.service.d.ts.map +1 -1
- package/dist/esm/files/services/files.backend.service.js +175 -5
- package/dist/esm/files/services/files.backend.service.js.map +1 -1
- package/dist/esm/files/storage/application-storage-key.backend.utils.d.ts +109 -0
- package/dist/esm/files/storage/application-storage-key.backend.utils.d.ts.map +1 -0
- package/dist/esm/files/storage/application-storage-key.backend.utils.js +123 -0
- package/dist/esm/files/storage/application-storage-key.backend.utils.js.map +1 -0
- package/dist/esm/files/storage/file-storage-provider.types.d.ts +16 -10
- package/dist/esm/files/storage/file-storage-provider.types.d.ts.map +1 -1
- package/dist/esm/files/storage/file-storage-provider.types.js.map +1 -1
- package/dist/esm/files/storage/local-directory-storage-provider.backend.service.d.ts +67 -8
- package/dist/esm/files/storage/local-directory-storage-provider.backend.service.d.ts.map +1 -1
- package/dist/esm/files/storage/local-directory-storage-provider.backend.service.js +101 -28
- package/dist/esm/files/storage/local-directory-storage-provider.backend.service.js.map +1 -1
- package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.d.ts.map +1 -1
- package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.js +8 -55
- package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.js.map +1 -1
- package/dist/esm/files/utils/file-field-schema-path.backend.utils.d.ts.map +1 -1
- package/dist/esm/files/utils/file-field-schema-path.backend.utils.js +20 -0
- package/dist/esm/files/utils/file-field-schema-path.backend.utils.js.map +1 -1
- package/dist/esm/files/utils/office-document-text-extraction.backend.utils.d.ts +86 -0
- package/dist/esm/files/utils/office-document-text-extraction.backend.utils.d.ts.map +1 -0
- package/dist/esm/files/utils/office-document-text-extraction.backend.utils.js +288 -0
- package/dist/esm/files/utils/office-document-text-extraction.backend.utils.js.map +1 -0
- package/dist/esm/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service.d.ts +15 -0
- package/dist/esm/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service.js +76 -5
- package/dist/esm/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/a2a/controllers/a2a.controller.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/controllers/a2a.controller.js +6 -1
- package/dist/esm/flows-actors/a2a/controllers/a2a.controller.js.map +1 -1
- package/dist/esm/flows-actors/a2a/models/a2a.backend.schemas.d.ts +60 -0
- package/dist/esm/flows-actors/a2a/models/a2a.backend.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/models/a2a.backend.schemas.js +63 -0
- package/dist/esm/flows-actors/a2a/models/a2a.backend.schemas.js.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.d.ts +74 -0
- package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.js +196 -40
- package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a-task.backend.service.d.ts +7 -1
- package/dist/esm/flows-actors/a2a/services/a2a-task.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a-task.backend.service.js +53 -1
- package/dist/esm/flows-actors/a2a/services/a2a-task.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a-token-budget.backend.service.d.ts +18 -0
- package/dist/esm/flows-actors/a2a/services/a2a-token-budget.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a-token-budget.backend.service.js +18 -0
- package/dist/esm/flows-actors/a2a/services/a2a-token-budget.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a.backend.service.d.ts +12 -7
- package/dist/esm/flows-actors/a2a/services/a2a.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.d.ts +0 -13
- package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.d.ts.map +1 -1
- package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.js +14 -22
- package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.js.map +1 -1
- package/dist/esm/flows-actors/models/core-facets.backend.definitions.d.ts +8 -3
- package/dist/esm/flows-actors/models/core-facets.backend.definitions.d.ts.map +1 -1
- package/dist/esm/flows-actors/models/core-facets.backend.definitions.js +25 -15
- package/dist/esm/flows-actors/models/core-facets.backend.definitions.js.map +1 -1
- package/dist/esm/flows-actors/models/flows-actors.backend.schemas.d.ts +13 -1
- package/dist/esm/flows-actors/models/flows-actors.backend.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/models/flows-actors.backend.schemas.js.map +1 -1
- package/dist/esm/flows-actors/models/function-tools.backend.definitions.d.ts +88 -8
- package/dist/esm/flows-actors/models/function-tools.backend.definitions.d.ts.map +1 -1
- package/dist/esm/flows-actors/models/function-tools.backend.definitions.js +333 -31
- package/dist/esm/flows-actors/models/function-tools.backend.definitions.js.map +1 -1
- package/dist/esm/flows-actors/models/market-generation.actors-system.backend.definitions.d.ts.map +1 -1
- package/dist/esm/flows-actors/models/market-generation.actors-system.backend.definitions.js +4 -2
- package/dist/esm/flows-actors/models/market-generation.actors-system.backend.definitions.js.map +1 -1
- package/dist/esm/flows-actors/models/mcp-client.backend.definitions.d.ts +113 -0
- package/dist/esm/flows-actors/models/mcp-client.backend.definitions.d.ts.map +1 -0
- package/dist/esm/flows-actors/models/mcp-client.backend.definitions.js +62 -0
- package/dist/esm/flows-actors/models/mcp-client.backend.definitions.js.map +1 -0
- package/dist/esm/flows-actors/services/actors-system.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/actors-system.backend.service.js +0 -2
- package/dist/esm/flows-actors/services/actors-system.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/services/agents.backend.service.d.ts +28 -1
- package/dist/esm/flows-actors/services/agents.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/agents.backend.service.js +204 -18
- package/dist/esm/flows-actors/services/agents.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/services/conversational-execution.backend.service.d.ts +5 -1
- package/dist/esm/flows-actors/services/conversational-execution.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/conversational-execution.backend.service.js +79 -16
- package/dist/esm/flows-actors/services/conversational-execution.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/services/flows-actors-registry.service.d.ts +34 -5
- package/dist/esm/flows-actors/services/flows-actors-registry.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/flows-actors-registry.service.js +154 -20
- package/dist/esm/flows-actors/services/flows-actors-registry.service.js.map +1 -1
- package/dist/esm/flows-actors/services/flows.backend.services.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/flows.backend.services.js +27 -23
- package/dist/esm/flows-actors/services/flows.backend.services.js.map +1 -1
- package/dist/esm/flows-actors/services/llm-observability-agent-call-trace-sink.backend.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/llm-observability-agent-call-trace-sink.backend.js +7 -1
- package/dist/esm/flows-actors/services/llm-observability-agent-call-trace-sink.backend.js.map +1 -1
- package/dist/esm/flows-actors/services/mcp-client.backend.service.d.ts +90 -0
- package/dist/esm/flows-actors/services/mcp-client.backend.service.d.ts.map +1 -0
- package/dist/esm/flows-actors/services/mcp-client.backend.service.js +368 -0
- package/dist/esm/flows-actors/services/mcp-client.backend.service.js.map +1 -0
- package/dist/esm/flows-actors/services/prompt-compiler.backend.service.d.ts +9 -5
- package/dist/esm/flows-actors/services/prompt-compiler.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/prompt-compiler.backend.service.js +12 -17
- package/dist/esm/flows-actors/services/prompt-compiler.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.d.ts.map +1 -1
- package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js +8 -4
- package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js.map +1 -1
- package/dist/esm/flows-actors/utils/meta-workflow-canonical-json.backend.utils.d.ts +0 -207
- package/dist/esm/flows-actors/utils/meta-workflow-canonical-json.backend.utils.d.ts.map +1 -1
- package/dist/esm/flows-actors/utils/meta-workflow-canonical-json.backend.utils.js +8 -243
- package/dist/esm/flows-actors/utils/meta-workflow-canonical-json.backend.utils.js.map +1 -1
- package/dist/esm/flows-actors/utils/meta-workflow-structured-generation-plan.backend.utils.d.ts.map +1 -1
- package/dist/esm/flows-actors/utils/meta-workflow-structured-generation-plan.backend.utils.js.map +1 -1
- package/dist/esm/guidance/services/milestone-evaluator.backend.service.d.ts +9 -14
- package/dist/esm/guidance/services/milestone-evaluator.backend.service.d.ts.map +1 -1
- package/dist/esm/guidance/services/milestone-evaluator.backend.service.js +18 -89
- package/dist/esm/guidance/services/milestone-evaluator.backend.service.js.map +1 -1
- package/dist/esm/guidance/services/progression-state-store.backend.service.d.ts +86 -0
- package/dist/esm/guidance/services/progression-state-store.backend.service.d.ts.map +1 -0
- package/dist/esm/guidance/services/progression-state-store.backend.service.js +155 -0
- package/dist/esm/guidance/services/progression-state-store.backend.service.js.map +1 -0
- package/dist/esm/i18n/controllers/i18n-controller.backend.service.d.ts +10 -0
- package/dist/esm/i18n/controllers/i18n-controller.backend.service.d.ts.map +1 -1
- package/dist/esm/i18n/controllers/i18n-controller.backend.service.js +55 -5
- package/dist/esm/i18n/controllers/i18n-controller.backend.service.js.map +1 -1
- package/dist/esm/index.d.ts +11 -4
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +31 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/inject/models/container.d.ts.map +1 -1
- package/dist/esm/inject/models/container.js +78 -10
- package/dist/esm/inject/models/container.js.map +1 -1
- package/dist/esm/inject/models/service-types.d.ts +17 -3
- package/dist/esm/inject/models/service-types.d.ts.map +1 -1
- package/dist/esm/inject/models/service-types.js +19 -3
- package/dist/esm/inject/models/service-types.js.map +1 -1
- package/dist/esm/mcp/controllers/mcp.controller.d.ts.map +1 -1
- package/dist/esm/mcp/controllers/mcp.controller.js +20 -0
- package/dist/esm/mcp/controllers/mcp.controller.js.map +1 -1
- package/dist/esm/mcp/services/mcp-server.backend.service.d.ts +56 -1
- package/dist/esm/mcp/services/mcp-server.backend.service.d.ts.map +1 -1
- package/dist/esm/mcp/services/mcp-server.backend.service.js +107 -11
- package/dist/esm/mcp/services/mcp-server.backend.service.js.map +1 -1
- package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.d.ts.map +1 -1
- package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.js +22 -0
- package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.js.map +1 -1
- package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.d.ts.map +1 -1
- package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.js +49 -4
- package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.js.map +1 -1
- package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.d.ts +66 -0
- package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.js +199 -0
- package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.js.map +1 -0
- package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.d.ts +149 -13
- package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.d.ts.map +1 -1
- package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.js +411 -19
- package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.js.map +1 -1
- package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.d.ts +11 -2
- package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.js.map +1 -1
- package/dist/esm/monitoring/logger/models/logger.backend.schemas.d.ts +28 -9
- package/dist/esm/monitoring/logger/models/logger.backend.schemas.d.ts.map +1 -1
- package/dist/esm/monitoring/logger/models/logger.backend.schemas.js +30 -10
- package/dist/esm/monitoring/logger/models/logger.backend.schemas.js.map +1 -1
- package/dist/esm/monitoring/logger/services/logger.service.d.ts +12 -0
- package/dist/esm/monitoring/logger/services/logger.service.d.ts.map +1 -1
- package/dist/esm/monitoring/logger/services/logger.service.js +52 -11
- package/dist/esm/monitoring/logger/services/logger.service.js.map +1 -1
- package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.d.ts +62 -0
- package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.d.ts.map +1 -0
- package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.js +78 -0
- package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.js.map +1 -0
- package/dist/esm/monitoring/observability/audit-observation-emission.backend.d.ts +309 -0
- package/dist/esm/monitoring/observability/audit-observation-emission.backend.d.ts.map +1 -0
- package/dist/esm/monitoring/observability/audit-observation-emission.backend.js +385 -0
- package/dist/esm/monitoring/observability/audit-observation-emission.backend.js.map +1 -0
- package/dist/esm/monitoring/observability/models/observability.backend.schemas.d.ts +1 -0
- package/dist/esm/monitoring/observability/models/observability.backend.schemas.d.ts.map +1 -1
- package/dist/esm/monitoring/observability/models/observability.backend.schemas.js.map +1 -1
- package/dist/esm/monitoring/observability/services/metrics.service.d.ts +21 -0
- package/dist/esm/monitoring/observability/services/metrics.service.d.ts.map +1 -1
- package/dist/esm/monitoring/observability/services/metrics.service.js +38 -0
- package/dist/esm/monitoring/observability/services/metrics.service.js.map +1 -1
- package/dist/esm/notifications/email/models/email-context-provider.interface.d.ts +0 -80
- package/dist/esm/notifications/email/models/email-context-provider.interface.d.ts.map +0 -1
- package/dist/esm/notifications/email/models/email-context-provider.interface.js +0 -25
- package/dist/esm/notifications/email/models/email-context-provider.interface.js.map +0 -1
- package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.d.ts +0 -49
- package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.d.ts.map +0 -1
- package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.js +0 -141
- package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.js.map +0 -1
- package/dist/esm/notifications/email/services/email-template-compiler.backend.service.d.ts +0 -37
- package/dist/esm/notifications/email/services/email-template-compiler.backend.service.d.ts.map +0 -1
- package/dist/esm/notifications/email/services/email-template-compiler.backend.service.js +0 -121
- package/dist/esm/notifications/email/services/email-template-compiler.backend.service.js.map +0 -1
- package/dist/esm/notifications/email/services/email-template-registry.backend.service.d.ts +66 -1
- package/dist/esm/notifications/email/services/email-template-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/email/services/email-template-registry.backend.service.js +105 -10
- package/dist/esm/notifications/email/services/email-template-registry.backend.service.js.map +1 -1
- package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.d.ts +0 -58
- package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.d.ts.map +0 -1
- package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.js +0 -223
- package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.js.map +0 -1
- package/dist/esm/notifications/email/services/email-template-validator.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/email/services/email-template-validator.backend.service.js +10 -1
- package/dist/esm/notifications/email/services/email-template-validator.backend.service.js.map +1 -1
- package/dist/esm/notifications/email/services/email.backend.service.d.ts +60 -4
- package/dist/esm/notifications/email/services/email.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/email/services/email.backend.service.js +145 -43
- package/dist/esm/notifications/email/services/email.backend.service.js.map +1 -1
- package/dist/esm/notifications/email/utils/color-conversion.utils.d.ts +0 -1
- package/dist/esm/notifications/email/utils/color-conversion.utils.d.ts.map +1 -1
- package/dist/esm/notifications/email/utils/color-conversion.utils.js.map +1 -1
- package/dist/esm/notifications/services/notification-badge.backend.service.d.ts +142 -21
- package/dist/esm/notifications/services/notification-badge.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/services/notification-badge.backend.service.js +283 -58
- package/dist/esm/notifications/services/notification-badge.backend.service.js.map +1 -1
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.d.ts +99 -13
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.js +422 -66
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.js.map +1 -1
- package/dist/esm/notifications/sms/services/sms.backend.service.d.ts +2 -2
- package/dist/esm/notifications/sms/services/sms.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/sms/services/sms.backend.service.js +5 -5
- package/dist/esm/notifications/sms/services/sms.backend.service.js.map +1 -1
- package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.d.ts +117 -5
- package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.js +164 -6
- package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.js.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.d.ts +0 -6
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.js +46 -1
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.js.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.js +16 -6
- package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.js.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.js +12 -12
- package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.d.ts +16 -0
- package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.js +18 -0
- package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.js.map +1 -1
- package/dist/esm/organizations/batches/organization-purge.batch.backend.service.d.ts +2 -2
- package/dist/esm/organizations/batches/organization-purge.batch.backend.service.js +2 -2
- package/dist/esm/organizations/batches/organization-purge.batch.backend.service.js.map +1 -1
- package/dist/esm/organizations/services/organization-custom-implementation.backend.service.d.ts.map +1 -1
- package/dist/esm/organizations/services/organization-custom-implementation.backend.service.js +63 -2
- package/dist/esm/organizations/services/organization-custom-implementation.backend.service.js.map +1 -1
- package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.d.ts +66 -0
- package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.js +257 -0
- package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.js.map +1 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.binding.d.ts +12 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.binding.d.ts.map +1 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.binding.js +47 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.binding.js.map +1 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.interface.d.ts +87 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.interface.d.ts.map +1 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.interface.js +1 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.interface.js.map +1 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.options.d.ts +31 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.options.d.ts.map +1 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.options.js +13 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.options.js.map +1 -0
- package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.d.ts +19 -25
- package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.js +33 -0
- package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.js.map +1 -1
- package/dist/esm/queue/domain-queue-consumer.backend.service.d.ts +2 -2
- package/dist/esm/queue/domain-queue-consumer.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/domain-queue-consumer.backend.service.js +1 -4
- package/dist/esm/queue/domain-queue-consumer.backend.service.js.map +1 -1
- package/dist/esm/queue/job-consumer.backend.service.d.ts +2 -2
- package/dist/esm/queue/job-consumer.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/job-consumer.backend.service.js +1 -4
- package/dist/esm/queue/job-consumer.backend.service.js.map +1 -1
- package/dist/esm/queue/job-executor.backend.service.d.ts +2 -2
- package/dist/esm/queue/job-executor.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/job-executor.backend.service.js +1 -4
- package/dist/esm/queue/job-executor.backend.service.js.map +1 -1
- package/dist/esm/queue/queue-monitoring.backend.service.d.ts +8 -4
- package/dist/esm/queue/queue-monitoring.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/queue-monitoring.backend.service.js +25 -17
- package/dist/esm/queue/queue-monitoring.backend.service.js.map +1 -1
- package/dist/esm/queue/queue-worker-initializer.backend.service.d.ts +16 -1
- package/dist/esm/queue/queue-worker-initializer.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/queue-worker-initializer.backend.service.js +16 -1
- package/dist/esm/queue/queue-worker-initializer.backend.service.js.map +1 -1
- package/dist/esm/queue/queue.backend.service.d.ts +3 -3
- package/dist/esm/queue/queue.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/queue.backend.service.js +26 -4
- package/dist/esm/queue/queue.backend.service.js.map +1 -1
- package/dist/esm/queue/worker-shutdown-manager.backend.service.d.ts +2 -2
- package/dist/esm/queue/worker-shutdown-manager.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/worker-shutdown-manager.backend.service.js +18 -3
- package/dist/esm/queue/worker-shutdown-manager.backend.service.js.map +1 -1
- package/dist/esm/rag/utils/rag-chunking.backend.utils.d.ts +50 -25
- package/dist/esm/rag/utils/rag-chunking.backend.utils.d.ts.map +1 -1
- package/dist/esm/rag/utils/rag-chunking.backend.utils.js +147 -39
- package/dist/esm/rag/utils/rag-chunking.backend.utils.js.map +1 -1
- package/dist/esm/rag/utils/rag-context-assembly.backend.utils.d.ts +12 -3
- package/dist/esm/rag/utils/rag-context-assembly.backend.utils.d.ts.map +1 -1
- package/dist/esm/rag/utils/rag-context-assembly.backend.utils.js +12 -3
- package/dist/esm/rag/utils/rag-context-assembly.backend.utils.js.map +1 -1
- package/dist/esm/requests/service/websocket.service.d.ts +9 -0
- package/dist/esm/requests/service/websocket.service.d.ts.map +1 -1
- package/dist/esm/requests/service/websocket.service.js +32 -8
- package/dist/esm/requests/service/websocket.service.js.map +1 -1
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.d.ts.map +1 -1
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.js +14 -2
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.js.map +1 -1
- package/dist/esm/resources/models/resources-operations.backend.definitions.d.ts.map +1 -1
- package/dist/esm/resources/models/resources-operations.backend.definitions.js +2 -0
- package/dist/esm/resources/models/resources-operations.backend.definitions.js.map +1 -1
- package/dist/esm/resources/models/resources-relationships.backend.definitions.d.ts.map +1 -1
- package/dist/esm/resources/models/resources-relationships.backend.definitions.js +14 -0
- package/dist/esm/resources/models/resources-relationships.backend.definitions.js.map +1 -1
- package/dist/esm/resources/models/resources-types.backend.schemas.d.ts +2 -1
- package/dist/esm/resources/models/resources-types.backend.schemas.d.ts.map +1 -1
- package/dist/esm/resources/models/resources-types.backend.schemas.js +8 -0
- package/dist/esm/resources/models/resources-types.backend.schemas.js.map +1 -1
- package/dist/esm/resources/services/resources-registry.backend.service.d.ts +60 -5
- package/dist/esm/resources/services/resources-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/resources/services/resources-registry.backend.service.js +90 -6
- package/dist/esm/resources/services/resources-registry.backend.service.js.map +1 -1
- package/dist/esm/runtime/controllers/health-controller.backend.service.d.ts +36 -3
- package/dist/esm/runtime/controllers/health-controller.backend.service.d.ts.map +1 -1
- package/dist/esm/runtime/controllers/health-controller.backend.service.js +32 -10
- package/dist/esm/runtime/controllers/health-controller.backend.service.js.map +1 -1
- package/dist/esm/runtime/domain-module.backend.definitions.d.ts +24 -0
- package/dist/esm/runtime/domain-module.backend.definitions.d.ts.map +1 -1
- package/dist/esm/runtime/domain-module.backend.definitions.js +24 -0
- package/dist/esm/runtime/domain-module.backend.definitions.js.map +1 -1
- package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.d.ts +51 -0
- package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.d.ts.map +1 -1
- package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.js.map +1 -1
- package/dist/esm/runtime/services/http-server.backend.service.d.ts +26 -0
- package/dist/esm/runtime/services/http-server.backend.service.d.ts.map +1 -1
- package/dist/esm/runtime/services/http-server.backend.service.js +181 -1
- package/dist/esm/runtime/services/http-server.backend.service.js.map +1 -1
- package/dist/esm/runtime/services/start-application.backend.service.d.ts +19 -1
- package/dist/esm/runtime/services/start-application.backend.service.d.ts.map +1 -1
- package/dist/esm/runtime/services/start-application.backend.service.js +261 -77
- package/dist/esm/runtime/services/start-application.backend.service.js.map +1 -1
- package/dist/esm/security/api-keys/api-keys.custom-impl.backend.service.d.ts +15 -0
- package/dist/esm/security/api-keys/api-keys.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/security/api-keys/api-keys.custom-impl.backend.service.js +28 -0
- package/dist/esm/security/api-keys/api-keys.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.d.ts +5 -1
- package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.js +24 -4
- package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.js +29 -4
- package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.d.ts +114 -0
- package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.js +354 -3
- package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/models/cimd.backend.schemas.d.ts +1 -0
- package/dist/esm/security/authentications/models/cimd.backend.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/models/cimd.backend.schemas.js +22 -0
- package/dist/esm/security/authentications/models/cimd.backend.schemas.js.map +1 -1
- package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.d.ts +15 -0
- package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.js.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.d.ts +0 -2
- package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.js +23 -14
- package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.js.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.d.ts +0 -1
- package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.js +15 -12
- package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.d.ts +113 -3
- package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.js +207 -30
- package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.d.ts +95 -2
- package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.js +153 -9
- package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/anonymous-session.backend.service.d.ts +190 -0
- package/dist/esm/security/authentications/services/anonymous-session.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/anonymous-session.backend.service.js +377 -53
- package/dist/esm/security/authentications/services/anonymous-session.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.js +68 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.d.ts +41 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.js +202 -23
- package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.js +42 -1
- package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.js +34 -4
- package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.d.ts +29 -5
- package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.js +77 -5
- package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.d.ts +17 -1
- package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.js +49 -17
- package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.d.ts +43 -1
- package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.js +277 -97
- package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/cimd-client-metadata.backend.service.d.ts +28 -5
- package/dist/esm/security/authentications/services/cimd-client-metadata.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/cimd-client-metadata.backend.service.js +72 -12
- package/dist/esm/security/authentications/services/cimd-client-metadata.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.js +3 -0
- package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.js.map +1 -1
- package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.d.ts +28 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.js +283 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.d.ts +4 -3
- package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.js +4 -3
- package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.d.ts +35 -0
- package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.js +111 -21
- package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.d.ts +14 -1
- package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.js +49 -8
- package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/utils/auth-policy-resolution.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/utils/auth-policy-resolution.backend.utils.js +4 -0
- package/dist/esm/security/authentications/services/utils/auth-policy-resolution.backend.utils.js.map +1 -1
- package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.js +6 -0
- package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/utils/external-turn-rate-limit.backend.utils.d.ts +37 -1
- package/dist/esm/security/authentications/services/utils/external-turn-rate-limit.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/utils/external-turn-rate-limit.backend.utils.js +51 -0
- package/dist/esm/security/authentications/services/utils/external-turn-rate-limit.backend.utils.js.map +1 -1
- package/dist/esm/security/authentications/utils/enterprise-sso-enforcement.backend.utils.d.ts +41 -0
- package/dist/esm/security/authentications/utils/enterprise-sso-enforcement.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/utils/enterprise-sso-enforcement.backend.utils.js +45 -0
- package/dist/esm/security/authentications/utils/enterprise-sso-enforcement.backend.utils.js.map +1 -1
- package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.d.ts +116 -0
- package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.d.ts.map +1 -0
- package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.js +162 -0
- package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.js.map +1 -0
- package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.d.ts +20 -20
- package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.js +27 -28
- package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.js.map +1 -1
- package/dist/esm/security/authorizations/platform-access-grant-custom-implementation.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authorizations/platform-access-grant-custom-implementation.backend.service.js +77 -3
- package/dist/esm/security/authorizations/platform-access-grant-custom-implementation.backend.service.js.map +1 -1
- package/dist/esm/security/authorizations/role-ceiling.backend.utils.d.ts +4 -0
- package/dist/esm/security/authorizations/role-ceiling.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authorizations/role-ceiling.backend.utils.js +4 -0
- package/dist/esm/security/authorizations/role-ceiling.backend.utils.js.map +1 -1
- package/dist/esm/security/authorizations/role-conferral.backend.utils.d.ts +93 -0
- package/dist/esm/security/authorizations/role-conferral.backend.utils.d.ts.map +1 -0
- package/dist/esm/security/authorizations/role-conferral.backend.utils.js +95 -0
- package/dist/esm/security/authorizations/role-conferral.backend.utils.js.map +1 -0
- package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.d.ts +124 -1
- package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.d.ts.map +1 -1
- package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.js +142 -5
- package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.js.map +1 -1
- package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts +74 -8
- package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authorizations/services/authorizations.backend.service.js +175 -19
- package/dist/esm/security/authorizations/services/authorizations.backend.service.js.map +1 -1
- package/dist/esm/security/authorizations/super-admin-floor.backend.utils.d.ts +6 -14
- package/dist/esm/security/authorizations/super-admin-floor.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authorizations/super-admin-floor.backend.utils.js +13 -22
- package/dist/esm/security/authorizations/super-admin-floor.backend.utils.js.map +1 -1
- package/dist/esm/security/connected-accounts/connection-target-authorization.backend.d.ts +60 -0
- package/dist/esm/security/connected-accounts/connection-target-authorization.backend.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/connection-target-authorization.backend.js +79 -0
- package/dist/esm/security/connected-accounts/connection-target-authorization.backend.js.map +1 -0
- package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.d.ts +161 -0
- package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.js +512 -0
- package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.js.map +1 -0
- package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.d.ts +59 -0
- package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.js +22 -0
- package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.js.map +1 -0
- package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.d.ts +44 -0
- package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.js +20 -0
- package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.js.map +1 -0
- package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.d.ts +191 -0
- package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.js +385 -0
- package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.js.map +1 -0
- package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.d.ts +41 -0
- package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.js +358 -0
- package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.d.ts +160 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.js +266 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.js.map +1 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.d.ts +111 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.js +107 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.js.map +1 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.d.ts +54 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.js +153 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.js.map +1 -0
- package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.d.ts +195 -0
- package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.js +387 -0
- package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.js.map +1 -0
- package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.d.ts +45 -0
- package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.js +291 -0
- package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.d.ts +62 -0
- package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.js +29 -0
- package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.js.map +1 -0
- package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.d.ts +127 -0
- package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.js +277 -0
- package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.js.map +1 -0
- package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.d.ts +66 -0
- package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.js +75 -0
- package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.js.map +1 -0
- package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.d.ts +21 -3
- package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.d.ts.map +1 -1
- package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.js +26 -16
- package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.js.map +1 -1
- package/dist/esm/security/credential-rotation-grace.backend.utils.d.ts +9 -4
- package/dist/esm/security/credential-rotation-grace.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/credential-rotation-grace.backend.utils.js +9 -4
- package/dist/esm/security/credential-rotation-grace.backend.utils.js.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-client-generation.backend.utils.d.ts +26 -0
- package/dist/esm/security/oauth-clients/oauth-client-generation.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-client-generation.backend.utils.js +43 -0
- package/dist/esm/security/oauth-clients/oauth-client-generation.backend.utils.js.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.d.ts +8 -1
- package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.js +49 -0
- package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/security/scim/controllers/scim.backend.controller.d.ts.map +1 -1
- package/dist/esm/security/scim/controllers/scim.backend.controller.js +17 -5
- package/dist/esm/security/scim/controllers/scim.backend.controller.js.map +1 -1
- package/dist/esm/security/scim/models/scim-protocol.backend.schemas.d.ts +67 -29
- package/dist/esm/security/scim/models/scim-protocol.backend.schemas.d.ts.map +1 -1
- package/dist/esm/security/scim/models/scim-protocol.backend.schemas.js +47 -25
- package/dist/esm/security/scim/models/scim-protocol.backend.schemas.js.map +1 -1
- package/dist/esm/security/ssrf/outbound-target-guard.backend.utils.d.ts +10 -2
- package/dist/esm/security/ssrf/outbound-target-guard.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/ssrf/outbound-target-guard.backend.utils.js +10 -2
- package/dist/esm/security/ssrf/outbound-target-guard.backend.utils.js.map +1 -1
- package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.d.ts +143 -0
- package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.d.ts.map +1 -0
- package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.js +258 -0
- package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.js.map +1 -0
- package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.d.ts +39 -0
- package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.js +159 -0
- package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +11 -9
|
@@ -20,6 +20,7 @@ import { describeCaughtError, projectCaughtErrorLogFields } from '../../../error
|
|
|
20
20
|
import { MachineTokenIssuerBackendService } from '../../../security/authentications/services/machine-token-issuer.backend.service.js';
|
|
21
21
|
import { hashOAuthClientSecret } from '../../../security/oauth-clients/oauth-client-generation.backend.utils.js';
|
|
22
22
|
import { extractRefreshTokenReuseSignal } from '../../../security/authentications/services/auth-token-issuer.backend.service.js';
|
|
23
|
+
import { resolveActiveMemberOrgIds } from '../../../security/authentications/services/resolve-active-member-orgs.backend.utils.js';
|
|
23
24
|
import { ApiKeyScope, CoreResourceOperation, CoreResourceType, DELEGATED_TOKEN_RESOURCE_SERVERS, MACHINE_TOKEN_RESOURCE_SERVERS, ErrorCustomMessageReference, ErrorType, ExecutionContext_ExecutionType, MachineAuthMethod, OAuthClientStatus, OAuthGrantType, ResourcePrimaryScope, UserStatus, } from '@wildo-ai/saas-models';
|
|
24
25
|
import { JwtClaim_App_Auth_UserRequest_Schema } from '../../../security/authentications/models/authentications.backend.schemas.js';
|
|
25
26
|
import { isRotationGraceWindowOpen, isCredentialExpired } from '../../../security/credential-rotation-grace.backend.utils.js';
|
|
@@ -276,17 +277,35 @@ let OAuthProviderTokenBackendService = class OAuthProviderTokenBackendService {
|
|
|
276
277
|
// assurance-control: WILDO.IDENTITY.DELEGATED_AUTHORIZATION — issuing a delegated token grants a
|
|
277
278
|
// third-party client the ability to act AS the user (the most security-sensitive access grant the
|
|
278
279
|
// provider makes). Emit the audit/SIEM record (subject, client/azp, audience, granted scopes, TTL).
|
|
279
|
-
// Fire-and-forget: auditing must never block or fail token issuance.
|
|
280
|
-
//
|
|
281
|
-
// the
|
|
280
|
+
// Fire-and-forget: auditing must never block or fail token issuance.
|
|
281
|
+
//
|
|
282
|
+
// SIEM-3 (F4 tenant-segregation routing) — the routing org comes from the SUBJECT, not the request.
|
|
283
|
+
// There is genuinely no authenticated request EC at a token MINT (the client has just redeemed a
|
|
284
|
+
// code; the token it is being handed is not itself an authenticated request), so the 2nd arg stays
|
|
285
|
+
// `undefined` and, without the 3rd, this — the provider's most sensitive grant — reached the DB
|
|
286
|
+
// store and the app-level sinks but NEVER the customer's own security sink. `grant.userId` is
|
|
287
|
+
// resolved by `exchangeAuthorizationCode` off the STORED authorization code, so it is token-bound
|
|
288
|
+
// and can never be a caller-supplied value; that is exactly the provenance the magic-link and
|
|
289
|
+
// first-party-refresh paths already route on, and `_resolveSubjectRoutingOrgIds` turns it into
|
|
290
|
+
// VERIFIED ACTIVE memberships read as SYSTEM. A delegated grant therefore reaches precisely the
|
|
291
|
+
// tenants whose data the minted token can act on, which is the F4 question.
|
|
292
|
+
//
|
|
293
|
+
// D3/H-20: the DELEGATING CLIENT's own org is deliberately NOT a routing target. The token carries
|
|
294
|
+
// the USER's authority and the client is only `azp`, so a client registered in org A completing the
|
|
295
|
+
// flow for a user of org B must not thereby publish that user's grant into org A's SIEM feed.
|
|
282
296
|
const auditLogsForDelegated = this.container.get(SAAS_SERVICE_TYPES.AuditLogsService);
|
|
283
|
-
void
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
297
|
+
void (async () => {
|
|
298
|
+
// Resolved INSIDE the fire-and-forget block: a membership read must never add latency to the
|
|
299
|
+
// mint, and its failure mode (fail-closed to `[]`) must never reach the token response.
|
|
300
|
+
const delegatedRoutingOrgIds = await this._resolveSubjectRoutingOrgIds(grant.userId);
|
|
301
|
+
await auditLogsForDelegated.logOAuthDelegatedTokenIssued({
|
|
302
|
+
userId: grant.userId,
|
|
303
|
+
clientId: grant.clientId,
|
|
304
|
+
audience: requestedAudience,
|
|
305
|
+
scopes: grant.scope,
|
|
306
|
+
ttlSeconds: expiresIn,
|
|
307
|
+
}, undefined, delegatedRoutingOrgIds);
|
|
308
|
+
})().catch((auditError) => this.logger.warn('OAUTH_DELEGATED_TOKEN_ISSUED audit emit failed (non-fatal)', {
|
|
290
309
|
...projectCaughtErrorLogFields(auditError),
|
|
291
310
|
}));
|
|
292
311
|
this.logger.debug('Issued authorization_code (user-delegated) token', {
|
|
@@ -364,15 +383,23 @@ let OAuthProviderTokenBackendService = class OAuthProviderTokenBackendService {
|
|
|
364
383
|
// A routine expired/revoked/invalid refresh carries NO signal ⇒ no event (deliberate anti-flood: the
|
|
365
384
|
// security-relevant refresh failure is theft, not routine session expiry). Fire-and-forget.
|
|
366
385
|
// assurance-control: WILDO.IDENTITY.CREDENTIAL_LIFECYCLE — credential-theft detection + response.
|
|
386
|
+
// SIEM-3 (F4): routed to the VICTIM's verified member orgs, exactly as the first-party refresh
|
|
387
|
+
// endpoint already does (`authentication-controller.backend.service.ts` refreshToken). This is
|
|
388
|
+
// credential-THEFT detection — the single event a customer's SOC most needs in its own feed —
|
|
389
|
+
// and the two refresh surfaces share one issuer, so they must not disagree about who sees it.
|
|
390
|
+
// `reuseSignal.userId` is read off the STORED token family by the issuer, never off the request.
|
|
367
391
|
const reuseSignal = extractRefreshTokenReuseSignal(refreshError);
|
|
368
392
|
if (reuseSignal) {
|
|
369
393
|
const auditLogsForReuse = this.container.get(SAAS_SERVICE_TYPES.AuditLogsService);
|
|
370
|
-
void
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
394
|
+
void (async () => {
|
|
395
|
+
const reuseRoutingOrgIds = await this._resolveSubjectRoutingOrgIds(reuseSignal.userId);
|
|
396
|
+
await auditLogsForReuse.logUserRefreshTokenReuseDetected({
|
|
397
|
+
userId: reuseSignal.userId,
|
|
398
|
+
reusedJti: reuseSignal.reusedJti,
|
|
399
|
+
sessionId: reuseSignal.sessionId,
|
|
400
|
+
familyRevoked: reuseSignal.familyRevoked,
|
|
401
|
+
}, undefined, reuseRoutingOrgIds);
|
|
402
|
+
})().catch((auditError) => this.logger.warn('USER_REFRESH_TOKEN_REUSE_DETECTED audit emit failed (non-fatal)', {
|
|
376
403
|
...projectCaughtErrorLogFields(auditError),
|
|
377
404
|
}));
|
|
378
405
|
}
|
|
@@ -406,13 +433,30 @@ let OAuthProviderTokenBackendService = class OAuthProviderTokenBackendService {
|
|
|
406
433
|
// A-4: audit the SUCCESSFUL provider refresh grant. Low-detail INFO — the security-relevant refresh
|
|
407
434
|
// failure (theft/reuse) is audited via A-9 above; routine failures are intentionally not audited.
|
|
408
435
|
// assurance-control: WILDO.IDENTITY.CREDENTIAL_LIFECYCLE — token lifecycle (refresh). Fire-and-forget.
|
|
436
|
+
//
|
|
437
|
+
// SIEM-3 (F4): routed on `refreshedUserId`, which is read back from OUR OWN freshly-minted access
|
|
438
|
+
// token — server-minted, so token-bound rather than caller-claimed.
|
|
439
|
+
//
|
|
440
|
+
// NOT ROUTED on the FIRST-PARTY branch (no `clientId`+`clientSecret`), and that is a decision rather
|
|
441
|
+
// than an oversight. That branch deliberately performs no JWT verify (`AuthTokens` carries no
|
|
442
|
+
// subject, and the verify exists only to mint the OIDC §12.2 id_token), so the event has no subject
|
|
443
|
+
// at all — neither in `routingOrgIds` NOR in its own `userId` data field. Routing an org-anonymous
|
|
444
|
+
// "a token was refreshed" row into a tenant's SIEM would add noise carrying no attribution, so the
|
|
445
|
+
// honest ordering is: make the event ATTRIBUTABLE first (a verify inside this fire-and-forget block
|
|
446
|
+
// would do it, at the cost of retiring the "a first-party refresh performs no verify" pin), and
|
|
447
|
+
// route it in the same change. Until then the DB store + Layer-2 sinks remain its only record —
|
|
448
|
+
// and note the first-party refresh ENDPOINT (`/auth/refresh-token`) already audits with a subject
|
|
449
|
+
// and routes, so nothing is lost for the ordinary session-refresh journey.
|
|
409
450
|
const clientAuthenticated = Boolean(clientId && clientSecret);
|
|
410
451
|
const auditLogsForRefresh = this.container.get(SAAS_SERVICE_TYPES.AuditLogsService);
|
|
411
|
-
void
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
452
|
+
void (async () => {
|
|
453
|
+
const refreshRoutingOrgIds = await this._resolveSubjectRoutingOrgIds(refreshedUserId);
|
|
454
|
+
await auditLogsForRefresh.logOAuthTokenRefreshed({
|
|
455
|
+
userId: refreshedUserId,
|
|
456
|
+
clientId: clientAuthenticated ? clientId : undefined,
|
|
457
|
+
clientAuthenticated,
|
|
458
|
+
}, undefined, refreshRoutingOrgIds);
|
|
459
|
+
})().catch((auditError) => this.logger.warn('OAUTH_TOKEN_REFRESHED audit emit failed (non-fatal)', {
|
|
416
460
|
...projectCaughtErrorLogFields(auditError),
|
|
417
461
|
}));
|
|
418
462
|
return {
|
|
@@ -440,6 +484,52 @@ let OAuthProviderTokenBackendService = class OAuthProviderTokenBackendService {
|
|
|
440
484
|
this.logger.debug('Token revocation on a non-revocable token treated as success (RFC 7009)', { reason: describeCaughtError(error) });
|
|
441
485
|
}
|
|
442
486
|
}
|
|
487
|
+
/**
|
|
488
|
+
* F4 per-org SIEM routing for a provider event whose only trustworthy tenant anchor is the
|
|
489
|
+
* TOKEN-BOUND SUBJECT.
|
|
490
|
+
*
|
|
491
|
+
* Every emit on this service happens at a token MINT or ROTATION, where there is no authenticated
|
|
492
|
+
* request execution context — the caller has just presented a credential, and the token it is about
|
|
493
|
+
* to receive is not itself an authenticated request. So the routing org can never come from the
|
|
494
|
+
* request, and passing nothing left the provider's most sensitive events (a delegated grant, a
|
|
495
|
+
* detected credential theft) reaching the DB store and the app-level sinks but never a customer's
|
|
496
|
+
* own security sink.
|
|
497
|
+
*
|
|
498
|
+
* The subject is the answer, and only because of WHERE it comes from: each caller passes a user id
|
|
499
|
+
* the SERVER resolved — off the stored authorization code, off the stored refresh-token family, or
|
|
500
|
+
* off a token this process just minted and verified — never a value the caller wrote down.
|
|
501
|
+
* `resolveActiveMemberOrgIds` then reads the ORGANIZATION_MEMBERS junction as SYSTEM with a filter
|
|
502
|
+
* built entirely from that id plus a constant status, and brands the result `VerifiedOrgId[]`, so no
|
|
503
|
+
* caller input reaches the routing decision at any point in the chain. That provenance is the whole
|
|
504
|
+
* requirement — routing on an unverified org is the 2026-07-09 cross-tenant leak, and misrouting a
|
|
505
|
+
* delegated grant is strictly worse than not routing it.
|
|
506
|
+
*
|
|
507
|
+
* Resolved through the container rather than the constructor to match this service's lazy-dependency
|
|
508
|
+
* posture (the OAuth provider graph is reachable during startup; see the class JSDoc).
|
|
509
|
+
*
|
|
510
|
+
* NEVER-THROW, for a reason worth stating: each caller now resolves this BEFORE its emit, so a
|
|
511
|
+
* throw here would suppress the audit event entirely — turning a per-org DISPATCH failure into the
|
|
512
|
+
* loss of the authoritative record, which is the opposite of the fail-closed posture. Routing is
|
|
513
|
+
* best-effort; the DB store and the Layer-2 sink are not. `resolveActiveMemberOrgIds` is itself
|
|
514
|
+
* never-throw, so the only failure this adds is an unresolvable `SystemAccessService` binding.
|
|
515
|
+
*
|
|
516
|
+
* Returns `[]` when there is no subject to route on or when resolution failed. `[]` and `undefined`
|
|
517
|
+
* are equivalent at the sink boundary here because the request-EC argument is always `undefined` at
|
|
518
|
+
* these emit sites, so there is no EC org for `undefined` to fall back to; `[]` is passed because it
|
|
519
|
+
* states that the question WAS asked and the answer was empty.
|
|
520
|
+
*/
|
|
521
|
+
async _resolveSubjectRoutingOrgIds(userId) {
|
|
522
|
+
if (!userId) {
|
|
523
|
+
return [];
|
|
524
|
+
}
|
|
525
|
+
try {
|
|
526
|
+
const systemAccessService = this.container.get(SAAS_SERVICE_TYPES.SystemAccessService);
|
|
527
|
+
return await resolveActiveMemberOrgIds(systemAccessService, userId);
|
|
528
|
+
}
|
|
529
|
+
catch {
|
|
530
|
+
return [];
|
|
531
|
+
}
|
|
532
|
+
}
|
|
443
533
|
/**
|
|
444
534
|
* Build a typed backend error carrying the precise OAuth 2.0 error code in `context.oauthError`
|
|
445
535
|
* so the token-endpoint controller can render the RFC 6749 §5.2 error response body.
|
package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-provider-token.backend.service.js","sourceRoot":"","sources":["../../../../../../src/security/authentications/services/oauth-provider-token.backend.service.ts"],"names":[],"mappings":";;;;;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E,GAAgC,EAAE,UAAkB,EAAE,MAAc;QACvG,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE;YACnD,sBAAsB,EAAE,GAAG;YAC3B,OAAO,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE;SAChC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AA5cY,gCAAgC;IAD5C,UAAU,EAAE;IAGR,WAAA,MAAM,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAA;IACpC,WAAA,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;IAC3C,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAC9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAA;+CAHc,aAAa;QACO,uBAAuB;QACxB,0BAA0B;QACrB,gCAAgC;GAN3G,gCAAgC,CA4c5C","sourcesContent":["import 'reflect-metadata';\nimport { inject, injectable } from 'inversify';\nimport type { Container } from 'inversify';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport { AppConfigurationService } from '~wildo-backend-lib/config/services/app-configuration.backend.service';\nimport { ErrorBuilderBackendService } from '~wildo-backend-lib/errors/services/error-builder.backend.service';\nimport { describeCaughtError, projectCaughtErrorLogFields } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\nimport { MachineTokenIssuerBackendService } from '~wildo-backend-lib/security/authentications/services/machine-token-issuer.backend.service';\nimport { hashOAuthClientSecret } from '~wildo-backend-lib/security/oauth-clients/oauth-client-generation.backend.utils';\nimport type { ExecutionContextCreatorBackendService } from '~wildo-backend-lib/runtime/services/execution-context-creator.backend.service';\nimport type { RepositoriesRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/repositories/repositories-registry-handler.backend.service';\nimport type { OidcAuthorizationCodeBackendService } from '~wildo-backend-lib/security/authentications/services/oidc-authorization-code.backend.service';\nimport type { OidcUserClaimsBackendService } from '~wildo-backend-lib/security/authentications/services/oidc-user-claims.backend.service';\nimport type { JwtBackendService } from '~wildo-backend-lib/security/jwt/services/jwt.backend.service';\nimport type { AuthTokenIssuerBackendService } from '~wildo-backend-lib/security/authentications/services/auth-token-issuer.backend.service';\nimport { extractRefreshTokenReuseSignal } from '~wildo-backend-lib/security/authentications/services/auth-token-issuer.backend.service';\nimport type { ResourceServerInstancesRegistryBackendService } from '~wildo-backend-lib/mcp/services/resource-server-instances-registry.backend.service';\nimport {\n ApiKeyScope,\n CoreResourceOperation,\n CoreResourceType,\n DELEGATED_TOKEN_RESOURCE_SERVERS,\n MACHINE_TOKEN_RESOURCE_SERVERS,\n ErrorCustomMessageReference,\n ErrorType,\n ExecutionContext_ExecutionType,\n MachineAuthMethod,\n OAuthClientStatus,\n OAuthGrantType,\n ResourcePrimaryScope,\n UserStatus,\n} from '@wildo-ai/saas-models';\nimport { JwtClaim_App_Auth_UserRequest_Schema } from '~wildo-backend-lib/security/authentications/models/authentications.backend.schemas';\nimport type { OAuthClientApplication, OAuthClientOrganization, Roles, VerifiedOrgId } from '@wildo-ai/saas-models';\nimport { isRotationGraceWindowOpen, isCredentialExpired } from '~wildo-backend-lib/security/credential-rotation-grace.backend.utils';\nimport { AuditLogsBackendService } from '~wildo-backend-lib/compliance/audit-trails/services/audit-logs.backend.service';\nimport {\n getUserAuthorizationVersion,\n type AuthorizationVersionedUser,\n} from '~wildo-backend-lib/security/authentications/models/user-authorization-version.backend.utils';\n\n/**\n * Upper bound (minutes) on a USER-DELEGATED (`authorization_code`) access-token lifetime. A consented\n * third-party/agent token that acts AS the user is confined more tightly than a first-party session:\n * it gets NO refresh AND a lifetime capped at this bound, so an over-long operator-configured session\n * TTL (`accessTokenExpirationMinutes`, up to 1440) never widens a delegated token's window. The\n * effective TTL is `min(accessTokenExpirationMinutes, this)`. A dedicated operator-authored delegated\n * TTL config knob is the future extension; this cap is the safe default until then.\n */\nconst DELEGATED_ACCESS_TOKEN_MAX_TTL_MINUTES = 30;\n\n/**\n * Parsed input for the OAuth 2.0 `client_credentials` grant. The HTTP token-endpoint\n * controller (OIDC branch) extracts these from the request (`client_secret_basic` /\n * `client_secret_post` for the client secret, plus the `resource` (RFC 8707) form param) and\n * hands them here; this service is transport-agnostic.\n */\nexport interface OAuthClientCredentialsGrantRequest {\n /** The presented `oc_org_`/`oc_app_` client secret. */\n clientSecret: string;\n /** Optional `client_id` for a defensive cross-check against the resolved client. */\n clientId?: string;\n /** RFC 8707 resource indicator (the `resource` form param), if supplied. */\n resource?: string;\n}\n\n/** OAuth 2.0 successful token response (RFC 6749 §5.1) — snake_case is the wire contract. */\nexport interface OAuthTokenSuccessResponse {\n access_token: string;\n token_type: 'Bearer';\n expires_in: number;\n /**\n * Optional per RFC 6749 §5.1. Set by the OIDC identity flow (authorization_code, reflecting the\n * granted identity scopes); OMITTED by client_credentials — machine tokens are roles-only, with\n * no scope-based authorization.\n */\n scope?: string;\n}\n\n/** authorization_code / OIDC token response — adds the ID token + (optional) refresh token. */\nexport interface OidcTokenSuccessResponse extends OAuthTokenSuccessResponse {\n id_token: string;\n refresh_token?: string;\n}\n\n/**\n * OAuth 2.0 Authorization Server — `client_credentials` grant issuance. Verifies a\n * registered {@link OAuthClientOrganization}/{@link OAuthClientApplication} by its\n * presented secret and mints a short-lived, audience-bound machine access token via\n * {@link MachineTokenIssuerBackendService}. Transport-agnostic (no HTTP): the OIDC-branch\n * token-endpoint controller is a thin wrapper that parses the request and formats the\n * OAuth response / error.\n *\n * Secret verification MIRRORS the request-auth choke point's direct-secret front\n * (`handle{Organization,Application}OAuthClient`): route by the `oc_` prefix, resolve by\n * `hashedSecret` then the `previousHashedSecret` rotation-grace slot, require `ACTIVE`.\n * The audience is resolved through the SHARED\n * {@link AppConfigurationService.resolveApiResourceAudience} so the token this endpoint\n * mints carries exactly the `aud` the choke point validates (RFC 8707 — no drift).\n */\n@injectable()\nexport class OAuthProviderTokenBackendService {\n constructor(\n @inject(SAAS_SERVICE_TYPES.Container) private readonly container: Container,\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.AppConfigService) private readonly appConfigService: AppConfigurationService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService) private readonly errorBuilder: ErrorBuilderBackendService,\n @inject(SAAS_SERVICE_TYPES.MachineTokenIssuer) private readonly machineTokenIssuer: MachineTokenIssuerBackendService,\n ) {}\n\n public async issueClientCredentialsToken(request: OAuthClientCredentialsGrantRequest): Promise<OAuthTokenSuccessResponse> {\n const { clientSecret, clientId, resource } = request;\n\n // Route by secret prefix (same discriminator the request-auth choke point uses).\n const scopeKind = clientSecret.startsWith('oc_org_')\n ? ApiKeyScope.ORGANIZATION\n : clientSecret.startsWith('oc_app_')\n ? ApiKeyScope.APPLICATION\n : undefined;\n if (!scopeKind) {\n throw this._oauthError(ErrorType.AUTHENTICATION, ErrorCustomMessageReference.AUTHENTICATION_API_KEY_INVALID, 'invalid_client', 'unrecognized client secret prefix');\n }\n const resourceType = scopeKind === ApiKeyScope.ORGANIZATION\n ? CoreResourceType.OAUTH_CLIENTS_ORGANIZATION\n : CoreResourceType.OAUTH_CLIENTS_APPLICATION;\n\n // Resolve + validate the RFC 8707 audience up front (fail fast; the SAME value the\n // choke point validates against — resolved from the one shared authority).\n const apiAudience = this.appConfigService.resolveApiResourceAudience();\n if (!apiAudience) {\n throw this._oauthError(ErrorType.CONFIGURATION, ErrorCustomMessageReference.JWT_TOKEN_NOT_FOUND, 'temporarily_unavailable', 'api resource audience unresolvable');\n }\n // RFC 8707 resource indicator. Absent ⇒ the generic API audience (back-compat: clients that omit\n // `resource` keep getting an API-audience token). Present ⇒ it MUST name one of this app's resource\n // servers (API / A2A / MCP); the token is minted `aud`-bound to that surface, so a client that\n // follows an MCP/A2A endpoint's advertised Protected-Resource-Metadata `resource` receives a token\n // scoped to that endpoint (confused-deputy / token-passthrough defense) — replacing the former\n // blanket `invalid_target` rejection of every non-API resource. Mirrors the authorization_code\n // path's resource validation (below), but the machine set includes the API itself.\n // R-2: the valid set is enumerated from the INSTANCES REGISTRY — each kind's default surface PLUS\n // every declared named instance (`…/mcp/<ref>`, `…/a2a/<ref>`) — so declaring a server makes it\n // mintable and addressable in one move, and an undeclared one is `invalid_target` here (the mint\n // mirror of the 404 its endpoint returns).\n const requestedAudience = resource ?? apiAudience;\n const supportedMachineAudiences = this.container\n .get<ResourceServerInstancesRegistryBackendService>(SAAS_SERVICE_TYPES.ResourceServerInstancesRegistry)\n .listResourceServerAudiences(MACHINE_TOKEN_RESOURCE_SERVERS);\n if (!supportedMachineAudiences.includes(requestedAudience)) {\n throw this._oauthError(ErrorType.AUTHORIZATION, ErrorCustomMessageReference.AUTHORIZATIONS_ACCESS_DENIED, 'invalid_target', `unsupported resource '${resource}'`);\n }\n\n // Repository-direct read (raw record incl. roles/scope FK/status/grants), by\n // hashedSecret then the rotation-grace slot — mirrors the choke point.\n const ecCreator = this.container.get<ExecutionContextCreatorBackendService>(SAAS_SERVICE_TYPES.ExecutionContextCreatorBackendService);\n const repositoriesRegistry = this.container.get<RepositoriesRegistryHandlerBackendService>(SAAS_SERVICE_TYPES.RepositoriesRegistryHandlerService);\n const internalEc = await ecCreator.createForInternalRepositoryOperation({\n resourceType,\n operationIdentifier: CoreResourceOperation.READ,\n });\n const repo = repositoriesRegistry.getRepository(resourceType);\n\n type ResolvedClient = (OAuthClientOrganization | OAuthClientApplication) & { previousSecretInvalidationDate?: Date | null };\n const presentedHash = hashOAuthClientSecret(clientSecret);\n let client = await repo.read<ResolvedClient>(internalEc, { hashedSecret: presentedHash });\n if (!client) {\n const rotated = await repo.read<ResolvedClient>(internalEc, { previousHashedSecret: presentedHash });\n if (rotated && isRotationGraceWindowOpen(rotated.previousSecretInvalidationDate)) {\n client = rotated;\n }\n }\n\n if (!client || client.status !== OAuthClientStatus.ACTIVE || isCredentialExpired(client.expiresAt)) {\n throw this._oauthError(ErrorType.AUTHENTICATION, ErrorCustomMessageReference.AUTHENTICATION_API_KEY_INVALID, 'invalid_client', 'client not found or inactive');\n }\n // Defensive: if a client_id was supplied it MUST match the secret's owner.\n if (clientId && clientId !== client._id) {\n throw this._oauthError(ErrorType.AUTHENTICATION, ErrorCustomMessageReference.AUTHENTICATION_API_KEY_INVALID, 'invalid_client', 'client_id does not match presented secret');\n }\n if (!(client.allowedGrants ?? []).includes(OAuthGrantType.CLIENT_CREDENTIALS)) {\n throw this._oauthError(ErrorType.AUTHORIZATION, ErrorCustomMessageReference.AUTHORIZATIONS_ACCESS_DENIED, 'unauthorized_client', 'client is not authorized for the client_credentials grant');\n }\n\n const { scopeType, scopeId }: {\n scopeType: ResourcePrimaryScope.ORGANIZATIONS | ResourcePrimaryScope.APPLICATION;\n scopeId: string;\n } = scopeKind === ApiKeyScope.ORGANIZATION\n ? { scopeType: ResourcePrimaryScope.ORGANIZATIONS, scopeId: (client as OAuthClientOrganization).organizationId }\n : { scopeType: ResourcePrimaryScope.APPLICATION, scopeId: (client as OAuthClientApplication).applicationId };\n\n const issued = await this.machineTokenIssuer.issueClientAccessToken({\n clientId: client._id,\n scopeType,\n scopeId,\n roles: (client.roles ?? []) as Roles[],\n audience: requestedAudience,\n });\n\n this.logger.debug('Issued client_credentials token via OAuth token endpoint', {\n clientId: client._id,\n scopeType,\n scopeId,\n });\n\n // Audit the successful machine authentication at the OAuth issuance moment — the discrete,\n // low-volume \"a machine authenticated\" event (as opposed to auditing every subsequent request\n // the issued token makes). Fire-and-forget: auditing must never block or fail token issuance.\n //\n // SIEM-3 (F4 tenant-segregation routing) — the per-org SIEM fan-out routes on the explicit\n // `routingOrgIds` arg (or the request EC's authenticated org), NEVER on the `organizationId`\n // event-DATA field. This is a token-MINT: there is NO authenticated request EC (the client\n // just presented its credentials), so without an explicit `routingOrgIds` the event reaches\n // the DB store but NEVER the org SIEM. For an ORGANIZATION_MACHINE, `scopeId` IS the verified\n // `organizationId` read off the authenticated `OAuthClientOrganization` record above (line ~156)\n // — an F4-safe VERIFIED member org, not an attacker-supplied value — so we pass it as the\n // single routing org. An APPLICATION_MACHINE has no single tenant SIEM to route to ⇒ `undefined`\n // (DB store + Layer-2 app-level sinks still receive it; there is simply no per-org dispatch).\n const auditLogs = this.container.get<AuditLogsBackendService>(SAAS_SERVICE_TYPES.AuditLogsService);\n const machineAuthRoutingOrgIds: VerifiedOrgId[] | undefined = scopeType === ResourcePrimaryScope.ORGANIZATIONS ? [scopeId as VerifiedOrgId] : undefined;\n void auditLogs.logMachineAuthSuccess({\n authMethod: MachineAuthMethod.OAUTH_CLIENT,\n credentialId: client._id,\n scopeType: scopeType === ResourcePrimaryScope.ORGANIZATIONS\n ? ExecutionContext_ExecutionType.ORGANIZATION_MACHINE\n : ExecutionContext_ExecutionType.APPLICATION_MACHINE,\n scopeId,\n organizationId: scopeType === ResourcePrimaryScope.ORGANIZATIONS ? scopeId : undefined,\n }, undefined, machineAuthRoutingOrgIds).catch((auditError) => this.logger.warn('MACHINE_AUTH_SUCCESS audit emit failed (non-fatal)', {\n ...projectCaughtErrorLogFields(auditError),\n }));\n\n return {\n access_token: issued.accessToken,\n token_type: 'Bearer',\n expires_in: issued.expiresIn,\n };\n }\n\n /**\n * OIDC `authorization_code` grant. Redeems the code (atomic consume + client/redirect_uri\n * binding + mandatory PKCE S256 — in `OidcAuthorizationCodeBackendService`), then mints an\n * ID token (`createJwtForIdToken`) plus a USER access + refresh token (the existing user\n * issuer — a user-delegated token represents the consenting user). PKCE protects the\n * exchange (OAuth 2.1 mandatory-PKCE model); a CONFIDENTIAL client (`tokenEndpointAuthMethod !==\n * NONE`) must ALSO present a valid `client_secret`, enforced inside `exchangeAuthorizationCode`.\n * Heavy deps are lazily resolved to avoid startup-graph re-entry.\n */\n public async issueAuthorizationCodeToken(request: {\n code: string;\n clientId: string;\n redirectUri: string;\n codeVerifier: string;\n /**\n * The client secret presented via client_secret_basic/post, if any. REQUIRED for a confidential\n * client (verified in `exchangeAuthorizationCode`); ignored for a public (PKCE-only) client.\n */\n clientSecret?: string;\n /**\n * RFC 8707 §2.2 resource indicator OPTIONALLY echoed on the token request. The audience is\n * authoritatively bound at authorize time (`grant.resource`); when present here it MUST match\n * that bound value (a confused-deputy cross-check — a client must not exchange a code authorized\n * for agent A into a token for agent B), else `invalid_target`.\n */\n resource?: string;\n }): Promise<OidcTokenSuccessResponse> {\n const authCodeService = this.container.get<OidcAuthorizationCodeBackendService>(SAAS_SERVICE_TYPES.OidcAuthorizationCode);\n const jwtService = this.container.get<JwtBackendService>(SAAS_SERVICE_TYPES.JwtBackendService);\n\n const grant = await authCodeService.exchangeAuthorizationCode({\n code: request.code,\n clientId: request.clientId,\n redirectUri: request.redirectUri,\n codeVerifier: request.codeVerifier,\n presentedClientSecret: request.clientSecret,\n });\n\n // RFC 8707 (mandated by the MCP/A2A authorization specs): the client MUST name the resource\n // server it wants the token for, and a USER-DELEGATED token may ONLY target an agent surface\n // (A2A / MCP) — NEVER the main API. This tight audience is the load-bearing confinement (B-S2):\n // the token is `aud`-bound to that endpoint, so the main resource API (which accepts only\n // `aud='AUTH_TOKEN'` user tokens) rejects it. A consented third-party client thus acts for the\n // user at the named agent endpoint ONLY, never as a full first-party session.\n const requestedAudience = grant.resource;\n if (!requestedAudience) {\n throw this._oauthError(ErrorType.AUTHORIZATION, ErrorCustomMessageReference.AUTHORIZATIONS_ACCESS_DENIED, 'invalid_target',\n 'the `resource` parameter (RFC 8707) is required for the authorization_code grant');\n }\n // RFC 8707 §2.2 confused-deputy cross-check: if the token request ALSO named a resource, it must\n // match the one bound to the code at authorize (the user consented to THAT agent). A client must\n // not redeem a code authorized for agent A into a token audience-bound to agent B.\n if (request.resource && request.resource !== requestedAudience) {\n throw this._oauthError(ErrorType.AUTHORIZATION, ErrorCustomMessageReference.AUTHORIZATIONS_ACCESS_DENIED, 'invalid_target',\n 'the token-request `resource` does not match the resource authorized at the authorization endpoint');\n }\n // R-2: same instance-aware enumeration as the machine grant, but over the DELEGATED kinds only\n // (A2A / MCP — never the main API), so a user may delegate to a NAMED agent/server instance while\n // the B-S2 confinement (no delegated token for the API audience) is preserved unchanged.\n const allowedDelegatedAudiences = this.container\n .get<ResourceServerInstancesRegistryBackendService>(SAAS_SERVICE_TYPES.ResourceServerInstancesRegistry)\n .listResourceServerAudiences(DELEGATED_TOKEN_RESOURCE_SERVERS);\n if (!allowedDelegatedAudiences.includes(requestedAudience)) {\n throw this._oauthError(ErrorType.AUTHORIZATION, ErrorCustomMessageReference.AUTHORIZATIONS_ACCESS_DENIED, 'invalid_target',\n `resource '${requestedAudience}' is not a delegatable agent endpoint (A2A / MCP)`);\n }\n\n // OIDC Core §5.4: the ID token carries the SAME scope-gated identity claims (`email` / `profile`)\n // that `/oauth/userinfo` returns, via the one shared resolver — so an RP reading the ID token\n // directly gets email/name without a userinfo round-trip, and the two surfaces never disagree.\n // Cold path (once per authorization, not per request), so the resolver's own User/UserProfile reads\n // are acceptable alongside the authorization-version read below.\n const userClaimsService = this.container.get<OidcUserClaimsBackendService>(SAAS_SERVICE_TYPES.OidcUserClaims);\n const idTokenClaims = await userClaimsService.resolveUserClaims(grant.userId, grant.scope);\n const idToken = await jwtService.createJwtForIdToken({\n userId: grant.userId,\n clientId: grant.clientId,\n nonce: grant.nonce,\n // revocation-C: `sid` = the End-User's OP session captured at authorize (threaded through the code\n // grant). This is the PRIMARY path an RP obtains a `sid`-bearing id_token, and the hint it later\n // presents to `/oauth/end-session` to terminate that first-party session.\n sid: grant.sessionId,\n extraClaims: idTokenClaims,\n });\n\n // Bind the delegated token to the same durable User authorization version\n // as first-party access/refresh tokens. Delegated tokens have no refresh\n // path, so request-time comparison is their only post-issuance revocation\n // fence when userTypes/appRoles/status changes.\n const ecCreator =\n this.container.get<ExecutionContextCreatorBackendService>(\n SAAS_SERVICE_TYPES.ExecutionContextCreatorBackendService,\n );\n const repositoriesRegistry =\n this.container.get<RepositoriesRegistryHandlerBackendService>(\n SAAS_SERVICE_TYPES.RepositoriesRegistryHandlerService,\n );\n const userReadEc = await ecCreator.createForInternalRepositoryOperation({\n resourceType: CoreResourceType.USERS,\n operationIdentifier: CoreResourceOperation.READ,\n });\n const user = await repositoriesRegistry\n .getRepository(CoreResourceType.USERS)\n .read<AuthorizationVersionedUser>(userReadEc, grant.userId);\n const authorizationVersion = getUserAuthorizationVersion(user);\n if (\n !user\n || user.status !== UserStatus.ACTIVE\n || authorizationVersion === null\n ) {\n throw this._oauthError(\n ErrorType.AUTHENTICATION,\n ErrorCustomMessageReference.AUTHENTICATION_INVALID_TOKEN,\n 'invalid_grant',\n 'the authorizing user is no longer active or versioned',\n );\n }\n\n // Mint the USER-delegated access token audience-bound to the named agent endpoint. Roles-only:\n // the user's roles are fetched at request time (NO authz `scope` on the token); `azp` = the\n // delegating client for attribution. NO refresh token — a confined agent token must not be able\n // to mint fresh tokens.\n const accessClaim = JwtClaim_App_Auth_UserRequest_Schema.parse({\n type: ExecutionContext_ExecutionType.USER_REQUEST,\n userId: grant.userId,\n authorizationVersion,\n azp: grant.clientId,\n // Identity scopes (openid/…) ride for IDENTITY only — they carry NO authorization weight.\n ...(grant.scope.length ? { scope: grant.scope } : {}),\n });\n // Confine the delegated token to at most DELEGATED_ACCESS_TOKEN_MAX_TTL_MINUTES (never the full\n // first-party session TTL). expiresIn MUST mirror the minted `exp`, so both derive from the cap.\n const delegatedTtlMinutes = Math.min(\n this.appConfigService.config.jwt.accessTokenExpirationMinutes,\n DELEGATED_ACCESS_TOKEN_MAX_TTL_MINUTES,\n );\n const accessToken = await jwtService.createJwtForDelegatedUserToken(accessClaim, {\n audience: requestedAudience,\n expiresInMinutes: delegatedTtlMinutes,\n });\n const expiresIn = delegatedTtlMinutes * 60;\n\n // assurance-control: WILDO.IDENTITY.DELEGATED_AUTHORIZATION — issuing a delegated token grants a\n // third-party client the ability to act AS the user (the most security-sensitive access grant the\n // provider makes). Emit the audit/SIEM record (subject, client/azp, audience, granted scopes, TTL).\n // Fire-and-forget: auditing must never block or fail token issuance. No request EC / verified org at\n // this mint (the token is not itself an authenticated request), so per-org SIEM dispatch is omitted —\n // the DB store + Layer-2 immudb sink still record it.\n const auditLogsForDelegated = this.container.get<AuditLogsBackendService>(SAAS_SERVICE_TYPES.AuditLogsService);\n void auditLogsForDelegated.logOAuthDelegatedTokenIssued({\n userId: grant.userId,\n clientId: grant.clientId,\n audience: requestedAudience,\n scopes: grant.scope,\n ttlSeconds: expiresIn,\n }).catch((auditError) => this.logger.warn('OAUTH_DELEGATED_TOKEN_ISSUED audit emit failed (non-fatal)', {\n ...projectCaughtErrorLogFields(auditError),\n }));\n this.logger.debug('Issued authorization_code (user-delegated) token', {\n clientId: grant.clientId, userId: grant.userId, audience: requestedAudience, scopeCount: grant.scope.length, ttlMinutes: delegatedTtlMinutes,\n });\n\n return {\n access_token: accessToken,\n token_type: 'Bearer',\n expires_in: expiresIn,\n id_token: idToken,\n scope: grant.scope.join(' '),\n };\n }\n\n /**\n * OIDC `refresh_token` grant. Rotates the presented user refresh token via the existing\n * `AuthTokenIssuer` (reuse-detection + rotation grace preserved) and returns a fresh access +\n * refresh token. A rejected/reused/expired token maps to the OAuth `invalid_grant` error.\n *\n * Item 5 (OIDC Core §12.2): when the token request AUTHENTICATES a client (a `clientId` AND a valid\n * `clientSecret`), a fresh `id_token` is ALSO re-issued. This is OPTIONAL per §12.2 and omitted for a\n * pure first-party session refresh (no credentials). The client is AUTHENTICATED FIRST — crucially\n * BEFORE the refresh token is rotated — via the shared `verifyPresentedClientSecret` (the same\n * current/rotation-grace secret check as the revocation and code-exchange paths). This ordering matters:\n * `refreshAccessToken` unconditionally consumes (blacklists + rotates) the presented token, so a bad\n * secret checked AFTER it would burn the refresh token and, past the grace window, trip reuse-detection\n * into revoking the whole token family on the legitimate retry. Authenticating first means (a) the\n * id_token `aud` names a genuinely-verified client rather than a caller-supplied value, and (b) a failed\n * authentication fails the WHOLE request as `invalid_client` (401) with NO rotation and NO tokens\n * issued — never a silent access+refresh downgrade. A `clientId` presented WITHOUT a secret is\n * not authenticated and therefore yields access + refresh only (no id_token). The re-issued id token\n * is MINIMAL — `sub`/`aud`/`iss` only, WITHOUT the scope-gated identity claims (email/name/locale) and\n * (per §12.2) WITHOUT a `nonce`: the original grant's scopes are not threaded onto the first-party\n * refresh path, so an RP that needs identity claims fetches them from `/oauth/userinfo` (which reads\n * the fresh access token). The user id is read back from the freshly-minted access token rather than\n * threaded out of `AuthTokenIssuer` (whose `AuthTokens` deliberately carries no subject) — the access\n * token is the authoritative subject carrier, and it is first-party (`aud='AUTH_TOKEN'`) so it verifies\n * with the default key/audience. id-token MINTING (after successful client auth) is best-effort: a\n * verify miss or an unresolvable issuer (`createJwtForIdToken` throws) simply omits the id token — the\n * access + refresh tokens are the required output and never fail on the id-token addition.\n *\n * ── Audit posture (A-4) — a DELIBERATE, narrow-by-design surface (user-confirmed 2026-07-31) ──\n * This grant emits exactly TWO audit events, and INTENTIONALLY does not emit on routine failure:\n * • SUCCESS → `OAUTH_TOKEN_REFRESHED` (INFO) — one row per successful rotation.\n * • THEFT → `USER_REFRESH_TOKEN_REUSE_DETECTED` (CRITICAL) — only when the issuer's reuse-detection\n * fired and revoked the token family (surfaced via the tagged-error signal below).\n * • ROUTINE FAILURE (expired / revoked / plain-invalid presented token) → NO audit event, ON PURPOSE.\n * Rationale: routine refresh failures are HIGH-VOLUME — every ended/idle session eventually presents an\n * expired-or-revoked refresh token, so auditing them would FLOOD the compliance store with benign noise\n * and drown the signal a SOC actually monitors. The security-relevant refresh failure is credential\n * THEFT, which is precisely what reuse-detection catches and A-9 records; a plain expired token is not a\n * security event. Auditing high-frequency expected failures is a recognised audit-log anti-pattern\n * (signal-to-noise collapse). If a future control ever needs the full rejected-attempt stream, add a\n * DEBOUNCED/aggregated counter (a metric, not a per-attempt audit row) rather than a per-request event.\n */\n public async issueRefreshTokenGrant(refreshToken: string, clientId?: string, clientSecret?: string): Promise<OAuthTokenSuccessResponse & { refresh_token?: string; id_token?: string }> {\n // Item 5 — AUTHENTICATE the client BEFORE the (destructive) refresh-token rotation. `refreshAccessToken`\n // unconditionally blacklists the presented token's jti and mints a successor, so authenticating AFTER it\n // would CONSUME the refresh token even on a bad secret — and after the rotation-grace window the\n // legitimate retry would trip reuse-detection and revoke the whole token family (logout everywhere). By\n // gating here, a bad secret throws `invalid_client` (→ the token endpoint's 401 mapping) with NO rotation\n // having happened. Only `clientId` + `clientSecret` together require authentication (and yield an\n // id_token); a first-party session refresh presents neither and skips straight to rotation.\n if (clientId && clientSecret) {\n const authCodeService = this.container.get<OidcAuthorizationCodeBackendService>(SAAS_SERVICE_TYPES.OidcAuthorizationCode);\n await authCodeService.verifyPresentedClientSecret(clientId, clientSecret);\n }\n\n const userTokenIssuer = this.container.get<AuthTokenIssuerBackendService>(SAAS_SERVICE_TYPES.AuthTokenIssuer);\n let tokens;\n try {\n tokens = await userTokenIssuer.refreshAccessToken(refreshToken);\n } catch (refreshError) {\n // A-9 caller-signal: the issuer performs the family revoke but does NOT audit (TRAP 13); it TAGS a\n // reuse rejection with the theft signal. If present, emit `USER_REFRESH_TOKEN_REUSE_DETECTED` here.\n // A routine expired/revoked/invalid refresh carries NO signal ⇒ no event (deliberate anti-flood: the\n // security-relevant refresh failure is theft, not routine session expiry). Fire-and-forget.\n // assurance-control: WILDO.IDENTITY.CREDENTIAL_LIFECYCLE — credential-theft detection + response.\n const reuseSignal = extractRefreshTokenReuseSignal(refreshError);\n if (reuseSignal) {\n const auditLogsForReuse = this.container.get<AuditLogsBackendService>(SAAS_SERVICE_TYPES.AuditLogsService);\n void auditLogsForReuse.logUserRefreshTokenReuseDetected({\n userId: reuseSignal.userId,\n reusedJti: reuseSignal.reusedJti,\n sessionId: reuseSignal.sessionId,\n familyRevoked: reuseSignal.familyRevoked,\n }).catch((auditError) => this.logger.warn('USER_REFRESH_TOKEN_REUSE_DETECTED audit emit failed (non-fatal)', {\n ...projectCaughtErrorLogFields(auditError),\n }));\n }\n throw this._oauthError(ErrorType.AUTHENTICATION, ErrorCustomMessageReference.AUTHENTICATION_API_KEY_INVALID, 'invalid_grant', 'refresh token invalid, expired, or revoked');\n }\n const expiresIn = tokens.expiresIn ?? this.appConfigService.config.jwt.accessTokenExpirationMinutes * 60;\n\n // The client was already authenticated above → mint a MINIMAL id_token from the fresh access token\n // (best-effort; a verify miss / unresolvable issuer omits it without failing the now-completed rotation).\n let idToken: string | undefined;\n // A-4: the subject read off the fresh access token (client-authenticated path only) — threaded into the\n // success audit below when available; the general first-party refresh path audits without a subject.\n let refreshedUserId: string | undefined;\n if (clientId && clientSecret) {\n try {\n const jwtService = this.container.get<JwtBackendService>(SAAS_SERVICE_TYPES.JwtBackendService);\n // Quiet verify (no default backend error LOG) — a best-effort read of OUR OWN freshly-minted token.\n // The refreshed access token carries the same `sessionId` as its predecessor (revocation-C: refresh\n // propagates it), so a `sid`-bearing id_token stays coherent across a refresh.\n const claims = await jwtService.verifyWithoutBackendErrorActions(tokens.accessToken) as { sub?: string; sessionId?: string };\n if (claims.sub) {\n refreshedUserId = claims.sub;\n idToken = await jwtService.createJwtForIdToken({ userId: claims.sub, clientId, sid: claims.sessionId });\n }\n } catch (idTokenError) {\n this.logger.debug('ID token omitted from refresh_token grant (non-fatal)', {\n reason: describeCaughtError(idTokenError),\n });\n }\n }\n\n // A-4: audit the SUCCESSFUL provider refresh grant. Low-detail INFO — the security-relevant refresh\n // failure (theft/reuse) is audited via A-9 above; routine failures are intentionally not audited.\n // assurance-control: WILDO.IDENTITY.CREDENTIAL_LIFECYCLE — token lifecycle (refresh). Fire-and-forget.\n const clientAuthenticated = Boolean(clientId && clientSecret);\n const auditLogsForRefresh = this.container.get<AuditLogsBackendService>(SAAS_SERVICE_TYPES.AuditLogsService);\n void auditLogsForRefresh.logOAuthTokenRefreshed({\n userId: refreshedUserId,\n clientId: clientAuthenticated ? clientId : undefined,\n clientAuthenticated,\n }).catch((auditError) => this.logger.warn('OAUTH_TOKEN_REFRESHED audit emit failed (non-fatal)', {\n ...projectCaughtErrorLogFields(auditError),\n }));\n\n return {\n access_token: tokens.accessToken,\n token_type: 'Bearer',\n expires_in: expiresIn,\n ...(tokens.refreshToken ? { refresh_token: tokens.refreshToken } : {}),\n ...(idToken ? { id_token: idToken } : {}),\n scope: '',\n };\n }\n\n /**\n * OAuth 2.0 token revocation (RFC 7009). Revokes a user refresh token. Per §2.2 the endpoint\n * returns success even for an unknown/invalid token (no token-status oracle), so this NEVER\n * throws for a bad token — only unexpected infra failures propagate.\n */\n public async revokeRefreshToken(refreshToken: string): Promise<void> {\n const userTokenIssuer = this.container.get<AuthTokenIssuerBackendService>(SAAS_SERVICE_TYPES.AuthTokenIssuer);\n try {\n await userTokenIssuer.revokeRefreshToken(refreshToken);\n } catch (error) {\n // RFC 7009 §2.2: an invalid token is still a successful revocation. Swallow validation\n // errors; log at debug for observability.\n this.logger.debug('Token revocation on a non-revocable token treated as success (RFC 7009)', { reason: describeCaughtError(error) });\n }\n }\n\n /**\n * Build a typed backend error carrying the precise OAuth 2.0 error code in `context.oauthError`\n * so the token-endpoint controller can render the RFC 6749 §5.2 error response body.\n */\n private _oauthError(type: ErrorType, ref: ErrorCustomMessageReference, oauthError: string, detail: string) {\n return this.errorBuilder.buildError(type, undefined, {\n customMessageReference: ref,\n context: { oauthError, detail },\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"oauth-provider-token.backend.service.js","sourceRoot":"","sources":["../../../../../../src/security/authentications/services/oauth-provider-token.backend.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAC7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,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GG;IACK,WAAW,CAAC,IAAe,EAAE,GAAgC,EAAE,UAAkB,EAAE,MAAc;QACvG,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE;YACnD,sBAAsB,EAAE,GAAG;YAC3B,OAAO,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE;SAChC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAriBY,gCAAgC;IAD5C,UAAU,EAAE;IAGR,WAAA,MAAM,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAA;IACpC,WAAA,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;IAC3C,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAC9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAA;+CAHc,aAAa;QACO,uBAAuB;QACxB,0BAA0B;QACrB,gCAAgC;GAN3G,gCAAgC,CAqiB5C","sourcesContent":["import 'reflect-metadata';\nimport { inject, injectable } from 'inversify';\nimport type { Container } from 'inversify';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport { AppConfigurationService } from '~wildo-backend-lib/config/services/app-configuration.backend.service';\nimport { ErrorBuilderBackendService } from '~wildo-backend-lib/errors/services/error-builder.backend.service';\nimport { describeCaughtError, projectCaughtErrorLogFields } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\nimport { MachineTokenIssuerBackendService } from '~wildo-backend-lib/security/authentications/services/machine-token-issuer.backend.service';\nimport { hashOAuthClientSecret } from '~wildo-backend-lib/security/oauth-clients/oauth-client-generation.backend.utils';\nimport type { ExecutionContextCreatorBackendService } from '~wildo-backend-lib/runtime/services/execution-context-creator.backend.service';\nimport type { RepositoriesRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/repositories/repositories-registry-handler.backend.service';\nimport type { OidcAuthorizationCodeBackendService } from '~wildo-backend-lib/security/authentications/services/oidc-authorization-code.backend.service';\nimport type { OidcUserClaimsBackendService } from '~wildo-backend-lib/security/authentications/services/oidc-user-claims.backend.service';\nimport type { JwtBackendService } from '~wildo-backend-lib/security/jwt/services/jwt.backend.service';\nimport type { AuthTokenIssuerBackendService } from '~wildo-backend-lib/security/authentications/services/auth-token-issuer.backend.service';\nimport { extractRefreshTokenReuseSignal } from '~wildo-backend-lib/security/authentications/services/auth-token-issuer.backend.service';\nimport { resolveActiveMemberOrgIds } from '~wildo-backend-lib/security/authentications/services/resolve-active-member-orgs.backend.utils';\nimport type { SystemAccessBackendService } from '~wildo-backend-lib/base-classes/services/services/system-access.backend.service';\nimport type { ResourceServerInstancesRegistryBackendService } from '~wildo-backend-lib/mcp/services/resource-server-instances-registry.backend.service';\nimport {\n ApiKeyScope,\n CoreResourceOperation,\n CoreResourceType,\n DELEGATED_TOKEN_RESOURCE_SERVERS,\n MACHINE_TOKEN_RESOURCE_SERVERS,\n ErrorCustomMessageReference,\n ErrorType,\n ExecutionContext_ExecutionType,\n MachineAuthMethod,\n OAuthClientStatus,\n OAuthGrantType,\n ResourcePrimaryScope,\n UserStatus,\n} from '@wildo-ai/saas-models';\nimport { JwtClaim_App_Auth_UserRequest_Schema } from '~wildo-backend-lib/security/authentications/models/authentications.backend.schemas';\nimport type { OAuthClientApplication, OAuthClientOrganization, Roles, VerifiedOrgId } from '@wildo-ai/saas-models';\nimport { isRotationGraceWindowOpen, isCredentialExpired } from '~wildo-backend-lib/security/credential-rotation-grace.backend.utils';\nimport { AuditLogsBackendService } from '~wildo-backend-lib/compliance/audit-trails/services/audit-logs.backend.service';\nimport {\n getUserAuthorizationVersion,\n type AuthorizationVersionedUser,\n} from '~wildo-backend-lib/security/authentications/models/user-authorization-version.backend.utils';\n\n/**\n * Upper bound (minutes) on a USER-DELEGATED (`authorization_code`) access-token lifetime. A consented\n * third-party/agent token that acts AS the user is confined more tightly than a first-party session:\n * it gets NO refresh AND a lifetime capped at this bound, so an over-long operator-configured session\n * TTL (`accessTokenExpirationMinutes`, up to 1440) never widens a delegated token's window. The\n * effective TTL is `min(accessTokenExpirationMinutes, this)`. A dedicated operator-authored delegated\n * TTL config knob is the future extension; this cap is the safe default until then.\n */\nconst DELEGATED_ACCESS_TOKEN_MAX_TTL_MINUTES = 30;\n\n/**\n * Parsed input for the OAuth 2.0 `client_credentials` grant. The HTTP token-endpoint\n * controller (OIDC branch) extracts these from the request (`client_secret_basic` /\n * `client_secret_post` for the client secret, plus the `resource` (RFC 8707) form param) and\n * hands them here; this service is transport-agnostic.\n */\nexport interface OAuthClientCredentialsGrantRequest {\n /** The presented `oc_org_`/`oc_app_` client secret. */\n clientSecret: string;\n /** Optional `client_id` for a defensive cross-check against the resolved client. */\n clientId?: string;\n /** RFC 8707 resource indicator (the `resource` form param), if supplied. */\n resource?: string;\n}\n\n/** OAuth 2.0 successful token response (RFC 6749 §5.1) — snake_case is the wire contract. */\nexport interface OAuthTokenSuccessResponse {\n access_token: string;\n token_type: 'Bearer';\n expires_in: number;\n /**\n * Optional per RFC 6749 §5.1. Set by the OIDC identity flow (authorization_code, reflecting the\n * granted identity scopes); OMITTED by client_credentials — machine tokens are roles-only, with\n * no scope-based authorization.\n */\n scope?: string;\n}\n\n/** authorization_code / OIDC token response — adds the ID token + (optional) refresh token. */\nexport interface OidcTokenSuccessResponse extends OAuthTokenSuccessResponse {\n id_token: string;\n refresh_token?: string;\n}\n\n/**\n * OAuth 2.0 Authorization Server — `client_credentials` grant issuance. Verifies a\n * registered {@link OAuthClientOrganization}/{@link OAuthClientApplication} by its\n * presented secret and mints a short-lived, audience-bound machine access token via\n * {@link MachineTokenIssuerBackendService}. Transport-agnostic (no HTTP): the OIDC-branch\n * token-endpoint controller is a thin wrapper that parses the request and formats the\n * OAuth response / error.\n *\n * Secret verification MIRRORS the request-auth choke point's direct-secret front\n * (`handle{Organization,Application}OAuthClient`): route by the `oc_` prefix, resolve by\n * `hashedSecret` then the `previousHashedSecret` rotation-grace slot, require `ACTIVE`.\n * The audience is resolved through the SHARED\n * {@link AppConfigurationService.resolveApiResourceAudience} so the token this endpoint\n * mints carries exactly the `aud` the choke point validates (RFC 8707 — no drift).\n */\n@injectable()\nexport class OAuthProviderTokenBackendService {\n constructor(\n @inject(SAAS_SERVICE_TYPES.Container) private readonly container: Container,\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.AppConfigService) private readonly appConfigService: AppConfigurationService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService) private readonly errorBuilder: ErrorBuilderBackendService,\n @inject(SAAS_SERVICE_TYPES.MachineTokenIssuer) private readonly machineTokenIssuer: MachineTokenIssuerBackendService,\n ) {}\n\n public async issueClientCredentialsToken(request: OAuthClientCredentialsGrantRequest): Promise<OAuthTokenSuccessResponse> {\n const { clientSecret, clientId, resource } = request;\n\n // Route by secret prefix (same discriminator the request-auth choke point uses).\n const scopeKind = clientSecret.startsWith('oc_org_')\n ? ApiKeyScope.ORGANIZATION\n : clientSecret.startsWith('oc_app_')\n ? ApiKeyScope.APPLICATION\n : undefined;\n if (!scopeKind) {\n throw this._oauthError(ErrorType.AUTHENTICATION, ErrorCustomMessageReference.AUTHENTICATION_API_KEY_INVALID, 'invalid_client', 'unrecognized client secret prefix');\n }\n const resourceType = scopeKind === ApiKeyScope.ORGANIZATION\n ? CoreResourceType.OAUTH_CLIENTS_ORGANIZATION\n : CoreResourceType.OAUTH_CLIENTS_APPLICATION;\n\n // Resolve + validate the RFC 8707 audience up front (fail fast; the SAME value the\n // choke point validates against — resolved from the one shared authority).\n const apiAudience = this.appConfigService.resolveApiResourceAudience();\n if (!apiAudience) {\n throw this._oauthError(ErrorType.CONFIGURATION, ErrorCustomMessageReference.JWT_TOKEN_NOT_FOUND, 'temporarily_unavailable', 'api resource audience unresolvable');\n }\n // RFC 8707 resource indicator. Absent ⇒ the generic API audience (back-compat: clients that omit\n // `resource` keep getting an API-audience token). Present ⇒ it MUST name one of this app's resource\n // servers (API / A2A / MCP); the token is minted `aud`-bound to that surface, so a client that\n // follows an MCP/A2A endpoint's advertised Protected-Resource-Metadata `resource` receives a token\n // scoped to that endpoint (confused-deputy / token-passthrough defense) — replacing the former\n // blanket `invalid_target` rejection of every non-API resource. Mirrors the authorization_code\n // path's resource validation (below), but the machine set includes the API itself.\n // R-2: the valid set is enumerated from the INSTANCES REGISTRY — each kind's default surface PLUS\n // every declared named instance (`…/mcp/<ref>`, `…/a2a/<ref>`) — so declaring a server makes it\n // mintable and addressable in one move, and an undeclared one is `invalid_target` here (the mint\n // mirror of the 404 its endpoint returns).\n const requestedAudience = resource ?? apiAudience;\n const supportedMachineAudiences = this.container\n .get<ResourceServerInstancesRegistryBackendService>(SAAS_SERVICE_TYPES.ResourceServerInstancesRegistry)\n .listResourceServerAudiences(MACHINE_TOKEN_RESOURCE_SERVERS);\n if (!supportedMachineAudiences.includes(requestedAudience)) {\n throw this._oauthError(ErrorType.AUTHORIZATION, ErrorCustomMessageReference.AUTHORIZATIONS_ACCESS_DENIED, 'invalid_target', `unsupported resource '${resource}'`);\n }\n\n // Repository-direct read (raw record incl. roles/scope FK/status/grants), by\n // hashedSecret then the rotation-grace slot — mirrors the choke point.\n const ecCreator = this.container.get<ExecutionContextCreatorBackendService>(SAAS_SERVICE_TYPES.ExecutionContextCreatorBackendService);\n const repositoriesRegistry = this.container.get<RepositoriesRegistryHandlerBackendService>(SAAS_SERVICE_TYPES.RepositoriesRegistryHandlerService);\n const internalEc = await ecCreator.createForInternalRepositoryOperation({\n resourceType,\n operationIdentifier: CoreResourceOperation.READ,\n });\n const repo = repositoriesRegistry.getRepository(resourceType);\n\n type ResolvedClient = (OAuthClientOrganization | OAuthClientApplication) & { previousSecretInvalidationDate?: Date | null };\n const presentedHash = hashOAuthClientSecret(clientSecret);\n let client = await repo.read<ResolvedClient>(internalEc, { hashedSecret: presentedHash });\n if (!client) {\n const rotated = await repo.read<ResolvedClient>(internalEc, { previousHashedSecret: presentedHash });\n if (rotated && isRotationGraceWindowOpen(rotated.previousSecretInvalidationDate)) {\n client = rotated;\n }\n }\n\n if (!client || client.status !== OAuthClientStatus.ACTIVE || isCredentialExpired(client.expiresAt)) {\n throw this._oauthError(ErrorType.AUTHENTICATION, ErrorCustomMessageReference.AUTHENTICATION_API_KEY_INVALID, 'invalid_client', 'client not found or inactive');\n }\n // Defensive: if a client_id was supplied it MUST match the secret's owner.\n if (clientId && clientId !== client._id) {\n throw this._oauthError(ErrorType.AUTHENTICATION, ErrorCustomMessageReference.AUTHENTICATION_API_KEY_INVALID, 'invalid_client', 'client_id does not match presented secret');\n }\n if (!(client.allowedGrants ?? []).includes(OAuthGrantType.CLIENT_CREDENTIALS)) {\n throw this._oauthError(ErrorType.AUTHORIZATION, ErrorCustomMessageReference.AUTHORIZATIONS_ACCESS_DENIED, 'unauthorized_client', 'client is not authorized for the client_credentials grant');\n }\n\n const { scopeType, scopeId }: {\n scopeType: ResourcePrimaryScope.ORGANIZATIONS | ResourcePrimaryScope.APPLICATION;\n scopeId: string;\n } = scopeKind === ApiKeyScope.ORGANIZATION\n ? { scopeType: ResourcePrimaryScope.ORGANIZATIONS, scopeId: (client as OAuthClientOrganization).organizationId }\n : { scopeType: ResourcePrimaryScope.APPLICATION, scopeId: (client as OAuthClientApplication).applicationId };\n\n const issued = await this.machineTokenIssuer.issueClientAccessToken({\n clientId: client._id,\n scopeType,\n scopeId,\n roles: (client.roles ?? []) as Roles[],\n audience: requestedAudience,\n });\n\n this.logger.debug('Issued client_credentials token via OAuth token endpoint', {\n clientId: client._id,\n scopeType,\n scopeId,\n });\n\n // Audit the successful machine authentication at the OAuth issuance moment — the discrete,\n // low-volume \"a machine authenticated\" event (as opposed to auditing every subsequent request\n // the issued token makes). Fire-and-forget: auditing must never block or fail token issuance.\n //\n // SIEM-3 (F4 tenant-segregation routing) — the per-org SIEM fan-out routes on the explicit\n // `routingOrgIds` arg (or the request EC's authenticated org), NEVER on the `organizationId`\n // event-DATA field. This is a token-MINT: there is NO authenticated request EC (the client\n // just presented its credentials), so without an explicit `routingOrgIds` the event reaches\n // the DB store but NEVER the org SIEM. For an ORGANIZATION_MACHINE, `scopeId` IS the verified\n // `organizationId` read off the authenticated `OAuthClientOrganization` record above (line ~156)\n // — an F4-safe VERIFIED member org, not an attacker-supplied value — so we pass it as the\n // single routing org. An APPLICATION_MACHINE has no single tenant SIEM to route to ⇒ `undefined`\n // (DB store + Layer-2 app-level sinks still receive it; there is simply no per-org dispatch).\n const auditLogs = this.container.get<AuditLogsBackendService>(SAAS_SERVICE_TYPES.AuditLogsService);\n const machineAuthRoutingOrgIds: VerifiedOrgId[] | undefined = scopeType === ResourcePrimaryScope.ORGANIZATIONS ? [scopeId as VerifiedOrgId] : undefined;\n void auditLogs.logMachineAuthSuccess({\n authMethod: MachineAuthMethod.OAUTH_CLIENT,\n credentialId: client._id,\n scopeType: scopeType === ResourcePrimaryScope.ORGANIZATIONS\n ? ExecutionContext_ExecutionType.ORGANIZATION_MACHINE\n : ExecutionContext_ExecutionType.APPLICATION_MACHINE,\n scopeId,\n organizationId: scopeType === ResourcePrimaryScope.ORGANIZATIONS ? scopeId : undefined,\n }, undefined, machineAuthRoutingOrgIds).catch((auditError) => this.logger.warn('MACHINE_AUTH_SUCCESS audit emit failed (non-fatal)', {\n ...projectCaughtErrorLogFields(auditError),\n }));\n\n return {\n access_token: issued.accessToken,\n token_type: 'Bearer',\n expires_in: issued.expiresIn,\n };\n }\n\n /**\n * OIDC `authorization_code` grant. Redeems the code (atomic consume + client/redirect_uri\n * binding + mandatory PKCE S256 — in `OidcAuthorizationCodeBackendService`), then mints an\n * ID token (`createJwtForIdToken`) plus a USER access + refresh token (the existing user\n * issuer — a user-delegated token represents the consenting user). PKCE protects the\n * exchange (OAuth 2.1 mandatory-PKCE model); a CONFIDENTIAL client (`tokenEndpointAuthMethod !==\n * NONE`) must ALSO present a valid `client_secret`, enforced inside `exchangeAuthorizationCode`.\n * Heavy deps are lazily resolved to avoid startup-graph re-entry.\n */\n public async issueAuthorizationCodeToken(request: {\n code: string;\n clientId: string;\n redirectUri: string;\n codeVerifier: string;\n /**\n * The client secret presented via client_secret_basic/post, if any. REQUIRED for a confidential\n * client (verified in `exchangeAuthorizationCode`); ignored for a public (PKCE-only) client.\n */\n clientSecret?: string;\n /**\n * RFC 8707 §2.2 resource indicator OPTIONALLY echoed on the token request. The audience is\n * authoritatively bound at authorize time (`grant.resource`); when present here it MUST match\n * that bound value (a confused-deputy cross-check — a client must not exchange a code authorized\n * for agent A into a token for agent B), else `invalid_target`.\n */\n resource?: string;\n }): Promise<OidcTokenSuccessResponse> {\n const authCodeService = this.container.get<OidcAuthorizationCodeBackendService>(SAAS_SERVICE_TYPES.OidcAuthorizationCode);\n const jwtService = this.container.get<JwtBackendService>(SAAS_SERVICE_TYPES.JwtBackendService);\n\n const grant = await authCodeService.exchangeAuthorizationCode({\n code: request.code,\n clientId: request.clientId,\n redirectUri: request.redirectUri,\n codeVerifier: request.codeVerifier,\n presentedClientSecret: request.clientSecret,\n });\n\n // RFC 8707 (mandated by the MCP/A2A authorization specs): the client MUST name the resource\n // server it wants the token for, and a USER-DELEGATED token may ONLY target an agent surface\n // (A2A / MCP) — NEVER the main API. This tight audience is the load-bearing confinement (B-S2):\n // the token is `aud`-bound to that endpoint, so the main resource API (which accepts only\n // `aud='AUTH_TOKEN'` user tokens) rejects it. A consented third-party client thus acts for the\n // user at the named agent endpoint ONLY, never as a full first-party session.\n const requestedAudience = grant.resource;\n if (!requestedAudience) {\n throw this._oauthError(ErrorType.AUTHORIZATION, ErrorCustomMessageReference.AUTHORIZATIONS_ACCESS_DENIED, 'invalid_target',\n 'the `resource` parameter (RFC 8707) is required for the authorization_code grant');\n }\n // RFC 8707 §2.2 confused-deputy cross-check: if the token request ALSO named a resource, it must\n // match the one bound to the code at authorize (the user consented to THAT agent). A client must\n // not redeem a code authorized for agent A into a token audience-bound to agent B.\n if (request.resource && request.resource !== requestedAudience) {\n throw this._oauthError(ErrorType.AUTHORIZATION, ErrorCustomMessageReference.AUTHORIZATIONS_ACCESS_DENIED, 'invalid_target',\n 'the token-request `resource` does not match the resource authorized at the authorization endpoint');\n }\n // R-2: same instance-aware enumeration as the machine grant, but over the DELEGATED kinds only\n // (A2A / MCP — never the main API), so a user may delegate to a NAMED agent/server instance while\n // the B-S2 confinement (no delegated token for the API audience) is preserved unchanged.\n const allowedDelegatedAudiences = this.container\n .get<ResourceServerInstancesRegistryBackendService>(SAAS_SERVICE_TYPES.ResourceServerInstancesRegistry)\n .listResourceServerAudiences(DELEGATED_TOKEN_RESOURCE_SERVERS);\n if (!allowedDelegatedAudiences.includes(requestedAudience)) {\n throw this._oauthError(ErrorType.AUTHORIZATION, ErrorCustomMessageReference.AUTHORIZATIONS_ACCESS_DENIED, 'invalid_target',\n `resource '${requestedAudience}' is not a delegatable agent endpoint (A2A / MCP)`);\n }\n\n // OIDC Core §5.4: the ID token carries the SAME scope-gated identity claims (`email` / `profile`)\n // that `/oauth/userinfo` returns, via the one shared resolver — so an RP reading the ID token\n // directly gets email/name without a userinfo round-trip, and the two surfaces never disagree.\n // Cold path (once per authorization, not per request), so the resolver's own User/UserProfile reads\n // are acceptable alongside the authorization-version read below.\n const userClaimsService = this.container.get<OidcUserClaimsBackendService>(SAAS_SERVICE_TYPES.OidcUserClaims);\n const idTokenClaims = await userClaimsService.resolveUserClaims(grant.userId, grant.scope);\n const idToken = await jwtService.createJwtForIdToken({\n userId: grant.userId,\n clientId: grant.clientId,\n nonce: grant.nonce,\n // revocation-C: `sid` = the End-User's OP session captured at authorize (threaded through the code\n // grant). This is the PRIMARY path an RP obtains a `sid`-bearing id_token, and the hint it later\n // presents to `/oauth/end-session` to terminate that first-party session.\n sid: grant.sessionId,\n extraClaims: idTokenClaims,\n });\n\n // Bind the delegated token to the same durable User authorization version\n // as first-party access/refresh tokens. Delegated tokens have no refresh\n // path, so request-time comparison is their only post-issuance revocation\n // fence when userTypes/appRoles/status changes.\n const ecCreator =\n this.container.get<ExecutionContextCreatorBackendService>(\n SAAS_SERVICE_TYPES.ExecutionContextCreatorBackendService,\n );\n const repositoriesRegistry =\n this.container.get<RepositoriesRegistryHandlerBackendService>(\n SAAS_SERVICE_TYPES.RepositoriesRegistryHandlerService,\n );\n const userReadEc = await ecCreator.createForInternalRepositoryOperation({\n resourceType: CoreResourceType.USERS,\n operationIdentifier: CoreResourceOperation.READ,\n });\n const user = await repositoriesRegistry\n .getRepository(CoreResourceType.USERS)\n .read<AuthorizationVersionedUser>(userReadEc, grant.userId);\n const authorizationVersion = getUserAuthorizationVersion(user);\n if (\n !user\n || user.status !== UserStatus.ACTIVE\n || authorizationVersion === null\n ) {\n throw this._oauthError(\n ErrorType.AUTHENTICATION,\n ErrorCustomMessageReference.AUTHENTICATION_INVALID_TOKEN,\n 'invalid_grant',\n 'the authorizing user is no longer active or versioned',\n );\n }\n\n // Mint the USER-delegated access token audience-bound to the named agent endpoint. Roles-only:\n // the user's roles are fetched at request time (NO authz `scope` on the token); `azp` = the\n // delegating client for attribution. NO refresh token — a confined agent token must not be able\n // to mint fresh tokens.\n const accessClaim = JwtClaim_App_Auth_UserRequest_Schema.parse({\n type: ExecutionContext_ExecutionType.USER_REQUEST,\n userId: grant.userId,\n authorizationVersion,\n azp: grant.clientId,\n // Identity scopes (openid/…) ride for IDENTITY only — they carry NO authorization weight.\n ...(grant.scope.length ? { scope: grant.scope } : {}),\n });\n // Confine the delegated token to at most DELEGATED_ACCESS_TOKEN_MAX_TTL_MINUTES (never the full\n // first-party session TTL). expiresIn MUST mirror the minted `exp`, so both derive from the cap.\n const delegatedTtlMinutes = Math.min(\n this.appConfigService.config.jwt.accessTokenExpirationMinutes,\n DELEGATED_ACCESS_TOKEN_MAX_TTL_MINUTES,\n );\n const accessToken = await jwtService.createJwtForDelegatedUserToken(accessClaim, {\n audience: requestedAudience,\n expiresInMinutes: delegatedTtlMinutes,\n });\n const expiresIn = delegatedTtlMinutes * 60;\n\n // assurance-control: WILDO.IDENTITY.DELEGATED_AUTHORIZATION — issuing a delegated token grants a\n // third-party client the ability to act AS the user (the most security-sensitive access grant the\n // provider makes). Emit the audit/SIEM record (subject, client/azp, audience, granted scopes, TTL).\n // Fire-and-forget: auditing must never block or fail token issuance.\n //\n // SIEM-3 (F4 tenant-segregation routing) — the routing org comes from the SUBJECT, not the request.\n // There is genuinely no authenticated request EC at a token MINT (the client has just redeemed a\n // code; the token it is being handed is not itself an authenticated request), so the 2nd arg stays\n // `undefined` and, without the 3rd, this — the provider's most sensitive grant — reached the DB\n // store and the app-level sinks but NEVER the customer's own security sink. `grant.userId` is\n // resolved by `exchangeAuthorizationCode` off the STORED authorization code, so it is token-bound\n // and can never be a caller-supplied value; that is exactly the provenance the magic-link and\n // first-party-refresh paths already route on, and `_resolveSubjectRoutingOrgIds` turns it into\n // VERIFIED ACTIVE memberships read as SYSTEM. A delegated grant therefore reaches precisely the\n // tenants whose data the minted token can act on, which is the F4 question.\n //\n // D3/H-20: the DELEGATING CLIENT's own org is deliberately NOT a routing target. The token carries\n // the USER's authority and the client is only `azp`, so a client registered in org A completing the\n // flow for a user of org B must not thereby publish that user's grant into org A's SIEM feed.\n const auditLogsForDelegated = this.container.get<AuditLogsBackendService>(SAAS_SERVICE_TYPES.AuditLogsService);\n void (async () => {\n // Resolved INSIDE the fire-and-forget block: a membership read must never add latency to the\n // mint, and its failure mode (fail-closed to `[]`) must never reach the token response.\n const delegatedRoutingOrgIds = await this._resolveSubjectRoutingOrgIds(grant.userId);\n await auditLogsForDelegated.logOAuthDelegatedTokenIssued({\n userId: grant.userId,\n clientId: grant.clientId,\n audience: requestedAudience,\n scopes: grant.scope,\n ttlSeconds: expiresIn,\n }, undefined, delegatedRoutingOrgIds);\n })().catch((auditError) => this.logger.warn('OAUTH_DELEGATED_TOKEN_ISSUED audit emit failed (non-fatal)', {\n ...projectCaughtErrorLogFields(auditError),\n }));\n this.logger.debug('Issued authorization_code (user-delegated) token', {\n clientId: grant.clientId, userId: grant.userId, audience: requestedAudience, scopeCount: grant.scope.length, ttlMinutes: delegatedTtlMinutes,\n });\n\n return {\n access_token: accessToken,\n token_type: 'Bearer',\n expires_in: expiresIn,\n id_token: idToken,\n scope: grant.scope.join(' '),\n };\n }\n\n /**\n * OIDC `refresh_token` grant. Rotates the presented user refresh token via the existing\n * `AuthTokenIssuer` (reuse-detection + rotation grace preserved) and returns a fresh access +\n * refresh token. A rejected/reused/expired token maps to the OAuth `invalid_grant` error.\n *\n * Item 5 (OIDC Core §12.2): when the token request AUTHENTICATES a client (a `clientId` AND a valid\n * `clientSecret`), a fresh `id_token` is ALSO re-issued. This is OPTIONAL per §12.2 and omitted for a\n * pure first-party session refresh (no credentials). The client is AUTHENTICATED FIRST — crucially\n * BEFORE the refresh token is rotated — via the shared `verifyPresentedClientSecret` (the same\n * current/rotation-grace secret check as the revocation and code-exchange paths). This ordering matters:\n * `refreshAccessToken` unconditionally consumes (blacklists + rotates) the presented token, so a bad\n * secret checked AFTER it would burn the refresh token and, past the grace window, trip reuse-detection\n * into revoking the whole token family on the legitimate retry. Authenticating first means (a) the\n * id_token `aud` names a genuinely-verified client rather than a caller-supplied value, and (b) a failed\n * authentication fails the WHOLE request as `invalid_client` (401) with NO rotation and NO tokens\n * issued — never a silent access+refresh downgrade. A `clientId` presented WITHOUT a secret is\n * not authenticated and therefore yields access + refresh only (no id_token). The re-issued id token\n * is MINIMAL — `sub`/`aud`/`iss` only, WITHOUT the scope-gated identity claims (email/name/locale) and\n * (per §12.2) WITHOUT a `nonce`: the original grant's scopes are not threaded onto the first-party\n * refresh path, so an RP that needs identity claims fetches them from `/oauth/userinfo` (which reads\n * the fresh access token). The user id is read back from the freshly-minted access token rather than\n * threaded out of `AuthTokenIssuer` (whose `AuthTokens` deliberately carries no subject) — the access\n * token is the authoritative subject carrier, and it is first-party (`aud='AUTH_TOKEN'`) so it verifies\n * with the default key/audience. id-token MINTING (after successful client auth) is best-effort: a\n * verify miss or an unresolvable issuer (`createJwtForIdToken` throws) simply omits the id token — the\n * access + refresh tokens are the required output and never fail on the id-token addition.\n *\n * ── Audit posture (A-4) — a DELIBERATE, narrow-by-design surface (user-confirmed 2026-07-31) ──\n * This grant emits exactly TWO audit events, and INTENTIONALLY does not emit on routine failure:\n * • SUCCESS → `OAUTH_TOKEN_REFRESHED` (INFO) — one row per successful rotation.\n * • THEFT → `USER_REFRESH_TOKEN_REUSE_DETECTED` (CRITICAL) — only when the issuer's reuse-detection\n * fired and revoked the token family (surfaced via the tagged-error signal below).\n * • ROUTINE FAILURE (expired / revoked / plain-invalid presented token) → NO audit event, ON PURPOSE.\n * Rationale: routine refresh failures are HIGH-VOLUME — every ended/idle session eventually presents an\n * expired-or-revoked refresh token, so auditing them would FLOOD the compliance store with benign noise\n * and drown the signal a SOC actually monitors. The security-relevant refresh failure is credential\n * THEFT, which is precisely what reuse-detection catches and A-9 records; a plain expired token is not a\n * security event. Auditing high-frequency expected failures is a recognised audit-log anti-pattern\n * (signal-to-noise collapse). If a future control ever needs the full rejected-attempt stream, add a\n * DEBOUNCED/aggregated counter (a metric, not a per-attempt audit row) rather than a per-request event.\n */\n public async issueRefreshTokenGrant(refreshToken: string, clientId?: string, clientSecret?: string): Promise<OAuthTokenSuccessResponse & { refresh_token?: string; id_token?: string }> {\n // Item 5 — AUTHENTICATE the client BEFORE the (destructive) refresh-token rotation. `refreshAccessToken`\n // unconditionally blacklists the presented token's jti and mints a successor, so authenticating AFTER it\n // would CONSUME the refresh token even on a bad secret — and after the rotation-grace window the\n // legitimate retry would trip reuse-detection and revoke the whole token family (logout everywhere). By\n // gating here, a bad secret throws `invalid_client` (→ the token endpoint's 401 mapping) with NO rotation\n // having happened. Only `clientId` + `clientSecret` together require authentication (and yield an\n // id_token); a first-party session refresh presents neither and skips straight to rotation.\n if (clientId && clientSecret) {\n const authCodeService = this.container.get<OidcAuthorizationCodeBackendService>(SAAS_SERVICE_TYPES.OidcAuthorizationCode);\n await authCodeService.verifyPresentedClientSecret(clientId, clientSecret);\n }\n\n const userTokenIssuer = this.container.get<AuthTokenIssuerBackendService>(SAAS_SERVICE_TYPES.AuthTokenIssuer);\n let tokens;\n try {\n tokens = await userTokenIssuer.refreshAccessToken(refreshToken);\n } catch (refreshError) {\n // A-9 caller-signal: the issuer performs the family revoke but does NOT audit (TRAP 13); it TAGS a\n // reuse rejection with the theft signal. If present, emit `USER_REFRESH_TOKEN_REUSE_DETECTED` here.\n // A routine expired/revoked/invalid refresh carries NO signal ⇒ no event (deliberate anti-flood: the\n // security-relevant refresh failure is theft, not routine session expiry). Fire-and-forget.\n // assurance-control: WILDO.IDENTITY.CREDENTIAL_LIFECYCLE — credential-theft detection + response.\n // SIEM-3 (F4): routed to the VICTIM's verified member orgs, exactly as the first-party refresh\n // endpoint already does (`authentication-controller.backend.service.ts` refreshToken). This is\n // credential-THEFT detection — the single event a customer's SOC most needs in its own feed —\n // and the two refresh surfaces share one issuer, so they must not disagree about who sees it.\n // `reuseSignal.userId` is read off the STORED token family by the issuer, never off the request.\n const reuseSignal = extractRefreshTokenReuseSignal(refreshError);\n if (reuseSignal) {\n const auditLogsForReuse = this.container.get<AuditLogsBackendService>(SAAS_SERVICE_TYPES.AuditLogsService);\n void (async () => {\n const reuseRoutingOrgIds = await this._resolveSubjectRoutingOrgIds(reuseSignal.userId);\n await auditLogsForReuse.logUserRefreshTokenReuseDetected({\n userId: reuseSignal.userId,\n reusedJti: reuseSignal.reusedJti,\n sessionId: reuseSignal.sessionId,\n familyRevoked: reuseSignal.familyRevoked,\n }, undefined, reuseRoutingOrgIds);\n })().catch((auditError) => this.logger.warn('USER_REFRESH_TOKEN_REUSE_DETECTED audit emit failed (non-fatal)', {\n ...projectCaughtErrorLogFields(auditError),\n }));\n }\n throw this._oauthError(ErrorType.AUTHENTICATION, ErrorCustomMessageReference.AUTHENTICATION_API_KEY_INVALID, 'invalid_grant', 'refresh token invalid, expired, or revoked');\n }\n const expiresIn = tokens.expiresIn ?? this.appConfigService.config.jwt.accessTokenExpirationMinutes * 60;\n\n // The client was already authenticated above → mint a MINIMAL id_token from the fresh access token\n // (best-effort; a verify miss / unresolvable issuer omits it without failing the now-completed rotation).\n let idToken: string | undefined;\n // A-4: the subject read off the fresh access token (client-authenticated path only) — threaded into the\n // success audit below when available; the general first-party refresh path audits without a subject.\n let refreshedUserId: string | undefined;\n if (clientId && clientSecret) {\n try {\n const jwtService = this.container.get<JwtBackendService>(SAAS_SERVICE_TYPES.JwtBackendService);\n // Quiet verify (no default backend error LOG) — a best-effort read of OUR OWN freshly-minted token.\n // The refreshed access token carries the same `sessionId` as its predecessor (revocation-C: refresh\n // propagates it), so a `sid`-bearing id_token stays coherent across a refresh.\n const claims = await jwtService.verifyWithoutBackendErrorActions(tokens.accessToken) as { sub?: string; sessionId?: string };\n if (claims.sub) {\n refreshedUserId = claims.sub;\n idToken = await jwtService.createJwtForIdToken({ userId: claims.sub, clientId, sid: claims.sessionId });\n }\n } catch (idTokenError) {\n this.logger.debug('ID token omitted from refresh_token grant (non-fatal)', {\n reason: describeCaughtError(idTokenError),\n });\n }\n }\n\n // A-4: audit the SUCCESSFUL provider refresh grant. Low-detail INFO — the security-relevant refresh\n // failure (theft/reuse) is audited via A-9 above; routine failures are intentionally not audited.\n // assurance-control: WILDO.IDENTITY.CREDENTIAL_LIFECYCLE — token lifecycle (refresh). Fire-and-forget.\n //\n // SIEM-3 (F4): routed on `refreshedUserId`, which is read back from OUR OWN freshly-minted access\n // token — server-minted, so token-bound rather than caller-claimed.\n //\n // NOT ROUTED on the FIRST-PARTY branch (no `clientId`+`clientSecret`), and that is a decision rather\n // than an oversight. That branch deliberately performs no JWT verify (`AuthTokens` carries no\n // subject, and the verify exists only to mint the OIDC §12.2 id_token), so the event has no subject\n // at all — neither in `routingOrgIds` NOR in its own `userId` data field. Routing an org-anonymous\n // \"a token was refreshed\" row into a tenant's SIEM would add noise carrying no attribution, so the\n // honest ordering is: make the event ATTRIBUTABLE first (a verify inside this fire-and-forget block\n // would do it, at the cost of retiring the \"a first-party refresh performs no verify\" pin), and\n // route it in the same change. Until then the DB store + Layer-2 sinks remain its only record —\n // and note the first-party refresh ENDPOINT (`/auth/refresh-token`) already audits with a subject\n // and routes, so nothing is lost for the ordinary session-refresh journey.\n const clientAuthenticated = Boolean(clientId && clientSecret);\n const auditLogsForRefresh = this.container.get<AuditLogsBackendService>(SAAS_SERVICE_TYPES.AuditLogsService);\n void (async () => {\n const refreshRoutingOrgIds = await this._resolveSubjectRoutingOrgIds(refreshedUserId);\n await auditLogsForRefresh.logOAuthTokenRefreshed({\n userId: refreshedUserId,\n clientId: clientAuthenticated ? clientId : undefined,\n clientAuthenticated,\n }, undefined, refreshRoutingOrgIds);\n })().catch((auditError) => this.logger.warn('OAUTH_TOKEN_REFRESHED audit emit failed (non-fatal)', {\n ...projectCaughtErrorLogFields(auditError),\n }));\n\n return {\n access_token: tokens.accessToken,\n token_type: 'Bearer',\n expires_in: expiresIn,\n ...(tokens.refreshToken ? { refresh_token: tokens.refreshToken } : {}),\n ...(idToken ? { id_token: idToken } : {}),\n scope: '',\n };\n }\n\n /**\n * OAuth 2.0 token revocation (RFC 7009). Revokes a user refresh token. Per §2.2 the endpoint\n * returns success even for an unknown/invalid token (no token-status oracle), so this NEVER\n * throws for a bad token — only unexpected infra failures propagate.\n */\n public async revokeRefreshToken(refreshToken: string): Promise<void> {\n const userTokenIssuer = this.container.get<AuthTokenIssuerBackendService>(SAAS_SERVICE_TYPES.AuthTokenIssuer);\n try {\n await userTokenIssuer.revokeRefreshToken(refreshToken);\n } catch (error) {\n // RFC 7009 §2.2: an invalid token is still a successful revocation. Swallow validation\n // errors; log at debug for observability.\n this.logger.debug('Token revocation on a non-revocable token treated as success (RFC 7009)', { reason: describeCaughtError(error) });\n }\n }\n\n /**\n * F4 per-org SIEM routing for a provider event whose only trustworthy tenant anchor is the\n * TOKEN-BOUND SUBJECT.\n *\n * Every emit on this service happens at a token MINT or ROTATION, where there is no authenticated\n * request execution context — the caller has just presented a credential, and the token it is about\n * to receive is not itself an authenticated request. So the routing org can never come from the\n * request, and passing nothing left the provider's most sensitive events (a delegated grant, a\n * detected credential theft) reaching the DB store and the app-level sinks but never a customer's\n * own security sink.\n *\n * The subject is the answer, and only because of WHERE it comes from: each caller passes a user id\n * the SERVER resolved — off the stored authorization code, off the stored refresh-token family, or\n * off a token this process just minted and verified — never a value the caller wrote down.\n * `resolveActiveMemberOrgIds` then reads the ORGANIZATION_MEMBERS junction as SYSTEM with a filter\n * built entirely from that id plus a constant status, and brands the result `VerifiedOrgId[]`, so no\n * caller input reaches the routing decision at any point in the chain. That provenance is the whole\n * requirement — routing on an unverified org is the 2026-07-09 cross-tenant leak, and misrouting a\n * delegated grant is strictly worse than not routing it.\n *\n * Resolved through the container rather than the constructor to match this service's lazy-dependency\n * posture (the OAuth provider graph is reachable during startup; see the class JSDoc).\n *\n * NEVER-THROW, for a reason worth stating: each caller now resolves this BEFORE its emit, so a\n * throw here would suppress the audit event entirely — turning a per-org DISPATCH failure into the\n * loss of the authoritative record, which is the opposite of the fail-closed posture. Routing is\n * best-effort; the DB store and the Layer-2 sink are not. `resolveActiveMemberOrgIds` is itself\n * never-throw, so the only failure this adds is an unresolvable `SystemAccessService` binding.\n *\n * Returns `[]` when there is no subject to route on or when resolution failed. `[]` and `undefined`\n * are equivalent at the sink boundary here because the request-EC argument is always `undefined` at\n * these emit sites, so there is no EC org for `undefined` to fall back to; `[]` is passed because it\n * states that the question WAS asked and the answer was empty.\n */\n private async _resolveSubjectRoutingOrgIds(userId: string | undefined): Promise<VerifiedOrgId[]> {\n if (!userId) {\n return [];\n }\n try {\n const systemAccessService = this.container.get<SystemAccessBackendService>(SAAS_SERVICE_TYPES.SystemAccessService);\n return await resolveActiveMemberOrgIds(systemAccessService, userId);\n } catch {\n return [];\n }\n }\n\n /**\n * Build a typed backend error carrying the precise OAuth 2.0 error code in `context.oauthError`\n * so the token-endpoint controller can render the RFC 6749 §5.2 error response body.\n */\n private _oauthError(type: ErrorType, ref: ErrorCustomMessageReference, oauthError: string, detail: string) {\n return this.errorBuilder.buildError(type, undefined, {\n customMessageReference: ref,\n context: { oauthError, detail },\n });\n }\n}\n"]}
|
package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.d.ts
CHANGED
|
@@ -206,7 +206,8 @@ export declare class OidcAuthorizationCodeBackendService {
|
|
|
206
206
|
* back to the relying party. EXACT string match against the resolved client's `postLogoutRedirectUris`
|
|
207
207
|
* allowlist — the SAME anti-open-redirect discipline as the authorization-code `redirect_uri` gate
|
|
208
208
|
* (`exchangeAuthorizationCode`), never a prefix or origin match. A client that cannot be resolved, or
|
|
209
|
-
* that registered no post-logout URIs
|
|
209
|
+
* that registered no post-logout URIs, admits none — fail closed. (A CIMD client CAN register
|
|
210
|
+
* them since #464; before that, none could.)
|
|
210
211
|
* spec-cite: OpenID Connect RP-Initiated Logout 1.0 §3 (the OP "MUST NOT perform post-logout redirection
|
|
211
212
|
* if the `post_logout_redirect_uri` value supplied does not exactly match one of the previously
|
|
212
213
|
* registered `post_logout_redirect_uris` values"; registration of those values is §2).
|
|
@@ -307,6 +308,18 @@ export declare class OidcAuthorizationCodeBackendService {
|
|
|
307
308
|
* updateAsSystem — the CREATE DTO strips the context FK `userId`, re-attached from the schema allowlist).
|
|
308
309
|
*/
|
|
309
310
|
upsertConsentGrant(userId: string, clientId: string, resource: string | undefined, scopes: string[]): Promise<void>;
|
|
311
|
+
/**
|
|
312
|
+
* When a consent granted NOW should lapse (#465).
|
|
313
|
+
*
|
|
314
|
+
* The operator's `auth.consentGrantLifetimeDays` when authored, else the framework default — whose
|
|
315
|
+
* reasoning is at `OAUTH_CONSENT_GRANT_DEFAULT_LIFETIME_DAYS`. There is no "never": that was the
|
|
316
|
+
* state this replaced.
|
|
317
|
+
*
|
|
318
|
+
* Reads config through the container and TOLERATES its absence, deliberately. A consent the user
|
|
319
|
+
* has just given must not fail to persist because a policy lookup threw — losing the grant is a
|
|
320
|
+
* worse outcome than applying the default, and the default is the safer of the two anyway.
|
|
321
|
+
*/
|
|
322
|
+
private consentGrantExpiry;
|
|
310
323
|
/**
|
|
311
324
|
* Widen an existing consent grant's scopes to the UNION of its current scopes + the newly-approved set,
|
|
312
325
|
* via a system update. Shared by the initial-existing path and the concurrency-recovery path so the
|
package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oidc-authorization-code.backend.service.d.ts","sourceRoot":"","sources":["../../../../../../src/security/authentications/services/oidc-authorization-code.backend.service.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAG3C,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,kEAAkE,CAAC;AAE9G,OAAO,EAAE,6BAA6B,EAAE,MAAM,yFAAyF,CAAC;
|
|
1
|
+
{"version":3,"file":"oidc-authorization-code.backend.service.d.ts","sourceRoot":"","sources":["../../../../../../src/security/authentications/services/oidc-authorization-code.backend.service.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAG3C,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,kEAAkE,CAAC;AAE9G,OAAO,EAAE,6BAA6B,EAAE,MAAM,yFAAyF,CAAC;AA+BxI,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAE3B,MAAM,yFAAyF,CAAC;AAOjG,gGAAgG;AAChG,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,C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AG,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAkChI;;;;;;;;;;OAUG;IACH,OAAO,CAAC,kBAAkB;IAY1B;;;;OAIG;YACW,uBAAuB;IAgBrC;;;;OAIG;YACW,gBAAgB;IAY9B,OAAO,CAAC,UAAU;CAQnB"}
|
package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.js
CHANGED
|
@@ -19,6 +19,7 @@ import { ErrorBuilderBackendService } from '../../../errors/services/error-build
|
|
|
19
19
|
import { describeCaughtError, projectCaughtErrorLogFields } from '../../../errors/utils/error-log-level-classification.backend.utils.js';
|
|
20
20
|
import { ConsumableTokenBackendService } from '../../../security/consumable-tokens/services/consumable-token.backend.service.js';
|
|
21
21
|
import { ApiKeyScope, ConsumableToken_ConsumptionMode, CoreConsumableTokenTypes, CoreResourceOperation, CoreResourceType, ErrorCustomMessageReference, ErrorType, isConfidentialTokenEndpointAuthMethod, isWildoBackendError, OAuthClientStatus, OAuthCodeExchangeFailureReason, OAuthGrantType, OAuthClientRegistrationOrigin, OAuthTokenEndpointAuthMethod, OrganizationMemberStatus, } from '@wildo-ai/saas-models';
|
|
22
|
+
import { OAUTH_CONSENT_GRANT_DEFAULT_LIFETIME_DAYS } from '@wildo-ai/saas-models';
|
|
22
23
|
import { isCredentialExpired, isRotationGraceWindowOpen } from '../../../security/credential-rotation-grace.backend.utils.js';
|
|
23
24
|
import { hashOAuthClientSecret } from '../../../security/oauth-clients/oauth-client-generation.backend.utils.js';
|
|
24
25
|
import { isValidPkceCodeVerifier, isValidS256CodeChallenge } from '../../../security/authentications/services/utils/pkce.backend.utils.js';
|
|
@@ -436,7 +437,8 @@ let OidcAuthorizationCodeBackendService = class OidcAuthorizationCodeBackendServ
|
|
|
436
437
|
* back to the relying party. EXACT string match against the resolved client's `postLogoutRedirectUris`
|
|
437
438
|
* allowlist — the SAME anti-open-redirect discipline as the authorization-code `redirect_uri` gate
|
|
438
439
|
* (`exchangeAuthorizationCode`), never a prefix or origin match. A client that cannot be resolved, or
|
|
439
|
-
* that registered no post-logout URIs
|
|
440
|
+
* that registered no post-logout URIs, admits none — fail closed. (A CIMD client CAN register
|
|
441
|
+
* them since #464; before that, none could.)
|
|
440
442
|
* spec-cite: OpenID Connect RP-Initiated Logout 1.0 §3 (the OP "MUST NOT perform post-logout redirection
|
|
441
443
|
* if the `post_logout_redirect_uri` value supplied does not exactly match one of the previously
|
|
442
444
|
* registered `post_logout_redirect_uris` values"; registration of those values is §2).
|
|
@@ -561,11 +563,16 @@ let OidcAuthorizationCodeBackendService = class OidcAuthorizationCodeBackendServ
|
|
|
561
563
|
clientId,
|
|
562
564
|
name: metadata.client_name,
|
|
563
565
|
redirectUris: metadata.redirect_uris,
|
|
564
|
-
// revocation-C: RP-Initiated Logout post-logout redirects
|
|
565
|
-
//
|
|
566
|
-
//
|
|
567
|
-
//
|
|
568
|
-
|
|
566
|
+
// revocation-C: RP-Initiated Logout post-logout redirects, honoured for a CIMD client since
|
|
567
|
+
// 2026-09-08 (#464). The document's `post_logout_redirect_uris` is carried through and matched
|
|
568
|
+
// EXACTLY by `isRegisteredPostLogoutRedirectUri` — the same anti-open-redirect discipline as
|
|
569
|
+
// the authorization-code `redirect_uri` gate, and the same trust model, since both members
|
|
570
|
+
// come from the same client-authored document fetched through the same SSRF guard.
|
|
571
|
+
//
|
|
572
|
+
// A document that registers none still admits none: fail-closed empty, which is what every
|
|
573
|
+
// CIMD client got while the member was undeclared. What changed is that a client which DOES
|
|
574
|
+
// register one stops having its redirect silently ignored.
|
|
575
|
+
postLogoutRedirectUris: metadata.post_logout_redirect_uris ?? [],
|
|
569
576
|
allowedScopes: OIDC_SUPPORTED_IDENTITY_SCOPES,
|
|
570
577
|
allowedGrants,
|
|
571
578
|
tenancy: { kind: AuthorizationClientTenancy.UNAFFILIATED },
|
|
@@ -778,7 +785,10 @@ let OidcAuthorizationCodeBackendService = class OidcAuthorizationCodeBackendServ
|
|
|
778
785
|
await this.widenConsentGrantScopes(systemAccess, existing, scopes);
|
|
779
786
|
return;
|
|
780
787
|
}
|
|
781
|
-
|
|
788
|
+
// #465: every affirmative consent carries an expiry. The field had a reader and no writer, so a
|
|
789
|
+
// remembered approval lived until the person revoked it while reading to an operator as a policy
|
|
790
|
+
// knob that existed.
|
|
791
|
+
const data = { userId, clientId, scopes, expiresAt: this.consentGrantExpiry() };
|
|
782
792
|
if (resource)
|
|
783
793
|
data.resource = resource;
|
|
784
794
|
try {
|
|
@@ -805,6 +815,30 @@ let OidcAuthorizationCodeBackendService = class OidcAuthorizationCodeBackendServ
|
|
|
805
815
|
await this.widenConsentGrantScopes(systemAccess, winner, scopes);
|
|
806
816
|
}
|
|
807
817
|
}
|
|
818
|
+
/**
|
|
819
|
+
* When a consent granted NOW should lapse (#465).
|
|
820
|
+
*
|
|
821
|
+
* The operator's `auth.consentGrantLifetimeDays` when authored, else the framework default — whose
|
|
822
|
+
* reasoning is at `OAUTH_CONSENT_GRANT_DEFAULT_LIFETIME_DAYS`. There is no "never": that was the
|
|
823
|
+
* state this replaced.
|
|
824
|
+
*
|
|
825
|
+
* Reads config through the container and TOLERATES its absence, deliberately. A consent the user
|
|
826
|
+
* has just given must not fail to persist because a policy lookup threw — losing the grant is a
|
|
827
|
+
* worse outcome than applying the default, and the default is the safer of the two anyway.
|
|
828
|
+
*/
|
|
829
|
+
consentGrantExpiry() {
|
|
830
|
+
let lifetimeDays = OAUTH_CONSENT_GRANT_DEFAULT_LIFETIME_DAYS;
|
|
831
|
+
try {
|
|
832
|
+
const configured = this.container.get(SAAS_SERVICE_TYPES.AppConfigService)
|
|
833
|
+
?.config?.auth?.consentGrantLifetimeDays;
|
|
834
|
+
if (typeof configured === 'number')
|
|
835
|
+
lifetimeDays = configured;
|
|
836
|
+
}
|
|
837
|
+
catch {
|
|
838
|
+
// Unbound in a harness that never looks at consent policy — the default stands.
|
|
839
|
+
}
|
|
840
|
+
return new Date(Date.now() + lifetimeDays * 24 * 60 * 60 * 1000);
|
|
841
|
+
}
|
|
808
842
|
/**
|
|
809
843
|
* Widen an existing consent grant's scopes to the UNION of its current scopes + the newly-approved set,
|
|
810
844
|
* via a system update. Shared by the initial-existing path and the concurrency-recovery path so the
|
|
@@ -812,7 +846,14 @@ let OidcAuthorizationCodeBackendService = class OidcAuthorizationCodeBackendServ
|
|
|
812
846
|
*/
|
|
813
847
|
async widenConsentGrantScopes(systemAccess, existing, scopes) {
|
|
814
848
|
const merged = Array.from(new Set([...(existing.scopes ?? []), ...scopes]));
|
|
815
|
-
|
|
849
|
+
// The expiry RESTARTS on a widen (#465): a widen only happens because the user approved again,
|
|
850
|
+
// and a re-affirmation that left the old clock running would expire a consent the person gave
|
|
851
|
+
// moments ago. Both callers of this method — the initial-existing path and the
|
|
852
|
+
// concurrency-recovery path — are affirmative acts, so both refresh.
|
|
853
|
+
await systemAccess.updateAsSystem(CoreResourceType.OAUTH_CONSENT_GRANTS, existing._id, {
|
|
854
|
+
scopes: merged,
|
|
855
|
+
expiresAt: this.consentGrantExpiry(),
|
|
856
|
+
});
|
|
816
857
|
// A-3: an existing persistent consent grant was WIDENED (scopes unioned). Shared by the initial-existing
|
|
817
858
|
// path AND the concurrency-recovery path, so both audit the durable-authority change once.
|
|
818
859
|
// assurance-control: WILDO.IDENTITY.DELEGATED_AUTHORIZATION — persistent delegated-access authorization (widen).
|