@wildo-ai/saas-backend-lib 1.1.0 → 1.1.2

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 (265) hide show
  1. package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.d.ts +14 -3
  2. package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.d.ts.map +1 -1
  3. package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.js +115 -22
  4. package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.js.map +1 -1
  5. package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.d.ts +3 -1
  6. package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.d.ts.map +1 -1
  7. package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.js +8 -3
  8. package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.js.map +1 -1
  9. package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.d.ts +11 -0
  10. package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.d.ts.map +1 -1
  11. package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.js +11 -2
  12. package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.js.map +1 -1
  13. package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.d.ts +1 -0
  14. package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.d.ts.map +1 -1
  15. package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.js +6 -1
  16. package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.js.map +1 -1
  17. package/dist/esm/base-classes/services/repositories/http-api/odata-query-compiler.backend.d.ts.map +1 -1
  18. package/dist/esm/base-classes/services/repositories/http-api/odata-query-compiler.backend.js +16 -0
  19. package/dist/esm/base-classes/services/repositories/http-api/odata-query-compiler.backend.js.map +1 -1
  20. package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.d.ts +20 -6
  21. package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.d.ts.map +1 -1
  22. package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.js +88 -32
  23. package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.js.map +1 -1
  24. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.d.ts +3 -1
  25. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.d.ts.map +1 -1
  26. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.js +32 -7
  27. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.js.map +1 -1
  28. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.d.ts +8 -5
  29. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.d.ts.map +1 -1
  30. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.js.map +1 -1
  31. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts +31 -0
  32. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts.map +1 -1
  33. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js +127 -5
  34. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js.map +1 -1
  35. package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.d.ts +71 -1
  36. package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.d.ts.map +1 -1
  37. package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js +62 -2
  38. package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js.map +1 -1
  39. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts +21 -0
  40. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts.map +1 -1
  41. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js +126 -4
  42. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js.map +1 -1
  43. package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.d.ts +3 -26
  44. package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.d.ts.map +1 -1
  45. package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.js +3 -68
  46. package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.js.map +1 -1
  47. package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.d.ts.map +1 -1
  48. package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js +4 -2
  49. package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js.map +1 -1
  50. package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.js +6 -6
  51. package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.js.map +1 -1
  52. package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.d.ts +38 -0
  53. package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.d.ts.map +1 -1
  54. package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.js +40 -0
  55. package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.js.map +1 -1
  56. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts +20 -0
  57. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts.map +1 -1
  58. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js +28 -0
  59. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js.map +1 -1
  60. package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.d.ts +12 -0
  61. package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.d.ts.map +1 -0
  62. package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.js +118 -0
  63. package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.js.map +1 -0
  64. package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.d.ts.map +1 -1
  65. package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.js +8 -5
  66. package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.js.map +1 -1
  67. package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.d.ts.map +1 -1
  68. package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.js +14 -0
  69. package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.js.map +1 -1
  70. package/dist/esm/config/custom/application-config-controller.backend.service.d.ts.map +1 -1
  71. package/dist/esm/config/custom/application-config-controller.backend.service.js +7 -1
  72. package/dist/esm/config/custom/application-config-controller.backend.service.js.map +1 -1
  73. package/dist/esm/config/models/app-config.backend.schemas.d.ts +4 -0
  74. package/dist/esm/config/models/app-config.backend.schemas.d.ts.map +1 -1
  75. package/dist/esm/config/services/app-configuration.backend.utils.d.ts +10 -1
  76. package/dist/esm/config/services/app-configuration.backend.utils.d.ts.map +1 -1
  77. package/dist/esm/config/services/app-configuration.backend.utils.js +13 -2
  78. package/dist/esm/config/services/app-configuration.backend.utils.js.map +1 -1
  79. package/dist/esm/data-seeding/services/shared/data-seed-scope-iteration.shared.utils.d.ts +2 -2
  80. package/dist/esm/data-seeding/services/shared/data-seed-scope-iteration.shared.utils.js +2 -2
  81. package/dist/esm/data-seeding/services/shared/data-seed-scope-iteration.shared.utils.js.map +1 -1
  82. package/dist/esm/databases/models/filter.backend.schemas.js +2 -2
  83. package/dist/esm/databases/models/filter.backend.schemas.js.map +1 -1
  84. package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.d.ts.map +1 -1
  85. package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.js +20 -1
  86. package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.js.map +1 -1
  87. package/dist/esm/databases/services/redis.service.d.ts +27 -0
  88. package/dist/esm/databases/services/redis.service.d.ts.map +1 -1
  89. package/dist/esm/databases/services/redis.service.js +29 -0
  90. package/dist/esm/databases/services/redis.service.js.map +1 -1
  91. package/dist/esm/errors/services/error-handler.backend.service.d.ts.map +1 -1
  92. package/dist/esm/errors/services/error-handler.backend.service.js +5 -0
  93. package/dist/esm/errors/services/error-handler.backend.service.js.map +1 -1
  94. package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.d.ts +41 -0
  95. package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.d.ts.map +1 -0
  96. package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.js +40 -0
  97. package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.js.map +1 -0
  98. package/dist/esm/external-data/controllers/external-data-admin.backend.controller.d.ts +64 -0
  99. package/dist/esm/external-data/controllers/external-data-admin.backend.controller.d.ts.map +1 -0
  100. package/dist/esm/external-data/controllers/external-data-admin.backend.controller.js +193 -0
  101. package/dist/esm/external-data/controllers/external-data-admin.backend.controller.js.map +1 -0
  102. package/dist/esm/external-data/external-data-pipeline-run.backend.service.d.ts +13 -2
  103. package/dist/esm/external-data/external-data-pipeline-run.backend.service.d.ts.map +1 -1
  104. package/dist/esm/external-data/external-data-pipeline-run.backend.service.js +8 -2
  105. package/dist/esm/external-data/external-data-pipeline-run.backend.service.js.map +1 -1
  106. package/dist/esm/external-data/external-data-transform.backend.d.ts.map +1 -1
  107. package/dist/esm/external-data/external-data-transform.backend.js +7 -1
  108. package/dist/esm/external-data/external-data-transform.backend.js.map +1 -1
  109. package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.d.ts +2 -0
  110. package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.d.ts.map +1 -1
  111. package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.js +13 -0
  112. package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.js.map +1 -1
  113. package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts +14 -0
  114. package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts.map +1 -1
  115. package/dist/esm/external-providers/services/external-providers-registry.backend.service.js +6 -0
  116. package/dist/esm/external-providers/services/external-providers-registry.backend.service.js.map +1 -1
  117. package/dist/esm/files/controllers/file.controller.d.ts +24 -1
  118. package/dist/esm/files/controllers/file.controller.d.ts.map +1 -1
  119. package/dist/esm/files/controllers/file.controller.js +66 -2
  120. package/dist/esm/files/controllers/file.controller.js.map +1 -1
  121. package/dist/esm/files/handlers/file-upload-route-locals.backend.types.d.ts +17 -0
  122. package/dist/esm/files/handlers/file-upload-route-locals.backend.types.d.ts.map +1 -0
  123. package/dist/esm/files/handlers/file-upload-route-locals.backend.types.js +1 -0
  124. package/dist/esm/files/handlers/file-upload-route-locals.backend.types.js.map +1 -0
  125. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts +5 -1
  126. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts.map +1 -1
  127. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js +42 -3
  128. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js.map +1 -1
  129. package/dist/esm/files/services/file-operation-handler.backend.service.d.ts +18 -0
  130. package/dist/esm/files/services/file-operation-handler.backend.service.d.ts.map +1 -1
  131. package/dist/esm/files/services/file-operation-handler.backend.service.js +36 -28
  132. package/dist/esm/files/services/file-operation-handler.backend.service.js.map +1 -1
  133. package/dist/esm/files/services/file-upload-grant.backend.service.d.ts +163 -0
  134. package/dist/esm/files/services/file-upload-grant.backend.service.d.ts.map +1 -0
  135. package/dist/esm/files/services/file-upload-grant.backend.service.js +442 -0
  136. package/dist/esm/files/services/file-upload-grant.backend.service.js.map +1 -0
  137. package/dist/esm/files/services/files.backend.service.d.ts +19 -0
  138. package/dist/esm/files/services/files.backend.service.d.ts.map +1 -1
  139. package/dist/esm/files/services/files.backend.service.js +78 -15
  140. package/dist/esm/files/services/files.backend.service.js.map +1 -1
  141. package/dist/esm/files/utils/file-uploader.utils.d.ts.map +1 -1
  142. package/dist/esm/files/utils/file-uploader.utils.js +12 -0
  143. package/dist/esm/files/utils/file-uploader.utils.js.map +1 -1
  144. package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.js +5 -5
  145. package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.js.map +1 -1
  146. package/dist/esm/flows-actors/services/agents.backend.service.d.ts +79 -0
  147. package/dist/esm/flows-actors/services/agents.backend.service.d.ts.map +1 -1
  148. package/dist/esm/flows-actors/services/agents.backend.service.js +319 -42
  149. package/dist/esm/flows-actors/services/agents.backend.service.js.map +1 -1
  150. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.d.ts +151 -41
  151. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.d.ts.map +1 -1
  152. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js +300 -139
  153. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js.map +1 -1
  154. package/dist/esm/index.d.ts +4 -1
  155. package/dist/esm/index.d.ts.map +1 -1
  156. package/dist/esm/index.js +14 -1
  157. package/dist/esm/index.js.map +1 -1
  158. package/dist/esm/inject/models/container.d.ts.map +1 -1
  159. package/dist/esm/inject/models/container.js +4 -0
  160. package/dist/esm/inject/models/container.js.map +1 -1
  161. package/dist/esm/inject/models/service-types.d.ts +3 -0
  162. package/dist/esm/inject/models/service-types.d.ts.map +1 -1
  163. package/dist/esm/inject/models/service-types.js +2 -0
  164. package/dist/esm/inject/models/service-types.js.map +1 -1
  165. package/dist/esm/mcp/controllers/mcp.controller.d.ts.map +1 -1
  166. package/dist/esm/mcp/controllers/mcp.controller.js +12 -4
  167. package/dist/esm/mcp/controllers/mcp.controller.js.map +1 -1
  168. package/dist/esm/mcp/models/mcp-tool.backend.schemas.d.ts +34 -0
  169. package/dist/esm/mcp/models/mcp-tool.backend.schemas.d.ts.map +1 -1
  170. package/dist/esm/mcp/models/mcp-tool.backend.schemas.js +42 -0
  171. package/dist/esm/mcp/models/mcp-tool.backend.schemas.js.map +1 -1
  172. package/dist/esm/mcp/services/mcp-server.backend.service.d.ts +29 -1
  173. package/dist/esm/mcp/services/mcp-server.backend.service.d.ts.map +1 -1
  174. package/dist/esm/mcp/services/mcp-server.backend.service.js +131 -3
  175. package/dist/esm/mcp/services/mcp-server.backend.service.js.map +1 -1
  176. package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.d.ts +64 -2
  177. package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.d.ts.map +1 -1
  178. package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.js +130 -6
  179. package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.js.map +1 -1
  180. package/dist/esm/notifications/services/notifications-dispatcher.backend.service.d.ts +9 -0
  181. package/dist/esm/notifications/services/notifications-dispatcher.backend.service.d.ts.map +1 -1
  182. package/dist/esm/notifications/services/notifications-dispatcher.backend.service.js +11 -36
  183. package/dist/esm/notifications/services/notifications-dispatcher.backend.service.js.map +1 -1
  184. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.d.ts.map +1 -1
  185. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.js +9 -7
  186. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.js.map +1 -1
  187. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.d.ts +5 -5
  188. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.d.ts.map +1 -1
  189. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.js +14 -13
  190. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.js.map +1 -1
  191. package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.d.ts +2 -1
  192. package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.d.ts.map +1 -1
  193. package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.js +2 -2
  194. package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.js.map +1 -1
  195. package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.d.ts.map +1 -1
  196. package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.js +9 -7
  197. package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.js.map +1 -1
  198. package/dist/esm/organizations/services/organization-unit-custom-implementation.backend.service.d.ts.map +1 -1
  199. package/dist/esm/organizations/services/organization-unit-custom-implementation.backend.service.js +4 -1
  200. package/dist/esm/organizations/services/organization-unit-custom-implementation.backend.service.js.map +1 -1
  201. package/dist/esm/requests/service/websocket.service.d.ts.map +1 -1
  202. package/dist/esm/requests/service/websocket.service.js +56 -7
  203. package/dist/esm/requests/service/websocket.service.js.map +1 -1
  204. package/dist/esm/resources/models/custom-service-implementations.backend.definition.d.ts.map +1 -1
  205. package/dist/esm/resources/models/custom-service-implementations.backend.definition.js +2 -0
  206. package/dist/esm/resources/models/custom-service-implementations.backend.definition.js.map +1 -1
  207. package/dist/esm/resources/services/resource-id.backend.service.js +3 -3
  208. package/dist/esm/resources/services/resource-id.backend.service.js.map +1 -1
  209. package/dist/esm/resources/services/resources-registry.backend.service.js +1 -1
  210. package/dist/esm/resources/services/resources-registry.backend.service.js.map +1 -1
  211. package/dist/esm/runtime/services/execution-context-creator.backend.service.d.ts.map +1 -1
  212. package/dist/esm/runtime/services/execution-context-creator.backend.service.js +13 -7
  213. package/dist/esm/runtime/services/execution-context-creator.backend.service.js.map +1 -1
  214. package/dist/esm/runtime/services/start-application.backend.service.d.ts +28 -0
  215. package/dist/esm/runtime/services/start-application.backend.service.d.ts.map +1 -1
  216. package/dist/esm/runtime/services/start-application.backend.service.js +82 -0
  217. package/dist/esm/runtime/services/start-application.backend.service.js.map +1 -1
  218. package/dist/esm/security/authentications/models/jwt.backend.schemas.d.ts +3 -23
  219. package/dist/esm/security/authentications/models/jwt.backend.schemas.d.ts.map +1 -1
  220. package/dist/esm/security/authentications/models/jwt.backend.schemas.js +20 -45
  221. package/dist/esm/security/authentications/models/jwt.backend.schemas.js.map +1 -1
  222. package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.d.ts +9 -1
  223. package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.d.ts.map +1 -1
  224. package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.js +9 -1
  225. package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.js.map +1 -1
  226. package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.d.ts.map +1 -1
  227. package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.js +5 -3
  228. package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.js.map +1 -1
  229. package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.d.ts +25 -1
  230. package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.d.ts.map +1 -1
  231. package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.js +55 -4
  232. package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.js.map +1 -1
  233. package/dist/esm/security/authorizations/initiator-organization-confinement.backend.d.ts.map +1 -1
  234. package/dist/esm/security/authorizations/initiator-organization-confinement.backend.js +24 -1
  235. package/dist/esm/security/authorizations/initiator-organization-confinement.backend.js.map +1 -1
  236. package/dist/esm/security/authorizations/privileged-access-review.backend.utils.d.ts +117 -0
  237. package/dist/esm/security/authorizations/privileged-access-review.backend.utils.d.ts.map +1 -0
  238. package/dist/esm/security/authorizations/privileged-access-review.backend.utils.js +104 -0
  239. package/dist/esm/security/authorizations/privileged-access-review.backend.utils.js.map +1 -0
  240. package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts +101 -6
  241. package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts.map +1 -1
  242. package/dist/esm/security/authorizations/services/authorizations.backend.service.js +210 -30
  243. package/dist/esm/security/authorizations/services/authorizations.backend.service.js.map +1 -1
  244. package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.d.ts +18 -1
  245. package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.d.ts.map +1 -1
  246. package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.js +110 -74
  247. package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.js.map +1 -1
  248. package/dist/esm/security/consumable-tokens/consumable-token-models.exports.d.ts +22 -0
  249. package/dist/esm/security/consumable-tokens/consumable-token-models.exports.d.ts.map +1 -0
  250. package/dist/esm/security/consumable-tokens/consumable-token-models.exports.js +22 -0
  251. package/dist/esm/security/consumable-tokens/consumable-token-models.exports.js.map +1 -0
  252. package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.d.ts +17 -3
  253. package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.d.ts.map +1 -1
  254. package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.js +12 -0
  255. package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.js.map +1 -1
  256. package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.d.ts +20 -0
  257. package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.d.ts.map +1 -1
  258. package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.js +58 -5
  259. package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.js.map +1 -1
  260. package/dist/esm/security/jwt/services/jwt.backend.service.d.ts.map +1 -1
  261. package/dist/esm/security/jwt/services/jwt.backend.service.js +1 -18
  262. package/dist/esm/security/jwt/services/jwt.backend.service.js.map +1 -1
  263. package/dist/tsconfig.build.tsbuildinfo +1 -1
  264. package/package.json +15 -9
  265. package/dist/esm/.builder.pid +0 -9
@@ -1 +1 @@
1
- {"version":3,"file":"initiator-organization-confinement.backend.js","sourceRoot":"","sources":["../../../../../src/security/authorizations/initiator-organization-confinement.backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAoBH,sFAAsF;AACtF,MAAM,CAAC,MAAM,wCAAwC,GAAG,gBAAgB,CAAC;AAEzE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,8CAA8C,CAAyB,MAOtF;IACC,MAAM,uBAAuB,GAAG,MAAM,CAAC,gBAAgB,CAAC,YAAY,EAAE,cAAc,CAAC;IACrF,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAC7B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,4FAA4F;IAC5F,4FAA4F;IAC5F,2EAA2E;IAC3E,IAAI,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,uCAAuC,KAAK,IAAI,EAAE,CAAC;QACxF,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IACE,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,wCAAwC,CAAC;WACnE,CAAC,MAAM,CAAC,gBAAgB,CAAC,wCAAwC,CAAC,EACrE,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,iBAAiB,GAAG,MAAM,CAAC,WAAW,CAAC,iCAAiC,CAC5E,MAAM,CAAC,UAAU,EACjB,wCAAwC,CACzC,CAAC;IAEF,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,iBAAiB,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;QACrC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC;YAC/D,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,uBAAuB,CAAC,CAAC;YACpF,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["/**\n * Initiator-organization confinement — ONE definition, compiled by both adapters (D3).\n *\n * assurance-control: WILDO.ACCESS.SCOPE_CONFINEMENT — confines a query to the tenant the\n * caller is acting in.\n *\n * A caller's `initiatorIds.organizationId` is not a value they can choose: the execution-context\n * creator validates a requested organization against their MEMBERSHIPS and refuses one they do\n * not belong to. So it is a trustworthy statement of \"the tenant this request is acting in\", and\n * rows of other tenants are not part of what was asked for.\n *\n * **Why this exists as an authority rather than a repository branch.** PostgreSQL applied this\n * confinement and MongoDB did not — divergence D3, and the only measured divergence where the\n * two adapters disagreed about WHO CAN SEE WHOSE ROWS. Under the layering principle that\n * tenancy is a resource-system rule and adapters carry dialect only, a predicate about who may\n * read what has no business being written twice, or once.\n *\n * **The crossing is the part that was missing, and it is why the PostgreSQL version was wrong.**\n * The platform declares deliberate, reviewed cross-tenant doors per operation variant\n * (`admitsCrossTenantPlatformAdministration`) — `organizationMembers.grantOwnership`, the\n * owner-floor repair door, is one. Those are admitted at the AUTHORIZATION layer, before any\n * repository runs. A confinement that does not know about them lets authorization admit the\n * crossing and then silently filters the query to the operator's own tenant — so the repair door\n * reports success and repairs nothing, which is precisely the failure mode\n * `.claude/rules/administrative-continuity-floors.md` warns about.\n *\n * So: confine by default, and step aside ONLY for an operation that has declared the crossing.\n */\n\n/** What this authority needs from the execution context. Deliberately narrow, like its siblings. */\nexport interface InitiatorOrganizationConfinementSignal {\n readonly initiatorIds?: { readonly organizationId?: string | null } | null;\n /**\n * The operation being executed. Only its crossing declaration is read — an operation that\n * did NOT declare one is confined, which is what makes the opt-in enumerable rather than a\n * privilege-based bypass.\n */\n readonly operation?: { readonly admitsCrossTenantPlatformAdministration?: boolean } | null;\n}\n\n/** The schema-path operations this rule performs, supplied by the resource layer. */\nexport interface InitiatorOrganizationConfinementPathResolver {\n findNestedFieldPathsFromZodSchema(mainSchema: any, fieldIdentifier: string): string[];\n hasNestedPath(target: object, path: string): boolean;\n setNestedValue(target: object, path: string, value: unknown): void;\n}\n\n/** The field this confinement is keyed on. Named once so no call site can typo it. */\nexport const INITIATOR_ORGANIZATION_CONFINEMENT_FIELD = 'organizationId';\n\n/**\n * Confine `filter` to the caller's organization, unless the operation declares a crossing.\n *\n * Returns whether the confinement was applied, so a caller can report or pin the decision\n * rather than having to re-derive it.\n *\n * Precedence deliberately matches the relationship-FK sibling and NOT the retention hide: an\n * already-present path is left alone. A value at this key was put there by the context layer\n * from the addressed URL scope, which the authorization layer has already reconciled against\n * the caller; overwriting it here would silently re-scope a request that was legitimately\n * addressed elsewhere.\n *\n * `isFieldPersisted` exists because PostgreSQL can be stricter than MongoDB: it knows which\n * columns are actually planned, and filtering on an unplanned one is a SQL error rather than a\n * no-op. MongoDB passes a predicate that is always true.\n */\nexport function assignInitiatorOrganizationConfinementToFilter<TFilter extends object>(params: {\n readonly filter: TFilter;\n readonly executionContext: InitiatorOrganizationConfinementSignal;\n readonly blacklistedFields: ReadonlySet<string>;\n readonly mainSchema: unknown;\n readonly schemaPaths: InitiatorOrganizationConfinementPathResolver;\n readonly isFieldPersisted: (fieldName: string) => boolean;\n}): boolean {\n const initiatorOrganizationId = params.executionContext.initiatorIds?.organizationId;\n if (!initiatorOrganizationId) {\n return false;\n }\n\n // A DECLARED crossing is the whole point of the opt-in: the authorization layer has already\n // admitted this operation across the tenant boundary, and re-confining it here would undo a\n // decision that was made deliberately, with an audit record, one layer up.\n if (params.executionContext.operation?.admitsCrossTenantPlatformAdministration === true) {\n return false;\n }\n\n if (\n params.blacklistedFields.has(INITIATOR_ORGANIZATION_CONFINEMENT_FIELD)\n || !params.isFieldPersisted(INITIATOR_ORGANIZATION_CONFINEMENT_FIELD)\n ) {\n return false;\n }\n\n const organizationPaths = params.schemaPaths.findNestedFieldPathsFromZodSchema(\n params.mainSchema,\n INITIATOR_ORGANIZATION_CONFINEMENT_FIELD,\n );\n\n let applied = false;\n organizationPaths.forEach((fullPath) => {\n if (!params.schemaPaths.hasNestedPath(params.filter, fullPath)) {\n params.schemaPaths.setNestedValue(params.filter, fullPath, initiatorOrganizationId);\n applied = true;\n }\n });\n\n return applied;\n}\n"]}
1
+ {"version":3,"file":"initiator-organization-confinement.backend.js","sourceRoot":"","sources":["../../../../../src/security/authorizations/initiator-organization-confinement.backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAoBH,sFAAsF;AACtF,MAAM,CAAC,MAAM,wCAAwC,GAAG,gBAAgB,CAAC;AAEzE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,8CAA8C,CAAyB,MAOtF;IACC,MAAM,uBAAuB,GAAG,MAAM,CAAC,gBAAgB,CAAC,YAAY,EAAE,cAAc,CAAC;IACrF,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAC7B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,4FAA4F;IAC5F,4FAA4F;IAC5F,2EAA2E;IAC3E,IAAI,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,uCAAuC,KAAK,IAAI,EAAE,CAAC;QACxF,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IACE,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,wCAAwC,CAAC;WACnE,CAAC,MAAM,CAAC,gBAAgB,CAAC,wCAAwC,CAAC,EACrE,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,MAAM,iBAAiB,GAAG,MAAM,CAAC,WAAW,CAAC,iCAAiC,CAC5E,MAAM,CAAC,UAAU,EACjB,wCAAwC,CACzC,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IAEhD,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,iBAAiB,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;QACrC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC;YAC/D,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,uBAAuB,CAAC,CAAC;YACpF,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["/**\n * Initiator-organization confinement — ONE definition, compiled by both adapters (D3).\n *\n * assurance-control: WILDO.ACCESS.SCOPE_CONFINEMENT — confines a query to the tenant the\n * caller is acting in.\n *\n * A caller's `initiatorIds.organizationId` is not a value they can choose: the execution-context\n * creator validates a requested organization against their MEMBERSHIPS and refuses one they do\n * not belong to. So it is a trustworthy statement of \"the tenant this request is acting in\", and\n * rows of other tenants are not part of what was asked for.\n *\n * **Why this exists as an authority rather than a repository branch.** PostgreSQL applied this\n * confinement and MongoDB did not — divergence D3, and the only measured divergence where the\n * two adapters disagreed about WHO CAN SEE WHOSE ROWS. Under the layering principle that\n * tenancy is a resource-system rule and adapters carry dialect only, a predicate about who may\n * read what has no business being written twice, or once.\n *\n * **The crossing is the part that was missing, and it is why the PostgreSQL version was wrong.**\n * The platform declares deliberate, reviewed cross-tenant doors per operation variant\n * (`admitsCrossTenantPlatformAdministration`) — `organizationMembers.grantOwnership`, the\n * owner-floor repair door, is one. Those are admitted at the AUTHORIZATION layer, before any\n * repository runs. A confinement that does not know about them lets authorization admit the\n * crossing and then silently filters the query to the operator's own tenant — so the repair door\n * reports success and repairs nothing, which is precisely the failure mode\n * `.claude/rules/administrative-continuity-floors.md` warns about.\n *\n * So: confine by default, and step aside ONLY for an operation that has declared the crossing.\n */\n\n/** What this authority needs from the execution context. Deliberately narrow, like its siblings. */\nexport interface InitiatorOrganizationConfinementSignal {\n readonly initiatorIds?: { readonly organizationId?: string | null } | null;\n /**\n * The operation being executed. Only its crossing declaration is read — an operation that\n * did NOT declare one is confined, which is what makes the opt-in enumerable rather than a\n * privilege-based bypass.\n */\n readonly operation?: { readonly admitsCrossTenantPlatformAdministration?: boolean } | null;\n}\n\n/** The schema-path operations this rule performs, supplied by the resource layer. */\nexport interface InitiatorOrganizationConfinementPathResolver {\n findNestedFieldPathsFromZodSchema(mainSchema: any, fieldIdentifier: string): string[];\n hasNestedPath(target: object, path: string): boolean;\n setNestedValue(target: object, path: string, value: unknown): void;\n}\n\n/** The field this confinement is keyed on. Named once so no call site can typo it. */\nexport const INITIATOR_ORGANIZATION_CONFINEMENT_FIELD = 'organizationId';\n\n/**\n * Confine `filter` to the caller's organization, unless the operation declares a crossing.\n *\n * Returns whether the confinement was applied, so a caller can report or pin the decision\n * rather than having to re-derive it.\n *\n * Precedence deliberately matches the relationship-FK sibling and NOT the retention hide: an\n * already-present path is left alone. A value at this key was put there by the context layer\n * from the addressed URL scope, which the authorization layer has already reconciled against\n * the caller; overwriting it here would silently re-scope a request that was legitimately\n * addressed elsewhere.\n *\n * `isFieldPersisted` exists because PostgreSQL can be stricter than MongoDB: it knows which\n * columns are actually planned, and filtering on an unplanned one is a SQL error rather than a\n * no-op. MongoDB passes a predicate that is always true.\n */\nexport function assignInitiatorOrganizationConfinementToFilter<TFilter extends object>(params: {\n readonly filter: TFilter;\n readonly executionContext: InitiatorOrganizationConfinementSignal;\n readonly blacklistedFields: ReadonlySet<string>;\n readonly mainSchema: unknown;\n readonly schemaPaths: InitiatorOrganizationConfinementPathResolver;\n readonly isFieldPersisted: (fieldName: string) => boolean;\n}): boolean {\n const initiatorOrganizationId = params.executionContext.initiatorIds?.organizationId;\n if (!initiatorOrganizationId) {\n return false;\n }\n\n // A DECLARED crossing is the whole point of the opt-in: the authorization layer has already\n // admitted this operation across the tenant boundary, and re-confining it here would undo a\n // decision that was made deliberately, with an audit record, one layer up.\n if (params.executionContext.operation?.admitsCrossTenantPlatformAdministration === true) {\n return false;\n }\n\n if (\n params.blacklistedFields.has(INITIATOR_ORGANIZATION_CONFINEMENT_FIELD)\n || !params.isFieldPersisted(INITIATOR_ORGANIZATION_CONFINEMENT_FIELD)\n ) {\n return false;\n }\n\n /*\n * TOP-LEVEL PATHS ONLY — a correction measured on 2026-09-01, in both directions at once.\n *\n * `findNestedFieldPathsFromZodSchema` returns EVERY schema path ending in `organizationId`,\n * and the first control-plane resource to reach this rule over HTTP\n * (`wildoApplicationActorTasks`) models one NESTED occurrence:\n * `errorStates.errorItems.initiatorIds.organizationId` — a RECORDED FACT about a past error's\n * initiator, not a tenancy column. Confining on it failed differently per adapter, and the loud\n * failure was the harmless one:\n *\n * - PostgreSQL: `invalid column reference errorStates.errorItems.initiatorIds.organizationId`\n * — a 400 on every LIST. Visible, kind.\n * - MongoDB: `{ \"errorStates…organizationId\": org }` matches only rows where a nested error\n * item CARRIES that value — so every row with no recorded errors would silently vanish from\n * its OWN tenant's listings. Invisible, and the dangerous direction\n * (`negative-results-require-a-positive-probe.md`: under-reporting reads as truth).\n *\n * Top-level is not an approximation of the rule — it IS the rule. The write path's own\n * invariant (documented at the contextual-filter builder beside\n * `enrichDataWithContextFields`) is that a scoped resource always carries its scope FK as a\n * top-level column; tenancy never lives only inside a nested value. A deeper occurrence of the\n * field NAME is data about something else and was never this confinement's subject.\n */\n const organizationPaths = params.schemaPaths.findNestedFieldPathsFromZodSchema(\n params.mainSchema,\n INITIATOR_ORGANIZATION_CONFINEMENT_FIELD,\n ).filter((fullPath) => !fullPath.includes('.'));\n\n let applied = false;\n organizationPaths.forEach((fullPath) => {\n if (!params.schemaPaths.hasNestedPath(params.filter, fullPath)) {\n params.schemaPaths.setNestedValue(params.filter, fullPath, initiatorOrganizationId);\n applied = true;\n }\n });\n\n return applied;\n}\n"]}
@@ -0,0 +1,117 @@
1
+ import { type User } from '@wildo-ai/saas-models';
2
+ import type { AuthExecutionContextFactoryBackendService } from '../../security/authentications/services/auth-execution-context-factory.backend.service';
3
+ import type { ErrorBuilderBackendService } from '../../errors/services/error-builder.backend.service';
4
+ import type { RepositoriesRegistryHandlerBackendService } from '../../base-classes/services/repositories/repositories-registry-handler.backend.service';
5
+ /**
6
+ * WHO currently holds privileged access — the enumeration a periodic privileged-access review reads.
7
+ *
8
+ * assurance-control: WILDO.ACCESS.PRIVILEGED_REVIEW — enumerate the principals holding privileged
9
+ * access, at both scopes, so a review has an explicitly scoped population to decide over.
10
+ *
11
+ * ## What this is, and the three things it deliberately is NOT
12
+ *
13
+ * The objective demands four things of an application: privileged access is explicitly SCOPED, it is
14
+ * PERIODICALLY REVIEWED, the review is DECIDED BY AUTHORIZED PEOPLE, and the outcome is RETAINED as
15
+ * traceable evidence. Wildo supplies the first honestly and can supply the raw material for the
16
+ * second. It supplies neither of the last two, and this module must not look as though it does.
17
+ *
18
+ * - **It does not schedule.** Nothing here fires periodically; a caller decides when to look.
19
+ * - **It does not decide.** No row is marked reviewed, approved or revoked. A reviewer's judgement is
20
+ * a human act with named accountability, and a framework that recorded one would be asserting a
21
+ * decision nobody made — the same line the governed-document fact families draw.
22
+ * - **It records no evidence.** The review OCCURRENCE — who reviewed, when, what they concluded — is
23
+ * the application's to supply as a declared host artifact, because Wildo cannot witness it. The
24
+ * general question of where a control's evidence lives is a separate design (#269), and answering
25
+ * it here for one control is exactly the one-off this route was chosen to avoid.
26
+ *
27
+ * The objective's own caveat survives all of this and is worth restating where the code is: evidence
28
+ * is retained *without implying remediation completion*. A review record proves a review happened,
29
+ * never that what it found was fixed. Nothing this module returns should be read as remediation.
30
+ *
31
+ * ## Why it OWNS its execution context
32
+ *
33
+ * Same reason as `measureOrganizationsMissingUsableOwner`, and the failure recorded there is exactly
34
+ * the one that would bite here: an estate-wide read needs an `INTERNALLY_INITIATED_REQUEST` context to
35
+ * escape scope-root collection confinement, and a caller-supplied context that is role-less — or that
36
+ * carries a plausible-but-wrong execution-type string — silently confines the read to no tenants and
37
+ * returns an EMPTY population. An empty privileged-access review is indistinguishable from a healthy
38
+ * one, and it is the direction that reads as good news.
39
+ *
40
+ * ## Conferring roles come from the LIVE table, and are the caller's to resolve
41
+ *
42
+ * Both floors resolve their conferring set from the role table through `inheritFrom` rather than
43
+ * comparing role strings, because a custom role that inherits the authority confers it. This takes
44
+ * both sets as parameters for the same reason those functions do: the resolvers are lazy container
45
+ * bindings, and taking the answer keeps this module free of the container.
46
+ */
47
+ /** One principal holding APPLICATION-scope privileged access. */
48
+ export interface PrivilegedApplicationAccessHolder {
49
+ readonly userId: string;
50
+ readonly email?: string;
51
+ /** The roles this principal holds that confer the authority — what a reviewer decides about. */
52
+ readonly conferringRolesHeld: readonly string[];
53
+ }
54
+ /** One principal holding ORGANIZATION-scope privileged access, and where. */
55
+ export interface PrivilegedOrganizationAccessHolder {
56
+ readonly organizationId: string;
57
+ readonly organizationName?: string;
58
+ readonly membershipId: string;
59
+ readonly userId?: string;
60
+ readonly conferringRolesHeld: readonly string[];
61
+ }
62
+ /**
63
+ * The privileged-access population as it stands, at both scopes.
64
+ *
65
+ * `observedAt` is the instant the enumeration was taken, and it is the caller's to supply — this
66
+ * module reads no clock, so the same estate enumerates to the same value twice. A report that stamped
67
+ * its own "now" would be a different artifact on every run for reasons unrelated to access.
68
+ */
69
+ export interface PrivilegedAccessPopulation {
70
+ readonly observedAt: string;
71
+ readonly applicationScopeConferringRoles: readonly string[];
72
+ readonly organizationScopeConferringRoles: readonly string[];
73
+ readonly applicationScopeHolders: readonly PrivilegedApplicationAccessHolder[];
74
+ readonly organizationScopeHolders: readonly PrivilegedOrganizationAccessHolder[];
75
+ /**
76
+ * Tenants the enumeration could not read a membership list for.
77
+ *
78
+ * REPORTED rather than skipped: a tenant silently absent from a privileged-access review reads as a
79
+ * tenant with no privileged access, which is the wrong direction to be wrong in
80
+ * (`.claude/rules/negative-results-require-a-positive-probe.md`). A reviewer must be told what was
81
+ * not looked at.
82
+ */
83
+ readonly unreadableOrganizationIds: readonly string[];
84
+ }
85
+ /**
86
+ * Enumerate every principal holding privileged access, at both scopes.
87
+ *
88
+ * Fail-closed on the APPLICATION scope and best-effort per tenant on the ORGANIZATION scope, and the
89
+ * asymmetry is deliberate. A missing users repository makes the whole population unknowable, so
90
+ * answering at all would be a guess; one unreadable tenant leaves the rest of the review perfectly
91
+ * usable, provided the reviewer is told which tenant is missing — which `unreadableOrganizationIds`
92
+ * is for.
93
+ */
94
+ export declare function enumeratePrivilegedAccessPopulation(params: {
95
+ authExecutionContextFactory: AuthExecutionContextFactoryBackendService;
96
+ repositoriesRegistry: RepositoriesRegistryHandlerBackendService;
97
+ errorBuilder: ErrorBuilderBackendService;
98
+ /** From `resolveSuperAdminConferringRoles` — the live table's answer, not a role-string comparison. */
99
+ applicationScopeConferringRoles: readonly string[];
100
+ /** From `resolveOrganizationOwnerConferringRoles`. */
101
+ organizationScopeConferringRoles: readonly string[];
102
+ /** The instant this enumeration describes. Supplied, never read from a clock here. */
103
+ observedAt: string;
104
+ }): Promise<PrivilegedAccessPopulation>;
105
+ /**
106
+ * Whether a membership's LINKED USER can still authenticate.
107
+ *
108
+ * Exported because a reviewer's most common question about an organization-scope holder is whether
109
+ * the person behind it is still able to act, and the answer lives on a different row than the one the
110
+ * enumeration returns. Kept as a predicate over a supplied user rather than a second read, so a
111
+ * caller batches the lookup it already needs.
112
+ *
113
+ * The two statuses are the owner floor's own vocabulary
114
+ * ({@link ADMINISTRATIVELY_USABLE_OWNER_USER_STATUSES}), not a second list.
115
+ */
116
+ export declare function privilegedOrganizationHolderCanAuthenticate(user: Pick<User, 'status'> | undefined | null): boolean;
117
+ //# sourceMappingURL=privileged-access-review.backend.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"privileged-access-review.backend.utils.d.ts","sourceRoot":"","sources":["../../../../../src/security/authorizations/privileged-access-review.backend.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgE,KAAK,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAEhH,OAAO,KAAK,EAAE,yCAAyC,EAAE,MAAM,qGAAqG,CAAC;AACrK,OAAO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0BAA0B,CAAC;IACzC,uGAAuG;IACvG,+BAA+B,EAAE,SAAS,MAAM,EAAE,CAAC;IACnD,sDAAsD;IACtD,gCAAgC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpD,sFAAsF;IACtF,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAqFtC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,2CAA2C,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,CAElH"}
@@ -0,0 +1,104 @@
1
+ import { CoreResourceType } from '@wildo-ai/saas-models';
2
+ import { ErrorType } from '@wildo-ai/saas-models';
3
+ import { ADMINISTRATIVELY_USABLE_ORGANIZATION_MEMBER_STATUSES, createOrganizationOwnerFloorPopulationContext, isAdministrativelyUsableMembershipStatus, isAdministrativelyUsableOwnerUserStatus, rolesConferOrganizationOwner, } from './organization-owner-floor.backend.utils.js';
4
+ import { ADMINISTRATIVELY_USABLE_USER_STATUSES, isUsableSuperAdmin } from './super-admin-floor.backend.utils.js';
5
+ function readRows(candidates) {
6
+ return Array.isArray(candidates) ? candidates : [];
7
+ }
8
+ /**
9
+ * Enumerate every principal holding privileged access, at both scopes.
10
+ *
11
+ * Fail-closed on the APPLICATION scope and best-effort per tenant on the ORGANIZATION scope, and the
12
+ * asymmetry is deliberate. A missing users repository makes the whole population unknowable, so
13
+ * answering at all would be a guess; one unreadable tenant leaves the rest of the review perfectly
14
+ * usable, provided the reviewer is told which tenant is missing — which `unreadableOrganizationIds`
15
+ * is for.
16
+ */
17
+ export async function enumeratePrivilegedAccessPopulation(params) {
18
+ const executionContext = await createOrganizationOwnerFloorPopulationContext(params.authExecutionContextFactory);
19
+ const userRepository = params.repositoriesRegistry.getRepository(CoreResourceType.USERS);
20
+ if (!userRepository) {
21
+ throw params.errorBuilder.buildError(ErrorType.CONFIGURATION, executionContext, {
22
+ context: {
23
+ message: 'Cannot enumerate privileged access: the users repository is not registered',
24
+ resourceType: CoreResourceType.USERS,
25
+ },
26
+ });
27
+ }
28
+ /*
29
+ * The query narrows on the conferring roles and the usable statuses, and the predicate re-checks
30
+ * both. Not redundant: the query is what keeps this from materialising every user, and the
31
+ * predicate is what makes the answer exact when a row's status is out of vocabulary — the second
32
+ * way an ownerless tenant escaped the owner-floor backstop, recorded there.
33
+ */
34
+ const applicationCandidates = await userRepository.list(executionContext, {
35
+ appRoles: { $in: [...params.applicationScopeConferringRoles] },
36
+ status: { $in: [...ADMINISTRATIVELY_USABLE_USER_STATUSES] },
37
+ });
38
+ const applicationScopeHolders = readRows(applicationCandidates)
39
+ .filter((user) => isUsableSuperAdmin(user, params.applicationScopeConferringRoles))
40
+ .map((user) => ({
41
+ userId: String(user._id),
42
+ ...(typeof user.email === 'string' ? { email: user.email } : {}),
43
+ conferringRolesHeld: (Array.isArray(user.appRoles) ? user.appRoles : []).filter((role) => typeof role === 'string' && params.applicationScopeConferringRoles.includes(role)),
44
+ }));
45
+ const organizationRepository = params.repositoriesRegistry.getRepository(CoreResourceType.ORGANIZATIONS);
46
+ const membershipRepository = params.repositoriesRegistry.getRepository(CoreResourceType.ORGANIZATION_MEMBERS);
47
+ const organizationScopeHolders = [];
48
+ const unreadableOrganizationIds = [];
49
+ if (organizationRepository && membershipRepository) {
50
+ const organizations = readRows(await organizationRepository.list(executionContext, {}));
51
+ const nameByOrganizationId = new Map(organizations.map((organization) => [String(organization._id), organization.name]));
52
+ for (const organization of organizations) {
53
+ const organizationId = String(organization._id);
54
+ let memberships;
55
+ try {
56
+ memberships = readRows(await membershipRepository.list(executionContext, {
57
+ organizationId,
58
+ roles: { $in: [...params.organizationScopeConferringRoles] },
59
+ status: { $in: [...ADMINISTRATIVELY_USABLE_ORGANIZATION_MEMBER_STATUSES] },
60
+ }));
61
+ }
62
+ catch {
63
+ unreadableOrganizationIds.push(organizationId);
64
+ continue;
65
+ }
66
+ for (const membership of memberships) {
67
+ if (!rolesConferOrganizationOwner(membership.roles, params.organizationScopeConferringRoles))
68
+ continue;
69
+ if (!isAdministrativelyUsableMembershipStatus(membership.status))
70
+ continue;
71
+ organizationScopeHolders.push({
72
+ organizationId,
73
+ ...(nameByOrganizationId.get(organizationId) ? { organizationName: nameByOrganizationId.get(organizationId) } : {}),
74
+ membershipId: String(membership._id),
75
+ ...(membership.userId ? { userId: String(membership.userId) } : {}),
76
+ conferringRolesHeld: (Array.isArray(membership.roles) ? membership.roles : []).filter((role) => typeof role === 'string' && params.organizationScopeConferringRoles.includes(role)),
77
+ });
78
+ }
79
+ }
80
+ }
81
+ return {
82
+ observedAt: params.observedAt,
83
+ applicationScopeConferringRoles: [...params.applicationScopeConferringRoles],
84
+ organizationScopeConferringRoles: [...params.organizationScopeConferringRoles],
85
+ applicationScopeHolders,
86
+ organizationScopeHolders,
87
+ unreadableOrganizationIds,
88
+ };
89
+ }
90
+ /**
91
+ * Whether a membership's LINKED USER can still authenticate.
92
+ *
93
+ * Exported because a reviewer's most common question about an organization-scope holder is whether
94
+ * the person behind it is still able to act, and the answer lives on a different row than the one the
95
+ * enumeration returns. Kept as a predicate over a supplied user rather than a second read, so a
96
+ * caller batches the lookup it already needs.
97
+ *
98
+ * The two statuses are the owner floor's own vocabulary
99
+ * ({@link ADMINISTRATIVELY_USABLE_OWNER_USER_STATUSES}), not a second list.
100
+ */
101
+ export function privilegedOrganizationHolderCanAuthenticate(user) {
102
+ return isAdministrativelyUsableOwnerUserStatus(user?.status);
103
+ }
104
+ //# sourceMappingURL=privileged-access-review.backend.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"privileged-access-review.backend.utils.js","sourceRoot":"","sources":["../../../../../src/security/authorizations/privileged-access-review.backend.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAyD,MAAM,uBAAuB,CAAC;AAIhH,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAIlD,OAAO,EACL,oDAAoD,EA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C,EAAE,CAAC,CAAC,MAAM,CACnF,CAAC,IAAI,EAAkB,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,gCAAgC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAC7G;iBACF,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,+BAA+B,EAAE,CAAC,GAAG,MAAM,CAAC,+BAA+B,CAAC;QAC5E,gCAAgC,EAAE,CAAC,GAAG,MAAM,CAAC,gCAAgC,CAAC;QAC9E,uBAAuB;QACvB,wBAAwB;QACxB,yBAAyB;KAC1B,CAAC;AACJ,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,2CAA2C,CAAC,IAA6C;IACvG,OAAO,uCAAuC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC/D,CAAC","sourcesContent":["import { CoreResourceType, type Organization, type OrganizationMember, type User } from '@wildo-ai/saas-models';\n\nimport type { AuthExecutionContextFactoryBackendService } from '~wildo-backend-lib/security/authentications/services/auth-execution-context-factory.backend.service';\nimport type { ErrorBuilderBackendService } from '~wildo-backend-lib/errors/services/error-builder.backend.service';\nimport { ErrorType } from '@wildo-ai/saas-models';\nimport type { ExecutionContext } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\nimport type { RepositoriesRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/repositories/repositories-registry-handler.backend.service';\n\nimport {\n ADMINISTRATIVELY_USABLE_ORGANIZATION_MEMBER_STATUSES,\n ADMINISTRATIVELY_USABLE_OWNER_USER_STATUSES,\n createOrganizationOwnerFloorPopulationContext,\n isAdministrativelyUsableMembershipStatus,\n isAdministrativelyUsableOwnerUserStatus,\n rolesConferOrganizationOwner,\n} from './organization-owner-floor.backend.utils';\nimport { ADMINISTRATIVELY_USABLE_USER_STATUSES, isUsableSuperAdmin } from './super-admin-floor.backend.utils';\n\n/**\n * WHO currently holds privileged access — the enumeration a periodic privileged-access review reads.\n *\n * assurance-control: WILDO.ACCESS.PRIVILEGED_REVIEW — enumerate the principals holding privileged\n * access, at both scopes, so a review has an explicitly scoped population to decide over.\n *\n * ## What this is, and the three things it deliberately is NOT\n *\n * The objective demands four things of an application: privileged access is explicitly SCOPED, it is\n * PERIODICALLY REVIEWED, the review is DECIDED BY AUTHORIZED PEOPLE, and the outcome is RETAINED as\n * traceable evidence. Wildo supplies the first honestly and can supply the raw material for the\n * second. It supplies neither of the last two, and this module must not look as though it does.\n *\n * - **It does not schedule.** Nothing here fires periodically; a caller decides when to look.\n * - **It does not decide.** No row is marked reviewed, approved or revoked. A reviewer's judgement is\n * a human act with named accountability, and a framework that recorded one would be asserting a\n * decision nobody made — the same line the governed-document fact families draw.\n * - **It records no evidence.** The review OCCURRENCE — who reviewed, when, what they concluded — is\n * the application's to supply as a declared host artifact, because Wildo cannot witness it. The\n * general question of where a control's evidence lives is a separate design (#269), and answering\n * it here for one control is exactly the one-off this route was chosen to avoid.\n *\n * The objective's own caveat survives all of this and is worth restating where the code is: evidence\n * is retained *without implying remediation completion*. A review record proves a review happened,\n * never that what it found was fixed. Nothing this module returns should be read as remediation.\n *\n * ## Why it OWNS its execution context\n *\n * Same reason as `measureOrganizationsMissingUsableOwner`, and the failure recorded there is exactly\n * the one that would bite here: an estate-wide read needs an `INTERNALLY_INITIATED_REQUEST` context to\n * escape scope-root collection confinement, and a caller-supplied context that is role-less — or that\n * carries a plausible-but-wrong execution-type string — silently confines the read to no tenants and\n * returns an EMPTY population. An empty privileged-access review is indistinguishable from a healthy\n * one, and it is the direction that reads as good news.\n *\n * ## Conferring roles come from the LIVE table, and are the caller's to resolve\n *\n * Both floors resolve their conferring set from the role table through `inheritFrom` rather than\n * comparing role strings, because a custom role that inherits the authority confers it. This takes\n * both sets as parameters for the same reason those functions do: the resolvers are lazy container\n * bindings, and taking the answer keeps this module free of the container.\n */\n\n/** One principal holding APPLICATION-scope privileged access. */\nexport interface PrivilegedApplicationAccessHolder {\n readonly userId: string;\n readonly email?: string;\n /** The roles this principal holds that confer the authority — what a reviewer decides about. */\n readonly conferringRolesHeld: readonly string[];\n}\n\n/** One principal holding ORGANIZATION-scope privileged access, and where. */\nexport interface PrivilegedOrganizationAccessHolder {\n readonly organizationId: string;\n readonly organizationName?: string;\n readonly membershipId: string;\n readonly userId?: string;\n readonly conferringRolesHeld: readonly string[];\n}\n\n/**\n * The privileged-access population as it stands, at both scopes.\n *\n * `observedAt` is the instant the enumeration was taken, and it is the caller's to supply — this\n * module reads no clock, so the same estate enumerates to the same value twice. A report that stamped\n * its own \"now\" would be a different artifact on every run for reasons unrelated to access.\n */\nexport interface PrivilegedAccessPopulation {\n readonly observedAt: string;\n readonly applicationScopeConferringRoles: readonly string[];\n readonly organizationScopeConferringRoles: readonly string[];\n readonly applicationScopeHolders: readonly PrivilegedApplicationAccessHolder[];\n readonly organizationScopeHolders: readonly PrivilegedOrganizationAccessHolder[];\n /**\n * Tenants the enumeration could not read a membership list for.\n *\n * REPORTED rather than skipped: a tenant silently absent from a privileged-access review reads as a\n * tenant with no privileged access, which is the wrong direction to be wrong in\n * (`.claude/rules/negative-results-require-a-positive-probe.md`). A reviewer must be told what was\n * not looked at.\n */\n readonly unreadableOrganizationIds: readonly string[];\n}\n\ntype PrivilegedUserRow = Pick<User, '_id' | 'appRoles' | 'status' | 'email'>;\ntype PrivilegedMembershipRow = Pick<OrganizationMember, '_id' | 'roles' | 'status' | 'userId' | 'organizationId'>;\ntype PrivilegedOrganizationRow = Pick<Organization, '_id' | 'name'>;\n\nfunction readRows<TRow>(candidates: unknown): TRow[] {\n return Array.isArray(candidates) ? (candidates as TRow[]) : [];\n}\n\n/**\n * Enumerate every principal holding privileged access, at both scopes.\n *\n * Fail-closed on the APPLICATION scope and best-effort per tenant on the ORGANIZATION scope, and the\n * asymmetry is deliberate. A missing users repository makes the whole population unknowable, so\n * answering at all would be a guess; one unreadable tenant leaves the rest of the review perfectly\n * usable, provided the reviewer is told which tenant is missing — which `unreadableOrganizationIds`\n * is for.\n */\nexport async function enumeratePrivilegedAccessPopulation(params: {\n authExecutionContextFactory: AuthExecutionContextFactoryBackendService;\n repositoriesRegistry: RepositoriesRegistryHandlerBackendService;\n errorBuilder: ErrorBuilderBackendService;\n /** From `resolveSuperAdminConferringRoles` — the live table's answer, not a role-string comparison. */\n applicationScopeConferringRoles: readonly string[];\n /** From `resolveOrganizationOwnerConferringRoles`. */\n organizationScopeConferringRoles: readonly string[];\n /** The instant this enumeration describes. Supplied, never read from a clock here. */\n observedAt: string;\n}): Promise<PrivilegedAccessPopulation> {\n const executionContext: ExecutionContext<any> = await createOrganizationOwnerFloorPopulationContext(\n params.authExecutionContextFactory,\n );\n\n const userRepository = params.repositoriesRegistry.getRepository(CoreResourceType.USERS);\n if (!userRepository) {\n throw params.errorBuilder.buildError(ErrorType.CONFIGURATION, executionContext, {\n context: {\n message: 'Cannot enumerate privileged access: the users repository is not registered',\n resourceType: CoreResourceType.USERS,\n },\n });\n }\n\n /*\n * The query narrows on the conferring roles and the usable statuses, and the predicate re-checks\n * both. Not redundant: the query is what keeps this from materialising every user, and the\n * predicate is what makes the answer exact when a row's status is out of vocabulary — the second\n * way an ownerless tenant escaped the owner-floor backstop, recorded there.\n */\n const applicationCandidates = await userRepository.list<PrivilegedUserRow>(executionContext, {\n appRoles: { $in: [...params.applicationScopeConferringRoles] },\n status: { $in: [...ADMINISTRATIVELY_USABLE_USER_STATUSES] },\n });\n\n const applicationScopeHolders: PrivilegedApplicationAccessHolder[] = readRows<PrivilegedUserRow>(applicationCandidates)\n .filter((user) => isUsableSuperAdmin(user, params.applicationScopeConferringRoles))\n .map((user) => ({\n userId: String(user._id),\n ...(typeof user.email === 'string' ? { email: user.email } : {}),\n conferringRolesHeld: (Array.isArray(user.appRoles) ? user.appRoles : []).filter(\n (role): role is string => typeof role === 'string' && params.applicationScopeConferringRoles.includes(role),\n ),\n }));\n\n const organizationRepository = params.repositoriesRegistry.getRepository(CoreResourceType.ORGANIZATIONS);\n const membershipRepository = params.repositoriesRegistry.getRepository(CoreResourceType.ORGANIZATION_MEMBERS);\n const organizationScopeHolders: PrivilegedOrganizationAccessHolder[] = [];\n const unreadableOrganizationIds: string[] = [];\n\n if (organizationRepository && membershipRepository) {\n const organizations = readRows<PrivilegedOrganizationRow>(await organizationRepository.list<PrivilegedOrganizationRow>(executionContext, {}));\n const nameByOrganizationId = new Map(organizations.map((organization) => [String(organization._id), organization.name]));\n\n for (const organization of organizations) {\n const organizationId = String(organization._id);\n let memberships: PrivilegedMembershipRow[];\n try {\n memberships = readRows<PrivilegedMembershipRow>(\n await membershipRepository.list<PrivilegedMembershipRow>(executionContext, {\n organizationId,\n roles: { $in: [...params.organizationScopeConferringRoles] },\n status: { $in: [...ADMINISTRATIVELY_USABLE_ORGANIZATION_MEMBER_STATUSES] },\n }),\n );\n } catch {\n unreadableOrganizationIds.push(organizationId);\n continue;\n }\n\n for (const membership of memberships) {\n if (!rolesConferOrganizationOwner(membership.roles, params.organizationScopeConferringRoles)) continue;\n if (!isAdministrativelyUsableMembershipStatus(membership.status)) continue;\n organizationScopeHolders.push({\n organizationId,\n ...(nameByOrganizationId.get(organizationId) ? { organizationName: nameByOrganizationId.get(organizationId)! } : {}),\n membershipId: String(membership._id),\n ...(membership.userId ? { userId: String(membership.userId) } : {}),\n conferringRolesHeld: (Array.isArray(membership.roles) ? membership.roles : []).filter(\n (role): role is string => typeof role === 'string' && params.organizationScopeConferringRoles.includes(role),\n ),\n });\n }\n }\n }\n\n return {\n observedAt: params.observedAt,\n applicationScopeConferringRoles: [...params.applicationScopeConferringRoles],\n organizationScopeConferringRoles: [...params.organizationScopeConferringRoles],\n applicationScopeHolders,\n organizationScopeHolders,\n unreadableOrganizationIds,\n };\n}\n\n/**\n * Whether a membership's LINKED USER can still authenticate.\n *\n * Exported because a reviewer's most common question about an organization-scope holder is whether\n * the person behind it is still able to act, and the answer lives on a different row than the one the\n * enumeration returns. Kept as a predicate over a supplied user rather than a second read, so a\n * caller batches the lookup it already needs.\n *\n * The two statuses are the owner floor's own vocabulary\n * ({@link ADMINISTRATIVELY_USABLE_OWNER_USER_STATUSES}), not a second list.\n */\nexport function privilegedOrganizationHolderCanAuthenticate(user: Pick<User, 'status'> | undefined | null): boolean {\n return isAdministrativelyUsableOwnerUserStatus(user?.status);\n}\n"]}
@@ -211,6 +211,13 @@ export declare class AuthorizationsBackendService {
211
211
  *
212
212
  * Read from the OPERATION rather than inferred from the context, so the public carve-out above
213
213
  * cannot be satisfied by the caller's side of the request alone.
214
+ *
215
+ * Delegates to {@link requiredRolesDeclarePublicAccess}, the ONE named source for what
216
+ * `APP_PUBLIC` means. This used to be a private re-derivation of the same two-line test, and it
217
+ * was one of FOUR such copies (this one, the authentication tier's `operationAdmitsPublicAccess`,
218
+ * and the two role gates that did not have one and therefore refused credentialed callers). A
219
+ * policy expressed as a module-private constant reaches exactly the sites that already agree with
220
+ * it — see `.claude/rules/invariant-call-site-enumeration.md` #13.
214
221
  */
215
222
  private operationDeclaresPublicAccess;
216
223
  authorizeInRepositoryAndService(id_or_ids: IdOrIdsOrFilterType, operation: ResourceConfiguration_Operation<any, any, any>, executionContext: ExecutionContext<any>): Promise<void>;
@@ -394,8 +401,46 @@ export declare class AuthorizationsBackendService {
394
401
  */
395
402
  private buildTenantBoundaryNotFound;
396
403
  private authorizeOrganizations;
404
+ /**
405
+ * Does this resource DERIVE tenant-anchorless rows rather than store rows under the application?
406
+ *
407
+ * An INTROSPECTION resource declaring {@link IntrospectionTenancyStance.APPLICATION_STRUCTURE} or
408
+ * {@link IntrospectionTenancyStance.APPLICATION_RUNTIME} has no per-row application anchor, and
409
+ * that is its contract rather than an omission: its rows are DERIVED per read (from a companion
410
+ * behavior over the application's source, or from the companion's own runtime services), there is
411
+ * no store to hold a foreign key, and both stances say outright that there is no tenant dimension
412
+ * for a scope predicate to filter on. What separates the two stances is the READ POSTURE
413
+ * (structure may be `APP_PUBLIC`; runtime must be role-gated), which is the operation variants'
414
+ * job and ran before this method — not the anchor question answered here.
415
+ *
416
+ * Fails CLOSED in both directions that matter. With no registry bound the answer is `false`, so
417
+ * the anchor check below still runs; and the stance must be one of the two enumerated anchorless
418
+ * members, so an introspection resource that projects anything else — including a future scoped
419
+ * stance — keeps the check.
420
+ */
421
+ private projectsAnchorlessIntrospection;
397
422
  /**
398
423
  * Authorize APPLICATION scope
424
+ *
425
+ * ## What the per-row anchor check does, and what it cannot do
426
+ *
427
+ * The application is a SINGLETON per database — `ExecutionContextCreator.getApplicationId()` reads
428
+ * the APPLICATION row with an empty filter, on the stated grounds that "there is one APPLICATION
429
+ * row, so nothing can usefully narrow this read". So `appIdFromResource !== applicationId` cannot
430
+ * discriminate between applications within a database: both sides resolve to the same row. It is a
431
+ * consistency assertion about correctly-populated rows, not a cross-application isolation control.
432
+ *
433
+ * The `!appIdFromResource` branch is the one with teeth, and for a STORED resource it is right —
434
+ * every `APPLICATION`-anchored resource in the engine declares
435
+ * `parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.APPLICATION]`, so its
436
+ * rows carry the FK and a row without one is malformed.
437
+ *
438
+ * A projection cannot satisfy it at all, which is why the stance is consulted first. Measured
439
+ * before the carve-out existed: an addressed READ on `workbenchApplicationModules` answered 200 to
440
+ * an anonymous caller (the public-execution path returns before this method) and 403 to an
441
+ * authenticated one, while LIST answered 200 to both (collection operations run no row check). The
442
+ * resource could not be fixed from the application side without inventing a field its schema does
443
+ * not declare.
399
444
  */
400
445
  private authorizeApplication;
401
446
  /**
@@ -471,6 +516,29 @@ export declare class AuthorizationsBackendService {
471
516
  * - id_or_ids must be a valid string or array
472
517
  * - Authorization additionally verifies access to the specific resource(s)
473
518
  */
519
+ /**
520
+ * Authorize an operation on ROLES ALONE, with no row to fetch.
521
+ *
522
+ * ## Why this exists, and why it is deliberately narrow
523
+ *
524
+ * Every other entry point here authorizes an operation against ROWS — it pre-fetches them, checks
525
+ * scope, checks FK reachability, then checks roles. That is right whenever there is a row.
526
+ *
527
+ * A WebSocket SCOPE subscription has none. It says "tell me when anything of this type changes
528
+ * under this scope", which addresses no instance, so the row-shaped questions have no subject and
529
+ * only the role question remains. Passing a scope id in the row's place is the trap this avoids:
530
+ * it would authorize a READ of a row of the subscribed type whose id happens to be an application
531
+ * id, which is not a question anyone asked and which fails for the wrong reason.
532
+ *
533
+ * **This is strictly WEAKER than `authorizeInController` and must never be substituted for it on a
534
+ * path that has an id.** It answers "may this principal invoke this operation at all", not "may
535
+ * this principal reach this row". Its only caller is the scope-subscription gate, where the
536
+ * notification it admits carries row identities the caller could have listed anyway.
537
+ *
538
+ * Unit narrowing still applies: `resourceIdentifier` is forwarded, so a unit-scoped grant can
539
+ * rescue a failing role check exactly as it does everywhere else.
540
+ */
541
+ authorizeOperationRolesOnly(operation: ResourceConfiguration_Operation<any, any, any>, executionContext: ExecutionContext<any>): Promise<void>;
474
542
  authorizeInController(id_or_ids: string | string[] | undefined, executionContext: ExecutionContext<any>): Promise<void>;
475
543
  /**
476
544
  * Authorize a NON-CONTROLLER surface that will itself perform row-scoped reads.
@@ -576,11 +644,24 @@ export declare class AuthorizationsBackendService {
576
644
  * This prevents users from accessing resources assigned to or created by other users
577
645
  * by manipulating the URL path.
578
646
  *
579
- * Authorization behavior by execution type:
580
- * - USER_REQUEST: Must match the authenticated user's ID
581
- * - API_KEY: Allowed - API keys have broader access within their scope
582
- * - INTERNAL: Allowed - internal operations bypass FK validation
583
- * - PUBLIC: Allowed - public operations don't have identity context
647
+ * The gate is on IDENTITY, not on execution type (issue #321). A context is admitted on a user-FK
648
+ * path when it carries a `userId` AND that id equals the one in the path — whatever established the
649
+ * identity. Two execution types carry a `userId`:
650
+ * - USER_REQUEST — the session's own user;
651
+ * - CONSUMABLE_TOKEN — the `userId` the token was MINTED for (`createExecutionContextFromRequest`
652
+ * copies `consumableTokenObject.userId` onto `initiatorIds`). It is server-minted, so a bearer can
653
+ * only act as that subject on that path — the same trust a session confers.
654
+ * Machine principals, INTERNAL, PUBLIC, WEBHOOK and ANONYMOUS_SESSION never reach the gate: the
655
+ * early return below skips FK matching for them entirely (machine principals have broader access
656
+ * within their scope; the others carry no person to match). So the identity gate is evaluated for
657
+ * exactly two execution types — USER_REQUEST and CONSUMABLE_TOKEN — and a context of either kind
658
+ * WITHOUT a `userId` is refused: a user-FK path names a person, and a caller with no person cannot
659
+ * be that person.
660
+ *
661
+ * History: after the early return, this used to refuse every non-USER_REQUEST type — which, given
662
+ * that return, meant exactly CONSUMABLE_TOKEN — on the stated premise that "only USER_REQUEST has a
663
+ * userId". The premise was false when written (the token bridge already set it); the effect was
664
+ * that no token could act on a user-FK path even for the very user it was minted for.
584
665
  */
585
666
  private validateFKRelationshipAccess;
586
667
  /**
@@ -597,7 +678,21 @@ export declare class AuthorizationsBackendService {
597
678
  * Validate that user's roles satisfy the required operation roles
598
679
  * Considers role hierarchy within the given scope
599
680
  *
600
- * @returns true if user has at least one of the required roles
681
+ * The SECOND role gate in this class, and the reason the `APP_PUBLIC` admission below is repeated
682
+ * rather than inherited: an ORGANIZATIONS-scoped operation resolves its roles HERE, inside
683
+ * `validateParentScopeAccess`, and never reaches {@link validateOperationRoles} —
684
+ * `authorizeCollectionOperation` skips that call for ORGANIZATIONS scope precisely because this
685
+ * branch has already answered the question. A public declaration honoured at only one of the two
686
+ * would mean `APP_PUBLIC` worked on APPLICATION-scoped resources and refused on organization-scoped
687
+ * ones, which is the same defect one scope over.
688
+ *
689
+ * The caller has ALREADY proven tenancy by the time this runs — the ORGANIZATIONS branch resolves
690
+ * an `orgRoleInfo` for this specific organization, and the scope-root branch confines the read
691
+ * separately — so admitting on a public declaration here grants the right to ASK, never a wider
692
+ * set of rows.
693
+ *
694
+ * @returns true if user has at least one of the required roles, or the operation declares public
695
+ * access (in which case it requires none)
601
696
  */
602
697
  private validateRolesForScope;
603
698
  }
@@ -1 +1 @@
1
- {"version":3,"file":"authorizations.backend.service.d.ts","sourceRoot":"","sources":["../../../../../../src/security/authorizations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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgFG;IACU,8BAA8B,CACzC,SAAS,EAAE,+BAA+B,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACzD,gBAAgB,EAAE,gBAAgB,CAAC,GAAG,CAAC,GACtC,OAAO,CAAC,IAAI,CAAC;IAWhB;;;;;;;;;OASG;YACW,4BAA4B;IAmE1C;;;;;;;;;;;;;;;;OAgBG;YACW,4BAA4B;IAuF1C;;;;;;;;OAQG;YACW,yBAAyB;IAoPvC;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;CAY9B"}
1
+ {"version":3,"file":"authorizations.backend.service.d.ts","sourceRoot":"","sources":["../../../../../../src/security/authorizations/services/authorizations.backend.service.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,0EAA0E,CAAC;AAEhI,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,kEAAkE,CAAC;AAE9G,OAAO,EAAE,yCAAyC,EAAE,MAAM,qGAAqG,CAAC;AAChK,OAAO,EAAE,mBAAmB,EAAE,MAAM,qEAAqE,CAAC;AAC1G,OAAO,EACL,+BAA+B,EAQ/B,oBAAoB,EAMpB,kBAAkB,EAClB,cAAc,EAGd,KAAK,EACL,QAAQ,EACR,QAAQ,EAKT,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AACxF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAG3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qEAAqE,CAAC;AAGvG,qBACa,4BAA4B;IAUF,OAAO,CAAC,QAAQ,CAAC,MAAM;IACV,OAAO,CAAC,QAAQ,CAAC,YAAY;IACd,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACpG;;;;;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