@wildo-ai/saas-backend-lib 1.1.3 → 1.1.4

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.
Files changed (1056) hide show
  1. package/dist/esm/__tests__/fixture-deep-partial.d.ts.map +1 -1
  2. package/dist/esm/__tests__/integration/redis-integration-gate.d.ts.map +1 -1
  3. package/dist/esm/__tests__/setup.d.ts.map +1 -1
  4. package/dist/esm/__tests__/test-container.d.ts.map +1 -1
  5. package/dist/esm/applications/models/applications.backend.schemas.d.ts.map +1 -1
  6. package/dist/esm/applications/seeds/application-metadata-defaults.seeds.d.ts.map +1 -1
  7. package/dist/esm/applications/services/worker-remote-client-factory.backend.service.d.ts.map +1 -1
  8. package/dist/esm/applications/services/worker-remote-client-factory.backend.service.js.map +1 -1
  9. package/dist/esm/base-classes/models/manual-controllers.backend.definition.d.ts.map +1 -1
  10. package/dist/esm/base-classes/models/manual-controllers.backend.definition.js.map +1 -1
  11. package/dist/esm/base-classes/models/repositories.backend.schemas.d.ts.map +1 -1
  12. package/dist/esm/base-classes/services/__tests__/mock-resource-operation-helper.service.d.ts +1 -1
  13. package/dist/esm/base-classes/services/__tests__/mock-resource-operation-helper.service.d.ts.map +1 -1
  14. package/dist/esm/base-classes/services/batches/batches-cronjobs-custom-execution.service.d.ts.map +1 -1
  15. package/dist/esm/base-classes/services/batches/batches-cronjobs-executor.backend.service.d.ts.map +1 -1
  16. package/dist/esm/base-classes/services/batches/batches-cronjobs-resource-execution.backend.service.d.ts.map +1 -1
  17. package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.d.ts.map +1 -1
  18. package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.js.map +1 -1
  19. package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.d.ts.map +1 -1
  20. package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.js +12 -1
  21. package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.js.map +1 -1
  22. package/dist/esm/base-classes/services/batches/engine-custom-batch-manifests.d.ts.map +1 -1
  23. package/dist/esm/base-classes/services/batches/engine-custom-batch-manifests.js.map +1 -1
  24. package/dist/esm/base-classes/services/batches/resource-retention-sweep.batch.backend.service.d.ts.map +1 -1
  25. package/dist/esm/base-classes/services/batches/suspension-reactivation-sweep.batch.backend.service.d.ts.map +1 -1
  26. package/dist/esm/base-classes/services/controllers/abstract-controller.backend.service.d.ts.map +1 -1
  27. package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.d.ts.map +1 -1
  28. package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.js.map +1 -1
  29. package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.d.ts.map +1 -1
  30. package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.js.map +1 -1
  31. package/dist/esm/base-classes/services/controllers/utils/audit-access-fields.backend.utils.d.ts.map +1 -1
  32. package/dist/esm/base-classes/services/controllers/utils/operation-response-serializer.backend.utils.d.ts.map +1 -1
  33. package/dist/esm/base-classes/services/controllers/validate-field-handler.backend.service.d.ts.map +1 -1
  34. package/dist/esm/base-classes/services/repositories/__tests__/method-span-scan.guard-helpers.d.ts.map +1 -1
  35. package/dist/esm/base-classes/services/repositories/__tests__/mock-repositories-registry-handler.service.d.ts.map +1 -1
  36. package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.d.ts.map +1 -1
  37. package/dist/esm/base-classes/services/repositories/http-api/http-api-filter-translation.backend.d.ts.map +1 -1
  38. package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.d.ts.map +1 -1
  39. package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.js +13 -4
  40. package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.js.map +1 -1
  41. package/dist/esm/base-classes/services/repositories/http-api/http-api-query.backend.d.ts.map +1 -1
  42. package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.d.ts.map +1 -1
  43. package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.js +17 -0
  44. package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.js.map +1 -1
  45. package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.d.ts.map +1 -1
  46. package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.js.map +1 -1
  47. package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.d.ts.map +1 -1
  48. package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.js.map +1 -1
  49. package/dist/esm/base-classes/services/repositories/http-api/http-api-row-projection.backend.d.ts.map +1 -1
  50. package/dist/esm/base-classes/services/repositories/http-api/http-api-subject-erasure-effect.backend.d.ts.map +1 -1
  51. package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.d.ts.map +1 -1
  52. package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.js.map +1 -1
  53. package/dist/esm/base-classes/services/repositories/http-api/odata-query-compiler.backend.d.ts.map +1 -1
  54. package/dist/esm/base-classes/services/repositories/http-api/odoo-jsonrpc-compiler.backend.d.ts.map +1 -1
  55. package/dist/esm/base-classes/services/repositories/http-api/rest-json-query-compiler.backend.d.ts.map +1 -1
  56. package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.d.ts.map +1 -1
  57. package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.js.map +1 -1
  58. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.d.ts.map +1 -1
  59. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.d.ts.map +1 -1
  60. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts +57 -0
  61. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts.map +1 -1
  62. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js +95 -2
  63. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js.map +1 -1
  64. package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.d.ts.map +1 -1
  65. package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js.map +1 -1
  66. package/dist/esm/base-classes/services/repositories/repository-guarded-mutation.backend.types.d.ts.map +1 -1
  67. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts +5 -2
  68. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts.map +1 -1
  69. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js +14 -3
  70. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js.map +1 -1
  71. package/dist/esm/base-classes/services/repositories/repository-version-metadata.backend.utils.d.ts.map +1 -1
  72. package/dist/esm/base-classes/services/repositories/resource-write-integrity.backend.d.ts.map +1 -1
  73. package/dist/esm/base-classes/services/repositories/seed-row-default-materialization.backend.d.ts +72 -0
  74. package/dist/esm/base-classes/services/repositories/seed-row-default-materialization.backend.d.ts.map +1 -0
  75. package/dist/esm/base-classes/services/repositories/seed-row-default-materialization.backend.js +88 -0
  76. package/dist/esm/base-classes/services/repositories/seed-row-default-materialization.backend.js.map +1 -0
  77. package/dist/esm/base-classes/services/repositories/unique-constraint-conflict-reference.backend.d.ts.map +1 -1
  78. package/dist/esm/base-classes/services/resource-operations-helper.backend.service.d.ts.map +1 -1
  79. package/dist/esm/base-classes/services/services/__tests__/mock-services-registry-handler.service.d.ts.map +1 -1
  80. package/dist/esm/base-classes/services/services/__tests__/mock-system-access.service.d.ts.map +1 -1
  81. package/dist/esm/base-classes/services/services/read-only-field-change.backend.utils.d.ts.map +1 -1
  82. package/dist/esm/base-classes/services/services/resource-operation-audit-emission.backend.utils.d.ts.map +1 -1
  83. package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.d.ts.map +1 -1
  84. package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.js.map +1 -1
  85. package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-registry.backend.service.d.ts.map +1 -1
  86. package/dist/esm/base-classes/services/services/resource-operation-custom-implementation.factory.backend.d.ts.map +1 -1
  87. package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.d.ts.map +1 -1
  88. package/dist/esm/base-classes/services/services/resource-operation-server-injected-fields.backend.utils.d.ts.map +1 -1
  89. package/dist/esm/base-classes/services/services/resource-operation-transaction-persistence.backend.utils.d.ts.map +1 -1
  90. package/dist/esm/base-classes/services/services/resource-status-transition.custom-impl.backend.service.d.ts.map +1 -1
  91. package/dist/esm/base-classes/services/services/resource-status-transition.custom-impl.backend.service.js.map +1 -1
  92. package/dist/esm/base-classes/services/services/resource-status-transition.definitions.backend.d.ts.map +1 -1
  93. package/dist/esm/base-classes/services/services/resource-status-transition.definitions.backend.js.map +1 -1
  94. package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.d.ts.map +1 -1
  95. package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js +44 -6
  96. package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js.map +1 -1
  97. package/dist/esm/base-classes/services/services/system-access.backend.service.d.ts.map +1 -1
  98. package/dist/esm/base-classes/services/services/system-access.backend.service.js.map +1 -1
  99. package/dist/esm/base-classes/utils/backend-type-utils.d.ts.map +1 -1
  100. package/dist/esm/base-classes/utils/single-subject-addressing.backend.utils.d.ts.map +1 -1
  101. package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.d.ts.map +1 -1
  102. package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.js.map +1 -1
  103. package/dist/esm/billing/batches/usage-flush.batch.backend.service.d.ts.map +1 -1
  104. package/dist/esm/billing/batches/usage-flush.batch.backend.service.js.map +1 -1
  105. package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.d.ts.map +1 -1
  106. package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.js.map +1 -1
  107. package/dist/esm/billing/services/back-office/abstract-billing.backend.service.d.ts.map +1 -1
  108. package/dist/esm/billing/services/back-office/billing-feature-sync.backend.service.d.ts.map +1 -1
  109. package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.d.ts +1 -1
  110. package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.d.ts.map +1 -1
  111. package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.js +5 -4
  112. package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.js.map +1 -1
  113. package/dist/esm/billing/services/back-office/billing-state.backend.service.d.ts.map +1 -1
  114. package/dist/esm/billing/services/back-office/billing-state.backend.service.js +11 -1
  115. package/dist/esm/billing/services/back-office/billing-state.backend.service.js.map +1 -1
  116. package/dist/esm/billing/services/back-office/billing-subject-erasure-effect.backend.d.ts.map +1 -1
  117. package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.d.ts.map +1 -1
  118. package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.js.map +1 -1
  119. package/dist/esm/billing/services/back-office/usage-metering.backend.service.d.ts.map +1 -1
  120. package/dist/esm/billing/services/back-office/usage-metering.backend.service.js.map +1 -1
  121. package/dist/esm/billing/services/billing-adapter-registry.backend.d.ts.map +1 -1
  122. package/dist/esm/billing/services/billing-adapter-registry.backend.js.map +1 -1
  123. package/dist/esm/billing/services/billing-checkout-metadata.backend.utils.d.ts.map +1 -1
  124. package/dist/esm/billing/services/billing-checkout-metadata.backend.utils.js.map +1 -1
  125. package/dist/esm/billing/services/billing.utils.d.ts.map +1 -1
  126. package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.d.ts.map +1 -1
  127. package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.js.map +1 -1
  128. package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.d.ts +32 -0
  129. package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.d.ts.map +1 -1
  130. package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.js +32 -1
  131. package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.js.map +1 -1
  132. package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.d.ts.map +1 -1
  133. package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.js.map +1 -1
  134. package/dist/esm/billing/services/custom-impl/credit-pool.custom-ops.custom-impl.backend.service.d.ts.map +1 -1
  135. package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.d.ts.map +1 -1
  136. package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.js.map +1 -1
  137. package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.d.ts.map +1 -1
  138. package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.js.map +1 -1
  139. package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.d.ts +9 -6
  140. package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.d.ts.map +1 -1
  141. package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.js +9 -6
  142. package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.js.map +1 -1
  143. package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.d.ts.map +1 -1
  144. package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.js.map +1 -1
  145. package/dist/esm/billing/services/webhooks/billing-webhook-adapter.backend.service.d.ts.map +1 -1
  146. package/dist/esm/billing/services/webhooks/billing-webhook-capability-handler.backend.service.d.ts.map +1 -1
  147. package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.d.ts.map +1 -1
  148. package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.js +50 -3
  149. package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.js.map +1 -1
  150. package/dist/esm/billing/testing/billing-test-fixtures.d.ts.map +1 -1
  151. package/dist/esm/billing/testing/mock-billing-provider.d.ts.map +1 -1
  152. package/dist/esm/billing/testing/mock-billing-provider.js.map +1 -1
  153. package/dist/esm/charts/controllers/chart.backend.controller.d.ts.map +1 -1
  154. package/dist/esm/charts/services/chart-registry.backend.service.d.ts +80 -7
  155. package/dist/esm/charts/services/chart-registry.backend.service.d.ts.map +1 -1
  156. package/dist/esm/charts/services/chart-registry.backend.service.js +115 -8
  157. package/dist/esm/charts/services/chart-registry.backend.service.js.map +1 -1
  158. package/dist/esm/companion-exports.d.ts.map +1 -1
  159. package/dist/esm/compliance/audit-trails/audit-logs.custom-impl.backend.service.d.ts.map +1 -1
  160. package/dist/esm/compliance/audit-trails/batches/audit-logs-archive.batch.backend.service.d.ts.map +1 -1
  161. package/dist/esm/compliance/audit-trails/batches/audit-logs-archive.batch.backend.service.js.map +1 -1
  162. package/dist/esm/compliance/audit-trails/batches/immudb-audit-reconcile.batch.backend.service.d.ts.map +1 -1
  163. package/dist/esm/compliance/audit-trails/batches/siem-webhook-delivery.batch.backend.service.d.ts.map +1 -1
  164. package/dist/esm/compliance/audit-trails/services/__tests__/mock-audit-logs.service.d.ts.map +1 -1
  165. package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.d.ts.map +1 -1
  166. package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.js.map +1 -1
  167. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts +107 -4
  168. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts.map +1 -1
  169. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js +176 -5
  170. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js.map +1 -1
  171. package/dist/esm/compliance/audit-trails/services/composite-audit-log-sink.backend.d.ts.map +1 -1
  172. package/dist/esm/compliance/audit-trails/services/composite-audit-log-sink.backend.js.map +1 -1
  173. package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.d.ts.map +1 -1
  174. package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.js.map +1 -1
  175. package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.d.ts.map +1 -1
  176. package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.js.map +1 -1
  177. package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.d.ts.map +1 -1
  178. package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.js.map +1 -1
  179. package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.d.ts.map +1 -1
  180. package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.js +21 -0
  181. package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.js.map +1 -1
  182. package/dist/esm/compliance/audit-trails/services/utils/ocsf-class-mapping.backend.utils.d.ts.map +1 -1
  183. package/dist/esm/compliance/audit-trails/services/utils/siem-dictionary.backend.utils.d.ts.map +1 -1
  184. package/dist/esm/compliance/audit-trails/services/utils/siem-ocsf-projection.backend.utils.d.ts.map +1 -1
  185. package/dist/esm/compliance/audit-trails/services/utils/siem-projection-contract.backend.utils.d.ts.map +1 -1
  186. package/dist/esm/compliance/audit-trails/utils/audit-actor.backend.utils.d.ts.map +1 -1
  187. package/dist/esm/compliance/audit-trails/utils/layer2-audit-provider-boot-diagnostic.backend.utils.d.ts.map +1 -1
  188. package/dist/esm/compliance/index.d.ts.map +1 -1
  189. package/dist/esm/compliance/privacy/retention-hide-predicate.backend.d.ts.map +1 -1
  190. package/dist/esm/compliance/privacy/services/subject-erasure-external-effects.backend.service.d.ts.map +1 -1
  191. package/dist/esm/compliance/privacy/services/subject-session-revocation.backend.service.d.ts.map +1 -1
  192. package/dist/esm/config/bootstrap/application-runtime-profile.backend.d.ts.map +1 -1
  193. package/dist/esm/config/bootstrap/application-runtime-profile.backend.js.map +1 -1
  194. package/dist/esm/config/bootstrap/minion-initialization-projection.backend.d.ts.map +1 -1
  195. package/dist/esm/config/bootstrap/runtime-principal-attestation.backend.service.d.ts.map +1 -1
  196. package/dist/esm/config/bootstrap/runtime-principal-attestation.backend.service.js +3 -0
  197. package/dist/esm/config/bootstrap/runtime-principal-attestation.backend.service.js.map +1 -1
  198. package/dist/esm/config/bootstrap/runtime-principal.backend.service.d.ts.map +1 -1
  199. package/dist/esm/config/custom/application-config-controller.backend.service.d.ts.map +1 -1
  200. package/dist/esm/config/models/app-config-secrets.backend.schemas.d.ts.map +1 -1
  201. package/dist/esm/config/models/app-config.backend-authored.definitions.d.ts.map +1 -1
  202. package/dist/esm/config/models/app-config.backend.schemas.d.ts +4 -4
  203. package/dist/esm/config/models/app-config.backend.schemas.d.ts.map +1 -1
  204. package/dist/esm/config/models/app-config.backend.schemas.js.map +1 -1
  205. package/dist/esm/config/models/app-env-config.backend.schemas.d.ts.map +1 -1
  206. package/dist/esm/config/models/apps-manager-transport.backend.definitions.d.ts +36 -0
  207. package/dist/esm/config/models/apps-manager-transport.backend.definitions.d.ts.map +1 -0
  208. package/dist/esm/config/models/apps-manager-transport.backend.definitions.js +36 -0
  209. package/dist/esm/config/models/apps-manager-transport.backend.definitions.js.map +1 -0
  210. package/dist/esm/config/models/config-mutation-boundary.utils.d.ts.map +1 -1
  211. package/dist/esm/config/models/postgresql-env-config.backend.schemas.d.ts.map +1 -1
  212. package/dist/esm/config/models/provider-runtime-artifact.backend.schemas.d.ts.map +1 -1
  213. package/dist/esm/config/models/provider-runtime-artifact.backend.schemas.js.map +1 -1
  214. package/dist/esm/config/models/runtime-topology.backend.contracts.d.ts.map +1 -1
  215. package/dist/esm/config/services/__tests__/mock-app-configuration.service.d.ts.map +1 -1
  216. package/dist/esm/config/services/app-configuration-loader.backend.service.d.ts.map +1 -1
  217. package/dist/esm/config/services/app-configuration-loader.backend.service.js +3 -0
  218. package/dist/esm/config/services/app-configuration-loader.backend.service.js.map +1 -1
  219. package/dist/esm/config/services/app-configuration.backend.service.d.ts.map +1 -1
  220. package/dist/esm/config/services/app-configuration.backend.service.js.map +1 -1
  221. package/dist/esm/config/services/app-configuration.backend.utils.d.ts.map +1 -1
  222. package/dist/esm/config/services/app-configuration.backend.utils.js.map +1 -1
  223. package/dist/esm/config/services/application-startup-config-validator.backend.service.d.ts +12 -0
  224. package/dist/esm/config/services/application-startup-config-validator.backend.service.d.ts.map +1 -1
  225. package/dist/esm/config/services/application-startup-config-validator.backend.service.js +28 -0
  226. package/dist/esm/config/services/application-startup-config-validator.backend.service.js.map +1 -1
  227. package/dist/esm/data-seeding/batches/data-seeding-run-cleanup.batch.backend.service.d.ts.map +1 -1
  228. package/dist/esm/data-seeding/batches/data-seeding-scheduled-rerun.batch.backend.service.d.ts.map +1 -1
  229. package/dist/esm/data-seeding/controllers/data-seeding-admin.backend.contracts.d.ts.map +1 -1
  230. package/dist/esm/data-seeding/controllers/data-seeding-admin.backend.controller.d.ts.map +1 -1
  231. package/dist/esm/data-seeding/data-seeding-models.d.ts.map +1 -1
  232. package/dist/esm/data-seeding/models/business-key-resolver.shared.utils.d.ts.map +1 -1
  233. package/dist/esm/data-seeding/models/data-seed-execution-context.shared.types.d.ts.map +1 -1
  234. package/dist/esm/data-seeding/models/data-seed-migrator-runner.shared.utils.d.ts.map +1 -1
  235. package/dist/esm/data-seeding/models/data-seed-reconciler.shared.utils.d.ts.map +1 -1
  236. package/dist/esm/data-seeding/models/data-seed-row-metadata.shared.schemas.d.ts.map +1 -1
  237. package/dist/esm/data-seeding/models/data-seed-row-metadata.shared.utils.d.ts.map +1 -1
  238. package/dist/esm/data-seeding/models/data-seed-run.shared.resources-config.schemas.d.ts.map +1 -1
  239. package/dist/esm/data-seeding/models/data-seed-run.shared.schemas.d.ts.map +1 -1
  240. package/dist/esm/data-seeding/models/data-seed-trigger-mode-matrix.shared.utils.d.ts.map +1 -1
  241. package/dist/esm/data-seeding/models/data-seed.shared.schemas.d.ts.map +1 -1
  242. package/dist/esm/data-seeding/services/data-seed-application-bootstrap.backend.d.ts.map +1 -1
  243. package/dist/esm/data-seeding/services/data-seed-dispatcher.backend.service.d.ts.map +1 -1
  244. package/dist/esm/data-seeding/services/data-seed-registry.backend.service.d.ts.map +1 -1
  245. package/dist/esm/data-seeding/services/data-seed-scope-resolver-registry.backend.service.d.ts.map +1 -1
  246. package/dist/esm/data-seeding/services/engines/additive-seed-engine.backend.service.d.ts.map +1 -1
  247. package/dist/esm/data-seeding/services/engines/lazy-seed-engine.backend.service.d.ts.map +1 -1
  248. package/dist/esm/data-seeding/services/engines/manual-seed-engine.backend.service.d.ts.map +1 -1
  249. package/dist/esm/data-seeding/services/engines/sync-seed-engine.backend.service.d.ts.map +1 -1
  250. package/dist/esm/data-seeding/services/engines/upgrade-seed-engine.backend.service.d.ts.map +1 -1
  251. package/dist/esm/data-seeding/services/shared/data-seed-business-key.shared.utils.d.ts.map +1 -1
  252. package/dist/esm/data-seeding/services/shared/data-seed-error.shared.utils.d.ts.map +1 -1
  253. package/dist/esm/data-seeding/services/shared/data-seed-run-counters.shared.types.d.ts.map +1 -1
  254. package/dist/esm/data-seeding/services/shared/data-seed-run-ledger.backend.d.ts.map +1 -1
  255. package/dist/esm/data-seeding/services/shared/data-seed-scope-anchor.shared.types.d.ts.map +1 -1
  256. package/dist/esm/data-seeding/services/shared/data-seed-scope-iteration.shared.utils.d.ts.map +1 -1
  257. package/dist/esm/data-seeding/services/shared/data-seed-scope-resolution.backend.d.ts.map +1 -1
  258. package/dist/esm/databases/models/aggregation.backend.schemas.d.ts.map +1 -1
  259. package/dist/esm/databases/models/databases.backend.schemas.d.ts.map +1 -1
  260. package/dist/esm/databases/models/filter.backend.schemas.d.ts.map +1 -1
  261. package/dist/esm/databases/models/resolve-persistence-adapter.backend.utils.d.ts.map +1 -1
  262. package/dist/esm/databases/models/sql.backend.schemas.d.ts.map +1 -1
  263. package/dist/esm/databases/models/transaction.shared.schemas.d.ts.map +1 -1
  264. package/dist/esm/databases/services/__tests__/mock-mongo-transaction-registry.service.d.ts.map +1 -1
  265. package/dist/esm/databases/services/__tests__/mock-mongodb.service.d.ts.map +1 -1
  266. package/dist/esm/databases/services/__tests__/mock-mongoose-model.service.d.ts.map +1 -1
  267. package/dist/esm/databases/services/__tests__/mock-redis.service.d.ts.map +1 -1
  268. package/dist/esm/databases/services/__tests__/mock-zod-mongoose-schema-convertor.service.d.ts.map +1 -1
  269. package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.d.ts.map +1 -1
  270. package/dist/esm/databases/services/aggregation/aggregation-query.backend.service.d.ts.map +1 -1
  271. package/dist/esm/databases/services/aggregation/computed-measure-evaluator.backend.service.d.ts.map +1 -1
  272. package/dist/esm/databases/services/aggregation/field-access-validator.backend.service.d.ts.map +1 -1
  273. package/dist/esm/databases/services/aggregation/time-series-densifier.backend.service.d.ts.map +1 -1
  274. package/dist/esm/databases/services/aggregation/topn-processor.backend.service.d.ts.map +1 -1
  275. package/dist/esm/databases/services/aggregation/window-function-processor.backend.service.d.ts.map +1 -1
  276. package/dist/esm/databases/services/db-utils.d.ts.map +1 -1
  277. package/dist/esm/databases/services/mongo-aggregation.backend.service.d.ts.map +1 -1
  278. package/dist/esm/databases/services/mongodb.service.d.ts.map +1 -1
  279. package/dist/esm/databases/services/postgresql-aggregation.backend.service.d.ts.map +1 -1
  280. package/dist/esm/databases/services/postgresql-database.backend.service.d.ts.map +1 -1
  281. package/dist/esm/databases/services/postgresql-development-provisioning.backend.d.ts.map +1 -1
  282. package/dist/esm/databases/services/postgresql-filter.backend.service.d.ts.map +1 -1
  283. package/dist/esm/databases/services/postgresql-migration-runner.backend.d.ts.map +1 -1
  284. package/dist/esm/databases/services/postgresql-schema-ddl.backend.d.ts.map +1 -1
  285. package/dist/esm/databases/services/postgresql-schema-migration-sql.backend.d.ts.map +1 -1
  286. package/dist/esm/databases/services/postgresql-schema-plan-diff.backend.d.ts.map +1 -1
  287. package/dist/esm/databases/services/postgresql-schema-plan-diff.backend.js.map +1 -1
  288. package/dist/esm/databases/services/postgresql-schema-plan-lockfile.backend.d.ts.map +1 -1
  289. package/dist/esm/databases/services/redis.service.d.ts.map +1 -1
  290. package/dist/esm/databases/services/resource-persistence-unit-of-work.backend.service.d.ts.map +1 -1
  291. package/dist/esm/databases/services/schema-planning-standalone.backend.d.ts.map +1 -1
  292. package/dist/esm/databases/services/zod-to-mongoose-schema-convertor.backend.service.d.ts.map +1 -1
  293. package/dist/esm/databases/services/zod-to-sql-hybrid-schema.planner.d.ts.map +1 -1
  294. package/dist/esm/databases/utils/postgresql-identifier.backend.utils.d.ts.map +1 -1
  295. package/dist/esm/errors/services/__tests__/mock-error-builder.service.d.ts.map +1 -1
  296. package/dist/esm/errors/services/error-builder.backend.service.d.ts.map +1 -1
  297. package/dist/esm/errors/services/error-builder.backend.service.js.map +1 -1
  298. package/dist/esm/errors/services/error-handler.backend.service.d.ts.map +1 -1
  299. package/dist/esm/errors/services/error-handler.backend.service.js.map +1 -1
  300. package/dist/esm/errors/services/rate-limit.backend.service.d.ts.map +1 -1
  301. package/dist/esm/errors/services/rate-limit.backend.service.js.map +1 -1
  302. package/dist/esm/errors/utils/error-log-level-classification.backend.utils.d.ts.map +1 -1
  303. package/dist/esm/errors/utils/error-log-level-classification.backend.utils.js.map +1 -1
  304. package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.d.ts.map +1 -1
  305. package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.js.map +1 -1
  306. package/dist/esm/external-data/batches/external-data-pipeline-scheduled-run.batch.backend.service.d.ts.map +1 -1
  307. package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.d.ts.map +1 -1
  308. package/dist/esm/external-data/controllers/external-data-admin.backend.controller.d.ts.map +1 -1
  309. package/dist/esm/external-data/external-data-extraction-source.backend.d.ts.map +1 -1
  310. package/dist/esm/external-data/external-data-models.exports.d.ts.map +1 -1
  311. package/dist/esm/external-data/external-data-pipeline-run.backend.service.d.ts.map +1 -1
  312. package/dist/esm/external-data/external-data-pipeline-run.backend.service.js.map +1 -1
  313. package/dist/esm/external-data/external-data-transform.backend.d.ts.map +1 -1
  314. package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.d.ts.map +1 -1
  315. package/dist/esm/external-providers/models/external-providers.backend.schemas.d.ts.map +1 -1
  316. package/dist/esm/external-providers/models/provider-selection-resolution-evidence.backend.definitions.d.ts.map +1 -1
  317. package/dist/esm/external-providers/models/provider-selection-resolution-evidence.backend.definitions.js.map +1 -1
  318. package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.d.ts +102 -52
  319. package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.d.ts.map +1 -1
  320. package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.js +117 -71
  321. package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.js.map +1 -1
  322. package/dist/esm/external-providers/operations/provider-operation-request.backend.d.ts.map +1 -1
  323. package/dist/esm/external-providers/operations/provider-operation-request.backend.js.map +1 -1
  324. package/dist/esm/external-providers/operations/provider-request-signing.backend.d.ts.map +1 -1
  325. package/dist/esm/external-providers/operations/provider-request-signing.backend.js +26 -7
  326. package/dist/esm/external-providers/operations/provider-request-signing.backend.js.map +1 -1
  327. package/dist/esm/external-providers/operations/provider-rest-call-client.backend.d.ts.map +1 -1
  328. package/dist/esm/external-providers/operations/provider-rest-call-client.backend.js.map +1 -1
  329. package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.d.ts.map +1 -1
  330. package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.js.map +1 -1
  331. package/dist/esm/external-providers/services/backend-provider-loader.backend.service.d.ts.map +1 -1
  332. package/dist/esm/external-providers/services/backend-provider-loader.backend.service.js.map +1 -1
  333. package/dist/esm/external-providers/services/backend-provider-registry.backend.service.d.ts.map +1 -1
  334. package/dist/esm/external-providers/services/backend-provider-registry.backend.service.js.map +1 -1
  335. package/dist/esm/external-providers/services/document-extraction.backend.service.d.ts +81 -34
  336. package/dist/esm/external-providers/services/document-extraction.backend.service.d.ts.map +1 -1
  337. package/dist/esm/external-providers/services/document-extraction.backend.service.js +179 -98
  338. package/dist/esm/external-providers/services/document-extraction.backend.service.js.map +1 -1
  339. package/dist/esm/external-providers/services/embeddings.backend.service.d.ts.map +1 -1
  340. package/dist/esm/external-providers/services/embeddings.backend.service.js.map +1 -1
  341. package/dist/esm/external-providers/services/external-api-handler.backend.service.d.ts.map +1 -1
  342. package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts +121 -0
  343. package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts.map +1 -1
  344. package/dist/esm/external-providers/services/external-providers-registry.backend.service.js +151 -0
  345. package/dist/esm/external-providers/services/external-providers-registry.backend.service.js.map +1 -1
  346. package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.d.ts +15 -1
  347. package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.d.ts.map +1 -1
  348. package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.js +60 -4
  349. package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.js.map +1 -1
  350. package/dist/esm/features/controllers/features.backend.controller.d.ts.map +1 -1
  351. package/dist/esm/features/services/__tests__/mock-feature-definition-registry.service.d.ts.map +1 -1
  352. package/dist/esm/features/services/__tests__/mock-feature-resolution.service.d.ts.map +1 -1
  353. package/dist/esm/features/services/application-features-admin-write-path.custom-impl.backend.service.d.ts.map +1 -1
  354. package/dist/esm/features/services/feature-definition-registry.backend.service.d.ts.map +1 -1
  355. package/dist/esm/features/services/feature-gate.backend.service.d.ts.map +1 -1
  356. package/dist/esm/features/services/feature-resolution.backend.service.d.ts.map +1 -1
  357. package/dist/esm/features/services/organization-features-admin-write-path.custom-impl.backend.service.d.ts.map +1 -1
  358. package/dist/esm/features/services/scope-feature-ledger-relationship.backend.utils.d.ts.map +1 -1
  359. package/dist/esm/features/services/scope-features-cache-invalidation.custom-impl.backend.service.d.ts.map +1 -1
  360. package/dist/esm/features/testing/feature-test-utils.d.ts.map +1 -1
  361. package/dist/esm/files/batches/files-cleanup.batch.backend.service.d.ts.map +1 -1
  362. package/dist/esm/files/constraints/file-analyzers.types.d.ts.map +1 -1
  363. package/dist/esm/files/constraints/file-constraint-resolver-chain.backend.service.d.ts.map +1 -1
  364. package/dist/esm/files/constraints/file-constraint.types.d.ts.map +1 -1
  365. package/dist/esm/files/constraints/file-validation.backend.service.d.ts.map +1 -1
  366. package/dist/esm/files/constraints/resource-field-constraint-resolver.backend.service.d.ts.map +1 -1
  367. package/dist/esm/files/controllers/file.controller.d.ts.map +1 -1
  368. package/dist/esm/files/controllers/file.controller.js.map +1 -1
  369. package/dist/esm/files/handlers/file-upload-route-locals.backend.types.d.ts.map +1 -1
  370. package/dist/esm/files/handlers/file-upload-route-locals.backend.types.js.map +1 -1
  371. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts +37 -0
  372. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts.map +1 -1
  373. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js +221 -21
  374. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js.map +1 -1
  375. package/dist/esm/files/scanning/clamav-scanner.backend.service.d.ts.map +1 -1
  376. package/dist/esm/files/scanning/file-scan.types.d.ts.map +1 -1
  377. package/dist/esm/files/scanning/yara-scanner.backend.service.d.ts.map +1 -1
  378. package/dist/esm/files/scanning/yara-scanner.backend.service.js +20 -2
  379. package/dist/esm/files/scanning/yara-scanner.backend.service.js.map +1 -1
  380. package/dist/esm/files/services/__tests__/mock-file-field-detection.service.d.ts.map +1 -1
  381. package/dist/esm/files/services/__tests__/mock-file-operation-handler.service.d.ts.map +1 -1
  382. package/dist/esm/files/services/__tests__/mock-file-repository.service.d.ts.map +1 -1
  383. package/dist/esm/files/services/file-field-detection.backend.service.d.ts.map +1 -1
  384. package/dist/esm/files/services/file-operation-handler.backend.service.d.ts.map +1 -1
  385. package/dist/esm/files/services/file-operation-handler.backend.service.js.map +1 -1
  386. package/dist/esm/files/services/file-population.backend.service.d.ts.map +1 -1
  387. package/dist/esm/files/services/file-scanning.backend.service.d.ts.map +1 -1
  388. package/dist/esm/files/services/file-scanning.backend.service.js +5 -0
  389. package/dist/esm/files/services/file-scanning.backend.service.js.map +1 -1
  390. package/dist/esm/files/services/file-text-extraction.backend.service.d.ts.map +1 -1
  391. package/dist/esm/files/services/file-text-extraction.backend.service.js +8 -5
  392. package/dist/esm/files/services/file-text-extraction.backend.service.js.map +1 -1
  393. package/dist/esm/files/services/file-upload-grant.backend.service.d.ts.map +1 -1
  394. package/dist/esm/files/services/file-upload-grant.backend.service.js.map +1 -1
  395. package/dist/esm/files/services/files.backend.service.d.ts.map +1 -1
  396. package/dist/esm/files/services/files.backend.service.js +3 -1
  397. package/dist/esm/files/services/files.backend.service.js.map +1 -1
  398. package/dist/esm/files/services/rag-source-field-detection.backend.service.d.ts.map +1 -1
  399. package/dist/esm/files/storage/application-storage-key.backend.utils.d.ts.map +1 -1
  400. package/dist/esm/files/storage/application-storage-key.backend.utils.js.map +1 -1
  401. package/dist/esm/files/storage/file-storage-path-resolver.backend.service.d.ts.map +1 -1
  402. package/dist/esm/files/storage/file-storage-provider.types.d.ts +36 -1
  403. package/dist/esm/files/storage/file-storage-provider.types.d.ts.map +1 -1
  404. package/dist/esm/files/storage/file-storage-provider.types.js.map +1 -1
  405. package/dist/esm/files/storage/file-storage-router.backend.service.d.ts +21 -3
  406. package/dist/esm/files/storage/file-storage-router.backend.service.d.ts.map +1 -1
  407. package/dist/esm/files/storage/file-storage-router.backend.service.js +38 -5
  408. package/dist/esm/files/storage/file-storage-router.backend.service.js.map +1 -1
  409. package/dist/esm/files/storage/google-drive-storage-provider.backend.service.d.ts +87 -0
  410. package/dist/esm/files/storage/google-drive-storage-provider.backend.service.d.ts.map +1 -0
  411. package/dist/esm/files/storage/google-drive-storage-provider.backend.service.js +340 -0
  412. package/dist/esm/files/storage/google-drive-storage-provider.backend.service.js.map +1 -0
  413. package/dist/esm/files/storage/local-directory-storage-provider.backend.service.d.ts.map +1 -1
  414. package/dist/esm/files/storage/local-directory-storage-provider.backend.service.js.map +1 -1
  415. package/dist/esm/files/storage/storage-credential-provider.backend.utils.d.ts.map +1 -1
  416. package/dist/esm/files/storage/storage-platform-sts-credential-resolver.backend.utils.d.ts.map +1 -1
  417. package/dist/esm/files/storage/storage-sts-credential-resolver.backend.utils.d.ts.map +1 -1
  418. package/dist/esm/files/storage/storage-sts-credential-resolver.backend.utils.js +10 -3
  419. package/dist/esm/files/storage/storage-sts-credential-resolver.backend.utils.js.map +1 -1
  420. package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.d.ts.map +1 -1
  421. package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.js.map +1 -1
  422. package/dist/esm/files/utils/file-field-schema-path.backend.utils.d.ts.map +1 -1
  423. package/dist/esm/files/utils/file-field-schema-path.backend.utils.js.map +1 -1
  424. package/dist/esm/files/utils/file-upload.utils.d.ts.map +1 -1
  425. package/dist/esm/files/utils/file-uploader.utils.d.ts.map +1 -1
  426. package/dist/esm/files/utils/file-uploader.utils.js.map +1 -1
  427. package/dist/esm/files/utils/file-validation.utils.d.ts.map +1 -1
  428. package/dist/esm/files/utils/image-derivation.backend.utils.d.ts.map +1 -1
  429. package/dist/esm/files/utils/image-thumbnail.backend.utils.d.ts.map +1 -1
  430. package/dist/esm/files/utils/office-document-text-extraction.backend.utils.d.ts.map +1 -1
  431. package/dist/esm/files/utils/office-document-text-extraction.backend.utils.js.map +1 -1
  432. package/dist/esm/files/utils/rag-source-field-schema-path.backend.utils.d.ts.map +1 -1
  433. package/dist/esm/files/utils/storage-application-identity.backend.utils.d.ts.map +1 -1
  434. package/dist/esm/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service.d.ts.map +1 -1
  435. package/dist/esm/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service.js.map +1 -1
  436. package/dist/esm/flows-actors/a2a/batches/a2a-push-delivery.batch.backend.service.d.ts.map +1 -1
  437. package/dist/esm/flows-actors/a2a/controllers/a2a.controller.d.ts.map +1 -1
  438. package/dist/esm/flows-actors/a2a/controllers/a2a.controller.js.map +1 -1
  439. package/dist/esm/flows-actors/a2a/models/a2a-dialect.backend.schemas.d.ts.map +1 -1
  440. package/dist/esm/flows-actors/a2a/models/a2a-push-notification-delivery.backend.utils.d.ts.map +1 -1
  441. package/dist/esm/flows-actors/a2a/models/a2a-push-notification.backend.schemas.d.ts.map +1 -1
  442. package/dist/esm/flows-actors/a2a/models/a2a.backend.schemas.d.ts.map +1 -1
  443. package/dist/esm/flows-actors/a2a/models/a2a.backend.schemas.js.map +1 -1
  444. package/dist/esm/flows-actors/a2a/services/a2a-push-delivery-log.repository.d.ts.map +1 -1
  445. package/dist/esm/flows-actors/a2a/services/a2a-push-dispatcher.backend.service.d.ts.map +1 -1
  446. package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.d.ts.map +1 -1
  447. package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.js.map +1 -1
  448. package/dist/esm/flows-actors/a2a/services/a2a-task.backend.service.d.ts.map +1 -1
  449. package/dist/esm/flows-actors/a2a/services/a2a-task.backend.service.js.map +1 -1
  450. package/dist/esm/flows-actors/a2a/services/a2a-token-budget.backend.service.d.ts.map +1 -1
  451. package/dist/esm/flows-actors/a2a/services/a2a-token-budget.backend.service.js.map +1 -1
  452. package/dist/esm/flows-actors/a2a/services/a2a.backend.service.d.ts.map +1 -1
  453. package/dist/esm/flows-actors/a2a/services/a2a.backend.service.js.map +1 -1
  454. package/dist/esm/flows-actors/controllers/flows-actors.controller.d.ts.map +1 -1
  455. package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.d.ts.map +1 -1
  456. package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.js.map +1 -1
  457. package/dist/esm/flows-actors/models/agent-facets.backend.definitions.d.ts.map +1 -1
  458. package/dist/esm/flows-actors/models/agents.backend.definitions.d.ts.map +1 -1
  459. package/dist/esm/flows-actors/models/core-facets.backend.definitions.d.ts.map +1 -1
  460. package/dist/esm/flows-actors/models/core-facets.backend.definitions.js.map +1 -1
  461. package/dist/esm/flows-actors/models/flows-actors.backend.definitions.d.ts.map +1 -1
  462. package/dist/esm/flows-actors/models/flows-actors.backend.schemas.d.ts.map +1 -1
  463. package/dist/esm/flows-actors/models/flows-actors.backend.schemas.js.map +1 -1
  464. package/dist/esm/flows-actors/models/function-tools.backend.definitions.d.ts +107 -16
  465. package/dist/esm/flows-actors/models/function-tools.backend.definitions.d.ts.map +1 -1
  466. package/dist/esm/flows-actors/models/function-tools.backend.definitions.js +118 -18
  467. package/dist/esm/flows-actors/models/function-tools.backend.definitions.js.map +1 -1
  468. package/dist/esm/flows-actors/models/market-generation.actors-system.backend.definitions.d.ts.map +1 -1
  469. package/dist/esm/flows-actors/models/market-generation.actors-system.backend.definitions.js.map +1 -1
  470. package/dist/esm/flows-actors/models/mcp-client.backend.definitions.d.ts.map +1 -1
  471. package/dist/esm/flows-actors/models/mcp-client.backend.definitions.js.map +1 -1
  472. package/dist/esm/flows-actors/services/__tests__/fixtures/meta-workflow-evaluation-treatment.test-fixture.d.ts.map +1 -1
  473. package/dist/esm/flows-actors/services/actors-system.backend.service.d.ts.map +1 -1
  474. package/dist/esm/flows-actors/services/actors-system.backend.service.js.map +1 -1
  475. package/dist/esm/flows-actors/services/agent-call-trace-sink.backend.d.ts.map +1 -1
  476. package/dist/esm/flows-actors/services/agent-facets.backend.service.d.ts.map +1 -1
  477. package/dist/esm/flows-actors/services/agents.backend.service.d.ts +104 -5
  478. package/dist/esm/flows-actors/services/agents.backend.service.d.ts.map +1 -1
  479. package/dist/esm/flows-actors/services/agents.backend.service.js +263 -31
  480. package/dist/esm/flows-actors/services/agents.backend.service.js.map +1 -1
  481. package/dist/esm/flows-actors/services/context-curation.backend.service.d.ts.map +1 -1
  482. package/dist/esm/flows-actors/services/conversational-execution.backend.service.d.ts +46 -1
  483. package/dist/esm/flows-actors/services/conversational-execution.backend.service.d.ts.map +1 -1
  484. package/dist/esm/flows-actors/services/conversational-execution.backend.service.js +193 -6
  485. package/dist/esm/flows-actors/services/conversational-execution.backend.service.js.map +1 -1
  486. package/dist/esm/flows-actors/services/flows-actors-registry.service.d.ts.map +1 -1
  487. package/dist/esm/flows-actors/services/flows-actors-registry.service.js.map +1 -1
  488. package/dist/esm/flows-actors/services/flows.backend.services.d.ts.map +1 -1
  489. package/dist/esm/flows-actors/services/flows.backend.services.js.map +1 -1
  490. package/dist/esm/flows-actors/services/llm-observability-agent-call-trace-sink.backend.d.ts.map +1 -1
  491. package/dist/esm/flows-actors/services/llm-observability-agent-call-trace-sink.backend.js.map +1 -1
  492. package/dist/esm/flows-actors/services/mcp-client.backend.service.d.ts.map +1 -1
  493. package/dist/esm/flows-actors/services/mcp-client.backend.service.js +3 -0
  494. package/dist/esm/flows-actors/services/mcp-client.backend.service.js.map +1 -1
  495. package/dist/esm/flows-actors/services/mcp-credential-resolver.backend.service.d.ts +99 -0
  496. package/dist/esm/flows-actors/services/mcp-credential-resolver.backend.service.d.ts.map +1 -0
  497. package/dist/esm/flows-actors/services/mcp-credential-resolver.backend.service.js +155 -0
  498. package/dist/esm/flows-actors/services/mcp-credential-resolver.backend.service.js.map +1 -0
  499. package/dist/esm/flows-actors/services/meta-workflow-evaluation-treatment-compiler.backend.service.d.ts.map +1 -1
  500. package/dist/esm/flows-actors/services/meta-workflow-standard-action-contracts.backend.service.d.ts.map +1 -1
  501. package/dist/esm/flows-actors/services/meta-workflow-standard-evaluation-contracts.backend.service.d.ts.map +1 -1
  502. package/dist/esm/flows-actors/services/meta-workflow-structured-artifact-action-compiler.backend.service.d.ts.map +1 -1
  503. package/dist/esm/flows-actors/services/prompt-compiler.backend.service.d.ts.map +1 -1
  504. package/dist/esm/flows-actors/services/prompt-compiler.backend.service.js.map +1 -1
  505. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.d.ts.map +1 -1
  506. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js +9 -0
  507. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js.map +1 -1
  508. package/dist/esm/flows-actors/utils/bounded-subprocess.backend.utils.d.ts.map +1 -1
  509. package/dist/esm/flows-actors/utils/flows-actors-frontend-extractor.utils.d.ts.map +1 -1
  510. package/dist/esm/flows-actors/utils/meta-workflow-canonical-json.backend.utils.d.ts.map +1 -1
  511. package/dist/esm/flows-actors/utils/meta-workflow-canonical-json.backend.utils.js.map +1 -1
  512. package/dist/esm/flows-actors/utils/meta-workflow-structured-generation-plan.backend.utils.d.ts.map +1 -1
  513. package/dist/esm/flows-actors/utils/meta-workflow-structured-generation-plan.backend.utils.js.map +1 -1
  514. package/dist/esm/flows-actors/utils/prompt-ir-adapters.backend.utils.d.ts.map +1 -1
  515. package/dist/esm/flows-actors/utils/tool-approval-modification.backend.utils.d.ts +77 -0
  516. package/dist/esm/flows-actors/utils/tool-approval-modification.backend.utils.d.ts.map +1 -0
  517. package/dist/esm/flows-actors/utils/tool-approval-modification.backend.utils.js +164 -0
  518. package/dist/esm/flows-actors/utils/tool-approval-modification.backend.utils.js.map +1 -0
  519. package/dist/esm/flows-actors/utils/tool-approval-signing.backend.utils.d.ts +48 -0
  520. package/dist/esm/flows-actors/utils/tool-approval-signing.backend.utils.d.ts.map +1 -0
  521. package/dist/esm/flows-actors/utils/tool-approval-signing.backend.utils.js +101 -0
  522. package/dist/esm/flows-actors/utils/tool-approval-signing.backend.utils.js.map +1 -0
  523. package/dist/esm/guidance/batches/dormancy-detection.batch.backend.service.d.ts.map +1 -1
  524. package/dist/esm/guidance/services/guidance-trigger-evaluator.backend.service.d.ts.map +1 -1
  525. package/dist/esm/guidance/services/lifecycle-custom-implementations.backend.d.ts.map +1 -1
  526. package/dist/esm/guidance/services/lifecycle-evaluator.backend.service.d.ts.map +1 -1
  527. package/dist/esm/guidance/services/lifecycle-scope-id.backend.utils.d.ts.map +1 -1
  528. package/dist/esm/guidance/services/milestone-condition-registry.backend.service.d.ts.map +1 -1
  529. package/dist/esm/guidance/services/milestone-definition-registry.backend.service.d.ts.map +1 -1
  530. package/dist/esm/guidance/services/milestone-evaluator.backend.service.d.ts.map +1 -1
  531. package/dist/esm/guidance/services/milestone-evaluator.backend.service.js.map +1 -1
  532. package/dist/esm/guidance/services/progression-state-store.backend.service.d.ts.map +1 -1
  533. package/dist/esm/guidance/services/progression-state-store.backend.service.js.map +1 -1
  534. package/dist/esm/guidance/services/scoped-state-read-custom-implementations.backend.d.ts.map +1 -1
  535. package/dist/esm/i18n/controllers/i18n-controller.backend.service.d.ts.map +1 -1
  536. package/dist/esm/i18n/controllers/i18n-controller.backend.service.js.map +1 -1
  537. package/dist/esm/i18n/services/i18n.backend.service.d.ts.map +1 -1
  538. package/dist/esm/index.d.ts +0 -1
  539. package/dist/esm/index.d.ts.map +1 -1
  540. package/dist/esm/index.js +0 -1
  541. package/dist/esm/index.js.map +1 -1
  542. package/dist/esm/inject/models/container.d.ts +10 -0
  543. package/dist/esm/inject/models/container.d.ts.map +1 -1
  544. package/dist/esm/inject/models/container.js +49 -1
  545. package/dist/esm/inject/models/container.js.map +1 -1
  546. package/dist/esm/inject/models/service-types.d.ts +3 -0
  547. package/dist/esm/inject/models/service-types.d.ts.map +1 -1
  548. package/dist/esm/inject/models/service-types.js +3 -0
  549. package/dist/esm/inject/models/service-types.js.map +1 -1
  550. package/dist/esm/mcp/controllers/mcp.controller.d.ts.map +1 -1
  551. package/dist/esm/mcp/controllers/mcp.controller.js +50 -3
  552. package/dist/esm/mcp/controllers/mcp.controller.js.map +1 -1
  553. package/dist/esm/mcp/models/mcp-protocol.backend.schemas.d.ts.map +1 -1
  554. package/dist/esm/mcp/models/mcp-tool.backend.schemas.d.ts.map +1 -1
  555. package/dist/esm/mcp/models/mcp-tool.backend.schemas.js.map +1 -1
  556. package/dist/esm/mcp/services/mcp-server.backend.service.d.ts.map +1 -1
  557. package/dist/esm/mcp/services/mcp-server.backend.service.js.map +1 -1
  558. package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.d.ts.map +1 -1
  559. package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.js.map +1 -1
  560. package/dist/esm/mcp/services/resource-server-instances-registry.backend.service.d.ts.map +1 -1
  561. package/dist/esm/mcp/utils/zod-to-mcp-json-schema.backend.utils.d.ts.map +1 -1
  562. package/dist/esm/meta-workflow-runtime.exports.d.ts.map +1 -1
  563. package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.d.ts.map +1 -1
  564. package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.js.map +1 -1
  565. package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.d.ts.map +1 -1
  566. package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.js.map +1 -1
  567. package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.d.ts.map +1 -1
  568. package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.js.map +1 -1
  569. package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.d.ts.map +1 -1
  570. package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.js.map +1 -1
  571. package/dist/esm/monitoring/logger/models/logger.backend.schemas.d.ts.map +1 -1
  572. package/dist/esm/monitoring/logger/models/logger.backend.schemas.js.map +1 -1
  573. package/dist/esm/monitoring/logger/services/__tests__/mock-logger.service.d.ts.map +1 -1
  574. package/dist/esm/monitoring/logger/services/logger.service.d.ts +12 -0
  575. package/dist/esm/monitoring/logger/services/logger.service.d.ts.map +1 -1
  576. package/dist/esm/monitoring/logger/services/logger.service.js +3 -3
  577. package/dist/esm/monitoring/logger/services/logger.service.js.map +1 -1
  578. package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.d.ts.map +1 -1
  579. package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.js.map +1 -1
  580. package/dist/esm/monitoring/logger/utils/log-value-normalization.backend.utils.d.ts.map +1 -1
  581. package/dist/esm/monitoring/observability/audit-observation-emission.backend.d.ts +10 -6
  582. package/dist/esm/monitoring/observability/audit-observation-emission.backend.d.ts.map +1 -1
  583. package/dist/esm/monitoring/observability/audit-observation-emission.backend.js +10 -6
  584. package/dist/esm/monitoring/observability/audit-observation-emission.backend.js.map +1 -1
  585. package/dist/esm/monitoring/observability/models/observability.backend.schemas.d.ts.map +1 -1
  586. package/dist/esm/monitoring/observability/models/observability.backend.schemas.js.map +1 -1
  587. package/dist/esm/monitoring/observability/otel-preload.d.ts.map +1 -1
  588. package/dist/esm/monitoring/observability/otel-sdk-global-handle.d.ts.map +1 -1
  589. package/dist/esm/monitoring/observability/services/__tests__/mock-metrics.service.d.ts.map +1 -1
  590. package/dist/esm/monitoring/observability/services/metrics.service.d.ts.map +1 -1
  591. package/dist/esm/monitoring/observability/services/metrics.service.js.map +1 -1
  592. package/dist/esm/monitoring/observability/services/observability.backend.service.d.ts.map +1 -1
  593. package/dist/esm/notifications/email/components/email-components.d.ts.map +1 -1
  594. package/dist/esm/notifications/email/models/email-template-definition.d.ts.map +1 -1
  595. package/dist/esm/notifications/email/models/email-transport.backend.definitions.d.ts.map +1 -1
  596. package/dist/esm/notifications/email/services/email-batch-send.batch.backend.service.d.ts.map +1 -1
  597. package/dist/esm/notifications/email/services/email-template-registry.backend.service.d.ts.map +1 -1
  598. package/dist/esm/notifications/email/services/email-template-registry.backend.service.js.map +1 -1
  599. package/dist/esm/notifications/email/services/email-template-validator.backend.service.d.ts.map +1 -1
  600. package/dist/esm/notifications/email/services/email-template-validator.backend.service.js.map +1 -1
  601. package/dist/esm/notifications/email/services/email.backend.service.d.ts +47 -6
  602. package/dist/esm/notifications/email/services/email.backend.service.d.ts.map +1 -1
  603. package/dist/esm/notifications/email/services/email.backend.service.js +86 -36
  604. package/dist/esm/notifications/email/services/email.backend.service.js.map +1 -1
  605. package/dist/esm/notifications/email/utils/color-conversion.utils.d.ts.map +1 -1
  606. package/dist/esm/notifications/email/utils/color-conversion.utils.js.map +1 -1
  607. package/dist/esm/notifications/email/utils/interpolate-email-label.utils.d.ts.map +1 -1
  608. package/dist/esm/notifications/email/utils/zod-to-typescript.utils.d.ts.map +1 -1
  609. package/dist/esm/notifications/services/notification-badge.backend.service.d.ts.map +1 -1
  610. package/dist/esm/notifications/services/notification-badge.backend.service.js.map +1 -1
  611. package/dist/esm/notifications/services/notifications-dispatcher.backend.service.d.ts.map +1 -1
  612. package/dist/esm/notifications/services/notifications-dispatcher.backend.service.js.map +1 -1
  613. package/dist/esm/notifications/sms/models/sms-transport.backend.definitions.d.ts +32 -0
  614. package/dist/esm/notifications/sms/models/sms-transport.backend.definitions.d.ts.map +1 -0
  615. package/dist/esm/notifications/sms/models/sms-transport.backend.definitions.js +32 -0
  616. package/dist/esm/notifications/sms/models/sms-transport.backend.definitions.js.map +1 -0
  617. package/dist/esm/notifications/sms/services/sms.backend.service.d.ts +64 -10
  618. package/dist/esm/notifications/sms/services/sms.backend.service.d.ts.map +1 -1
  619. package/dist/esm/notifications/sms/services/sms.backend.service.js +277 -82
  620. package/dist/esm/notifications/sms/services/sms.backend.service.js.map +1 -1
  621. package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.d.ts.map +1 -1
  622. package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.js.map +1 -1
  623. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.d.ts.map +1 -1
  624. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.js.map +1 -1
  625. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.d.ts.map +1 -1
  626. package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.d.ts.map +1 -1
  627. package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.js.map +1 -1
  628. package/dist/esm/notifications/webhooks/outbound/services/m2m-webhook-delivery-log.custom-impl.backend.service.d.ts.map +1 -1
  629. package/dist/esm/notifications/webhooks/outbound/services/m2m-webhook-delivery-log.repository.d.ts.map +1 -1
  630. package/dist/esm/notifications/webhooks/outbound/services/m2m-webhook-dispatcher.backend.service.d.ts.map +1 -1
  631. package/dist/esm/notifications/webhooks/outbound/services/webhook-config-public-key.custom-impl.backend.service.d.ts.map +1 -1
  632. package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.d.ts.map +1 -1
  633. package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.js.map +1 -1
  634. package/dist/esm/notifications/webhooks/outbound/services/webhook-config.backend.service.d.ts.map +1 -1
  635. package/dist/esm/notifications/webhooks/services/polymorphic-lookup.backend.service.d.ts.map +1 -1
  636. package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.d.ts.map +1 -1
  637. package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.js.map +1 -1
  638. package/dist/esm/organizations/batches/organization-member-invitation-sweep.batch.backend.service.d.ts.map +1 -1
  639. package/dist/esm/organizations/batches/organization-purge.batch.backend.service.d.ts.map +1 -1
  640. package/dist/esm/organizations/batches/organization-purge.batch.backend.service.js.map +1 -1
  641. package/dist/esm/organizations/services/authority-change-audit.backend.utils.d.ts.map +1 -1
  642. package/dist/esm/organizations/services/invitation-acceptance.backend.utils.d.ts.map +1 -1
  643. package/dist/esm/organizations/services/org-creation-on-registration.backend.utils.d.ts.map +1 -1
  644. package/dist/esm/organizations/services/org-member-roles-validation.backend.utils.d.ts.map +1 -1
  645. package/dist/esm/organizations/services/organization-custom-implementation.backend.service.d.ts.map +1 -1
  646. package/dist/esm/organizations/services/organization-custom-implementation.backend.service.js.map +1 -1
  647. package/dist/esm/organizations/services/organization-deletion-audit.custom-impl.backend.service.d.ts.map +1 -1
  648. package/dist/esm/organizations/services/organization-member-custom-implementation.backend.service.d.ts.map +1 -1
  649. package/dist/esm/organizations/services/organization-onboarding-operation.backend.utils.d.ts.map +1 -1
  650. package/dist/esm/organizations/services/organization-unit-custom-implementation.backend.service.d.ts.map +1 -1
  651. package/dist/esm/organizations/services/organization-unit-member-custom-implementation.backend.service.d.ts.map +1 -1
  652. package/dist/esm/organizations/services/scim-provisioning-gate.backend.utils.d.ts.map +1 -1
  653. package/dist/esm/organizations/services/user-org-type-grant.backend.utils.d.ts.map +1 -1
  654. package/dist/esm/organizations/services/user-type-revocation-on-org-leave.backend.utils.d.ts.map +1 -1
  655. package/dist/esm/pdf-templates/__tests__/fixtures/tiny-pdf-template.fixture.d.ts.map +1 -1
  656. package/dist/esm/pdf-templates/models/pdf-template-binding.d.ts.map +1 -1
  657. package/dist/esm/pdf-templates/models/pdf-template-definition.d.ts.map +1 -1
  658. package/dist/esm/pdf-templates/services/pdf-generated-file-writer.backend.service.d.ts.map +1 -1
  659. package/dist/esm/pdf-templates/services/pdf-generation-orchestrator.backend.service.d.ts.map +1 -1
  660. package/dist/esm/pdf-templates/services/pdf-renderer.backend.service.d.ts.map +1 -1
  661. package/dist/esm/pdf-templates/services/pdf-template-binding.backend.service.d.ts.map +1 -1
  662. package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.d.ts.map +1 -1
  663. package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.js.map +1 -1
  664. package/dist/esm/queue/adapters/queue-adapter.backend.binding.d.ts.map +1 -1
  665. package/dist/esm/queue/adapters/queue-adapter.backend.binding.js.map +1 -1
  666. package/dist/esm/queue/adapters/queue-adapter.backend.interface.d.ts.map +1 -1
  667. package/dist/esm/queue/adapters/queue-adapter.backend.interface.js.map +1 -1
  668. package/dist/esm/queue/adapters/queue-adapter.backend.options.d.ts.map +1 -1
  669. package/dist/esm/queue/adapters/queue-adapter.backend.options.js.map +1 -1
  670. package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.d.ts.map +1 -1
  671. package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.js.map +1 -1
  672. package/dist/esm/queue/apps-crontabs-manager.backend.service.d.ts.map +1 -1
  673. package/dist/esm/queue/cron-job-sync.backend.service.d.ts.map +1 -1
  674. package/dist/esm/queue/domain-queue-consumer.backend.service.d.ts.map +1 -1
  675. package/dist/esm/queue/domain-queue-consumer.backend.service.js.map +1 -1
  676. package/dist/esm/queue/job-completion-registry.backend.service.d.ts.map +1 -1
  677. package/dist/esm/queue/job-consumer.backend.service.d.ts.map +1 -1
  678. package/dist/esm/queue/job-consumer.backend.service.js.map +1 -1
  679. package/dist/esm/queue/job-executor.backend.service.d.ts.map +1 -1
  680. package/dist/esm/queue/job-executor.backend.service.js.map +1 -1
  681. package/dist/esm/queue/job-payload-storage.backend.service.d.ts.map +1 -1
  682. package/dist/esm/queue/job-status-tracking.backend.service.d.ts.map +1 -1
  683. package/dist/esm/queue/queue-monitoring.backend.service.d.ts.map +1 -1
  684. package/dist/esm/queue/queue-monitoring.backend.service.js.map +1 -1
  685. package/dist/esm/queue/queue-worker-initializer.backend.service.d.ts.map +1 -1
  686. package/dist/esm/queue/queue-worker-initializer.backend.service.js.map +1 -1
  687. package/dist/esm/queue/queue.backend.service.d.ts.map +1 -1
  688. package/dist/esm/queue/queue.backend.service.js.map +1 -1
  689. package/dist/esm/queue/scheduled-message-verifier.backend.service.d.ts.map +1 -1
  690. package/dist/esm/queue/worker-shutdown-manager.backend.service.d.ts.map +1 -1
  691. package/dist/esm/queue/worker-shutdown-manager.backend.service.js.map +1 -1
  692. package/dist/esm/rag/batches/rag-embedding-drain.batch.backend.service.d.ts.map +1 -1
  693. package/dist/esm/rag/batches/rag-reconciliation-sweep.batch.backend.service.d.ts.map +1 -1
  694. package/dist/esm/rag/models/rag-chunk-store.backend.types.d.ts.map +1 -1
  695. package/dist/esm/rag/models/rag-retrieval.backend.types.d.ts.map +1 -1
  696. package/dist/esm/rag/services/mongodb-rag-chunk-store.backend.service.d.ts.map +1 -1
  697. package/dist/esm/rag/services/postgresql-rag-chunk-store.backend.service.d.ts.map +1 -1
  698. package/dist/esm/rag/services/rag-chunk-collection.mongodb-ddl.backend.d.ts.map +1 -1
  699. package/dist/esm/rag/services/rag-chunk-retrieval.mongodb-query.backend.d.ts.map +1 -1
  700. package/dist/esm/rag/services/rag-chunk-retrieval.postgresql-query.backend.d.ts.map +1 -1
  701. package/dist/esm/rag/services/rag-chunk-store.backend.service.d.ts.map +1 -1
  702. package/dist/esm/rag/services/rag-chunk-table.postgresql-ddl.backend.d.ts.map +1 -1
  703. package/dist/esm/rag/services/rag-ingestion.backend.service.d.ts.map +1 -1
  704. package/dist/esm/rag/services/rag-retrieval.backend.service.d.ts.map +1 -1
  705. package/dist/esm/rag/utils/rag-chunk-fusion.backend.utils.d.ts.map +1 -1
  706. package/dist/esm/rag/utils/rag-chunk-removal.backend.utils.d.ts.map +1 -1
  707. package/dist/esm/rag/utils/rag-chunk-row-shaping.backend.utils.d.ts.map +1 -1
  708. package/dist/esm/rag/utils/rag-chunking.backend.utils.d.ts.map +1 -1
  709. package/dist/esm/rag/utils/rag-chunking.backend.utils.js.map +1 -1
  710. package/dist/esm/rag/utils/rag-context-assembly.backend.utils.d.ts.map +1 -1
  711. package/dist/esm/rag/utils/rag-context-assembly.backend.utils.js.map +1 -1
  712. package/dist/esm/rag/utils/rag-ingestion-trigger.backend.utils.d.ts.map +1 -1
  713. package/dist/esm/rag/utils/rag-retrieval-scope.backend.utils.d.ts.map +1 -1
  714. package/dist/esm/rag/utils/rag-source-field-value.backend.utils.d.ts.map +1 -1
  715. package/dist/esm/requests/models/api-routes.backend.defintions.d.ts.map +1 -1
  716. package/dist/esm/requests/models/requests.backend.schemas.d.ts.map +1 -1
  717. package/dist/esm/requests/service/platform-mutualized-handler.backend.service.d.ts.map +1 -1
  718. package/dist/esm/requests/service/platform-requests.backend.utils.d.ts.map +1 -1
  719. package/dist/esm/requests/service/remote-client-base.backend.service.d.ts.map +1 -1
  720. package/dist/esm/requests/service/serverless-services-handler.backend.service.d.ts.map +1 -1
  721. package/dist/esm/requests/service/websocket.service.d.ts.map +1 -1
  722. package/dist/esm/requests/service/websocket.service.js +49 -1
  723. package/dist/esm/requests/service/websocket.service.js.map +1 -1
  724. package/dist/esm/resources/backend-resource-registry.exports.d.ts.map +1 -1
  725. package/dist/esm/resources/models/custom-service-implementations.backend.definition.d.ts.map +1 -1
  726. package/dist/esm/resources/models/custom-service-implementations.backend.definition.js +2 -0
  727. package/dist/esm/resources/models/custom-service-implementations.backend.definition.js.map +1 -1
  728. package/dist/esm/resources/models/index.d.ts.map +1 -1
  729. package/dist/esm/resources/models/resources-operations.backend.definitions.d.ts.map +1 -1
  730. package/dist/esm/resources/models/resources-operations.backend.definitions.js.map +1 -1
  731. package/dist/esm/resources/models/resources-relationships.backend.definitions.d.ts.map +1 -1
  732. package/dist/esm/resources/models/resources-relationships.backend.definitions.js.map +1 -1
  733. package/dist/esm/resources/models/resources-types.backend.schemas.d.ts.map +1 -1
  734. package/dist/esm/resources/models/resources-types.backend.schemas.js.map +1 -1
  735. package/dist/esm/resources/models/resources.backend.schemas.d.ts.map +1 -1
  736. package/dist/esm/resources/models/virtual-fields.backend.types.d.ts.map +1 -1
  737. package/dist/esm/resources/services/__tests__/mock-resources-registry.service.d.ts.map +1 -1
  738. package/dist/esm/resources/services/resource-context.backend.service.d.ts.map +1 -1
  739. package/dist/esm/resources/services/resource-id.backend.service.d.ts.map +1 -1
  740. package/dist/esm/resources/services/resource-population.backend.service.d.ts +17 -2
  741. package/dist/esm/resources/services/resource-population.backend.service.d.ts.map +1 -1
  742. package/dist/esm/resources/services/resource-population.backend.service.js +74 -18
  743. package/dist/esm/resources/services/resource-population.backend.service.js.map +1 -1
  744. package/dist/esm/resources/services/resources-registry.backend.service.d.ts +23 -0
  745. package/dist/esm/resources/services/resources-registry.backend.service.d.ts.map +1 -1
  746. package/dist/esm/resources/services/resources-registry.backend.service.js +31 -0
  747. package/dist/esm/resources/services/resources-registry.backend.service.js.map +1 -1
  748. package/dist/esm/resources/services/virtual-fields.backend.service.d.ts.map +1 -1
  749. package/dist/esm/resources/utils/resource-retention.backend.utils.d.ts.map +1 -1
  750. package/dist/esm/runtime/controllers/health-controller.backend.service.d.ts.map +1 -1
  751. package/dist/esm/runtime/controllers/health-controller.backend.service.js.map +1 -1
  752. package/dist/esm/runtime/domain-module.backend.definitions.d.ts.map +1 -1
  753. package/dist/esm/runtime/domain-module.backend.definitions.js.map +1 -1
  754. package/dist/esm/runtime/models/execution-context.backend.schemas.d.ts.map +1 -1
  755. package/dist/esm/runtime/models/request-context.als.backend.d.ts.map +1 -1
  756. package/dist/esm/runtime/models/runtime.backend.schemas.d.ts.map +1 -1
  757. package/dist/esm/runtime/services/execution-context-creator.backend.service.d.ts.map +1 -1
  758. package/dist/esm/runtime/services/execution-context-creator.backend.service.js.map +1 -1
  759. package/dist/esm/runtime/services/execution-context-handler.backend.service.d.ts.map +1 -1
  760. package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.d.ts.map +1 -1
  761. package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.js.map +1 -1
  762. package/dist/esm/runtime/services/http-server.backend.service.d.ts.map +1 -1
  763. package/dist/esm/runtime/services/http-server.backend.service.js +10 -0
  764. package/dist/esm/runtime/services/http-server.backend.service.js.map +1 -1
  765. package/dist/esm/runtime/services/start-application.backend.service.d.ts.map +1 -1
  766. package/dist/esm/runtime/services/start-application.backend.service.js +26 -12
  767. package/dist/esm/runtime/services/start-application.backend.service.js.map +1 -1
  768. package/dist/esm/runtime/services/utils/oauth-body-cap.backend.utils.d.ts.map +1 -1
  769. package/dist/esm/runtime/testing/execution-context-test-fixtures.d.ts.map +1 -1
  770. package/dist/esm/runtime/testing/mock-execution-context-creator.service.d.ts.map +1 -1
  771. package/dist/esm/runtime/utils/application-startup-config-access.backend.utils.d.ts.map +1 -1
  772. package/dist/esm/runtime/utils/feature-gated-core-resource-exclusions.backend.utils.d.ts.map +1 -1
  773. package/dist/esm/runtime/utils/request-client-ip.utils.d.ts.map +1 -1
  774. package/dist/esm/runtime/utils/scan-default-exports.backend.utils.d.ts.map +1 -1
  775. package/dist/esm/security/api-keys/api-key-generation.backend.utils.d.ts.map +1 -1
  776. package/dist/esm/security/api-keys/api-keys.custom-impl.backend.service.d.ts.map +1 -1
  777. package/dist/esm/security/api-keys/api-keys.custom-impl.backend.service.js.map +1 -1
  778. package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.d.ts.map +1 -1
  779. package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.js.map +1 -1
  780. package/dist/esm/security/authentications/controllers/auth-method-management-controller.backend.service.d.ts.map +1 -1
  781. package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.d.ts +22 -0
  782. package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.d.ts.map +1 -1
  783. package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.js +84 -0
  784. package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.js.map +1 -1
  785. package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.d.ts.map +1 -1
  786. package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.js.map +1 -1
  787. package/dist/esm/security/authentications/models/auth-constants.backend.d.ts.map +1 -1
  788. package/dist/esm/security/authentications/models/authentications.backend.schemas.d.ts.map +1 -1
  789. package/dist/esm/security/authentications/models/authorization-client.backend.schemas.d.ts.map +1 -1
  790. package/dist/esm/security/authentications/models/cimd.backend.schemas.d.ts.map +1 -1
  791. package/dist/esm/security/authentications/models/cimd.backend.schemas.js.map +1 -1
  792. package/dist/esm/security/authentications/models/federated-auth-transport.backend.definitions.d.ts +37 -0
  793. package/dist/esm/security/authentications/models/federated-auth-transport.backend.definitions.d.ts.map +1 -0
  794. package/dist/esm/security/authentications/models/federated-auth-transport.backend.definitions.js +37 -0
  795. package/dist/esm/security/authentications/models/federated-auth-transport.backend.definitions.js.map +1 -0
  796. package/dist/esm/security/authentications/models/identity-persistence-boundaries.backend.d.ts.map +1 -1
  797. package/dist/esm/security/authentications/models/jwt.backend.schemas.d.ts.map +1 -1
  798. package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.d.ts +15 -0
  799. package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.d.ts.map +1 -1
  800. package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.js.map +1 -1
  801. package/dist/esm/security/authentications/models/saml-authentication.backend.schemas.d.ts.map +1 -1
  802. package/dist/esm/security/authentications/models/sso-connection.backend.schemas.d.ts.map +1 -1
  803. package/dist/esm/security/authentications/models/user-authorization-version.backend.utils.d.ts.map +1 -1
  804. package/dist/esm/security/authentications/seeds/enterprise-config-defaults.seeds.d.ts.map +1 -1
  805. package/dist/esm/security/authentications/services/__tests__/mock-auth-execution-context-factory.service.d.ts.map +1 -1
  806. package/dist/esm/security/authentications/services/__tests__/mock-auth-token-issuer.service.d.ts.map +1 -1
  807. package/dist/esm/security/authentications/services/__tests__/oauth-provider-audit-spies.mock.d.ts.map +1 -1
  808. package/dist/esm/security/authentications/services/admin-config/__tests__/mock-domain-to-org-lookup.service.d.ts.map +1 -1
  809. package/dist/esm/security/authentications/services/admin-config/__tests__/mock-enterprise-user-provisioning.service.d.ts.map +1 -1
  810. package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.d.ts.map +1 -1
  811. package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.js.map +1 -1
  812. package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.d.ts.map +1 -1
  813. package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.js.map +1 -1
  814. package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.d.ts.map +1 -1
  815. package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.js.map +1 -1
  816. package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.d.ts.map +1 -1
  817. package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.js.map +1 -1
  818. package/dist/esm/security/authentications/services/admin-config/oidc-discovery.backend.service.d.ts.map +1 -1
  819. package/dist/esm/security/authentications/services/admin-config/oidc-discovery.backend.service.js +2 -1
  820. package/dist/esm/security/authentications/services/admin-config/oidc-discovery.backend.service.js.map +1 -1
  821. package/dist/esm/security/authentications/services/anonymous-session.backend.service.d.ts +9 -2
  822. package/dist/esm/security/authentications/services/anonymous-session.backend.service.d.ts.map +1 -1
  823. package/dist/esm/security/authentications/services/anonymous-session.backend.service.js +9 -2
  824. package/dist/esm/security/authentications/services/anonymous-session.backend.service.js.map +1 -1
  825. package/dist/esm/security/authentications/services/auth-credential-verifier.backend.service.d.ts.map +1 -1
  826. package/dist/esm/security/authentications/services/auth-execution-context-factory.backend.service.d.ts.map +1 -1
  827. package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.d.ts.map +1 -1
  828. package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.js.map +1 -1
  829. package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.d.ts.map +1 -1
  830. package/dist/esm/security/authentications/services/auth-methods/auth-password-reset.backend.service.d.ts.map +1 -1
  831. package/dist/esm/security/authentications/services/auth-methods/auth-phone-verification.backend.service.d.ts.map +1 -1
  832. package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.d.ts.map +1 -1
  833. package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.js.map +1 -1
  834. package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.d.ts +97 -0
  835. package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.d.ts.map +1 -1
  836. package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.js +218 -26
  837. package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.js.map +1 -1
  838. package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.d.ts +14 -0
  839. package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.d.ts.map +1 -1
  840. package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.js +36 -0
  841. package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.js.map +1 -1
  842. package/dist/esm/security/authentications/services/auth-methods/saml-assertion-validator.backend.service.d.ts.map +1 -1
  843. package/dist/esm/security/authentications/services/auth-methods/saml-authentication.backend.service.d.ts.map +1 -1
  844. package/dist/esm/security/authentications/services/auth-methods/saml-metadata.backend.service.d.ts.map +1 -1
  845. package/dist/esm/security/authentications/services/auth-methods/saml-replay-guard.backend.service.d.ts.map +1 -1
  846. package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.d.ts.map +1 -1
  847. package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.js.map +1 -1
  848. package/dist/esm/security/authentications/services/auth-session-store.backend.service.d.ts.map +1 -1
  849. package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.d.ts.map +1 -1
  850. package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.js.map +1 -1
  851. package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.d.ts.map +1 -1
  852. package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.js.map +1 -1
  853. package/dist/esm/security/authentications/services/cimd-client-metadata.backend.service.d.ts.map +1 -1
  854. package/dist/esm/security/authentications/services/cimd-client-metadata.backend.service.js.map +1 -1
  855. package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.d.ts.map +1 -1
  856. package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.js.map +1 -1
  857. package/dist/esm/security/authentications/services/custom-impls/scim-tokens.custom-impl.backend.service.d.ts.map +1 -1
  858. package/dist/esm/security/authentications/services/custom-impls/siem-delivery-dlq.custom-impl.backend.service.d.ts.map +1 -1
  859. package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.d.ts.map +1 -1
  860. package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.js +57 -1
  861. package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.js.map +1 -1
  862. package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.d.ts.map +1 -1
  863. package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.js.map +1 -1
  864. package/dist/esm/security/authentications/services/custom-impls/sso-connection.custom-impl.backend.service.d.ts.map +1 -1
  865. package/dist/esm/security/authentications/services/custom-impls/sso-connection.custom-impl.backend.service.js +11 -1
  866. package/dist/esm/security/authentications/services/custom-impls/sso-connection.custom-impl.backend.service.js.map +1 -1
  867. package/dist/esm/security/authentications/services/email-verification-initiator.backend.service.d.ts.map +1 -1
  868. package/dist/esm/security/authentications/services/machine-token-issuer.backend.service.d.ts.map +1 -1
  869. package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.d.ts.map +1 -1
  870. package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.js.map +1 -1
  871. package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.d.ts.map +1 -1
  872. package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.js.map +1 -1
  873. package/dist/esm/security/authentications/services/oidc-user-claims.backend.service.d.ts.map +1 -1
  874. package/dist/esm/security/authentications/services/resolve-active-member-orgs.backend.utils.d.ts.map +1 -1
  875. package/dist/esm/security/authentications/services/utils/__tests__/mock-auth-user-lookup.service.d.ts.map +1 -1
  876. package/dist/esm/security/authentications/services/utils/auth-controller.utils.d.ts.map +1 -1
  877. package/dist/esm/security/authentications/services/utils/auth-credential-ops.backend.service.d.ts.map +1 -1
  878. package/dist/esm/security/authentications/services/utils/auth-policy-resolution.backend.utils.d.ts.map +1 -1
  879. package/dist/esm/security/authentications/services/utils/auth-policy-resolution.backend.utils.js.map +1 -1
  880. package/dist/esm/security/authentications/services/utils/auth-response-helper.backend.service.d.ts.map +1 -1
  881. package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.d.ts.map +1 -1
  882. package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.js.map +1 -1
  883. package/dist/esm/security/authentications/services/utils/concurrent-session-eviction.backend.utils.d.ts.map +1 -1
  884. package/dist/esm/security/authentications/services/utils/ensure-user-profile.backend.utils.d.ts.map +1 -1
  885. package/dist/esm/security/authentications/services/utils/external-turn-rate-limit.backend.utils.d.ts.map +1 -1
  886. package/dist/esm/security/authentications/services/utils/external-turn-rate-limit.backend.utils.js.map +1 -1
  887. package/dist/esm/security/authentications/services/utils/machine-auth-rate-limit.backend.utils.d.ts.map +1 -1
  888. package/dist/esm/security/authentications/services/utils/pkce.backend.utils.d.ts.map +1 -1
  889. package/dist/esm/security/authentications/services/utils/saml-java-availability.d.ts.map +1 -1
  890. package/dist/esm/security/authentications/utils/application-auth-policy-audit.backend.utils.d.ts.map +1 -1
  891. package/dist/esm/security/authentications/utils/enterprise-sso-enforcement.backend.utils.d.ts.map +1 -1
  892. package/dist/esm/security/authentications/utils/enterprise-sso-enforcement.backend.utils.js.map +1 -1
  893. package/dist/esm/security/authentications/utils/one-off-session-lifetime.backend.utils.d.ts.map +1 -1
  894. package/dist/esm/security/authentications/utils/social-oauth2-purpose.backend.utils.d.ts.map +1 -1
  895. package/dist/esm/security/authorizations/access-grant-decision.factory.backend.d.ts +59 -0
  896. package/dist/esm/security/authorizations/access-grant-decision.factory.backend.d.ts.map +1 -0
  897. package/dist/esm/security/authorizations/access-grant-decision.factory.backend.js +111 -0
  898. package/dist/esm/security/authorizations/access-grant-decision.factory.backend.js.map +1 -0
  899. package/dist/esm/security/authorizations/access-grant-lifecycle-audit.backend.d.ts +57 -0
  900. package/dist/esm/security/authorizations/access-grant-lifecycle-audit.backend.d.ts.map +1 -0
  901. package/dist/esm/security/authorizations/access-grant-lifecycle-audit.backend.js +133 -0
  902. package/dist/esm/security/authorizations/access-grant-lifecycle-audit.backend.js.map +1 -0
  903. package/dist/esm/security/authorizations/application-access-grant-custom-implementation.backend.service.d.ts +41 -0
  904. package/dist/esm/security/authorizations/application-access-grant-custom-implementation.backend.service.d.ts.map +1 -0
  905. package/dist/esm/security/authorizations/application-access-grant-custom-implementation.backend.service.js +157 -0
  906. package/dist/esm/security/authorizations/application-access-grant-custom-implementation.backend.service.js.map +1 -0
  907. package/dist/esm/security/authorizations/application-wide-read-admission.backend.d.ts +84 -0
  908. package/dist/esm/security/authorizations/application-wide-read-admission.backend.d.ts.map +1 -0
  909. package/dist/esm/security/authorizations/application-wide-read-admission.backend.js +99 -0
  910. package/dist/esm/security/authorizations/application-wide-read-admission.backend.js.map +1 -0
  911. package/dist/esm/security/authorizations/authorization-denial-audit.backend.utils.d.ts.map +1 -1
  912. package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.d.ts.map +1 -1
  913. package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.js.map +1 -1
  914. package/dist/esm/security/authorizations/initiator-organization-confinement.backend.d.ts.map +1 -1
  915. package/dist/esm/security/authorizations/junction-scope-resolution.backend.d.ts.map +1 -1
  916. package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.d.ts.map +1 -1
  917. package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.js.map +1 -1
  918. package/dist/esm/security/authorizations/organization-unit-narrowing-enforcement.backend.d.ts.map +1 -1
  919. package/dist/esm/security/authorizations/platform-access-grant-custom-implementation.backend.service.d.ts.map +1 -1
  920. package/dist/esm/security/authorizations/platform-access-grant-custom-implementation.backend.service.js +20 -181
  921. package/dist/esm/security/authorizations/platform-access-grant-custom-implementation.backend.service.js.map +1 -1
  922. package/dist/esm/security/authorizations/privileged-access-review.backend.utils.d.ts.map +1 -1
  923. package/dist/esm/security/authorizations/relationship-foreign-key-filter.backend.d.ts.map +1 -1
  924. package/dist/esm/security/authorizations/role-ceiling.backend.utils.d.ts.map +1 -1
  925. package/dist/esm/security/authorizations/role-ceiling.backend.utils.js.map +1 -1
  926. package/dist/esm/security/authorizations/role-conferral.backend.utils.d.ts +40 -0
  927. package/dist/esm/security/authorizations/role-conferral.backend.utils.d.ts.map +1 -1
  928. package/dist/esm/security/authorizations/role-conferral.backend.utils.js +43 -1
  929. package/dist/esm/security/authorizations/role-conferral.backend.utils.js.map +1 -1
  930. package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.d.ts +27 -17
  931. package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.d.ts.map +1 -1
  932. package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.js +27 -17
  933. package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.js.map +1 -1
  934. package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts +72 -0
  935. package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts.map +1 -1
  936. package/dist/esm/security/authorizations/services/authorizations.backend.service.js +153 -10
  937. package/dist/esm/security/authorizations/services/authorizations.backend.service.js.map +1 -1
  938. package/dist/esm/security/authorizations/super-admin-floor.backend.utils.d.ts.map +1 -1
  939. package/dist/esm/security/authorizations/super-admin-floor.backend.utils.js.map +1 -1
  940. package/dist/esm/security/connected-accounts/connection-target-authorization.backend.d.ts.map +1 -1
  941. package/dist/esm/security/connected-accounts/connection-target-authorization.backend.js.map +1 -1
  942. package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.d.ts +139 -1
  943. package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.d.ts.map +1 -1
  944. package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.js +474 -33
  945. package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.js.map +1 -1
  946. package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.d.ts +40 -0
  947. package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.d.ts.map +1 -1
  948. package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.js.map +1 -1
  949. package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.d.ts.map +1 -1
  950. package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.js.map +1 -1
  951. package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.d.ts +19 -0
  952. package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.d.ts.map +1 -1
  953. package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.js +38 -0
  954. package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.js.map +1 -1
  955. package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.d.ts.map +1 -1
  956. package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.js.map +1 -1
  957. package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.d.ts.map +1 -1
  958. package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.js +17 -1
  959. package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.js.map +1 -1
  960. package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.d.ts +14 -0
  961. package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.d.ts.map +1 -1
  962. package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.js +16 -0
  963. package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.js.map +1 -1
  964. package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.d.ts.map +1 -1
  965. package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.js +1 -1
  966. package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.js.map +1 -1
  967. package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.d.ts +19 -0
  968. package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.d.ts.map +1 -1
  969. package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.js +45 -2
  970. package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.js.map +1 -1
  971. package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.d.ts.map +1 -1
  972. package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.js.map +1 -1
  973. package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.d.ts +37 -1
  974. package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.d.ts.map +1 -1
  975. package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.js.map +1 -1
  976. package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.d.ts.map +1 -1
  977. package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.js.map +1 -1
  978. package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.d.ts.map +1 -1
  979. package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.js.map +1 -1
  980. package/dist/esm/security/connected-accounts/utils/user-delegated-access-token-slot.backend.utils.d.ts +34 -0
  981. package/dist/esm/security/connected-accounts/utils/user-delegated-access-token-slot.backend.utils.d.ts.map +1 -0
  982. package/dist/esm/security/connected-accounts/utils/user-delegated-access-token-slot.backend.utils.js +39 -0
  983. package/dist/esm/security/connected-accounts/utils/user-delegated-access-token-slot.backend.utils.js.map +1 -0
  984. package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.d.ts.map +1 -1
  985. package/dist/esm/security/consumable-tokens/consumable-token-models.exports.d.ts.map +1 -1
  986. package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.d.ts.map +1 -1
  987. package/dist/esm/security/consumable-tokens/models/consumable-tokens.shared.schemas.d.ts.map +1 -1
  988. package/dist/esm/security/consumable-tokens/models/index.d.ts.map +1 -1
  989. package/dist/esm/security/consumable-tokens/services/__tests__/mock-consumable-token.service.d.ts.map +1 -1
  990. package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.d.ts.map +1 -1
  991. package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.js.map +1 -1
  992. package/dist/esm/security/credential-rotation-grace.backend.utils.d.ts.map +1 -1
  993. package/dist/esm/security/credential-rotation-grace.backend.utils.js.map +1 -1
  994. package/dist/esm/security/jwt/services/auth-jwt-guard.backend.service.d.ts.map +1 -1
  995. package/dist/esm/security/jwt/services/jwt.backend.service.d.ts.map +1 -1
  996. package/dist/esm/security/jwt/services/wildo-worker-bootstrap-client.backend.service.d.ts +13 -0
  997. package/dist/esm/security/jwt/services/wildo-worker-bootstrap-client.backend.service.d.ts.map +1 -1
  998. package/dist/esm/security/jwt/services/wildo-worker-bootstrap-client.backend.service.js +14 -0
  999. package/dist/esm/security/jwt/services/wildo-worker-bootstrap-client.backend.service.js.map +1 -1
  1000. package/dist/esm/security/jwt/utils/jwt-verification-error-classification.backend.utils.d.ts.map +1 -1
  1001. package/dist/esm/security/oauth-clients/oauth-client-generation.backend.utils.d.ts.map +1 -1
  1002. package/dist/esm/security/oauth-clients/oauth-client-generation.backend.utils.js.map +1 -1
  1003. package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.d.ts.map +1 -1
  1004. package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.js.map +1 -1
  1005. package/dist/esm/security/outbound/outbound-request-deadline.backend.utils.d.ts +39 -0
  1006. package/dist/esm/security/outbound/outbound-request-deadline.backend.utils.d.ts.map +1 -0
  1007. package/dist/esm/security/outbound/outbound-request-deadline.backend.utils.js +60 -0
  1008. package/dist/esm/security/outbound/outbound-request-deadline.backend.utils.js.map +1 -0
  1009. package/dist/esm/security/outbound/outbound-request-headers.backend.utils.d.ts +66 -0
  1010. package/dist/esm/security/outbound/outbound-request-headers.backend.utils.d.ts.map +1 -0
  1011. package/dist/esm/security/outbound/outbound-request-headers.backend.utils.js +75 -0
  1012. package/dist/esm/security/outbound/outbound-request-headers.backend.utils.js.map +1 -0
  1013. package/dist/esm/security/scim/controllers/scim.backend.controller.d.ts.map +1 -1
  1014. package/dist/esm/security/scim/controllers/scim.backend.controller.js.map +1 -1
  1015. package/dist/esm/security/scim/models/scim-protocol.backend.schemas.d.ts.map +1 -1
  1016. package/dist/esm/security/scim/models/scim-protocol.backend.schemas.js.map +1 -1
  1017. package/dist/esm/security/scim/utils/scim-attribute-path-resolver.backend.utils.d.ts.map +1 -1
  1018. package/dist/esm/security/scim/utils/scim-filter-parser.d.ts.map +1 -1
  1019. package/dist/esm/security/scim/utils/scim-response-formatter.d.ts.map +1 -1
  1020. package/dist/esm/security/session-invalidation-fence.backend.utils.d.ts.map +1 -1
  1021. package/dist/esm/security/ssrf/outbound-target-guard.backend.utils.d.ts.map +1 -1
  1022. package/dist/esm/security/ssrf/outbound-target-guard.backend.utils.js.map +1 -1
  1023. package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.d.ts.map +1 -1
  1024. package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.js.map +1 -1
  1025. package/dist/esm/security/token-invalidation-fence.backend.utils.d.ts.map +1 -1
  1026. package/dist/esm/testing.d.ts.map +1 -1
  1027. package/dist/esm/users/services/inbound-contact-custom-implementation.backend.service.d.ts.map +1 -1
  1028. package/dist/esm/users/services/user-deletion-audit.custom-impl.backend.service.d.ts.map +1 -1
  1029. package/dist/esm/users/services/user-force-password-reset.custom-impl.backend.service.d.ts.map +1 -1
  1030. package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.d.ts.map +1 -1
  1031. package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.js.map +1 -1
  1032. package/dist/esm/users/services/user-role-administration.custom-impl.backend.service.d.ts.map +1 -1
  1033. package/dist/esm/users/services/user-self-custom-implementations.backend.d.ts.map +1 -1
  1034. package/dist/esm/users/services/user-super-admin-floor.custom-impl.backend.service.d.ts.map +1 -1
  1035. package/dist/tsconfig.build.tsbuildinfo +1 -1
  1036. package/package.json +9 -9
  1037. package/dist/esm/external-providers/services/flow-actor-design.backend.service.d.ts +0 -45
  1038. package/dist/esm/external-providers/services/flow-actor-design.backend.service.d.ts.map +0 -1
  1039. package/dist/esm/external-providers/services/flow-actor-design.backend.service.js +0 -22
  1040. package/dist/esm/external-providers/services/flow-actor-design.backend.service.js.map +0 -1
  1041. package/dist/esm/notifications/email/models/email-context-provider.interface.d.ts +0 -0
  1042. package/dist/esm/notifications/email/models/email-context-provider.interface.d.ts.map +0 -0
  1043. package/dist/esm/notifications/email/models/email-context-provider.interface.js +0 -0
  1044. package/dist/esm/notifications/email/models/email-context-provider.interface.js.map +0 -0
  1045. package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.d.ts +0 -0
  1046. package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.d.ts.map +0 -0
  1047. package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.js +0 -0
  1048. package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.js.map +0 -0
  1049. package/dist/esm/notifications/email/services/email-template-compiler.backend.service.d.ts +0 -0
  1050. package/dist/esm/notifications/email/services/email-template-compiler.backend.service.d.ts.map +0 -0
  1051. package/dist/esm/notifications/email/services/email-template-compiler.backend.service.js +0 -0
  1052. package/dist/esm/notifications/email/services/email-template-compiler.backend.service.js.map +0 -0
  1053. package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.d.ts +0 -0
  1054. package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.d.ts.map +0 -0
  1055. package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.js +0 -0
  1056. package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.js.map +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-provider-controller.backend.service.js","sourceRoot":"","sources":["../../../../../../src/security/authentications/controllers/oauth-provider-controller.backend.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,gCAAgC,EAAE,MAAM,0FAA0F,CAAC;AAC5I,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,kEAAkE,CAAC;AAC9G,OAAO,EAAE,mBAAmB,EAAE,MAAM,kEAAkE,CAAC;AACvG,OAAO,EAAE,2BAA2B,EAAE,MAAM,8EAA8E,CAAC;AAC3H,OAAO,EAAE,kBAAkB,EAAE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CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAC9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAC9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAA;IAC7C,WAAA,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;IAC3C,WAAA,MAAM,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAA;IAC5C,WAAA,MAAM,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,CAAA;IAChD,WAAA,MAAM,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAA;IACvC,WAAA,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;IAC3C,WAAA,MAAM,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAA;IACzC,YAAA,MAAM,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAA;IAC7C,YAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAG9C,YAAA,MAAM,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAA;qCAdA,aAAa;QACM,0BAA0B;QAC1B,mBAAmB;QACH,gCAAgC;QAC9B,uBAAuB;QAC5B,iBAAiB;QACR,mCAAmC;QAC/C,YAAY;QACX,uBAAuB;QACjB,4BAA4B;QAC9B,gCAAgC;GAZpG,qCAAqC,CA0pDjD","sourcesContent":["import 'reflect-metadata';\nimport { timingSafeEqual } from 'node:crypto';\nimport { inject, injectable } from 'inversify';\nimport type { Request, Response } from 'express';\nimport cors from 'cors';\nimport { AbstractControllerBackendService } from '~wildo-backend-lib/base-classes/services/controllers/abstract-controller.backend.service';\nimport { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport { ErrorBuilderBackendService } from '~wildo-backend-lib/errors/services/error-builder.backend.service';\nimport { ErrorHandlerService } from '~wildo-backend-lib/errors/services/error-handler.backend.service';\nimport { projectCaughtErrorLogFields } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport { OAuthProviderTokenBackendService } from '~wildo-backend-lib/security/authentications/services/oauth-provider-token.backend.service';\nimport { OidcAuthorizationCodeBackendService } from '~wildo-backend-lib/security/authentications/services/oidc-authorization-code.backend.service';\nimport { OidcUserClaimsBackendService, OIDC_SUPPORTED_IDENTITY_SCOPES, OIDC_SCOPE_GATED_IDENTITY_CLAIMS } from '~wildo-backend-lib/security/authentications/services/oidc-user-claims.backend.service';\nimport { CimdTrustPolicy } from '~wildo-backend-lib/security/authentications/models/cimd.backend.schemas';\nimport type { DynamicClientRegistrationConfig } from '~wildo-backend-lib/security/authentications/models/cimd.backend.schemas';\nimport { generateOAuthClientSecretMaterial, generateRegistrationAccessTokenMaterial, hashRegistrationAccessToken } from '~wildo-backend-lib/security/oauth-clients/oauth-client-generation.backend.utils';\nimport type { SystemAccessBackendService } from '~wildo-backend-lib/base-classes/services/services/system-access.backend.service';\nimport { CimdClientMetadataBackendService } from '~wildo-backend-lib/security/authentications/services/cimd-client-metadata.backend.service';\nimport { AppConfigurationService } from '~wildo-backend-lib/config/services/app-configuration.backend.service';\nimport { JwtBackendService } from '~wildo-backend-lib/security/jwt/services/jwt.backend.service';\nimport { JwtPrivateKeys } from '~wildo-backend-lib/security/authentications/models/jwt.backend.schemas';\nimport { AuthControllerUtils } from '~wildo-backend-lib/security/authentications/services/utils/auth-controller.utils';\nimport type { AuthTokenIssuerBackendService } from '~wildo-backend-lib/security/authentications/services/auth-token-issuer.backend.service';\nimport { RedisService } from '~wildo-backend-lib/databases/services/redis.service';\nimport { getClientIpFromRequest } from '~wildo-backend-lib/runtime/utils/request-client-ip.utils';\nimport { assertMachineAuthAttemptWithinRate, recordMachineAuthFailure } from '~wildo-backend-lib/security/authentications/services/utils/machine-auth-rate-limit.backend.utils';\nimport { isValidS256CodeChallenge } from '~wildo-backend-lib/security/authentications/services/utils/pkce.backend.utils';\nimport { AuditLogsBackendService } from '~wildo-backend-lib/compliance/audit-trails/services/audit-logs.backend.service';\nimport {\n ApiKeyScope,\n CoreResourceType,\n ExecutionContext_ExecutionType,\n MANUAL_CONTROLLER_ROUTES_URLS,\n ManualControllerRouteKey,\n OAuthClientRegistrationOrigin,\n OAuthClientStatus,\n OAuthGrantType,\n OAuthTokenEndpointAuthMethod,\n isSafeOAuthRedirectUri,\n isWildoBackendError,\n} from '@wildo-ai/saas-models';\nimport type { OAuthClientApplication } from '@wildo-ai/saas-models';\n\n/**\n * OAuth 2.0 Authorization Server endpoints (Wildo-AS-PROVIDER). A THIN transport wrapper\n * over {@link OAuthProviderTokenBackendService} — it parses the request per RFC 6749 and\n * renders the §5.1 success / §5.2 error body; all verification + issuance logic lives in\n * the (unit-tested) service.\n *\n * Deliberately SEPARATE from the RP-side `AuthenticationControllerBackendService`\n * (Wildo-as-client) per the framework's semantic-distinction rule. The OIDC branch adds\n * `/.well-known/openid-configuration`, `/jwks`, `authorize`, and `userinfo` alongside this\n * token endpoint here.\n *\n * NOTE: `setupRoutes()` runs inside the `super()` constructor (before this subclass's field\n * initializers), so it only BINDS handlers — `this.tokenService` is read at REQUEST time,\n * by which point the field is set. This is the standard manual-controller pattern.\n */\n@injectable()\nexport class OAuthProviderControllerBackendService extends AbstractControllerBackendService {\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService) errorBuilder: ErrorBuilderBackendService,\n @inject(SAAS_SERVICE_TYPES.ErrorHandlerService) errorHandler: ErrorHandlerService,\n @inject(SAAS_SERVICE_TYPES.OAuthProviderToken) private readonly tokenService: OAuthProviderTokenBackendService,\n @inject(SAAS_SERVICE_TYPES.AppConfigService) private readonly appConfigService: AppConfigurationService,\n @inject(SAAS_SERVICE_TYPES.JwtBackendService) private readonly jwtService: JwtBackendService,\n @inject(SAAS_SERVICE_TYPES.OidcAuthorizationCode) private readonly authCodeService: OidcAuthorizationCodeBackendService,\n @inject(SAAS_SERVICE_TYPES.RedisService) private readonly redisService: RedisService,\n @inject(SAAS_SERVICE_TYPES.AuditLogsService) private readonly auditLogs: AuditLogsBackendService,\n @inject(SAAS_SERVICE_TYPES.OidcUserClaims) private readonly userClaimsService: OidcUserClaimsBackendService,\n @inject(SAAS_SERVICE_TYPES.CimdClientMetadata) private readonly cimdService: CimdClientMetadataBackendService,\n @inject(SAAS_SERVICE_TYPES.SystemAccessService) private readonly systemAccess: SystemAccessBackendService,\n // revocation-C: the per-session revocation writer the `/oauth/end-session` handler calls to terminate\n // the OP session named by an id_token's `sid`. Appended LAST so the existing positional DI is untouched.\n @inject(SAAS_SERVICE_TYPES.AuthTokenIssuer) private readonly authTokenIssuer: AuthTokenIssuerBackendService,\n ) {\n super(logger, errorBuilder, errorHandler, 'OAuthProviderController');\n }\n\n protected setupRoutes(): void {\n const tokenUrl = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_TOKEN];\n this.router.post(tokenUrl, this.asyncHandler(this.handleToken.bind(this)));\n this.logRouteRegistration('POST', tokenUrl, 'OAuth 2.0 token endpoint (grant_type=client_credentials)');\n\n // OIDC discovery + JWKS are PUBLIC, non-credentialed metadata that clients (incl. future\n // browser SPAs doing authorization_code) fetch cross-origin. Per OIDC/OAuth convention they\n // must be readable from ANY origin, so they get their own permissive-GET CORS that overrides\n // the app-global frontend-origin allowlist. `origin:'*'` is safe here BECAUSE these responses\n // carry NO credentials and NO secrets (public keys + public metadata only). The token endpoint\n // is deliberately NOT included — it is a server-side credential endpoint and stays under the\n // restrictive global CORS.\n const publicMetadataCors = cors({ origin: '*', methods: ['GET'], credentials: false });\n\n const discoveryUrl = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_DISCOVERY];\n this.router.get(discoveryUrl, publicMetadataCors, this.asyncHandler(this.handleDiscovery.bind(this)));\n this.logRouteRegistration('GET', discoveryUrl, 'OIDC discovery document (public, CORS-open)');\n\n // RFC 8414 alias: many OAuth/MCP clients probe `/.well-known/oauth-authorization-server` FIRST.\n // Serve the SAME discovery document there (public, CORS-open).\n const asMetadataUrl = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_AS_METADATA];\n this.router.get(asMetadataUrl, publicMetadataCors, this.asyncHandler(this.handleDiscovery.bind(this)));\n this.logRouteRegistration('GET', asMetadataUrl, 'RFC 8414 authorization-server metadata alias (public, CORS-open)');\n\n const jwksUrl = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_JWKS];\n this.router.get(jwksUrl, publicMetadataCors, this.asyncHandler(this.handleJwks.bind(this)));\n this.logRouteRegistration('GET', jwksUrl, 'JSON Web Key Set (jwks_uri) (public, CORS-open)');\n\n // authorize is a browser-redirect endpoint (no CORS). userinfo is bearer-credentialed, so it\n // stays under the restrictive global CORS (NOT the public-metadata origin:'*').\n const authorizeUrl = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_AUTHORIZE];\n this.router.get(authorizeUrl, this.asyncHandler(this.handleAuthorize.bind(this)));\n this.logRouteRegistration('GET', authorizeUrl, 'OIDC authorization endpoint (authorization_code)');\n\n // S1: interactive-consent decision endpoint — the approve/deny for a `requiresConsent` client.\n const consentUrl = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_CONSENT];\n this.router.post(consentUrl, this.asyncHandler(this.handleConsentDecision.bind(this)));\n this.logRouteRegistration('POST', consentUrl, 'OIDC interactive-consent decision endpoint');\n\n const userInfoUrl = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_USERINFO];\n this.router.get(userInfoUrl, this.asyncHandler(this.handleUserInfo.bind(this)));\n this.logRouteRegistration('GET', userInfoUrl, 'OIDC UserInfo endpoint');\n\n const revokeUrl = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_REVOKE];\n this.router.post(revokeUrl, this.asyncHandler(this.handleRevoke.bind(this)));\n this.logRouteRegistration('POST', revokeUrl, 'OAuth 2.0 token revocation (RFC 7009)');\n\n // OIDC RP-Initiated Logout (revocation-C). A GET browser-redirect endpoint like `authorize` — the RP\n // navigates the user's browser here, so it takes NO CORS (a top-level navigation, not an XHR) and no\n // Bearer middleware (the `id_token_hint` IS the credential, verified inside the handler).\n const endSessionUrl = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_END_SESSION];\n this.router.get(endSessionUrl, this.asyncHandler(this.handleEndSession.bind(this)));\n this.logRouteRegistration('GET', endSessionUrl, 'OIDC RP-Initiated Logout (end_session_endpoint)');\n\n // §6 logout-confirmation decision — the POST the frontend `/oauth/logout-confirm` prompt calls to\n // actually terminate the session. Token-authorized (no Bearer / no CORS); the single-use\n // `OIDC_LOGOUT_CONFIRMATION` token minted by `handleEndSession` is the credential.\n const endSessionConfirmUrl = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_END_SESSION_CONFIRM];\n this.router.post(endSessionConfirmUrl, this.asyncHandler(this.handleEndSessionConfirm.bind(this)));\n this.logRouteRegistration('POST', endSessionConfirmUrl, 'OIDC RP-Initiated Logout §6 confirmation decision');\n\n const registerUrl = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_REGISTER];\n this.router.post(registerUrl, this.asyncHandler(this.handleDynamicRegistration.bind(this)));\n this.logRouteRegistration('POST', registerUrl, 'RFC 7591 dynamic client registration (404 unless opted in)');\n\n // RFC 7592 §2: ONE client configuration endpoint, three methods. Registered unconditionally like\n // `/oauth/register` above and gated by the same opt-in inside the handler.\n const registerClientUrl = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_REGISTER_CLIENT];\n this.router.get(registerClientUrl, this.asyncHandler(this.handleClientConfigurationRead.bind(this)));\n this.router.put(registerClientUrl, this.asyncHandler(this.handleClientConfigurationUpdate.bind(this)));\n this.router.delete(registerClientUrl, this.asyncHandler(this.handleClientConfigurationDelete.bind(this)));\n this.logRouteRegistration('GET', registerClientUrl, 'RFC 7592 client read (404 unless opted in)');\n this.logRouteRegistration('PUT', registerClientUrl, 'RFC 7592 client update (404 unless opted in)');\n this.logRouteRegistration('DELETE', registerClientUrl, 'RFC 7592 client delete (404 unless opted in)');\n }\n\n /**\n * `POST /oauth/revoke` — RFC 7009 token revocation. Revokes the presented `token` (a user\n * refresh token). Per §2.2 the endpoint returns 200 even for an unknown/invalid token (no\n * token-status oracle).\n *\n * F-OIDC-6 (RFC 7009 §2.1 client authentication): when the request carries client credentials\n * (`client_secret_basic` via the Authorization header, or `client_secret_post` in the body), the\n * client is authenticated FIRST — a bad secret is `invalid_client` (401) and NO revocation happens.\n * An UNauthenticated revoke stays allowed: §2.1 permits it for a public client, and Wildo's refresh\n * tokens are first-party session tokens that no OAuth client owns, so there is no client↔token\n * binding to additionally enforce. A `client_secret` presented WITHOUT a `client_id` is\n * `invalid_request` (400) — an unnamed client cannot be authenticated.\n */\n private async handleRevoke(req: Request, res: Response): Promise<void> {\n const body = (req.body ?? {}) as Record<string, string | undefined>;\n // A repeated body param (Express parses `k=a&k=b` into a string[] despite the cast) is a malformed\n // request. Reject cleanly (400) so an array never reaches `hashOAuthClientSecret` or\n // `revokeRefreshToken` (which would 500), consistent with the token/authorize handlers.\n const malformedRevokeParam = this.firstMalformedParam(body, ['token', 'token_type_hint', 'client_id', 'client_secret']);\n if (malformedRevokeParam) {\n this.sendOAuthError(res, 400, 'invalid_request', `the '${malformedRevokeParam}' parameter must be a single string value`);\n return;\n }\n // `extractClientCredentials` already resolves the client id from Basic-header-or-body, so a\n // present `clientSecret` with an absent `clientId` means a secret was posted with no id at all.\n const { clientId, clientSecret } = this.extractClientCredentials(req, body);\n if (clientSecret) {\n if (!clientId) {\n this.sendOAuthError(res, 400, 'invalid_request', 'client_id is required when a client_secret is presented');\n return;\n }\n try {\n await this.authCodeService.verifyPresentedClientSecret(clientId, clientSecret);\n } catch (error) {\n if (isWildoBackendError(error)) {\n const context = (error as { context?: { oauthError?: string; detail?: string } }).context;\n if (context?.oauthError) {\n this.sendOAuthError(res, context.oauthError === 'invalid_client' ? 401 : 400, context.oauthError, context.detail);\n return;\n }\n }\n throw error;\n }\n }\n if (body.token) {\n await this.tokenService.revokeRefreshToken(body.token);\n // A-5: audit the revocation ATTEMPT. RFC 7009 is a no-oracle (200 for unknown tokens), so this\n // records the presented client (if a confidential client authenticated above) + hint, never whose\n // token it was or whether it existed. Reaching here with a `clientSecret` means it verified (a bad\n // secret returned early above). Fire-and-forget — auditing must never affect the RFC 7009 response.\n // assurance-control: WILDO.IDENTITY.CREDENTIAL_LIFECYCLE — token lifecycle (revocation).\n const revokeClientAuthenticated = Boolean(clientId && clientSecret);\n void this.auditLogs.logOAuthTokenRevoked({\n clientId: revokeClientAuthenticated ? clientId : undefined,\n clientAuthenticated: revokeClientAuthenticated,\n tokenTypeHint: body.token_type_hint,\n ipAddress: getClientIpFromRequest(req),\n }).catch((auditError) => this.logger.warn('OAUTH_TOKEN_REVOKED audit emit failed (non-fatal)', {\n ...projectCaughtErrorLogFields(auditError),\n }));\n }\n res.set('Cache-Control', 'no-store');\n res.status(200).json({});\n }\n\n /**\n * `GET /oauth/end-session` — OIDC RP-Initiated Logout 1.0 (revocation-C). A relying party redirects the\n * End-User's browser here to terminate their Wildo OP login session. This is a top-level BROWSER\n * navigation (not an XHR), so it answers with a real 302 redirect — unlike `authorize`/`decision`, which\n * return JSON to a Bearer SPA.\n *\n * Flow:\n * 1. Verify the `id_token_hint` — a token WE minted (signature + our public issuer), TOLERATING expiry\n * (§2: the hint may be a previously issued, possibly-expired ID token) and audience (its `aud` is the\n * RP, validated by the allowlist below, not the first-party `AUTH_TOKEN`).\n * 2. Extract `sub` (user), `sid` (the session), `azp` (the relying party); validate a presented\n * `post_logout_redirect_uri` against the RP's registered allowlist (EXACT match, `client_id`/`azp` agree).\n * 3. Branch on trust — the §6 logout-confirmation posture (Keycloak-style: skip the prompt for a trusted RP):\n * a. TRUSTED RP (valid hint + exact-match registered redirect) → terminate THAT session inline\n * (`invalidateSession(sid)`, per-session — its access + refresh die on the next request across every\n * front, other sessions live), clear the refresh cookie, and 302 to the RP echoing `state` (§3). No\n * prompt: a known RP presenting an id_token we signed is trusted to log the user out directly.\n * b. NON-trusted but a real session was identified (a valid hint whose redirect is absent / unregistered /\n * mismatched) → do NOT terminate; mint a single-use `OIDC_LOGOUT_CONFIRMATION` token naming the session\n * and 302 to the frontend `/oauth/logout-confirm` §6 prompt. Termination happens at\n * `POST /oauth/end-session/confirm` on the End-User's explicit confirm — this closes the BROWSER-based\n * logout-CSRF vector §6 targets (a cross-origin page cannot read the token to complete the confirm; see\n * `handleEndSessionConfirm` for the full threat model, incl. what it deliberately does NOT defend).\n * c. Nothing to terminate (no / unverifiable / forged hint) → clear the cookie and land on the OP's\n * signed-out page (`/oauth/logged-out`, §5). No prompt — there is nothing to confirm.\n * 4. Audit the logout (`OAUTH_RP_INITIATED_LOGOUT`) at each terminal disposition — for the prompt path (b)\n * that is the confirm endpoint, when the session actually ends.\n *\n * The signed-out landing (`/oauth/logged-out`) is UNIFORM across the confirm result of (b) and case (c), so\n * the response is not an oracle for whether a session existed. RP-Initiated Logout forbids acting on an\n * invalid hint; RP token revocation is out of scope (RFC 7009); delegated tokens are left to expire.\n * spec-cite: OpenID Connect RP-Initiated Logout 1.0 §2 (the OP terminates the End-User's session; the\n * `id_token_hint` need not be current — \"even when the exp time has passed\"; `post_logout_redirect_uri`\n * MUST have been registered) and §3 (the OP MUST NOT redirect unless the value EXACTLY matches a\n * registered `post_logout_redirect_uri`).\n * assurance-control: WILDO.IDENTITY.CREDENTIAL_LIFECYCLE — per-session revocation (RP-Initiated Logout).\n */\n private async handleEndSession(req: Request, res: Response): Promise<void> {\n const q = req.query as Record<string, string | undefined>;\n const malformed = this.firstMalformedParam(q, ['id_token_hint', 'post_logout_redirect_uri', 'client_id', 'state']);\n if (malformed) {\n this.sendOAuthError(res, 400, 'invalid_request', `the '${malformed}' parameter must be a single string value`);\n return;\n }\n const appBase = this.appConfigService.resolveAppPublicBaseUrl();\n if (!appBase) {\n this.sendOAuthError(res, 503, 'temporarily_unavailable', 'app public base URL is not resolvable');\n return;\n }\n // The OP's own logged-out destination when there is no validated RP redirect: the dedicated\n // \"you have been signed out\" page (`PUBLIC_LAYOUTS_OAUTH_LOGGED_OUT`, route `/oauth/logged-out`),\n // per RP-Initiated Logout 1.0 §5 (the OP displays a logout confirmation rather than redirecting back\n // to the RP). Reached by the no-session branch (c) — where NOTHING is terminated — and by the confirm\n // endpoint after it terminates; the landing is UNIFORM across both so it is not a session-state oracle.\n const landingUrl = `${appBase}/oauth/logged-out`;\n\n // The public issuer id_tokens are minted with (`createJwtForIdToken` sets `iss` to this). Needed to\n // verify the hint against the RIGHT issuer — `getVerifyOptions` otherwise forces the appSlug issuer.\n const issuer = this.appConfigService.resolveApiResourceAudience();\n\n let userId: string | undefined;\n let sessionId: string | undefined;\n let clientId: string | undefined;\n if (q.id_token_hint && issuer) {\n try {\n const claims = (await this.jwtService.verifyWithoutBackendErrorActions(\n q.id_token_hint,\n JwtPrivateKeys.APPLICATION_AUTH_TOKEN,\n { ignoreAudience: true, ignoreExpiration: true, issuerOverride: issuer },\n )) as { sub?: string; sid?: string; azp?: string; aud?: string };\n userId = claims.sub;\n sessionId = claims.sid;\n // The relying party the hint was issued to: `azp` (OIDC authorized party), falling back to `aud`\n // (the id_token audience = the client). Scopes the post_logout_redirect_uri allowlist lookup.\n clientId = claims.azp ?? claims.aud;\n } catch {\n // An invalid / forged hint identifies nothing. Terminate nothing; land the user on the OP page.\n // Deliberately NOT an error — §2 tolerates a stale hint; we simply cannot act on this one.\n }\n }\n\n // RP-Initiated Logout §2: a `client_id` parameter, when present, MUST agree with the hint's client.\n // A mismatch means the request cannot be trusted to name the RP, so no RP redirect is honored.\n const clientIdMismatch = Boolean(q.client_id && clientId && q.client_id !== clientId);\n\n // Validate the post_logout_redirect_uri BEFORE terminating, so the audit records the disposition.\n let validatedRedirect: string | undefined;\n let postLogoutRedirectUriRejected = false;\n if (q.post_logout_redirect_uri) {\n const canRedirect = !clientIdMismatch\n && clientId !== undefined\n && await this.authCodeService.isRegisteredPostLogoutRedirectUri(clientId, q.post_logout_redirect_uri);\n if (canRedirect) {\n validatedRedirect = q.post_logout_redirect_uri;\n } else {\n postLogoutRedirectUriRejected = true;\n }\n }\n\n res.set('Cache-Control', 'no-store');\n\n // ── Trusted RP logout (the Keycloak-style §6-prompt skip): a valid `id_token_hint` AND an exact-match\n // registered `post_logout_redirect_uri`. The request names a known, allow-listed relying party and\n // carries an id_token WE signed, so it is trusted to terminate the session and return the End-User to\n // the RP WITHOUT an interstitial — the current, unchanged behaviour (RP-Initiated Logout §3).\n if (validatedRedirect) {\n if (sessionId) {\n await this.authTokenIssuer.invalidateSession(sessionId);\n }\n // Best-effort browser hygiene: clear the first-party refresh cookie. The helper sets the same\n // `Path=/api/v1/auth` the cookie was issued with, so the deletion takes effect even though this\n // endpoint lives under a different path.\n AuthControllerUtils.clearRefreshCookie(res, this.appConfigService.applicationEnv);\n this._auditRpInitiatedLogout(req, { userId, sessionId, clientId, sessionTerminated: Boolean(sessionId), postLogoutRedirectUriRejected });\n let redirect: URL;\n try {\n redirect = new URL(validatedRedirect);\n } catch {\n // The allowlist entry passed `isSafeOAuthRedirectUri` at registration, so this is unreachable\n // through the front door; fall back to the landing rather than 500 if a malformed entry slipped in.\n res.redirect(302, landingUrl);\n return;\n }\n // RP-Initiated Logout §2: echo `state` on the post-logout redirect when the RP supplied it (§2 states\n // the OP passes `state` back to the RP; §3 governs the redirection itself).\n if (q.state) redirect.searchParams.set('state', q.state);\n res.redirect(302, redirect.toString());\n return;\n }\n\n // ── §6 confirmation prompt: a NON-trusted logout that still names a real session (a valid hint whose\n // `post_logout_redirect_uri` is absent / unregistered / client-mismatched). Do NOT terminate yet —\n // mint a single-use confirmation token naming the session and 302 the browser to the frontend\n // `/oauth/logout-confirm` prompt. Termination happens only on the End-User's explicit confirm\n // (`POST /oauth/end-session/confirm`), which closes the BROWSER-based logout-CSRF vector (see\n // `handleEndSessionConfirm` for the exact threat model). No audit here — nothing has been terminated;\n // the confirm endpoint audits the actual logout with the clientId/redirect disposition stashed here.\n if (sessionId && userId) {\n const { confirmationToken } = await this.authCodeService.createLogoutConfirmation({ userId, sessionId, clientId, postLogoutRedirectUriRejected });\n const confirmUrl = new URL(`${appBase}/oauth/logout-confirm`);\n confirmUrl.searchParams.set('token', confirmationToken);\n res.redirect(302, confirmUrl.toString());\n return;\n }\n\n // ── Nothing to terminate (no / unverifiable / forged hint): no session was identified, so there is\n // nothing to confirm. Clear the cookie for hygiene and land on the signed-out page — the UNIFORM §5\n // landing, identical to a completed logout, so the response is not an oracle for whether the hint was\n // valid or a session existed.\n AuthControllerUtils.clearRefreshCookie(res, this.appConfigService.applicationEnv);\n this._auditRpInitiatedLogout(req, { userId, sessionId, clientId, sessionTerminated: false, postLogoutRedirectUriRejected });\n res.redirect(302, landingUrl);\n }\n\n /**\n * Fire-and-forget audit for an RP-Initiated Logout disposition (`OAUTH_RP_INITIATED_LOGOUT`). Auditing\n * must never affect the logout the End-User already performed, so a failure is swallowed at WARN.\n * Called at each terminal disposition: the trusted-RP redirect, the no-session landing, and the §6\n * confirm endpoint (the prompt path audits there, when the session actually ends).\n */\n private _auditRpInitiatedLogout(\n req: Request,\n fields: { userId?: string; sessionId?: string; clientId?: string; sessionTerminated: boolean; postLogoutRedirectUriRejected: boolean },\n ): void {\n void this.auditLogs.logOAuthRpInitiatedLogout({\n ...fields,\n ipAddress: getClientIpFromRequest(req),\n }).catch((auditError) => this.logger.warn('OAUTH_RP_INITIATED_LOGOUT audit emit failed (non-fatal)', {\n ...projectCaughtErrorLogFields(auditError),\n }));\n }\n\n /**\n * `POST /oauth/end-session/confirm` — the OIDC RP-Initiated Logout §6 confirmation decision\n * (revocation-C). The frontend `/oauth/logout-confirm` prompt calls this with the single-use\n * `OIDC_LOGOUT_CONFIRMATION` token minted by `handleEndSession` when the End-User clicks \"Sign out\".\n * Token-authorized (no Bearer — the End-User may be unauthenticated in the SPA, having arrived via an\n * RP redirect), single-use, short-TTL.\n *\n * THREAT MODEL — read before strengthening or relaxing this. The prompt+token defends against\n * BROWSER-based logout CSRF: the token is minted into the VICTIM'S browser URL by the GET's 302, and a\n * cross-origin page (an `<img>`/auto-navigation forcing the GET) cannot READ that URL, so it cannot\n * complete the confirm — the classic \"silent logout via a crafted link\" is closed. It does NOT, and by\n * the endpoint's nature cannot, stop a party that HOLDS a valid `id_token` from scripting\n * GET→read-token→POST-confirm headlessly; but that party can already log the user out through the\n * trusted-RP path, because letting an authorized RP end the End-User's session is exactly what\n * RP-Initiated Logout is FOR. So the residual is a bounded session-logout by an id_token holder, not a\n * new capability. Binding the confirm to the victim's OP session (Keycloak's mechanism) is deliberately\n * NOT done: this OP is token-based and the `__wildo_refresh` cookie is scoped to `/api/v1/auth`, so it\n * never reaches `/oauth/*`, and the design intentionally allows an unauthenticated SPA to confirm.\n *\n * Consumes the token → terminates the named session (`invalidateSession(sid)`) → clears the refresh\n * cookie → audits → returns `{ redirect_to: /oauth/logged-out }` as JSON (the SPA navigates there,\n * mirroring `/oauth/authorize/decision`). A stale / invalid / already-used token is NOT an error: the\n * End-User confirmed a logout, so it lands them on the signed-out page WITHOUT terminating (the session\n * is most likely already gone, and revealing whether the token was live would be a session-state oracle).\n */\n private async handleEndSessionConfirm(req: Request, res: Response): Promise<void> {\n const appBase = this.appConfigService.resolveAppPublicBaseUrl();\n if (!appBase) {\n this.sendOAuthError(res, 503, 'temporarily_unavailable', 'app public base URL is not resolvable');\n return;\n }\n const body = (req.body ?? {}) as { token?: unknown };\n const token = typeof body.token === 'string' ? body.token : '';\n if (!token) {\n this.sendOAuthError(res, 400, 'invalid_request', \"the 'token' parameter is required\");\n return;\n }\n\n res.set('Cache-Control', 'no-store');\n const confirmation = await this.authCodeService.consumeLogoutConfirmation(token);\n // A stale / wrong-type token yields null → land on the signed-out page without terminating.\n if (confirmation?.sessionId) {\n await this.authTokenIssuer.invalidateSession(confirmation.sessionId);\n }\n AuthControllerUtils.clearRefreshCookie(res, this.appConfigService.applicationEnv);\n // Full attribution: the RP the hint named and the redirect disposition were stashed in the token at\n // mint time, so the confirm audit matches what the trusted-RP and no-session paths record inline.\n this._auditRpInitiatedLogout(req, {\n userId: confirmation?.userId,\n sessionId: confirmation?.sessionId,\n clientId: confirmation?.clientId,\n sessionTerminated: Boolean(confirmation?.sessionId),\n postLogoutRedirectUriRejected: confirmation?.postLogoutRedirectUriRejected ?? false,\n });\n res.status(200).json({ redirect_to: `${appBase}/oauth/logged-out` });\n }\n\n /**\n * `GET /.well-known/openid-configuration` — OIDC discovery metadata. `issuer` is the app's\n * API base URL (matching the `iss` in issued tokens); endpoint URLs are absolute so a client\n * that fetched this doc can reach them directly. The `authorization_endpoint` is the BROWSER-FACING\n * frontend consent/authorize page; the other endpoints are the backend API routes.\n */\n private async handleDiscovery(_req: Request, res: Response): Promise<void> {\n const issuer = this.appConfigService.resolveApiResourceAudience();\n if (!issuer) {\n this.sendOAuthError(res, 503, 'temporarily_unavailable', 'issuer URL is not resolvable');\n return;\n }\n // The `authorization_endpoint` is a BROWSER-FACING page, not the backend API endpoint: a third-party\n // client redirects the user's browser THERE, the SPA establishes the session and (for a\n // `requiresConsent` client) renders the consent screen, then calls the backend `/oauth/authorize`\n // with the user's Bearer. So it points at the frontend consent route (matches\n // `CommonRoutePaths.oauthConsent` in saas-frontend-lib) under the app's public base URL — NOT under\n // the `/api/v1` API mount. The path is a frontend-route literal (route paths are not a closed vocabulary).\n const appBase = this.appConfigService.resolveAppPublicBaseUrl();\n if (!appBase) {\n this.sendOAuthError(res, 503, 'temporarily_unavailable', 'app public base URL is not resolvable');\n return;\n }\n // Deployment guard: a non-https issuer (outside localhost) is a misconfigured public base\n // URL — OIDC relying parties reject a non-https issuer. Surface it loudly rather than let it\n // fail opaquely at the client. (The fix is operator-side: set the external https public URL.)\n if (issuer.startsWith('http://') && !/\\/\\/(localhost|127\\.0\\.0\\.1)/.test(issuer)) {\n this.logger.warn('OIDC issuer is not https — relying parties will reject it. Set the app public URL to the external https origin.', { issuer });\n }\n res.set('Cache-Control', 'public, max-age=3600');\n this.jsonSuccess(res, {\n issuer,\n authorization_endpoint: `${appBase}/oauth/consent`,\n token_endpoint: `${issuer}${MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_TOKEN]}`,\n jwks_uri: `${issuer}${MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_JWKS]}`,\n userinfo_endpoint: `${issuer}${MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_USERINFO]}`,\n revocation_endpoint: `${issuer}${MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_REVOKE]}`,\n // OIDC RP-Initiated Logout 1.0 (revocation-C): the `end_session_endpoint` an RP redirects the browser\n // to in order to terminate the End-User's OP session. A backend API route (like revocation), not the\n // browser-facing frontend page — the handler does the termination then redirects.\n // spec-cite: OpenID Connect RP-Initiated Logout 1.0 §2.1 (OpenID Provider Discovery Metadata —\n // `end_session_endpoint: REQUIRED`).\n end_session_endpoint: `${issuer}${MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_END_SESSION]}`,\n grant_types_supported: ['client_credentials', 'authorization_code', 'refresh_token'],\n response_types_supported: ['code'],\n response_modes_supported: ['query'],\n code_challenge_methods_supported: ['S256'],\n // RFC 9207. This is a CLAIM, not a preference: a client reading `true` here MUST reject any\n // authorization response from this server that arrives without `iss`. It is therefore only safe\n // while `sendAuthorizationRedirect` remains the sole way an authorization response leaves this\n // controller — it is what makes the claim true on the code path, the consent-approve path and\n // the consent-deny path alike. Do not set this to `true` for a server that emits `iss` on only\n // some of its responses.\n // spec-cite: RFC 9207 § 2.3 — `authorization_response_iss_parameter_supported`.\n authorization_response_iss_parameter_supported: true,\n // `none` = PUBLIC client (PKCE, no client secret) — the authorization_code token exchange\n // accepts `client_id` from the body and relies on PKCE (S256) instead of a secret, so a public\n // agent/SPA client is supported. Confidential clients use `client_secret_basic|post`. Omitting\n // `none` here would (mis)signal confidential-only and block a spec-compliant public client.\n token_endpoint_auth_methods_supported: ['none', 'client_secret_basic', 'client_secret_post'],\n // RFC 8707: this provider honors the `resource` indicator (REQUIRED for a user-delegated\n // authorization_code token — it binds the token `aud` to the A2A/MCP endpoint; the per-endpoint\n // resource value is discovered from the A2A agent card `url` / the MCP RFC 9728 metadata).\n resource_indicators_supported: true,\n /**\n * CIMD advertisement — DERIVED from the deployment's own posture, never hard-coded true.\n *\n * \"Authorization servers advertise that they support clients using Client ID Metadata Documents\n * by including the following property in their OAuth Authorization Server metadata:\n * `client_id_metadata_document_supported: true`\"\n * spec-cite: MCP 2025-11-25 — Authorization § Client ID Metadata Documents → Discovery\n *\n * The client's documented reaction to this flag is to CHOOSE CIMD over its other options —\n * \"Use Client ID Metadata Documents if the Authorization Server indicates it supports it\" —\n * so advertising it while the policy is `DISABLED` would steer every conformant client into a\n * mechanism this deployment refuses, and its fallback order would already have been spent.\n * Advertising the truth is what lets a client pick DCR or pre-registration instead.\n */\n ...(this.cimdService.deploymentConfiguration().policy === CimdTrustPolicy.DISABLED\n ? {}\n : { client_id_metadata_document_supported: true }),\n /**\n * `registration_endpoint` — advertised ONLY when the application opted in, for the same\n * reason as the CIMD flag and with the same consequence if it lies.\n *\n * A client's documented fallback order is \"pre-registered → CIMD → Dynamic Client\n * Registration → prompt the user\", so advertising an endpoint that answers 404 would consume\n * the third rung and push a conformant client straight to prompting a human.\n * spec-cite: MCP 2025-11-25 — Authorization § Client Registration Approaches: \"Use Dynamic\n * Client Registration as a fallback if the Authorization Server supports it (via\n * `registration_endpoint` in OAuth Authorization Server Metadata)\".\n */\n ...(this.dynamicRegistrationConfiguration().enabled\n ? { registration_endpoint: `${issuer}${MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_REGISTER]}` }\n : {}),\n subject_types_supported: ['public'],\n id_token_signing_alg_values_supported: ['ES256'],\n // OIDC Discovery RECOMMENDED metadata — DERIVED from the userinfo/ID-token resolver's single-source\n // vocabulary so discovery can never drift from what the ID token actually carries (the OIDC §5.4\n // consistency contract). `openid` is the baseline identity scope; `email`/`profile` gate the identity\n // claims. Scopes are IDENTITY only — authorization is roles-only (scope-based authorization was deleted\n // 2026-07-21). `claims_supported` = the always-present protocol claims + the resolver's scope-gated\n // identity claims; `auth_time` is deliberately NOT advertised (the authorization_code flow never\n // populates it, so advertising it would promise a claim we never deliver). The authorize endpoint\n // redirects the code as query params, so the only response mode is `query`.\n scopes_supported: [...OIDC_SUPPORTED_IDENTITY_SCOPES],\n claims_supported: ['sub', 'iss', 'aud', 'exp', 'iat', 'nonce', 'azp', ...OIDC_SCOPE_GATED_IDENTITY_CLAIMS],\n }, 200);\n }\n\n /**\n * `GET /oauth/jwks` — the JWKS a relying party uses to verify Wildo-issued tokens. Each JWK's\n * `kid` is the RFC 7638 thumbprint embedded in the token header. Public keys only.\n */\n private async handleJwks(_req: Request, res: Response): Promise<void> {\n res.set('Cache-Control', 'public, max-age=3600');\n this.jsonSuccess(res, this.jwtService.getPublicJwks(), 200);\n }\n\n /**\n * `POST /oauth/token` — RFC 6749 token endpoint. Serves `grant_type=client_credentials`\n * (the OIDC branch adds `authorization_code`). Accepts `client_secret_basic` (Authorization:\n * Basic) or `client_secret_post` (form body) client authentication.\n */\n private async handleToken(req: Request, res: Response): Promise<void> {\n const body = (req.body ?? {}) as Record<string, string | undefined>;\n // These OAuth params are single-valued; a REPEATED body key (which Express parses to `string[]`\n // despite the cast) is a malformed request. Reject it cleanly (400) so an array never reaches a\n // `.split`/`.includes` (500) or silently slips through the RFC 8707 audience comparison.\n const malformedTokenParam = this.firstMalformedParam(body, ['grant_type', 'code', 'redirect_uri', 'code_verifier', 'client_id', 'client_secret', 'refresh_token', 'resource', 'scope']);\n if (malformedTokenParam) {\n this.sendOAuthError(res, 400, 'invalid_request', `the '${malformedTokenParam}' parameter must be a single string value`);\n return;\n }\n // Source IP for the per-IP machine-auth failure lockout (see the machine-auth-rate-limit utils).\n // Cheap header parse; only the `client_credentials` grant actually asserts/records against it.\n // security-decision (accepted-low — D11, see .claude/plans/oidc-provider-test-coverage.md § \"ACCEPTED RISK\"):\n // the per-IP brute-force limiter (`assertMachineAuthAttemptWithinRate`) fires ONLY on the client_credentials\n // branch below; the authorization_code + refresh_token secret fronts (and the unauthenticated /oauth/revoke)\n // are DELIBERATELY not per-endpoint rate-limited. 256-bit high-entropy secrets make online guessing\n // infeasible and the global ~1000/min/IP HTTP limiter caps the DoS surface; those fronts are now audited\n // (A-7), so a per-endpoint lockout counter is cheap to add IF the decision is ever revisited.\n const clientIp = getClientIpFromRequest(req);\n\n try {\n let token: unknown;\n if (body.grant_type === 'client_credentials') {\n // Brute-force / DB-read-exhaustion guard: reject a saturated source before the\n // `hashOAuthClientSecret` lookup; the catch below records a failure on `invalid_client`.\n await assertMachineAuthAttemptWithinRate(this.redisService, this.errorBuilder, this.logger, clientIp, this.appConfigService.applicationEnv);\n const { clientId, clientSecret } = this.extractClientCredentials(req, body);\n if (!clientSecret) {\n this.sendOAuthError(res, 401, 'invalid_client', 'missing client credentials');\n return;\n }\n token = await this.tokenService.issueClientCredentialsToken({ clientSecret, clientId, resource: body.resource });\n } else if (body.grant_type === 'authorization_code') {\n // client_id comes from the body (public client) or client auth (confidential); a confidential\n // client ALSO presents client_secret here (client_secret_basic/post), enforced downstream.\n const { clientId, clientSecret } = this.extractClientCredentials(req, body);\n const effectiveClientId = clientId ?? body.client_id;\n if (!effectiveClientId || !body.code || !body.redirect_uri || !body.code_verifier) {\n this.sendOAuthError(res, 400, 'invalid_request', 'code, redirect_uri, code_verifier and client_id are required');\n return;\n }\n token = await this.tokenService.issueAuthorizationCodeToken({\n code: body.code,\n clientId: effectiveClientId,\n redirectUri: body.redirect_uri,\n codeVerifier: body.code_verifier,\n // Presented client secret (if any). REQUIRED for a confidential client, verified during the\n // code exchange; a public (PKCE-only) client presents none.\n clientSecret,\n // RFC 8707 §2.2: a client MAY echo `resource` on the token request. The authorize-bound\n // resource is authoritative; when the token request also names one it MUST match (a\n // confused-deputy cross-check), else `invalid_target`.\n resource: body.resource,\n });\n } else if (body.grant_type === 'refresh_token') {\n if (!body.refresh_token) {\n this.sendOAuthError(res, 400, 'invalid_request', 'refresh_token is required');\n return;\n }\n // Item 5 (OIDC §12.2): pass the presented client credentials so an AUTHENTICATED OIDC client\n // ALSO gets a fresh id_token. The token service authenticates the secret (bad secret ⇒\n // `invalid_client` → 401 via the catch below) before minting; a first-party session refresh\n // presents no credentials → access + refresh only, no id_token.\n const { clientId, clientSecret } = this.extractClientCredentials(req, body);\n token = await this.tokenService.issueRefreshTokenGrant(body.refresh_token, clientId, clientSecret);\n } else {\n this.sendOAuthError(res, 400, 'unsupported_grant_type', `grant_type '${body.grant_type ?? ''}' is not supported`);\n return;\n }\n\n // RFC 6749 §5.1: token responses MUST NOT be cached.\n res.set('Cache-Control', 'no-store');\n res.set('Pragma', 'no-cache');\n this.jsonSuccess(res, token, 200);\n } catch (error) {\n if (isWildoBackendError(error)) {\n const context = (error as { context?: { oauthError?: string; detail?: string } }).context;\n if (context?.oauthError) {\n // Feed the per-IP machine-auth failure lockout AND emit the MACHINE_AUTH_FAILED audit\n // event when a client presented a bad secret to the client-credentials exchange (a guess\n // attempt) — scoped to that grant so authorization_code client-auth failures don't share\n // the machine-front bucket. `invalid_client` = authentication failed (bad secret); the\n // other OAuth errors (unauthorized_client / invalid_scope / invalid_target) are authorized-\n // client request errors, not auth failures, so they neither lock nor emit this event.\n if (context.oauthError === 'invalid_client' && body.grant_type === 'client_credentials') {\n await recordMachineAuthFailure(this.redisService, this.logger, clientIp);\n const presentedSecret = body.client_secret;\n const credentialPrefix = presentedSecret?.startsWith('oc_org_')\n ? 'oc_org_'\n : presentedSecret?.startsWith('oc_app_') ? 'oc_app_' : undefined;\n void this.auditLogs.logMachineAuthFailed({\n credentialKind: 'oauth_client',\n credentialPrefix,\n reason: 'invalid_client',\n ipAddress: clientIp,\n }).catch((auditError) => this.logger.warn('MACHINE_AUTH_FAILED audit emit failed (non-fatal)', {\n ...projectCaughtErrorLogFields(auditError),\n }));\n }\n // RFC 6749 §5.2: `invalid_client` → 401 (with WWW-Authenticate); others → 400.\n // RFC 6749 §5.2 status: invalid_client→401; temporarily_unavailable (server-side\n // misconfig, e.g. an unresolvable issuer/audience)→503; everything else→400. Without the\n // 503 case a server misconfiguration is mislabelled to the client as a 400 bad request.\n this.sendOAuthError(res, context.oauthError === 'invalid_client' ? 401 : context.oauthError === 'temporarily_unavailable' ? 503 : 400, context.oauthError, context.detail);\n return;\n }\n }\n throw error; // unexpected → unified error-handler middleware\n }\n }\n\n /**\n * `GET /oauth/authorize` — OIDC authorization endpoint (authorization_code + PKCE). Called by the\n * BROWSER-FACING frontend consent page (the discovery `authorization_endpoint`), NOT hit directly by a\n * raw third-party browser: the SPA establishes the user session first and calls this with the user's\n * Bearer. Validates the request + resolves the user, then either:\n * - `requiresConsent` client → returns `{ consent_required, consent_token, client, scopes, resource }`\n * JSON (the SPA renders the consent screen, then POSTs the decision to `/oauth/authorize/decision`); or\n * - trusted client (`requiresConsent` false) → mints the code and returns `{ redirect_to }` JSON.\n * BOTH the trusted code path and the consent-decision path return `redirect_to` as JSON (NOT an HTTP\n * 302): the caller is a Bearer-authenticated XHR that auto-follows a 302 but cannot read a cross-origin\n * `Location`, so the SPA completes the OAuth redirect with `window.location.assign(redirect_to)`.\n *\n * Errors are returned DIRECTLY (never redirected) — safe against open-redirect; redirecting\n * OAuth errors for a pre-validated `redirect_uri` (RFC 6749 §4.1.2.1) is a follow-up.\n */\n /** The deployment's dynamic-registration posture. Absent ⇒ disabled. */\n private dynamicRegistrationConfiguration(): DynamicClientRegistrationConfig {\n const authored = (this.appConfigService.config?.auth as { dynamicClientRegistration?: DynamicClientRegistrationConfig } | undefined)?.dynamicClientRegistration;\n return {\n enabled: authored?.enabled ?? false,\n maxRegistrationsPerHourPerIp: authored?.maxRegistrationsPerHourPerIp ?? 10,\n };\n }\n\n /**\n * `POST /oauth/register` — RFC 7591 dynamic client registration.\n *\n * ## What this endpoint is, stated plainly\n *\n * An UNAUTHENTICATED write primitive. Anyone who can reach it creates a durable row in this\n * application's database. That is not a flaw in the design — it is the design, and it is why the\n * endpoint is off by default, rate-limited per source IP, and why everything it creates is\n * confined to the weakest posture the framework can express.\n *\n * ## The four confinements, and why each one is not optional\n *\n * 1. **No roles, ever.** Roles are this framework's single authorization axis. A caller who\n * could name its own roles at an anonymous endpoint would have found a total privilege\n * escalation — the exact bypass `buildOAuthClientMintHandlers`' role-ceiling gate exists to\n * prevent for AUTHENTICATED callers. A request that ASKS for roles is REFUSED rather than\n * quietly downgraded: a client that believes it holds authority it does not have will fail\n * later in a way neither side can diagnose.\n * 2. **Identity scopes only** (`openid`/`profile`/`email`), for the same reason CIMD is capped\n * there: the ceiling would otherwise be authored by the party it constrains.\n * 3. **`registrationOrigin: DYNAMIC`**, which `adaptRegisteredClient` maps to\n * `UNAFFILIATED` — so the row lands on the APPLICATION collection for want of an\n * organization WITHOUT inheriting the platform-operator first-party posture that\n * `scope: APPLICATION` normally carries. This is the whole reason the field exists.\n * 4. **`authorization_code` only.** `client_credentials` is the machine front, where a client\n * acts as ITSELF with its own roles. A self-registered client acting on its own behalf is a\n * principal nobody vouched for; it may only ever act FOR A USER who consented.\n *\n * ## What is deliberately NOT issued\n *\n * No `client_secret`. The client is public (`token_endpoint_auth_method: none`) and authenticates\n * with PKCE, which is what MCP's own worked example registers. A row still persists inert secret\n * material because `hashedSecret` is required by the client schema; the REJECTED alternative was\n * making that field optional, which is a reshape across every OAuth-client surface for the sake of\n * one caller. Nothing can present the inert secret — it is never returned and never regenerated.\n *\n * spec-cite: RFC 7591 § 3.1 — client registration request; § 3.2.1 — client information response.\n * spec-cite: MCP 2025-11-25 — Authorization § Dynamic Client Registration (\"included for\n * backwards compatibility with earlier versions of the MCP authorization spec\"), which is why\n * this ships OFF by default while CIMD is the recommended path.\n */\n private async handleDynamicRegistration(req: Request, res: Response): Promise<void> {\n const configuration = this.dynamicRegistrationConfiguration();\n if (!configuration.enabled) {\n // 404, not 403: an application that has not opted in should be indistinguishable from one\n // whose framework never had the endpoint. A 403 would advertise a capability that is one\n // config flag away, and invite probing for the flag.\n res.status(404).json({ error: 'not_found' });\n return;\n }\n\n const clientIp = getClientIpFromRequest(req);\n // The ONLY thing between an unauthenticated endpoint and unbounded row creation. Applied before\n // any parsing so a malformed flood costs no more than a well-formed one.\n const withinRate = await this.withinDynamicRegistrationRate(clientIp, configuration);\n if (!withinRate) {\n res.status(429).json({ error: 'temporarily_unavailable', error_description: 'too many client registrations from this source' });\n return;\n }\n\n const body = (req.body ?? {}) as Record<string, unknown>;\n\n // RFC 7591 § 2: `redirect_uris` is REQUIRED for a client using the authorization_code grant.\n const redirectUris = body.redirect_uris;\n if (!Array.isArray(redirectUris) || redirectUris.length === 0 || !redirectUris.every((uri): uri is string => typeof uri === 'string')) {\n this.sendRegistrationError(res, 'invalid_redirect_uri', 'redirect_uris must be a non-empty array of strings');\n return;\n }\n // Each URI must independently pass the SAME safety refine every registered client faces —\n // https anywhere, http loopback only, no javascript:/data:, no fragment, no embedded\n // credentials. Checked HERE as well as by the schema so the refusal names the offending value\n // rather than surfacing as a generic validation failure on a system write.\n const unsafe = redirectUris.find((uri) => !isSafeOAuthRedirectUri(uri));\n if (unsafe) {\n this.sendRegistrationError(res, 'invalid_redirect_uri', `redirect_uri is not permitted: ${unsafe}`);\n return;\n }\n\n // revocation-C: `post_logout_redirect_uris` — OPTIONAL OIDC RP-Initiated Logout client metadata (unlike\n // `redirect_uris`, which RFC 7591 requires for authorization_code). When present it must be an array of\n // strings, each held to the SAME `isSafeOAuthRedirectUri` gate as a redirect URI (so a registered\n // post-logout target can never become an open-redirect / off-origin navigation). Absent ⇒ [] (the client\n // simply cannot pass a `post_logout_redirect_uri` to `/oauth/end-session`).\n let postLogoutRedirectUris: string[] = [];\n if (body.post_logout_redirect_uris !== undefined) {\n if (!Array.isArray(body.post_logout_redirect_uris) || !body.post_logout_redirect_uris.every((uri): uri is string => typeof uri === 'string')) {\n this.sendRegistrationError(res, 'invalid_client_metadata', 'post_logout_redirect_uris must be an array of strings');\n return;\n }\n const unsafePostLogout = body.post_logout_redirect_uris.find((uri) => !isSafeOAuthRedirectUri(uri));\n if (unsafePostLogout) {\n this.sendRegistrationError(res, 'invalid_client_metadata', `post_logout_redirect_uri is not permitted: ${unsafePostLogout}`);\n return;\n }\n postLogoutRedirectUris = body.post_logout_redirect_uris;\n }\n\n const clientName = typeof body.client_name === 'string' && body.client_name.trim().length > 0\n ? body.client_name.trim().slice(0, 100)\n : undefined;\n if (!clientName) {\n this.sendRegistrationError(res, 'invalid_client_metadata', 'client_name is required');\n return;\n }\n\n // CONFINEMENT 1 — refuse, never downgrade. `roles` is not an RFC 7591 field at all, so its\n // presence is either a probe or a client that fundamentally misunderstands this endpoint.\n if (body.roles !== undefined) {\n this.sendRegistrationError(res, 'invalid_client_metadata', 'roles cannot be requested at dynamic registration');\n return;\n }\n // CONFINEMENT 2 — a scope request wider than identity is refused for the same reason.\n const requestedScopes = typeof body.scope === 'string' ? body.scope.split(/\\s+/).filter(Boolean) : [];\n const beyondIdentity = requestedScopes.filter((scope) => !OIDC_SUPPORTED_IDENTITY_SCOPES.includes(scope));\n if (beyondIdentity.length > 0) {\n this.sendRegistrationError(res, 'invalid_client_metadata', `scope(s) not available to a dynamically registered client: ${beyondIdentity.join(', ')}`);\n return;\n }\n // CONFINEMENT 4 — authorization_code only.\n //\n // `refresh_token` is TOLERATED here and then NOT granted, and the asymmetry with confinements 1\n // and 2 (which refuse rather than downgrade) is deliberate — do not \"fix\" it into a refusal.\n // A conformant MCP client is TOLD to ask: clients that desire refresh tokens \"SHOULD include\n // `refresh_token` in their `grant_types` client metadata\", and in the same breath \"MUST NOT\n // assume refresh tokens will be issued; the AS retains discretion\". Refusing the registration\n // would therefore reject well-behaved clients for following their own specification, whereas\n // roles and wide scopes are things no client is ever instructed to request here.\n //\n // Substituting instead of refusing is the sanctioned shape: the AS \"MAY reject or replace any of\n // the client's requested metadata values submitted during the registration and substitute them\n // with suitable values\", and MUST \"return all registered metadata about this client\" — which the\n // 201 echo below does, so `grant_types: [\"authorization_code\"]` IS the notification that the\n // request was narrowed. There is no second signal, and per the discretion clause above none is\n // owed.\n //\n // OPEN DESIGN QUESTION, recorded rather than silently settled: whether a dynamically registered\n // PUBLIC client should be granted refresh at all. Granting it extends an anonymous\n // self-registered client's reach without a fresh consent; withholding it means such a client\n // re-consents when its access token expires. Today it is withheld. That is a security posture,\n // not an oversight, and changing it is a deliberate decision — not a bug fix.\n //\n // spec-cite: MCP 2026-07-28 — Authorization § Refresh Tokens\n // (<https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization>).\n // spec-cite: RFC 7591 § 3.2.1 — Client Information Response.\n const requestedGrants = Array.isArray(body.grant_types) ? body.grant_types : [OAuthGrantType.AUTHORIZATION_CODE];\n const forbiddenGrant = requestedGrants.find((grant) => grant !== OAuthGrantType.AUTHORIZATION_CODE && grant !== OAuthGrantType.REFRESH_TOKEN);\n if (forbiddenGrant) {\n this.sendRegistrationError(res, 'invalid_client_metadata', `grant_type not available to a dynamically registered client: ${String(forbiddenGrant)}`);\n return;\n }\n // A confidential auth method would require a secret this endpoint deliberately does not issue.\n const requestedAuthMethod = body.token_endpoint_auth_method;\n if (requestedAuthMethod !== undefined && requestedAuthMethod !== OAuthTokenEndpointAuthMethod.NONE) {\n this.sendRegistrationError(res, 'invalid_client_metadata', 'only token_endpoint_auth_method=none is available to a dynamically registered client');\n return;\n }\n\n const secretMaterial = generateOAuthClientSecretMaterial(ApiKeyScope.APPLICATION);\n // RFC 7592 §3: the registration response carries a `registration_access_token` the client uses at\n // the client configuration endpoint, and a `registration_client_uri` naming that endpoint. Minted\n // here and returned exactly once — there is no way to recover it afterwards, which is why §5 says\n // it \"SHOULD NOT expire while a client is still actively registered\".\n const registrationTokenMaterial = generateRegistrationAccessTokenMaterial();\n const created = await this.systemAccess.createAsSystem(CoreResourceType.OAUTH_CLIENTS_APPLICATION, {\n name: clientName,\n scope: ApiKeyScope.APPLICATION,\n applicationId: this.appConfigService.applicationId,\n // Every confinement, as DATA on the row — so a later read does not have to re-derive them.\n roles: [],\n allowedScopes: requestedScopes.length > 0 ? requestedScopes : [...OIDC_SUPPORTED_IDENTITY_SCOPES],\n allowedGrants: [OAuthGrantType.AUTHORIZATION_CODE],\n redirectUris,\n postLogoutRedirectUris,\n tokenEndpointAuthMethod: OAuthTokenEndpointAuthMethod.NONE,\n // Belt to `adaptRegisteredClient`'s braces: the resolver forces consent for a DYNAMIC client\n // regardless, but a row that also SAYS so cannot mislead an operator reading the collection.\n requiresConsent: true,\n registrationOrigin: OAuthClientRegistrationOrigin.DYNAMIC,\n hashedSecret: secretMaterial.hashedSecret,\n secretPrefix: secretMaterial.secretPrefix,\n registrationAccessTokenHash: registrationTokenMaterial.registrationAccessTokenHash,\n registrationAccessTokenPrefix: registrationTokenMaterial.registrationAccessTokenPrefix,\n }, {\n // `registrationOrigin`, `hashedSecret` and `secretPrefix` all carry\n // `.excludeFromCreate()` — they are server-managed precisely so no caller can author them.\n // This endpoint IS the server-side door, so it re-attaches them explicitly.\n preserveServerInjectedFields: [\n 'registrationOrigin', 'hashedSecret', 'secretPrefix',\n // Same reason as the two above: server-managed, so `.excludeFromCreate()` strips them and\n // this endpoint — the server-side door — re-attaches them explicitly. Omitting them here\n // would persist a client with NO registration access token, and every management call would\n // then fail 401 with nothing to diagnose.\n 'registrationAccessTokenHash', 'registrationAccessTokenPrefix',\n ],\n }) as { _id: string };\n\n // assurance-control: WILDO.IDENTITY.CLIENT_IDENTITY_ASSERTION — an anonymous party created a\n // client identity in this application. Fire-and-forget; auditing must never fail the request it\n // observes, and the row exists either way.\n void this.auditLogs.logDynamicClientRegistered({\n clientId: created._id,\n clientName,\n redirectUris,\n postLogoutRedirectUris,\n ipAddress: clientIp,\n }).catch((auditError) => this.logger.warn('DYNAMIC_CLIENT_REGISTERED audit emit failed (non-fatal)', {\n ...projectCaughtErrorLogFields(auditError),\n }));\n\n res.set('Cache-Control', 'no-store');\n // RFC 7591 § 3.2.1: 201 Created, and the response echoes the registered metadata so the client\n // can see exactly what was accepted — including the fields we NARROWED, which is how a client\n // learns it is confined rather than discovering it at the token endpoint.\n this.jsonSuccess(res, {\n client_id: created._id,\n client_id_issued_at: Math.floor(Date.now() / 1000),\n client_name: clientName,\n redirect_uris: redirectUris,\n post_logout_redirect_uris: postLogoutRedirectUris,\n grant_types: [OAuthGrantType.AUTHORIZATION_CODE],\n response_types: ['code'],\n token_endpoint_auth_method: OAuthTokenEndpointAuthMethod.NONE,\n scope: (requestedScopes.length > 0 ? requestedScopes : [...OIDC_SUPPORTED_IDENTITY_SCOPES]).join(' '),\n // RFC 7592 §3 — both REQUIRED in a registration response that supports management. The token\n // appears here and NOWHERE else, ever.\n registration_access_token: registrationTokenMaterial.plainToken,\n registration_client_uri: this.registrationClientUri(created._id),\n }, 201);\n }\n\n /**\n * The client configuration endpoint URL for one client — RFC 7592 §3's `registration_client_uri`.\n *\n * Built from the same issuer the discovery document advertises, so a client that resolved this\n * server through discovery reaches the same origin here.\n */\n private registrationClientUri(clientId: string): string {\n const template = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_REGISTER_CLIENT];\n const issuer = this.appConfigService.resolveApiResourceAudience();\n return `${issuer}${template.replace(':clientId', encodeURIComponent(clientId))}`;\n }\n\n /**\n * The SINGLE seam through which every OAuth authorization RESPONSE leaves this server.\n *\n * It exists to make one invariant unbypassable rather than hand-applied: **every** authorization\n * response carries the RFC 9207 `iss` parameter. There are three responses today — the trusted-client\n * code path, the consent APPROVE path, and the consent DENY path — and the specification requires the\n * parameter on all of them, \"including error responses\". A fourth response added later cannot forget,\n * because emitting one means calling this.\n * spec-cite: MCP 2026-07-28 — Authorization § Authorization Response Validation.\n *\n * `iss` is the mix-up defence: it lets a client that talks to more than one authorization server\n * verify that the response came from the one it started the flow with, before it hands the code to a\n * token endpoint. Without it, a client with several configured servers can be induced to redeem a code\n * at the wrong one.\n *\n * **Fails closed when the issuer is unresolvable, and that is the point.** A conformant client MUST\n * REJECT a response whose `iss` is missing when the server advertises\n * `authorization_response_iss_parameter_supported: true` — so silently omitting the parameter would\n * turn a local misconfiguration into a response the client is obliged to throw away, with no\n * diagnosis. Refusing here names the cause instead. `503` rather than `400` because an unresolvable\n * issuer is this deployment's fault, never the caller's — matching `handleDiscovery`, which already\n * refuses on the same condition.\n *\n * spec-cite: MCP 2026-07-28 — Authorization § Authorization Response Validation (the SHOULD to\n * include `iss`, the MUST to advertise it, and the client action table whose `true` + absent row is\n * \"Reject the response\").\n * spec-cite: RFC 9207 § 2 — `iss` in the authorization response; § 2.3 — metadata advertisement.\n */\n private sendAuthorizationRedirect(res: Response, redirect: URL): void {\n const issuer = this.appConfigService.resolveApiResourceAudience();\n if (!issuer) {\n this.sendOAuthError(res, 503, 'temporarily_unavailable', 'issuer URL is not resolvable');\n return;\n }\n redirect.searchParams.set('iss', issuer);\n res.set('Cache-Control', 'no-store');\n this.jsonSuccess(res, { redirect_to: redirect.toString() }, 200);\n }\n\n /** RFC 7591 § 3.2.2 registration-error response: 400 + `error` / `error_description`. */\n /* ───────────────────────────────────────────────────────────────────────────\n * RFC 7592 — client configuration endpoint\n * ──────────────────────────────────────────────────────────────────────── */\n\n /**\n * Authenticate a call to the client configuration endpoint, or answer and return null.\n *\n * Every RFC 7592 verb shares this, so the refusal ladder cannot drift between them — which is the\n * whole reason it is a helper rather than three copies. The ladder, and why each rung is the code\n * it is:\n *\n * - **404 when the application has not opted in.** Identical to `/oauth/register`: an application\n * without dynamic registration should be indistinguishable from one whose framework never had\n * the endpoint, so a 403 would advertise a capability one config flag away.\n * - **401 with `WWW-Authenticate` when the Bearer token is absent or malformed.** \"The client MUST\n * use its registration access token in all calls to this endpoint as an OAuth 2.0 Bearer Token.\"\n * spec-cite: RFC 7592 §2.\n * - **401 when the client does not exist.** \"If the client does not exist on this server, the\n * server MUST respond with HTTP 401 Unauthorized and the registration access token used to make\n * this request SHOULD be immediately revoked.\" spec-cite: RFC 7592 §2.1. The SHOULD is moot for\n * us: a token for a client that does not exist has no row to revoke, so there is nothing to do.\n * - **403 when the client exists but was not dynamically registered.** \"If the client does not have\n * permission to read its record, the server MUST return an HTTP 403 Forbidden.\" spec-cite: RFC\n * 7592 §2.1. An operator- or organization-registered client is administered through the ordinary\n * authenticated resource surface; it holds no registration access token and must not be\n * reachable here even if one were somehow presented.\n * - **401 when the presented token does not match.**\n *\n * Note the deliberate asymmetry: an unknown client is 401 and a known-but-ineligible one is 403,\n * which is what the specification asks for even though it leaks that a client id exists. That\n * disclosure is bounded — the caller already had to supply the id — and diverging from the\n * specification here would break a conformant client's error handling.\n */\n private async authenticateClientConfiguration(\n req: Request,\n res: Response,\n ): Promise<{ clientId: string; record: OAuthClientApplication } | null> {\n if (!this.dynamicRegistrationConfiguration().enabled) {\n res.status(404).json({ error: 'not_found' });\n return null;\n }\n\n const header = req.headers.authorization;\n const presented = typeof header === 'string' && header.startsWith('Bearer ')\n ? header.slice('Bearer '.length).trim()\n : undefined;\n if (!presented) {\n this.sendClientConfigurationUnauthorized(res, 'a registration access token is required');\n return null;\n }\n\n const clientId = String(req.params.clientId ?? '');\n if (!clientId) {\n this.sendClientConfigurationUnauthorized(res, 'unknown client');\n return null;\n }\n\n const record = await this.systemAccess.readAsSystem<OAuthClientApplication>(\n CoreResourceType.OAUTH_CLIENTS_APPLICATION,\n clientId,\n ).catch(() => null);\n if (!record) {\n this.sendClientConfigurationUnauthorized(res, 'unknown client');\n return null;\n }\n\n if (record.registrationOrigin !== OAuthClientRegistrationOrigin.DYNAMIC) {\n res.set('Cache-Control', 'no-store');\n res.status(403).json({ error: 'access_denied', error_description: 'this client is not managed through dynamic registration' });\n return null;\n }\n\n /*\n * A DEPROVISIONED client is not manageable, and this rung is what makes its registration access\n * token invalid.\n *\n * \"If a client is deprovisioned from a server, any outstanding registration access token for\n * that client MUST be invalidated at the same time.\" spec-cite: RFC 7592 §5. A token that\n * authenticates at no endpoint is invalidated in the only sense that matters — so `DELETE` marks\n * the client `INACTIVE` and this refuses every later call, rather than clearing the stored hash\n * and losing the record of which token the client held, which an operator investigating a\n * deleted client wants.\n */\n if (record.status !== OAuthClientStatus.ACTIVE) {\n this.sendClientConfigurationUnauthorized(res, 'invalid registration access token');\n return null;\n }\n\n const storedHash = record.registrationAccessTokenHash;\n // Compared through `timingSafeEqual` over the two DIGESTS: both are fixed-length hex, so the\n // buffers can never differ in length and the comparison cannot leak a prefix match by timing.\n if (!storedHash || !this.registrationTokenMatches(presented, storedHash)) {\n this.sendClientConfigurationUnauthorized(res, 'invalid registration access token');\n return null;\n }\n\n return { clientId, record };\n }\n\n /**\n * Constant-time comparison of a presented registration access token against the stored digest.\n *\n * Both sides are SHA-256 hex, so they are always the same length and `timingSafeEqual` cannot\n * throw — which is why the digests are compared rather than the raw values.\n */\n private registrationTokenMatches(presented: string, storedHash: string): boolean {\n const presentedDigest = Buffer.from(hashRegistrationAccessToken(presented), 'hex');\n const storedDigest = Buffer.from(storedHash, 'hex');\n if (presentedDigest.length !== storedDigest.length || presentedDigest.length === 0) return false;\n return timingSafeEqual(presentedDigest, storedDigest);\n }\n\n /**\n * RFC 6750 §3 shape for every unauthenticated refusal at this endpoint.\n *\n * One description for a missing token and a wrong one, on purpose: distinguishing them tells an\n * unauthenticated caller which half of its guess was right.\n */\n private sendClientConfigurationUnauthorized(res: Response, description: string): void {\n res.set('Cache-Control', 'no-store');\n res.set('WWW-Authenticate', 'Bearer error=\"invalid_token\"');\n res.status(401).json({ error: 'invalid_token', error_description: description });\n }\n\n /**\n * The client information response body — RFC 7592 §3, minus the two members §2.2 forbids a client\n * to send back.\n *\n * `registration_access_token` is NOT echoed on read or update. It is returned once, at\n * registration, and we do not rotate it: §5 permits rotation on a read or update (\"MAY\"), and\n * taking that option means a client that loses the response has silently lost management access\n * for good. The specification's own preference — \"SHOULD NOT expire while a client is still\n * actively registered\" — points the same way.\n */\n private clientInformationResponse(clientId: string, record: OAuthClientApplication): Record<string, unknown> {\n return {\n client_id: clientId,\n client_name: record.name,\n redirect_uris: record.redirectUris ?? [],\n post_logout_redirect_uris: record.postLogoutRedirectUris ?? [],\n grant_types: record.allowedGrants ?? [],\n response_types: ['code'],\n token_endpoint_auth_method: record.tokenEndpointAuthMethod,\n scope: (record.allowedScopes ?? []).join(' '),\n registration_client_uri: this.registrationClientUri(clientId),\n };\n }\n\n /**\n * `GET /oauth/register/:clientId` — RFC 7592 §2.1 Client Read Request.\n *\n * \"the authorization server responds with an HTTP 200 OK with content type of `application/json`\".\n * spec-cite: RFC 7592 §2.1.\n */\n private async handleClientConfigurationRead(req: Request, res: Response): Promise<void> {\n const authenticated = await this.authenticateClientConfiguration(req, res);\n if (!authenticated) return;\n\n res.set('Cache-Control', 'no-store');\n this.jsonSuccess(res, this.clientInformationResponse(authenticated.clientId, authenticated.record), 200);\n }\n\n /**\n * `PUT /oauth/register/:clientId` — RFC 7592 §2.2 Client Update Request.\n *\n * **Full replacement, not a patch, and that is the specification's choice rather than ours:** \"This\n * request MUST include all client metadata fields as returned to the client from a previous\n * registration, read, or update operation\" and \"Omitted fields MUST be treated as null or empty\n * values by the server, indicating the client's request to delete them from the client's\n * registration.\" spec-cite: RFC 7592 §2.2.\n *\n * So a client that sends only the field it wants to change DELETES everything else. That is\n * surprising, it is what the specification requires, and it is why `redirect_uris` is re-validated\n * on every update rather than assumed still present.\n *\n * Every confinement the registration endpoint applies is re-applied here, in the same order. A\n * client that could widen its scopes, add a grant or change its auth method through an update\n * would have found a way around the registration confinements by taking one extra step.\n */\n private async handleClientConfigurationUpdate(req: Request, res: Response): Promise<void> {\n const authenticated = await this.authenticateClientConfiguration(req, res);\n if (!authenticated) return;\n const { clientId, record } = authenticated;\n\n const body = (req.body ?? {}) as Record<string, unknown>;\n\n // \"The client MUST include its `client_id` field in the request, and it MUST be the same as its\n // currently issued client identifier.\" spec-cite: RFC 7592 §2.2. A mismatch is the client\n // addressing one registration and describing another, which is a client bug worth naming.\n if (body.client_id !== clientId) {\n this.sendRegistrationError(res, 'invalid_client_metadata', 'client_id must be present and must match the client being updated');\n return;\n }\n\n // \"The updated client metadata fields request MUST NOT include the `registration_access_token`,\n // `registration_client_uri`, `client_secret_expires_at`, or `client_id_issued_at` fields.\"\n // spec-cite: RFC 7592 §2.2. Refused rather than ignored: a client sending one has misunderstood\n // the contract, and silently dropping it would leave it believing it had rotated its own token.\n const forbidden = ['registration_access_token', 'registration_client_uri', 'client_secret_expires_at', 'client_id_issued_at']\n .find((field) => body[field] !== undefined);\n if (forbidden) {\n this.sendRegistrationError(res, 'invalid_client_metadata', `${forbidden} must not be included in an update request`);\n return;\n }\n\n // \"If the client includes the `client_secret` field in the request, the value of this field MUST\n // match the currently issued client secret for that client. The client MUST NOT be allowed to\n // overwrite its existing client secret with its own chosen value.\" spec-cite: RFC 7592 §2.2.\n // A dynamically registered client is PUBLIC and never received a secret, so any value it sends\n // cannot match one — refuse rather than compare against a secret it does not have.\n if (body.client_secret !== undefined) {\n this.sendRegistrationError(res, 'invalid_client_metadata', 'this client has no client secret to confirm');\n return;\n }\n\n const redirectUris = body.redirect_uris;\n if (!Array.isArray(redirectUris) || redirectUris.length === 0 || !redirectUris.every((uri): uri is string => typeof uri === 'string')) {\n this.sendRegistrationError(res, 'invalid_redirect_uri', 'redirect_uris must be a non-empty array of strings');\n return;\n }\n const unsafe = redirectUris.find((uri) => !isSafeOAuthRedirectUri(uri));\n if (unsafe) {\n this.sendRegistrationError(res, 'invalid_redirect_uri', `redirect_uri is not permitted: ${unsafe}`);\n return;\n }\n\n // Omitted ⇒ emptied, per §2.2. That is the whole reason this reads as a replacement.\n let postLogoutRedirectUris: string[] = [];\n if (body.post_logout_redirect_uris !== undefined) {\n if (!Array.isArray(body.post_logout_redirect_uris) || !body.post_logout_redirect_uris.every((uri): uri is string => typeof uri === 'string')) {\n this.sendRegistrationError(res, 'invalid_client_metadata', 'post_logout_redirect_uris must be an array of strings');\n return;\n }\n const unsafePostLogout = body.post_logout_redirect_uris.find((uri) => !isSafeOAuthRedirectUri(uri));\n if (unsafePostLogout) {\n this.sendRegistrationError(res, 'invalid_client_metadata', `post_logout_redirect_uri is not permitted: ${unsafePostLogout}`);\n return;\n }\n postLogoutRedirectUris = body.post_logout_redirect_uris;\n }\n\n const clientName = typeof body.client_name === 'string' && body.client_name.trim().length > 0\n ? body.client_name.trim().slice(0, 100)\n : undefined;\n if (!clientName) {\n this.sendRegistrationError(res, 'invalid_client_metadata', 'client_name is required');\n return;\n }\n\n // The registration confinements, re-applied. See `handleDynamicRegistration` for why each one\n // refuses rather than downgrades; the reasoning is identical and is not repeated here.\n if (body.roles !== undefined) {\n this.sendRegistrationError(res, 'invalid_client_metadata', 'roles cannot be requested at dynamic registration');\n return;\n }\n const requestedScopes = typeof body.scope === 'string' ? body.scope.split(/\\s+/).filter(Boolean) : [];\n const beyondIdentity = requestedScopes.filter((scope) => !OIDC_SUPPORTED_IDENTITY_SCOPES.includes(scope));\n if (beyondIdentity.length > 0) {\n this.sendRegistrationError(res, 'invalid_client_metadata', `scope(s) not available to a dynamically registered client: ${beyondIdentity.join(', ')}`);\n return;\n }\n const requestedGrants = Array.isArray(body.grant_types) ? body.grant_types : [OAuthGrantType.AUTHORIZATION_CODE];\n const forbiddenGrant = requestedGrants.find((grant) => grant !== OAuthGrantType.AUTHORIZATION_CODE && grant !== OAuthGrantType.REFRESH_TOKEN);\n if (forbiddenGrant) {\n this.sendRegistrationError(res, 'invalid_client_metadata', `grant_type not available to a dynamically registered client: ${String(forbiddenGrant)}`);\n return;\n }\n const requestedAuthMethod = body.token_endpoint_auth_method;\n if (requestedAuthMethod !== undefined && requestedAuthMethod !== OAuthTokenEndpointAuthMethod.NONE) {\n this.sendRegistrationError(res, 'invalid_client_metadata', 'only token_endpoint_auth_method=none is available to a dynamically registered client');\n return;\n }\n\n const updated = await this.systemAccess.updateAsSystem<OAuthClientApplication>(\n CoreResourceType.OAUTH_CLIENTS_APPLICATION,\n clientId,\n {\n name: clientName,\n redirectUris,\n postLogoutRedirectUris,\n allowedScopes: requestedScopes.length > 0 ? requestedScopes : [...OIDC_SUPPORTED_IDENTITY_SCOPES],\n },\n );\n if (!updated) {\n this.sendClientConfigurationUnauthorized(res, 'unknown client');\n return;\n }\n\n // assurance-control: WILDO.IDENTITY.CLIENT_IDENTITY_ASSERTION — a self-registered client changed\n // its own registration. Same standing as the registration itself, so the same audit concern:\n // `redirect_uris` is where a client's authorization responses are delivered, and an update is the\n // one way that set moves after registration.\n void this.auditLogs.logDynamicClientRegistered({\n clientId,\n clientName,\n redirectUris,\n postLogoutRedirectUris,\n ipAddress: getClientIpFromRequest(req),\n }).catch((auditError) => this.logger.warn('DYNAMIC_CLIENT_REGISTERED audit emit failed on update (non-fatal)', {\n ...projectCaughtErrorLogFields(auditError),\n }));\n\n res.set('Cache-Control', 'no-store');\n this.jsonSuccess(res, this.clientInformationResponse(clientId, { ...record, ...updated }), 200);\n }\n\n /**\n * `DELETE /oauth/register/:clientId` — RFC 7592 §2.3 Client Delete Request.\n *\n * \"If a client has been successfully deprovisioned, the authorization server MUST respond with an\n * HTTP 204 No Content message.\" spec-cite: RFC 7592 §2.3.\n *\n * **Deprovisioned by STATUS, not by removing the row**, and the row is what makes that sound: every\n * client-resolution path in this server refuses a non-`ACTIVE` client, so `INACTIVE` is\n * indistinguishable from absent to any protocol caller — while the row survives for the audit\n * trail, which is the thing an operator investigating a deleted client actually needs.\n *\n * The registration access token is invalidated by the same write, though not by being erased:\n * `authenticateClientConfiguration` refuses a non-`ACTIVE` client before it ever compares a token,\n * so the token authenticates nowhere from this moment. \"If a client is deprovisioned from a server,\n * any outstanding registration access token for that client MUST be invalidated at the same time.\"\n * spec-cite: RFC 7592 §5. Keeping the digest on the row costs nothing and preserves the record of\n * which token the client held, which an operator investigating a deleted client wants.\n *\n * **NOT DONE, and stated rather than implied:** \"If possible, the authorization server SHOULD\n * immediately invalidate all existing authorization grants and currently active access tokens, all\n * refresh tokens, and all other tokens associated with this client.\" spec-cite: RFC 7592 §2.3.\n * Already-issued access tokens keep working until they expire. Reaching them means driving the\n * revocation machinery over every token minted for this client, which is a larger change than this\n * endpoint; the client cannot obtain NEW tokens the moment this returns, because the token endpoint\n * resolves the client and refuses it.\n */\n private async handleClientConfigurationDelete(req: Request, res: Response): Promise<void> {\n const authenticated = await this.authenticateClientConfiguration(req, res);\n if (!authenticated) return;\n const { clientId } = authenticated;\n\n const deprovisioned = await this.systemAccess.updateAsSystem<OAuthClientApplication>(\n CoreResourceType.OAUTH_CLIENTS_APPLICATION,\n clientId,\n { status: OAuthClientStatus.INACTIVE },\n );\n if (!deprovisioned) {\n this.sendClientConfigurationUnauthorized(res, 'unknown client');\n return;\n }\n\n res.set('Cache-Control', 'no-store');\n res.status(204).send();\n }\n\n private sendRegistrationError(res: Response, error: string, description: string): void {\n res.set('Cache-Control', 'no-store');\n res.status(400).json({ error, error_description: description });\n }\n\n /**\n * Per-source-IP registration budget.\n *\n * Fail-CLOSED on a store error, which is the opposite of how most rate limits behave here and is\n * deliberate: elsewhere a limiter outage degrades an authenticated feature, whereas this one is\n * the sole restraint on anonymous row creation. Refusing registrations during a Redis outage\n * costs a client one retry; failing open costs the database.\n */\n private async withinDynamicRegistrationRate(clientIp: string | undefined, configuration: DynamicClientRegistrationConfig): Promise<boolean> {\n try {\n const key = `oauth-dynamic-registration:${clientIp ?? 'unknown'}`;\n const count = await this.redisService.incrementRateLimit(key, 3600);\n return count <= configuration.maxRegistrationsPerHourPerIp;\n } catch (error) {\n this.logger.warn('Dynamic-registration rate check failed; refusing (fail-closed)', {\n ...projectCaughtErrorLogFields(error),\n });\n return false;\n }\n }\n\n private async handleAuthorize(req: Request, res: Response): Promise<void> {\n const q = req.query as Record<string, string | undefined>;\n\n // Single-valued params; a REPEATED query key (Express parses `?scope=a&scope=b` to `string[]`\n // despite the cast) is malformed. Reject cleanly (400) — otherwise `(q.scope).split(...)` throws\n // a 500 and a repeated `resource` reaches the RFC 8707 binding as an array.\n const malformedAuthorizeParam = this.firstMalformedParam(q, ['response_type', 'client_id', 'redirect_uri', 'code_challenge', 'code_challenge_method', 'scope', 'resource', 'state', 'nonce']);\n if (malformedAuthorizeParam) {\n this.sendOAuthError(res, 400, 'invalid_request', `the '${malformedAuthorizeParam}' parameter must be a single string value`);\n return;\n }\n\n if (q.response_type !== 'code') {\n this.sendOAuthError(res, 400, 'unsupported_response_type', 'only response_type=code is supported');\n return;\n }\n if (!q.client_id || !q.redirect_uri) {\n this.sendOAuthError(res, 400, 'invalid_request', 'client_id and redirect_uri are required');\n return;\n }\n if (q.code_challenge_method !== 'S256' || !isValidS256CodeChallenge(q.code_challenge)) {\n // RFC 7636 §4.2: require a well-formed S256 challenge (43 unreserved-base64url chars) at the entry —\n // not merely a present one — so a malformed/low-entropy challenge is rejected before a code is minted.\n this.sendOAuthError(res, 400, 'invalid_request', 'a PKCE S256 code_challenge is required');\n return;\n }\n\n const authenticated = await this.resolveAuthenticatedUser(req);\n if (!authenticated) {\n // The user must authenticate first. A browser-integrated frontend redirects to login here;\n // for an API caller we signal login_required. (Login + consent UI is the frontend follow-up.)\n this.sendOAuthError(res, 401, 'login_required', 'user authentication is required at the authorization endpoint');\n return;\n }\n const { userId, sessionId } = authenticated;\n\n const scope = (q.scope ?? '').split(/\\s+/).filter(Boolean);\n try {\n // S1 (interactive consent): a `requiresConsent` (third-party) client does NOT receive a code\n // straight away — the user must EXPLICITLY approve acting on their behalf. Return\n // `consent_required` + a single-use consent-request token (the frontend renders the consent\n // screen from this and POSTs the decision to `/oauth/authorize/decision`). A trusted /\n // first-party client (`requiresConsent` false — the default) proceeds straight to the code, so\n // machine + trusted flows are UNCHANGED. Server-owned gate: the client cannot suppress it.\n // `userId` is resolved + non-undefined by here (login_required returned above otherwise). Passed so\n // the consent resolver can apply the D4/B same-org gate (a cross-org user always sees consent).\n const consentPosture = await this.authCodeService.resolveAuthorizationClientConsent(q.client_id, q.redirect_uri, userId);\n const { requiresConsent, clientName } = consentPosture;\n // Persistent consent (Item 3, \"remember this app\"): a `requiresConsent` client whose user already\n // has a stored grant covering the requested scopes for this (client, resource) is NOT re-prompted —\n // it falls through to the code-issuance path below (returns `{redirect_to}`), exactly like a trusted\n // client. Scope matching is SUBSET; a request for any new scope re-prompts (see hasCoveringConsentGrant).\n const needsConsent = requiresConsent\n && !(await this.authCodeService.hasCoveringConsentGrant(userId, q.client_id, q.resource, scope));\n if (needsConsent) {\n const { consentToken } = await this.authCodeService.createConsentRequest({\n userId,\n clientId: q.client_id,\n redirectUri: q.redirect_uri,\n scope,\n codeChallenge: q.code_challenge,\n nonce: q.nonce,\n resource: q.resource,\n state: q.state,\n });\n res.set('Cache-Control', 'no-store');\n this.jsonSuccess(res, {\n consent_required: true,\n consent_token: consentToken,\n client: {\n id: q.client_id,\n name: clientName,\n /**\n * How this client's identity was established, and the two DISPLAY obligations that come\n * with a domain-only identity. All three are here because the specification makes them\n * requirements on the authorization server, and the consent screen cannot satisfy a\n * requirement it was never handed the data for:\n *\n * \"Authorization servers … MUST clearly display the redirect URI hostname during\n * authorization\" and \"SHOULD display additional warnings for `localhost`-only redirect\n * URIs\".\n * spec-cite: MCP 2025-11-25 — Authorization § Client ID Metadata Document Security →\n * Localhost Redirect URI Risks\n *\n * `origin` lets the screen say WHICH trust story applies: a registered client was vetted\n * by someone in this application, a CIMD client proved only that it controls a domain.\n * Sent for both origins so the consent screen has one shape, not two.\n */\n origin: consentPosture.origin,\n redirect_uri_hostname: consentPosture.redirectUriHostname,\n loopback_only_redirects: consentPosture.warnsLoopbackOnlyRedirects,\n },\n scopes: scope,\n resource: q.resource ?? null,\n }, 200);\n return;\n }\n const { code } = await this.authCodeService.issueAuthorizationCode({\n userId,\n clientId: q.client_id,\n redirectUri: q.redirect_uri,\n scope,\n codeChallenge: q.code_challenge,\n codeChallengeMethod: 'S256',\n nonce: q.nonce,\n // RFC 8707 resource indicator — the agent (A2A / MCP) endpoint the client wants the token\n // for. Bound into the code here (authoritative), so the token endpoint mints an `aud`-confined\n // delegated token (B-S2). Absent ⇒ the token exchange fails closed with `invalid_target`.\n resource: q.resource,\n // revocation-C: bind the End-User's OP session to the code → id_token `sid`, so an RP logout\n // (end_session) terminates the exact Wildo login session this delegation was authorized from.\n sessionId,\n });\n // U-30 defense: build the redirect target defensively. `q.redirect_uri` already exact-matched a\n // registered URI (each constrained to a parseable absolute URL by `isSafeOAuthRedirectUri`), so this\n // cannot throw through the front door — but fail with a CLEAN OAuth error rather than a raw 500 if a\n // redirectUri was ever persisted bypassing that refine (a seed / createAsSystem / migration).\n let redirect: URL;\n try {\n redirect = new URL(q.redirect_uri);\n } catch {\n this.sendOAuthError(res, 400, 'invalid_request', 'the redirect_uri bound to this request is not a valid URL');\n return;\n }\n redirect.searchParams.set('code', code);\n if (q.state) redirect.searchParams.set('state', q.state);\n // Return the redirect target as JSON (NOT a 302), mirroring `/oauth/authorize/decision`: the caller\n // is the Bearer-authenticated consent SPA (an XHR), which auto-follows a 302 but cannot read a\n // cross-origin `Location` — so a 302 would neither deliver the code to the client nor forward the\n // user. The SPA does `window.location.assign(redirect_to)` to complete the OAuth redirect.\n this.sendAuthorizationRedirect(res, redirect);\n } catch (error) {\n if (isWildoBackendError(error)) {\n const ctx = (error as { context?: { oauthError?: string; detail?: string } }).context;\n if (ctx?.oauthError) {\n this.sendOAuthError(res, ctx.oauthError === 'invalid_client' ? 401 : 400, ctx.oauthError, ctx.detail);\n return;\n }\n }\n throw error;\n }\n }\n\n /**\n * `POST /oauth/authorize/decision` — the interactive-consent decision (S1). After `/oauth/authorize`\n * returned `consent_required` for a `requiresConsent` client, the user's approve/deny is POSTed here\n * with the single-use consent-request token. Bearer-authenticated (the same user who authorized).\n * - `decision=approve` → mint the authorization code from the stashed request → return\n * `{ redirect_to: <redirect_uri>?code=&state= }` (200 JSON).\n * - anything else → DENY → return `{ redirect_to: <redirect_uri>?error=access_denied&state= }`\n * (200 JSON, RFC 6749 §4.1.2.1). No code minted.\n *\n * Returns the redirect target as JSON (NOT an HTTP 302) because the caller is a Bearer-authenticated\n * BROWSER SPA (the interactive consent screen): an XHR carrying the required `Authorization` header\n * auto-follows a 302 and cannot read a cross-origin `Location`, so the SPA could neither read the\n * code nor forward the user. Instead the SPA does `window.location.assign(redirect_to)` to complete\n * the OAuth redirect to the third-party client. The request parameters come from the SERVER-STORED\n * consent token (not the POST body), so the decision cannot tamper with what the user approved.\n */\n private async handleConsentDecision(req: Request, res: Response): Promise<void> {\n const body = (req.body ?? {}) as Record<string, string | undefined>;\n const malformed = this.firstMalformedParam(body, ['consent_token', 'decision', 'remember']);\n if (malformed) {\n this.sendOAuthError(res, 400, 'invalid_request', `the '${malformed}' parameter must be a single string value`);\n return;\n }\n const authenticated = await this.resolveAuthenticatedUser(req);\n if (!authenticated) {\n this.sendOAuthError(res, 401, 'login_required', 'user authentication is required to record a consent decision');\n return;\n }\n const { userId, sessionId } = authenticated;\n if (!body.consent_token || !body.decision) {\n this.sendOAuthError(res, 400, 'invalid_request', 'consent_token and decision are required');\n return;\n }\n\n try {\n const request = await this.authCodeService.consumeConsentRequest(body.consent_token);\n // Bind the decision to the AUTHENTICATED user: the consent token's subject MUST be the caller,\n // so one user cannot approve/deny another user's pending consent (the token is single-use, so\n // this is already consumed — fail closed without minting anything).\n if (request.userId !== userId) {\n // assurance-control: WILDO.ACCESS.AUTHORIZATION_DECISION_AUDIT — a consent-token user-binding violation\n // (one user attempting to act on another user's pending consent) is a textbook cross-user\n // authorization-abuse signal. Fail closed (403) AND audit it (records BOTH principals — actor +\n // victim). The raw consent-token value is deliberately NOT logged (credential hygiene; it is\n // single-use and already consumed). Fire-and-forget — auditing must never affect the fail-closed 403.\n void this.auditLogs.logOAuthConsentBindingViolation({\n authenticatedUserId: userId,\n boundUserId: request.userId,\n clientId: request.clientId,\n ipAddress: getClientIpFromRequest(req),\n }).catch((auditError) => this.logger.warn('OAUTH_CONSENT_BINDING_VIOLATION audit emit failed (non-fatal)', {\n ...projectCaughtErrorLogFields(auditError),\n }));\n this.sendOAuthError(res, 403, 'access_denied', 'the consent request does not belong to the authenticated user');\n return;\n }\n // U-30 defense: the single-use consent token is ALREADY consumed above (its redirect_uri is only known\n // post-consume), so we cannot pre-validate — but a malformed stored redirect_uri must yield a CLEAN OAuth\n // error, not a raw 500 (the token is spent either way; do not also leak a stack trace). Normally\n // impossible — the stored value passed `isSafeOAuthRedirectUri` at authorize time.\n let redirect: URL;\n try {\n redirect = new URL(request.redirectUri);\n } catch {\n this.sendOAuthError(res, 400, 'invalid_request', 'the redirect_uri bound to this consent request is not a valid URL');\n return;\n }\n if (request.state) redirect.searchParams.set('state', request.state);\n res.set('Cache-Control', 'no-store');\n\n if (body.decision !== 'approve') {\n // DENY (or any non-approve value) — fail closed, no code minted.\n // assurance-control: WILDO.IDENTITY.DELEGATED_AUTHORIZATION — user REFUSES third-party delegated access. The\n // binding check above passed, so the denying user IS `request.userId`. Fire-and-forget.\n void this.auditLogs.logOAuthConsentDenied({\n userId: request.userId,\n clientId: request.clientId,\n scopes: request.scope,\n resource: request.resource,\n ipAddress: getClientIpFromRequest(req),\n }).catch((auditError) => this.logger.warn('OAUTH_CONSENT_DENIED audit emit failed (non-fatal)', {\n ...projectCaughtErrorLogFields(auditError),\n }));\n redirect.searchParams.set('error', 'access_denied');\n // An ERROR response carries `iss` too — explicitly required, and the case that matters most:\n // a mix-up victim is likelier to be handed a failure than a success.\n this.sendAuthorizationRedirect(res, redirect);\n return;\n }\n\n const { code } = await this.authCodeService.issueAuthorizationCode({\n userId: request.userId,\n clientId: request.clientId,\n redirectUri: request.redirectUri,\n scope: request.scope,\n codeChallenge: request.codeChallenge,\n codeChallengeMethod: 'S256',\n nonce: request.nonce,\n resource: request.resource,\n // revocation-C: bind the session that COMPLETES the grant (the decision-time authenticated\n // session, verified `request.userId === userId` above) to the code → id_token `sid`. Using the\n // live decision-time session (not the stored authorize-time one) keeps `sid` pointing at a\n // session that is still alive to be terminated by a later RP end_session.\n sessionId,\n });\n // assurance-control: WILDO.IDENTITY.DELEGATED_AUTHORIZATION — user APPROVES third-party delegated access (a\n // code is now issued and the client may act for them). `remembered` flags whether a durable grant was\n // also requested (the grant CREATION itself is audited separately as A-3 inside `upsertConsentGrant`).\n // Fire-and-forget — auditing must never affect the consent the user already gave.\n void this.auditLogs.logOAuthConsentGranted({\n userId: request.userId,\n clientId: request.clientId,\n scopes: request.scope,\n resource: request.resource,\n remembered: body.remember === 'true',\n ipAddress: getClientIpFromRequest(req),\n }).catch((auditError) => this.logger.warn('OAUTH_CONSENT_GRANTED audit emit failed (non-fatal)', {\n ...projectCaughtErrorLogFields(auditError),\n }));\n // Persistent consent (Item 3): if the user opted to remember this app, store/widen the grant so a\n // future authorize with covering scopes skips the prompt. Best-effort — a store failure must NOT\n // fail the consent the user already gave (the code is already minted).\n if (body.remember === 'true') {\n await this.authCodeService\n .upsertConsentGrant(request.userId, request.clientId, request.resource, request.scope)\n .catch((e) => this.logger.warn('Persistent consent grant store failed (non-fatal)', { ...projectCaughtErrorLogFields(e) }));\n }\n redirect.searchParams.set('code', code);\n this.sendAuthorizationRedirect(res, redirect);\n } catch (error) {\n if (isWildoBackendError(error)) {\n const ctx = (error as { context?: { oauthError?: string; detail?: string } }).context;\n if (ctx?.oauthError) {\n this.sendOAuthError(res, ctx.oauthError === 'invalid_client' ? 401 : 400, ctx.oauthError, ctx.detail);\n return;\n }\n }\n throw error;\n }\n }\n\n /**\n * `GET /oauth/userinfo` — returns the authenticated user's claims for a valid user Bearer token\n * (OIDC Core §5.3). Always returns `sub`; adds the standard `email`/`profile`-scope claims the\n * access token was granted, resolved via {@link OidcUserClaimsBackendService}. `picture` (avatar)\n * and `locale` claims are a documented follow-up.\n */\n private async handleUserInfo(req: Request, res: Response): Promise<void> {\n const authHeader = req.headers['authorization'];\n if (typeof authHeader !== 'string' || !authHeader.startsWith('Bearer ')) {\n this.sendOAuthError(res, 401, 'invalid_token', 'a bearer access token is required', 'Bearer');\n return;\n }\n let claim: { type?: string; userId?: string; sub?: string; scope?: string[] };\n try {\n claim = (await this.jwtService.verify(authHeader.slice('Bearer '.length).trim())) as typeof claim;\n } catch {\n this.sendOAuthError(res, 401, 'invalid_token', 'access token invalid or expired', 'Bearer');\n return;\n }\n const sub = claim.userId ?? claim.sub;\n if (!sub || claim.type !== ExecutionContext_ExecutionType.USER_REQUEST) {\n this.sendOAuthError(res, 403, 'insufficient_scope', 'userinfo requires a user access token', 'Bearer');\n return;\n }\n // OIDC Core §5.3.2: `sub` plus the standard claims the access token's granted identity scopes\n // (`email` / `profile`) permit. A token carrying no `scope` claim (e.g. a first-party session\n // token) yields just `sub`. The resolver reads the subject's own User/UserProfile and never\n // throws for a missing profile.\n const claims = await this.userClaimsService.resolveUserClaims(sub, claim.scope ?? []);\n res.set('Cache-Control', 'no-store');\n this.jsonSuccess(res, { sub, ...claims }, 200);\n }\n\n /**\n * Resolve the authenticated user (id + login `sessionId`) from a `Bearer` user access token, else\n * `undefined`. The `sessionId` (revocation-C) is threaded into the OIDC authorization code so the\n * id_token carries `sid` — the handle the RP-Initiated Logout endpoint terminates.\n */\n private async resolveAuthenticatedUser(req: Request): Promise<{ userId: string; sessionId?: string } | undefined> {\n const authHeader = req.headers['authorization'];\n if (typeof authHeader !== 'string' || !authHeader.startsWith('Bearer ')) return undefined;\n try {\n const claim = (await this.jwtService.verify(authHeader.slice('Bearer '.length).trim())) as { type?: string; userId?: string; sessionId?: string };\n if (claim.type !== ExecutionContext_ExecutionType.USER_REQUEST || !claim.userId) return undefined;\n return { userId: claim.userId, sessionId: claim.sessionId };\n } catch {\n return undefined;\n }\n }\n\n /**\n * Resolve the client secret (+ optional client_id) from `client_secret_basic`\n * (Authorization: Basic base64(client_id:client_secret)) or `client_secret_post` (body).\n * Values are URL-safe in this system (`oc_*` secrets + id), so no percent-decoding is needed.\n */\n private extractClientCredentials(req: Request, body: Record<string, string | undefined>): { clientId?: string; clientSecret?: string } {\n const authHeader = req.headers['authorization'];\n if (typeof authHeader === 'string' && authHeader.startsWith('Basic ')) {\n const decoded = Buffer.from(authHeader.slice('Basic '.length).trim(), 'base64').toString('utf8');\n const sep = decoded.indexOf(':');\n if (sep >= 0) {\n return {\n clientId: decoded.slice(0, sep) || undefined,\n clientSecret: decoded.slice(sep + 1) || undefined,\n };\n }\n }\n return { clientId: body.client_id || undefined, clientSecret: body.client_secret || undefined };\n }\n\n /**\n * OAuth/OIDC request params are single-valued STRINGS, but Express (`extended:true` urlencoded, plus\n * `express.json`) parses a REPEATED key into a `string[]` and a bracketed `k[$regex]=…` / JSON\n * `{\"k\":{…}}` key into an OBJECT — despite the `Record<string,string|undefined>` cast at the handler\n * boundary. Returns the first `keys` entry that arrived as a NON-STRING (array, object, number, …), or\n * `undefined`.\n *\n * The caller rejects with `invalid_request` (400) so a non-string can never reach a `.split`/`.includes`\n * (500), slip silently through the RFC 8707 audience comparison, OR — critically — reach a RAW Mongo\n * filter as a `{$regex}` / `{$ne}` operator object. That last case is a NoSQL-operator-injection sink:\n * an object `code`/`token` flows to the consumable-token store's `findOne({ token })` and would\n * consume an arbitrary matching token (password-reset / invitation / magic-link); an object\n * `client_id` selects an arbitrary client. Rejecting EVERY non-string closes both the repeated-param\n * (array) and the injection (object) classes with one guard — an array is simply one kind of non-string.\n */\n private firstMalformedParam(source: Record<string, unknown>, keys: string[]): string | undefined {\n return keys.find((k) => source[k] !== undefined && typeof source[k] !== 'string');\n }\n\n private sendOAuthError(res: Response, status: number, error: string, description?: string, wwwAuthenticate?: 'Basic' | 'Bearer'): void {\n res.set('Cache-Control', 'no-store');\n // Token endpoint 401s challenge `Basic` (client auth); userinfo challenges `Bearer`. Other\n // 401s (e.g. authorize login_required) send no challenge.\n const scheme = wwwAuthenticate ?? (status === 401 ? 'Basic' : undefined);\n if (scheme) res.set('WWW-Authenticate', scheme);\n res.status(status).json({ error, ...(description ? { error_description: description } : {}) });\n }\n}\n"]}
1
+ {"version":3,"file":"oauth-provider-controller.backend.service.js","sourceRoot":"","sources":["../../../../../src/security/authentications/controllers/oauth-provider-controller.backend.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,gCAAgC,EAAE,MAAM,0FAA0F,CAAC;AAC5I,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,kEAAkE,CAAC;AAC9G,OAAO,EAAE,mBAAmB,EAAE,MAAM,kEAAkE,CAAC;AACvG,OAAO,EAAE,2BAA2B,EAAE,MAAM,8EAA8E,CAAC;AAC3H,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,gCAAgC,EAAE,MAAM,2FAA2F,CAAC;AAC7I,OAAO,EAAE,mCAAmC,EAAE,MAAM,8FAA8F,CAAC;AACnJ,OAAO,EAAE,4BAA4B,EAAE,8BAA8B,EAAE,gCAAgC,EAAE,MAAM,uFAAuF,CAAC;AACvM,OAAO,EAAE,eAAe,EAAE,MAAM,yEAAyE,CAAC;AAE1G,OAAO,EAAE,iCAAiC,EAAE,uCAAuC,EAAE,2BAA2B,EAAE,MAAM,iFAAiF,CA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5C,WAAA,MAAM,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,CAAA;IAChD,WAAA,MAAM,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAA;IACvC,WAAA,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;IAC3C,WAAA,MAAM,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAA;IACzC,YAAA,MAAM,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAA;IAC7C,YAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAG9C,YAAA,MAAM,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAA;qCAdA,aAAa;QACM,0BAA0B;QAC1B,mBAAmB;QACH,gCAAgC;QAC9B,uBAAuB;QAC5B,iBAAiB;QACR,mCAAmC;QAC/C,YAAY;QACX,uBAAuB;QACjB,4BAA4B;QAC9B,gCAAgC;GAZpG,qCAAqC,CA0pDjD","sourcesContent":["import 'reflect-metadata';\nimport { timingSafeEqual } from 'node:crypto';\nimport { inject, injectable } from 'inversify';\nimport type { Request, Response } from 'express';\nimport cors from 'cors';\nimport { AbstractControllerBackendService } from '~wildo-backend-lib/base-classes/services/controllers/abstract-controller.backend.service';\nimport { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport { ErrorBuilderBackendService } from '~wildo-backend-lib/errors/services/error-builder.backend.service';\nimport { ErrorHandlerService } from '~wildo-backend-lib/errors/services/error-handler.backend.service';\nimport { projectCaughtErrorLogFields } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport { OAuthProviderTokenBackendService } from '~wildo-backend-lib/security/authentications/services/oauth-provider-token.backend.service';\nimport { OidcAuthorizationCodeBackendService } from '~wildo-backend-lib/security/authentications/services/oidc-authorization-code.backend.service';\nimport { OidcUserClaimsBackendService, OIDC_SUPPORTED_IDENTITY_SCOPES, OIDC_SCOPE_GATED_IDENTITY_CLAIMS } from '~wildo-backend-lib/security/authentications/services/oidc-user-claims.backend.service';\nimport { CimdTrustPolicy } from '~wildo-backend-lib/security/authentications/models/cimd.backend.schemas';\nimport type { DynamicClientRegistrationConfig } from '~wildo-backend-lib/security/authentications/models/cimd.backend.schemas';\nimport { generateOAuthClientSecretMaterial, generateRegistrationAccessTokenMaterial, hashRegistrationAccessToken } from '~wildo-backend-lib/security/oauth-clients/oauth-client-generation.backend.utils';\nimport type { SystemAccessBackendService } from '~wildo-backend-lib/base-classes/services/services/system-access.backend.service';\nimport { CimdClientMetadataBackendService } from '~wildo-backend-lib/security/authentications/services/cimd-client-metadata.backend.service';\nimport { AppConfigurationService } from '~wildo-backend-lib/config/services/app-configuration.backend.service';\nimport { JwtBackendService } from '~wildo-backend-lib/security/jwt/services/jwt.backend.service';\nimport { JwtPrivateKeys } from '~wildo-backend-lib/security/authentications/models/jwt.backend.schemas';\nimport { AuthControllerUtils } from '~wildo-backend-lib/security/authentications/services/utils/auth-controller.utils';\nimport type { AuthTokenIssuerBackendService } from '~wildo-backend-lib/security/authentications/services/auth-token-issuer.backend.service';\nimport { RedisService } from '~wildo-backend-lib/databases/services/redis.service';\nimport { getClientIpFromRequest } from '~wildo-backend-lib/runtime/utils/request-client-ip.utils';\nimport { assertMachineAuthAttemptWithinRate, recordMachineAuthFailure } from '~wildo-backend-lib/security/authentications/services/utils/machine-auth-rate-limit.backend.utils';\nimport { isValidS256CodeChallenge } from '~wildo-backend-lib/security/authentications/services/utils/pkce.backend.utils';\nimport { AuditLogsBackendService } from '~wildo-backend-lib/compliance/audit-trails/services/audit-logs.backend.service';\nimport {\n ApiKeyScope,\n CoreResourceType,\n ExecutionContext_ExecutionType,\n MANUAL_CONTROLLER_ROUTES_URLS,\n ManualControllerRouteKey,\n OAuthClientRegistrationOrigin,\n OAuthClientStatus,\n OAuthGrantType,\n OAuthTokenEndpointAuthMethod,\n isSafeOAuthRedirectUri,\n isWildoBackendError,\n} from '@wildo-ai/saas-models';\nimport type { OAuthClientApplication } from '@wildo-ai/saas-models';\n\n/**\n * OAuth 2.0 Authorization Server endpoints (Wildo-AS-PROVIDER). A THIN transport wrapper\n * over {@link OAuthProviderTokenBackendService} — it parses the request per RFC 6749 and\n * renders the §5.1 success / §5.2 error body; all verification + issuance logic lives in\n * the (unit-tested) service.\n *\n * Deliberately SEPARATE from the RP-side `AuthenticationControllerBackendService`\n * (Wildo-as-client) per the framework's semantic-distinction rule. The OIDC branch adds\n * `/.well-known/openid-configuration`, `/jwks`, `authorize`, and `userinfo` alongside this\n * token endpoint here.\n *\n * NOTE: `setupRoutes()` runs inside the `super()` constructor (before this subclass's field\n * initializers), so it only BINDS handlers — `this.tokenService` is read at REQUEST time,\n * by which point the field is set. This is the standard manual-controller pattern.\n */\n@injectable()\nexport class OAuthProviderControllerBackendService extends AbstractControllerBackendService {\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService) errorBuilder: ErrorBuilderBackendService,\n @inject(SAAS_SERVICE_TYPES.ErrorHandlerService) errorHandler: ErrorHandlerService,\n @inject(SAAS_SERVICE_TYPES.OAuthProviderToken) private readonly tokenService: OAuthProviderTokenBackendService,\n @inject(SAAS_SERVICE_TYPES.AppConfigService) private readonly appConfigService: AppConfigurationService,\n @inject(SAAS_SERVICE_TYPES.JwtBackendService) private readonly jwtService: JwtBackendService,\n @inject(SAAS_SERVICE_TYPES.OidcAuthorizationCode) private readonly authCodeService: OidcAuthorizationCodeBackendService,\n @inject(SAAS_SERVICE_TYPES.RedisService) private readonly redisService: RedisService,\n @inject(SAAS_SERVICE_TYPES.AuditLogsService) private readonly auditLogs: AuditLogsBackendService,\n @inject(SAAS_SERVICE_TYPES.OidcUserClaims) private readonly userClaimsService: OidcUserClaimsBackendService,\n @inject(SAAS_SERVICE_TYPES.CimdClientMetadata) private readonly cimdService: CimdClientMetadataBackendService,\n @inject(SAAS_SERVICE_TYPES.SystemAccessService) private readonly systemAccess: SystemAccessBackendService,\n // revocation-C: the per-session revocation writer the `/oauth/end-session` handler calls to terminate\n // the OP session named by an id_token's `sid`. Appended LAST so the existing positional DI is untouched.\n @inject(SAAS_SERVICE_TYPES.AuthTokenIssuer) private readonly authTokenIssuer: AuthTokenIssuerBackendService,\n ) {\n super(logger, errorBuilder, errorHandler, 'OAuthProviderController');\n }\n\n protected setupRoutes(): void {\n const tokenUrl = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_TOKEN];\n this.router.post(tokenUrl, this.asyncHandler(this.handleToken.bind(this)));\n this.logRouteRegistration('POST', tokenUrl, 'OAuth 2.0 token endpoint (grant_type=client_credentials)');\n\n // OIDC discovery + JWKS are PUBLIC, non-credentialed metadata that clients (incl. future\n // browser SPAs doing authorization_code) fetch cross-origin. Per OIDC/OAuth convention they\n // must be readable from ANY origin, so they get their own permissive-GET CORS that overrides\n // the app-global frontend-origin allowlist. `origin:'*'` is safe here BECAUSE these responses\n // carry NO credentials and NO secrets (public keys + public metadata only). The token endpoint\n // is deliberately NOT included — it is a server-side credential endpoint and stays under the\n // restrictive global CORS.\n const publicMetadataCors = cors({ origin: '*', methods: ['GET'], credentials: false });\n\n const discoveryUrl = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_DISCOVERY];\n this.router.get(discoveryUrl, publicMetadataCors, this.asyncHandler(this.handleDiscovery.bind(this)));\n this.logRouteRegistration('GET', discoveryUrl, 'OIDC discovery document (public, CORS-open)');\n\n // RFC 8414 alias: many OAuth/MCP clients probe `/.well-known/oauth-authorization-server` FIRST.\n // Serve the SAME discovery document there (public, CORS-open).\n const asMetadataUrl = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_AS_METADATA];\n this.router.get(asMetadataUrl, publicMetadataCors, this.asyncHandler(this.handleDiscovery.bind(this)));\n this.logRouteRegistration('GET', asMetadataUrl, 'RFC 8414 authorization-server metadata alias (public, CORS-open)');\n\n const jwksUrl = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_JWKS];\n this.router.get(jwksUrl, publicMetadataCors, this.asyncHandler(this.handleJwks.bind(this)));\n this.logRouteRegistration('GET', jwksUrl, 'JSON Web Key Set (jwks_uri) (public, CORS-open)');\n\n // authorize is a browser-redirect endpoint (no CORS). userinfo is bearer-credentialed, so it\n // stays under the restrictive global CORS (NOT the public-metadata origin:'*').\n const authorizeUrl = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_AUTHORIZE];\n this.router.get(authorizeUrl, this.asyncHandler(this.handleAuthorize.bind(this)));\n this.logRouteRegistration('GET', authorizeUrl, 'OIDC authorization endpoint (authorization_code)');\n\n // S1: interactive-consent decision endpoint — the approve/deny for a `requiresConsent` client.\n const consentUrl = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_CONSENT];\n this.router.post(consentUrl, this.asyncHandler(this.handleConsentDecision.bind(this)));\n this.logRouteRegistration('POST', consentUrl, 'OIDC interactive-consent decision endpoint');\n\n const userInfoUrl = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_USERINFO];\n this.router.get(userInfoUrl, this.asyncHandler(this.handleUserInfo.bind(this)));\n this.logRouteRegistration('GET', userInfoUrl, 'OIDC UserInfo endpoint');\n\n const revokeUrl = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_REVOKE];\n this.router.post(revokeUrl, this.asyncHandler(this.handleRevoke.bind(this)));\n this.logRouteRegistration('POST', revokeUrl, 'OAuth 2.0 token revocation (RFC 7009)');\n\n // OIDC RP-Initiated Logout (revocation-C). A GET browser-redirect endpoint like `authorize` — the RP\n // navigates the user's browser here, so it takes NO CORS (a top-level navigation, not an XHR) and no\n // Bearer middleware (the `id_token_hint` IS the credential, verified inside the handler).\n const endSessionUrl = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_END_SESSION];\n this.router.get(endSessionUrl, this.asyncHandler(this.handleEndSession.bind(this)));\n this.logRouteRegistration('GET', endSessionUrl, 'OIDC RP-Initiated Logout (end_session_endpoint)');\n\n // §6 logout-confirmation decision — the POST the frontend `/oauth/logout-confirm` prompt calls to\n // actually terminate the session. Token-authorized (no Bearer / no CORS); the single-use\n // `OIDC_LOGOUT_CONFIRMATION` token minted by `handleEndSession` is the credential.\n const endSessionConfirmUrl = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_END_SESSION_CONFIRM];\n this.router.post(endSessionConfirmUrl, this.asyncHandler(this.handleEndSessionConfirm.bind(this)));\n this.logRouteRegistration('POST', endSessionConfirmUrl, 'OIDC RP-Initiated Logout §6 confirmation decision');\n\n const registerUrl = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_REGISTER];\n this.router.post(registerUrl, this.asyncHandler(this.handleDynamicRegistration.bind(this)));\n this.logRouteRegistration('POST', registerUrl, 'RFC 7591 dynamic client registration (404 unless opted in)');\n\n // RFC 7592 §2: ONE client configuration endpoint, three methods. Registered unconditionally like\n // `/oauth/register` above and gated by the same opt-in inside the handler.\n const registerClientUrl = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_REGISTER_CLIENT];\n this.router.get(registerClientUrl, this.asyncHandler(this.handleClientConfigurationRead.bind(this)));\n this.router.put(registerClientUrl, this.asyncHandler(this.handleClientConfigurationUpdate.bind(this)));\n this.router.delete(registerClientUrl, this.asyncHandler(this.handleClientConfigurationDelete.bind(this)));\n this.logRouteRegistration('GET', registerClientUrl, 'RFC 7592 client read (404 unless opted in)');\n this.logRouteRegistration('PUT', registerClientUrl, 'RFC 7592 client update (404 unless opted in)');\n this.logRouteRegistration('DELETE', registerClientUrl, 'RFC 7592 client delete (404 unless opted in)');\n }\n\n /**\n * `POST /oauth/revoke` — RFC 7009 token revocation. Revokes the presented `token` (a user\n * refresh token). Per §2.2 the endpoint returns 200 even for an unknown/invalid token (no\n * token-status oracle).\n *\n * F-OIDC-6 (RFC 7009 §2.1 client authentication): when the request carries client credentials\n * (`client_secret_basic` via the Authorization header, or `client_secret_post` in the body), the\n * client is authenticated FIRST — a bad secret is `invalid_client` (401) and NO revocation happens.\n * An UNauthenticated revoke stays allowed: §2.1 permits it for a public client, and Wildo's refresh\n * tokens are first-party session tokens that no OAuth client owns, so there is no client↔token\n * binding to additionally enforce. A `client_secret` presented WITHOUT a `client_id` is\n * `invalid_request` (400) — an unnamed client cannot be authenticated.\n */\n private async handleRevoke(req: Request, res: Response): Promise<void> {\n const body = (req.body ?? {}) as Record<string, string | undefined>;\n // A repeated body param (Express parses `k=a&k=b` into a string[] despite the cast) is a malformed\n // request. Reject cleanly (400) so an array never reaches `hashOAuthClientSecret` or\n // `revokeRefreshToken` (which would 500), consistent with the token/authorize handlers.\n const malformedRevokeParam = this.firstMalformedParam(body, ['token', 'token_type_hint', 'client_id', 'client_secret']);\n if (malformedRevokeParam) {\n this.sendOAuthError(res, 400, 'invalid_request', `the '${malformedRevokeParam}' parameter must be a single string value`);\n return;\n }\n // `extractClientCredentials` already resolves the client id from Basic-header-or-body, so a\n // present `clientSecret` with an absent `clientId` means a secret was posted with no id at all.\n const { clientId, clientSecret } = this.extractClientCredentials(req, body);\n if (clientSecret) {\n if (!clientId) {\n this.sendOAuthError(res, 400, 'invalid_request', 'client_id is required when a client_secret is presented');\n return;\n }\n try {\n await this.authCodeService.verifyPresentedClientSecret(clientId, clientSecret);\n } catch (error) {\n if (isWildoBackendError(error)) {\n const context = (error as { context?: { oauthError?: string; detail?: string } }).context;\n if (context?.oauthError) {\n this.sendOAuthError(res, context.oauthError === 'invalid_client' ? 401 : 400, context.oauthError, context.detail);\n return;\n }\n }\n throw error;\n }\n }\n if (body.token) {\n await this.tokenService.revokeRefreshToken(body.token);\n // A-5: audit the revocation ATTEMPT. RFC 7009 is a no-oracle (200 for unknown tokens), so this\n // records the presented client (if a confidential client authenticated above) + hint, never whose\n // token it was or whether it existed. Reaching here with a `clientSecret` means it verified (a bad\n // secret returned early above). Fire-and-forget — auditing must never affect the RFC 7009 response.\n // assurance-control: WILDO.IDENTITY.CREDENTIAL_LIFECYCLE — token lifecycle (revocation).\n const revokeClientAuthenticated = Boolean(clientId && clientSecret);\n void this.auditLogs.logOAuthTokenRevoked({\n clientId: revokeClientAuthenticated ? clientId : undefined,\n clientAuthenticated: revokeClientAuthenticated,\n tokenTypeHint: body.token_type_hint,\n ipAddress: getClientIpFromRequest(req),\n }).catch((auditError) => this.logger.warn('OAUTH_TOKEN_REVOKED audit emit failed (non-fatal)', {\n ...projectCaughtErrorLogFields(auditError),\n }));\n }\n res.set('Cache-Control', 'no-store');\n res.status(200).json({});\n }\n\n /**\n * `GET /oauth/end-session` — OIDC RP-Initiated Logout 1.0 (revocation-C). A relying party redirects the\n * End-User's browser here to terminate their Wildo OP login session. This is a top-level BROWSER\n * navigation (not an XHR), so it answers with a real 302 redirect — unlike `authorize`/`decision`, which\n * return JSON to a Bearer SPA.\n *\n * Flow:\n * 1. Verify the `id_token_hint` — a token WE minted (signature + our public issuer), TOLERATING expiry\n * (§2: the hint may be a previously issued, possibly-expired ID token) and audience (its `aud` is the\n * RP, validated by the allowlist below, not the first-party `AUTH_TOKEN`).\n * 2. Extract `sub` (user), `sid` (the session), `azp` (the relying party); validate a presented\n * `post_logout_redirect_uri` against the RP's registered allowlist (EXACT match, `client_id`/`azp` agree).\n * 3. Branch on trust — the §6 logout-confirmation posture (Keycloak-style: skip the prompt for a trusted RP):\n * a. TRUSTED RP (valid hint + exact-match registered redirect) → terminate THAT session inline\n * (`invalidateSession(sid)`, per-session — its access + refresh die on the next request across every\n * front, other sessions live), clear the refresh cookie, and 302 to the RP echoing `state` (§3). No\n * prompt: a known RP presenting an id_token we signed is trusted to log the user out directly.\n * b. NON-trusted but a real session was identified (a valid hint whose redirect is absent / unregistered /\n * mismatched) → do NOT terminate; mint a single-use `OIDC_LOGOUT_CONFIRMATION` token naming the session\n * and 302 to the frontend `/oauth/logout-confirm` §6 prompt. Termination happens at\n * `POST /oauth/end-session/confirm` on the End-User's explicit confirm — this closes the BROWSER-based\n * logout-CSRF vector §6 targets (a cross-origin page cannot read the token to complete the confirm; see\n * `handleEndSessionConfirm` for the full threat model, incl. what it deliberately does NOT defend).\n * c. Nothing to terminate (no / unverifiable / forged hint) → clear the cookie and land on the OP's\n * signed-out page (`/oauth/logged-out`, §5). No prompt — there is nothing to confirm.\n * 4. Audit the logout (`OAUTH_RP_INITIATED_LOGOUT`) at each terminal disposition — for the prompt path (b)\n * that is the confirm endpoint, when the session actually ends.\n *\n * The signed-out landing (`/oauth/logged-out`) is UNIFORM across the confirm result of (b) and case (c), so\n * the response is not an oracle for whether a session existed. RP-Initiated Logout forbids acting on an\n * invalid hint; RP token revocation is out of scope (RFC 7009); delegated tokens are left to expire.\n * spec-cite: OpenID Connect RP-Initiated Logout 1.0 §2 (the OP terminates the End-User's session; the\n * `id_token_hint` need not be current — \"even when the exp time has passed\"; `post_logout_redirect_uri`\n * MUST have been registered) and §3 (the OP MUST NOT redirect unless the value EXACTLY matches a\n * registered `post_logout_redirect_uri`).\n * assurance-control: WILDO.IDENTITY.CREDENTIAL_LIFECYCLE — per-session revocation (RP-Initiated Logout).\n */\n private async handleEndSession(req: Request, res: Response): Promise<void> {\n const q = req.query as Record<string, string | undefined>;\n const malformed = this.firstMalformedParam(q, ['id_token_hint', 'post_logout_redirect_uri', 'client_id', 'state']);\n if (malformed) {\n this.sendOAuthError(res, 400, 'invalid_request', `the '${malformed}' parameter must be a single string value`);\n return;\n }\n const appBase = this.appConfigService.resolveAppPublicBaseUrl();\n if (!appBase) {\n this.sendOAuthError(res, 503, 'temporarily_unavailable', 'app public base URL is not resolvable');\n return;\n }\n // The OP's own logged-out destination when there is no validated RP redirect: the dedicated\n // \"you have been signed out\" page (`PUBLIC_LAYOUTS_OAUTH_LOGGED_OUT`, route `/oauth/logged-out`),\n // per RP-Initiated Logout 1.0 §5 (the OP displays a logout confirmation rather than redirecting back\n // to the RP). Reached by the no-session branch (c) — where NOTHING is terminated — and by the confirm\n // endpoint after it terminates; the landing is UNIFORM across both so it is not a session-state oracle.\n const landingUrl = `${appBase}/oauth/logged-out`;\n\n // The public issuer id_tokens are minted with (`createJwtForIdToken` sets `iss` to this). Needed to\n // verify the hint against the RIGHT issuer — `getVerifyOptions` otherwise forces the appSlug issuer.\n const issuer = this.appConfigService.resolveApiResourceAudience();\n\n let userId: string | undefined;\n let sessionId: string | undefined;\n let clientId: string | undefined;\n if (q.id_token_hint && issuer) {\n try {\n const claims = (await this.jwtService.verifyWithoutBackendErrorActions(\n q.id_token_hint,\n JwtPrivateKeys.APPLICATION_AUTH_TOKEN,\n { ignoreAudience: true, ignoreExpiration: true, issuerOverride: issuer },\n )) as { sub?: string; sid?: string; azp?: string; aud?: string };\n userId = claims.sub;\n sessionId = claims.sid;\n // The relying party the hint was issued to: `azp` (OIDC authorized party), falling back to `aud`\n // (the id_token audience = the client). Scopes the post_logout_redirect_uri allowlist lookup.\n clientId = claims.azp ?? claims.aud;\n } catch {\n // An invalid / forged hint identifies nothing. Terminate nothing; land the user on the OP page.\n // Deliberately NOT an error — §2 tolerates a stale hint; we simply cannot act on this one.\n }\n }\n\n // RP-Initiated Logout §2: a `client_id` parameter, when present, MUST agree with the hint's client.\n // A mismatch means the request cannot be trusted to name the RP, so no RP redirect is honored.\n const clientIdMismatch = Boolean(q.client_id && clientId && q.client_id !== clientId);\n\n // Validate the post_logout_redirect_uri BEFORE terminating, so the audit records the disposition.\n let validatedRedirect: string | undefined;\n let postLogoutRedirectUriRejected = false;\n if (q.post_logout_redirect_uri) {\n const canRedirect = !clientIdMismatch\n && clientId !== undefined\n && await this.authCodeService.isRegisteredPostLogoutRedirectUri(clientId, q.post_logout_redirect_uri);\n if (canRedirect) {\n validatedRedirect = q.post_logout_redirect_uri;\n } else {\n postLogoutRedirectUriRejected = true;\n }\n }\n\n res.set('Cache-Control', 'no-store');\n\n // ── Trusted RP logout (the Keycloak-style §6-prompt skip): a valid `id_token_hint` AND an exact-match\n // registered `post_logout_redirect_uri`. The request names a known, allow-listed relying party and\n // carries an id_token WE signed, so it is trusted to terminate the session and return the End-User to\n // the RP WITHOUT an interstitial — the current, unchanged behaviour (RP-Initiated Logout §3).\n if (validatedRedirect) {\n if (sessionId) {\n await this.authTokenIssuer.invalidateSession(sessionId);\n }\n // Best-effort browser hygiene: clear the first-party refresh cookie. The helper sets the same\n // `Path=/api/v1/auth` the cookie was issued with, so the deletion takes effect even though this\n // endpoint lives under a different path.\n AuthControllerUtils.clearRefreshCookie(res, this.appConfigService.applicationEnv);\n this._auditRpInitiatedLogout(req, { userId, sessionId, clientId, sessionTerminated: Boolean(sessionId), postLogoutRedirectUriRejected });\n let redirect: URL;\n try {\n redirect = new URL(validatedRedirect);\n } catch {\n // The allowlist entry passed `isSafeOAuthRedirectUri` at registration, so this is unreachable\n // through the front door; fall back to the landing rather than 500 if a malformed entry slipped in.\n res.redirect(302, landingUrl);\n return;\n }\n // RP-Initiated Logout §2: echo `state` on the post-logout redirect when the RP supplied it (§2 states\n // the OP passes `state` back to the RP; §3 governs the redirection itself).\n if (q.state) redirect.searchParams.set('state', q.state);\n res.redirect(302, redirect.toString());\n return;\n }\n\n // ── §6 confirmation prompt: a NON-trusted logout that still names a real session (a valid hint whose\n // `post_logout_redirect_uri` is absent / unregistered / client-mismatched). Do NOT terminate yet —\n // mint a single-use confirmation token naming the session and 302 the browser to the frontend\n // `/oauth/logout-confirm` prompt. Termination happens only on the End-User's explicit confirm\n // (`POST /oauth/end-session/confirm`), which closes the BROWSER-based logout-CSRF vector (see\n // `handleEndSessionConfirm` for the exact threat model). No audit here — nothing has been terminated;\n // the confirm endpoint audits the actual logout with the clientId/redirect disposition stashed here.\n if (sessionId && userId) {\n const { confirmationToken } = await this.authCodeService.createLogoutConfirmation({ userId, sessionId, clientId, postLogoutRedirectUriRejected });\n const confirmUrl = new URL(`${appBase}/oauth/logout-confirm`);\n confirmUrl.searchParams.set('token', confirmationToken);\n res.redirect(302, confirmUrl.toString());\n return;\n }\n\n // ── Nothing to terminate (no / unverifiable / forged hint): no session was identified, so there is\n // nothing to confirm. Clear the cookie for hygiene and land on the signed-out page — the UNIFORM §5\n // landing, identical to a completed logout, so the response is not an oracle for whether the hint was\n // valid or a session existed.\n AuthControllerUtils.clearRefreshCookie(res, this.appConfigService.applicationEnv);\n this._auditRpInitiatedLogout(req, { userId, sessionId, clientId, sessionTerminated: false, postLogoutRedirectUriRejected });\n res.redirect(302, landingUrl);\n }\n\n /**\n * Fire-and-forget audit for an RP-Initiated Logout disposition (`OAUTH_RP_INITIATED_LOGOUT`). Auditing\n * must never affect the logout the End-User already performed, so a failure is swallowed at WARN.\n * Called at each terminal disposition: the trusted-RP redirect, the no-session landing, and the §6\n * confirm endpoint (the prompt path audits there, when the session actually ends).\n */\n private _auditRpInitiatedLogout(\n req: Request,\n fields: { userId?: string; sessionId?: string; clientId?: string; sessionTerminated: boolean; postLogoutRedirectUriRejected: boolean },\n ): void {\n void this.auditLogs.logOAuthRpInitiatedLogout({\n ...fields,\n ipAddress: getClientIpFromRequest(req),\n }).catch((auditError) => this.logger.warn('OAUTH_RP_INITIATED_LOGOUT audit emit failed (non-fatal)', {\n ...projectCaughtErrorLogFields(auditError),\n }));\n }\n\n /**\n * `POST /oauth/end-session/confirm` — the OIDC RP-Initiated Logout §6 confirmation decision\n * (revocation-C). The frontend `/oauth/logout-confirm` prompt calls this with the single-use\n * `OIDC_LOGOUT_CONFIRMATION` token minted by `handleEndSession` when the End-User clicks \"Sign out\".\n * Token-authorized (no Bearer — the End-User may be unauthenticated in the SPA, having arrived via an\n * RP redirect), single-use, short-TTL.\n *\n * THREAT MODEL — read before strengthening or relaxing this. The prompt+token defends against\n * BROWSER-based logout CSRF: the token is minted into the VICTIM'S browser URL by the GET's 302, and a\n * cross-origin page (an `<img>`/auto-navigation forcing the GET) cannot READ that URL, so it cannot\n * complete the confirm — the classic \"silent logout via a crafted link\" is closed. It does NOT, and by\n * the endpoint's nature cannot, stop a party that HOLDS a valid `id_token` from scripting\n * GET→read-token→POST-confirm headlessly; but that party can already log the user out through the\n * trusted-RP path, because letting an authorized RP end the End-User's session is exactly what\n * RP-Initiated Logout is FOR. So the residual is a bounded session-logout by an id_token holder, not a\n * new capability. Binding the confirm to the victim's OP session (Keycloak's mechanism) is deliberately\n * NOT done: this OP is token-based and the `__wildo_refresh` cookie is scoped to `/api/v1/auth`, so it\n * never reaches `/oauth/*`, and the design intentionally allows an unauthenticated SPA to confirm.\n *\n * Consumes the token → terminates the named session (`invalidateSession(sid)`) → clears the refresh\n * cookie → audits → returns `{ redirect_to: /oauth/logged-out }` as JSON (the SPA navigates there,\n * mirroring `/oauth/authorize/decision`). A stale / invalid / already-used token is NOT an error: the\n * End-User confirmed a logout, so it lands them on the signed-out page WITHOUT terminating (the session\n * is most likely already gone, and revealing whether the token was live would be a session-state oracle).\n */\n private async handleEndSessionConfirm(req: Request, res: Response): Promise<void> {\n const appBase = this.appConfigService.resolveAppPublicBaseUrl();\n if (!appBase) {\n this.sendOAuthError(res, 503, 'temporarily_unavailable', 'app public base URL is not resolvable');\n return;\n }\n const body = (req.body ?? {}) as { token?: unknown };\n const token = typeof body.token === 'string' ? body.token : '';\n if (!token) {\n this.sendOAuthError(res, 400, 'invalid_request', \"the 'token' parameter is required\");\n return;\n }\n\n res.set('Cache-Control', 'no-store');\n const confirmation = await this.authCodeService.consumeLogoutConfirmation(token);\n // A stale / wrong-type token yields null → land on the signed-out page without terminating.\n if (confirmation?.sessionId) {\n await this.authTokenIssuer.invalidateSession(confirmation.sessionId);\n }\n AuthControllerUtils.clearRefreshCookie(res, this.appConfigService.applicationEnv);\n // Full attribution: the RP the hint named and the redirect disposition were stashed in the token at\n // mint time, so the confirm audit matches what the trusted-RP and no-session paths record inline.\n this._auditRpInitiatedLogout(req, {\n userId: confirmation?.userId,\n sessionId: confirmation?.sessionId,\n clientId: confirmation?.clientId,\n sessionTerminated: Boolean(confirmation?.sessionId),\n postLogoutRedirectUriRejected: confirmation?.postLogoutRedirectUriRejected ?? false,\n });\n res.status(200).json({ redirect_to: `${appBase}/oauth/logged-out` });\n }\n\n /**\n * `GET /.well-known/openid-configuration` — OIDC discovery metadata. `issuer` is the app's\n * API base URL (matching the `iss` in issued tokens); endpoint URLs are absolute so a client\n * that fetched this doc can reach them directly. The `authorization_endpoint` is the BROWSER-FACING\n * frontend consent/authorize page; the other endpoints are the backend API routes.\n */\n private async handleDiscovery(_req: Request, res: Response): Promise<void> {\n const issuer = this.appConfigService.resolveApiResourceAudience();\n if (!issuer) {\n this.sendOAuthError(res, 503, 'temporarily_unavailable', 'issuer URL is not resolvable');\n return;\n }\n // The `authorization_endpoint` is a BROWSER-FACING page, not the backend API endpoint: a third-party\n // client redirects the user's browser THERE, the SPA establishes the session and (for a\n // `requiresConsent` client) renders the consent screen, then calls the backend `/oauth/authorize`\n // with the user's Bearer. So it points at the frontend consent route (matches\n // `CommonRoutePaths.oauthConsent` in saas-frontend-lib) under the app's public base URL — NOT under\n // the `/api/v1` API mount. The path is a frontend-route literal (route paths are not a closed vocabulary).\n const appBase = this.appConfigService.resolveAppPublicBaseUrl();\n if (!appBase) {\n this.sendOAuthError(res, 503, 'temporarily_unavailable', 'app public base URL is not resolvable');\n return;\n }\n // Deployment guard: a non-https issuer (outside localhost) is a misconfigured public base\n // URL — OIDC relying parties reject a non-https issuer. Surface it loudly rather than let it\n // fail opaquely at the client. (The fix is operator-side: set the external https public URL.)\n if (issuer.startsWith('http://') && !/\\/\\/(localhost|127\\.0\\.0\\.1)/.test(issuer)) {\n this.logger.warn('OIDC issuer is not https — relying parties will reject it. Set the app public URL to the external https origin.', { issuer });\n }\n res.set('Cache-Control', 'public, max-age=3600');\n this.jsonSuccess(res, {\n issuer,\n authorization_endpoint: `${appBase}/oauth/consent`,\n token_endpoint: `${issuer}${MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_TOKEN]}`,\n jwks_uri: `${issuer}${MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_JWKS]}`,\n userinfo_endpoint: `${issuer}${MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_USERINFO]}`,\n revocation_endpoint: `${issuer}${MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_REVOKE]}`,\n // OIDC RP-Initiated Logout 1.0 (revocation-C): the `end_session_endpoint` an RP redirects the browser\n // to in order to terminate the End-User's OP session. A backend API route (like revocation), not the\n // browser-facing frontend page — the handler does the termination then redirects.\n // spec-cite: OpenID Connect RP-Initiated Logout 1.0 §2.1 (OpenID Provider Discovery Metadata —\n // `end_session_endpoint: REQUIRED`).\n end_session_endpoint: `${issuer}${MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_END_SESSION]}`,\n grant_types_supported: ['client_credentials', 'authorization_code', 'refresh_token'],\n response_types_supported: ['code'],\n response_modes_supported: ['query'],\n code_challenge_methods_supported: ['S256'],\n // RFC 9207. This is a CLAIM, not a preference: a client reading `true` here MUST reject any\n // authorization response from this server that arrives without `iss`. It is therefore only safe\n // while `sendAuthorizationRedirect` remains the sole way an authorization response leaves this\n // controller — it is what makes the claim true on the code path, the consent-approve path and\n // the consent-deny path alike. Do not set this to `true` for a server that emits `iss` on only\n // some of its responses.\n // spec-cite: RFC 9207 § 2.3 — `authorization_response_iss_parameter_supported`.\n authorization_response_iss_parameter_supported: true,\n // `none` = PUBLIC client (PKCE, no client secret) — the authorization_code token exchange\n // accepts `client_id` from the body and relies on PKCE (S256) instead of a secret, so a public\n // agent/SPA client is supported. Confidential clients use `client_secret_basic|post`. Omitting\n // `none` here would (mis)signal confidential-only and block a spec-compliant public client.\n token_endpoint_auth_methods_supported: ['none', 'client_secret_basic', 'client_secret_post'],\n // RFC 8707: this provider honors the `resource` indicator (REQUIRED for a user-delegated\n // authorization_code token — it binds the token `aud` to the A2A/MCP endpoint; the per-endpoint\n // resource value is discovered from the A2A agent card `url` / the MCP RFC 9728 metadata).\n resource_indicators_supported: true,\n /**\n * CIMD advertisement — DERIVED from the deployment's own posture, never hard-coded true.\n *\n * \"Authorization servers advertise that they support clients using Client ID Metadata Documents\n * by including the following property in their OAuth Authorization Server metadata:\n * `client_id_metadata_document_supported: true`\"\n * spec-cite: MCP 2025-11-25 — Authorization § Client ID Metadata Documents → Discovery\n *\n * The client's documented reaction to this flag is to CHOOSE CIMD over its other options —\n * \"Use Client ID Metadata Documents if the Authorization Server indicates it supports it\" —\n * so advertising it while the policy is `DISABLED` would steer every conformant client into a\n * mechanism this deployment refuses, and its fallback order would already have been spent.\n * Advertising the truth is what lets a client pick DCR or pre-registration instead.\n */\n ...(this.cimdService.deploymentConfiguration().policy === CimdTrustPolicy.DISABLED\n ? {}\n : { client_id_metadata_document_supported: true }),\n /**\n * `registration_endpoint` — advertised ONLY when the application opted in, for the same\n * reason as the CIMD flag and with the same consequence if it lies.\n *\n * A client's documented fallback order is \"pre-registered → CIMD → Dynamic Client\n * Registration → prompt the user\", so advertising an endpoint that answers 404 would consume\n * the third rung and push a conformant client straight to prompting a human.\n * spec-cite: MCP 2025-11-25 — Authorization § Client Registration Approaches: \"Use Dynamic\n * Client Registration as a fallback if the Authorization Server supports it (via\n * `registration_endpoint` in OAuth Authorization Server Metadata)\".\n */\n ...(this.dynamicRegistrationConfiguration().enabled\n ? { registration_endpoint: `${issuer}${MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_REGISTER]}` }\n : {}),\n subject_types_supported: ['public'],\n id_token_signing_alg_values_supported: ['ES256'],\n // OIDC Discovery RECOMMENDED metadata — DERIVED from the userinfo/ID-token resolver's single-source\n // vocabulary so discovery can never drift from what the ID token actually carries (the OIDC §5.4\n // consistency contract). `openid` is the baseline identity scope; `email`/`profile` gate the identity\n // claims. Scopes are IDENTITY only — authorization is roles-only (scope-based authorization was deleted\n // 2026-07-21). `claims_supported` = the always-present protocol claims + the resolver's scope-gated\n // identity claims; `auth_time` is deliberately NOT advertised (the authorization_code flow never\n // populates it, so advertising it would promise a claim we never deliver). The authorize endpoint\n // redirects the code as query params, so the only response mode is `query`.\n scopes_supported: [...OIDC_SUPPORTED_IDENTITY_SCOPES],\n claims_supported: ['sub', 'iss', 'aud', 'exp', 'iat', 'nonce', 'azp', ...OIDC_SCOPE_GATED_IDENTITY_CLAIMS],\n }, 200);\n }\n\n /**\n * `GET /oauth/jwks` — the JWKS a relying party uses to verify Wildo-issued tokens. Each JWK's\n * `kid` is the RFC 7638 thumbprint embedded in the token header. Public keys only.\n */\n private async handleJwks(_req: Request, res: Response): Promise<void> {\n res.set('Cache-Control', 'public, max-age=3600');\n this.jsonSuccess(res, this.jwtService.getPublicJwks(), 200);\n }\n\n /**\n * `POST /oauth/token` — RFC 6749 token endpoint. Serves `grant_type=client_credentials`\n * (the OIDC branch adds `authorization_code`). Accepts `client_secret_basic` (Authorization:\n * Basic) or `client_secret_post` (form body) client authentication.\n */\n private async handleToken(req: Request, res: Response): Promise<void> {\n const body = (req.body ?? {}) as Record<string, string | undefined>;\n // These OAuth params are single-valued; a REPEATED body key (which Express parses to `string[]`\n // despite the cast) is a malformed request. Reject it cleanly (400) so an array never reaches a\n // `.split`/`.includes` (500) or silently slips through the RFC 8707 audience comparison.\n const malformedTokenParam = this.firstMalformedParam(body, ['grant_type', 'code', 'redirect_uri', 'code_verifier', 'client_id', 'client_secret', 'refresh_token', 'resource', 'scope']);\n if (malformedTokenParam) {\n this.sendOAuthError(res, 400, 'invalid_request', `the '${malformedTokenParam}' parameter must be a single string value`);\n return;\n }\n // Source IP for the per-IP machine-auth failure lockout (see the machine-auth-rate-limit utils).\n // Cheap header parse; only the `client_credentials` grant actually asserts/records against it.\n // security-decision (accepted-low — D11, see .claude/plans/oidc-provider-test-coverage.md § \"ACCEPTED RISK\"):\n // the per-IP brute-force limiter (`assertMachineAuthAttemptWithinRate`) fires ONLY on the client_credentials\n // branch below; the authorization_code + refresh_token secret fronts (and the unauthenticated /oauth/revoke)\n // are DELIBERATELY not per-endpoint rate-limited. 256-bit high-entropy secrets make online guessing\n // infeasible and the global ~1000/min/IP HTTP limiter caps the DoS surface; those fronts are now audited\n // (A-7), so a per-endpoint lockout counter is cheap to add IF the decision is ever revisited.\n const clientIp = getClientIpFromRequest(req);\n\n try {\n let token: unknown;\n if (body.grant_type === 'client_credentials') {\n // Brute-force / DB-read-exhaustion guard: reject a saturated source before the\n // `hashOAuthClientSecret` lookup; the catch below records a failure on `invalid_client`.\n await assertMachineAuthAttemptWithinRate(this.redisService, this.errorBuilder, this.logger, clientIp, this.appConfigService.applicationEnv);\n const { clientId, clientSecret } = this.extractClientCredentials(req, body);\n if (!clientSecret) {\n this.sendOAuthError(res, 401, 'invalid_client', 'missing client credentials');\n return;\n }\n token = await this.tokenService.issueClientCredentialsToken({ clientSecret, clientId, resource: body.resource });\n } else if (body.grant_type === 'authorization_code') {\n // client_id comes from the body (public client) or client auth (confidential); a confidential\n // client ALSO presents client_secret here (client_secret_basic/post), enforced downstream.\n const { clientId, clientSecret } = this.extractClientCredentials(req, body);\n const effectiveClientId = clientId ?? body.client_id;\n if (!effectiveClientId || !body.code || !body.redirect_uri || !body.code_verifier) {\n this.sendOAuthError(res, 400, 'invalid_request', 'code, redirect_uri, code_verifier and client_id are required');\n return;\n }\n token = await this.tokenService.issueAuthorizationCodeToken({\n code: body.code,\n clientId: effectiveClientId,\n redirectUri: body.redirect_uri,\n codeVerifier: body.code_verifier,\n // Presented client secret (if any). REQUIRED for a confidential client, verified during the\n // code exchange; a public (PKCE-only) client presents none.\n clientSecret,\n // RFC 8707 §2.2: a client MAY echo `resource` on the token request. The authorize-bound\n // resource is authoritative; when the token request also names one it MUST match (a\n // confused-deputy cross-check), else `invalid_target`.\n resource: body.resource,\n });\n } else if (body.grant_type === 'refresh_token') {\n if (!body.refresh_token) {\n this.sendOAuthError(res, 400, 'invalid_request', 'refresh_token is required');\n return;\n }\n // Item 5 (OIDC §12.2): pass the presented client credentials so an AUTHENTICATED OIDC client\n // ALSO gets a fresh id_token. The token service authenticates the secret (bad secret ⇒\n // `invalid_client` → 401 via the catch below) before minting; a first-party session refresh\n // presents no credentials → access + refresh only, no id_token.\n const { clientId, clientSecret } = this.extractClientCredentials(req, body);\n token = await this.tokenService.issueRefreshTokenGrant(body.refresh_token, clientId, clientSecret);\n } else {\n this.sendOAuthError(res, 400, 'unsupported_grant_type', `grant_type '${body.grant_type ?? ''}' is not supported`);\n return;\n }\n\n // RFC 6749 §5.1: token responses MUST NOT be cached.\n res.set('Cache-Control', 'no-store');\n res.set('Pragma', 'no-cache');\n this.jsonSuccess(res, token, 200);\n } catch (error) {\n if (isWildoBackendError(error)) {\n const context = (error as { context?: { oauthError?: string; detail?: string } }).context;\n if (context?.oauthError) {\n // Feed the per-IP machine-auth failure lockout AND emit the MACHINE_AUTH_FAILED audit\n // event when a client presented a bad secret to the client-credentials exchange (a guess\n // attempt) — scoped to that grant so authorization_code client-auth failures don't share\n // the machine-front bucket. `invalid_client` = authentication failed (bad secret); the\n // other OAuth errors (unauthorized_client / invalid_scope / invalid_target) are authorized-\n // client request errors, not auth failures, so they neither lock nor emit this event.\n if (context.oauthError === 'invalid_client' && body.grant_type === 'client_credentials') {\n await recordMachineAuthFailure(this.redisService, this.logger, clientIp);\n const presentedSecret = body.client_secret;\n const credentialPrefix = presentedSecret?.startsWith('oc_org_')\n ? 'oc_org_'\n : presentedSecret?.startsWith('oc_app_') ? 'oc_app_' : undefined;\n void this.auditLogs.logMachineAuthFailed({\n credentialKind: 'oauth_client',\n credentialPrefix,\n reason: 'invalid_client',\n ipAddress: clientIp,\n }).catch((auditError) => this.logger.warn('MACHINE_AUTH_FAILED audit emit failed (non-fatal)', {\n ...projectCaughtErrorLogFields(auditError),\n }));\n }\n // RFC 6749 §5.2: `invalid_client` → 401 (with WWW-Authenticate); others → 400.\n // RFC 6749 §5.2 status: invalid_client→401; temporarily_unavailable (server-side\n // misconfig, e.g. an unresolvable issuer/audience)→503; everything else→400. Without the\n // 503 case a server misconfiguration is mislabelled to the client as a 400 bad request.\n this.sendOAuthError(res, context.oauthError === 'invalid_client' ? 401 : context.oauthError === 'temporarily_unavailable' ? 503 : 400, context.oauthError, context.detail);\n return;\n }\n }\n throw error; // unexpected → unified error-handler middleware\n }\n }\n\n /**\n * `GET /oauth/authorize` — OIDC authorization endpoint (authorization_code + PKCE). Called by the\n * BROWSER-FACING frontend consent page (the discovery `authorization_endpoint`), NOT hit directly by a\n * raw third-party browser: the SPA establishes the user session first and calls this with the user's\n * Bearer. Validates the request + resolves the user, then either:\n * - `requiresConsent` client → returns `{ consent_required, consent_token, client, scopes, resource }`\n * JSON (the SPA renders the consent screen, then POSTs the decision to `/oauth/authorize/decision`); or\n * - trusted client (`requiresConsent` false) → mints the code and returns `{ redirect_to }` JSON.\n * BOTH the trusted code path and the consent-decision path return `redirect_to` as JSON (NOT an HTTP\n * 302): the caller is a Bearer-authenticated XHR that auto-follows a 302 but cannot read a cross-origin\n * `Location`, so the SPA completes the OAuth redirect with `window.location.assign(redirect_to)`.\n *\n * Errors are returned DIRECTLY (never redirected) — safe against open-redirect; redirecting\n * OAuth errors for a pre-validated `redirect_uri` (RFC 6749 §4.1.2.1) is a follow-up.\n */\n /** The deployment's dynamic-registration posture. Absent ⇒ disabled. */\n private dynamicRegistrationConfiguration(): DynamicClientRegistrationConfig {\n const authored = (this.appConfigService.config?.auth as { dynamicClientRegistration?: DynamicClientRegistrationConfig } | undefined)?.dynamicClientRegistration;\n return {\n enabled: authored?.enabled ?? false,\n maxRegistrationsPerHourPerIp: authored?.maxRegistrationsPerHourPerIp ?? 10,\n };\n }\n\n /**\n * `POST /oauth/register` — RFC 7591 dynamic client registration.\n *\n * ## What this endpoint is, stated plainly\n *\n * An UNAUTHENTICATED write primitive. Anyone who can reach it creates a durable row in this\n * application's database. That is not a flaw in the design — it is the design, and it is why the\n * endpoint is off by default, rate-limited per source IP, and why everything it creates is\n * confined to the weakest posture the framework can express.\n *\n * ## The four confinements, and why each one is not optional\n *\n * 1. **No roles, ever.** Roles are this framework's single authorization axis. A caller who\n * could name its own roles at an anonymous endpoint would have found a total privilege\n * escalation — the exact bypass `buildOAuthClientMintHandlers`' role-ceiling gate exists to\n * prevent for AUTHENTICATED callers. A request that ASKS for roles is REFUSED rather than\n * quietly downgraded: a client that believes it holds authority it does not have will fail\n * later in a way neither side can diagnose.\n * 2. **Identity scopes only** (`openid`/`profile`/`email`), for the same reason CIMD is capped\n * there: the ceiling would otherwise be authored by the party it constrains.\n * 3. **`registrationOrigin: DYNAMIC`**, which `adaptRegisteredClient` maps to\n * `UNAFFILIATED` — so the row lands on the APPLICATION collection for want of an\n * organization WITHOUT inheriting the platform-operator first-party posture that\n * `scope: APPLICATION` normally carries. This is the whole reason the field exists.\n * 4. **`authorization_code` only.** `client_credentials` is the machine front, where a client\n * acts as ITSELF with its own roles. A self-registered client acting on its own behalf is a\n * principal nobody vouched for; it may only ever act FOR A USER who consented.\n *\n * ## What is deliberately NOT issued\n *\n * No `client_secret`. The client is public (`token_endpoint_auth_method: none`) and authenticates\n * with PKCE, which is what MCP's own worked example registers. A row still persists inert secret\n * material because `hashedSecret` is required by the client schema; the REJECTED alternative was\n * making that field optional, which is a reshape across every OAuth-client surface for the sake of\n * one caller. Nothing can present the inert secret — it is never returned and never regenerated.\n *\n * spec-cite: RFC 7591 § 3.1 — client registration request; § 3.2.1 — client information response.\n * spec-cite: MCP 2025-11-25 — Authorization § Dynamic Client Registration (\"included for\n * backwards compatibility with earlier versions of the MCP authorization spec\"), which is why\n * this ships OFF by default while CIMD is the recommended path.\n */\n private async handleDynamicRegistration(req: Request, res: Response): Promise<void> {\n const configuration = this.dynamicRegistrationConfiguration();\n if (!configuration.enabled) {\n // 404, not 403: an application that has not opted in should be indistinguishable from one\n // whose framework never had the endpoint. A 403 would advertise a capability that is one\n // config flag away, and invite probing for the flag.\n res.status(404).json({ error: 'not_found' });\n return;\n }\n\n const clientIp = getClientIpFromRequest(req);\n // The ONLY thing between an unauthenticated endpoint and unbounded row creation. Applied before\n // any parsing so a malformed flood costs no more than a well-formed one.\n const withinRate = await this.withinDynamicRegistrationRate(clientIp, configuration);\n if (!withinRate) {\n res.status(429).json({ error: 'temporarily_unavailable', error_description: 'too many client registrations from this source' });\n return;\n }\n\n const body = (req.body ?? {}) as Record<string, unknown>;\n\n // RFC 7591 § 2: `redirect_uris` is REQUIRED for a client using the authorization_code grant.\n const redirectUris = body.redirect_uris;\n if (!Array.isArray(redirectUris) || redirectUris.length === 0 || !redirectUris.every((uri): uri is string => typeof uri === 'string')) {\n this.sendRegistrationError(res, 'invalid_redirect_uri', 'redirect_uris must be a non-empty array of strings');\n return;\n }\n // Each URI must independently pass the SAME safety refine every registered client faces —\n // https anywhere, http loopback only, no javascript:/data:, no fragment, no embedded\n // credentials. Checked HERE as well as by the schema so the refusal names the offending value\n // rather than surfacing as a generic validation failure on a system write.\n const unsafe = redirectUris.find((uri) => !isSafeOAuthRedirectUri(uri));\n if (unsafe) {\n this.sendRegistrationError(res, 'invalid_redirect_uri', `redirect_uri is not permitted: ${unsafe}`);\n return;\n }\n\n // revocation-C: `post_logout_redirect_uris` — OPTIONAL OIDC RP-Initiated Logout client metadata (unlike\n // `redirect_uris`, which RFC 7591 requires for authorization_code). When present it must be an array of\n // strings, each held to the SAME `isSafeOAuthRedirectUri` gate as a redirect URI (so a registered\n // post-logout target can never become an open-redirect / off-origin navigation). Absent ⇒ [] (the client\n // simply cannot pass a `post_logout_redirect_uri` to `/oauth/end-session`).\n let postLogoutRedirectUris: string[] = [];\n if (body.post_logout_redirect_uris !== undefined) {\n if (!Array.isArray(body.post_logout_redirect_uris) || !body.post_logout_redirect_uris.every((uri): uri is string => typeof uri === 'string')) {\n this.sendRegistrationError(res, 'invalid_client_metadata', 'post_logout_redirect_uris must be an array of strings');\n return;\n }\n const unsafePostLogout = body.post_logout_redirect_uris.find((uri) => !isSafeOAuthRedirectUri(uri));\n if (unsafePostLogout) {\n this.sendRegistrationError(res, 'invalid_client_metadata', `post_logout_redirect_uri is not permitted: ${unsafePostLogout}`);\n return;\n }\n postLogoutRedirectUris = body.post_logout_redirect_uris;\n }\n\n const clientName = typeof body.client_name === 'string' && body.client_name.trim().length > 0\n ? body.client_name.trim().slice(0, 100)\n : undefined;\n if (!clientName) {\n this.sendRegistrationError(res, 'invalid_client_metadata', 'client_name is required');\n return;\n }\n\n // CONFINEMENT 1 — refuse, never downgrade. `roles` is not an RFC 7591 field at all, so its\n // presence is either a probe or a client that fundamentally misunderstands this endpoint.\n if (body.roles !== undefined) {\n this.sendRegistrationError(res, 'invalid_client_metadata', 'roles cannot be requested at dynamic registration');\n return;\n }\n // CONFINEMENT 2 — a scope request wider than identity is refused for the same reason.\n const requestedScopes = typeof body.scope === 'string' ? body.scope.split(/\\s+/).filter(Boolean) : [];\n const beyondIdentity = requestedScopes.filter((scope) => !OIDC_SUPPORTED_IDENTITY_SCOPES.includes(scope));\n if (beyondIdentity.length > 0) {\n this.sendRegistrationError(res, 'invalid_client_metadata', `scope(s) not available to a dynamically registered client: ${beyondIdentity.join(', ')}`);\n return;\n }\n // CONFINEMENT 4 — authorization_code only.\n //\n // `refresh_token` is TOLERATED here and then NOT granted, and the asymmetry with confinements 1\n // and 2 (which refuse rather than downgrade) is deliberate — do not \"fix\" it into a refusal.\n // A conformant MCP client is TOLD to ask: clients that desire refresh tokens \"SHOULD include\n // `refresh_token` in their `grant_types` client metadata\", and in the same breath \"MUST NOT\n // assume refresh tokens will be issued; the AS retains discretion\". Refusing the registration\n // would therefore reject well-behaved clients for following their own specification, whereas\n // roles and wide scopes are things no client is ever instructed to request here.\n //\n // Substituting instead of refusing is the sanctioned shape: the AS \"MAY reject or replace any of\n // the client's requested metadata values submitted during the registration and substitute them\n // with suitable values\", and MUST \"return all registered metadata about this client\" — which the\n // 201 echo below does, so `grant_types: [\"authorization_code\"]` IS the notification that the\n // request was narrowed. There is no second signal, and per the discretion clause above none is\n // owed.\n //\n // OPEN DESIGN QUESTION, recorded rather than silently settled: whether a dynamically registered\n // PUBLIC client should be granted refresh at all. Granting it extends an anonymous\n // self-registered client's reach without a fresh consent; withholding it means such a client\n // re-consents when its access token expires. Today it is withheld. That is a security posture,\n // not an oversight, and changing it is a deliberate decision — not a bug fix.\n //\n // spec-cite: MCP 2026-07-28 — Authorization § Refresh Tokens\n // (<https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization>).\n // spec-cite: RFC 7591 § 3.2.1 — Client Information Response.\n const requestedGrants = Array.isArray(body.grant_types) ? body.grant_types : [OAuthGrantType.AUTHORIZATION_CODE];\n const forbiddenGrant = requestedGrants.find((grant) => grant !== OAuthGrantType.AUTHORIZATION_CODE && grant !== OAuthGrantType.REFRESH_TOKEN);\n if (forbiddenGrant) {\n this.sendRegistrationError(res, 'invalid_client_metadata', `grant_type not available to a dynamically registered client: ${String(forbiddenGrant)}`);\n return;\n }\n // A confidential auth method would require a secret this endpoint deliberately does not issue.\n const requestedAuthMethod = body.token_endpoint_auth_method;\n if (requestedAuthMethod !== undefined && requestedAuthMethod !== OAuthTokenEndpointAuthMethod.NONE) {\n this.sendRegistrationError(res, 'invalid_client_metadata', 'only token_endpoint_auth_method=none is available to a dynamically registered client');\n return;\n }\n\n const secretMaterial = generateOAuthClientSecretMaterial(ApiKeyScope.APPLICATION);\n // RFC 7592 §3: the registration response carries a `registration_access_token` the client uses at\n // the client configuration endpoint, and a `registration_client_uri` naming that endpoint. Minted\n // here and returned exactly once — there is no way to recover it afterwards, which is why §5 says\n // it \"SHOULD NOT expire while a client is still actively registered\".\n const registrationTokenMaterial = generateRegistrationAccessTokenMaterial();\n const created = await this.systemAccess.createAsSystem(CoreResourceType.OAUTH_CLIENTS_APPLICATION, {\n name: clientName,\n scope: ApiKeyScope.APPLICATION,\n applicationId: this.appConfigService.applicationId,\n // Every confinement, as DATA on the row — so a later read does not have to re-derive them.\n roles: [],\n allowedScopes: requestedScopes.length > 0 ? requestedScopes : [...OIDC_SUPPORTED_IDENTITY_SCOPES],\n allowedGrants: [OAuthGrantType.AUTHORIZATION_CODE],\n redirectUris,\n postLogoutRedirectUris,\n tokenEndpointAuthMethod: OAuthTokenEndpointAuthMethod.NONE,\n // Belt to `adaptRegisteredClient`'s braces: the resolver forces consent for a DYNAMIC client\n // regardless, but a row that also SAYS so cannot mislead an operator reading the collection.\n requiresConsent: true,\n registrationOrigin: OAuthClientRegistrationOrigin.DYNAMIC,\n hashedSecret: secretMaterial.hashedSecret,\n secretPrefix: secretMaterial.secretPrefix,\n registrationAccessTokenHash: registrationTokenMaterial.registrationAccessTokenHash,\n registrationAccessTokenPrefix: registrationTokenMaterial.registrationAccessTokenPrefix,\n }, {\n // `registrationOrigin`, `hashedSecret` and `secretPrefix` all carry\n // `.excludeFromCreate()` — they are server-managed precisely so no caller can author them.\n // This endpoint IS the server-side door, so it re-attaches them explicitly.\n preserveServerInjectedFields: [\n 'registrationOrigin', 'hashedSecret', 'secretPrefix',\n // Same reason as the two above: server-managed, so `.excludeFromCreate()` strips them and\n // this endpoint — the server-side door — re-attaches them explicitly. Omitting them here\n // would persist a client with NO registration access token, and every management call would\n // then fail 401 with nothing to diagnose.\n 'registrationAccessTokenHash', 'registrationAccessTokenPrefix',\n ],\n }) as { _id: string };\n\n // assurance-control: WILDO.IDENTITY.CLIENT_IDENTITY_ASSERTION — an anonymous party created a\n // client identity in this application. Fire-and-forget; auditing must never fail the request it\n // observes, and the row exists either way.\n void this.auditLogs.logDynamicClientRegistered({\n clientId: created._id,\n clientName,\n redirectUris,\n postLogoutRedirectUris,\n ipAddress: clientIp,\n }).catch((auditError) => this.logger.warn('DYNAMIC_CLIENT_REGISTERED audit emit failed (non-fatal)', {\n ...projectCaughtErrorLogFields(auditError),\n }));\n\n res.set('Cache-Control', 'no-store');\n // RFC 7591 § 3.2.1: 201 Created, and the response echoes the registered metadata so the client\n // can see exactly what was accepted — including the fields we NARROWED, which is how a client\n // learns it is confined rather than discovering it at the token endpoint.\n this.jsonSuccess(res, {\n client_id: created._id,\n client_id_issued_at: Math.floor(Date.now() / 1000),\n client_name: clientName,\n redirect_uris: redirectUris,\n post_logout_redirect_uris: postLogoutRedirectUris,\n grant_types: [OAuthGrantType.AUTHORIZATION_CODE],\n response_types: ['code'],\n token_endpoint_auth_method: OAuthTokenEndpointAuthMethod.NONE,\n scope: (requestedScopes.length > 0 ? requestedScopes : [...OIDC_SUPPORTED_IDENTITY_SCOPES]).join(' '),\n // RFC 7592 §3 — both REQUIRED in a registration response that supports management. The token\n // appears here and NOWHERE else, ever.\n registration_access_token: registrationTokenMaterial.plainToken,\n registration_client_uri: this.registrationClientUri(created._id),\n }, 201);\n }\n\n /**\n * The client configuration endpoint URL for one client — RFC 7592 §3's `registration_client_uri`.\n *\n * Built from the same issuer the discovery document advertises, so a client that resolved this\n * server through discovery reaches the same origin here.\n */\n private registrationClientUri(clientId: string): string {\n const template = MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.OAUTH_PROVIDER_REGISTER_CLIENT];\n const issuer = this.appConfigService.resolveApiResourceAudience();\n return `${issuer}${template.replace(':clientId', encodeURIComponent(clientId))}`;\n }\n\n /**\n * The SINGLE seam through which every OAuth authorization RESPONSE leaves this server.\n *\n * It exists to make one invariant unbypassable rather than hand-applied: **every** authorization\n * response carries the RFC 9207 `iss` parameter. There are three responses today — the trusted-client\n * code path, the consent APPROVE path, and the consent DENY path — and the specification requires the\n * parameter on all of them, \"including error responses\". A fourth response added later cannot forget,\n * because emitting one means calling this.\n * spec-cite: MCP 2026-07-28 — Authorization § Authorization Response Validation.\n *\n * `iss` is the mix-up defence: it lets a client that talks to more than one authorization server\n * verify that the response came from the one it started the flow with, before it hands the code to a\n * token endpoint. Without it, a client with several configured servers can be induced to redeem a code\n * at the wrong one.\n *\n * **Fails closed when the issuer is unresolvable, and that is the point.** A conformant client MUST\n * REJECT a response whose `iss` is missing when the server advertises\n * `authorization_response_iss_parameter_supported: true` — so silently omitting the parameter would\n * turn a local misconfiguration into a response the client is obliged to throw away, with no\n * diagnosis. Refusing here names the cause instead. `503` rather than `400` because an unresolvable\n * issuer is this deployment's fault, never the caller's — matching `handleDiscovery`, which already\n * refuses on the same condition.\n *\n * spec-cite: MCP 2026-07-28 — Authorization § Authorization Response Validation (the SHOULD to\n * include `iss`, the MUST to advertise it, and the client action table whose `true` + absent row is\n * \"Reject the response\").\n * spec-cite: RFC 9207 § 2 — `iss` in the authorization response; § 2.3 — metadata advertisement.\n */\n private sendAuthorizationRedirect(res: Response, redirect: URL): void {\n const issuer = this.appConfigService.resolveApiResourceAudience();\n if (!issuer) {\n this.sendOAuthError(res, 503, 'temporarily_unavailable', 'issuer URL is not resolvable');\n return;\n }\n redirect.searchParams.set('iss', issuer);\n res.set('Cache-Control', 'no-store');\n this.jsonSuccess(res, { redirect_to: redirect.toString() }, 200);\n }\n\n /** RFC 7591 § 3.2.2 registration-error response: 400 + `error` / `error_description`. */\n /* ───────────────────────────────────────────────────────────────────────────\n * RFC 7592 — client configuration endpoint\n * ──────────────────────────────────────────────────────────────────────── */\n\n /**\n * Authenticate a call to the client configuration endpoint, or answer and return null.\n *\n * Every RFC 7592 verb shares this, so the refusal ladder cannot drift between them — which is the\n * whole reason it is a helper rather than three copies. The ladder, and why each rung is the code\n * it is:\n *\n * - **404 when the application has not opted in.** Identical to `/oauth/register`: an application\n * without dynamic registration should be indistinguishable from one whose framework never had\n * the endpoint, so a 403 would advertise a capability one config flag away.\n * - **401 with `WWW-Authenticate` when the Bearer token is absent or malformed.** \"The client MUST\n * use its registration access token in all calls to this endpoint as an OAuth 2.0 Bearer Token.\"\n * spec-cite: RFC 7592 §2.\n * - **401 when the client does not exist.** \"If the client does not exist on this server, the\n * server MUST respond with HTTP 401 Unauthorized and the registration access token used to make\n * this request SHOULD be immediately revoked.\" spec-cite: RFC 7592 §2.1. The SHOULD is moot for\n * us: a token for a client that does not exist has no row to revoke, so there is nothing to do.\n * - **403 when the client exists but was not dynamically registered.** \"If the client does not have\n * permission to read its record, the server MUST return an HTTP 403 Forbidden.\" spec-cite: RFC\n * 7592 §2.1. An operator- or organization-registered client is administered through the ordinary\n * authenticated resource surface; it holds no registration access token and must not be\n * reachable here even if one were somehow presented.\n * - **401 when the presented token does not match.**\n *\n * Note the deliberate asymmetry: an unknown client is 401 and a known-but-ineligible one is 403,\n * which is what the specification asks for even though it leaks that a client id exists. That\n * disclosure is bounded — the caller already had to supply the id — and diverging from the\n * specification here would break a conformant client's error handling.\n */\n private async authenticateClientConfiguration(\n req: Request,\n res: Response,\n ): Promise<{ clientId: string; record: OAuthClientApplication } | null> {\n if (!this.dynamicRegistrationConfiguration().enabled) {\n res.status(404).json({ error: 'not_found' });\n return null;\n }\n\n const header = req.headers.authorization;\n const presented = typeof header === 'string' && header.startsWith('Bearer ')\n ? header.slice('Bearer '.length).trim()\n : undefined;\n if (!presented) {\n this.sendClientConfigurationUnauthorized(res, 'a registration access token is required');\n return null;\n }\n\n const clientId = String(req.params.clientId ?? '');\n if (!clientId) {\n this.sendClientConfigurationUnauthorized(res, 'unknown client');\n return null;\n }\n\n const record = await this.systemAccess.readAsSystem<OAuthClientApplication>(\n CoreResourceType.OAUTH_CLIENTS_APPLICATION,\n clientId,\n ).catch(() => null);\n if (!record) {\n this.sendClientConfigurationUnauthorized(res, 'unknown client');\n return null;\n }\n\n if (record.registrationOrigin !== OAuthClientRegistrationOrigin.DYNAMIC) {\n res.set('Cache-Control', 'no-store');\n res.status(403).json({ error: 'access_denied', error_description: 'this client is not managed through dynamic registration' });\n return null;\n }\n\n /*\n * A DEPROVISIONED client is not manageable, and this rung is what makes its registration access\n * token invalid.\n *\n * \"If a client is deprovisioned from a server, any outstanding registration access token for\n * that client MUST be invalidated at the same time.\" spec-cite: RFC 7592 §5. A token that\n * authenticates at no endpoint is invalidated in the only sense that matters — so `DELETE` marks\n * the client `INACTIVE` and this refuses every later call, rather than clearing the stored hash\n * and losing the record of which token the client held, which an operator investigating a\n * deleted client wants.\n */\n if (record.status !== OAuthClientStatus.ACTIVE) {\n this.sendClientConfigurationUnauthorized(res, 'invalid registration access token');\n return null;\n }\n\n const storedHash = record.registrationAccessTokenHash;\n // Compared through `timingSafeEqual` over the two DIGESTS: both are fixed-length hex, so the\n // buffers can never differ in length and the comparison cannot leak a prefix match by timing.\n if (!storedHash || !this.registrationTokenMatches(presented, storedHash)) {\n this.sendClientConfigurationUnauthorized(res, 'invalid registration access token');\n return null;\n }\n\n return { clientId, record };\n }\n\n /**\n * Constant-time comparison of a presented registration access token against the stored digest.\n *\n * Both sides are SHA-256 hex, so they are always the same length and `timingSafeEqual` cannot\n * throw — which is why the digests are compared rather than the raw values.\n */\n private registrationTokenMatches(presented: string, storedHash: string): boolean {\n const presentedDigest = Buffer.from(hashRegistrationAccessToken(presented), 'hex');\n const storedDigest = Buffer.from(storedHash, 'hex');\n if (presentedDigest.length !== storedDigest.length || presentedDigest.length === 0) return false;\n return timingSafeEqual(presentedDigest, storedDigest);\n }\n\n /**\n * RFC 6750 §3 shape for every unauthenticated refusal at this endpoint.\n *\n * One description for a missing token and a wrong one, on purpose: distinguishing them tells an\n * unauthenticated caller which half of its guess was right.\n */\n private sendClientConfigurationUnauthorized(res: Response, description: string): void {\n res.set('Cache-Control', 'no-store');\n res.set('WWW-Authenticate', 'Bearer error=\"invalid_token\"');\n res.status(401).json({ error: 'invalid_token', error_description: description });\n }\n\n /**\n * The client information response body — RFC 7592 §3, minus the two members §2.2 forbids a client\n * to send back.\n *\n * `registration_access_token` is NOT echoed on read or update. It is returned once, at\n * registration, and we do not rotate it: §5 permits rotation on a read or update (\"MAY\"), and\n * taking that option means a client that loses the response has silently lost management access\n * for good. The specification's own preference — \"SHOULD NOT expire while a client is still\n * actively registered\" — points the same way.\n */\n private clientInformationResponse(clientId: string, record: OAuthClientApplication): Record<string, unknown> {\n return {\n client_id: clientId,\n client_name: record.name,\n redirect_uris: record.redirectUris ?? [],\n post_logout_redirect_uris: record.postLogoutRedirectUris ?? [],\n grant_types: record.allowedGrants ?? [],\n response_types: ['code'],\n token_endpoint_auth_method: record.tokenEndpointAuthMethod,\n scope: (record.allowedScopes ?? []).join(' '),\n registration_client_uri: this.registrationClientUri(clientId),\n };\n }\n\n /**\n * `GET /oauth/register/:clientId` — RFC 7592 §2.1 Client Read Request.\n *\n * \"the authorization server responds with an HTTP 200 OK with content type of `application/json`\".\n * spec-cite: RFC 7592 §2.1.\n */\n private async handleClientConfigurationRead(req: Request, res: Response): Promise<void> {\n const authenticated = await this.authenticateClientConfiguration(req, res);\n if (!authenticated) return;\n\n res.set('Cache-Control', 'no-store');\n this.jsonSuccess(res, this.clientInformationResponse(authenticated.clientId, authenticated.record), 200);\n }\n\n /**\n * `PUT /oauth/register/:clientId` — RFC 7592 §2.2 Client Update Request.\n *\n * **Full replacement, not a patch, and that is the specification's choice rather than ours:** \"This\n * request MUST include all client metadata fields as returned to the client from a previous\n * registration, read, or update operation\" and \"Omitted fields MUST be treated as null or empty\n * values by the server, indicating the client's request to delete them from the client's\n * registration.\" spec-cite: RFC 7592 §2.2.\n *\n * So a client that sends only the field it wants to change DELETES everything else. That is\n * surprising, it is what the specification requires, and it is why `redirect_uris` is re-validated\n * on every update rather than assumed still present.\n *\n * Every confinement the registration endpoint applies is re-applied here, in the same order. A\n * client that could widen its scopes, add a grant or change its auth method through an update\n * would have found a way around the registration confinements by taking one extra step.\n */\n private async handleClientConfigurationUpdate(req: Request, res: Response): Promise<void> {\n const authenticated = await this.authenticateClientConfiguration(req, res);\n if (!authenticated) return;\n const { clientId, record } = authenticated;\n\n const body = (req.body ?? {}) as Record<string, unknown>;\n\n // \"The client MUST include its `client_id` field in the request, and it MUST be the same as its\n // currently issued client identifier.\" spec-cite: RFC 7592 §2.2. A mismatch is the client\n // addressing one registration and describing another, which is a client bug worth naming.\n if (body.client_id !== clientId) {\n this.sendRegistrationError(res, 'invalid_client_metadata', 'client_id must be present and must match the client being updated');\n return;\n }\n\n // \"The updated client metadata fields request MUST NOT include the `registration_access_token`,\n // `registration_client_uri`, `client_secret_expires_at`, or `client_id_issued_at` fields.\"\n // spec-cite: RFC 7592 §2.2. Refused rather than ignored: a client sending one has misunderstood\n // the contract, and silently dropping it would leave it believing it had rotated its own token.\n const forbidden = ['registration_access_token', 'registration_client_uri', 'client_secret_expires_at', 'client_id_issued_at']\n .find((field) => body[field] !== undefined);\n if (forbidden) {\n this.sendRegistrationError(res, 'invalid_client_metadata', `${forbidden} must not be included in an update request`);\n return;\n }\n\n // \"If the client includes the `client_secret` field in the request, the value of this field MUST\n // match the currently issued client secret for that client. The client MUST NOT be allowed to\n // overwrite its existing client secret with its own chosen value.\" spec-cite: RFC 7592 §2.2.\n // A dynamically registered client is PUBLIC and never received a secret, so any value it sends\n // cannot match one — refuse rather than compare against a secret it does not have.\n if (body.client_secret !== undefined) {\n this.sendRegistrationError(res, 'invalid_client_metadata', 'this client has no client secret to confirm');\n return;\n }\n\n const redirectUris = body.redirect_uris;\n if (!Array.isArray(redirectUris) || redirectUris.length === 0 || !redirectUris.every((uri): uri is string => typeof uri === 'string')) {\n this.sendRegistrationError(res, 'invalid_redirect_uri', 'redirect_uris must be a non-empty array of strings');\n return;\n }\n const unsafe = redirectUris.find((uri) => !isSafeOAuthRedirectUri(uri));\n if (unsafe) {\n this.sendRegistrationError(res, 'invalid_redirect_uri', `redirect_uri is not permitted: ${unsafe}`);\n return;\n }\n\n // Omitted ⇒ emptied, per §2.2. That is the whole reason this reads as a replacement.\n let postLogoutRedirectUris: string[] = [];\n if (body.post_logout_redirect_uris !== undefined) {\n if (!Array.isArray(body.post_logout_redirect_uris) || !body.post_logout_redirect_uris.every((uri): uri is string => typeof uri === 'string')) {\n this.sendRegistrationError(res, 'invalid_client_metadata', 'post_logout_redirect_uris must be an array of strings');\n return;\n }\n const unsafePostLogout = body.post_logout_redirect_uris.find((uri) => !isSafeOAuthRedirectUri(uri));\n if (unsafePostLogout) {\n this.sendRegistrationError(res, 'invalid_client_metadata', `post_logout_redirect_uri is not permitted: ${unsafePostLogout}`);\n return;\n }\n postLogoutRedirectUris = body.post_logout_redirect_uris;\n }\n\n const clientName = typeof body.client_name === 'string' && body.client_name.trim().length > 0\n ? body.client_name.trim().slice(0, 100)\n : undefined;\n if (!clientName) {\n this.sendRegistrationError(res, 'invalid_client_metadata', 'client_name is required');\n return;\n }\n\n // The registration confinements, re-applied. See `handleDynamicRegistration` for why each one\n // refuses rather than downgrades; the reasoning is identical and is not repeated here.\n if (body.roles !== undefined) {\n this.sendRegistrationError(res, 'invalid_client_metadata', 'roles cannot be requested at dynamic registration');\n return;\n }\n const requestedScopes = typeof body.scope === 'string' ? body.scope.split(/\\s+/).filter(Boolean) : [];\n const beyondIdentity = requestedScopes.filter((scope) => !OIDC_SUPPORTED_IDENTITY_SCOPES.includes(scope));\n if (beyondIdentity.length > 0) {\n this.sendRegistrationError(res, 'invalid_client_metadata', `scope(s) not available to a dynamically registered client: ${beyondIdentity.join(', ')}`);\n return;\n }\n const requestedGrants = Array.isArray(body.grant_types) ? body.grant_types : [OAuthGrantType.AUTHORIZATION_CODE];\n const forbiddenGrant = requestedGrants.find((grant) => grant !== OAuthGrantType.AUTHORIZATION_CODE && grant !== OAuthGrantType.REFRESH_TOKEN);\n if (forbiddenGrant) {\n this.sendRegistrationError(res, 'invalid_client_metadata', `grant_type not available to a dynamically registered client: ${String(forbiddenGrant)}`);\n return;\n }\n const requestedAuthMethod = body.token_endpoint_auth_method;\n if (requestedAuthMethod !== undefined && requestedAuthMethod !== OAuthTokenEndpointAuthMethod.NONE) {\n this.sendRegistrationError(res, 'invalid_client_metadata', 'only token_endpoint_auth_method=none is available to a dynamically registered client');\n return;\n }\n\n const updated = await this.systemAccess.updateAsSystem<OAuthClientApplication>(\n CoreResourceType.OAUTH_CLIENTS_APPLICATION,\n clientId,\n {\n name: clientName,\n redirectUris,\n postLogoutRedirectUris,\n allowedScopes: requestedScopes.length > 0 ? requestedScopes : [...OIDC_SUPPORTED_IDENTITY_SCOPES],\n },\n );\n if (!updated) {\n this.sendClientConfigurationUnauthorized(res, 'unknown client');\n return;\n }\n\n // assurance-control: WILDO.IDENTITY.CLIENT_IDENTITY_ASSERTION — a self-registered client changed\n // its own registration. Same standing as the registration itself, so the same audit concern:\n // `redirect_uris` is where a client's authorization responses are delivered, and an update is the\n // one way that set moves after registration.\n void this.auditLogs.logDynamicClientRegistered({\n clientId,\n clientName,\n redirectUris,\n postLogoutRedirectUris,\n ipAddress: getClientIpFromRequest(req),\n }).catch((auditError) => this.logger.warn('DYNAMIC_CLIENT_REGISTERED audit emit failed on update (non-fatal)', {\n ...projectCaughtErrorLogFields(auditError),\n }));\n\n res.set('Cache-Control', 'no-store');\n this.jsonSuccess(res, this.clientInformationResponse(clientId, { ...record, ...updated }), 200);\n }\n\n /**\n * `DELETE /oauth/register/:clientId` — RFC 7592 §2.3 Client Delete Request.\n *\n * \"If a client has been successfully deprovisioned, the authorization server MUST respond with an\n * HTTP 204 No Content message.\" spec-cite: RFC 7592 §2.3.\n *\n * **Deprovisioned by STATUS, not by removing the row**, and the row is what makes that sound: every\n * client-resolution path in this server refuses a non-`ACTIVE` client, so `INACTIVE` is\n * indistinguishable from absent to any protocol caller — while the row survives for the audit\n * trail, which is the thing an operator investigating a deleted client actually needs.\n *\n * The registration access token is invalidated by the same write, though not by being erased:\n * `authenticateClientConfiguration` refuses a non-`ACTIVE` client before it ever compares a token,\n * so the token authenticates nowhere from this moment. \"If a client is deprovisioned from a server,\n * any outstanding registration access token for that client MUST be invalidated at the same time.\"\n * spec-cite: RFC 7592 §5. Keeping the digest on the row costs nothing and preserves the record of\n * which token the client held, which an operator investigating a deleted client wants.\n *\n * **NOT DONE, and stated rather than implied:** \"If possible, the authorization server SHOULD\n * immediately invalidate all existing authorization grants and currently active access tokens, all\n * refresh tokens, and all other tokens associated with this client.\" spec-cite: RFC 7592 §2.3.\n * Already-issued access tokens keep working until they expire. Reaching them means driving the\n * revocation machinery over every token minted for this client, which is a larger change than this\n * endpoint; the client cannot obtain NEW tokens the moment this returns, because the token endpoint\n * resolves the client and refuses it.\n */\n private async handleClientConfigurationDelete(req: Request, res: Response): Promise<void> {\n const authenticated = await this.authenticateClientConfiguration(req, res);\n if (!authenticated) return;\n const { clientId } = authenticated;\n\n const deprovisioned = await this.systemAccess.updateAsSystem<OAuthClientApplication>(\n CoreResourceType.OAUTH_CLIENTS_APPLICATION,\n clientId,\n { status: OAuthClientStatus.INACTIVE },\n );\n if (!deprovisioned) {\n this.sendClientConfigurationUnauthorized(res, 'unknown client');\n return;\n }\n\n res.set('Cache-Control', 'no-store');\n res.status(204).send();\n }\n\n private sendRegistrationError(res: Response, error: string, description: string): void {\n res.set('Cache-Control', 'no-store');\n res.status(400).json({ error, error_description: description });\n }\n\n /**\n * Per-source-IP registration budget.\n *\n * Fail-CLOSED on a store error, which is the opposite of how most rate limits behave here and is\n * deliberate: elsewhere a limiter outage degrades an authenticated feature, whereas this one is\n * the sole restraint on anonymous row creation. Refusing registrations during a Redis outage\n * costs a client one retry; failing open costs the database.\n */\n private async withinDynamicRegistrationRate(clientIp: string | undefined, configuration: DynamicClientRegistrationConfig): Promise<boolean> {\n try {\n const key = `oauth-dynamic-registration:${clientIp ?? 'unknown'}`;\n const count = await this.redisService.incrementRateLimit(key, 3600);\n return count <= configuration.maxRegistrationsPerHourPerIp;\n } catch (error) {\n this.logger.warn('Dynamic-registration rate check failed; refusing (fail-closed)', {\n ...projectCaughtErrorLogFields(error),\n });\n return false;\n }\n }\n\n private async handleAuthorize(req: Request, res: Response): Promise<void> {\n const q = req.query as Record<string, string | undefined>;\n\n // Single-valued params; a REPEATED query key (Express parses `?scope=a&scope=b` to `string[]`\n // despite the cast) is malformed. Reject cleanly (400) — otherwise `(q.scope).split(...)` throws\n // a 500 and a repeated `resource` reaches the RFC 8707 binding as an array.\n const malformedAuthorizeParam = this.firstMalformedParam(q, ['response_type', 'client_id', 'redirect_uri', 'code_challenge', 'code_challenge_method', 'scope', 'resource', 'state', 'nonce']);\n if (malformedAuthorizeParam) {\n this.sendOAuthError(res, 400, 'invalid_request', `the '${malformedAuthorizeParam}' parameter must be a single string value`);\n return;\n }\n\n if (q.response_type !== 'code') {\n this.sendOAuthError(res, 400, 'unsupported_response_type', 'only response_type=code is supported');\n return;\n }\n if (!q.client_id || !q.redirect_uri) {\n this.sendOAuthError(res, 400, 'invalid_request', 'client_id and redirect_uri are required');\n return;\n }\n if (q.code_challenge_method !== 'S256' || !isValidS256CodeChallenge(q.code_challenge)) {\n // RFC 7636 §4.2: require a well-formed S256 challenge (43 unreserved-base64url chars) at the entry —\n // not merely a present one — so a malformed/low-entropy challenge is rejected before a code is minted.\n this.sendOAuthError(res, 400, 'invalid_request', 'a PKCE S256 code_challenge is required');\n return;\n }\n\n const authenticated = await this.resolveAuthenticatedUser(req);\n if (!authenticated) {\n // The user must authenticate first. A browser-integrated frontend redirects to login here;\n // for an API caller we signal login_required. (Login + consent UI is the frontend follow-up.)\n this.sendOAuthError(res, 401, 'login_required', 'user authentication is required at the authorization endpoint');\n return;\n }\n const { userId, sessionId } = authenticated;\n\n const scope = (q.scope ?? '').split(/\\s+/).filter(Boolean);\n try {\n // S1 (interactive consent): a `requiresConsent` (third-party) client does NOT receive a code\n // straight away — the user must EXPLICITLY approve acting on their behalf. Return\n // `consent_required` + a single-use consent-request token (the frontend renders the consent\n // screen from this and POSTs the decision to `/oauth/authorize/decision`). A trusted /\n // first-party client (`requiresConsent` false — the default) proceeds straight to the code, so\n // machine + trusted flows are UNCHANGED. Server-owned gate: the client cannot suppress it.\n // `userId` is resolved + non-undefined by here (login_required returned above otherwise). Passed so\n // the consent resolver can apply the D4/B same-org gate (a cross-org user always sees consent).\n const consentPosture = await this.authCodeService.resolveAuthorizationClientConsent(q.client_id, q.redirect_uri, userId);\n const { requiresConsent, clientName } = consentPosture;\n // Persistent consent (Item 3, \"remember this app\"): a `requiresConsent` client whose user already\n // has a stored grant covering the requested scopes for this (client, resource) is NOT re-prompted —\n // it falls through to the code-issuance path below (returns `{redirect_to}`), exactly like a trusted\n // client. Scope matching is SUBSET; a request for any new scope re-prompts (see hasCoveringConsentGrant).\n const needsConsent = requiresConsent\n && !(await this.authCodeService.hasCoveringConsentGrant(userId, q.client_id, q.resource, scope));\n if (needsConsent) {\n const { consentToken } = await this.authCodeService.createConsentRequest({\n userId,\n clientId: q.client_id,\n redirectUri: q.redirect_uri,\n scope,\n codeChallenge: q.code_challenge,\n nonce: q.nonce,\n resource: q.resource,\n state: q.state,\n });\n res.set('Cache-Control', 'no-store');\n this.jsonSuccess(res, {\n consent_required: true,\n consent_token: consentToken,\n client: {\n id: q.client_id,\n name: clientName,\n /**\n * How this client's identity was established, and the two DISPLAY obligations that come\n * with a domain-only identity. All three are here because the specification makes them\n * requirements on the authorization server, and the consent screen cannot satisfy a\n * requirement it was never handed the data for:\n *\n * \"Authorization servers … MUST clearly display the redirect URI hostname during\n * authorization\" and \"SHOULD display additional warnings for `localhost`-only redirect\n * URIs\".\n * spec-cite: MCP 2025-11-25 — Authorization § Client ID Metadata Document Security →\n * Localhost Redirect URI Risks\n *\n * `origin` lets the screen say WHICH trust story applies: a registered client was vetted\n * by someone in this application, a CIMD client proved only that it controls a domain.\n * Sent for both origins so the consent screen has one shape, not two.\n */\n origin: consentPosture.origin,\n redirect_uri_hostname: consentPosture.redirectUriHostname,\n loopback_only_redirects: consentPosture.warnsLoopbackOnlyRedirects,\n },\n scopes: scope,\n resource: q.resource ?? null,\n }, 200);\n return;\n }\n const { code } = await this.authCodeService.issueAuthorizationCode({\n userId,\n clientId: q.client_id,\n redirectUri: q.redirect_uri,\n scope,\n codeChallenge: q.code_challenge,\n codeChallengeMethod: 'S256',\n nonce: q.nonce,\n // RFC 8707 resource indicator — the agent (A2A / MCP) endpoint the client wants the token\n // for. Bound into the code here (authoritative), so the token endpoint mints an `aud`-confined\n // delegated token (B-S2). Absent ⇒ the token exchange fails closed with `invalid_target`.\n resource: q.resource,\n // revocation-C: bind the End-User's OP session to the code → id_token `sid`, so an RP logout\n // (end_session) terminates the exact Wildo login session this delegation was authorized from.\n sessionId,\n });\n // U-30 defense: build the redirect target defensively. `q.redirect_uri` already exact-matched a\n // registered URI (each constrained to a parseable absolute URL by `isSafeOAuthRedirectUri`), so this\n // cannot throw through the front door — but fail with a CLEAN OAuth error rather than a raw 500 if a\n // redirectUri was ever persisted bypassing that refine (a seed / createAsSystem / migration).\n let redirect: URL;\n try {\n redirect = new URL(q.redirect_uri);\n } catch {\n this.sendOAuthError(res, 400, 'invalid_request', 'the redirect_uri bound to this request is not a valid URL');\n return;\n }\n redirect.searchParams.set('code', code);\n if (q.state) redirect.searchParams.set('state', q.state);\n // Return the redirect target as JSON (NOT a 302), mirroring `/oauth/authorize/decision`: the caller\n // is the Bearer-authenticated consent SPA (an XHR), which auto-follows a 302 but cannot read a\n // cross-origin `Location` — so a 302 would neither deliver the code to the client nor forward the\n // user. The SPA does `window.location.assign(redirect_to)` to complete the OAuth redirect.\n this.sendAuthorizationRedirect(res, redirect);\n } catch (error) {\n if (isWildoBackendError(error)) {\n const ctx = (error as { context?: { oauthError?: string; detail?: string } }).context;\n if (ctx?.oauthError) {\n this.sendOAuthError(res, ctx.oauthError === 'invalid_client' ? 401 : 400, ctx.oauthError, ctx.detail);\n return;\n }\n }\n throw error;\n }\n }\n\n /**\n * `POST /oauth/authorize/decision` — the interactive-consent decision (S1). After `/oauth/authorize`\n * returned `consent_required` for a `requiresConsent` client, the user's approve/deny is POSTed here\n * with the single-use consent-request token. Bearer-authenticated (the same user who authorized).\n * - `decision=approve` → mint the authorization code from the stashed request → return\n * `{ redirect_to: <redirect_uri>?code=&state= }` (200 JSON).\n * - anything else → DENY → return `{ redirect_to: <redirect_uri>?error=access_denied&state= }`\n * (200 JSON, RFC 6749 §4.1.2.1). No code minted.\n *\n * Returns the redirect target as JSON (NOT an HTTP 302) because the caller is a Bearer-authenticated\n * BROWSER SPA (the interactive consent screen): an XHR carrying the required `Authorization` header\n * auto-follows a 302 and cannot read a cross-origin `Location`, so the SPA could neither read the\n * code nor forward the user. Instead the SPA does `window.location.assign(redirect_to)` to complete\n * the OAuth redirect to the third-party client. The request parameters come from the SERVER-STORED\n * consent token (not the POST body), so the decision cannot tamper with what the user approved.\n */\n private async handleConsentDecision(req: Request, res: Response): Promise<void> {\n const body = (req.body ?? {}) as Record<string, string | undefined>;\n const malformed = this.firstMalformedParam(body, ['consent_token', 'decision', 'remember']);\n if (malformed) {\n this.sendOAuthError(res, 400, 'invalid_request', `the '${malformed}' parameter must be a single string value`);\n return;\n }\n const authenticated = await this.resolveAuthenticatedUser(req);\n if (!authenticated) {\n this.sendOAuthError(res, 401, 'login_required', 'user authentication is required to record a consent decision');\n return;\n }\n const { userId, sessionId } = authenticated;\n if (!body.consent_token || !body.decision) {\n this.sendOAuthError(res, 400, 'invalid_request', 'consent_token and decision are required');\n return;\n }\n\n try {\n const request = await this.authCodeService.consumeConsentRequest(body.consent_token);\n // Bind the decision to the AUTHENTICATED user: the consent token's subject MUST be the caller,\n // so one user cannot approve/deny another user's pending consent (the token is single-use, so\n // this is already consumed — fail closed without minting anything).\n if (request.userId !== userId) {\n // assurance-control: WILDO.ACCESS.AUTHORIZATION_DECISION_AUDIT — a consent-token user-binding violation\n // (one user attempting to act on another user's pending consent) is a textbook cross-user\n // authorization-abuse signal. Fail closed (403) AND audit it (records BOTH principals — actor +\n // victim). The raw consent-token value is deliberately NOT logged (credential hygiene; it is\n // single-use and already consumed). Fire-and-forget — auditing must never affect the fail-closed 403.\n void this.auditLogs.logOAuthConsentBindingViolation({\n authenticatedUserId: userId,\n boundUserId: request.userId,\n clientId: request.clientId,\n ipAddress: getClientIpFromRequest(req),\n }).catch((auditError) => this.logger.warn('OAUTH_CONSENT_BINDING_VIOLATION audit emit failed (non-fatal)', {\n ...projectCaughtErrorLogFields(auditError),\n }));\n this.sendOAuthError(res, 403, 'access_denied', 'the consent request does not belong to the authenticated user');\n return;\n }\n // U-30 defense: the single-use consent token is ALREADY consumed above (its redirect_uri is only known\n // post-consume), so we cannot pre-validate — but a malformed stored redirect_uri must yield a CLEAN OAuth\n // error, not a raw 500 (the token is spent either way; do not also leak a stack trace). Normally\n // impossible — the stored value passed `isSafeOAuthRedirectUri` at authorize time.\n let redirect: URL;\n try {\n redirect = new URL(request.redirectUri);\n } catch {\n this.sendOAuthError(res, 400, 'invalid_request', 'the redirect_uri bound to this consent request is not a valid URL');\n return;\n }\n if (request.state) redirect.searchParams.set('state', request.state);\n res.set('Cache-Control', 'no-store');\n\n if (body.decision !== 'approve') {\n // DENY (or any non-approve value) — fail closed, no code minted.\n // assurance-control: WILDO.IDENTITY.DELEGATED_AUTHORIZATION — user REFUSES third-party delegated access. The\n // binding check above passed, so the denying user IS `request.userId`. Fire-and-forget.\n void this.auditLogs.logOAuthConsentDenied({\n userId: request.userId,\n clientId: request.clientId,\n scopes: request.scope,\n resource: request.resource,\n ipAddress: getClientIpFromRequest(req),\n }).catch((auditError) => this.logger.warn('OAUTH_CONSENT_DENIED audit emit failed (non-fatal)', {\n ...projectCaughtErrorLogFields(auditError),\n }));\n redirect.searchParams.set('error', 'access_denied');\n // An ERROR response carries `iss` too — explicitly required, and the case that matters most:\n // a mix-up victim is likelier to be handed a failure than a success.\n this.sendAuthorizationRedirect(res, redirect);\n return;\n }\n\n const { code } = await this.authCodeService.issueAuthorizationCode({\n userId: request.userId,\n clientId: request.clientId,\n redirectUri: request.redirectUri,\n scope: request.scope,\n codeChallenge: request.codeChallenge,\n codeChallengeMethod: 'S256',\n nonce: request.nonce,\n resource: request.resource,\n // revocation-C: bind the session that COMPLETES the grant (the decision-time authenticated\n // session, verified `request.userId === userId` above) to the code → id_token `sid`. Using the\n // live decision-time session (not the stored authorize-time one) keeps `sid` pointing at a\n // session that is still alive to be terminated by a later RP end_session.\n sessionId,\n });\n // assurance-control: WILDO.IDENTITY.DELEGATED_AUTHORIZATION — user APPROVES third-party delegated access (a\n // code is now issued and the client may act for them). `remembered` flags whether a durable grant was\n // also requested (the grant CREATION itself is audited separately as A-3 inside `upsertConsentGrant`).\n // Fire-and-forget — auditing must never affect the consent the user already gave.\n void this.auditLogs.logOAuthConsentGranted({\n userId: request.userId,\n clientId: request.clientId,\n scopes: request.scope,\n resource: request.resource,\n remembered: body.remember === 'true',\n ipAddress: getClientIpFromRequest(req),\n }).catch((auditError) => this.logger.warn('OAUTH_CONSENT_GRANTED audit emit failed (non-fatal)', {\n ...projectCaughtErrorLogFields(auditError),\n }));\n // Persistent consent (Item 3): if the user opted to remember this app, store/widen the grant so a\n // future authorize with covering scopes skips the prompt. Best-effort — a store failure must NOT\n // fail the consent the user already gave (the code is already minted).\n if (body.remember === 'true') {\n await this.authCodeService\n .upsertConsentGrant(request.userId, request.clientId, request.resource, request.scope)\n .catch((e) => this.logger.warn('Persistent consent grant store failed (non-fatal)', { ...projectCaughtErrorLogFields(e) }));\n }\n redirect.searchParams.set('code', code);\n this.sendAuthorizationRedirect(res, redirect);\n } catch (error) {\n if (isWildoBackendError(error)) {\n const ctx = (error as { context?: { oauthError?: string; detail?: string } }).context;\n if (ctx?.oauthError) {\n this.sendOAuthError(res, ctx.oauthError === 'invalid_client' ? 401 : 400, ctx.oauthError, ctx.detail);\n return;\n }\n }\n throw error;\n }\n }\n\n /**\n * `GET /oauth/userinfo` — returns the authenticated user's claims for a valid user Bearer token\n * (OIDC Core §5.3). Always returns `sub`; adds the standard `email`/`profile`-scope claims the\n * access token was granted, resolved via {@link OidcUserClaimsBackendService}. `picture` (avatar)\n * and `locale` claims are a documented follow-up.\n */\n private async handleUserInfo(req: Request, res: Response): Promise<void> {\n const authHeader = req.headers['authorization'];\n if (typeof authHeader !== 'string' || !authHeader.startsWith('Bearer ')) {\n this.sendOAuthError(res, 401, 'invalid_token', 'a bearer access token is required', 'Bearer');\n return;\n }\n let claim: { type?: string; userId?: string; sub?: string; scope?: string[] };\n try {\n claim = (await this.jwtService.verify(authHeader.slice('Bearer '.length).trim())) as typeof claim;\n } catch {\n this.sendOAuthError(res, 401, 'invalid_token', 'access token invalid or expired', 'Bearer');\n return;\n }\n const sub = claim.userId ?? claim.sub;\n if (!sub || claim.type !== ExecutionContext_ExecutionType.USER_REQUEST) {\n this.sendOAuthError(res, 403, 'insufficient_scope', 'userinfo requires a user access token', 'Bearer');\n return;\n }\n // OIDC Core §5.3.2: `sub` plus the standard claims the access token's granted identity scopes\n // (`email` / `profile`) permit. A token carrying no `scope` claim (e.g. a first-party session\n // token) yields just `sub`. The resolver reads the subject's own User/UserProfile and never\n // throws for a missing profile.\n const claims = await this.userClaimsService.resolveUserClaims(sub, claim.scope ?? []);\n res.set('Cache-Control', 'no-store');\n this.jsonSuccess(res, { sub, ...claims }, 200);\n }\n\n /**\n * Resolve the authenticated user (id + login `sessionId`) from a `Bearer` user access token, else\n * `undefined`. The `sessionId` (revocation-C) is threaded into the OIDC authorization code so the\n * id_token carries `sid` — the handle the RP-Initiated Logout endpoint terminates.\n */\n private async resolveAuthenticatedUser(req: Request): Promise<{ userId: string; sessionId?: string } | undefined> {\n const authHeader = req.headers['authorization'];\n if (typeof authHeader !== 'string' || !authHeader.startsWith('Bearer ')) return undefined;\n try {\n const claim = (await this.jwtService.verify(authHeader.slice('Bearer '.length).trim())) as { type?: string; userId?: string; sessionId?: string };\n if (claim.type !== ExecutionContext_ExecutionType.USER_REQUEST || !claim.userId) return undefined;\n return { userId: claim.userId, sessionId: claim.sessionId };\n } catch {\n return undefined;\n }\n }\n\n /**\n * Resolve the client secret (+ optional client_id) from `client_secret_basic`\n * (Authorization: Basic base64(client_id:client_secret)) or `client_secret_post` (body).\n * Values are URL-safe in this system (`oc_*` secrets + id), so no percent-decoding is needed.\n */\n private extractClientCredentials(req: Request, body: Record<string, string | undefined>): { clientId?: string; clientSecret?: string } {\n const authHeader = req.headers['authorization'];\n if (typeof authHeader === 'string' && authHeader.startsWith('Basic ')) {\n const decoded = Buffer.from(authHeader.slice('Basic '.length).trim(), 'base64').toString('utf8');\n const sep = decoded.indexOf(':');\n if (sep >= 0) {\n return {\n clientId: decoded.slice(0, sep) || undefined,\n clientSecret: decoded.slice(sep + 1) || undefined,\n };\n }\n }\n return { clientId: body.client_id || undefined, clientSecret: body.client_secret || undefined };\n }\n\n /**\n * OAuth/OIDC request params are single-valued STRINGS, but Express (`extended:true` urlencoded, plus\n * `express.json`) parses a REPEATED key into a `string[]` and a bracketed `k[$regex]=…` / JSON\n * `{\"k\":{…}}` key into an OBJECT — despite the `Record<string,string|undefined>` cast at the handler\n * boundary. Returns the first `keys` entry that arrived as a NON-STRING (array, object, number, …), or\n * `undefined`.\n *\n * The caller rejects with `invalid_request` (400) so a non-string can never reach a `.split`/`.includes`\n * (500), slip silently through the RFC 8707 audience comparison, OR — critically — reach a RAW Mongo\n * filter as a `{$regex}` / `{$ne}` operator object. That last case is a NoSQL-operator-injection sink:\n * an object `code`/`token` flows to the consumable-token store's `findOne({ token })` and would\n * consume an arbitrary matching token (password-reset / invitation / magic-link); an object\n * `client_id` selects an arbitrary client. Rejecting EVERY non-string closes both the repeated-param\n * (array) and the injection (object) classes with one guard — an array is simply one kind of non-string.\n */\n private firstMalformedParam(source: Record<string, unknown>, keys: string[]): string | undefined {\n return keys.find((k) => source[k] !== undefined && typeof source[k] !== 'string');\n }\n\n private sendOAuthError(res: Response, status: number, error: string, description?: string, wwwAuthenticate?: 'Basic' | 'Bearer'): void {\n res.set('Cache-Control', 'no-store');\n // Token endpoint 401s challenge `Basic` (client auth); userinfo challenges `Bearer`. Other\n // 401s (e.g. authorize login_required) send no challenge.\n const scheme = wwwAuthenticate ?? (status === 401 ? 'Basic' : undefined);\n if (scheme) res.set('WWW-Authenticate', scheme);\n res.status(status).json({ error, ...(description ? { error_description: description } : {}) });\n }\n}\n"]}