@contember/engine-tenant-api 2.2.0-alpha.1 → 2.2.0-alpha.10

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 (2014) hide show
  1. package/CLAUDE.md +60 -7
  2. package/dist/development/index.cjs +69 -0
  3. package/dist/development/index.cjs.map +1 -1
  4. package/dist/development/index.js +71 -2
  5. package/dist/development/index.js.map +1 -1
  6. package/dist/development/src/TenantContainer.cjs +39 -10
  7. package/dist/development/src/TenantContainer.cjs.map +1 -1
  8. package/dist/development/src/TenantContainer.js +39 -10
  9. package/dist/development/src/TenantContainer.js.map +1 -1
  10. package/dist/development/src/bridges/system/IdentityFetcher.cjs +9 -7
  11. package/dist/development/src/bridges/system/IdentityFetcher.cjs.map +1 -1
  12. package/dist/development/src/bridges/system/IdentityFetcher.js +9 -7
  13. package/dist/development/src/bridges/system/IdentityFetcher.js.map +1 -1
  14. package/dist/development/src/migrations/2026-06-18-120000-idp-claim-mapping.cjs +10 -0
  15. package/dist/development/src/migrations/2026-06-18-120000-idp-claim-mapping.cjs.map +1 -0
  16. package/dist/development/src/migrations/2026-06-18-120000-idp-claim-mapping.js +11 -0
  17. package/dist/development/src/migrations/2026-06-18-120000-idp-claim-mapping.js.map +1 -0
  18. package/dist/development/src/migrations/2026-08-03-120000-person-enable-auth-log.cjs +9 -0
  19. package/dist/development/src/migrations/2026-08-03-120000-person-enable-auth-log.cjs.map +1 -0
  20. package/dist/development/src/migrations/2026-08-03-120000-person-enable-auth-log.js +10 -0
  21. package/dist/development/src/migrations/2026-08-03-120000-person-enable-auth-log.js.map +1 -0
  22. package/dist/development/src/migrations/2026-08-04-120000-config-panel.cjs +11 -0
  23. package/dist/development/src/migrations/2026-08-04-120000-config-panel.cjs.map +1 -0
  24. package/dist/development/src/migrations/2026-08-04-120000-config-panel.js +12 -0
  25. package/dist/development/src/migrations/2026-08-04-120000-config-panel.js.map +1 -0
  26. package/dist/development/src/migrations/2026-09-04-120000-idp-disable-local-authentication.cjs +18 -0
  27. package/dist/development/src/migrations/2026-09-04-120000-idp-disable-local-authentication.cjs.map +1 -0
  28. package/dist/development/src/migrations/2026-09-04-120000-idp-disable-local-authentication.js +19 -0
  29. package/dist/development/src/migrations/2026-09-04-120000-idp-disable-local-authentication.js.map +1 -0
  30. package/dist/development/src/migrations/2026-09-11-120000-custom-role.cjs +18 -0
  31. package/dist/development/src/migrations/2026-09-11-120000-custom-role.cjs.map +1 -0
  32. package/dist/development/src/migrations/2026-09-11-120000-custom-role.js +19 -0
  33. package/dist/development/src/migrations/2026-09-11-120000-custom-role.js.map +1 -0
  34. package/dist/development/src/migrations/runner.cjs +17 -5
  35. package/dist/development/src/migrations/runner.cjs.map +1 -1
  36. package/dist/development/src/migrations/runner.js +17 -5
  37. package/dist/development/src/migrations/runner.js.map +1 -1
  38. package/dist/development/src/migrations/snapshot.cjs +22 -2
  39. package/dist/development/src/migrations/snapshot.cjs.map +1 -1
  40. package/dist/development/src/migrations/snapshot.js +22 -2
  41. package/dist/development/src/migrations/snapshot.js.map +1 -1
  42. package/dist/development/src/model/authorization/CustomRoleAuthorizator.cjs +65 -0
  43. package/dist/development/src/model/authorization/CustomRoleAuthorizator.cjs.map +1 -0
  44. package/dist/development/src/model/authorization/CustomRoleAuthorizator.js +65 -0
  45. package/dist/development/src/model/authorization/CustomRoleAuthorizator.js.map +1 -0
  46. package/dist/development/src/model/authorization/CustomRolePermissions.cjs +404 -0
  47. package/dist/development/src/model/authorization/CustomRolePermissions.cjs.map +1 -0
  48. package/dist/development/src/model/authorization/CustomRolePermissions.js +387 -0
  49. package/dist/development/src/model/authorization/CustomRolePermissions.js.map +1 -0
  50. package/dist/development/src/model/authorization/PermissionActions.cjs +19 -16
  51. package/dist/development/src/model/authorization/PermissionActions.cjs.map +1 -1
  52. package/dist/development/src/model/authorization/PermissionActions.js +19 -16
  53. package/dist/development/src/model/authorization/PermissionActions.js.map +1 -1
  54. package/dist/development/src/model/authorization/PermissionContextFactory.cjs +20 -2
  55. package/dist/development/src/model/authorization/PermissionContextFactory.cjs.map +1 -1
  56. package/dist/development/src/model/authorization/PermissionContextFactory.js +20 -2
  57. package/dist/development/src/model/authorization/PermissionContextFactory.js.map +1 -1
  58. package/dist/development/src/model/authorization/PermissionsFactory.cjs +32 -24
  59. package/dist/development/src/model/authorization/PermissionsFactory.cjs.map +1 -1
  60. package/dist/development/src/model/authorization/PermissionsFactory.js +33 -25
  61. package/dist/development/src/model/authorization/PermissionsFactory.js.map +1 -1
  62. package/dist/development/src/model/authorization/Roles.cjs +8 -0
  63. package/dist/development/src/model/authorization/Roles.cjs.map +1 -1
  64. package/dist/development/src/model/authorization/Roles.js +8 -0
  65. package/dist/development/src/model/authorization/Roles.js.map +1 -1
  66. package/dist/development/src/model/authorization/TargetIdentityPermission.cjs +35 -0
  67. package/dist/development/src/model/authorization/TargetIdentityPermission.cjs.map +1 -0
  68. package/dist/development/src/model/authorization/TargetIdentityPermission.js +35 -0
  69. package/dist/development/src/model/authorization/TargetIdentityPermission.js.map +1 -0
  70. package/dist/development/src/model/commands/apiKey/ApiKeyHelper.cjs +19 -0
  71. package/dist/development/src/model/commands/apiKey/ApiKeyHelper.cjs.map +1 -1
  72. package/dist/development/src/model/commands/apiKey/ApiKeyHelper.js +19 -0
  73. package/dist/development/src/model/commands/apiKey/ApiKeyHelper.js.map +1 -1
  74. package/dist/development/src/model/commands/apiKey/CreateApiKeyCommand.cjs +4 -2
  75. package/dist/development/src/model/commands/apiKey/CreateApiKeyCommand.cjs.map +1 -1
  76. package/dist/development/src/model/commands/apiKey/CreateApiKeyCommand.js +5 -3
  77. package/dist/development/src/model/commands/apiKey/CreateApiKeyCommand.js.map +1 -1
  78. package/dist/development/src/model/commands/apiKey/ProlongApiKeyCommand.cjs +9 -10
  79. package/dist/development/src/model/commands/apiKey/ProlongApiKeyCommand.cjs.map +1 -1
  80. package/dist/development/src/model/commands/apiKey/ProlongApiKeyCommand.js +10 -11
  81. package/dist/development/src/model/commands/apiKey/ProlongApiKeyCommand.js.map +1 -1
  82. package/dist/development/src/model/commands/authLog/CreateAuthLogEntryCommand.cjs.map +1 -1
  83. package/dist/development/src/model/commands/authLog/CreateAuthLogEntryCommand.js.map +1 -1
  84. package/dist/development/src/model/commands/configuration/UpdateConfigurationCommand.cjs +5 -3
  85. package/dist/development/src/model/commands/configuration/UpdateConfigurationCommand.cjs.map +1 -1
  86. package/dist/development/src/model/commands/configuration/UpdateConfigurationCommand.js +5 -3
  87. package/dist/development/src/model/commands/configuration/UpdateConfigurationCommand.js.map +1 -1
  88. package/dist/development/src/model/commands/customRole/CreateCustomRoleCommand.cjs +23 -0
  89. package/dist/development/src/model/commands/customRole/CreateCustomRoleCommand.cjs.map +1 -0
  90. package/dist/development/src/model/commands/customRole/CreateCustomRoleCommand.js +23 -0
  91. package/dist/development/src/model/commands/customRole/CreateCustomRoleCommand.js.map +1 -0
  92. package/dist/development/src/model/commands/customRole/DeleteCustomRoleCommand.cjs +14 -0
  93. package/dist/development/src/model/commands/customRole/DeleteCustomRoleCommand.cjs.map +1 -0
  94. package/dist/development/src/model/commands/customRole/DeleteCustomRoleCommand.js +14 -0
  95. package/dist/development/src/model/commands/customRole/DeleteCustomRoleCommand.js.map +1 -0
  96. package/dist/development/src/model/commands/customRole/RemoveCustomRoleAssignmentsCommand.cjs +16 -0
  97. package/dist/development/src/model/commands/customRole/RemoveCustomRoleAssignmentsCommand.cjs.map +1 -0
  98. package/dist/development/src/model/commands/customRole/RemoveCustomRoleAssignmentsCommand.js +16 -0
  99. package/dist/development/src/model/commands/customRole/RemoveCustomRoleAssignmentsCommand.js.map +1 -0
  100. package/dist/development/src/model/commands/customRole/UpdateCustomRoleCommand.cjs +19 -0
  101. package/dist/development/src/model/commands/customRole/UpdateCustomRoleCommand.cjs.map +1 -0
  102. package/dist/development/src/model/commands/customRole/UpdateCustomRoleCommand.js +19 -0
  103. package/dist/development/src/model/commands/customRole/UpdateCustomRoleCommand.js.map +1 -0
  104. package/dist/development/src/model/commands/identity/PatchIdentityGlobalRoles.cjs +1 -1
  105. package/dist/development/src/model/commands/identity/PatchIdentityGlobalRoles.cjs.map +1 -1
  106. package/dist/development/src/model/commands/identity/PatchIdentityGlobalRoles.js +1 -1
  107. package/dist/development/src/model/commands/identity/PatchIdentityGlobalRoles.js.map +1 -1
  108. package/dist/development/src/model/commands/idp/ClaimIdpRevalidationCommand.cjs +3 -7
  109. package/dist/development/src/model/commands/idp/ClaimIdpRevalidationCommand.cjs.map +1 -1
  110. package/dist/development/src/model/commands/idp/ClaimIdpRevalidationCommand.js +3 -7
  111. package/dist/development/src/model/commands/idp/ClaimIdpRevalidationCommand.js.map +1 -1
  112. package/dist/development/src/model/commands/idp/CreateIdpCommand.cjs +8 -2
  113. package/dist/development/src/model/commands/idp/CreateIdpCommand.cjs.map +1 -1
  114. package/dist/development/src/model/commands/idp/CreateIdpCommand.js +8 -2
  115. package/dist/development/src/model/commands/idp/CreateIdpCommand.js.map +1 -1
  116. package/dist/development/src/model/commands/idp/CreateIdpSessionCommand.cjs +4 -1
  117. package/dist/development/src/model/commands/idp/CreateIdpSessionCommand.cjs.map +1 -1
  118. package/dist/development/src/model/commands/idp/CreateIdpSessionCommand.js +5 -2
  119. package/dist/development/src/model/commands/idp/CreateIdpSessionCommand.js.map +1 -1
  120. package/dist/development/src/model/commands/idp/UpdateIdpCommand.cjs +6 -2
  121. package/dist/development/src/model/commands/idp/UpdateIdpCommand.cjs.map +1 -1
  122. package/dist/development/src/model/commands/idp/UpdateIdpCommand.js +6 -2
  123. package/dist/development/src/model/commands/idp/UpdateIdpCommand.js.map +1 -1
  124. package/dist/development/src/model/commands/idp/UpdateIdpSessionCommand.cjs +2 -1
  125. package/dist/development/src/model/commands/idp/UpdateIdpSessionCommand.cjs.map +1 -1
  126. package/dist/development/src/model/commands/idp/UpdateIdpSessionCommand.js +3 -2
  127. package/dist/development/src/model/commands/idp/UpdateIdpSessionCommand.js.map +1 -1
  128. package/dist/development/src/model/commands/membership/{RemoveProjectMembershipsCommand.cjs → RemoveProjectMembershipCommand.cjs} +1 -1
  129. package/dist/development/src/model/commands/membership/RemoveProjectMembershipCommand.cjs.map +1 -0
  130. package/dist/development/src/model/commands/membership/{RemoveProjectMembershipsCommand.js → RemoveProjectMembershipCommand.js} +1 -1
  131. package/dist/development/src/model/commands/membership/RemoveProjectMembershipCommand.js.map +1 -0
  132. package/dist/development/src/model/commands/membership/UpdateProjectMemberCommand.cjs +2 -2
  133. package/dist/development/src/model/commands/membership/UpdateProjectMemberCommand.cjs.map +1 -1
  134. package/dist/development/src/model/commands/membership/UpdateProjectMemberCommand.js +1 -1
  135. package/dist/development/src/model/commands/membership/UpdateProjectMemberCommand.js.map +1 -1
  136. package/dist/development/src/model/commands/person/CreatePersonCommand.cjs +1 -0
  137. package/dist/development/src/model/commands/person/CreatePersonCommand.cjs.map +1 -1
  138. package/dist/development/src/model/commands/person/CreatePersonCommand.js +1 -0
  139. package/dist/development/src/model/commands/person/CreatePersonCommand.js.map +1 -1
  140. package/dist/development/src/model/commands/person/EnablePersonCommand.cjs +17 -0
  141. package/dist/development/src/model/commands/person/EnablePersonCommand.cjs.map +1 -0
  142. package/dist/development/src/model/commands/person/EnablePersonCommand.js +17 -0
  143. package/dist/development/src/model/commands/person/EnablePersonCommand.js.map +1 -0
  144. package/dist/development/src/model/commands/person/SetMfaGraceUntilCommand.cjs +3 -3
  145. package/dist/development/src/model/commands/person/SetMfaGraceUntilCommand.cjs.map +1 -1
  146. package/dist/development/src/model/commands/person/SetMfaGraceUntilCommand.js +4 -4
  147. package/dist/development/src/model/commands/person/SetMfaGraceUntilCommand.js.map +1 -1
  148. package/dist/development/src/model/commands/personToken/ResetPasswordCommand.cjs +2 -3
  149. package/dist/development/src/model/commands/personToken/ResetPasswordCommand.cjs.map +1 -1
  150. package/dist/development/src/model/commands/personToken/ResetPasswordCommand.js +2 -3
  151. package/dist/development/src/model/commands/personToken/ResetPasswordCommand.js.map +1 -1
  152. package/dist/development/src/model/commands/personToken/SaveEmailOtpTokenCommand.cjs +3 -3
  153. package/dist/development/src/model/commands/personToken/SaveEmailOtpTokenCommand.cjs.map +1 -1
  154. package/dist/development/src/model/commands/personToken/SaveEmailOtpTokenCommand.js +4 -4
  155. package/dist/development/src/model/commands/personToken/SaveEmailOtpTokenCommand.js.map +1 -1
  156. package/dist/development/src/model/commands/personToken/SavePersonTokenCommand.cjs +12 -6
  157. package/dist/development/src/model/commands/personToken/SavePersonTokenCommand.cjs.map +1 -1
  158. package/dist/development/src/model/commands/personToken/SavePersonTokenCommand.js +13 -7
  159. package/dist/development/src/model/commands/personToken/SavePersonTokenCommand.js.map +1 -1
  160. package/dist/development/src/model/commands/rateLimit/RecordRateLimitEventCommand.cjs +1 -2
  161. package/dist/development/src/model/commands/rateLimit/RecordRateLimitEventCommand.cjs.map +1 -1
  162. package/dist/development/src/model/commands/rateLimit/RecordRateLimitEventCommand.js +1 -2
  163. package/dist/development/src/model/commands/rateLimit/RecordRateLimitEventCommand.js.map +1 -1
  164. package/dist/development/src/model/mailing/UserMailer.cjs +2 -1
  165. package/dist/development/src/model/mailing/UserMailer.cjs.map +1 -1
  166. package/dist/development/src/model/mailing/UserMailer.js +2 -1
  167. package/dist/development/src/model/mailing/UserMailer.js.map +1 -1
  168. package/dist/development/src/model/queries/apiKey/ApiKeyQuery.cjs +8 -1
  169. package/dist/development/src/model/queries/apiKey/ApiKeyQuery.cjs.map +1 -1
  170. package/dist/development/src/model/queries/apiKey/ApiKeyQuery.js +9 -2
  171. package/dist/development/src/model/queries/apiKey/ApiKeyQuery.js.map +1 -1
  172. package/dist/development/src/model/queries/apiKey/ApiKeySessionsQuery.cjs +2 -3
  173. package/dist/development/src/model/queries/apiKey/ApiKeySessionsQuery.cjs.map +1 -1
  174. package/dist/development/src/model/queries/apiKey/ApiKeySessionsQuery.js +2 -3
  175. package/dist/development/src/model/queries/apiKey/ApiKeySessionsQuery.js.map +1 -1
  176. package/dist/development/src/model/queries/authLog/NextLoginAttemptQuery.cjs +12 -10
  177. package/dist/development/src/model/queries/authLog/NextLoginAttemptQuery.cjs.map +1 -1
  178. package/dist/development/src/model/queries/authLog/NextLoginAttemptQuery.js +12 -10
  179. package/dist/development/src/model/queries/authLog/NextLoginAttemptQuery.js.map +1 -1
  180. package/dist/development/src/model/queries/authLog/NextMailAttemptQuery.cjs +10 -8
  181. package/dist/development/src/model/queries/authLog/NextMailAttemptQuery.cjs.map +1 -1
  182. package/dist/development/src/model/queries/authLog/NextMailAttemptQuery.js +10 -8
  183. package/dist/development/src/model/queries/authLog/NextMailAttemptQuery.js.map +1 -1
  184. package/dist/development/src/model/queries/configuration/ConfigurationQuery.cjs +4 -0
  185. package/dist/development/src/model/queries/configuration/ConfigurationQuery.cjs.map +1 -1
  186. package/dist/development/src/model/queries/configuration/ConfigurationQuery.js +4 -0
  187. package/dist/development/src/model/queries/configuration/ConfigurationQuery.js.map +1 -1
  188. package/dist/development/src/model/queries/customRole/CustomRolesQuery.cjs +23 -0
  189. package/dist/development/src/model/queries/customRole/CustomRolesQuery.cjs.map +1 -0
  190. package/dist/development/src/model/queries/customRole/CustomRolesQuery.js +23 -0
  191. package/dist/development/src/model/queries/customRole/CustomRolesQuery.js.map +1 -0
  192. package/dist/development/src/model/queries/identity/IdentitiesHoldingRoleCountQuery.cjs +15 -0
  193. package/dist/development/src/model/queries/identity/IdentitiesHoldingRoleCountQuery.cjs.map +1 -0
  194. package/dist/development/src/model/queries/identity/IdentitiesHoldingRoleCountQuery.js +15 -0
  195. package/dist/development/src/model/queries/identity/IdentitiesHoldingRoleCountQuery.js.map +1 -0
  196. package/dist/development/src/model/queries/identity/IdentityQuery.cjs +7 -2
  197. package/dist/development/src/model/queries/identity/IdentityQuery.cjs.map +1 -1
  198. package/dist/development/src/model/queries/identity/IdentityQuery.js +7 -2
  199. package/dist/development/src/model/queries/identity/IdentityQuery.js.map +1 -1
  200. package/dist/development/src/model/queries/idp/LocalAuthDisablingIdpsQuery.cjs +21 -0
  201. package/dist/development/src/model/queries/idp/LocalAuthDisablingIdpsQuery.cjs.map +1 -0
  202. package/dist/development/src/model/queries/idp/LocalAuthDisablingIdpsQuery.js +21 -0
  203. package/dist/development/src/model/queries/idp/LocalAuthDisablingIdpsQuery.js.map +1 -0
  204. package/dist/development/src/model/queries/idp/PersonIdentityProvidersQuery.cjs +1 -1
  205. package/dist/development/src/model/queries/idp/PersonIdentityProvidersQuery.cjs.map +1 -1
  206. package/dist/development/src/model/queries/idp/PersonIdentityProvidersQuery.js +1 -1
  207. package/dist/development/src/model/queries/idp/PersonIdentityProvidersQuery.js.map +1 -1
  208. package/dist/development/src/model/queries/idp/helpers.cjs +3 -3
  209. package/dist/development/src/model/queries/idp/helpers.cjs.map +1 -1
  210. package/dist/development/src/model/queries/idp/helpers.js +3 -3
  211. package/dist/development/src/model/queries/idp/helpers.js.map +1 -1
  212. package/dist/development/src/model/queries/membership/IdentityHasProjectMembershipsQuery.cjs +15 -0
  213. package/dist/development/src/model/queries/membership/IdentityHasProjectMembershipsQuery.cjs.map +1 -0
  214. package/dist/development/src/model/queries/membership/IdentityHasProjectMembershipsQuery.js +15 -0
  215. package/dist/development/src/model/queries/membership/IdentityHasProjectMembershipsQuery.js.map +1 -0
  216. package/dist/development/src/model/queries/membership/ProjectMembersQuery.cjs +1 -1
  217. package/dist/development/src/model/queries/membership/ProjectMembersQuery.cjs.map +1 -1
  218. package/dist/development/src/model/queries/membership/ProjectMembersQuery.js +1 -1
  219. package/dist/development/src/model/queries/membership/ProjectMembersQuery.js.map +1 -1
  220. package/dist/development/src/model/queries/person/PersonQueryBuilderFactory.cjs +2 -2
  221. package/dist/development/src/model/queries/person/PersonQueryBuilderFactory.cjs.map +1 -1
  222. package/dist/development/src/model/queries/person/PersonQueryBuilderFactory.js +2 -2
  223. package/dist/development/src/model/queries/person/PersonQueryBuilderFactory.js.map +1 -1
  224. package/dist/development/src/model/queries/personToken/PersonTokenQuery.cjs +1 -1
  225. package/dist/development/src/model/queries/personToken/PersonTokenQuery.cjs.map +1 -1
  226. package/dist/development/src/model/queries/personToken/PersonTokenQuery.js +1 -1
  227. package/dist/development/src/model/queries/personToken/PersonTokenQuery.js.map +1 -1
  228. package/dist/development/src/model/queries/project/ProjectsByIdentityQuery.cjs +4 -1
  229. package/dist/development/src/model/queries/project/ProjectsByIdentityQuery.cjs.map +1 -1
  230. package/dist/development/src/model/queries/project/ProjectsByIdentityQuery.js +4 -1
  231. package/dist/development/src/model/queries/project/ProjectsByIdentityQuery.js.map +1 -1
  232. package/dist/development/src/model/queries/rateLimit/RateLimitCountQuery.cjs +3 -3
  233. package/dist/development/src/model/queries/rateLimit/RateLimitCountQuery.cjs.map +1 -1
  234. package/dist/development/src/model/queries/rateLimit/RateLimitCountQuery.js +3 -3
  235. package/dist/development/src/model/queries/rateLimit/RateLimitCountQuery.js.map +1 -1
  236. package/dist/development/src/model/service/AuthLogService.cjs +8 -2
  237. package/dist/development/src/model/service/AuthLogService.cjs.map +1 -1
  238. package/dist/development/src/model/service/AuthLogService.js +8 -2
  239. package/dist/development/src/model/service/AuthLogService.js.map +1 -1
  240. package/dist/development/src/model/service/AuthPolicyManager.cjs +2 -1
  241. package/dist/development/src/model/service/AuthPolicyManager.cjs.map +1 -1
  242. package/dist/development/src/model/service/AuthPolicyManager.js +2 -1
  243. package/dist/development/src/model/service/AuthPolicyManager.js.map +1 -1
  244. package/dist/development/src/model/service/AuthPolicyResolver.cjs +2 -1
  245. package/dist/development/src/model/service/AuthPolicyResolver.cjs.map +1 -1
  246. package/dist/development/src/model/service/AuthPolicyResolver.js +2 -1
  247. package/dist/development/src/model/service/AuthPolicyResolver.js.map +1 -1
  248. package/dist/development/src/model/service/CustomRoleManager.cjs +170 -0
  249. package/dist/development/src/model/service/CustomRoleManager.cjs.map +1 -0
  250. package/dist/development/src/model/service/CustomRoleManager.js +170 -0
  251. package/dist/development/src/model/service/CustomRoleManager.js.map +1 -0
  252. package/dist/development/src/model/service/EmailChangeManager.cjs +5 -4
  253. package/dist/development/src/model/service/EmailChangeManager.cjs.map +1 -1
  254. package/dist/development/src/model/service/EmailChangeManager.js +5 -4
  255. package/dist/development/src/model/service/EmailChangeManager.js.map +1 -1
  256. package/dist/development/src/model/service/EmailOtpManager.cjs +0 -1
  257. package/dist/development/src/model/service/EmailOtpManager.cjs.map +1 -1
  258. package/dist/development/src/model/service/EmailOtpManager.js +0 -1
  259. package/dist/development/src/model/service/EmailOtpManager.js.map +1 -1
  260. package/dist/development/src/model/service/EmailValidator.cjs +2 -1
  261. package/dist/development/src/model/service/EmailValidator.cjs.map +1 -1
  262. package/dist/development/src/model/service/EmailValidator.js +2 -1
  263. package/dist/development/src/model/service/EmailValidator.js.map +1 -1
  264. package/dist/development/src/model/service/EmailVerificationManager.cjs +5 -4
  265. package/dist/development/src/model/service/EmailVerificationManager.cjs.map +1 -1
  266. package/dist/development/src/model/service/EmailVerificationManager.js +5 -4
  267. package/dist/development/src/model/service/EmailVerificationManager.js.map +1 -1
  268. package/dist/development/src/model/service/GlobalRoleValidator.cjs +35 -0
  269. package/dist/development/src/model/service/GlobalRoleValidator.cjs.map +1 -0
  270. package/dist/development/src/model/service/GlobalRoleValidator.js +35 -0
  271. package/dist/development/src/model/service/GlobalRoleValidator.js.map +1 -0
  272. package/dist/development/src/model/service/IDPSignInManager.cjs +52 -16
  273. package/dist/development/src/model/service/IDPSignInManager.cjs.map +1 -1
  274. package/dist/development/src/model/service/IDPSignInManager.js +52 -16
  275. package/dist/development/src/model/service/IDPSignInManager.js.map +1 -1
  276. package/dist/development/src/model/service/InviteManager.cjs +2 -1
  277. package/dist/development/src/model/service/InviteManager.cjs.map +1 -1
  278. package/dist/development/src/model/service/InviteManager.js +2 -1
  279. package/dist/development/src/model/service/InviteManager.js.map +1 -1
  280. package/dist/development/src/model/service/PanelAccessResolver.cjs +32 -0
  281. package/dist/development/src/model/service/PanelAccessResolver.cjs.map +1 -0
  282. package/dist/development/src/model/service/PanelAccessResolver.js +32 -0
  283. package/dist/development/src/model/service/PanelAccessResolver.js.map +1 -0
  284. package/dist/development/src/model/service/PasswordChangeManager.cjs +2 -1
  285. package/dist/development/src/model/service/PasswordChangeManager.cjs.map +1 -1
  286. package/dist/development/src/model/service/PasswordChangeManager.js +2 -1
  287. package/dist/development/src/model/service/PasswordChangeManager.js.map +1 -1
  288. package/dist/development/src/model/service/PasswordResetManager.cjs +9 -3
  289. package/dist/development/src/model/service/PasswordResetManager.cjs.map +1 -1
  290. package/dist/development/src/model/service/PasswordResetManager.js +9 -3
  291. package/dist/development/src/model/service/PasswordResetManager.js.map +1 -1
  292. package/dist/development/src/model/service/PasswordlessSignInManager.cjs +24 -6
  293. package/dist/development/src/model/service/PasswordlessSignInManager.cjs.map +1 -1
  294. package/dist/development/src/model/service/PasswordlessSignInManager.js +24 -6
  295. package/dist/development/src/model/service/PasswordlessSignInManager.js.map +1 -1
  296. package/dist/development/src/model/service/PersonAccessManager.cjs +10 -2
  297. package/dist/development/src/model/service/PersonAccessManager.cjs.map +1 -1
  298. package/dist/development/src/model/service/PersonAccessManager.js +10 -2
  299. package/dist/development/src/model/service/PersonAccessManager.js.map +1 -1
  300. package/dist/development/src/model/service/PersonManager.cjs +2 -1
  301. package/dist/development/src/model/service/PersonManager.cjs.map +1 -1
  302. package/dist/development/src/model/service/PersonManager.js +2 -1
  303. package/dist/development/src/model/service/PersonManager.js.map +1 -1
  304. package/dist/development/src/model/service/ProjectMemberManager.cjs +2 -1
  305. package/dist/development/src/model/service/ProjectMemberManager.cjs.map +1 -1
  306. package/dist/development/src/model/service/ProjectMemberManager.js +2 -1
  307. package/dist/development/src/model/service/ProjectMemberManager.js.map +1 -1
  308. package/dist/development/src/model/service/RateLimiter.cjs +1 -2
  309. package/dist/development/src/model/service/RateLimiter.cjs.map +1 -1
  310. package/dist/development/src/model/service/RateLimiter.js +1 -2
  311. package/dist/development/src/model/service/RateLimiter.js.map +1 -1
  312. package/dist/development/src/model/service/RolesManager.cjs +17 -18
  313. package/dist/development/src/model/service/RolesManager.cjs.map +1 -1
  314. package/dist/development/src/model/service/RolesManager.js +18 -19
  315. package/dist/development/src/model/service/RolesManager.js.map +1 -1
  316. package/dist/development/src/model/service/SecretsManager.cjs +2 -1
  317. package/dist/development/src/model/service/SecretsManager.cjs.map +1 -1
  318. package/dist/development/src/model/service/SecretsManager.js +2 -1
  319. package/dist/development/src/model/service/SecretsManager.js.map +1 -1
  320. package/dist/development/src/model/service/SignInManager.cjs +9 -5
  321. package/dist/development/src/model/service/SignInManager.cjs.map +1 -1
  322. package/dist/development/src/model/service/SignInManager.js +9 -5
  323. package/dist/development/src/model/service/SignInManager.js.map +1 -1
  324. package/dist/development/src/model/service/SignOutManager.cjs +2 -1
  325. package/dist/development/src/model/service/SignOutManager.cjs.map +1 -1
  326. package/dist/development/src/model/service/SignOutManager.js +2 -1
  327. package/dist/development/src/model/service/SignOutManager.js.map +1 -1
  328. package/dist/development/src/model/service/SignUpManager.cjs +15 -7
  329. package/dist/development/src/model/service/SignUpManager.cjs.map +1 -1
  330. package/dist/development/src/model/service/SignUpManager.js +15 -7
  331. package/dist/development/src/model/service/SignUpManager.js.map +1 -1
  332. package/dist/development/src/model/service/apiKey/ApiKeyManager.cjs +56 -40
  333. package/dist/development/src/model/service/apiKey/ApiKeyManager.cjs.map +1 -1
  334. package/dist/development/src/model/service/apiKey/ApiKeyManager.js +57 -41
  335. package/dist/development/src/model/service/apiKey/ApiKeyManager.js.map +1 -1
  336. package/dist/development/src/model/service/apiKey/ApiKeyService.cjs.map +1 -1
  337. package/dist/development/src/model/service/apiKey/ApiKeyService.js.map +1 -1
  338. package/dist/development/src/model/service/apiKey/UnpersistedApiKeyManager.cjs +10 -1
  339. package/dist/development/src/model/service/apiKey/UnpersistedApiKeyManager.cjs.map +1 -1
  340. package/dist/development/src/model/service/apiKey/UnpersistedApiKeyManager.js +11 -2
  341. package/dist/development/src/model/service/apiKey/UnpersistedApiKeyManager.js.map +1 -1
  342. package/dist/development/src/model/service/idp/ClaimMapping.cjs +187 -0
  343. package/dist/development/src/model/service/idp/ClaimMapping.cjs.map +1 -0
  344. package/dist/development/src/model/service/idp/ClaimMapping.js +170 -0
  345. package/dist/development/src/model/service/idp/ClaimMapping.js.map +1 -0
  346. package/dist/development/src/model/service/idp/ClaimMappingEvaluator.cjs +155 -0
  347. package/dist/development/src/model/service/idp/ClaimMappingEvaluator.cjs.map +1 -0
  348. package/dist/development/src/model/service/idp/ClaimMappingEvaluator.js +155 -0
  349. package/dist/development/src/model/service/idp/ClaimMappingEvaluator.js.map +1 -0
  350. package/dist/development/src/model/service/idp/ClaimMappingValidation.cjs +83 -0
  351. package/dist/development/src/model/service/idp/ClaimMappingValidation.cjs.map +1 -0
  352. package/dist/development/src/model/service/idp/ClaimMappingValidation.js +83 -0
  353. package/dist/development/src/model/service/idp/ClaimMappingValidation.js.map +1 -0
  354. package/dist/development/src/model/service/idp/IDPClaimSyncService.cjs +261 -0
  355. package/dist/development/src/model/service/idp/IDPClaimSyncService.cjs.map +1 -0
  356. package/dist/development/src/model/service/idp/IDPClaimSyncService.js +261 -0
  357. package/dist/development/src/model/service/idp/IDPClaimSyncService.js.map +1 -0
  358. package/dist/development/src/model/service/idp/IDPManager.cjs +98 -21
  359. package/dist/development/src/model/service/idp/IDPManager.cjs.map +1 -1
  360. package/dist/development/src/model/service/idp/IDPManager.js +98 -21
  361. package/dist/development/src/model/service/idp/IDPManager.js.map +1 -1
  362. package/dist/development/src/model/service/idp/IdpSessionRevalidator.cjs +93 -28
  363. package/dist/development/src/model/service/idp/IdpSessionRevalidator.cjs.map +1 -1
  364. package/dist/development/src/model/service/idp/IdpSessionRevalidator.js +93 -28
  365. package/dist/development/src/model/service/idp/IdpSessionRevalidator.js.map +1 -1
  366. package/dist/development/src/model/service/idp/PersonIdentityProviderManager.cjs +8 -1
  367. package/dist/development/src/model/service/idp/PersonIdentityProviderManager.cjs.map +1 -1
  368. package/dist/development/src/model/service/idp/PersonIdentityProviderManager.js +8 -1
  369. package/dist/development/src/model/service/idp/PersonIdentityProviderManager.js.map +1 -1
  370. package/dist/development/src/model/service/idp/providers/OIDCHelpers.cjs +69 -33
  371. package/dist/development/src/model/service/idp/providers/OIDCHelpers.cjs.map +1 -1
  372. package/dist/development/src/model/service/idp/providers/OIDCHelpers.js +69 -33
  373. package/dist/development/src/model/service/idp/providers/OIDCHelpers.js.map +1 -1
  374. package/dist/development/src/model/service/idp/providers/OIDCProvider.cjs +4 -1
  375. package/dist/development/src/model/service/idp/providers/OIDCProvider.cjs.map +1 -1
  376. package/dist/development/src/model/service/idp/providers/OIDCProvider.js +4 -1
  377. package/dist/development/src/model/service/idp/providers/OIDCProvider.js.map +1 -1
  378. package/dist/development/src/model/utils/DatabaseContext.cjs +10 -3
  379. package/dist/development/src/model/utils/DatabaseContext.cjs.map +1 -1
  380. package/dist/development/src/model/utils/DatabaseContext.js +11 -4
  381. package/dist/development/src/model/utils/DatabaseContext.js.map +1 -1
  382. package/dist/development/src/model/utils/token.cjs +2 -2
  383. package/dist/development/src/model/utils/token.cjs.map +1 -1
  384. package/dist/development/src/model/utils/token.js +2 -2
  385. package/dist/development/src/model/utils/token.js.map +1 -1
  386. package/dist/development/src/resolvers/ResolverFactory.cjs +12 -3
  387. package/dist/development/src/resolvers/ResolverFactory.cjs.map +1 -1
  388. package/dist/development/src/resolvers/ResolverFactory.js +12 -3
  389. package/dist/development/src/resolvers/ResolverFactory.js.map +1 -1
  390. package/dist/development/src/resolvers/TenantResolverContextFactory.cjs +4 -4
  391. package/dist/development/src/resolvers/TenantResolverContextFactory.cjs.map +1 -1
  392. package/dist/development/src/resolvers/TenantResolverContextFactory.js +4 -4
  393. package/dist/development/src/resolvers/TenantResolverContextFactory.js.map +1 -1
  394. package/dist/development/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.cjs +19 -9
  395. package/dist/development/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.cjs.map +1 -1
  396. package/dist/development/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.js +20 -10
  397. package/dist/development/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.js.map +1 -1
  398. package/dist/development/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.cjs +7 -5
  399. package/dist/development/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.cjs.map +1 -1
  400. package/dist/development/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.js +7 -5
  401. package/dist/development/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.js.map +1 -1
  402. package/dist/development/src/resolvers/mutation/configuration/AuthPolicyMutationResolver.cjs +7 -5
  403. package/dist/development/src/resolvers/mutation/configuration/AuthPolicyMutationResolver.cjs.map +1 -1
  404. package/dist/development/src/resolvers/mutation/configuration/AuthPolicyMutationResolver.js +7 -5
  405. package/dist/development/src/resolvers/mutation/configuration/AuthPolicyMutationResolver.js.map +1 -1
  406. package/dist/development/src/resolvers/mutation/configuration/ConfigurationMutationResolver.cjs +7 -5
  407. package/dist/development/src/resolvers/mutation/configuration/ConfigurationMutationResolver.cjs.map +1 -1
  408. package/dist/development/src/resolvers/mutation/configuration/ConfigurationMutationResolver.js +7 -5
  409. package/dist/development/src/resolvers/mutation/configuration/ConfigurationMutationResolver.js.map +1 -1
  410. package/dist/development/src/resolvers/mutation/customRole/CustomRoleMutationResolver.cjs +124 -0
  411. package/dist/development/src/resolvers/mutation/customRole/CustomRoleMutationResolver.cjs.map +1 -0
  412. package/dist/development/src/resolvers/mutation/customRole/CustomRoleMutationResolver.js +124 -0
  413. package/dist/development/src/resolvers/mutation/customRole/CustomRoleMutationResolver.js.map +1 -0
  414. package/dist/development/src/resolvers/mutation/identity/GlobalRolesMutationResolver.cjs +35 -11
  415. package/dist/development/src/resolvers/mutation/identity/GlobalRolesMutationResolver.cjs.map +1 -1
  416. package/dist/development/src/resolvers/mutation/identity/GlobalRolesMutationResolver.js +35 -11
  417. package/dist/development/src/resolvers/mutation/identity/GlobalRolesMutationResolver.js.map +1 -1
  418. package/dist/development/src/resolvers/mutation/idp/AddIDPMutationResolver.cjs +10 -7
  419. package/dist/development/src/resolvers/mutation/idp/AddIDPMutationResolver.cjs.map +1 -1
  420. package/dist/development/src/resolvers/mutation/idp/AddIDPMutationResolver.js +10 -7
  421. package/dist/development/src/resolvers/mutation/idp/AddIDPMutationResolver.js.map +1 -1
  422. package/dist/development/src/resolvers/mutation/idp/DisableIDPMutationResolver.cjs +7 -5
  423. package/dist/development/src/resolvers/mutation/idp/DisableIDPMutationResolver.cjs.map +1 -1
  424. package/dist/development/src/resolvers/mutation/idp/DisableIDPMutationResolver.js +7 -5
  425. package/dist/development/src/resolvers/mutation/idp/DisableIDPMutationResolver.js.map +1 -1
  426. package/dist/development/src/resolvers/mutation/idp/DisconnectMyIdentityProviderMutationResolver.cjs +8 -6
  427. package/dist/development/src/resolvers/mutation/idp/DisconnectMyIdentityProviderMutationResolver.cjs.map +1 -1
  428. package/dist/development/src/resolvers/mutation/idp/DisconnectMyIdentityProviderMutationResolver.js +8 -6
  429. package/dist/development/src/resolvers/mutation/idp/DisconnectMyIdentityProviderMutationResolver.js.map +1 -1
  430. package/dist/development/src/resolvers/mutation/idp/EnableIDPMutationResolver.cjs +7 -5
  431. package/dist/development/src/resolvers/mutation/idp/EnableIDPMutationResolver.cjs.map +1 -1
  432. package/dist/development/src/resolvers/mutation/idp/EnableIDPMutationResolver.js +7 -5
  433. package/dist/development/src/resolvers/mutation/idp/EnableIDPMutationResolver.js.map +1 -1
  434. package/dist/development/src/resolvers/mutation/idp/UpdateIDPMutationResolver.cjs +10 -7
  435. package/dist/development/src/resolvers/mutation/idp/UpdateIDPMutationResolver.cjs.map +1 -1
  436. package/dist/development/src/resolvers/mutation/idp/UpdateIDPMutationResolver.js +10 -7
  437. package/dist/development/src/resolvers/mutation/idp/UpdateIDPMutationResolver.js.map +1 -1
  438. package/dist/development/src/resolvers/mutation/idp/audit.cjs +1 -0
  439. package/dist/development/src/resolvers/mutation/idp/audit.cjs.map +1 -1
  440. package/dist/development/src/resolvers/mutation/idp/audit.js +1 -0
  441. package/dist/development/src/resolvers/mutation/idp/audit.js.map +1 -1
  442. package/dist/development/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.cjs +38 -18
  443. package/dist/development/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.cjs.map +1 -1
  444. package/dist/development/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.js +38 -18
  445. package/dist/development/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.js.map +1 -1
  446. package/dist/development/src/resolvers/mutation/person/ChangePasswordMutationResolver.cjs +10 -8
  447. package/dist/development/src/resolvers/mutation/person/ChangePasswordMutationResolver.cjs.map +1 -1
  448. package/dist/development/src/resolvers/mutation/person/ChangePasswordMutationResolver.js +10 -8
  449. package/dist/development/src/resolvers/mutation/person/ChangePasswordMutationResolver.js.map +1 -1
  450. package/dist/development/src/resolvers/mutation/person/ChangeProfileMutationResolver.cjs +17 -11
  451. package/dist/development/src/resolvers/mutation/person/ChangeProfileMutationResolver.cjs.map +1 -1
  452. package/dist/development/src/resolvers/mutation/person/ChangeProfileMutationResolver.js +17 -11
  453. package/dist/development/src/resolvers/mutation/person/ChangeProfileMutationResolver.js.map +1 -1
  454. package/dist/development/src/resolvers/mutation/person/DisablePersonMutationResolver.cjs +10 -8
  455. package/dist/development/src/resolvers/mutation/person/DisablePersonMutationResolver.cjs.map +1 -1
  456. package/dist/development/src/resolvers/mutation/person/DisablePersonMutationResolver.js +10 -8
  457. package/dist/development/src/resolvers/mutation/person/DisablePersonMutationResolver.js.map +1 -1
  458. package/dist/development/src/resolvers/mutation/person/EmailOtpMutationResolver.cjs +10 -8
  459. package/dist/development/src/resolvers/mutation/person/EmailOtpMutationResolver.cjs.map +1 -1
  460. package/dist/development/src/resolvers/mutation/person/EmailOtpMutationResolver.js +10 -8
  461. package/dist/development/src/resolvers/mutation/person/EmailOtpMutationResolver.js.map +1 -1
  462. package/dist/development/src/resolvers/mutation/person/EmailVerificationMutationResolver.cjs +10 -8
  463. package/dist/development/src/resolvers/mutation/person/EmailVerificationMutationResolver.cjs.map +1 -1
  464. package/dist/development/src/resolvers/mutation/person/EmailVerificationMutationResolver.js +10 -8
  465. package/dist/development/src/resolvers/mutation/person/EmailVerificationMutationResolver.js.map +1 -1
  466. package/dist/development/src/resolvers/mutation/person/EnablePersonMutationResolver.cjs +61 -0
  467. package/dist/development/src/resolvers/mutation/person/EnablePersonMutationResolver.cjs.map +1 -0
  468. package/dist/development/src/resolvers/mutation/person/EnablePersonMutationResolver.js +61 -0
  469. package/dist/development/src/resolvers/mutation/person/EnablePersonMutationResolver.js.map +1 -0
  470. package/dist/development/src/resolvers/mutation/person/ForceSignOutMutationResolver.cjs +8 -6
  471. package/dist/development/src/resolvers/mutation/person/ForceSignOutMutationResolver.cjs.map +1 -1
  472. package/dist/development/src/resolvers/mutation/person/ForceSignOutMutationResolver.js +8 -6
  473. package/dist/development/src/resolvers/mutation/person/ForceSignOutMutationResolver.js.map +1 -1
  474. package/dist/development/src/resolvers/mutation/person/IDPMutationResolver.cjs +32 -5
  475. package/dist/development/src/resolvers/mutation/person/IDPMutationResolver.cjs.map +1 -1
  476. package/dist/development/src/resolvers/mutation/person/IDPMutationResolver.js +32 -5
  477. package/dist/development/src/resolvers/mutation/person/IDPMutationResolver.js.map +1 -1
  478. package/dist/development/src/resolvers/mutation/person/InviteMutationResolver.cjs +7 -5
  479. package/dist/development/src/resolvers/mutation/person/InviteMutationResolver.cjs.map +1 -1
  480. package/dist/development/src/resolvers/mutation/person/InviteMutationResolver.js +7 -5
  481. package/dist/development/src/resolvers/mutation/person/InviteMutationResolver.js.map +1 -1
  482. package/dist/development/src/resolvers/mutation/person/OtpMutationResolver.cjs +9 -7
  483. package/dist/development/src/resolvers/mutation/person/OtpMutationResolver.cjs.map +1 -1
  484. package/dist/development/src/resolvers/mutation/person/OtpMutationResolver.js +9 -7
  485. package/dist/development/src/resolvers/mutation/person/OtpMutationResolver.js.map +1 -1
  486. package/dist/development/src/resolvers/mutation/person/PasswordlessMutationResolver.cjs +12 -6
  487. package/dist/development/src/resolvers/mutation/person/PasswordlessMutationResolver.cjs.map +1 -1
  488. package/dist/development/src/resolvers/mutation/person/PasswordlessMutationResolver.js +12 -6
  489. package/dist/development/src/resolvers/mutation/person/PasswordlessMutationResolver.js.map +1 -1
  490. package/dist/development/src/resolvers/mutation/person/RegenerateBackupCodesMutationResolver.cjs +9 -7
  491. package/dist/development/src/resolvers/mutation/person/RegenerateBackupCodesMutationResolver.cjs.map +1 -1
  492. package/dist/development/src/resolvers/mutation/person/RegenerateBackupCodesMutationResolver.js +9 -7
  493. package/dist/development/src/resolvers/mutation/person/RegenerateBackupCodesMutationResolver.js.map +1 -1
  494. package/dist/development/src/resolvers/mutation/person/ResetPasswordMutationResolver.cjs +10 -8
  495. package/dist/development/src/resolvers/mutation/person/ResetPasswordMutationResolver.cjs.map +1 -1
  496. package/dist/development/src/resolvers/mutation/person/ResetPasswordMutationResolver.js +10 -8
  497. package/dist/development/src/resolvers/mutation/person/ResetPasswordMutationResolver.js.map +1 -1
  498. package/dist/development/src/resolvers/mutation/person/ResetPersonMfaMutationResolver.cjs +8 -6
  499. package/dist/development/src/resolvers/mutation/person/ResetPersonMfaMutationResolver.cjs.map +1 -1
  500. package/dist/development/src/resolvers/mutation/person/ResetPersonMfaMutationResolver.js +8 -6
  501. package/dist/development/src/resolvers/mutation/person/ResetPersonMfaMutationResolver.js.map +1 -1
  502. package/dist/development/src/resolvers/mutation/person/RevokeSessionMutationResolver.cjs +8 -6
  503. package/dist/development/src/resolvers/mutation/person/RevokeSessionMutationResolver.cjs.map +1 -1
  504. package/dist/development/src/resolvers/mutation/person/RevokeSessionMutationResolver.js +8 -6
  505. package/dist/development/src/resolvers/mutation/person/RevokeSessionMutationResolver.js.map +1 -1
  506. package/dist/development/src/resolvers/mutation/person/SignInMutationResolver.cjs +22 -14
  507. package/dist/development/src/resolvers/mutation/person/SignInMutationResolver.cjs.map +1 -1
  508. package/dist/development/src/resolvers/mutation/person/SignInMutationResolver.js +22 -14
  509. package/dist/development/src/resolvers/mutation/person/SignInMutationResolver.js.map +1 -1
  510. package/dist/development/src/resolvers/mutation/person/SignOutMutationResolver.cjs +7 -5
  511. package/dist/development/src/resolvers/mutation/person/SignOutMutationResolver.cjs.map +1 -1
  512. package/dist/development/src/resolvers/mutation/person/SignOutMutationResolver.js +7 -5
  513. package/dist/development/src/resolvers/mutation/person/SignOutMutationResolver.js.map +1 -1
  514. package/dist/development/src/resolvers/mutation/person/SignUpMutationResolver.cjs +10 -8
  515. package/dist/development/src/resolvers/mutation/person/SignUpMutationResolver.cjs.map +1 -1
  516. package/dist/development/src/resolvers/mutation/person/SignUpMutationResolver.js +10 -8
  517. package/dist/development/src/resolvers/mutation/person/SignUpMutationResolver.js.map +1 -1
  518. package/dist/development/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.cjs +9 -7
  519. package/dist/development/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.cjs.map +1 -1
  520. package/dist/development/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.js +9 -7
  521. package/dist/development/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.js.map +1 -1
  522. package/dist/development/src/resolvers/mutation/project/CreateProjectMutationResolver.cjs +7 -5
  523. package/dist/development/src/resolvers/mutation/project/CreateProjectMutationResolver.cjs.map +1 -1
  524. package/dist/development/src/resolvers/mutation/project/CreateProjectMutationResolver.js +7 -5
  525. package/dist/development/src/resolvers/mutation/project/CreateProjectMutationResolver.js.map +1 -1
  526. package/dist/development/src/resolvers/mutation/project/SetProjectSecretMutationResolver.cjs +7 -5
  527. package/dist/development/src/resolvers/mutation/project/SetProjectSecretMutationResolver.cjs.map +1 -1
  528. package/dist/development/src/resolvers/mutation/project/SetProjectSecretMutationResolver.js +7 -5
  529. package/dist/development/src/resolvers/mutation/project/SetProjectSecretMutationResolver.js.map +1 -1
  530. package/dist/development/src/resolvers/mutation/project/UpdateProjectMutationResolver.cjs +7 -5
  531. package/dist/development/src/resolvers/mutation/project/UpdateProjectMutationResolver.cjs.map +1 -1
  532. package/dist/development/src/resolvers/mutation/project/UpdateProjectMutationResolver.js +7 -5
  533. package/dist/development/src/resolvers/mutation/project/UpdateProjectMutationResolver.js.map +1 -1
  534. package/dist/development/src/resolvers/mutation/projectMember/AddProjectMemberMutationResolver.cjs +7 -5
  535. package/dist/development/src/resolvers/mutation/projectMember/AddProjectMemberMutationResolver.cjs.map +1 -1
  536. package/dist/development/src/resolvers/mutation/projectMember/AddProjectMemberMutationResolver.js +7 -5
  537. package/dist/development/src/resolvers/mutation/projectMember/AddProjectMemberMutationResolver.js.map +1 -1
  538. package/dist/development/src/resolvers/mutation/projectMember/RemoveProjectMemberMutationResolver.cjs +8 -6
  539. package/dist/development/src/resolvers/mutation/projectMember/RemoveProjectMemberMutationResolver.cjs.map +1 -1
  540. package/dist/development/src/resolvers/mutation/projectMember/RemoveProjectMemberMutationResolver.js +8 -6
  541. package/dist/development/src/resolvers/mutation/projectMember/RemoveProjectMemberMutationResolver.js.map +1 -1
  542. package/dist/development/src/resolvers/mutation/projectMember/UpdateProjectMemberMutationResolver.cjs +8 -6
  543. package/dist/development/src/resolvers/mutation/projectMember/UpdateProjectMemberMutationResolver.cjs.map +1 -1
  544. package/dist/development/src/resolvers/mutation/projectMember/UpdateProjectMemberMutationResolver.js +8 -6
  545. package/dist/development/src/resolvers/mutation/projectMember/UpdateProjectMemberMutationResolver.js.map +1 -1
  546. package/dist/development/src/resolvers/mutation/projectMember/audit.cjs +2 -1
  547. package/dist/development/src/resolvers/mutation/projectMember/audit.cjs.map +1 -1
  548. package/dist/development/src/resolvers/mutation/projectMember/audit.js +2 -1
  549. package/dist/development/src/resolvers/mutation/projectMember/audit.js.map +1 -1
  550. package/dist/development/src/resolvers/query/ApiKeyQueryResolver.cjs +8 -6
  551. package/dist/development/src/resolvers/query/ApiKeyQueryResolver.cjs.map +1 -1
  552. package/dist/development/src/resolvers/query/ApiKeyQueryResolver.js +8 -6
  553. package/dist/development/src/resolvers/query/ApiKeyQueryResolver.js.map +1 -1
  554. package/dist/development/src/resolvers/query/AuthLogQueryResolver.cjs +7 -5
  555. package/dist/development/src/resolvers/query/AuthLogQueryResolver.cjs.map +1 -1
  556. package/dist/development/src/resolvers/query/AuthLogQueryResolver.js +7 -5
  557. package/dist/development/src/resolvers/query/AuthLogQueryResolver.js.map +1 -1
  558. package/dist/development/src/resolvers/query/AuthPolicyQueryResolver.cjs +8 -6
  559. package/dist/development/src/resolvers/query/AuthPolicyQueryResolver.cjs.map +1 -1
  560. package/dist/development/src/resolvers/query/AuthPolicyQueryResolver.js +8 -6
  561. package/dist/development/src/resolvers/query/AuthPolicyQueryResolver.js.map +1 -1
  562. package/dist/development/src/resolvers/query/ConfigurationQueryResolver.cjs +8 -6
  563. package/dist/development/src/resolvers/query/ConfigurationQueryResolver.cjs.map +1 -1
  564. package/dist/development/src/resolvers/query/ConfigurationQueryResolver.js +8 -6
  565. package/dist/development/src/resolvers/query/ConfigurationQueryResolver.js.map +1 -1
  566. package/dist/development/src/resolvers/query/CustomRoleQueryResolver.cjs +55 -0
  567. package/dist/development/src/resolvers/query/CustomRoleQueryResolver.cjs.map +1 -0
  568. package/dist/development/src/resolvers/query/CustomRoleQueryResolver.js +55 -0
  569. package/dist/development/src/resolvers/query/CustomRoleQueryResolver.js.map +1 -0
  570. package/dist/development/src/resolvers/query/IDPQueryResolver.cjs +7 -5
  571. package/dist/development/src/resolvers/query/IDPQueryResolver.cjs.map +1 -1
  572. package/dist/development/src/resolvers/query/IDPQueryResolver.js +7 -5
  573. package/dist/development/src/resolvers/query/IDPQueryResolver.js.map +1 -1
  574. package/dist/development/src/resolvers/query/MailTemplateQueryResolver.cjs +21 -14
  575. package/dist/development/src/resolvers/query/MailTemplateQueryResolver.cjs.map +1 -1
  576. package/dist/development/src/resolvers/query/MailTemplateQueryResolver.js +21 -14
  577. package/dist/development/src/resolvers/query/MailTemplateQueryResolver.js.map +1 -1
  578. package/dist/development/src/resolvers/query/PersonQueryResolver.cjs +7 -5
  579. package/dist/development/src/resolvers/query/PersonQueryResolver.cjs.map +1 -1
  580. package/dist/development/src/resolvers/query/PersonQueryResolver.js +7 -5
  581. package/dist/development/src/resolvers/query/PersonQueryResolver.js.map +1 -1
  582. package/dist/development/src/resolvers/query/ProjectMembersQueryResolver.cjs +7 -5
  583. package/dist/development/src/resolvers/query/ProjectMembersQueryResolver.cjs.map +1 -1
  584. package/dist/development/src/resolvers/query/ProjectMembersQueryResolver.js +7 -5
  585. package/dist/development/src/resolvers/query/ProjectMembersQueryResolver.js.map +1 -1
  586. package/dist/development/src/resolvers/query/ProjectQueryResolver.cjs +10 -7
  587. package/dist/development/src/resolvers/query/ProjectQueryResolver.cjs.map +1 -1
  588. package/dist/development/src/resolvers/query/ProjectQueryResolver.js +10 -7
  589. package/dist/development/src/resolvers/query/ProjectQueryResolver.js.map +1 -1
  590. package/dist/development/src/resolvers/responseHelpers/ApiKeyResponseFactory.cjs +7 -5
  591. package/dist/development/src/resolvers/responseHelpers/ApiKeyResponseFactory.cjs.map +1 -1
  592. package/dist/development/src/resolvers/responseHelpers/ApiKeyResponseFactory.js +7 -5
  593. package/dist/development/src/resolvers/responseHelpers/ApiKeyResponseFactory.js.map +1 -1
  594. package/dist/development/src/resolvers/responseHelpers/PersonResponseFactory.cjs +5 -0
  595. package/dist/development/src/resolvers/responseHelpers/PersonResponseFactory.cjs.map +1 -1
  596. package/dist/development/src/resolvers/responseHelpers/PersonResponseFactory.js +5 -0
  597. package/dist/development/src/resolvers/responseHelpers/PersonResponseFactory.js.map +1 -1
  598. package/dist/development/src/resolvers/responseHelpers/ProjectResponseFactory.cjs +23 -0
  599. package/dist/development/src/resolvers/responseHelpers/ProjectResponseFactory.cjs.map +1 -0
  600. package/dist/development/src/resolvers/responseHelpers/ProjectResponseFactory.js +23 -0
  601. package/dist/development/src/resolvers/responseHelpers/ProjectResponseFactory.js.map +1 -0
  602. package/dist/development/src/resolvers/responseHelpers/SignInResponseFactory.cjs +8 -6
  603. package/dist/development/src/resolvers/responseHelpers/SignInResponseFactory.cjs.map +1 -1
  604. package/dist/development/src/resolvers/responseHelpers/SignInResponseFactory.js +8 -6
  605. package/dist/development/src/resolvers/responseHelpers/SignInResponseFactory.js.map +1 -1
  606. package/dist/development/src/resolvers/types/IdentityTypeResolver.cjs +50 -18
  607. package/dist/development/src/resolvers/types/IdentityTypeResolver.cjs.map +1 -1
  608. package/dist/development/src/resolvers/types/IdentityTypeResolver.js +50 -18
  609. package/dist/development/src/resolvers/types/IdentityTypeResolver.js.map +1 -1
  610. package/dist/development/src/resolvers/types/PersonTypeResolver.cjs +38 -8
  611. package/dist/development/src/resolvers/types/PersonTypeResolver.cjs.map +1 -1
  612. package/dist/development/src/resolvers/types/PersonTypeResolver.js +38 -8
  613. package/dist/development/src/resolvers/types/PersonTypeResolver.js.map +1 -1
  614. package/dist/development/src/resolvers/types/ProjectTypeResolver.cjs +31 -6
  615. package/dist/development/src/resolvers/types/ProjectTypeResolver.cjs.map +1 -1
  616. package/dist/development/src/resolvers/types/ProjectTypeResolver.js +31 -6
  617. package/dist/development/src/resolvers/types/ProjectTypeResolver.js.map +1 -1
  618. package/dist/development/src/schema/tenant.graphql.cjs +275 -15
  619. package/dist/development/src/schema/tenant.graphql.cjs.map +1 -1
  620. package/dist/development/src/schema/tenant.graphql.js +275 -15
  621. package/dist/development/src/schema/tenant.graphql.js.map +1 -1
  622. package/dist/production/index.cjs +69 -0
  623. package/dist/production/index.cjs.map +1 -1
  624. package/dist/production/index.js +71 -2
  625. package/dist/production/index.js.map +1 -1
  626. package/dist/production/src/TenantContainer.cjs +39 -10
  627. package/dist/production/src/TenantContainer.cjs.map +1 -1
  628. package/dist/production/src/TenantContainer.js +39 -10
  629. package/dist/production/src/TenantContainer.js.map +1 -1
  630. package/dist/production/src/bridges/system/IdentityFetcher.cjs +9 -7
  631. package/dist/production/src/bridges/system/IdentityFetcher.cjs.map +1 -1
  632. package/dist/production/src/bridges/system/IdentityFetcher.js +9 -7
  633. package/dist/production/src/bridges/system/IdentityFetcher.js.map +1 -1
  634. package/dist/production/src/migrations/2026-06-18-120000-idp-claim-mapping.cjs +10 -0
  635. package/dist/production/src/migrations/2026-06-18-120000-idp-claim-mapping.cjs.map +1 -0
  636. package/dist/production/src/migrations/2026-06-18-120000-idp-claim-mapping.js +11 -0
  637. package/dist/production/src/migrations/2026-06-18-120000-idp-claim-mapping.js.map +1 -0
  638. package/dist/production/src/migrations/2026-08-03-120000-person-enable-auth-log.cjs +9 -0
  639. package/dist/production/src/migrations/2026-08-03-120000-person-enable-auth-log.cjs.map +1 -0
  640. package/dist/production/src/migrations/2026-08-03-120000-person-enable-auth-log.js +10 -0
  641. package/dist/production/src/migrations/2026-08-03-120000-person-enable-auth-log.js.map +1 -0
  642. package/dist/production/src/migrations/2026-08-04-120000-config-panel.cjs +11 -0
  643. package/dist/production/src/migrations/2026-08-04-120000-config-panel.cjs.map +1 -0
  644. package/dist/production/src/migrations/2026-08-04-120000-config-panel.js +12 -0
  645. package/dist/production/src/migrations/2026-08-04-120000-config-panel.js.map +1 -0
  646. package/dist/production/src/migrations/2026-09-04-120000-idp-disable-local-authentication.cjs +18 -0
  647. package/dist/production/src/migrations/2026-09-04-120000-idp-disable-local-authentication.cjs.map +1 -0
  648. package/dist/production/src/migrations/2026-09-04-120000-idp-disable-local-authentication.js +19 -0
  649. package/dist/production/src/migrations/2026-09-04-120000-idp-disable-local-authentication.js.map +1 -0
  650. package/dist/production/src/migrations/2026-09-11-120000-custom-role.cjs +18 -0
  651. package/dist/production/src/migrations/2026-09-11-120000-custom-role.cjs.map +1 -0
  652. package/dist/production/src/migrations/2026-09-11-120000-custom-role.js +19 -0
  653. package/dist/production/src/migrations/2026-09-11-120000-custom-role.js.map +1 -0
  654. package/dist/production/src/migrations/runner.cjs +17 -5
  655. package/dist/production/src/migrations/runner.cjs.map +1 -1
  656. package/dist/production/src/migrations/runner.js +17 -5
  657. package/dist/production/src/migrations/runner.js.map +1 -1
  658. package/dist/production/src/migrations/snapshot.cjs +22 -2
  659. package/dist/production/src/migrations/snapshot.cjs.map +1 -1
  660. package/dist/production/src/migrations/snapshot.js +22 -2
  661. package/dist/production/src/migrations/snapshot.js.map +1 -1
  662. package/dist/production/src/model/authorization/CustomRoleAuthorizator.cjs +65 -0
  663. package/dist/production/src/model/authorization/CustomRoleAuthorizator.cjs.map +1 -0
  664. package/dist/production/src/model/authorization/CustomRoleAuthorizator.js +65 -0
  665. package/dist/production/src/model/authorization/CustomRoleAuthorizator.js.map +1 -0
  666. package/dist/production/src/model/authorization/CustomRolePermissions.cjs +404 -0
  667. package/dist/production/src/model/authorization/CustomRolePermissions.cjs.map +1 -0
  668. package/dist/production/src/model/authorization/CustomRolePermissions.js +387 -0
  669. package/dist/production/src/model/authorization/CustomRolePermissions.js.map +1 -0
  670. package/dist/production/src/model/authorization/PermissionActions.cjs +19 -16
  671. package/dist/production/src/model/authorization/PermissionActions.cjs.map +1 -1
  672. package/dist/production/src/model/authorization/PermissionActions.js +19 -16
  673. package/dist/production/src/model/authorization/PermissionActions.js.map +1 -1
  674. package/dist/production/src/model/authorization/PermissionContextFactory.cjs +20 -2
  675. package/dist/production/src/model/authorization/PermissionContextFactory.cjs.map +1 -1
  676. package/dist/production/src/model/authorization/PermissionContextFactory.js +20 -2
  677. package/dist/production/src/model/authorization/PermissionContextFactory.js.map +1 -1
  678. package/dist/production/src/model/authorization/PermissionsFactory.cjs +32 -24
  679. package/dist/production/src/model/authorization/PermissionsFactory.cjs.map +1 -1
  680. package/dist/production/src/model/authorization/PermissionsFactory.js +33 -25
  681. package/dist/production/src/model/authorization/PermissionsFactory.js.map +1 -1
  682. package/dist/production/src/model/authorization/Roles.cjs +8 -0
  683. package/dist/production/src/model/authorization/Roles.cjs.map +1 -1
  684. package/dist/production/src/model/authorization/Roles.js +8 -0
  685. package/dist/production/src/model/authorization/Roles.js.map +1 -1
  686. package/dist/production/src/model/authorization/TargetIdentityPermission.cjs +35 -0
  687. package/dist/production/src/model/authorization/TargetIdentityPermission.cjs.map +1 -0
  688. package/dist/production/src/model/authorization/TargetIdentityPermission.js +35 -0
  689. package/dist/production/src/model/authorization/TargetIdentityPermission.js.map +1 -0
  690. package/dist/production/src/model/commands/apiKey/ApiKeyHelper.cjs +19 -0
  691. package/dist/production/src/model/commands/apiKey/ApiKeyHelper.cjs.map +1 -1
  692. package/dist/production/src/model/commands/apiKey/ApiKeyHelper.js +19 -0
  693. package/dist/production/src/model/commands/apiKey/ApiKeyHelper.js.map +1 -1
  694. package/dist/production/src/model/commands/apiKey/CreateApiKeyCommand.cjs +4 -2
  695. package/dist/production/src/model/commands/apiKey/CreateApiKeyCommand.cjs.map +1 -1
  696. package/dist/production/src/model/commands/apiKey/CreateApiKeyCommand.js +5 -3
  697. package/dist/production/src/model/commands/apiKey/CreateApiKeyCommand.js.map +1 -1
  698. package/dist/production/src/model/commands/apiKey/ProlongApiKeyCommand.cjs +9 -10
  699. package/dist/production/src/model/commands/apiKey/ProlongApiKeyCommand.cjs.map +1 -1
  700. package/dist/production/src/model/commands/apiKey/ProlongApiKeyCommand.js +10 -11
  701. package/dist/production/src/model/commands/apiKey/ProlongApiKeyCommand.js.map +1 -1
  702. package/dist/production/src/model/commands/authLog/CreateAuthLogEntryCommand.cjs.map +1 -1
  703. package/dist/production/src/model/commands/authLog/CreateAuthLogEntryCommand.js.map +1 -1
  704. package/dist/production/src/model/commands/configuration/UpdateConfigurationCommand.cjs +5 -3
  705. package/dist/production/src/model/commands/configuration/UpdateConfigurationCommand.cjs.map +1 -1
  706. package/dist/production/src/model/commands/configuration/UpdateConfigurationCommand.js +5 -3
  707. package/dist/production/src/model/commands/configuration/UpdateConfigurationCommand.js.map +1 -1
  708. package/dist/production/src/model/commands/customRole/CreateCustomRoleCommand.cjs +23 -0
  709. package/dist/production/src/model/commands/customRole/CreateCustomRoleCommand.cjs.map +1 -0
  710. package/dist/production/src/model/commands/customRole/CreateCustomRoleCommand.js +23 -0
  711. package/dist/production/src/model/commands/customRole/CreateCustomRoleCommand.js.map +1 -0
  712. package/dist/production/src/model/commands/customRole/DeleteCustomRoleCommand.cjs +14 -0
  713. package/dist/production/src/model/commands/customRole/DeleteCustomRoleCommand.cjs.map +1 -0
  714. package/dist/production/src/model/commands/customRole/DeleteCustomRoleCommand.js +14 -0
  715. package/dist/production/src/model/commands/customRole/DeleteCustomRoleCommand.js.map +1 -0
  716. package/dist/production/src/model/commands/customRole/RemoveCustomRoleAssignmentsCommand.cjs +16 -0
  717. package/dist/production/src/model/commands/customRole/RemoveCustomRoleAssignmentsCommand.cjs.map +1 -0
  718. package/dist/production/src/model/commands/customRole/RemoveCustomRoleAssignmentsCommand.js +16 -0
  719. package/dist/production/src/model/commands/customRole/RemoveCustomRoleAssignmentsCommand.js.map +1 -0
  720. package/dist/production/src/model/commands/customRole/UpdateCustomRoleCommand.cjs +19 -0
  721. package/dist/production/src/model/commands/customRole/UpdateCustomRoleCommand.cjs.map +1 -0
  722. package/dist/production/src/model/commands/customRole/UpdateCustomRoleCommand.js +19 -0
  723. package/dist/production/src/model/commands/customRole/UpdateCustomRoleCommand.js.map +1 -0
  724. package/dist/production/src/model/commands/identity/PatchIdentityGlobalRoles.cjs +1 -1
  725. package/dist/production/src/model/commands/identity/PatchIdentityGlobalRoles.cjs.map +1 -1
  726. package/dist/production/src/model/commands/identity/PatchIdentityGlobalRoles.js +1 -1
  727. package/dist/production/src/model/commands/identity/PatchIdentityGlobalRoles.js.map +1 -1
  728. package/dist/production/src/model/commands/idp/ClaimIdpRevalidationCommand.cjs +3 -7
  729. package/dist/production/src/model/commands/idp/ClaimIdpRevalidationCommand.cjs.map +1 -1
  730. package/dist/production/src/model/commands/idp/ClaimIdpRevalidationCommand.js +3 -7
  731. package/dist/production/src/model/commands/idp/ClaimIdpRevalidationCommand.js.map +1 -1
  732. package/dist/production/src/model/commands/idp/CreateIdpCommand.cjs +8 -2
  733. package/dist/production/src/model/commands/idp/CreateIdpCommand.cjs.map +1 -1
  734. package/dist/production/src/model/commands/idp/CreateIdpCommand.js +8 -2
  735. package/dist/production/src/model/commands/idp/CreateIdpCommand.js.map +1 -1
  736. package/dist/production/src/model/commands/idp/CreateIdpSessionCommand.cjs +4 -1
  737. package/dist/production/src/model/commands/idp/CreateIdpSessionCommand.cjs.map +1 -1
  738. package/dist/production/src/model/commands/idp/CreateIdpSessionCommand.js +5 -2
  739. package/dist/production/src/model/commands/idp/CreateIdpSessionCommand.js.map +1 -1
  740. package/dist/production/src/model/commands/idp/UpdateIdpCommand.cjs +6 -2
  741. package/dist/production/src/model/commands/idp/UpdateIdpCommand.cjs.map +1 -1
  742. package/dist/production/src/model/commands/idp/UpdateIdpCommand.js +6 -2
  743. package/dist/production/src/model/commands/idp/UpdateIdpCommand.js.map +1 -1
  744. package/dist/production/src/model/commands/idp/UpdateIdpSessionCommand.cjs +2 -1
  745. package/dist/production/src/model/commands/idp/UpdateIdpSessionCommand.cjs.map +1 -1
  746. package/dist/production/src/model/commands/idp/UpdateIdpSessionCommand.js +3 -2
  747. package/dist/production/src/model/commands/idp/UpdateIdpSessionCommand.js.map +1 -1
  748. package/dist/production/src/model/commands/membership/{RemoveProjectMembershipsCommand.cjs → RemoveProjectMembershipCommand.cjs} +1 -1
  749. package/dist/production/src/model/commands/membership/RemoveProjectMembershipCommand.cjs.map +1 -0
  750. package/dist/production/src/model/commands/membership/{RemoveProjectMembershipsCommand.js → RemoveProjectMembershipCommand.js} +1 -1
  751. package/dist/production/src/model/commands/membership/RemoveProjectMembershipCommand.js.map +1 -0
  752. package/dist/production/src/model/commands/membership/UpdateProjectMemberCommand.cjs +2 -2
  753. package/dist/production/src/model/commands/membership/UpdateProjectMemberCommand.cjs.map +1 -1
  754. package/dist/production/src/model/commands/membership/UpdateProjectMemberCommand.js +1 -1
  755. package/dist/production/src/model/commands/membership/UpdateProjectMemberCommand.js.map +1 -1
  756. package/dist/production/src/model/commands/person/CreatePersonCommand.cjs +1 -0
  757. package/dist/production/src/model/commands/person/CreatePersonCommand.cjs.map +1 -1
  758. package/dist/production/src/model/commands/person/CreatePersonCommand.js +1 -0
  759. package/dist/production/src/model/commands/person/CreatePersonCommand.js.map +1 -1
  760. package/dist/production/src/model/commands/person/EnablePersonCommand.cjs +17 -0
  761. package/dist/production/src/model/commands/person/EnablePersonCommand.cjs.map +1 -0
  762. package/dist/production/src/model/commands/person/EnablePersonCommand.js +17 -0
  763. package/dist/production/src/model/commands/person/EnablePersonCommand.js.map +1 -0
  764. package/dist/production/src/model/commands/person/SetMfaGraceUntilCommand.cjs +3 -3
  765. package/dist/production/src/model/commands/person/SetMfaGraceUntilCommand.cjs.map +1 -1
  766. package/dist/production/src/model/commands/person/SetMfaGraceUntilCommand.js +4 -4
  767. package/dist/production/src/model/commands/person/SetMfaGraceUntilCommand.js.map +1 -1
  768. package/dist/production/src/model/commands/personToken/ResetPasswordCommand.cjs +2 -3
  769. package/dist/production/src/model/commands/personToken/ResetPasswordCommand.cjs.map +1 -1
  770. package/dist/production/src/model/commands/personToken/ResetPasswordCommand.js +2 -3
  771. package/dist/production/src/model/commands/personToken/ResetPasswordCommand.js.map +1 -1
  772. package/dist/production/src/model/commands/personToken/SaveEmailOtpTokenCommand.cjs +3 -3
  773. package/dist/production/src/model/commands/personToken/SaveEmailOtpTokenCommand.cjs.map +1 -1
  774. package/dist/production/src/model/commands/personToken/SaveEmailOtpTokenCommand.js +4 -4
  775. package/dist/production/src/model/commands/personToken/SaveEmailOtpTokenCommand.js.map +1 -1
  776. package/dist/production/src/model/commands/personToken/SavePersonTokenCommand.cjs +12 -6
  777. package/dist/production/src/model/commands/personToken/SavePersonTokenCommand.cjs.map +1 -1
  778. package/dist/production/src/model/commands/personToken/SavePersonTokenCommand.js +13 -7
  779. package/dist/production/src/model/commands/personToken/SavePersonTokenCommand.js.map +1 -1
  780. package/dist/production/src/model/commands/rateLimit/RecordRateLimitEventCommand.cjs +1 -2
  781. package/dist/production/src/model/commands/rateLimit/RecordRateLimitEventCommand.cjs.map +1 -1
  782. package/dist/production/src/model/commands/rateLimit/RecordRateLimitEventCommand.js +1 -2
  783. package/dist/production/src/model/commands/rateLimit/RecordRateLimitEventCommand.js.map +1 -1
  784. package/dist/production/src/model/mailing/UserMailer.cjs +2 -1
  785. package/dist/production/src/model/mailing/UserMailer.cjs.map +1 -1
  786. package/dist/production/src/model/mailing/UserMailer.js +2 -1
  787. package/dist/production/src/model/mailing/UserMailer.js.map +1 -1
  788. package/dist/production/src/model/queries/apiKey/ApiKeyQuery.cjs +8 -1
  789. package/dist/production/src/model/queries/apiKey/ApiKeyQuery.cjs.map +1 -1
  790. package/dist/production/src/model/queries/apiKey/ApiKeyQuery.js +9 -2
  791. package/dist/production/src/model/queries/apiKey/ApiKeyQuery.js.map +1 -1
  792. package/dist/production/src/model/queries/apiKey/ApiKeySessionsQuery.cjs +2 -3
  793. package/dist/production/src/model/queries/apiKey/ApiKeySessionsQuery.cjs.map +1 -1
  794. package/dist/production/src/model/queries/apiKey/ApiKeySessionsQuery.js +2 -3
  795. package/dist/production/src/model/queries/apiKey/ApiKeySessionsQuery.js.map +1 -1
  796. package/dist/production/src/model/queries/authLog/NextLoginAttemptQuery.cjs +12 -10
  797. package/dist/production/src/model/queries/authLog/NextLoginAttemptQuery.cjs.map +1 -1
  798. package/dist/production/src/model/queries/authLog/NextLoginAttemptQuery.js +12 -10
  799. package/dist/production/src/model/queries/authLog/NextLoginAttemptQuery.js.map +1 -1
  800. package/dist/production/src/model/queries/authLog/NextMailAttemptQuery.cjs +10 -8
  801. package/dist/production/src/model/queries/authLog/NextMailAttemptQuery.cjs.map +1 -1
  802. package/dist/production/src/model/queries/authLog/NextMailAttemptQuery.js +10 -8
  803. package/dist/production/src/model/queries/authLog/NextMailAttemptQuery.js.map +1 -1
  804. package/dist/production/src/model/queries/configuration/ConfigurationQuery.cjs +4 -0
  805. package/dist/production/src/model/queries/configuration/ConfigurationQuery.cjs.map +1 -1
  806. package/dist/production/src/model/queries/configuration/ConfigurationQuery.js +4 -0
  807. package/dist/production/src/model/queries/configuration/ConfigurationQuery.js.map +1 -1
  808. package/dist/production/src/model/queries/customRole/CustomRolesQuery.cjs +23 -0
  809. package/dist/production/src/model/queries/customRole/CustomRolesQuery.cjs.map +1 -0
  810. package/dist/production/src/model/queries/customRole/CustomRolesQuery.js +23 -0
  811. package/dist/production/src/model/queries/customRole/CustomRolesQuery.js.map +1 -0
  812. package/dist/production/src/model/queries/identity/IdentitiesHoldingRoleCountQuery.cjs +15 -0
  813. package/dist/production/src/model/queries/identity/IdentitiesHoldingRoleCountQuery.cjs.map +1 -0
  814. package/dist/production/src/model/queries/identity/IdentitiesHoldingRoleCountQuery.js +15 -0
  815. package/dist/production/src/model/queries/identity/IdentitiesHoldingRoleCountQuery.js.map +1 -0
  816. package/dist/production/src/model/queries/identity/IdentityQuery.cjs +7 -2
  817. package/dist/production/src/model/queries/identity/IdentityQuery.cjs.map +1 -1
  818. package/dist/production/src/model/queries/identity/IdentityQuery.js +7 -2
  819. package/dist/production/src/model/queries/identity/IdentityQuery.js.map +1 -1
  820. package/dist/production/src/model/queries/idp/LocalAuthDisablingIdpsQuery.cjs +21 -0
  821. package/dist/production/src/model/queries/idp/LocalAuthDisablingIdpsQuery.cjs.map +1 -0
  822. package/dist/production/src/model/queries/idp/LocalAuthDisablingIdpsQuery.js +21 -0
  823. package/dist/production/src/model/queries/idp/LocalAuthDisablingIdpsQuery.js.map +1 -0
  824. package/dist/production/src/model/queries/idp/PersonIdentityProvidersQuery.cjs +1 -1
  825. package/dist/production/src/model/queries/idp/PersonIdentityProvidersQuery.cjs.map +1 -1
  826. package/dist/production/src/model/queries/idp/PersonIdentityProvidersQuery.js +1 -1
  827. package/dist/production/src/model/queries/idp/PersonIdentityProvidersQuery.js.map +1 -1
  828. package/dist/production/src/model/queries/idp/helpers.cjs +3 -3
  829. package/dist/production/src/model/queries/idp/helpers.cjs.map +1 -1
  830. package/dist/production/src/model/queries/idp/helpers.js +3 -3
  831. package/dist/production/src/model/queries/idp/helpers.js.map +1 -1
  832. package/dist/production/src/model/queries/membership/IdentityHasProjectMembershipsQuery.cjs +15 -0
  833. package/dist/production/src/model/queries/membership/IdentityHasProjectMembershipsQuery.cjs.map +1 -0
  834. package/dist/production/src/model/queries/membership/IdentityHasProjectMembershipsQuery.js +15 -0
  835. package/dist/production/src/model/queries/membership/IdentityHasProjectMembershipsQuery.js.map +1 -0
  836. package/dist/production/src/model/queries/membership/ProjectMembersQuery.cjs +1 -1
  837. package/dist/production/src/model/queries/membership/ProjectMembersQuery.cjs.map +1 -1
  838. package/dist/production/src/model/queries/membership/ProjectMembersQuery.js +1 -1
  839. package/dist/production/src/model/queries/membership/ProjectMembersQuery.js.map +1 -1
  840. package/dist/production/src/model/queries/person/PersonQueryBuilderFactory.cjs +2 -2
  841. package/dist/production/src/model/queries/person/PersonQueryBuilderFactory.cjs.map +1 -1
  842. package/dist/production/src/model/queries/person/PersonQueryBuilderFactory.js +2 -2
  843. package/dist/production/src/model/queries/person/PersonQueryBuilderFactory.js.map +1 -1
  844. package/dist/production/src/model/queries/personToken/PersonTokenQuery.cjs +1 -1
  845. package/dist/production/src/model/queries/personToken/PersonTokenQuery.cjs.map +1 -1
  846. package/dist/production/src/model/queries/personToken/PersonTokenQuery.js +1 -1
  847. package/dist/production/src/model/queries/personToken/PersonTokenQuery.js.map +1 -1
  848. package/dist/production/src/model/queries/project/ProjectsByIdentityQuery.cjs +4 -1
  849. package/dist/production/src/model/queries/project/ProjectsByIdentityQuery.cjs.map +1 -1
  850. package/dist/production/src/model/queries/project/ProjectsByIdentityQuery.js +4 -1
  851. package/dist/production/src/model/queries/project/ProjectsByIdentityQuery.js.map +1 -1
  852. package/dist/production/src/model/queries/rateLimit/RateLimitCountQuery.cjs +3 -3
  853. package/dist/production/src/model/queries/rateLimit/RateLimitCountQuery.cjs.map +1 -1
  854. package/dist/production/src/model/queries/rateLimit/RateLimitCountQuery.js +3 -3
  855. package/dist/production/src/model/queries/rateLimit/RateLimitCountQuery.js.map +1 -1
  856. package/dist/production/src/model/service/AuthLogService.cjs +8 -2
  857. package/dist/production/src/model/service/AuthLogService.cjs.map +1 -1
  858. package/dist/production/src/model/service/AuthLogService.js +8 -2
  859. package/dist/production/src/model/service/AuthLogService.js.map +1 -1
  860. package/dist/production/src/model/service/AuthPolicyManager.cjs +2 -1
  861. package/dist/production/src/model/service/AuthPolicyManager.cjs.map +1 -1
  862. package/dist/production/src/model/service/AuthPolicyManager.js +2 -1
  863. package/dist/production/src/model/service/AuthPolicyManager.js.map +1 -1
  864. package/dist/production/src/model/service/AuthPolicyResolver.cjs +2 -1
  865. package/dist/production/src/model/service/AuthPolicyResolver.cjs.map +1 -1
  866. package/dist/production/src/model/service/AuthPolicyResolver.js +2 -1
  867. package/dist/production/src/model/service/AuthPolicyResolver.js.map +1 -1
  868. package/dist/production/src/model/service/CustomRoleManager.cjs +170 -0
  869. package/dist/production/src/model/service/CustomRoleManager.cjs.map +1 -0
  870. package/dist/production/src/model/service/CustomRoleManager.js +170 -0
  871. package/dist/production/src/model/service/CustomRoleManager.js.map +1 -0
  872. package/dist/production/src/model/service/EmailChangeManager.cjs +5 -4
  873. package/dist/production/src/model/service/EmailChangeManager.cjs.map +1 -1
  874. package/dist/production/src/model/service/EmailChangeManager.js +5 -4
  875. package/dist/production/src/model/service/EmailChangeManager.js.map +1 -1
  876. package/dist/production/src/model/service/EmailOtpManager.cjs +0 -1
  877. package/dist/production/src/model/service/EmailOtpManager.cjs.map +1 -1
  878. package/dist/production/src/model/service/EmailOtpManager.js +0 -1
  879. package/dist/production/src/model/service/EmailOtpManager.js.map +1 -1
  880. package/dist/production/src/model/service/EmailValidator.cjs +2 -1
  881. package/dist/production/src/model/service/EmailValidator.cjs.map +1 -1
  882. package/dist/production/src/model/service/EmailValidator.js +2 -1
  883. package/dist/production/src/model/service/EmailValidator.js.map +1 -1
  884. package/dist/production/src/model/service/EmailVerificationManager.cjs +5 -4
  885. package/dist/production/src/model/service/EmailVerificationManager.cjs.map +1 -1
  886. package/dist/production/src/model/service/EmailVerificationManager.js +5 -4
  887. package/dist/production/src/model/service/EmailVerificationManager.js.map +1 -1
  888. package/dist/production/src/model/service/GlobalRoleValidator.cjs +35 -0
  889. package/dist/production/src/model/service/GlobalRoleValidator.cjs.map +1 -0
  890. package/dist/production/src/model/service/GlobalRoleValidator.js +35 -0
  891. package/dist/production/src/model/service/GlobalRoleValidator.js.map +1 -0
  892. package/dist/production/src/model/service/IDPSignInManager.cjs +52 -16
  893. package/dist/production/src/model/service/IDPSignInManager.cjs.map +1 -1
  894. package/dist/production/src/model/service/IDPSignInManager.js +52 -16
  895. package/dist/production/src/model/service/IDPSignInManager.js.map +1 -1
  896. package/dist/production/src/model/service/InviteManager.cjs +2 -1
  897. package/dist/production/src/model/service/InviteManager.cjs.map +1 -1
  898. package/dist/production/src/model/service/InviteManager.js +2 -1
  899. package/dist/production/src/model/service/InviteManager.js.map +1 -1
  900. package/dist/production/src/model/service/PanelAccessResolver.cjs +32 -0
  901. package/dist/production/src/model/service/PanelAccessResolver.cjs.map +1 -0
  902. package/dist/production/src/model/service/PanelAccessResolver.js +32 -0
  903. package/dist/production/src/model/service/PanelAccessResolver.js.map +1 -0
  904. package/dist/production/src/model/service/PasswordChangeManager.cjs +2 -1
  905. package/dist/production/src/model/service/PasswordChangeManager.cjs.map +1 -1
  906. package/dist/production/src/model/service/PasswordChangeManager.js +2 -1
  907. package/dist/production/src/model/service/PasswordChangeManager.js.map +1 -1
  908. package/dist/production/src/model/service/PasswordResetManager.cjs +9 -3
  909. package/dist/production/src/model/service/PasswordResetManager.cjs.map +1 -1
  910. package/dist/production/src/model/service/PasswordResetManager.js +9 -3
  911. package/dist/production/src/model/service/PasswordResetManager.js.map +1 -1
  912. package/dist/production/src/model/service/PasswordlessSignInManager.cjs +24 -6
  913. package/dist/production/src/model/service/PasswordlessSignInManager.cjs.map +1 -1
  914. package/dist/production/src/model/service/PasswordlessSignInManager.js +24 -6
  915. package/dist/production/src/model/service/PasswordlessSignInManager.js.map +1 -1
  916. package/dist/production/src/model/service/PersonAccessManager.cjs +10 -2
  917. package/dist/production/src/model/service/PersonAccessManager.cjs.map +1 -1
  918. package/dist/production/src/model/service/PersonAccessManager.js +10 -2
  919. package/dist/production/src/model/service/PersonAccessManager.js.map +1 -1
  920. package/dist/production/src/model/service/PersonManager.cjs +2 -1
  921. package/dist/production/src/model/service/PersonManager.cjs.map +1 -1
  922. package/dist/production/src/model/service/PersonManager.js +2 -1
  923. package/dist/production/src/model/service/PersonManager.js.map +1 -1
  924. package/dist/production/src/model/service/ProjectMemberManager.cjs +2 -1
  925. package/dist/production/src/model/service/ProjectMemberManager.cjs.map +1 -1
  926. package/dist/production/src/model/service/ProjectMemberManager.js +2 -1
  927. package/dist/production/src/model/service/ProjectMemberManager.js.map +1 -1
  928. package/dist/production/src/model/service/RateLimiter.cjs +1 -2
  929. package/dist/production/src/model/service/RateLimiter.cjs.map +1 -1
  930. package/dist/production/src/model/service/RateLimiter.js +1 -2
  931. package/dist/production/src/model/service/RateLimiter.js.map +1 -1
  932. package/dist/production/src/model/service/RolesManager.cjs +17 -18
  933. package/dist/production/src/model/service/RolesManager.cjs.map +1 -1
  934. package/dist/production/src/model/service/RolesManager.js +18 -19
  935. package/dist/production/src/model/service/RolesManager.js.map +1 -1
  936. package/dist/production/src/model/service/SecretsManager.cjs +2 -1
  937. package/dist/production/src/model/service/SecretsManager.cjs.map +1 -1
  938. package/dist/production/src/model/service/SecretsManager.js +2 -1
  939. package/dist/production/src/model/service/SecretsManager.js.map +1 -1
  940. package/dist/production/src/model/service/SignInManager.cjs +9 -5
  941. package/dist/production/src/model/service/SignInManager.cjs.map +1 -1
  942. package/dist/production/src/model/service/SignInManager.js +9 -5
  943. package/dist/production/src/model/service/SignInManager.js.map +1 -1
  944. package/dist/production/src/model/service/SignOutManager.cjs +2 -1
  945. package/dist/production/src/model/service/SignOutManager.cjs.map +1 -1
  946. package/dist/production/src/model/service/SignOutManager.js +2 -1
  947. package/dist/production/src/model/service/SignOutManager.js.map +1 -1
  948. package/dist/production/src/model/service/SignUpManager.cjs +15 -7
  949. package/dist/production/src/model/service/SignUpManager.cjs.map +1 -1
  950. package/dist/production/src/model/service/SignUpManager.js +15 -7
  951. package/dist/production/src/model/service/SignUpManager.js.map +1 -1
  952. package/dist/production/src/model/service/apiKey/ApiKeyManager.cjs +56 -40
  953. package/dist/production/src/model/service/apiKey/ApiKeyManager.cjs.map +1 -1
  954. package/dist/production/src/model/service/apiKey/ApiKeyManager.js +57 -41
  955. package/dist/production/src/model/service/apiKey/ApiKeyManager.js.map +1 -1
  956. package/dist/production/src/model/service/apiKey/ApiKeyService.cjs.map +1 -1
  957. package/dist/production/src/model/service/apiKey/ApiKeyService.js.map +1 -1
  958. package/dist/production/src/model/service/apiKey/UnpersistedApiKeyManager.cjs +10 -1
  959. package/dist/production/src/model/service/apiKey/UnpersistedApiKeyManager.cjs.map +1 -1
  960. package/dist/production/src/model/service/apiKey/UnpersistedApiKeyManager.js +11 -2
  961. package/dist/production/src/model/service/apiKey/UnpersistedApiKeyManager.js.map +1 -1
  962. package/dist/production/src/model/service/idp/ClaimMapping.cjs +187 -0
  963. package/dist/production/src/model/service/idp/ClaimMapping.cjs.map +1 -0
  964. package/dist/production/src/model/service/idp/ClaimMapping.js +170 -0
  965. package/dist/production/src/model/service/idp/ClaimMapping.js.map +1 -0
  966. package/dist/production/src/model/service/idp/ClaimMappingEvaluator.cjs +155 -0
  967. package/dist/production/src/model/service/idp/ClaimMappingEvaluator.cjs.map +1 -0
  968. package/dist/production/src/model/service/idp/ClaimMappingEvaluator.js +155 -0
  969. package/dist/production/src/model/service/idp/ClaimMappingEvaluator.js.map +1 -0
  970. package/dist/production/src/model/service/idp/ClaimMappingValidation.cjs +83 -0
  971. package/dist/production/src/model/service/idp/ClaimMappingValidation.cjs.map +1 -0
  972. package/dist/production/src/model/service/idp/ClaimMappingValidation.js +83 -0
  973. package/dist/production/src/model/service/idp/ClaimMappingValidation.js.map +1 -0
  974. package/dist/production/src/model/service/idp/IDPClaimSyncService.cjs +261 -0
  975. package/dist/production/src/model/service/idp/IDPClaimSyncService.cjs.map +1 -0
  976. package/dist/production/src/model/service/idp/IDPClaimSyncService.js +261 -0
  977. package/dist/production/src/model/service/idp/IDPClaimSyncService.js.map +1 -0
  978. package/dist/production/src/model/service/idp/IDPManager.cjs +98 -21
  979. package/dist/production/src/model/service/idp/IDPManager.cjs.map +1 -1
  980. package/dist/production/src/model/service/idp/IDPManager.js +98 -21
  981. package/dist/production/src/model/service/idp/IDPManager.js.map +1 -1
  982. package/dist/production/src/model/service/idp/IdpSessionRevalidator.cjs +93 -28
  983. package/dist/production/src/model/service/idp/IdpSessionRevalidator.cjs.map +1 -1
  984. package/dist/production/src/model/service/idp/IdpSessionRevalidator.js +93 -28
  985. package/dist/production/src/model/service/idp/IdpSessionRevalidator.js.map +1 -1
  986. package/dist/production/src/model/service/idp/PersonIdentityProviderManager.cjs +8 -1
  987. package/dist/production/src/model/service/idp/PersonIdentityProviderManager.cjs.map +1 -1
  988. package/dist/production/src/model/service/idp/PersonIdentityProviderManager.js +8 -1
  989. package/dist/production/src/model/service/idp/PersonIdentityProviderManager.js.map +1 -1
  990. package/dist/production/src/model/service/idp/providers/OIDCHelpers.cjs +69 -33
  991. package/dist/production/src/model/service/idp/providers/OIDCHelpers.cjs.map +1 -1
  992. package/dist/production/src/model/service/idp/providers/OIDCHelpers.js +69 -33
  993. package/dist/production/src/model/service/idp/providers/OIDCHelpers.js.map +1 -1
  994. package/dist/production/src/model/service/idp/providers/OIDCProvider.cjs +4 -1
  995. package/dist/production/src/model/service/idp/providers/OIDCProvider.cjs.map +1 -1
  996. package/dist/production/src/model/service/idp/providers/OIDCProvider.js +4 -1
  997. package/dist/production/src/model/service/idp/providers/OIDCProvider.js.map +1 -1
  998. package/dist/production/src/model/utils/DatabaseContext.cjs +10 -3
  999. package/dist/production/src/model/utils/DatabaseContext.cjs.map +1 -1
  1000. package/dist/production/src/model/utils/DatabaseContext.js +11 -4
  1001. package/dist/production/src/model/utils/DatabaseContext.js.map +1 -1
  1002. package/dist/production/src/model/utils/token.cjs +2 -2
  1003. package/dist/production/src/model/utils/token.cjs.map +1 -1
  1004. package/dist/production/src/model/utils/token.js +2 -2
  1005. package/dist/production/src/model/utils/token.js.map +1 -1
  1006. package/dist/production/src/resolvers/ResolverFactory.cjs +12 -3
  1007. package/dist/production/src/resolvers/ResolverFactory.cjs.map +1 -1
  1008. package/dist/production/src/resolvers/ResolverFactory.js +12 -3
  1009. package/dist/production/src/resolvers/ResolverFactory.js.map +1 -1
  1010. package/dist/production/src/resolvers/TenantResolverContextFactory.cjs +4 -4
  1011. package/dist/production/src/resolvers/TenantResolverContextFactory.cjs.map +1 -1
  1012. package/dist/production/src/resolvers/TenantResolverContextFactory.js +4 -4
  1013. package/dist/production/src/resolvers/TenantResolverContextFactory.js.map +1 -1
  1014. package/dist/production/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.cjs +19 -9
  1015. package/dist/production/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.cjs.map +1 -1
  1016. package/dist/production/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.js +20 -10
  1017. package/dist/production/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.js.map +1 -1
  1018. package/dist/production/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.cjs +7 -5
  1019. package/dist/production/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.cjs.map +1 -1
  1020. package/dist/production/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.js +7 -5
  1021. package/dist/production/src/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.js.map +1 -1
  1022. package/dist/production/src/resolvers/mutation/configuration/AuthPolicyMutationResolver.cjs +7 -5
  1023. package/dist/production/src/resolvers/mutation/configuration/AuthPolicyMutationResolver.cjs.map +1 -1
  1024. package/dist/production/src/resolvers/mutation/configuration/AuthPolicyMutationResolver.js +7 -5
  1025. package/dist/production/src/resolvers/mutation/configuration/AuthPolicyMutationResolver.js.map +1 -1
  1026. package/dist/production/src/resolvers/mutation/configuration/ConfigurationMutationResolver.cjs +7 -5
  1027. package/dist/production/src/resolvers/mutation/configuration/ConfigurationMutationResolver.cjs.map +1 -1
  1028. package/dist/production/src/resolvers/mutation/configuration/ConfigurationMutationResolver.js +7 -5
  1029. package/dist/production/src/resolvers/mutation/configuration/ConfigurationMutationResolver.js.map +1 -1
  1030. package/dist/production/src/resolvers/mutation/customRole/CustomRoleMutationResolver.cjs +124 -0
  1031. package/dist/production/src/resolvers/mutation/customRole/CustomRoleMutationResolver.cjs.map +1 -0
  1032. package/dist/production/src/resolvers/mutation/customRole/CustomRoleMutationResolver.js +124 -0
  1033. package/dist/production/src/resolvers/mutation/customRole/CustomRoleMutationResolver.js.map +1 -0
  1034. package/dist/production/src/resolvers/mutation/identity/GlobalRolesMutationResolver.cjs +35 -11
  1035. package/dist/production/src/resolvers/mutation/identity/GlobalRolesMutationResolver.cjs.map +1 -1
  1036. package/dist/production/src/resolvers/mutation/identity/GlobalRolesMutationResolver.js +35 -11
  1037. package/dist/production/src/resolvers/mutation/identity/GlobalRolesMutationResolver.js.map +1 -1
  1038. package/dist/production/src/resolvers/mutation/idp/AddIDPMutationResolver.cjs +10 -7
  1039. package/dist/production/src/resolvers/mutation/idp/AddIDPMutationResolver.cjs.map +1 -1
  1040. package/dist/production/src/resolvers/mutation/idp/AddIDPMutationResolver.js +10 -7
  1041. package/dist/production/src/resolvers/mutation/idp/AddIDPMutationResolver.js.map +1 -1
  1042. package/dist/production/src/resolvers/mutation/idp/DisableIDPMutationResolver.cjs +7 -5
  1043. package/dist/production/src/resolvers/mutation/idp/DisableIDPMutationResolver.cjs.map +1 -1
  1044. package/dist/production/src/resolvers/mutation/idp/DisableIDPMutationResolver.js +7 -5
  1045. package/dist/production/src/resolvers/mutation/idp/DisableIDPMutationResolver.js.map +1 -1
  1046. package/dist/production/src/resolvers/mutation/idp/DisconnectMyIdentityProviderMutationResolver.cjs +8 -6
  1047. package/dist/production/src/resolvers/mutation/idp/DisconnectMyIdentityProviderMutationResolver.cjs.map +1 -1
  1048. package/dist/production/src/resolvers/mutation/idp/DisconnectMyIdentityProviderMutationResolver.js +8 -6
  1049. package/dist/production/src/resolvers/mutation/idp/DisconnectMyIdentityProviderMutationResolver.js.map +1 -1
  1050. package/dist/production/src/resolvers/mutation/idp/EnableIDPMutationResolver.cjs +7 -5
  1051. package/dist/production/src/resolvers/mutation/idp/EnableIDPMutationResolver.cjs.map +1 -1
  1052. package/dist/production/src/resolvers/mutation/idp/EnableIDPMutationResolver.js +7 -5
  1053. package/dist/production/src/resolvers/mutation/idp/EnableIDPMutationResolver.js.map +1 -1
  1054. package/dist/production/src/resolvers/mutation/idp/UpdateIDPMutationResolver.cjs +10 -7
  1055. package/dist/production/src/resolvers/mutation/idp/UpdateIDPMutationResolver.cjs.map +1 -1
  1056. package/dist/production/src/resolvers/mutation/idp/UpdateIDPMutationResolver.js +10 -7
  1057. package/dist/production/src/resolvers/mutation/idp/UpdateIDPMutationResolver.js.map +1 -1
  1058. package/dist/production/src/resolvers/mutation/idp/audit.cjs +1 -0
  1059. package/dist/production/src/resolvers/mutation/idp/audit.cjs.map +1 -1
  1060. package/dist/production/src/resolvers/mutation/idp/audit.js +1 -0
  1061. package/dist/production/src/resolvers/mutation/idp/audit.js.map +1 -1
  1062. package/dist/production/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.cjs +38 -18
  1063. package/dist/production/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.cjs.map +1 -1
  1064. package/dist/production/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.js +38 -18
  1065. package/dist/production/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.js.map +1 -1
  1066. package/dist/production/src/resolvers/mutation/person/ChangePasswordMutationResolver.cjs +10 -8
  1067. package/dist/production/src/resolvers/mutation/person/ChangePasswordMutationResolver.cjs.map +1 -1
  1068. package/dist/production/src/resolvers/mutation/person/ChangePasswordMutationResolver.js +10 -8
  1069. package/dist/production/src/resolvers/mutation/person/ChangePasswordMutationResolver.js.map +1 -1
  1070. package/dist/production/src/resolvers/mutation/person/ChangeProfileMutationResolver.cjs +17 -11
  1071. package/dist/production/src/resolvers/mutation/person/ChangeProfileMutationResolver.cjs.map +1 -1
  1072. package/dist/production/src/resolvers/mutation/person/ChangeProfileMutationResolver.js +17 -11
  1073. package/dist/production/src/resolvers/mutation/person/ChangeProfileMutationResolver.js.map +1 -1
  1074. package/dist/production/src/resolvers/mutation/person/DisablePersonMutationResolver.cjs +10 -8
  1075. package/dist/production/src/resolvers/mutation/person/DisablePersonMutationResolver.cjs.map +1 -1
  1076. package/dist/production/src/resolvers/mutation/person/DisablePersonMutationResolver.js +10 -8
  1077. package/dist/production/src/resolvers/mutation/person/DisablePersonMutationResolver.js.map +1 -1
  1078. package/dist/production/src/resolvers/mutation/person/EmailOtpMutationResolver.cjs +10 -8
  1079. package/dist/production/src/resolvers/mutation/person/EmailOtpMutationResolver.cjs.map +1 -1
  1080. package/dist/production/src/resolvers/mutation/person/EmailOtpMutationResolver.js +10 -8
  1081. package/dist/production/src/resolvers/mutation/person/EmailOtpMutationResolver.js.map +1 -1
  1082. package/dist/production/src/resolvers/mutation/person/EmailVerificationMutationResolver.cjs +10 -8
  1083. package/dist/production/src/resolvers/mutation/person/EmailVerificationMutationResolver.cjs.map +1 -1
  1084. package/dist/production/src/resolvers/mutation/person/EmailVerificationMutationResolver.js +10 -8
  1085. package/dist/production/src/resolvers/mutation/person/EmailVerificationMutationResolver.js.map +1 -1
  1086. package/dist/production/src/resolvers/mutation/person/EnablePersonMutationResolver.cjs +61 -0
  1087. package/dist/production/src/resolvers/mutation/person/EnablePersonMutationResolver.cjs.map +1 -0
  1088. package/dist/production/src/resolvers/mutation/person/EnablePersonMutationResolver.js +61 -0
  1089. package/dist/production/src/resolvers/mutation/person/EnablePersonMutationResolver.js.map +1 -0
  1090. package/dist/production/src/resolvers/mutation/person/ForceSignOutMutationResolver.cjs +8 -6
  1091. package/dist/production/src/resolvers/mutation/person/ForceSignOutMutationResolver.cjs.map +1 -1
  1092. package/dist/production/src/resolvers/mutation/person/ForceSignOutMutationResolver.js +8 -6
  1093. package/dist/production/src/resolvers/mutation/person/ForceSignOutMutationResolver.js.map +1 -1
  1094. package/dist/production/src/resolvers/mutation/person/IDPMutationResolver.cjs +32 -5
  1095. package/dist/production/src/resolvers/mutation/person/IDPMutationResolver.cjs.map +1 -1
  1096. package/dist/production/src/resolvers/mutation/person/IDPMutationResolver.js +32 -5
  1097. package/dist/production/src/resolvers/mutation/person/IDPMutationResolver.js.map +1 -1
  1098. package/dist/production/src/resolvers/mutation/person/InviteMutationResolver.cjs +7 -5
  1099. package/dist/production/src/resolvers/mutation/person/InviteMutationResolver.cjs.map +1 -1
  1100. package/dist/production/src/resolvers/mutation/person/InviteMutationResolver.js +7 -5
  1101. package/dist/production/src/resolvers/mutation/person/InviteMutationResolver.js.map +1 -1
  1102. package/dist/production/src/resolvers/mutation/person/OtpMutationResolver.cjs +9 -7
  1103. package/dist/production/src/resolvers/mutation/person/OtpMutationResolver.cjs.map +1 -1
  1104. package/dist/production/src/resolvers/mutation/person/OtpMutationResolver.js +9 -7
  1105. package/dist/production/src/resolvers/mutation/person/OtpMutationResolver.js.map +1 -1
  1106. package/dist/production/src/resolvers/mutation/person/PasswordlessMutationResolver.cjs +12 -6
  1107. package/dist/production/src/resolvers/mutation/person/PasswordlessMutationResolver.cjs.map +1 -1
  1108. package/dist/production/src/resolvers/mutation/person/PasswordlessMutationResolver.js +12 -6
  1109. package/dist/production/src/resolvers/mutation/person/PasswordlessMutationResolver.js.map +1 -1
  1110. package/dist/production/src/resolvers/mutation/person/RegenerateBackupCodesMutationResolver.cjs +9 -7
  1111. package/dist/production/src/resolvers/mutation/person/RegenerateBackupCodesMutationResolver.cjs.map +1 -1
  1112. package/dist/production/src/resolvers/mutation/person/RegenerateBackupCodesMutationResolver.js +9 -7
  1113. package/dist/production/src/resolvers/mutation/person/RegenerateBackupCodesMutationResolver.js.map +1 -1
  1114. package/dist/production/src/resolvers/mutation/person/ResetPasswordMutationResolver.cjs +10 -8
  1115. package/dist/production/src/resolvers/mutation/person/ResetPasswordMutationResolver.cjs.map +1 -1
  1116. package/dist/production/src/resolvers/mutation/person/ResetPasswordMutationResolver.js +10 -8
  1117. package/dist/production/src/resolvers/mutation/person/ResetPasswordMutationResolver.js.map +1 -1
  1118. package/dist/production/src/resolvers/mutation/person/ResetPersonMfaMutationResolver.cjs +8 -6
  1119. package/dist/production/src/resolvers/mutation/person/ResetPersonMfaMutationResolver.cjs.map +1 -1
  1120. package/dist/production/src/resolvers/mutation/person/ResetPersonMfaMutationResolver.js +8 -6
  1121. package/dist/production/src/resolvers/mutation/person/ResetPersonMfaMutationResolver.js.map +1 -1
  1122. package/dist/production/src/resolvers/mutation/person/RevokeSessionMutationResolver.cjs +8 -6
  1123. package/dist/production/src/resolvers/mutation/person/RevokeSessionMutationResolver.cjs.map +1 -1
  1124. package/dist/production/src/resolvers/mutation/person/RevokeSessionMutationResolver.js +8 -6
  1125. package/dist/production/src/resolvers/mutation/person/RevokeSessionMutationResolver.js.map +1 -1
  1126. package/dist/production/src/resolvers/mutation/person/SignInMutationResolver.cjs +22 -14
  1127. package/dist/production/src/resolvers/mutation/person/SignInMutationResolver.cjs.map +1 -1
  1128. package/dist/production/src/resolvers/mutation/person/SignInMutationResolver.js +22 -14
  1129. package/dist/production/src/resolvers/mutation/person/SignInMutationResolver.js.map +1 -1
  1130. package/dist/production/src/resolvers/mutation/person/SignOutMutationResolver.cjs +7 -5
  1131. package/dist/production/src/resolvers/mutation/person/SignOutMutationResolver.cjs.map +1 -1
  1132. package/dist/production/src/resolvers/mutation/person/SignOutMutationResolver.js +7 -5
  1133. package/dist/production/src/resolvers/mutation/person/SignOutMutationResolver.js.map +1 -1
  1134. package/dist/production/src/resolvers/mutation/person/SignUpMutationResolver.cjs +10 -8
  1135. package/dist/production/src/resolvers/mutation/person/SignUpMutationResolver.cjs.map +1 -1
  1136. package/dist/production/src/resolvers/mutation/person/SignUpMutationResolver.js +10 -8
  1137. package/dist/production/src/resolvers/mutation/person/SignUpMutationResolver.js.map +1 -1
  1138. package/dist/production/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.cjs +9 -7
  1139. package/dist/production/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.cjs.map +1 -1
  1140. package/dist/production/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.js +9 -7
  1141. package/dist/production/src/resolvers/mutation/person/TogglePasswordlessMutationResolver.js.map +1 -1
  1142. package/dist/production/src/resolvers/mutation/project/CreateProjectMutationResolver.cjs +7 -5
  1143. package/dist/production/src/resolvers/mutation/project/CreateProjectMutationResolver.cjs.map +1 -1
  1144. package/dist/production/src/resolvers/mutation/project/CreateProjectMutationResolver.js +7 -5
  1145. package/dist/production/src/resolvers/mutation/project/CreateProjectMutationResolver.js.map +1 -1
  1146. package/dist/production/src/resolvers/mutation/project/SetProjectSecretMutationResolver.cjs +7 -5
  1147. package/dist/production/src/resolvers/mutation/project/SetProjectSecretMutationResolver.cjs.map +1 -1
  1148. package/dist/production/src/resolvers/mutation/project/SetProjectSecretMutationResolver.js +7 -5
  1149. package/dist/production/src/resolvers/mutation/project/SetProjectSecretMutationResolver.js.map +1 -1
  1150. package/dist/production/src/resolvers/mutation/project/UpdateProjectMutationResolver.cjs +7 -5
  1151. package/dist/production/src/resolvers/mutation/project/UpdateProjectMutationResolver.cjs.map +1 -1
  1152. package/dist/production/src/resolvers/mutation/project/UpdateProjectMutationResolver.js +7 -5
  1153. package/dist/production/src/resolvers/mutation/project/UpdateProjectMutationResolver.js.map +1 -1
  1154. package/dist/production/src/resolvers/mutation/projectMember/AddProjectMemberMutationResolver.cjs +7 -5
  1155. package/dist/production/src/resolvers/mutation/projectMember/AddProjectMemberMutationResolver.cjs.map +1 -1
  1156. package/dist/production/src/resolvers/mutation/projectMember/AddProjectMemberMutationResolver.js +7 -5
  1157. package/dist/production/src/resolvers/mutation/projectMember/AddProjectMemberMutationResolver.js.map +1 -1
  1158. package/dist/production/src/resolvers/mutation/projectMember/RemoveProjectMemberMutationResolver.cjs +8 -6
  1159. package/dist/production/src/resolvers/mutation/projectMember/RemoveProjectMemberMutationResolver.cjs.map +1 -1
  1160. package/dist/production/src/resolvers/mutation/projectMember/RemoveProjectMemberMutationResolver.js +8 -6
  1161. package/dist/production/src/resolvers/mutation/projectMember/RemoveProjectMemberMutationResolver.js.map +1 -1
  1162. package/dist/production/src/resolvers/mutation/projectMember/UpdateProjectMemberMutationResolver.cjs +8 -6
  1163. package/dist/production/src/resolvers/mutation/projectMember/UpdateProjectMemberMutationResolver.cjs.map +1 -1
  1164. package/dist/production/src/resolvers/mutation/projectMember/UpdateProjectMemberMutationResolver.js +8 -6
  1165. package/dist/production/src/resolvers/mutation/projectMember/UpdateProjectMemberMutationResolver.js.map +1 -1
  1166. package/dist/production/src/resolvers/mutation/projectMember/audit.cjs +2 -1
  1167. package/dist/production/src/resolvers/mutation/projectMember/audit.cjs.map +1 -1
  1168. package/dist/production/src/resolvers/mutation/projectMember/audit.js +2 -1
  1169. package/dist/production/src/resolvers/mutation/projectMember/audit.js.map +1 -1
  1170. package/dist/production/src/resolvers/query/ApiKeyQueryResolver.cjs +8 -6
  1171. package/dist/production/src/resolvers/query/ApiKeyQueryResolver.cjs.map +1 -1
  1172. package/dist/production/src/resolvers/query/ApiKeyQueryResolver.js +8 -6
  1173. package/dist/production/src/resolvers/query/ApiKeyQueryResolver.js.map +1 -1
  1174. package/dist/production/src/resolvers/query/AuthLogQueryResolver.cjs +7 -5
  1175. package/dist/production/src/resolvers/query/AuthLogQueryResolver.cjs.map +1 -1
  1176. package/dist/production/src/resolvers/query/AuthLogQueryResolver.js +7 -5
  1177. package/dist/production/src/resolvers/query/AuthLogQueryResolver.js.map +1 -1
  1178. package/dist/production/src/resolvers/query/AuthPolicyQueryResolver.cjs +8 -6
  1179. package/dist/production/src/resolvers/query/AuthPolicyQueryResolver.cjs.map +1 -1
  1180. package/dist/production/src/resolvers/query/AuthPolicyQueryResolver.js +8 -6
  1181. package/dist/production/src/resolvers/query/AuthPolicyQueryResolver.js.map +1 -1
  1182. package/dist/production/src/resolvers/query/ConfigurationQueryResolver.cjs +8 -6
  1183. package/dist/production/src/resolvers/query/ConfigurationQueryResolver.cjs.map +1 -1
  1184. package/dist/production/src/resolvers/query/ConfigurationQueryResolver.js +8 -6
  1185. package/dist/production/src/resolvers/query/ConfigurationQueryResolver.js.map +1 -1
  1186. package/dist/production/src/resolvers/query/CustomRoleQueryResolver.cjs +55 -0
  1187. package/dist/production/src/resolvers/query/CustomRoleQueryResolver.cjs.map +1 -0
  1188. package/dist/production/src/resolvers/query/CustomRoleQueryResolver.js +55 -0
  1189. package/dist/production/src/resolvers/query/CustomRoleQueryResolver.js.map +1 -0
  1190. package/dist/production/src/resolvers/query/IDPQueryResolver.cjs +7 -5
  1191. package/dist/production/src/resolvers/query/IDPQueryResolver.cjs.map +1 -1
  1192. package/dist/production/src/resolvers/query/IDPQueryResolver.js +7 -5
  1193. package/dist/production/src/resolvers/query/IDPQueryResolver.js.map +1 -1
  1194. package/dist/production/src/resolvers/query/MailTemplateQueryResolver.cjs +21 -14
  1195. package/dist/production/src/resolvers/query/MailTemplateQueryResolver.cjs.map +1 -1
  1196. package/dist/production/src/resolvers/query/MailTemplateQueryResolver.js +21 -14
  1197. package/dist/production/src/resolvers/query/MailTemplateQueryResolver.js.map +1 -1
  1198. package/dist/production/src/resolvers/query/PersonQueryResolver.cjs +7 -5
  1199. package/dist/production/src/resolvers/query/PersonQueryResolver.cjs.map +1 -1
  1200. package/dist/production/src/resolvers/query/PersonQueryResolver.js +7 -5
  1201. package/dist/production/src/resolvers/query/PersonQueryResolver.js.map +1 -1
  1202. package/dist/production/src/resolvers/query/ProjectMembersQueryResolver.cjs +7 -5
  1203. package/dist/production/src/resolvers/query/ProjectMembersQueryResolver.cjs.map +1 -1
  1204. package/dist/production/src/resolvers/query/ProjectMembersQueryResolver.js +7 -5
  1205. package/dist/production/src/resolvers/query/ProjectMembersQueryResolver.js.map +1 -1
  1206. package/dist/production/src/resolvers/query/ProjectQueryResolver.cjs +10 -7
  1207. package/dist/production/src/resolvers/query/ProjectQueryResolver.cjs.map +1 -1
  1208. package/dist/production/src/resolvers/query/ProjectQueryResolver.js +10 -7
  1209. package/dist/production/src/resolvers/query/ProjectQueryResolver.js.map +1 -1
  1210. package/dist/production/src/resolvers/responseHelpers/ApiKeyResponseFactory.cjs +7 -5
  1211. package/dist/production/src/resolvers/responseHelpers/ApiKeyResponseFactory.cjs.map +1 -1
  1212. package/dist/production/src/resolvers/responseHelpers/ApiKeyResponseFactory.js +7 -5
  1213. package/dist/production/src/resolvers/responseHelpers/ApiKeyResponseFactory.js.map +1 -1
  1214. package/dist/production/src/resolvers/responseHelpers/PersonResponseFactory.cjs +5 -0
  1215. package/dist/production/src/resolvers/responseHelpers/PersonResponseFactory.cjs.map +1 -1
  1216. package/dist/production/src/resolvers/responseHelpers/PersonResponseFactory.js +5 -0
  1217. package/dist/production/src/resolvers/responseHelpers/PersonResponseFactory.js.map +1 -1
  1218. package/dist/production/src/resolvers/responseHelpers/ProjectResponseFactory.cjs +23 -0
  1219. package/dist/production/src/resolvers/responseHelpers/ProjectResponseFactory.cjs.map +1 -0
  1220. package/dist/production/src/resolvers/responseHelpers/ProjectResponseFactory.js +23 -0
  1221. package/dist/production/src/resolvers/responseHelpers/ProjectResponseFactory.js.map +1 -0
  1222. package/dist/production/src/resolvers/responseHelpers/SignInResponseFactory.cjs +8 -6
  1223. package/dist/production/src/resolvers/responseHelpers/SignInResponseFactory.cjs.map +1 -1
  1224. package/dist/production/src/resolvers/responseHelpers/SignInResponseFactory.js +8 -6
  1225. package/dist/production/src/resolvers/responseHelpers/SignInResponseFactory.js.map +1 -1
  1226. package/dist/production/src/resolvers/types/IdentityTypeResolver.cjs +50 -18
  1227. package/dist/production/src/resolvers/types/IdentityTypeResolver.cjs.map +1 -1
  1228. package/dist/production/src/resolvers/types/IdentityTypeResolver.js +50 -18
  1229. package/dist/production/src/resolvers/types/IdentityTypeResolver.js.map +1 -1
  1230. package/dist/production/src/resolvers/types/PersonTypeResolver.cjs +38 -8
  1231. package/dist/production/src/resolvers/types/PersonTypeResolver.cjs.map +1 -1
  1232. package/dist/production/src/resolvers/types/PersonTypeResolver.js +38 -8
  1233. package/dist/production/src/resolvers/types/PersonTypeResolver.js.map +1 -1
  1234. package/dist/production/src/resolvers/types/ProjectTypeResolver.cjs +31 -6
  1235. package/dist/production/src/resolvers/types/ProjectTypeResolver.cjs.map +1 -1
  1236. package/dist/production/src/resolvers/types/ProjectTypeResolver.js +31 -6
  1237. package/dist/production/src/resolvers/types/ProjectTypeResolver.js.map +1 -1
  1238. package/dist/production/src/schema/tenant.graphql.cjs +275 -15
  1239. package/dist/production/src/schema/tenant.graphql.cjs.map +1 -1
  1240. package/dist/production/src/schema/tenant.graphql.js +275 -15
  1241. package/dist/production/src/schema/tenant.graphql.js.map +1 -1
  1242. package/dist/tests/cases/integration/database/dbClock.test.d.ts +2 -0
  1243. package/dist/tests/cases/integration/database/dbClock.test.d.ts.map +1 -0
  1244. package/dist/tests/cases/integration/mocked/configurationPanel.test.d.ts +2 -0
  1245. package/dist/tests/cases/integration/mocked/configurationPanel.test.d.ts.map +1 -0
  1246. package/dist/tests/cases/integration/mocked/customRoleCrud.test.d.ts +2 -0
  1247. package/dist/tests/cases/integration/mocked/customRoleCrud.test.d.ts.map +1 -0
  1248. package/dist/tests/cases/integration/mocked/disablePersonMutation.test.d.ts +2 -0
  1249. package/dist/tests/cases/integration/mocked/disablePersonMutation.test.d.ts.map +1 -0
  1250. package/dist/tests/cases/integration/mocked/enablePersonMutation.test.d.ts +2 -0
  1251. package/dist/tests/cases/integration/mocked/enablePersonMutation.test.d.ts.map +1 -0
  1252. package/dist/tests/cases/integration/mocked/gql/addProjectMember.d.ts.map +1 -1
  1253. package/dist/tests/cases/integration/mocked/gql/changeMyPassword.d.ts.map +1 -1
  1254. package/dist/tests/cases/integration/mocked/gql/changeMyProfile.d.ts.map +1 -1
  1255. package/dist/tests/cases/integration/mocked/gql/changePassword.d.ts.map +1 -1
  1256. package/dist/tests/cases/integration/mocked/gql/changeProfile.d.ts.map +1 -1
  1257. package/dist/tests/cases/integration/mocked/gql/confirmOtp.d.ts.map +1 -1
  1258. package/dist/tests/cases/integration/mocked/gql/createApiKey.d.ts.map +1 -1
  1259. package/dist/tests/cases/integration/mocked/gql/createResetPasswordRequest.d.ts.map +1 -1
  1260. package/dist/tests/cases/integration/mocked/gql/createSessionToken.d.ts.map +1 -1
  1261. package/dist/tests/cases/integration/mocked/gql/emailOtp.d.ts.map +1 -1
  1262. package/dist/tests/cases/integration/mocked/gql/emailVerification.d.ts.map +1 -1
  1263. package/dist/tests/cases/integration/mocked/gql/invite.d.ts.map +1 -1
  1264. package/dist/tests/cases/integration/mocked/gql/myIdentityProviders.d.ts.map +1 -1
  1265. package/dist/tests/cases/integration/mocked/gql/passwordless.d.ts +4 -1
  1266. package/dist/tests/cases/integration/mocked/gql/passwordless.d.ts.map +1 -1
  1267. package/dist/tests/cases/integration/mocked/gql/prepareOtp.d.ts.map +1 -1
  1268. package/dist/tests/cases/integration/mocked/gql/resetPassword.d.ts.map +1 -1
  1269. package/dist/tests/cases/integration/mocked/gql/signIn.d.ts.map +1 -1
  1270. package/dist/tests/cases/integration/mocked/gql/signInIdp.d.ts.map +1 -1
  1271. package/dist/tests/cases/integration/mocked/gql/signUp.d.ts.map +1 -1
  1272. package/dist/tests/cases/integration/mocked/gql/unmanagedInvite.d.ts.map +1 -1
  1273. package/dist/tests/cases/integration/mocked/gql/updateProjectMember.d.ts.map +1 -1
  1274. package/dist/tests/cases/integration/mocked/idpClaimMappingConfig.test.d.ts +2 -0
  1275. package/dist/tests/cases/integration/mocked/idpClaimMappingConfig.test.d.ts.map +1 -0
  1276. package/dist/tests/cases/integration/mocked/localAuthenticationDisabled.test.d.ts +2 -0
  1277. package/dist/tests/cases/integration/mocked/localAuthenticationDisabled.test.d.ts.map +1 -0
  1278. package/dist/tests/cases/integration/mocked/mailTemplateScope.test.d.ts +2 -0
  1279. package/dist/tests/cases/integration/mocked/mailTemplateScope.test.d.ts.map +1 -0
  1280. package/dist/tests/cases/integration/mocked/permissionsQuery.test.d.ts +2 -0
  1281. package/dist/tests/cases/integration/mocked/permissionsQuery.test.d.ts.map +1 -0
  1282. package/dist/tests/cases/integration/mocked/signInIdpClaimMapping.test.d.ts +2 -0
  1283. package/dist/tests/cases/integration/mocked/signInIdpClaimMapping.test.d.ts.map +1 -0
  1284. package/dist/tests/cases/integration/mocked/signInIdpClaimMappingFixes.test.d.ts +2 -0
  1285. package/dist/tests/cases/integration/mocked/signInIdpClaimMappingFixes.test.d.ts.map +1 -0
  1286. package/dist/tests/cases/integration/mocked/signInIdpClaimMappingSafety.test.d.ts +2 -0
  1287. package/dist/tests/cases/integration/mocked/signInIdpClaimMappingSafety.test.d.ts.map +1 -0
  1288. package/dist/tests/cases/integration/mocked/sql/authLogSql.d.ts.map +1 -1
  1289. package/dist/tests/cases/integration/mocked/sql/authPolicySql.d.ts.map +1 -1
  1290. package/dist/tests/cases/integration/mocked/sql/consumeBackupCodeSql.d.ts.map +1 -1
  1291. package/dist/tests/cases/integration/mocked/sql/createApiKeySql.d.ts.map +1 -1
  1292. package/dist/tests/cases/integration/mocked/sql/createIdentitySql.d.ts.map +1 -1
  1293. package/dist/tests/cases/integration/mocked/sql/createMembershipSql.d.ts.map +1 -1
  1294. package/dist/tests/cases/integration/mocked/sql/createMembershipVariableSql.d.ts.map +1 -1
  1295. package/dist/tests/cases/integration/mocked/sql/createPersonSql.d.ts.map +1 -1
  1296. package/dist/tests/cases/integration/mocked/sql/createPersonTokenSql.d.ts.map +1 -1
  1297. package/dist/tests/cases/integration/mocked/sql/createSessionKeySql.d.ts.map +1 -1
  1298. package/dist/tests/cases/integration/mocked/sql/disableApiKeySql.d.ts.map +1 -1
  1299. package/dist/tests/cases/integration/mocked/sql/disableOneOffKeySql.d.ts.map +1 -1
  1300. package/dist/tests/cases/integration/mocked/sql/emailOtpSql.d.ts.map +1 -1
  1301. package/dist/tests/cases/integration/mocked/sql/generateBackupCodesSql.d.ts.map +1 -1
  1302. package/dist/tests/cases/integration/mocked/sql/getApiKeySql.d.ts.map +1 -1
  1303. package/dist/tests/cases/integration/mocked/sql/getConfigSql.d.ts.map +1 -1
  1304. package/dist/tests/cases/integration/mocked/sql/getCustomRolesSql.d.ts +18 -0
  1305. package/dist/tests/cases/integration/mocked/sql/getCustomRolesSql.d.ts.map +1 -0
  1306. package/dist/tests/cases/integration/mocked/sql/getIdentityByIdSql.d.ts.map +1 -1
  1307. package/dist/tests/cases/integration/mocked/sql/getIdentityProjectMembershipPresenceSql.d.ts +3 -0
  1308. package/dist/tests/cases/integration/mocked/sql/getIdentityProjectMembershipPresenceSql.d.ts.map +1 -0
  1309. package/dist/tests/cases/integration/mocked/sql/getIdentityProjectsSql.d.ts.map +1 -1
  1310. package/dist/tests/cases/integration/mocked/sql/getIdpBySlugSql.d.ts.map +1 -1
  1311. package/dist/tests/cases/integration/mocked/sql/getIdpSessionByApiKeySql.d.ts.map +1 -1
  1312. package/dist/tests/cases/integration/mocked/sql/getMailTemplateSql.d.ts.map +1 -1
  1313. package/dist/tests/cases/integration/mocked/sql/getNextLoginAttemptSql.d.ts.map +1 -1
  1314. package/dist/tests/cases/integration/mocked/sql/getNextMailAttemptSql.d.ts +1 -1
  1315. package/dist/tests/cases/integration/mocked/sql/getNextMailAttemptSql.d.ts.map +1 -1
  1316. package/dist/tests/cases/integration/mocked/sql/getPersonByEmailSql.d.ts +1 -0
  1317. package/dist/tests/cases/integration/mocked/sql/getPersonByEmailSql.d.ts.map +1 -1
  1318. package/dist/tests/cases/integration/mocked/sql/getPersonByIdSql.d.ts.map +1 -1
  1319. package/dist/tests/cases/integration/mocked/sql/getPersonByIdentity.d.ts.map +1 -1
  1320. package/dist/tests/cases/integration/mocked/sql/getPersonByIdpSql.d.ts.map +1 -1
  1321. package/dist/tests/cases/integration/mocked/sql/getPersonsByIdentitySql.d.ts.map +1 -1
  1322. package/dist/tests/cases/integration/mocked/sql/getProjectBySlugSql.d.ts +1 -1
  1323. package/dist/tests/cases/integration/mocked/sql/getProjectBySlugSql.d.ts.map +1 -1
  1324. package/dist/tests/cases/integration/mocked/sql/getProjectMembershipSql.d.ts.map +1 -1
  1325. package/dist/tests/cases/integration/mocked/sql/listApiKeysSql.d.ts.map +1 -1
  1326. package/dist/tests/cases/integration/mocked/sql/listPersonsSql.d.ts +2 -0
  1327. package/dist/tests/cases/integration/mocked/sql/listPersonsSql.d.ts.map +1 -1
  1328. package/dist/tests/cases/integration/mocked/sql/listProjectSecretsSql.d.ts.map +1 -1
  1329. package/dist/tests/cases/integration/mocked/sql/listSessionsSql.d.ts +1 -1
  1330. package/dist/tests/cases/integration/mocked/sql/listSessionsSql.d.ts.map +1 -1
  1331. package/dist/tests/cases/integration/mocked/sql/localAuthDisablingIdpsSql.d.ts +10 -0
  1332. package/dist/tests/cases/integration/mocked/sql/localAuthDisablingIdpsSql.d.ts.map +1 -0
  1333. package/dist/tests/cases/integration/mocked/sql/loginHistorySql.d.ts.map +1 -1
  1334. package/dist/tests/cases/integration/mocked/sql/patchVariablesSql.d.ts.map +1 -1
  1335. package/dist/tests/cases/integration/mocked/sql/personIdentityProvidersSql.d.ts +1 -0
  1336. package/dist/tests/cases/integration/mocked/sql/personIdentityProvidersSql.d.ts.map +1 -1
  1337. package/dist/tests/cases/integration/mocked/sql/removeMembershipSql.d.ts +8 -0
  1338. package/dist/tests/cases/integration/mocked/sql/removeMembershipSql.d.ts.map +1 -0
  1339. package/dist/tests/cases/integration/mocked/sql/selectMembershipsSql.d.ts.map +1 -1
  1340. package/dist/tests/cases/integration/mocked/sql/setEmailOtpEnabledSql.d.ts.map +1 -1
  1341. package/dist/tests/cases/integration/mocked/sql/sqlTransaction.d.ts +6 -0
  1342. package/dist/tests/cases/integration/mocked/sql/sqlTransaction.d.ts.map +1 -1
  1343. package/dist/tests/cases/integration/mocked/sql/updatePesonNameSql.d.ts.map +1 -1
  1344. package/dist/tests/cases/integration/mocked/sql/updatePesonPasswordSql.d.ts.map +1 -1
  1345. package/dist/tests/cases/unit/apiKey/verifyAndProlongReplica.test.d.ts +2 -0
  1346. package/dist/tests/cases/unit/apiKey/verifyAndProlongReplica.test.d.ts.map +1 -0
  1347. package/dist/tests/cases/unit/customRoleAuthorizator.test.d.ts +2 -0
  1348. package/dist/tests/cases/unit/customRoleAuthorizator.test.d.ts.map +1 -0
  1349. package/dist/tests/cases/unit/customRolePermissions.test.d.ts +2 -0
  1350. package/dist/tests/cases/unit/customRolePermissions.test.d.ts.map +1 -0
  1351. package/dist/tests/cases/unit/databaseContextRetry.test.d.ts +2 -0
  1352. package/dist/tests/cases/unit/databaseContextRetry.test.d.ts.map +1 -0
  1353. package/dist/tests/cases/unit/idp/claimIdpRevalidation.test.d.ts +2 -0
  1354. package/dist/tests/cases/unit/idp/claimIdpRevalidation.test.d.ts.map +1 -0
  1355. package/dist/tests/cases/unit/idp/claimMappingEvaluator.test.d.ts +2 -0
  1356. package/dist/tests/cases/unit/idp/claimMappingEvaluator.test.d.ts.map +1 -0
  1357. package/dist/tests/cases/unit/idp/claimMappingValidation.test.d.ts +2 -0
  1358. package/dist/tests/cases/unit/idp/claimMappingValidation.test.d.ts.map +1 -0
  1359. package/dist/tests/cases/unit/idp/idpManagerConfigMerge.test.d.ts +2 -0
  1360. package/dist/tests/cases/unit/idp/idpManagerConfigMerge.test.d.ts.map +1 -0
  1361. package/dist/tests/cases/unit/idp/idpManagerUnknownConfigKeys.test.d.ts +2 -0
  1362. package/dist/tests/cases/unit/idp/idpManagerUnknownConfigKeys.test.d.ts.map +1 -0
  1363. package/dist/tests/cases/unit/idp/oidcClaims.test.d.ts +2 -0
  1364. package/dist/tests/cases/unit/idp/oidcClaims.test.d.ts.map +1 -0
  1365. package/dist/tests/cases/unit/panelAccessResolver.test.d.ts +2 -0
  1366. package/dist/tests/cases/unit/panelAccessResolver.test.d.ts.map +1 -0
  1367. package/dist/tests/cases/unit/savePersonTokenCommand.test.d.ts +2 -0
  1368. package/dist/tests/cases/unit/savePersonTokenCommand.test.d.ts.map +1 -0
  1369. package/dist/tests/cases/unit/updateConfigurationCommand.test.d.ts +2 -0
  1370. package/dist/tests/cases/unit/updateConfigurationCommand.test.d.ts.map +1 -0
  1371. package/dist/tests/src/IdPMock.d.ts.map +1 -1
  1372. package/dist/tests/src/dbUtils.d.ts.map +1 -1
  1373. package/dist/tests/src/tags.d.ts.map +1 -1
  1374. package/dist/tests/src/testGraphql.d.ts.map +1 -1
  1375. package/dist/tests/src/testTenant.d.ts +16 -4
  1376. package/dist/tests/src/testTenant.d.ts.map +1 -1
  1377. package/dist/tests/src/testUuid.d.ts.map +1 -1
  1378. package/dist/tests/tsconfig.tsbuildinfo +1 -1
  1379. package/dist/types/TenantContainer.d.ts +36 -13
  1380. package/dist/types/TenantContainer.d.ts.map +1 -1
  1381. package/dist/types/bridges/system/IdentityFetcher.d.ts +2 -2
  1382. package/dist/types/bridges/system/IdentityFetcher.d.ts.map +1 -1
  1383. package/dist/types/exceptions.d.ts.map +1 -1
  1384. package/dist/types/migrations/2026-06-18-120000-idp-claim-mapping.d.ts +3 -0
  1385. package/dist/types/migrations/2026-06-18-120000-idp-claim-mapping.d.ts.map +1 -0
  1386. package/dist/types/migrations/2026-08-03-120000-person-enable-auth-log.d.ts +3 -0
  1387. package/dist/types/migrations/2026-08-03-120000-person-enable-auth-log.d.ts.map +1 -0
  1388. package/dist/types/migrations/2026-08-04-120000-config-panel.d.ts +3 -0
  1389. package/dist/types/migrations/2026-08-04-120000-config-panel.d.ts.map +1 -0
  1390. package/dist/types/migrations/2026-09-04-120000-idp-disable-local-authentication.d.ts +3 -0
  1391. package/dist/types/migrations/2026-09-04-120000-idp-disable-local-authentication.d.ts.map +1 -0
  1392. package/dist/types/migrations/2026-09-11-120000-custom-role.d.ts +3 -0
  1393. package/dist/types/migrations/2026-09-11-120000-custom-role.d.ts.map +1 -0
  1394. package/dist/types/migrations/runner.d.ts.map +1 -1
  1395. package/dist/types/migrations/snapshot-factory.d.ts.map +1 -1
  1396. package/dist/types/migrations/snapshot.d.ts.map +1 -1
  1397. package/dist/types/migrations/tenantCredentials.d.ts.map +1 -1
  1398. package/dist/types/model/authorization/AclSchemaAccessNodeFactory.d.ts.map +1 -1
  1399. package/dist/types/model/authorization/CustomRoleAuthorizator.d.ts +29 -0
  1400. package/dist/types/model/authorization/CustomRoleAuthorizator.d.ts.map +1 -0
  1401. package/dist/types/model/authorization/CustomRolePermissions.d.ts +45 -0
  1402. package/dist/types/model/authorization/CustomRolePermissions.d.ts.map +1 -0
  1403. package/dist/types/model/authorization/DirectPermissionsAccessNode.d.ts.map +1 -1
  1404. package/dist/types/model/authorization/Identity.d.ts.map +1 -1
  1405. package/dist/types/model/authorization/IdentityFactory.d.ts.map +1 -1
  1406. package/dist/types/model/authorization/IdentityScope.d.ts.map +1 -1
  1407. package/dist/types/model/authorization/MembershipMatcher.d.ts.map +1 -1
  1408. package/dist/types/model/authorization/PermissionActions.d.ts +104 -37
  1409. package/dist/types/model/authorization/PermissionActions.d.ts.map +1 -1
  1410. package/dist/types/model/authorization/PermissionContext.d.ts.map +1 -1
  1411. package/dist/types/model/authorization/PermissionContextFactory.d.ts +13 -2
  1412. package/dist/types/model/authorization/PermissionContextFactory.d.ts.map +1 -1
  1413. package/dist/types/model/authorization/PermissionsFactory.d.ts.map +1 -1
  1414. package/dist/types/model/authorization/ProjectScope.d.ts.map +1 -1
  1415. package/dist/types/model/authorization/ProjectScopeFactory.d.ts.map +1 -1
  1416. package/dist/types/model/authorization/Roles.d.ts +8 -0
  1417. package/dist/types/model/authorization/Roles.d.ts.map +1 -1
  1418. package/dist/types/model/authorization/TargetIdentityPermission.d.ts +15 -0
  1419. package/dist/types/model/authorization/TargetIdentityPermission.d.ts.map +1 -0
  1420. package/dist/types/model/authorization/index.d.ts +3 -0
  1421. package/dist/types/model/authorization/index.d.ts.map +1 -1
  1422. package/dist/types/model/commands/CommandBus.d.ts.map +1 -1
  1423. package/dist/types/model/commands/apiKey/ApiKeyHelper.d.ts +15 -0
  1424. package/dist/types/model/commands/apiKey/ApiKeyHelper.d.ts.map +1 -1
  1425. package/dist/types/model/commands/apiKey/CreateApiKeyCommand.d.ts +5 -1
  1426. package/dist/types/model/commands/apiKey/CreateApiKeyCommand.d.ts.map +1 -1
  1427. package/dist/types/model/commands/apiKey/DisableApiKeyCommand.d.ts.map +1 -1
  1428. package/dist/types/model/commands/apiKey/DisableIdentityApiKeysCommand.d.ts.map +1 -1
  1429. package/dist/types/model/commands/apiKey/DisableOneOffApiKeyCommand.d.ts.map +1 -1
  1430. package/dist/types/model/commands/apiKey/ProlongApiKeyCommand.d.ts +6 -4
  1431. package/dist/types/model/commands/apiKey/ProlongApiKeyCommand.d.ts.map +1 -1
  1432. package/dist/types/model/commands/authLog/CreateAuthLogEntryCommand.d.ts +1 -0
  1433. package/dist/types/model/commands/authLog/CreateAuthLogEntryCommand.d.ts.map +1 -1
  1434. package/dist/types/model/commands/authPolicy/CreateAuthPolicyCommand.d.ts.map +1 -1
  1435. package/dist/types/model/commands/authPolicy/DeleteAuthPolicyCommand.d.ts.map +1 -1
  1436. package/dist/types/model/commands/authPolicy/UpdateAuthPolicyCommand.d.ts.map +1 -1
  1437. package/dist/types/model/commands/backupCode/ConsumeBackupCodeCommand.d.ts.map +1 -1
  1438. package/dist/types/model/commands/backupCode/CreateBackupCodeCommand.d.ts.map +1 -1
  1439. package/dist/types/model/commands/backupCode/DeleteBackupCodesCommand.d.ts.map +1 -1
  1440. package/dist/types/model/commands/configuration/UpdateConfigurationCommand.d.ts.map +1 -1
  1441. package/dist/types/model/commands/customRole/CreateCustomRoleCommand.d.ts +12 -0
  1442. package/dist/types/model/commands/customRole/CreateCustomRoleCommand.d.ts.map +1 -0
  1443. package/dist/types/model/commands/customRole/DeleteCustomRoleCommand.d.ts +13 -0
  1444. package/dist/types/model/commands/customRole/DeleteCustomRoleCommand.d.ts.map +1 -0
  1445. package/dist/types/model/commands/customRole/RemoveCustomRoleAssignmentsCommand.d.ts +8 -0
  1446. package/dist/types/model/commands/customRole/RemoveCustomRoleAssignmentsCommand.d.ts.map +1 -0
  1447. package/dist/types/model/commands/customRole/UpdateCustomRoleCommand.d.ts +16 -0
  1448. package/dist/types/model/commands/customRole/UpdateCustomRoleCommand.d.ts.map +1 -0
  1449. package/dist/types/model/commands/customRole/index.d.ts +5 -0
  1450. package/dist/types/model/commands/customRole/index.d.ts.map +1 -0
  1451. package/dist/types/model/commands/identity/CreateIdentityCommand.d.ts.map +1 -1
  1452. package/dist/types/model/commands/identity/PatchIdentityGlobalRoles.d.ts.map +1 -1
  1453. package/dist/types/model/commands/idp/ClaimIdpRevalidationCommand.d.ts.map +1 -1
  1454. package/dist/types/model/commands/idp/CreateIdpCommand.d.ts.map +1 -1
  1455. package/dist/types/model/commands/idp/CreateIdpSessionCommand.d.ts.map +1 -1
  1456. package/dist/types/model/commands/idp/DisableIdpCommand.d.ts.map +1 -1
  1457. package/dist/types/model/commands/idp/DisconnectPersonIdentityProviderCommand.d.ts.map +1 -1
  1458. package/dist/types/model/commands/idp/EnableIdpCommand.d.ts.map +1 -1
  1459. package/dist/types/model/commands/idp/UpdateIdpCommand.d.ts.map +1 -1
  1460. package/dist/types/model/commands/idp/UpdateIdpSessionCommand.d.ts.map +1 -1
  1461. package/dist/types/model/commands/index.d.ts +1 -0
  1462. package/dist/types/model/commands/index.d.ts.map +1 -1
  1463. package/dist/types/model/commands/mailTemplate/AddMailTemplateCommand.d.ts.map +1 -1
  1464. package/dist/types/model/commands/mailTemplate/RemoveMailTemplateCommand.d.ts.map +1 -1
  1465. package/dist/types/model/commands/membership/AddProjectMemberCommand.d.ts.map +1 -1
  1466. package/dist/types/model/commands/membership/CreateOrUpdateProjectMembershipCommand.d.ts.map +1 -1
  1467. package/dist/types/model/commands/membership/RemoveProjectMemberCommand.d.ts.map +1 -1
  1468. package/dist/types/model/commands/membership/{RemoveProjectMembershipsCommand.d.ts → RemoveProjectMembershipCommand.d.ts} +1 -1
  1469. package/dist/types/model/commands/membership/RemoveProjectMembershipCommand.d.ts.map +1 -0
  1470. package/dist/types/model/commands/membership/UpdateProjectMemberCommand.d.ts.map +1 -1
  1471. package/dist/types/model/commands/membership/index.d.ts +2 -1
  1472. package/dist/types/model/commands/membership/index.d.ts.map +1 -1
  1473. package/dist/types/model/commands/membership/variables/PatchProjectMembershipVariableValuesCommand.d.ts.map +1 -1
  1474. package/dist/types/model/commands/membership/variables/PatchProjectMembershipVariablesCommand.d.ts.map +1 -1
  1475. package/dist/types/model/commands/membership/variables/SetProjectMembershipVariableValuesCommand.d.ts.map +1 -1
  1476. package/dist/types/model/commands/membership/variables/index.d.ts +1 -0
  1477. package/dist/types/model/commands/membership/variables/index.d.ts.map +1 -1
  1478. package/dist/types/model/commands/otp/ConfirmOtpCommand.d.ts.map +1 -1
  1479. package/dist/types/model/commands/otp/DisableOtpCommand.d.ts.map +1 -1
  1480. package/dist/types/model/commands/otp/PrepareOtpCommand.d.ts.map +1 -1
  1481. package/dist/types/model/commands/otp/ReEncryptOtpSecretCommand.d.ts.map +1 -1
  1482. package/dist/types/model/commands/otp/SetEmailOtpEnabledCommand.d.ts.map +1 -1
  1483. package/dist/types/model/commands/person/ChangePasswordCommand.d.ts.map +1 -1
  1484. package/dist/types/model/commands/person/ChangeProfileCommand.d.ts.map +1 -1
  1485. package/dist/types/model/commands/person/CreatePersonCommand.d.ts.map +1 -1
  1486. package/dist/types/model/commands/person/CreatePersonIdentityProviderIdentifierCommand.d.ts.map +1 -1
  1487. package/dist/types/model/commands/person/DisablePersonCommand.d.ts.map +1 -1
  1488. package/dist/types/model/commands/person/EnablePersonCommand.d.ts +7 -0
  1489. package/dist/types/model/commands/person/EnablePersonCommand.d.ts.map +1 -0
  1490. package/dist/types/model/commands/person/MarkEmailVerifiedCommand.d.ts.map +1 -1
  1491. package/dist/types/model/commands/person/ResetPersonMfaCommand.d.ts.map +1 -1
  1492. package/dist/types/model/commands/person/SetMfaGraceUntilCommand.d.ts +8 -3
  1493. package/dist/types/model/commands/person/SetMfaGraceUntilCommand.d.ts.map +1 -1
  1494. package/dist/types/model/commands/person/TogglePersonPasswordlessCommand.d.ts.map +1 -1
  1495. package/dist/types/model/commands/personToken/ActivateOtpCommand.d.ts.map +1 -1
  1496. package/dist/types/model/commands/personToken/ClaimOtpAttemptCommand.d.ts.map +1 -1
  1497. package/dist/types/model/commands/personToken/CreatePersonTokenCommand.d.ts.map +1 -1
  1498. package/dist/types/model/commands/personToken/IncreaseOtpAttemptCommand.d.ts.map +1 -1
  1499. package/dist/types/model/commands/personToken/InvalidateEmailOtpTokensCommand.d.ts.map +1 -1
  1500. package/dist/types/model/commands/personToken/InvalidateTokenCommand.d.ts.map +1 -1
  1501. package/dist/types/model/commands/personToken/ResetPasswordCommand.d.ts +1 -1
  1502. package/dist/types/model/commands/personToken/ResetPasswordCommand.d.ts.map +1 -1
  1503. package/dist/types/model/commands/personToken/SaveEmailOtpTokenCommand.d.ts.map +1 -1
  1504. package/dist/types/model/commands/personToken/SavePersonTokenCommand.d.ts.map +1 -1
  1505. package/dist/types/model/commands/project/CreateProjectCommand.d.ts.map +1 -1
  1506. package/dist/types/model/commands/project/SetProjectSecretCommand.d.ts.map +1 -1
  1507. package/dist/types/model/commands/project/UpdateProjectCommand.d.ts.map +1 -1
  1508. package/dist/types/model/commands/rateLimit/RecordRateLimitEventCommand.d.ts.map +1 -1
  1509. package/dist/types/model/dtos/Password.d.ts.map +1 -1
  1510. package/dist/types/model/mailing/UserMailer.d.ts.map +1 -1
  1511. package/dist/types/model/mailing/templates/BackupCodesExhausted.mustache.d.ts.map +1 -1
  1512. package/dist/types/model/mailing/templates/EmailChangeNotify.mustache.d.ts.map +1 -1
  1513. package/dist/types/model/mailing/templates/EmailChangeVerify.mustache.d.ts.map +1 -1
  1514. package/dist/types/model/mailing/templates/EmailOtp.mustache.d.ts.map +1 -1
  1515. package/dist/types/model/mailing/templates/EmailVerification.mustache.d.ts.map +1 -1
  1516. package/dist/types/model/mailing/templates/ExistingUserInvited.mustache.d.ts.map +1 -1
  1517. package/dist/types/model/mailing/templates/ForcedSignOut.mustache.d.ts.map +1 -1
  1518. package/dist/types/model/mailing/templates/Layout.mustache.d.ts.map +1 -1
  1519. package/dist/types/model/mailing/templates/NewUserInvited.mustache.d.ts.map +1 -1
  1520. package/dist/types/model/mailing/templates/PasswordReset.mustache.d.ts.map +1 -1
  1521. package/dist/types/model/mailing/templates/PasswordlessSignIn.mustache.d.ts.map +1 -1
  1522. package/dist/types/model/mailing/templates/UnusualLogin.mustache.d.ts.map +1 -1
  1523. package/dist/types/model/mailing/type.d.ts.map +1 -1
  1524. package/dist/types/model/queries/apiKey/ApiKeyListQuery.d.ts.map +1 -1
  1525. package/dist/types/model/queries/apiKey/ApiKeyQuery.d.ts +4 -0
  1526. package/dist/types/model/queries/apiKey/ApiKeyQuery.d.ts.map +1 -1
  1527. package/dist/types/model/queries/apiKey/ApiKeySessionsQuery.d.ts +1 -4
  1528. package/dist/types/model/queries/apiKey/ApiKeySessionsQuery.d.ts.map +1 -1
  1529. package/dist/types/model/queries/authLog/AuthLogQuery.d.ts.map +1 -1
  1530. package/dist/types/model/queries/authLog/NextLoginAttemptQuery.d.ts +2 -2
  1531. package/dist/types/model/queries/authLog/NextLoginAttemptQuery.d.ts.map +1 -1
  1532. package/dist/types/model/queries/authLog/NextMailAttemptQuery.d.ts +2 -2
  1533. package/dist/types/model/queries/authLog/NextMailAttemptQuery.d.ts.map +1 -1
  1534. package/dist/types/model/queries/authPolicy/AuthPoliciesQuery.d.ts.map +1 -1
  1535. package/dist/types/model/queries/configuration/ConfigurationQuery.d.ts.map +1 -1
  1536. package/dist/types/model/queries/customRole/CustomRolesQuery.d.ts +12 -0
  1537. package/dist/types/model/queries/customRole/CustomRolesQuery.d.ts.map +1 -0
  1538. package/dist/types/model/queries/customRole/index.d.ts +2 -0
  1539. package/dist/types/model/queries/customRole/index.d.ts.map +1 -0
  1540. package/dist/types/model/queries/identity/IdentitiesHoldingRoleCountQuery.d.ts +8 -0
  1541. package/dist/types/model/queries/identity/IdentitiesHoldingRoleCountQuery.d.ts.map +1 -0
  1542. package/dist/types/model/queries/identity/IdentityQuery.d.ts +3 -2
  1543. package/dist/types/model/queries/identity/IdentityQuery.d.ts.map +1 -1
  1544. package/dist/types/model/queries/identity/index.d.ts +1 -0
  1545. package/dist/types/model/queries/identity/index.d.ts.map +1 -1
  1546. package/dist/types/model/queries/idp/IdentityProviderBySlugQuery.d.ts.map +1 -1
  1547. package/dist/types/model/queries/idp/IdentityProvidersQuery.d.ts.map +1 -1
  1548. package/dist/types/model/queries/idp/IdpSessionByApiKeyQuery.d.ts.map +1 -1
  1549. package/dist/types/model/queries/idp/IdpSessionsBySidQuery.d.ts.map +1 -1
  1550. package/dist/types/model/queries/idp/IdpSessionsBySubQuery.d.ts.map +1 -1
  1551. package/dist/types/model/queries/idp/LocalAuthDisablingIdpsQuery.d.ts +18 -0
  1552. package/dist/types/model/queries/idp/LocalAuthDisablingIdpsQuery.d.ts.map +1 -0
  1553. package/dist/types/model/queries/idp/PersonIdentityProvidersQuery.d.ts +1 -0
  1554. package/dist/types/model/queries/idp/PersonIdentityProvidersQuery.d.ts.map +1 -1
  1555. package/dist/types/model/queries/idp/helpers.d.ts +1 -1
  1556. package/dist/types/model/queries/idp/helpers.d.ts.map +1 -1
  1557. package/dist/types/model/queries/idp/index.d.ts +1 -0
  1558. package/dist/types/model/queries/idp/index.d.ts.map +1 -1
  1559. package/dist/types/model/queries/idp/types.d.ts +1 -0
  1560. package/dist/types/model/queries/idp/types.d.ts.map +1 -1
  1561. package/dist/types/model/queries/index.d.ts +1 -0
  1562. package/dist/types/model/queries/index.d.ts.map +1 -1
  1563. package/dist/types/model/queries/mailTemplate/MailTemplateListQuery.d.ts.map +1 -1
  1564. package/dist/types/model/queries/mailTemplate/MailTemplateQuery.d.ts.map +1 -1
  1565. package/dist/types/model/queries/membership/AllProjectRolesByIdentityQuery.d.ts.map +1 -1
  1566. package/dist/types/model/queries/membership/IdentityHasProjectMembershipsQuery.d.ts +7 -0
  1567. package/dist/types/model/queries/membership/IdentityHasProjectMembershipsQuery.d.ts.map +1 -0
  1568. package/dist/types/model/queries/membership/ProjectMembersQuery.d.ts.map +1 -1
  1569. package/dist/types/model/queries/membership/ProjectMembershipByIdentityQuery.d.ts.map +1 -1
  1570. package/dist/types/model/queries/membership/ProjectRolesByIdentityQuery.d.ts.map +1 -1
  1571. package/dist/types/model/queries/membership/ProjectSlugSpecification.d.ts.map +1 -1
  1572. package/dist/types/model/queries/membership/index.d.ts +1 -0
  1573. package/dist/types/model/queries/membership/index.d.ts.map +1 -1
  1574. package/dist/types/model/queries/person/PersonByIdPQuery.d.ts.map +1 -1
  1575. package/dist/types/model/queries/person/PersonByIdentityBatchQuery.d.ts.map +1 -1
  1576. package/dist/types/model/queries/person/PersonQuery.d.ts.map +1 -1
  1577. package/dist/types/model/queries/person/PersonQueryBuilderFactory.d.ts.map +1 -1
  1578. package/dist/types/model/queries/person/PersonsQuery.d.ts.map +1 -1
  1579. package/dist/types/model/queries/person/types.d.ts +3 -0
  1580. package/dist/types/model/queries/person/types.d.ts.map +1 -1
  1581. package/dist/types/model/queries/personToken/PersonTokenQuery.d.ts.map +1 -1
  1582. package/dist/types/model/queries/project/ProjectBySlugQuery.d.ts.map +1 -1
  1583. package/dist/types/model/queries/project/ProjectSecretKeysQuery.d.ts.map +1 -1
  1584. package/dist/types/model/queries/project/ProjectSecretsQuery.d.ts.map +1 -1
  1585. package/dist/types/model/queries/project/ProjectUpdateTimestampQuery.d.ts.map +1 -1
  1586. package/dist/types/model/queries/project/ProjectsByIdentityQuery.d.ts.map +1 -1
  1587. package/dist/types/model/queries/project/ProjectsQuery.d.ts.map +1 -1
  1588. package/dist/types/model/queries/rateLimit/RateLimitCountQuery.d.ts +2 -2
  1589. package/dist/types/model/queries/rateLimit/RateLimitCountQuery.d.ts.map +1 -1
  1590. package/dist/types/model/service/AuthLogService.d.ts.map +1 -1
  1591. package/dist/types/model/service/AuthPolicyManager.d.ts.map +1 -1
  1592. package/dist/types/model/service/AuthPolicyResolver.d.ts.map +1 -1
  1593. package/dist/types/model/service/BackupCodeManager.d.ts.map +1 -1
  1594. package/dist/types/model/service/ConfigurationManager.d.ts.map +1 -1
  1595. package/dist/types/model/service/CustomRoleManager.d.ts +46 -0
  1596. package/dist/types/model/service/CustomRoleManager.d.ts.map +1 -0
  1597. package/dist/types/model/service/EmailChangeManager.d.ts.map +1 -1
  1598. package/dist/types/model/service/EmailOtpManager.d.ts.map +1 -1
  1599. package/dist/types/model/service/EmailValidator.d.ts.map +1 -1
  1600. package/dist/types/model/service/EmailVerificationManager.d.ts.map +1 -1
  1601. package/dist/types/model/service/GlobalRoleValidator.d.ts +5 -0
  1602. package/dist/types/model/service/GlobalRoleValidator.d.ts.map +1 -0
  1603. package/dist/types/model/service/HibpChecker.d.ts.map +1 -1
  1604. package/dist/types/model/service/IDPSignInManager.d.ts +13 -1
  1605. package/dist/types/model/service/IDPSignInManager.d.ts.map +1 -1
  1606. package/dist/types/model/service/InviteManager.d.ts.map +1 -1
  1607. package/dist/types/model/service/LoginRiskAnalyzer.d.ts +1 -1
  1608. package/dist/types/model/service/LoginRiskAnalyzer.d.ts.map +1 -1
  1609. package/dist/types/model/service/MailTemplateManager.d.ts.map +1 -1
  1610. package/dist/types/model/service/MembershipValidator.d.ts.map +1 -1
  1611. package/dist/types/model/service/OtpAuthenticator.d.ts.map +1 -1
  1612. package/dist/types/model/service/OtpManager.d.ts.map +1 -1
  1613. package/dist/types/model/service/PanelAccessResolver.d.ts +19 -0
  1614. package/dist/types/model/service/PanelAccessResolver.d.ts.map +1 -0
  1615. package/dist/types/model/service/PasswordChangeManager.d.ts.map +1 -1
  1616. package/dist/types/model/service/PasswordResetManager.d.ts.map +1 -1
  1617. package/dist/types/model/service/PasswordStrengthValidator.d.ts.map +1 -1
  1618. package/dist/types/model/service/PasswordlessSignInManager.d.ts.map +1 -1
  1619. package/dist/types/model/service/PersonAccessManager.d.ts +5 -2
  1620. package/dist/types/model/service/PersonAccessManager.d.ts.map +1 -1
  1621. package/dist/types/model/service/PersonManager.d.ts.map +1 -1
  1622. package/dist/types/model/service/ProjectManager.d.ts.map +1 -1
  1623. package/dist/types/model/service/ProjectMemberManager.d.ts.map +1 -1
  1624. package/dist/types/model/service/RateLimiter.d.ts +1 -1
  1625. package/dist/types/model/service/RateLimiter.d.ts.map +1 -1
  1626. package/dist/types/model/service/RolesManager.d.ts +6 -1
  1627. package/dist/types/model/service/RolesManager.d.ts.map +1 -1
  1628. package/dist/types/model/service/SecretsManager.d.ts.map +1 -1
  1629. package/dist/types/model/service/SignInManager.d.ts.map +1 -1
  1630. package/dist/types/model/service/SignOutManager.d.ts.map +1 -1
  1631. package/dist/types/model/service/SignUpManager.d.ts +3 -1
  1632. package/dist/types/model/service/SignUpManager.d.ts.map +1 -1
  1633. package/dist/types/model/service/apiKey/ApiKeyManager.d.ts +4 -1
  1634. package/dist/types/model/service/apiKey/ApiKeyManager.d.ts.map +1 -1
  1635. package/dist/types/model/service/apiKey/ApiKeyService.d.ts +2 -2
  1636. package/dist/types/model/service/apiKey/ApiKeyService.d.ts.map +1 -1
  1637. package/dist/types/model/service/apiKey/UnpersistedApiKeyManager.d.ts +18 -0
  1638. package/dist/types/model/service/apiKey/UnpersistedApiKeyManager.d.ts.map +1 -1
  1639. package/dist/types/model/service/captcha/CaptchaValidator.d.ts.map +1 -1
  1640. package/dist/types/model/service/captcha/HCaptchaProvider.d.ts.map +1 -1
  1641. package/dist/types/model/service/captcha/RecaptchaV3Provider.d.ts.map +1 -1
  1642. package/dist/types/model/service/captcha/TurnstileProvider.d.ts.map +1 -1
  1643. package/dist/types/model/service/helpers/getPreferredProject.d.ts.map +1 -1
  1644. package/dist/types/model/service/helpers/isPasswordlessEnabled.d.ts.map +1 -1
  1645. package/dist/types/model/service/idp/BackchannelLogoutManager.d.ts.map +1 -1
  1646. package/dist/types/model/service/idp/ClaimMapping.d.ts +330 -0
  1647. package/dist/types/model/service/idp/ClaimMapping.d.ts.map +1 -0
  1648. package/dist/types/model/service/idp/ClaimMappingEvaluator.d.ts +30 -0
  1649. package/dist/types/model/service/idp/ClaimMappingEvaluator.d.ts.map +1 -0
  1650. package/dist/types/model/service/idp/ClaimMappingValidation.d.ts +55 -0
  1651. package/dist/types/model/service/idp/ClaimMappingValidation.d.ts.map +1 -0
  1652. package/dist/types/model/service/idp/IDPClaimSyncService.d.ts +113 -0
  1653. package/dist/types/model/service/idp/IDPClaimSyncService.d.ts.map +1 -0
  1654. package/dist/types/model/service/idp/IDPHandlerRegistry.d.ts.map +1 -1
  1655. package/dist/types/model/service/idp/IDPManager.d.ts +31 -1
  1656. package/dist/types/model/service/idp/IDPManager.d.ts.map +1 -1
  1657. package/dist/types/model/service/idp/IdentityProviderHandler.d.ts +7 -0
  1658. package/dist/types/model/service/idp/IdentityProviderHandler.d.ts.map +1 -1
  1659. package/dist/types/model/service/idp/IdpSessionRevalidator.d.ts +15 -1
  1660. package/dist/types/model/service/idp/IdpSessionRevalidator.d.ts.map +1 -1
  1661. package/dist/types/model/service/idp/PersonIdentityProviderManager.d.ts.map +1 -1
  1662. package/dist/types/model/service/idp/index.d.ts +4 -0
  1663. package/dist/types/model/service/idp/index.d.ts.map +1 -1
  1664. package/dist/types/model/service/idp/providers/AppleProvider.d.ts +2 -2
  1665. package/dist/types/model/service/idp/providers/AppleProvider.d.ts.map +1 -1
  1666. package/dist/types/model/service/idp/providers/FacebookProvider.d.ts +2 -2
  1667. package/dist/types/model/service/idp/providers/FacebookProvider.d.ts.map +1 -1
  1668. package/dist/types/model/service/idp/providers/OIDCHelpers.d.ts +13 -1
  1669. package/dist/types/model/service/idp/providers/OIDCHelpers.d.ts.map +1 -1
  1670. package/dist/types/model/service/idp/providers/OIDCProvider.d.ts +1 -1
  1671. package/dist/types/model/service/idp/providers/OIDCProvider.d.ts.map +1 -1
  1672. package/dist/types/model/service/idp/providers/OIDCTypes.d.ts +5 -5
  1673. package/dist/types/model/service/idp/providers/helpers.d.ts.map +1 -1
  1674. package/dist/types/model/service/index.d.ts +3 -0
  1675. package/dist/types/model/service/index.d.ts.map +1 -1
  1676. package/dist/types/model/service/membershipUtils.d.ts.map +1 -1
  1677. package/dist/types/model/type/AuthLog.d.ts +1 -1
  1678. package/dist/types/model/type/AuthLog.d.ts.map +1 -1
  1679. package/dist/types/model/type/Config.d.ts +2 -0
  1680. package/dist/types/model/type/Config.d.ts.map +1 -1
  1681. package/dist/types/model/type/CustomRole.d.ts +9 -0
  1682. package/dist/types/model/type/CustomRole.d.ts.map +1 -0
  1683. package/dist/types/model/type/IdentityProvider.d.ts +2 -0
  1684. package/dist/types/model/type/IdentityProvider.d.ts.map +1 -1
  1685. package/dist/types/model/type/PersonToken.d.ts +2 -0
  1686. package/dist/types/model/type/PersonToken.d.ts.map +1 -1
  1687. package/dist/types/model/type/RateLimit.d.ts +6 -6
  1688. package/dist/types/model/type/RateLimit.d.ts.map +1 -1
  1689. package/dist/types/model/type/index.d.ts +1 -0
  1690. package/dist/types/model/type/index.d.ts.map +1 -1
  1691. package/dist/types/model/utils/DatabaseContext.d.ts +15 -1
  1692. package/dist/types/model/utils/DatabaseContext.d.ts.map +1 -1
  1693. package/dist/types/model/utils/Response.d.ts.map +1 -1
  1694. package/dist/types/model/utils/email.d.ts.map +1 -1
  1695. package/dist/types/model/utils/hex.d.ts.map +1 -1
  1696. package/dist/types/model/utils/interval.d.ts.map +1 -1
  1697. package/dist/types/model/utils/time.d.ts.map +1 -1
  1698. package/dist/types/model/utils/token.d.ts +1 -2
  1699. package/dist/types/model/utils/token.d.ts.map +1 -1
  1700. package/dist/types/resolvers/ResolverFactory.d.ts +6 -0
  1701. package/dist/types/resolvers/ResolverFactory.d.ts.map +1 -1
  1702. package/dist/types/resolvers/TenantResolverContext.d.ts +1 -1
  1703. package/dist/types/resolvers/TenantResolverContext.d.ts.map +1 -1
  1704. package/dist/types/resolvers/TenantResolverContextFactory.d.ts +1 -1
  1705. package/dist/types/resolvers/TenantResolverContextFactory.d.ts.map +1 -1
  1706. package/dist/types/resolvers/errorUtils.d.ts.map +1 -1
  1707. package/dist/types/resolvers/membershipUtils.d.ts.map +1 -1
  1708. package/dist/types/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.d.ts.map +1 -1
  1709. package/dist/types/resolvers/mutation/apiKey/DisableApiKeyMutationResolver.d.ts.map +1 -1
  1710. package/dist/types/resolvers/mutation/configuration/AuthPolicyMutationResolver.d.ts.map +1 -1
  1711. package/dist/types/resolvers/mutation/configuration/ConfigurationMutationResolver.d.ts.map +1 -1
  1712. package/dist/types/resolvers/mutation/customRole/CustomRoleMutationResolver.d.ts +16 -0
  1713. package/dist/types/resolvers/mutation/customRole/CustomRoleMutationResolver.d.ts.map +1 -0
  1714. package/dist/types/resolvers/mutation/identity/GlobalRolesMutationResolver.d.ts.map +1 -1
  1715. package/dist/types/resolvers/mutation/idp/AddIDPMutationResolver.d.ts.map +1 -1
  1716. package/dist/types/resolvers/mutation/idp/DisableIDPMutationResolver.d.ts.map +1 -1
  1717. package/dist/types/resolvers/mutation/idp/DisconnectMyIdentityProviderMutationResolver.d.ts.map +1 -1
  1718. package/dist/types/resolvers/mutation/idp/EnableIDPMutationResolver.d.ts.map +1 -1
  1719. package/dist/types/resolvers/mutation/idp/UpdateIDPMutationResolver.d.ts.map +1 -1
  1720. package/dist/types/resolvers/mutation/idp/audit.d.ts.map +1 -1
  1721. package/dist/types/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.d.ts +2 -0
  1722. package/dist/types/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.d.ts.map +1 -1
  1723. package/dist/types/resolvers/mutation/person/ChangePasswordMutationResolver.d.ts.map +1 -1
  1724. package/dist/types/resolvers/mutation/person/ChangeProfileMutationResolver.d.ts.map +1 -1
  1725. package/dist/types/resolvers/mutation/person/DisablePersonMutationResolver.d.ts +1 -1
  1726. package/dist/types/resolvers/mutation/person/DisablePersonMutationResolver.d.ts.map +1 -1
  1727. package/dist/types/resolvers/mutation/person/EmailOtpMutationResolver.d.ts.map +1 -1
  1728. package/dist/types/resolvers/mutation/person/EmailVerificationMutationResolver.d.ts.map +1 -1
  1729. package/dist/types/resolvers/mutation/person/EnablePersonMutationResolver.d.ts +11 -0
  1730. package/dist/types/resolvers/mutation/person/EnablePersonMutationResolver.d.ts.map +1 -0
  1731. package/dist/types/resolvers/mutation/person/ForceSignOutMutationResolver.d.ts.map +1 -1
  1732. package/dist/types/resolvers/mutation/person/IDPMutationResolver.d.ts.map +1 -1
  1733. package/dist/types/resolvers/mutation/person/InviteMutationResolver.d.ts.map +1 -1
  1734. package/dist/types/resolvers/mutation/person/OtpMutationResolver.d.ts.map +1 -1
  1735. package/dist/types/resolvers/mutation/person/PasswordlessMutationResolver.d.ts.map +1 -1
  1736. package/dist/types/resolvers/mutation/person/RegenerateBackupCodesMutationResolver.d.ts.map +1 -1
  1737. package/dist/types/resolvers/mutation/person/ResetPasswordMutationResolver.d.ts.map +1 -1
  1738. package/dist/types/resolvers/mutation/person/ResetPersonMfaMutationResolver.d.ts.map +1 -1
  1739. package/dist/types/resolvers/mutation/person/RevokeSessionMutationResolver.d.ts.map +1 -1
  1740. package/dist/types/resolvers/mutation/person/SignInMutationResolver.d.ts.map +1 -1
  1741. package/dist/types/resolvers/mutation/person/SignOutMutationResolver.d.ts.map +1 -1
  1742. package/dist/types/resolvers/mutation/person/SignUpMutationResolver.d.ts.map +1 -1
  1743. package/dist/types/resolvers/mutation/person/TogglePasswordlessMutationResolver.d.ts.map +1 -1
  1744. package/dist/types/resolvers/mutation/project/CreateProjectMutationResolver.d.ts.map +1 -1
  1745. package/dist/types/resolvers/mutation/project/SetProjectSecretMutationResolver.d.ts.map +1 -1
  1746. package/dist/types/resolvers/mutation/project/UpdateProjectMutationResolver.d.ts.map +1 -1
  1747. package/dist/types/resolvers/mutation/projectMember/AddProjectMemberMutationResolver.d.ts.map +1 -1
  1748. package/dist/types/resolvers/mutation/projectMember/RemoveProjectMemberMutationResolver.d.ts.map +1 -1
  1749. package/dist/types/resolvers/mutation/projectMember/UpdateProjectMemberMutationResolver.d.ts.map +1 -1
  1750. package/dist/types/resolvers/mutation/projectMember/audit.d.ts +1 -1
  1751. package/dist/types/resolvers/mutation/projectMember/audit.d.ts.map +1 -1
  1752. package/dist/types/resolvers/query/ApiKeyQueryResolver.d.ts.map +1 -1
  1753. package/dist/types/resolvers/query/AuthLogQueryResolver.d.ts.map +1 -1
  1754. package/dist/types/resolvers/query/AuthPolicyQueryResolver.d.ts.map +1 -1
  1755. package/dist/types/resolvers/query/ConfigurationQueryResolver.d.ts.map +1 -1
  1756. package/dist/types/resolvers/query/CustomRoleQueryResolver.d.ts +11 -0
  1757. package/dist/types/resolvers/query/CustomRoleQueryResolver.d.ts.map +1 -0
  1758. package/dist/types/resolvers/query/IDPQueryResolver.d.ts.map +1 -1
  1759. package/dist/types/resolvers/query/MailTemplateQueryResolver.d.ts +1 -0
  1760. package/dist/types/resolvers/query/MailTemplateQueryResolver.d.ts.map +1 -1
  1761. package/dist/types/resolvers/query/MeQueryResolver.d.ts.map +1 -1
  1762. package/dist/types/resolvers/query/PersonQueryResolver.d.ts.map +1 -1
  1763. package/dist/types/resolvers/query/ProjectMembersQueryResolver.d.ts.map +1 -1
  1764. package/dist/types/resolvers/query/ProjectQueryResolver.d.ts.map +1 -1
  1765. package/dist/types/resolvers/responseHelpers/ApiKeyResponseFactory.d.ts.map +1 -1
  1766. package/dist/types/resolvers/responseHelpers/PersonResponseFactory.d.ts.map +1 -1
  1767. package/dist/types/resolvers/responseHelpers/ProjectResponseFactory.d.ts +10 -0
  1768. package/dist/types/resolvers/responseHelpers/ProjectResponseFactory.d.ts.map +1 -0
  1769. package/dist/types/resolvers/responseHelpers/SignInResponseFactory.d.ts.map +1 -1
  1770. package/dist/types/resolvers/types/IdentityTypeResolver.d.ts.map +1 -1
  1771. package/dist/types/resolvers/types/PersonTypeResolver.d.ts +15 -1
  1772. package/dist/types/resolvers/types/PersonTypeResolver.d.ts.map +1 -1
  1773. package/dist/types/resolvers/types/ProjectTypeResolver.d.ts +15 -6
  1774. package/dist/types/resolvers/types/ProjectTypeResolver.d.ts.map +1 -1
  1775. package/dist/types/schema/index.d.ts +381 -21
  1776. package/dist/types/schema/index.d.ts.map +1 -1
  1777. package/dist/types/schema/tenant.graphql.d.ts.map +1 -1
  1778. package/dist/types/schema/types.d.ts +2 -2
  1779. package/dist/types/schema/types.d.ts.map +1 -1
  1780. package/dist/types/tsconfig.tsbuildinfo +1 -1
  1781. package/dist/types/utils/Mailer.d.ts.map +1 -1
  1782. package/dist/types/utils/TemplateRenderer.d.ts.map +1 -1
  1783. package/dist/types/utils/array.d.ts.map +1 -1
  1784. package/dist/types/utils/batchQuery.d.ts.map +1 -1
  1785. package/package.json +12 -12
  1786. package/readme.md +56 -0
  1787. package/src/TenantContainer.ts +46 -8
  1788. package/src/migrations/2026-06-18-120000-idp-claim-mapping.ts +15 -0
  1789. package/src/migrations/2026-08-03-120000-person-enable-auth-log.ts +12 -0
  1790. package/src/migrations/2026-08-04-120000-config-panel.ts +13 -0
  1791. package/src/migrations/2026-09-04-120000-idp-disable-local-authentication.ts +18 -0
  1792. package/src/migrations/2026-09-11-120000-custom-role.ts +19 -0
  1793. package/src/migrations/runner.ts +10 -0
  1794. package/src/migrations/snapshot.ts +22 -2
  1795. package/src/model/authorization/CustomRoleAuthorizator.ts +72 -0
  1796. package/src/model/authorization/CustomRolePermissions.ts +558 -0
  1797. package/src/model/authorization/PermissionActions.ts +74 -17
  1798. package/src/model/authorization/PermissionContextFactory.ts +39 -3
  1799. package/src/model/authorization/PermissionsFactory.ts +65 -31
  1800. package/src/model/authorization/Roles.ts +13 -0
  1801. package/src/model/authorization/TargetIdentityPermission.ts +37 -0
  1802. package/src/model/authorization/index.ts +3 -0
  1803. package/src/model/commands/apiKey/ApiKeyHelper.ts +23 -0
  1804. package/src/model/commands/apiKey/CreateApiKeyCommand.ts +12 -5
  1805. package/src/model/commands/apiKey/ProlongApiKeyCommand.ts +22 -14
  1806. package/src/model/commands/authLog/CreateAuthLogEntryCommand.ts +1 -0
  1807. package/src/model/commands/configuration/UpdateConfigurationCommand.ts +5 -4
  1808. package/src/model/commands/customRole/CreateCustomRoleCommand.ts +30 -0
  1809. package/src/model/commands/customRole/DeleteCustomRoleCommand.ts +20 -0
  1810. package/src/model/commands/customRole/RemoveCustomRoleAssignmentsCommand.ts +20 -0
  1811. package/src/model/commands/customRole/UpdateCustomRoleCommand.ts +30 -0
  1812. package/src/model/commands/customRole/index.ts +4 -0
  1813. package/src/model/commands/identity/PatchIdentityGlobalRoles.ts +1 -1
  1814. package/src/model/commands/idp/ClaimIdpRevalidationCommand.ts +8 -7
  1815. package/src/model/commands/idp/CreateIdpCommand.ts +7 -1
  1816. package/src/model/commands/idp/CreateIdpSessionCommand.ts +5 -2
  1817. package/src/model/commands/idp/UpdateIdpCommand.ts +5 -1
  1818. package/src/model/commands/idp/UpdateIdpSessionCommand.ts +3 -2
  1819. package/src/model/commands/index.ts +1 -0
  1820. package/src/model/commands/membership/UpdateProjectMemberCommand.ts +1 -1
  1821. package/src/model/commands/membership/index.ts +2 -1
  1822. package/src/model/commands/membership/variables/index.ts +1 -0
  1823. package/src/model/commands/person/CreatePersonCommand.ts +1 -0
  1824. package/src/model/commands/person/EnablePersonCommand.ts +18 -0
  1825. package/src/model/commands/person/SetMfaGraceUntilCommand.ts +9 -4
  1826. package/src/model/commands/personToken/ResetPasswordCommand.ts +2 -3
  1827. package/src/model/commands/personToken/SaveEmailOtpTokenCommand.ts +5 -4
  1828. package/src/model/commands/personToken/SavePersonTokenCommand.ts +13 -7
  1829. package/src/model/commands/rateLimit/RecordRateLimitEventCommand.ts +3 -1
  1830. package/src/model/queries/apiKey/ApiKeyQuery.ts +17 -1
  1831. package/src/model/queries/apiKey/ApiKeySessionsQuery.ts +2 -2
  1832. package/src/model/queries/authLog/NextLoginAttemptQuery.ts +14 -12
  1833. package/src/model/queries/authLog/NextMailAttemptQuery.ts +12 -10
  1834. package/src/model/queries/configuration/ConfigurationQuery.ts +4 -0
  1835. package/src/model/queries/customRole/CustomRolesQuery.ts +30 -0
  1836. package/src/model/queries/customRole/index.ts +1 -0
  1837. package/src/model/queries/identity/IdentitiesHoldingRoleCountQuery.ts +17 -0
  1838. package/src/model/queries/identity/IdentityQuery.ts +10 -4
  1839. package/src/model/queries/identity/index.ts +1 -0
  1840. package/src/model/queries/idp/LocalAuthDisablingIdpsQuery.ts +41 -0
  1841. package/src/model/queries/idp/PersonIdentityProvidersQuery.ts +2 -0
  1842. package/src/model/queries/idp/helpers.ts +3 -2
  1843. package/src/model/queries/idp/index.ts +1 -0
  1844. package/src/model/queries/idp/types.ts +1 -0
  1845. package/src/model/queries/index.ts +1 -0
  1846. package/src/model/queries/membership/IdentityHasProjectMembershipsQuery.ts +17 -0
  1847. package/src/model/queries/membership/ProjectMembersQuery.ts +1 -0
  1848. package/src/model/queries/membership/index.ts +1 -0
  1849. package/src/model/queries/person/PersonQueryBuilderFactory.ts +4 -0
  1850. package/src/model/queries/person/types.ts +3 -0
  1851. package/src/model/queries/personToken/PersonTokenQuery.ts +4 -0
  1852. package/src/model/queries/rateLimit/RateLimitCountQuery.ts +5 -2
  1853. package/src/model/service/AuthLogService.ts +18 -2
  1854. package/src/model/service/CustomRoleManager.ts +221 -0
  1855. package/src/model/service/EmailChangeManager.ts +3 -3
  1856. package/src/model/service/EmailOtpManager.ts +0 -1
  1857. package/src/model/service/EmailVerificationManager.ts +3 -3
  1858. package/src/model/service/GlobalRoleValidator.ts +30 -0
  1859. package/src/model/service/IDPSignInManager.ts +74 -14
  1860. package/src/model/service/PanelAccessResolver.ts +32 -0
  1861. package/src/model/service/PasswordResetManager.ts +11 -3
  1862. package/src/model/service/PasswordlessSignInManager.ts +26 -6
  1863. package/src/model/service/PersonAccessManager.ts +19 -3
  1864. package/src/model/service/RateLimiter.ts +2 -3
  1865. package/src/model/service/RolesManager.ts +28 -14
  1866. package/src/model/service/SignInManager.ts +16 -8
  1867. package/src/model/service/SignUpManager.ts +12 -4
  1868. package/src/model/service/apiKey/ApiKeyManager.ts +75 -53
  1869. package/src/model/service/apiKey/ApiKeyService.ts +2 -2
  1870. package/src/model/service/apiKey/UnpersistedApiKeyManager.ts +24 -0
  1871. package/src/model/service/idp/ClaimMapping.ts +283 -0
  1872. package/src/model/service/idp/ClaimMappingEvaluator.ts +226 -0
  1873. package/src/model/service/idp/ClaimMappingValidation.ts +158 -0
  1874. package/src/model/service/idp/IDPClaimSyncService.ts +401 -0
  1875. package/src/model/service/idp/IDPManager.ts +126 -21
  1876. package/src/model/service/idp/IdentityProviderHandler.ts +7 -0
  1877. package/src/model/service/idp/IdpSessionRevalidator.ts +130 -25
  1878. package/src/model/service/idp/PersonIdentityProviderManager.ts +8 -0
  1879. package/src/model/service/idp/index.ts +4 -0
  1880. package/src/model/service/idp/providers/OIDCHelpers.ts +161 -53
  1881. package/src/model/service/idp/providers/OIDCProvider.ts +4 -1
  1882. package/src/model/service/index.ts +3 -0
  1883. package/src/model/type/AuthLog.ts +4 -0
  1884. package/src/model/type/Config.ts +3 -0
  1885. package/src/model/type/CustomRole.ts +8 -0
  1886. package/src/model/type/IdentityProvider.ts +2 -0
  1887. package/src/model/type/PersonToken.ts +2 -0
  1888. package/src/model/type/index.ts +1 -0
  1889. package/src/model/utils/DatabaseContext.ts +30 -6
  1890. package/src/model/utils/token.ts +2 -3
  1891. package/src/resolvers/ResolverFactory.ts +17 -0
  1892. package/src/resolvers/TenantResolverContext.ts +1 -1
  1893. package/src/resolvers/TenantResolverContextFactory.ts +5 -5
  1894. package/src/resolvers/mutation/apiKey/CreateApiKeyMutationResolver.ts +13 -5
  1895. package/src/resolvers/mutation/customRole/CustomRoleMutationResolver.ts +125 -0
  1896. package/src/resolvers/mutation/identity/GlobalRolesMutationResolver.ts +30 -7
  1897. package/src/resolvers/mutation/idp/AddIDPMutationResolver.ts +1 -0
  1898. package/src/resolvers/mutation/idp/UpdateIDPMutationResolver.ts +1 -0
  1899. package/src/resolvers/mutation/idp/audit.ts +1 -0
  1900. package/src/resolvers/mutation/mailTemplates/MailTemplateMutationResolver.ts +48 -14
  1901. package/src/resolvers/mutation/person/ChangePasswordMutationResolver.ts +2 -2
  1902. package/src/resolvers/mutation/person/ChangeProfileMutationResolver.ts +9 -3
  1903. package/src/resolvers/mutation/person/DisablePersonMutationResolver.ts +5 -5
  1904. package/src/resolvers/mutation/person/EmailVerificationMutationResolver.ts +1 -1
  1905. package/src/resolvers/mutation/person/EnablePersonMutationResolver.ts +50 -0
  1906. package/src/resolvers/mutation/person/ForceSignOutMutationResolver.ts +2 -2
  1907. package/src/resolvers/mutation/person/IDPMutationResolver.ts +31 -0
  1908. package/src/resolvers/mutation/person/PasswordlessMutationResolver.ts +7 -0
  1909. package/src/resolvers/mutation/person/ResetPasswordMutationResolver.ts +1 -1
  1910. package/src/resolvers/mutation/person/ResetPersonMfaMutationResolver.ts +2 -2
  1911. package/src/resolvers/mutation/person/SignInMutationResolver.ts +22 -9
  1912. package/src/resolvers/mutation/person/SignUpMutationResolver.ts +1 -1
  1913. package/src/resolvers/query/CustomRoleQueryResolver.ts +41 -0
  1914. package/src/resolvers/query/MailTemplateQueryResolver.ts +13 -8
  1915. package/src/resolvers/query/PersonQueryResolver.ts +3 -1
  1916. package/src/resolvers/query/ProjectQueryResolver.ts +3 -2
  1917. package/src/resolvers/responseHelpers/PersonResponseFactory.ts +5 -0
  1918. package/src/resolvers/responseHelpers/ProjectResponseFactory.ts +24 -0
  1919. package/src/resolvers/responseHelpers/SignInResponseFactory.ts +1 -1
  1920. package/src/resolvers/types/IdentityTypeResolver.ts +50 -14
  1921. package/src/resolvers/types/PersonTypeResolver.ts +45 -4
  1922. package/src/resolvers/types/ProjectTypeResolver.ts +33 -1
  1923. package/src/schema/index.ts +483 -15
  1924. package/src/schema/tenant.graphql.ts +275 -15
  1925. package/tests/cases/integration/database/dbClock.test.ts +171 -0
  1926. package/tests/cases/integration/mocked/antiAbuseSignUp.test.ts +2 -2
  1927. package/tests/cases/integration/mocked/changeMyProfileEmailVerificationMutation.test.ts +10 -11
  1928. package/tests/cases/integration/mocked/changePasswordMutation.test.ts +43 -0
  1929. package/tests/cases/integration/mocked/changeProfileMutation.test.ts +2 -0
  1930. package/tests/cases/integration/mocked/configurationPanel.test.ts +105 -0
  1931. package/tests/cases/integration/mocked/confirmEmailChangeMutation.test.ts +4 -2
  1932. package/tests/cases/integration/mocked/createSessionKeyMutation.test.ts +33 -0
  1933. package/tests/cases/integration/mocked/customRoleCrud.test.ts +442 -0
  1934. package/tests/cases/integration/mocked/disablePersonMutation.test.ts +92 -0
  1935. package/tests/cases/integration/mocked/enablePersonMutation.test.ts +137 -0
  1936. package/tests/cases/integration/mocked/forceSignOutPersonMutation.test.ts +3 -1
  1937. package/tests/cases/integration/mocked/globalIdentityRolesMutation.test.ts +169 -3
  1938. package/tests/cases/integration/mocked/gql/passwordless.ts +10 -0
  1939. package/tests/cases/integration/mocked/idpClaimMappingConfig.test.ts +332 -0
  1940. package/tests/cases/integration/mocked/listProjectMembersQuery.test.ts +8 -3
  1941. package/tests/cases/integration/mocked/localAuthenticationDisabled.test.ts +182 -0
  1942. package/tests/cases/integration/mocked/mailTemplateScope.test.ts +95 -0
  1943. package/tests/cases/integration/mocked/permissionsQuery.test.ts +153 -0
  1944. package/tests/cases/integration/mocked/personByIdQuery.test.ts +59 -1
  1945. package/tests/cases/integration/mocked/personIdentityProviders.test.ts +67 -0
  1946. package/tests/cases/integration/mocked/personsQuery.test.ts +38 -5
  1947. package/tests/cases/integration/mocked/requestEmailVerificationMutation.test.ts +15 -6
  1948. package/tests/cases/integration/mocked/resetPersonMfaMutation.test.ts +5 -3
  1949. package/tests/cases/integration/mocked/signInAnomalyDetection.test.ts +13 -2
  1950. package/tests/cases/integration/mocked/signInIdpClaimMapping.test.ts +1258 -0
  1951. package/tests/cases/integration/mocked/signInIdpClaimMappingFixes.test.ts +344 -0
  1952. package/tests/cases/integration/mocked/signInIdpClaimMappingSafety.test.ts +531 -0
  1953. package/tests/cases/integration/mocked/signInIdpMutation.test.ts +105 -1
  1954. package/tests/cases/integration/mocked/signInMfaEnforcement.test.ts +20 -5
  1955. package/tests/cases/integration/mocked/signInMutation.test.ts +14 -0
  1956. package/tests/cases/integration/mocked/signInPasswordlessMutation.test.ts +38 -1
  1957. package/tests/cases/integration/mocked/signUpMutation.test.ts +62 -3
  1958. package/tests/cases/integration/mocked/sql/createPersonTokenSql.ts +4 -3
  1959. package/tests/cases/integration/mocked/sql/createSessionKeySql.ts +2 -2
  1960. package/tests/cases/integration/mocked/sql/emailOtpSql.ts +10 -8
  1961. package/tests/cases/integration/mocked/sql/getApiKeySql.ts +2 -2
  1962. package/tests/cases/integration/mocked/sql/getConfigSql.ts +3 -0
  1963. package/tests/cases/integration/mocked/sql/getCustomRolesSql.ts +25 -0
  1964. package/tests/cases/integration/mocked/sql/getIdentityProjectMembershipPresenceSql.ts +11 -0
  1965. package/tests/cases/integration/mocked/sql/getIdpBySlugSql.ts +1 -1
  1966. package/tests/cases/integration/mocked/sql/getNextLoginAttemptSql.ts +15 -11
  1967. package/tests/cases/integration/mocked/sql/getNextMailAttemptSql.ts +12 -13
  1968. package/tests/cases/integration/mocked/sql/getPersonByEmailSql.ts +5 -2
  1969. package/tests/cases/integration/mocked/sql/getPersonByIdSql.ts +1 -1
  1970. package/tests/cases/integration/mocked/sql/getPersonByIdentity.ts +1 -1
  1971. package/tests/cases/integration/mocked/sql/getPersonByIdpSql.ts +1 -1
  1972. package/tests/cases/integration/mocked/sql/getPersonsByIdentitySql.ts +1 -1
  1973. package/tests/cases/integration/mocked/sql/getProjectBySlugSql.ts +1 -1
  1974. package/tests/cases/integration/mocked/sql/listPersonsSql.ts +5 -2
  1975. package/tests/cases/integration/mocked/sql/listSessionsSql.ts +3 -3
  1976. package/tests/cases/integration/mocked/sql/localAuthDisablingIdpsSql.ts +21 -0
  1977. package/tests/cases/integration/mocked/sql/personIdentityProvidersSql.ts +4 -2
  1978. package/tests/cases/integration/mocked/sql/removeMembershipSql.ts +14 -0
  1979. package/tests/cases/integration/mocked/sql/sqlTransaction.ts +28 -0
  1980. package/tests/cases/integration/mocked/trustForwardedClientInfo.test.ts +60 -3
  1981. package/tests/cases/integration/mocked/verifyEmailMutation.test.ts +9 -5
  1982. package/tests/cases/unit/apiKey/createSessionApiKeyPolicy.test.ts +9 -6
  1983. package/tests/cases/unit/apiKey/prolongApiKeyCommand.test.ts +29 -19
  1984. package/tests/cases/unit/apiKey/unpersistedApiKeyManager.test.ts +4 -5
  1985. package/tests/cases/unit/apiKey/verifyAndProlongIdle.test.ts +16 -6
  1986. package/tests/cases/unit/apiKey/verifyAndProlongReplica.test.ts +173 -0
  1987. package/tests/cases/unit/authLogBaselineWrite.test.ts +26 -3
  1988. package/tests/cases/unit/backupCodeManager.test.ts +1 -0
  1989. package/tests/cases/unit/customRoleAuthorizator.test.ts +149 -0
  1990. package/tests/cases/unit/customRolePermissions.test.ts +583 -0
  1991. package/tests/cases/unit/databaseContextRetry.test.ts +81 -0
  1992. package/tests/cases/unit/emailOtpManager.test.ts +10 -8
  1993. package/tests/cases/unit/idp/claimIdpRevalidation.test.ts +50 -0
  1994. package/tests/cases/unit/idp/claimMappingEvaluator.test.ts +554 -0
  1995. package/tests/cases/unit/idp/claimMappingValidation.test.ts +134 -0
  1996. package/tests/cases/unit/idp/idpManagerConfigMerge.test.ts +97 -0
  1997. package/tests/cases/unit/idp/idpManagerUnknownConfigKeys.test.ts +108 -0
  1998. package/tests/cases/unit/idp/idpSessionRevalidator.test.ts +261 -26
  1999. package/tests/cases/unit/idp/oidcClaims.test.ts +29 -0
  2000. package/tests/cases/unit/idp/oidcResponse.test.ts +54 -0
  2001. package/tests/cases/unit/idp/oidcRevalidate.test.ts +94 -2
  2002. package/tests/cases/unit/otpManager.test.ts +1 -0
  2003. package/tests/cases/unit/panelAccessResolver.test.ts +57 -0
  2004. package/tests/cases/unit/rateLimiter.test.ts +7 -7
  2005. package/tests/cases/unit/savePersonTokenCommand.test.ts +40 -0
  2006. package/tests/cases/unit/updateConfigurationCommand.test.ts +63 -0
  2007. package/tests/src/IdPMock.ts +6 -0
  2008. package/tests/src/testTenant.ts +60 -12
  2009. package/dist/development/src/model/commands/membership/RemoveProjectMembershipsCommand.cjs.map +0 -1
  2010. package/dist/development/src/model/commands/membership/RemoveProjectMembershipsCommand.js.map +0 -1
  2011. package/dist/production/src/model/commands/membership/RemoveProjectMembershipsCommand.cjs.map +0 -1
  2012. package/dist/production/src/model/commands/membership/RemoveProjectMembershipsCommand.js.map +0 -1
  2013. package/dist/types/model/commands/membership/RemoveProjectMembershipsCommand.d.ts.map +0 -1
  2014. /package/src/model/commands/membership/{RemoveProjectMembershipsCommand.ts → RemoveProjectMembershipCommand.ts} +0 -0
@@ -9,9 +9,12 @@ require("node:crypto");
9
9
  const DisableApiKeyCommand = require("../../commands/apiKey/DisableApiKeyCommand.cjs");
10
10
  const CreateAuthLogEntryCommand = require("../../commands/authLog/CreateAuthLogEntryCommand.cjs");
11
11
  const IDPRevalidation = require("./IDPRevalidation.cjs");
12
+ const ClaimMapping = require("./ClaimMapping.cjs");
12
13
  class IdpSessionRevalidator {
13
- constructor(idpRegistry) {
14
+ constructor(idpRegistry, claimSyncService, logger) {
14
15
  this.idpRegistry = idpRegistry;
16
+ this.claimSyncService = claimSyncService;
17
+ this.logger = logger;
15
18
  }
16
19
  async revalidate(dbContext, readDbContext, apiKeyRow, requestInfo) {
17
20
  const row = await readDbContext.queryHandler.fetch(new IdpSessionByApiKeyQuery.IdpSessionByApiKeyQuery(apiKeyRow.id, readDbContext.providers));
@@ -37,7 +40,8 @@ class IdpSessionRevalidator {
37
40
  let claimed;
38
41
  try {
39
42
  claimed = await dbContext.commandBus.execute(new ClaimIdpRevalidationCommand.ClaimIdpRevalidationCommand(row.id, decision.claimInterval));
40
- } catch {
43
+ } catch (e) {
44
+ this.logger.warn(e, { message: "IdP session revalidation: claim failed", idpSessionId: row.id });
41
45
  return "valid";
42
46
  }
43
47
  if (!claimed) {
@@ -47,7 +51,8 @@ class IdpSessionRevalidator {
47
51
  return await this.runRevalidation(dbContext, handler, row, apiKeyRow, requestInfo);
48
52
  }
49
53
  setImmediate(() => {
50
- this.runRevalidation(dbContext, handler, row, apiKeyRow, requestInfo).catch(() => {
54
+ this.runRevalidation(dbContext, handler, row, apiKeyRow, requestInfo).catch((e) => {
55
+ this.logger.error(e, { message: "IdP session revalidation: background run failed", idpSessionId: row.id });
51
56
  });
52
57
  });
53
58
  return "valid";
@@ -75,14 +80,16 @@ class IdpSessionRevalidator {
75
80
  let config;
76
81
  try {
77
82
  config = handler.validateConfiguration(row.providerConfiguration);
78
- } catch {
83
+ } catch (e) {
84
+ this.logger.warn(e, { message: "IdP session revalidation: stored configuration is invalid", idpSessionId: row.id });
79
85
  await this.logRevalidationFailed(dbContext, apiKeyRow, row, "config_invalid", requestInfo);
80
86
  return "valid";
81
87
  }
82
88
  let result;
83
89
  try {
84
90
  result = await handler.revalidate(config, row.session);
85
- } catch {
91
+ } catch (e) {
92
+ this.logger.warn(e, { message: "IdP session revalidation: identity provider call failed", idpSessionId: row.id });
86
93
  await this.logRevalidationFailed(dbContext, apiKeyRow, row, "revalidation_error", requestInfo);
87
94
  return "valid";
88
95
  }
@@ -94,11 +101,65 @@ class IdpSessionRevalidator {
94
101
  try {
95
102
  await dbContext.commandBus.execute(new UpdateIdpSessionCommand.UpdateIdpSessionCommand(row.id, result.idpSession));
96
103
  await this.logRevalidated(dbContext, apiKeyRow, row, requestInfo);
97
- } catch {
104
+ } catch (e) {
105
+ this.logger.error(e, { message: "IdP session revalidation: persisting the rotated session failed", idpSessionId: row.id });
98
106
  }
99
107
  }
108
+ if (result.claims) {
109
+ await this.syncClaims(dbContext, row, apiKeyRow, result.claims, result.claimsComplete === true, requestInfo);
110
+ }
100
111
  return "valid";
101
112
  }
113
+ /**
114
+ * Re-apply the claim mapping on a successful refresh. Runs in its own transaction (atomic apply of
115
+ * the membership changes) and never throws: the IdP has already vouched for the session, so a
116
+ * malformed mapping or a transient apply error must not revoke or fail it. A real membership change
117
+ * is audited as `idp_role_mapped`; a failure is audited as `idp_role_mapping_failed` (fail-open
118
+ * marker), mirroring the sign-in path. `claimsComplete` carries whether the refresh rebuilt sign-in's
119
+ * full claim surface (so removal reconciliation is safe) — see `allowRemoval` below.
120
+ */
121
+ async syncClaims(dbContext, row, apiKeyRow, claims, claimsComplete, requestInfo) {
122
+ try {
123
+ const mapping = ClaimMapping.parseClaimMapping(row.providerConfiguration);
124
+ if (!mapping) {
125
+ return;
126
+ }
127
+ const { audit, droppedUnsafeRules } = await dbContext.transaction(
128
+ (db) => this.claimSyncService.sync(db, mapping, claims, { id: apiKeyRow.identity_id }, false, { allowRemoval: claimsComplete })
129
+ );
130
+ if (audit) {
131
+ await this.logRoleMapping(dbContext, apiKeyRow, row, "idp_role_mapped", audit, requestInfo);
132
+ }
133
+ if (droppedUnsafeRules) {
134
+ await this.logRoleMapping(dbContext, apiKeyRow, row, "idp_role_mapping_failed", void 0, requestInfo);
135
+ }
136
+ } catch (e) {
137
+ this.logger.warn(e, { message: "IdP session revalidation: claim mapping sync failed", idpSessionId: row.id });
138
+ await this.logRoleMapping(dbContext, apiKeyRow, row, "idp_role_mapping_failed", void 0, requestInfo);
139
+ }
140
+ }
141
+ async logRoleMapping(dbContext, apiKeyRow, row, type, eventData, requestInfo) {
142
+ try {
143
+ await dbContext.commandBus.execute(
144
+ new CreateAuthLogEntryCommand.CreateAuthLogEntryCommand({
145
+ type,
146
+ invokedById: apiKeyRow.identity_id,
147
+ personId: apiKeyRow.person_id ?? void 0,
148
+ // The membership change affects this session's own person — record it as the target too,
149
+ // so an admin querying membership changes by target_person_id sees IdP-driven grants/revokes
150
+ // (consistent with the project_membership_* audit events).
151
+ targetPersonId: apiKeyRow.person_id ?? void 0,
152
+ identityProviderId: row.identityProviderId,
153
+ success: true,
154
+ eventData,
155
+ ipAddress: requestInfo?.ip,
156
+ userAgent: requestInfo?.userAgent
157
+ })
158
+ );
159
+ } catch (e) {
160
+ this.logger.error(e, { message: `IdP session revalidation: writing the ${type} audit entry failed`, idpSessionId: row.id });
161
+ }
162
+ }
102
163
  async logRevalidated(dbContext, apiKeyRow, row, requestInfo) {
103
164
  await dbContext.commandBus.execute(
104
165
  new CreateAuthLogEntryCommand.CreateAuthLogEntryCommand({
@@ -106,10 +167,10 @@ class IdpSessionRevalidator {
106
167
  invokedById: apiKeyRow.identity_id,
107
168
  personId: apiKeyRow.person_id ?? void 0,
108
169
  identityProviderId: row.identityProviderId,
109
- personTokenId: apiKeyRow.id,
110
170
  success: true,
111
171
  ipAddress: requestInfo?.ip,
112
- userAgent: requestInfo?.userAgent
172
+ userAgent: requestInfo?.userAgent,
173
+ eventData: { apiKeyId: apiKeyRow.id }
113
174
  })
114
175
  );
115
176
  }
@@ -128,37 +189,41 @@ class IdpSessionRevalidator {
128
189
  invokedById: apiKeyRow.identity_id,
129
190
  personId: apiKeyRow.person_id ?? void 0,
130
191
  identityProviderId: row.identityProviderId,
131
- personTokenId: apiKeyRow.id,
132
192
  // not a security failure (the session is kept) — a fail-open marker the operator
133
193
  // can alert on. `success: true` keeps it out of the failed-login funnels.
134
194
  success: true,
135
195
  errorCode,
136
196
  ipAddress: requestInfo?.ip,
137
- userAgent: requestInfo?.userAgent
197
+ userAgent: requestInfo?.userAgent,
198
+ eventData: { apiKeyId: apiKeyRow.id }
138
199
  })
139
200
  );
140
- } catch {
201
+ } catch (e) {
202
+ this.logger.error(e, { message: "IdP session revalidation: writing the idp_session_revalidation_failed audit entry failed", idpSessionId: row.id });
141
203
  }
142
204
  }
143
205
  async revoke(dbContext, apiKeyRow, row, reason, requestInfo) {
144
206
  await dbContext.commandBus.execute(new DisableApiKeyCommand.DisableApiKeyCommand(apiKeyRow.id));
145
- await dbContext.commandBus.execute(
146
- new CreateAuthLogEntryCommand.CreateAuthLogEntryCommand({
147
- type: "idp_session_revoked",
148
- invokedById: apiKeyRow.identity_id,
149
- personId: apiKeyRow.person_id ?? void 0,
150
- identityProviderId: row.identityProviderId,
151
- personTokenId: apiKeyRow.id,
152
- success: false,
153
- errorCode: reason,
154
- ipAddress: requestInfo?.ip,
155
- userAgent: requestInfo?.userAgent,
156
- // the action payload belongs in `event_data` (where every other audit event puts
157
- // it and where the admin UI / AuthLogQueryResolver reads it); `metadata` is for
158
- // transport context (forwarder IP/UA).
159
- eventData: { reason }
160
- })
161
- );
207
+ try {
208
+ await dbContext.commandBus.execute(
209
+ new CreateAuthLogEntryCommand.CreateAuthLogEntryCommand({
210
+ type: "idp_session_revoked",
211
+ invokedById: apiKeyRow.identity_id,
212
+ personId: apiKeyRow.person_id ?? void 0,
213
+ identityProviderId: row.identityProviderId,
214
+ success: false,
215
+ errorCode: reason,
216
+ ipAddress: requestInfo?.ip,
217
+ userAgent: requestInfo?.userAgent,
218
+ // the action payload belongs in `event_data` (where every other audit event puts
219
+ // it and where the admin UI / AuthLogQueryResolver reads it); `metadata` is for
220
+ // transport context (forwarder IP/UA).
221
+ eventData: { reason, apiKeyId: apiKeyRow.id }
222
+ })
223
+ );
224
+ } catch (e) {
225
+ this.logger.error(e, { message: "IdP session revalidation: writing the idp_session_revoked audit entry failed", idpSessionId: row.id });
226
+ }
162
227
  }
163
228
  resolveConfig(configuration) {
164
229
  const raw = configuration.revalidation ?? {};
@@ -1 +1 @@
1
- {"version":3,"file":"IdpSessionRevalidator.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/service/idp/IdpSessionRevalidator.ts"],"sourcesContent":["import { DatabaseContext } from '../../utils/index.js'\nimport { ApiKeyRequestInfo } from '../../commands/index.js'\nimport { ApiKeyRow } from '../../queries/apiKey/ApiKeyQuery.js'\nimport { IdpSessionByApiKeyQuery, IdpSessionRow } from '../../queries/idp/IdpSessionByApiKeyQuery.js'\nimport { IDPHandlerRegistry } from './IDPHandlerRegistry.js'\nimport { ClaimIdpRevalidationCommand } from '../../commands/idp/ClaimIdpRevalidationCommand.js'\nimport { UpdateIdpSessionCommand } from '../../commands/idp/UpdateIdpSessionCommand.js'\nimport { DisableApiKeyCommand } from '../../commands/index.js'\nimport { CreateAuthLogEntryCommand } from '../../commands/authLog/CreateAuthLogEntryCommand.js'\nimport { REVALIDATION_DEFAULT_FALLBACK_INTERVAL, REVALIDATION_DEFAULT_MIN_INTERVAL, REVALIDATION_DEFAULT_SOFT_THRESHOLD } from './IDPRevalidation.js'\nimport { IdentityProviderHandler, RevalidationResult } from './IdentityProviderHandler.js'\n\nexport type RevalidationOutcome = 'valid' | 'revoked'\n\ntype ResolvedRevalidationConfig = {\n\tenabled: boolean\n\tsoftThreshold: number\n\tminInterval: string\n\tfallbackInterval: string\n\tmode: 'auto' | 'blocking'\n}\n\n/**\n * Decision for the current request: whether to attempt a revalidation, and if so whether it\n * must block the request. `claimInterval` is the single-flight floor for the atomic claim.\n */\ntype Decision = null | { blocking: boolean; claimInterval: string }\n\n/**\n * Re-validates IdP-backed sessions against their identity provider on the verify hot path\n * (A24). Invoked from `ApiKeyManager.verifyAndProlong`. Operates entirely through the supplied\n * database contexts and the command bus, so it does not depend on `ApiKeyManager` (no DI cycle).\n *\n * The cadence is driven by the **access-token lifetime**, not a fixed interval:\n * - while the token is fresh (before `softRefreshThreshold` of its lifetime) → skip, free;\n * - past the threshold but not yet expired → a proactive **background (SWR)** refresh, so the\n * request keeps zero added latency and the token is renewed before it dies;\n * - once the token has actually expired → a **blocking** refresh (we can't serve a dead token).\n * `mode: 'blocking'` forces every revalidation synchronous (zero revocation lag). When the IdP\n * returns no token expiry, falls back to a plain `fallbackInterval` background throttle.\n */\nexport class IdpSessionRevalidator {\n\tconstructor(\n\t\tprivate readonly idpRegistry: IDPHandlerRegistry,\n\t) {\n\t}\n\n\tasync revalidate(\n\t\tdbContext: DatabaseContext,\n\t\treadDbContext: DatabaseContext,\n\t\tapiKeyRow: ApiKeyRow,\n\t\trequestInfo?: ApiKeyRequestInfo,\n\t): Promise<RevalidationOutcome> {\n\t\tconst row = await readDbContext.queryHandler.fetch(new IdpSessionByApiKeyQuery(apiKeyRow.id, readDbContext.providers))\n\t\tif (!row) {\n\t\t\t// not a federated session (password / IdP without revalidation) — fast no-op\n\t\t\treturn 'valid'\n\t\t}\n\n\t\tconst config = this.resolveConfig(row.providerConfiguration)\n\t\tif (!config.enabled) {\n\t\t\treturn 'valid'\n\t\t}\n\n\t\t// A disabled IdP no longer vouches for its sessions.\n\t\tif (row.providerDisabledAt) {\n\t\t\tawait this.revoke(dbContext, apiKeyRow, row, 'idp_disabled', requestInfo)\n\t\t\treturn 'revoked'\n\t\t}\n\n\t\tconst handler = this.idpRegistry.getHandlerOrNull(row.providerType)\n\t\tif (!handler?.revalidate) {\n\t\t\t// provider can't actively re-validate (e.g. SAML) — rely on expiry / SLO\n\t\t\treturn 'valid'\n\t\t}\n\n\t\tconst decision = this.decide(row, config, dbContext.providers.now())\n\t\tif (!decision) {\n\t\t\t// token still fresh — vouched for, no IdP call\n\t\t\treturn 'valid'\n\t\t}\n\n\t\t// Atomic claim = single-flight. Loser (within the floor window, or lost the race) serves stale.\n\t\tlet claimed: boolean\n\t\ttry {\n\t\t\tclaimed = await dbContext.commandBus.execute(new ClaimIdpRevalidationCommand(row.id, decision.claimInterval))\n\t\t} catch {\n\t\t\t// invalid interval string or transient DB error — fail open, retry next request\n\t\t\treturn 'valid'\n\t\t}\n\t\tif (!claimed) {\n\t\t\treturn 'valid'\n\t\t}\n\n\t\tif (decision.blocking) {\n\t\t\treturn await this.runRevalidation(dbContext, handler, row, apiKeyRow, requestInfo)\n\t\t}\n\n\t\t// SWR: serve this request from the (still valid) token, refresh after the response.\n\t\t// The work runs detached (after the response is sent), so any rejection — a transient\n\t\t// DB error in the revoke / persist writes, a corrupt-config throw — must be swallowed\n\t\t// here; otherwise it becomes an unhandledRejection and can take the worker down. The\n\t\t// session is simply kept and re-tried on a later request (the claim floor throttles).\n\t\tsetImmediate(() => {\n\t\t\tthis.runRevalidation(dbContext, handler, row, apiKeyRow, requestInfo).catch(() => {})\n\t\t})\n\t\treturn 'valid'\n\t}\n\n\t/**\n\t * Decide whether (and how) to revalidate, purely from timestamps — no interval parsing in\n\t * JS (the claim handles intervals in SQL). Returns null to skip.\n\t */\n\tprivate decide(row: IdpSessionRow, config: ResolvedRevalidationConfig, now: Date): Decision {\n\t\tconst expiresAt = row.session.expiresAt\n\t\tconst obtainedAt = row.tokenObtainedAt\n\n\t\t// No lifetime info from the IdP → plain background throttle on fallbackInterval.\n\t\tif (!expiresAt || !obtainedAt) {\n\t\t\treturn { blocking: config.mode === 'blocking', claimInterval: config.fallbackInterval }\n\t\t}\n\n\t\tconst lifetimeMs = expiresAt.getTime() - obtainedAt.getTime()\n\t\tconst softAtMs = obtainedAt.getTime() + lifetimeMs * config.softThreshold\n\t\tconst nowMs = now.getTime()\n\n\t\tif (nowMs < softAtMs) {\n\t\t\treturn null // still within the trusted window\n\t\t}\n\n\t\tconst expired = nowMs >= expiresAt.getTime()\n\t\treturn { blocking: config.mode === 'blocking' || expired, claimInterval: config.minInterval }\n\t}\n\n\tprivate async runRevalidation(\n\t\tdbContext: DatabaseContext,\n\t\thandler: IdentityProviderHandler<{}>,\n\t\trow: IdpSessionRow,\n\t\tapiKeyRow: ApiKeyRow,\n\t\trequestInfo?: ApiKeyRequestInfo,\n\t): Promise<RevalidationOutcome> {\n\t\tlet config: {}\n\t\ttry {\n\t\t\tconfig = handler.validateConfiguration(row.providerConfiguration)\n\t\t} catch {\n\t\t\t// corrupt stored config — must NOT revoke; keep the session and retry later. Audit\n\t\t\t// it so the operator can tell \"vouched for\" apart from \"silently broken\" (without an\n\t\t\t// entry, a config typo disables re-validation invisibly for the life of every session).\n\t\t\tawait this.logRevalidationFailed(dbContext, apiKeyRow, row, 'config_invalid', requestInfo)\n\t\t\treturn 'valid'\n\t\t}\n\n\t\tlet result: RevalidationResult\n\t\ttry {\n\t\t\tresult = await handler.revalidate!(config, row.session)\n\t\t} catch {\n\t\t\t// transient failure (network / IdP down) — must NOT revoke; keep the session and retry\n\t\t\t// on a later request (the claim floor prevents hammering the IdP). Audited (throttled\n\t\t\t// to one entry per claim window) so a prolonged IdP outage is visible rather than a\n\t\t\t// silent fail-open.\n\t\t\tawait this.logRevalidationFailed(dbContext, apiKeyRow, row, 'revalidation_error', requestInfo)\n\t\t\treturn 'valid'\n\t\t}\n\n\t\tif (result.status === 'revoked') {\n\t\t\tawait this.revoke(dbContext, apiKeyRow, row, result.reason, requestInfo)\n\t\t\treturn 'revoked'\n\t\t}\n\n\t\t// Still valid — persist the rotated token (resets the lifetime reference) / refreshed\n\t\t// expiry. A rotation is a real, low-frequency event (token-lifetime cadence), so we\n\t\t// audit it as `idp_session_revalidated`; the no-op userinfo/introspection probes\n\t\t// (no rotated session) are intentionally NOT logged to keep the audit log usable.\n\t\t//\n\t\t// The IdP has already vouched for the session, so these post-success writes are pure\n\t\t// best-effort bookkeeping (they only reset the SWR cadence reference). A transient DB\n\t\t// error or an `encrypt()` throw here must NOT fail the request — otherwise a blocking\n\t\t// revalidation fails closed on a successful refresh, contradicting \"fail open\" (the SWR\n\t\t// path already swallows this). Keep the existing row; the claim floor throttles a retry.\n\t\tif (result.idpSession) {\n\t\t\ttry {\n\t\t\t\tawait dbContext.commandBus.execute(new UpdateIdpSessionCommand(row.id, result.idpSession))\n\t\t\t\tawait this.logRevalidated(dbContext, apiKeyRow, row, requestInfo)\n\t\t\t} catch {\n\t\t\t\t// fall through — session stays valid, persist retried on a later request\n\t\t\t}\n\t\t}\n\t\treturn 'valid'\n\t}\n\n\tprivate async logRevalidated(dbContext: DatabaseContext, apiKeyRow: ApiKeyRow, row: IdpSessionRow, requestInfo?: ApiKeyRequestInfo): Promise<void> {\n\t\tawait dbContext.commandBus.execute(\n\t\t\tnew CreateAuthLogEntryCommand({\n\t\t\t\ttype: 'idp_session_revalidated',\n\t\t\t\tinvokedById: apiKeyRow.identity_id,\n\t\t\t\tpersonId: apiKeyRow.person_id ?? undefined,\n\t\t\t\tidentityProviderId: row.identityProviderId,\n\t\t\t\tpersonTokenId: apiKeyRow.id,\n\t\t\t\tsuccess: true,\n\t\t\t\tipAddress: requestInfo?.ip,\n\t\t\t\tuserAgent: requestInfo?.userAgent,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Audit a fail-open: the IdP couldn't be consulted (transient outage) or the stored config is\n\t * corrupt, so we kept the session rather than revoking it. Naturally throttled to one entry\n\t * per claim window (we only reach here after a successful claim, which bumps\n\t * `last_validated_at`). The write is best-effort and self-contained — a failure to audit must\n\t * never propagate and fail a blocking verify request (the whole point of failing open).\n\t */\n\tprivate async logRevalidationFailed(\n\t\tdbContext: DatabaseContext,\n\t\tapiKeyRow: ApiKeyRow,\n\t\trow: IdpSessionRow,\n\t\terrorCode: 'config_invalid' | 'revalidation_error',\n\t\trequestInfo?: ApiKeyRequestInfo,\n\t): Promise<void> {\n\t\ttry {\n\t\t\tawait dbContext.commandBus.execute(\n\t\t\t\tnew CreateAuthLogEntryCommand({\n\t\t\t\t\ttype: 'idp_session_revalidation_failed',\n\t\t\t\t\tinvokedById: apiKeyRow.identity_id,\n\t\t\t\t\tpersonId: apiKeyRow.person_id ?? undefined,\n\t\t\t\t\tidentityProviderId: row.identityProviderId,\n\t\t\t\t\tpersonTokenId: apiKeyRow.id,\n\t\t\t\t\t// not a security failure (the session is kept) — a fail-open marker the operator\n\t\t\t\t\t// can alert on. `success: true` keeps it out of the failed-login funnels.\n\t\t\t\t\tsuccess: true,\n\t\t\t\t\terrorCode,\n\t\t\t\t\tipAddress: requestInfo?.ip,\n\t\t\t\t\tuserAgent: requestInfo?.userAgent,\n\t\t\t\t}),\n\t\t\t)\n\t\t} catch {\n\t\t\t// best-effort observability — never fail the request because the audit write failed\n\t\t}\n\t}\n\n\tprivate async revoke(\n\t\tdbContext: DatabaseContext,\n\t\tapiKeyRow: ApiKeyRow,\n\t\trow: IdpSessionRow,\n\t\treason: string,\n\t\trequestInfo?: ApiKeyRequestInfo,\n\t): Promise<void> {\n\t\tawait dbContext.commandBus.execute(new DisableApiKeyCommand(apiKeyRow.id))\n\t\tawait dbContext.commandBus.execute(\n\t\t\tnew CreateAuthLogEntryCommand({\n\t\t\t\ttype: 'idp_session_revoked',\n\t\t\t\tinvokedById: apiKeyRow.identity_id,\n\t\t\t\tpersonId: apiKeyRow.person_id ?? undefined,\n\t\t\t\tidentityProviderId: row.identityProviderId,\n\t\t\t\tpersonTokenId: apiKeyRow.id,\n\t\t\t\tsuccess: false,\n\t\t\t\terrorCode: reason,\n\t\t\t\tipAddress: requestInfo?.ip,\n\t\t\t\tuserAgent: requestInfo?.userAgent,\n\t\t\t\t// the action payload belongs in `event_data` (where every other audit event puts\n\t\t\t\t// it and where the admin UI / AuthLogQueryResolver reads it); `metadata` is for\n\t\t\t\t// transport context (forwarder IP/UA).\n\t\t\t\teventData: { reason },\n\t\t\t}),\n\t\t)\n\t}\n\n\tprivate resolveConfig(configuration: Record<string, unknown>): ResolvedRevalidationConfig {\n\t\tconst raw = (configuration.revalidation ?? {}) as Record<string, unknown>\n\t\tconst threshold = typeof raw.softRefreshThreshold === 'number' && raw.softRefreshThreshold > 0 && raw.softRefreshThreshold <= 1\n\t\t\t? raw.softRefreshThreshold\n\t\t\t: REVALIDATION_DEFAULT_SOFT_THRESHOLD\n\t\treturn {\n\t\t\tenabled: raw.enabled === true,\n\t\t\tsoftThreshold: threshold,\n\t\t\tminInterval: typeof raw.minInterval === 'string' ? raw.minInterval : REVALIDATION_DEFAULT_MIN_INTERVAL,\n\t\t\tfallbackInterval: typeof raw.fallbackInterval === 'string' ? raw.fallbackInterval : REVALIDATION_DEFAULT_FALLBACK_INTERVAL,\n\t\t\tmode: raw.mode === 'blocking' ? 'blocking' : 'auto',\n\t\t}\n\t}\n}\n"],"names":["IdpSessionByApiKeyQuery","ClaimIdpRevalidationCommand","UpdateIdpSessionCommand","CreateAuthLogEntryCommand","DisableApiKeyCommand","REVALIDATION_DEFAULT_SOFT_THRESHOLD","REVALIDATION_DEFAULT_MIN_INTERVAL","REVALIDATION_DEFAULT_FALLBACK_INTERVAL"],"mappings":"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"}
1
+ {"version":3,"file":"IdpSessionRevalidator.cjs","sources":["../../../../../../../packages/engine-tenant-api/src/model/service/idp/IdpSessionRevalidator.ts"],"sourcesContent":["import { DatabaseContext } from '../../utils/index.js'\nimport { ApiKeyRequestInfo } from '../../commands/index.js'\nimport { ApiKeyRow } from '../../queries/apiKey/ApiKeyQuery.js'\nimport { IdpSessionByApiKeyQuery, IdpSessionRow } from '../../queries/idp/IdpSessionByApiKeyQuery.js'\nimport { IDPHandlerRegistry } from './IDPHandlerRegistry.js'\nimport { ClaimIdpRevalidationCommand } from '../../commands/idp/ClaimIdpRevalidationCommand.js'\nimport { UpdateIdpSessionCommand } from '../../commands/idp/UpdateIdpSessionCommand.js'\nimport { DisableApiKeyCommand } from '../../commands/index.js'\nimport { CreateAuthLogEntryCommand } from '../../commands/authLog/CreateAuthLogEntryCommand.js'\nimport { REVALIDATION_DEFAULT_FALLBACK_INTERVAL, REVALIDATION_DEFAULT_MIN_INTERVAL, REVALIDATION_DEFAULT_SOFT_THRESHOLD } from './IDPRevalidation.js'\nimport { IdentityProviderHandler, RevalidationResult } from './IdentityProviderHandler.js'\nimport { IDPClaimSyncService } from './IDPClaimSyncService.js'\nimport { Logger } from '@contember/logger'\nimport { parseClaimMapping } from './ClaimMapping.js'\nimport { JSONValue } from '@contember/schema'\n\nexport type RevalidationOutcome = 'valid' | 'revoked'\n\ntype ResolvedRevalidationConfig = {\n\tenabled: boolean\n\tsoftThreshold: number\n\tminInterval: string\n\tfallbackInterval: string\n\tmode: 'auto' | 'blocking'\n}\n\n/**\n * Decision for the current request: whether to attempt a revalidation, and if so whether it\n * must block the request. `claimInterval` is the single-flight floor for the atomic claim.\n */\ntype Decision = null | { blocking: boolean; claimInterval: string }\n\n/**\n * Re-validates IdP-backed sessions against their identity provider on the verify hot path\n * (A24). Invoked from `ApiKeyManager.verifyAndProlong`. Operates entirely through the supplied\n * database contexts and the command bus, so it does not depend on `ApiKeyManager` (no DI cycle).\n *\n * The cadence is driven by the **access-token lifetime**, not a fixed interval:\n * - while the token is fresh (before `softRefreshThreshold` of its lifetime) → skip, free;\n * - past the threshold but not yet expired → a proactive **background (SWR)** refresh, so the\n * request keeps zero added latency and the token is renewed before it dies;\n * - once the token has actually expired → a **blocking** refresh (we can't serve a dead token).\n * `mode: 'blocking'` forces every revalidation synchronous (zero revocation lag). When the IdP\n * returns no token expiry, falls back to a plain `fallbackInterval` background throttle.\n */\nexport class IdpSessionRevalidator {\n\tconstructor(\n\t\tprivate readonly idpRegistry: IDPHandlerRegistry,\n\t\tprivate readonly claimSyncService: IDPClaimSyncService,\n\t\tprivate readonly logger: Logger,\n\t) {\n\t}\n\n\tasync revalidate(\n\t\tdbContext: DatabaseContext,\n\t\treadDbContext: DatabaseContext,\n\t\tapiKeyRow: ApiKeyRow,\n\t\trequestInfo?: ApiKeyRequestInfo,\n\t): Promise<RevalidationOutcome> {\n\t\tconst row = await readDbContext.queryHandler.fetch(new IdpSessionByApiKeyQuery(apiKeyRow.id, readDbContext.providers))\n\t\tif (!row) {\n\t\t\t// not a federated session (password / IdP without revalidation) — fast no-op\n\t\t\treturn 'valid'\n\t\t}\n\n\t\tconst config = this.resolveConfig(row.providerConfiguration)\n\t\tif (!config.enabled) {\n\t\t\treturn 'valid'\n\t\t}\n\n\t\t// A disabled IdP no longer vouches for its sessions.\n\t\tif (row.providerDisabledAt) {\n\t\t\tawait this.revoke(dbContext, apiKeyRow, row, 'idp_disabled', requestInfo)\n\t\t\treturn 'revoked'\n\t\t}\n\n\t\tconst handler = this.idpRegistry.getHandlerOrNull(row.providerType)\n\t\tif (!handler?.revalidate) {\n\t\t\t// provider can't actively re-validate (e.g. SAML) — rely on expiry / SLO\n\t\t\treturn 'valid'\n\t\t}\n\n\t\tconst decision = this.decide(row, config, dbContext.providers.now())\n\t\tif (!decision) {\n\t\t\t// token still fresh — vouched for, no IdP call\n\t\t\treturn 'valid'\n\t\t}\n\n\t\t// Atomic claim = single-flight. Loser (within the floor window, or lost the race) serves stale.\n\t\tlet claimed: boolean\n\t\ttry {\n\t\t\tclaimed = await dbContext.commandBus.execute(new ClaimIdpRevalidationCommand(row.id, decision.claimInterval))\n\t\t} catch (e) {\n\t\t\tthis.logger.warn(e, { message: 'IdP session revalidation: claim failed', idpSessionId: row.id })\n\t\t\t// invalid interval string or transient DB error — fail open, retry next request\n\t\t\treturn 'valid'\n\t\t}\n\t\tif (!claimed) {\n\t\t\treturn 'valid'\n\t\t}\n\n\t\tif (decision.blocking) {\n\t\t\treturn await this.runRevalidation(dbContext, handler, row, apiKeyRow, requestInfo)\n\t\t}\n\n\t\t// SWR: serve this request from the (still valid) token, refresh after the response.\n\t\t// The work runs detached (after the response is sent), so any rejection — a transient\n\t\t// DB error in the revoke / persist writes, a corrupt-config throw — must be swallowed\n\t\t// here; otherwise it becomes an unhandledRejection and can take the worker down. The\n\t\t// session is simply kept and re-tried on a later request (the claim floor throttles).\n\t\tsetImmediate(() => {\n\t\t\tthis.runRevalidation(dbContext, handler, row, apiKeyRow, requestInfo).catch(e => {\n\t\t\t\tthis.logger.error(e, { message: 'IdP session revalidation: background run failed', idpSessionId: row.id })\n\t\t\t})\n\t\t})\n\t\treturn 'valid'\n\t}\n\n\t/**\n\t * Decide whether (and how) to revalidate, purely from timestamps — no interval parsing in\n\t * JS (the claim handles intervals in SQL). Returns null to skip.\n\t */\n\tprivate decide(row: IdpSessionRow, config: ResolvedRevalidationConfig, now: Date): Decision {\n\t\tconst expiresAt = row.session.expiresAt\n\t\tconst obtainedAt = row.tokenObtainedAt\n\n\t\t// No lifetime info from the IdP → plain background throttle on fallbackInterval.\n\t\tif (!expiresAt || !obtainedAt) {\n\t\t\treturn { blocking: config.mode === 'blocking', claimInterval: config.fallbackInterval }\n\t\t}\n\n\t\tconst lifetimeMs = expiresAt.getTime() - obtainedAt.getTime()\n\t\tconst softAtMs = obtainedAt.getTime() + lifetimeMs * config.softThreshold\n\t\tconst nowMs = now.getTime()\n\n\t\tif (nowMs < softAtMs) {\n\t\t\treturn null // still within the trusted window\n\t\t}\n\n\t\tconst expired = nowMs >= expiresAt.getTime()\n\t\treturn { blocking: config.mode === 'blocking' || expired, claimInterval: config.minInterval }\n\t}\n\n\tprivate async runRevalidation(\n\t\tdbContext: DatabaseContext,\n\t\thandler: IdentityProviderHandler<{}>,\n\t\trow: IdpSessionRow,\n\t\tapiKeyRow: ApiKeyRow,\n\t\trequestInfo?: ApiKeyRequestInfo,\n\t): Promise<RevalidationOutcome> {\n\t\tlet config: {}\n\t\ttry {\n\t\t\tconfig = handler.validateConfiguration(row.providerConfiguration)\n\t\t} catch (e) {\n\t\t\tthis.logger.warn(e, { message: 'IdP session revalidation: stored configuration is invalid', idpSessionId: row.id })\n\t\t\t// corrupt stored config — must NOT revoke; keep the session and retry later. Audit\n\t\t\t// it so the operator can tell \"vouched for\" apart from \"silently broken\" (without an\n\t\t\t// entry, a config typo disables re-validation invisibly for the life of every session).\n\t\t\tawait this.logRevalidationFailed(dbContext, apiKeyRow, row, 'config_invalid', requestInfo)\n\t\t\treturn 'valid'\n\t\t}\n\n\t\tlet result: RevalidationResult\n\t\ttry {\n\t\t\tresult = await handler.revalidate!(config, row.session)\n\t\t} catch (e) {\n\t\t\tthis.logger.warn(e, { message: 'IdP session revalidation: identity provider call failed', idpSessionId: row.id })\n\t\t\t// transient failure (network / IdP down) — must NOT revoke; keep the session and retry\n\t\t\t// on a later request (the claim floor prevents hammering the IdP). Audited (throttled\n\t\t\t// to one entry per claim window) so a prolonged IdP outage is visible rather than a\n\t\t\t// silent fail-open.\n\t\t\tawait this.logRevalidationFailed(dbContext, apiKeyRow, row, 'revalidation_error', requestInfo)\n\t\t\treturn 'valid'\n\t\t}\n\n\t\tif (result.status === 'revoked') {\n\t\t\tawait this.revoke(dbContext, apiKeyRow, row, result.reason, requestInfo)\n\t\t\treturn 'revoked'\n\t\t}\n\n\t\t// Still valid — persist the rotated token (resets the lifetime reference) / refreshed\n\t\t// expiry. A rotation is a real, low-frequency event (token-lifetime cadence), so we\n\t\t// audit it as `idp_session_revalidated`; the no-op userinfo/introspection probes\n\t\t// (no rotated session) are intentionally NOT logged to keep the audit log usable.\n\t\t//\n\t\t// The IdP has already vouched for the session, so these post-success writes are pure\n\t\t// best-effort bookkeeping (they only reset the SWR cadence reference). A transient DB\n\t\t// error or an `encrypt()` throw here must NOT fail the request — otherwise a blocking\n\t\t// revalidation fails closed on a successful refresh, contradicting \"fail open\" (the SWR\n\t\t// path already swallows this). Keep the existing row; the claim floor throttles a retry.\n\t\tif (result.idpSession) {\n\t\t\ttry {\n\t\t\t\tawait dbContext.commandBus.execute(new UpdateIdpSessionCommand(row.id, result.idpSession))\n\t\t\t\tawait this.logRevalidated(dbContext, apiKeyRow, row, requestInfo)\n\t\t\t} catch (e) {\n\t\t\t\tthis.logger.error(e, { message: 'IdP session revalidation: persisting the rotated session failed', idpSessionId: row.id })\n\t\t\t\t// fall through — session stays valid, persist retried on a later request\n\t\t\t}\n\t\t}\n\n\t\t// A09 — re-apply the IdP's claim mapping when the refresh returned fresh claims, so an `always`\n\t\t// mapping keeps an established session's project memberships in sync with the IdP's current claims\n\t\t// without requiring a full re-login. `sticky` mappings self-skip (the sync passes isNewPerson=false).\n\t\t// `claimsComplete` tells the sync whether the refresh rebuilt sign-in's full claim surface, so it can\n\t\t// reconcile (incl. `unmatched: \"remove\"`) exactly like sign-in. Strictly fail-open — see `syncClaims`.\n\t\tif (result.claims) {\n\t\t\tawait this.syncClaims(dbContext, row, apiKeyRow, result.claims, result.claimsComplete === true, requestInfo)\n\t\t}\n\t\treturn 'valid'\n\t}\n\n\t/**\n\t * Re-apply the claim mapping on a successful refresh. Runs in its own transaction (atomic apply of\n\t * the membership changes) and never throws: the IdP has already vouched for the session, so a\n\t * malformed mapping or a transient apply error must not revoke or fail it. A real membership change\n\t * is audited as `idp_role_mapped`; a failure is audited as `idp_role_mapping_failed` (fail-open\n\t * marker), mirroring the sign-in path. `claimsComplete` carries whether the refresh rebuilt sign-in's\n\t * full claim surface (so removal reconciliation is safe) — see `allowRemoval` below.\n\t */\n\tprivate async syncClaims(\n\t\tdbContext: DatabaseContext,\n\t\trow: IdpSessionRow,\n\t\tapiKeyRow: ApiKeyRow,\n\t\tclaims: Record<string, unknown>,\n\t\tclaimsComplete: boolean,\n\t\trequestInfo?: ApiKeyRequestInfo,\n\t): Promise<void> {\n\t\ttry {\n\t\t\tconst mapping = parseClaimMapping(row.providerConfiguration)\n\t\t\tif (!mapping) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// Atomic apply in its own transaction (the verify path has no surrounding one). `always`-only:\n\t\t\t// the sync passes isNewPerson=false, so a `sticky` mapping self-skips and returns a null audit.\n\t\t\t// Refresh mirrors sign-in as closely as the claim surface allows: when the provider returned its\n\t\t\t// COMPLETE surface (`claimsComplete` — `method: \"refresh\"` rebuilding sign-in's id-token + userinfo\n\t\t\t// merge), `unmatched: \"remove\"` reconciliation runs here too. A partial surface (a userinfo-only\n\t\t\t// probe, or a refresh whose userinfo fetch failed) passes `allowRemoval: false`, so refresh stays\n\t\t\t// additive-only and a membership the IdP still asserts is never stripped off an incomplete surface.\n\t\t\tconst { audit, droppedUnsafeRules } = await dbContext.transaction(db =>\n\t\t\t\tthis.claimSyncService.sync(db, mapping, claims, { id: apiKeyRow.identity_id }, false, { allowRemoval: claimsComplete })\n\t\t\t)\n\t\t\tif (audit) {\n\t\t\t\tawait this.logRoleMapping(dbContext, apiKeyRow, row, 'idp_role_mapped', audit, requestInfo)\n\t\t\t}\n\t\t\t// The apply-time safety backstop dropped a configured rule — emit the fail-open marker so a broken\n\t\t\t// mapping is visible on the refresh path too, mirroring sign-in (the marker carries no claim values).\n\t\t\tif (droppedUnsafeRules) {\n\t\t\t\tawait this.logRoleMapping(dbContext, apiKeyRow, row, 'idp_role_mapping_failed', undefined, requestInfo)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tthis.logger.warn(e, { message: 'IdP session revalidation: claim mapping sync failed', idpSessionId: row.id })\n\t\t\t// Strictly fail-open: a malformed mapping or a transient apply error must never revoke or\n\t\t\t// fail an already-vouched-for session. The transaction rolls back any partial apply.\n\t\t\tawait this.logRoleMapping(dbContext, apiKeyRow, row, 'idp_role_mapping_failed', undefined, requestInfo)\n\t\t}\n\t}\n\n\tprivate async logRoleMapping(\n\t\tdbContext: DatabaseContext,\n\t\tapiKeyRow: ApiKeyRow,\n\t\trow: IdpSessionRow,\n\t\ttype: 'idp_role_mapped' | 'idp_role_mapping_failed',\n\t\teventData: JSONValue | undefined,\n\t\trequestInfo?: ApiKeyRequestInfo,\n\t): Promise<void> {\n\t\ttry {\n\t\t\tawait dbContext.commandBus.execute(\n\t\t\t\tnew CreateAuthLogEntryCommand({\n\t\t\t\t\ttype,\n\t\t\t\t\tinvokedById: apiKeyRow.identity_id,\n\t\t\t\t\tpersonId: apiKeyRow.person_id ?? undefined,\n\t\t\t\t\t// The membership change affects this session's own person — record it as the target too,\n\t\t\t\t\t// so an admin querying membership changes by target_person_id sees IdP-driven grants/revokes\n\t\t\t\t\t// (consistent with the project_membership_* audit events).\n\t\t\t\t\ttargetPersonId: apiKeyRow.person_id ?? undefined,\n\t\t\t\t\tidentityProviderId: row.identityProviderId,\n\t\t\t\t\tsuccess: true,\n\t\t\t\t\teventData,\n\t\t\t\t\tipAddress: requestInfo?.ip,\n\t\t\t\t\tuserAgent: requestInfo?.userAgent,\n\t\t\t\t}),\n\t\t\t)\n\t\t} catch (e) {\n\t\t\tthis.logger.error(e, { message: `IdP session revalidation: writing the ${type} audit entry failed`, idpSessionId: row.id })\n\t\t\t// best-effort audit — never fail the request because the audit write failed\n\t\t}\n\t}\n\n\tprivate async logRevalidated(dbContext: DatabaseContext, apiKeyRow: ApiKeyRow, row: IdpSessionRow, requestInfo?: ApiKeyRequestInfo): Promise<void> {\n\t\tawait dbContext.commandBus.execute(\n\t\t\tnew CreateAuthLogEntryCommand({\n\t\t\t\ttype: 'idp_session_revalidated',\n\t\t\t\tinvokedById: apiKeyRow.identity_id,\n\t\t\t\tpersonId: apiKeyRow.person_id ?? undefined,\n\t\t\t\tidentityProviderId: row.identityProviderId,\n\t\t\t\tsuccess: true,\n\t\t\t\tipAddress: requestInfo?.ip,\n\t\t\t\tuserAgent: requestInfo?.userAgent,\n\t\t\t\teventData: { apiKeyId: apiKeyRow.id },\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Audit a fail-open: the IdP couldn't be consulted (transient outage) or the stored config is\n\t * corrupt, so we kept the session rather than revoking it. Naturally throttled to one entry\n\t * per claim window (we only reach here after a successful claim, which bumps\n\t * `last_validated_at`). The write is best-effort and self-contained — a failure to audit must\n\t * never propagate and fail a blocking verify request (the whole point of failing open).\n\t */\n\tprivate async logRevalidationFailed(\n\t\tdbContext: DatabaseContext,\n\t\tapiKeyRow: ApiKeyRow,\n\t\trow: IdpSessionRow,\n\t\terrorCode: 'config_invalid' | 'revalidation_error',\n\t\trequestInfo?: ApiKeyRequestInfo,\n\t): Promise<void> {\n\t\ttry {\n\t\t\tawait dbContext.commandBus.execute(\n\t\t\t\tnew CreateAuthLogEntryCommand({\n\t\t\t\t\ttype: 'idp_session_revalidation_failed',\n\t\t\t\t\tinvokedById: apiKeyRow.identity_id,\n\t\t\t\t\tpersonId: apiKeyRow.person_id ?? undefined,\n\t\t\t\t\tidentityProviderId: row.identityProviderId,\n\t\t\t\t\t// not a security failure (the session is kept) — a fail-open marker the operator\n\t\t\t\t\t// can alert on. `success: true` keeps it out of the failed-login funnels.\n\t\t\t\t\tsuccess: true,\n\t\t\t\t\terrorCode,\n\t\t\t\t\tipAddress: requestInfo?.ip,\n\t\t\t\t\tuserAgent: requestInfo?.userAgent,\n\t\t\t\t\teventData: { apiKeyId: apiKeyRow.id },\n\t\t\t\t}),\n\t\t\t)\n\t\t} catch (e) {\n\t\t\tthis.logger.error(e, { message: 'IdP session revalidation: writing the idp_session_revalidation_failed audit entry failed', idpSessionId: row.id })\n\t\t\t// best-effort observability — never fail the request because the audit write failed\n\t\t}\n\t}\n\n\tprivate async revoke(\n\t\tdbContext: DatabaseContext,\n\t\tapiKeyRow: ApiKeyRow,\n\t\trow: IdpSessionRow,\n\t\treason: string,\n\t\trequestInfo?: ApiKeyRequestInfo,\n\t): Promise<void> {\n\t\tawait dbContext.commandBus.execute(new DisableApiKeyCommand(apiKeyRow.id))\n\t\ttry {\n\t\t\tawait dbContext.commandBus.execute(\n\t\t\t\tnew CreateAuthLogEntryCommand({\n\t\t\t\t\ttype: 'idp_session_revoked',\n\t\t\t\t\tinvokedById: apiKeyRow.identity_id,\n\t\t\t\t\tpersonId: apiKeyRow.person_id ?? undefined,\n\t\t\t\t\tidentityProviderId: row.identityProviderId,\n\t\t\t\t\tsuccess: false,\n\t\t\t\t\terrorCode: reason,\n\t\t\t\t\tipAddress: requestInfo?.ip,\n\t\t\t\t\tuserAgent: requestInfo?.userAgent,\n\t\t\t\t\t// the action payload belongs in `event_data` (where every other audit event puts\n\t\t\t\t\t// it and where the admin UI / AuthLogQueryResolver reads it); `metadata` is for\n\t\t\t\t\t// transport context (forwarder IP/UA).\n\t\t\t\t\teventData: { reason, apiKeyId: apiKeyRow.id },\n\t\t\t\t}),\n\t\t\t)\n\t\t} catch (e) {\n\t\t\tthis.logger.error(e, { message: 'IdP session revalidation: writing the idp_session_revoked audit entry failed', idpSessionId: row.id })\n\t\t\t// best-effort audit: the key is already disabled, so the request must still be answered\n\t\t\t// as revoked rather than fail on the audit write\n\t\t}\n\t}\n\n\tprivate resolveConfig(configuration: Record<string, unknown>): ResolvedRevalidationConfig {\n\t\tconst raw = (configuration.revalidation ?? {}) as Record<string, unknown>\n\t\tconst threshold = typeof raw.softRefreshThreshold === 'number' && raw.softRefreshThreshold > 0 && raw.softRefreshThreshold <= 1\n\t\t\t? raw.softRefreshThreshold\n\t\t\t: REVALIDATION_DEFAULT_SOFT_THRESHOLD\n\t\treturn {\n\t\t\tenabled: raw.enabled === true,\n\t\t\tsoftThreshold: threshold,\n\t\t\tminInterval: typeof raw.minInterval === 'string' ? raw.minInterval : REVALIDATION_DEFAULT_MIN_INTERVAL,\n\t\t\tfallbackInterval: typeof raw.fallbackInterval === 'string' ? raw.fallbackInterval : REVALIDATION_DEFAULT_FALLBACK_INTERVAL,\n\t\t\tmode: raw.mode === 'blocking' ? 'blocking' : 'auto',\n\t\t}\n\t}\n}\n"],"names":["IdpSessionByApiKeyQuery","ClaimIdpRevalidationCommand","UpdateIdpSessionCommand","parseClaimMapping","CreateAuthLogEntryCommand","DisableApiKeyCommand","REVALIDATION_DEFAULT_SOFT_THRESHOLD","REVALIDATION_DEFAULT_MIN_INTERVAL","REVALIDATION_DEFAULT_FALLBACK_INTERVAL"],"mappings":"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"}
@@ -7,9 +7,12 @@ import "node:crypto";
7
7
  import { DisableApiKeyCommand } from "../../commands/apiKey/DisableApiKeyCommand.js";
8
8
  import { CreateAuthLogEntryCommand } from "../../commands/authLog/CreateAuthLogEntryCommand.js";
9
9
  import { REVALIDATION_DEFAULT_SOFT_THRESHOLD, REVALIDATION_DEFAULT_FALLBACK_INTERVAL, REVALIDATION_DEFAULT_MIN_INTERVAL } from "./IDPRevalidation.js";
10
+ import { parseClaimMapping } from "./ClaimMapping.js";
10
11
  class IdpSessionRevalidator {
11
- constructor(idpRegistry) {
12
+ constructor(idpRegistry, claimSyncService, logger) {
12
13
  this.idpRegistry = idpRegistry;
14
+ this.claimSyncService = claimSyncService;
15
+ this.logger = logger;
13
16
  }
14
17
  async revalidate(dbContext, readDbContext, apiKeyRow, requestInfo) {
15
18
  const row = await readDbContext.queryHandler.fetch(new IdpSessionByApiKeyQuery(apiKeyRow.id, readDbContext.providers));
@@ -35,7 +38,8 @@ class IdpSessionRevalidator {
35
38
  let claimed;
36
39
  try {
37
40
  claimed = await dbContext.commandBus.execute(new ClaimIdpRevalidationCommand(row.id, decision.claimInterval));
38
- } catch {
41
+ } catch (e) {
42
+ this.logger.warn(e, { message: "IdP session revalidation: claim failed", idpSessionId: row.id });
39
43
  return "valid";
40
44
  }
41
45
  if (!claimed) {
@@ -45,7 +49,8 @@ class IdpSessionRevalidator {
45
49
  return await this.runRevalidation(dbContext, handler, row, apiKeyRow, requestInfo);
46
50
  }
47
51
  setImmediate(() => {
48
- this.runRevalidation(dbContext, handler, row, apiKeyRow, requestInfo).catch(() => {
52
+ this.runRevalidation(dbContext, handler, row, apiKeyRow, requestInfo).catch((e) => {
53
+ this.logger.error(e, { message: "IdP session revalidation: background run failed", idpSessionId: row.id });
49
54
  });
50
55
  });
51
56
  return "valid";
@@ -73,14 +78,16 @@ class IdpSessionRevalidator {
73
78
  let config;
74
79
  try {
75
80
  config = handler.validateConfiguration(row.providerConfiguration);
76
- } catch {
81
+ } catch (e) {
82
+ this.logger.warn(e, { message: "IdP session revalidation: stored configuration is invalid", idpSessionId: row.id });
77
83
  await this.logRevalidationFailed(dbContext, apiKeyRow, row, "config_invalid", requestInfo);
78
84
  return "valid";
79
85
  }
80
86
  let result;
81
87
  try {
82
88
  result = await handler.revalidate(config, row.session);
83
- } catch {
89
+ } catch (e) {
90
+ this.logger.warn(e, { message: "IdP session revalidation: identity provider call failed", idpSessionId: row.id });
84
91
  await this.logRevalidationFailed(dbContext, apiKeyRow, row, "revalidation_error", requestInfo);
85
92
  return "valid";
86
93
  }
@@ -92,11 +99,65 @@ class IdpSessionRevalidator {
92
99
  try {
93
100
  await dbContext.commandBus.execute(new UpdateIdpSessionCommand(row.id, result.idpSession));
94
101
  await this.logRevalidated(dbContext, apiKeyRow, row, requestInfo);
95
- } catch {
102
+ } catch (e) {
103
+ this.logger.error(e, { message: "IdP session revalidation: persisting the rotated session failed", idpSessionId: row.id });
96
104
  }
97
105
  }
106
+ if (result.claims) {
107
+ await this.syncClaims(dbContext, row, apiKeyRow, result.claims, result.claimsComplete === true, requestInfo);
108
+ }
98
109
  return "valid";
99
110
  }
111
+ /**
112
+ * Re-apply the claim mapping on a successful refresh. Runs in its own transaction (atomic apply of
113
+ * the membership changes) and never throws: the IdP has already vouched for the session, so a
114
+ * malformed mapping or a transient apply error must not revoke or fail it. A real membership change
115
+ * is audited as `idp_role_mapped`; a failure is audited as `idp_role_mapping_failed` (fail-open
116
+ * marker), mirroring the sign-in path. `claimsComplete` carries whether the refresh rebuilt sign-in's
117
+ * full claim surface (so removal reconciliation is safe) — see `allowRemoval` below.
118
+ */
119
+ async syncClaims(dbContext, row, apiKeyRow, claims, claimsComplete, requestInfo) {
120
+ try {
121
+ const mapping = parseClaimMapping(row.providerConfiguration);
122
+ if (!mapping) {
123
+ return;
124
+ }
125
+ const { audit, droppedUnsafeRules } = await dbContext.transaction(
126
+ (db) => this.claimSyncService.sync(db, mapping, claims, { id: apiKeyRow.identity_id }, false, { allowRemoval: claimsComplete })
127
+ );
128
+ if (audit) {
129
+ await this.logRoleMapping(dbContext, apiKeyRow, row, "idp_role_mapped", audit, requestInfo);
130
+ }
131
+ if (droppedUnsafeRules) {
132
+ await this.logRoleMapping(dbContext, apiKeyRow, row, "idp_role_mapping_failed", void 0, requestInfo);
133
+ }
134
+ } catch (e) {
135
+ this.logger.warn(e, { message: "IdP session revalidation: claim mapping sync failed", idpSessionId: row.id });
136
+ await this.logRoleMapping(dbContext, apiKeyRow, row, "idp_role_mapping_failed", void 0, requestInfo);
137
+ }
138
+ }
139
+ async logRoleMapping(dbContext, apiKeyRow, row, type, eventData, requestInfo) {
140
+ try {
141
+ await dbContext.commandBus.execute(
142
+ new CreateAuthLogEntryCommand({
143
+ type,
144
+ invokedById: apiKeyRow.identity_id,
145
+ personId: apiKeyRow.person_id ?? void 0,
146
+ // The membership change affects this session's own person — record it as the target too,
147
+ // so an admin querying membership changes by target_person_id sees IdP-driven grants/revokes
148
+ // (consistent with the project_membership_* audit events).
149
+ targetPersonId: apiKeyRow.person_id ?? void 0,
150
+ identityProviderId: row.identityProviderId,
151
+ success: true,
152
+ eventData,
153
+ ipAddress: requestInfo?.ip,
154
+ userAgent: requestInfo?.userAgent
155
+ })
156
+ );
157
+ } catch (e) {
158
+ this.logger.error(e, { message: `IdP session revalidation: writing the ${type} audit entry failed`, idpSessionId: row.id });
159
+ }
160
+ }
100
161
  async logRevalidated(dbContext, apiKeyRow, row, requestInfo) {
101
162
  await dbContext.commandBus.execute(
102
163
  new CreateAuthLogEntryCommand({
@@ -104,10 +165,10 @@ class IdpSessionRevalidator {
104
165
  invokedById: apiKeyRow.identity_id,
105
166
  personId: apiKeyRow.person_id ?? void 0,
106
167
  identityProviderId: row.identityProviderId,
107
- personTokenId: apiKeyRow.id,
108
168
  success: true,
109
169
  ipAddress: requestInfo?.ip,
110
- userAgent: requestInfo?.userAgent
170
+ userAgent: requestInfo?.userAgent,
171
+ eventData: { apiKeyId: apiKeyRow.id }
111
172
  })
112
173
  );
113
174
  }
@@ -126,37 +187,41 @@ class IdpSessionRevalidator {
126
187
  invokedById: apiKeyRow.identity_id,
127
188
  personId: apiKeyRow.person_id ?? void 0,
128
189
  identityProviderId: row.identityProviderId,
129
- personTokenId: apiKeyRow.id,
130
190
  // not a security failure (the session is kept) — a fail-open marker the operator
131
191
  // can alert on. `success: true` keeps it out of the failed-login funnels.
132
192
  success: true,
133
193
  errorCode,
134
194
  ipAddress: requestInfo?.ip,
135
- userAgent: requestInfo?.userAgent
195
+ userAgent: requestInfo?.userAgent,
196
+ eventData: { apiKeyId: apiKeyRow.id }
136
197
  })
137
198
  );
138
- } catch {
199
+ } catch (e) {
200
+ this.logger.error(e, { message: "IdP session revalidation: writing the idp_session_revalidation_failed audit entry failed", idpSessionId: row.id });
139
201
  }
140
202
  }
141
203
  async revoke(dbContext, apiKeyRow, row, reason, requestInfo) {
142
204
  await dbContext.commandBus.execute(new DisableApiKeyCommand(apiKeyRow.id));
143
- await dbContext.commandBus.execute(
144
- new CreateAuthLogEntryCommand({
145
- type: "idp_session_revoked",
146
- invokedById: apiKeyRow.identity_id,
147
- personId: apiKeyRow.person_id ?? void 0,
148
- identityProviderId: row.identityProviderId,
149
- personTokenId: apiKeyRow.id,
150
- success: false,
151
- errorCode: reason,
152
- ipAddress: requestInfo?.ip,
153
- userAgent: requestInfo?.userAgent,
154
- // the action payload belongs in `event_data` (where every other audit event puts
155
- // it and where the admin UI / AuthLogQueryResolver reads it); `metadata` is for
156
- // transport context (forwarder IP/UA).
157
- eventData: { reason }
158
- })
159
- );
205
+ try {
206
+ await dbContext.commandBus.execute(
207
+ new CreateAuthLogEntryCommand({
208
+ type: "idp_session_revoked",
209
+ invokedById: apiKeyRow.identity_id,
210
+ personId: apiKeyRow.person_id ?? void 0,
211
+ identityProviderId: row.identityProviderId,
212
+ success: false,
213
+ errorCode: reason,
214
+ ipAddress: requestInfo?.ip,
215
+ userAgent: requestInfo?.userAgent,
216
+ // the action payload belongs in `event_data` (where every other audit event puts
217
+ // it and where the admin UI / AuthLogQueryResolver reads it); `metadata` is for
218
+ // transport context (forwarder IP/UA).
219
+ eventData: { reason, apiKeyId: apiKeyRow.id }
220
+ })
221
+ );
222
+ } catch (e) {
223
+ this.logger.error(e, { message: "IdP session revalidation: writing the idp_session_revoked audit entry failed", idpSessionId: row.id });
224
+ }
160
225
  }
161
226
  resolveConfig(configuration) {
162
227
  const raw = configuration.revalidation ?? {};
@@ -1 +1 @@
1
- {"version":3,"file":"IdpSessionRevalidator.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/service/idp/IdpSessionRevalidator.ts"],"sourcesContent":["import { DatabaseContext } from '../../utils/index.js'\nimport { ApiKeyRequestInfo } from '../../commands/index.js'\nimport { ApiKeyRow } from '../../queries/apiKey/ApiKeyQuery.js'\nimport { IdpSessionByApiKeyQuery, IdpSessionRow } from '../../queries/idp/IdpSessionByApiKeyQuery.js'\nimport { IDPHandlerRegistry } from './IDPHandlerRegistry.js'\nimport { ClaimIdpRevalidationCommand } from '../../commands/idp/ClaimIdpRevalidationCommand.js'\nimport { UpdateIdpSessionCommand } from '../../commands/idp/UpdateIdpSessionCommand.js'\nimport { DisableApiKeyCommand } from '../../commands/index.js'\nimport { CreateAuthLogEntryCommand } from '../../commands/authLog/CreateAuthLogEntryCommand.js'\nimport { REVALIDATION_DEFAULT_FALLBACK_INTERVAL, REVALIDATION_DEFAULT_MIN_INTERVAL, REVALIDATION_DEFAULT_SOFT_THRESHOLD } from './IDPRevalidation.js'\nimport { IdentityProviderHandler, RevalidationResult } from './IdentityProviderHandler.js'\n\nexport type RevalidationOutcome = 'valid' | 'revoked'\n\ntype ResolvedRevalidationConfig = {\n\tenabled: boolean\n\tsoftThreshold: number\n\tminInterval: string\n\tfallbackInterval: string\n\tmode: 'auto' | 'blocking'\n}\n\n/**\n * Decision for the current request: whether to attempt a revalidation, and if so whether it\n * must block the request. `claimInterval` is the single-flight floor for the atomic claim.\n */\ntype Decision = null | { blocking: boolean; claimInterval: string }\n\n/**\n * Re-validates IdP-backed sessions against their identity provider on the verify hot path\n * (A24). Invoked from `ApiKeyManager.verifyAndProlong`. Operates entirely through the supplied\n * database contexts and the command bus, so it does not depend on `ApiKeyManager` (no DI cycle).\n *\n * The cadence is driven by the **access-token lifetime**, not a fixed interval:\n * - while the token is fresh (before `softRefreshThreshold` of its lifetime) → skip, free;\n * - past the threshold but not yet expired → a proactive **background (SWR)** refresh, so the\n * request keeps zero added latency and the token is renewed before it dies;\n * - once the token has actually expired → a **blocking** refresh (we can't serve a dead token).\n * `mode: 'blocking'` forces every revalidation synchronous (zero revocation lag). When the IdP\n * returns no token expiry, falls back to a plain `fallbackInterval` background throttle.\n */\nexport class IdpSessionRevalidator {\n\tconstructor(\n\t\tprivate readonly idpRegistry: IDPHandlerRegistry,\n\t) {\n\t}\n\n\tasync revalidate(\n\t\tdbContext: DatabaseContext,\n\t\treadDbContext: DatabaseContext,\n\t\tapiKeyRow: ApiKeyRow,\n\t\trequestInfo?: ApiKeyRequestInfo,\n\t): Promise<RevalidationOutcome> {\n\t\tconst row = await readDbContext.queryHandler.fetch(new IdpSessionByApiKeyQuery(apiKeyRow.id, readDbContext.providers))\n\t\tif (!row) {\n\t\t\t// not a federated session (password / IdP without revalidation) — fast no-op\n\t\t\treturn 'valid'\n\t\t}\n\n\t\tconst config = this.resolveConfig(row.providerConfiguration)\n\t\tif (!config.enabled) {\n\t\t\treturn 'valid'\n\t\t}\n\n\t\t// A disabled IdP no longer vouches for its sessions.\n\t\tif (row.providerDisabledAt) {\n\t\t\tawait this.revoke(dbContext, apiKeyRow, row, 'idp_disabled', requestInfo)\n\t\t\treturn 'revoked'\n\t\t}\n\n\t\tconst handler = this.idpRegistry.getHandlerOrNull(row.providerType)\n\t\tif (!handler?.revalidate) {\n\t\t\t// provider can't actively re-validate (e.g. SAML) — rely on expiry / SLO\n\t\t\treturn 'valid'\n\t\t}\n\n\t\tconst decision = this.decide(row, config, dbContext.providers.now())\n\t\tif (!decision) {\n\t\t\t// token still fresh — vouched for, no IdP call\n\t\t\treturn 'valid'\n\t\t}\n\n\t\t// Atomic claim = single-flight. Loser (within the floor window, or lost the race) serves stale.\n\t\tlet claimed: boolean\n\t\ttry {\n\t\t\tclaimed = await dbContext.commandBus.execute(new ClaimIdpRevalidationCommand(row.id, decision.claimInterval))\n\t\t} catch {\n\t\t\t// invalid interval string or transient DB error — fail open, retry next request\n\t\t\treturn 'valid'\n\t\t}\n\t\tif (!claimed) {\n\t\t\treturn 'valid'\n\t\t}\n\n\t\tif (decision.blocking) {\n\t\t\treturn await this.runRevalidation(dbContext, handler, row, apiKeyRow, requestInfo)\n\t\t}\n\n\t\t// SWR: serve this request from the (still valid) token, refresh after the response.\n\t\t// The work runs detached (after the response is sent), so any rejection — a transient\n\t\t// DB error in the revoke / persist writes, a corrupt-config throw — must be swallowed\n\t\t// here; otherwise it becomes an unhandledRejection and can take the worker down. The\n\t\t// session is simply kept and re-tried on a later request (the claim floor throttles).\n\t\tsetImmediate(() => {\n\t\t\tthis.runRevalidation(dbContext, handler, row, apiKeyRow, requestInfo).catch(() => {})\n\t\t})\n\t\treturn 'valid'\n\t}\n\n\t/**\n\t * Decide whether (and how) to revalidate, purely from timestamps — no interval parsing in\n\t * JS (the claim handles intervals in SQL). Returns null to skip.\n\t */\n\tprivate decide(row: IdpSessionRow, config: ResolvedRevalidationConfig, now: Date): Decision {\n\t\tconst expiresAt = row.session.expiresAt\n\t\tconst obtainedAt = row.tokenObtainedAt\n\n\t\t// No lifetime info from the IdP → plain background throttle on fallbackInterval.\n\t\tif (!expiresAt || !obtainedAt) {\n\t\t\treturn { blocking: config.mode === 'blocking', claimInterval: config.fallbackInterval }\n\t\t}\n\n\t\tconst lifetimeMs = expiresAt.getTime() - obtainedAt.getTime()\n\t\tconst softAtMs = obtainedAt.getTime() + lifetimeMs * config.softThreshold\n\t\tconst nowMs = now.getTime()\n\n\t\tif (nowMs < softAtMs) {\n\t\t\treturn null // still within the trusted window\n\t\t}\n\n\t\tconst expired = nowMs >= expiresAt.getTime()\n\t\treturn { blocking: config.mode === 'blocking' || expired, claimInterval: config.minInterval }\n\t}\n\n\tprivate async runRevalidation(\n\t\tdbContext: DatabaseContext,\n\t\thandler: IdentityProviderHandler<{}>,\n\t\trow: IdpSessionRow,\n\t\tapiKeyRow: ApiKeyRow,\n\t\trequestInfo?: ApiKeyRequestInfo,\n\t): Promise<RevalidationOutcome> {\n\t\tlet config: {}\n\t\ttry {\n\t\t\tconfig = handler.validateConfiguration(row.providerConfiguration)\n\t\t} catch {\n\t\t\t// corrupt stored config — must NOT revoke; keep the session and retry later. Audit\n\t\t\t// it so the operator can tell \"vouched for\" apart from \"silently broken\" (without an\n\t\t\t// entry, a config typo disables re-validation invisibly for the life of every session).\n\t\t\tawait this.logRevalidationFailed(dbContext, apiKeyRow, row, 'config_invalid', requestInfo)\n\t\t\treturn 'valid'\n\t\t}\n\n\t\tlet result: RevalidationResult\n\t\ttry {\n\t\t\tresult = await handler.revalidate!(config, row.session)\n\t\t} catch {\n\t\t\t// transient failure (network / IdP down) — must NOT revoke; keep the session and retry\n\t\t\t// on a later request (the claim floor prevents hammering the IdP). Audited (throttled\n\t\t\t// to one entry per claim window) so a prolonged IdP outage is visible rather than a\n\t\t\t// silent fail-open.\n\t\t\tawait this.logRevalidationFailed(dbContext, apiKeyRow, row, 'revalidation_error', requestInfo)\n\t\t\treturn 'valid'\n\t\t}\n\n\t\tif (result.status === 'revoked') {\n\t\t\tawait this.revoke(dbContext, apiKeyRow, row, result.reason, requestInfo)\n\t\t\treturn 'revoked'\n\t\t}\n\n\t\t// Still valid — persist the rotated token (resets the lifetime reference) / refreshed\n\t\t// expiry. A rotation is a real, low-frequency event (token-lifetime cadence), so we\n\t\t// audit it as `idp_session_revalidated`; the no-op userinfo/introspection probes\n\t\t// (no rotated session) are intentionally NOT logged to keep the audit log usable.\n\t\t//\n\t\t// The IdP has already vouched for the session, so these post-success writes are pure\n\t\t// best-effort bookkeeping (they only reset the SWR cadence reference). A transient DB\n\t\t// error or an `encrypt()` throw here must NOT fail the request — otherwise a blocking\n\t\t// revalidation fails closed on a successful refresh, contradicting \"fail open\" (the SWR\n\t\t// path already swallows this). Keep the existing row; the claim floor throttles a retry.\n\t\tif (result.idpSession) {\n\t\t\ttry {\n\t\t\t\tawait dbContext.commandBus.execute(new UpdateIdpSessionCommand(row.id, result.idpSession))\n\t\t\t\tawait this.logRevalidated(dbContext, apiKeyRow, row, requestInfo)\n\t\t\t} catch {\n\t\t\t\t// fall through — session stays valid, persist retried on a later request\n\t\t\t}\n\t\t}\n\t\treturn 'valid'\n\t}\n\n\tprivate async logRevalidated(dbContext: DatabaseContext, apiKeyRow: ApiKeyRow, row: IdpSessionRow, requestInfo?: ApiKeyRequestInfo): Promise<void> {\n\t\tawait dbContext.commandBus.execute(\n\t\t\tnew CreateAuthLogEntryCommand({\n\t\t\t\ttype: 'idp_session_revalidated',\n\t\t\t\tinvokedById: apiKeyRow.identity_id,\n\t\t\t\tpersonId: apiKeyRow.person_id ?? undefined,\n\t\t\t\tidentityProviderId: row.identityProviderId,\n\t\t\t\tpersonTokenId: apiKeyRow.id,\n\t\t\t\tsuccess: true,\n\t\t\t\tipAddress: requestInfo?.ip,\n\t\t\t\tuserAgent: requestInfo?.userAgent,\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Audit a fail-open: the IdP couldn't be consulted (transient outage) or the stored config is\n\t * corrupt, so we kept the session rather than revoking it. Naturally throttled to one entry\n\t * per claim window (we only reach here after a successful claim, which bumps\n\t * `last_validated_at`). The write is best-effort and self-contained — a failure to audit must\n\t * never propagate and fail a blocking verify request (the whole point of failing open).\n\t */\n\tprivate async logRevalidationFailed(\n\t\tdbContext: DatabaseContext,\n\t\tapiKeyRow: ApiKeyRow,\n\t\trow: IdpSessionRow,\n\t\terrorCode: 'config_invalid' | 'revalidation_error',\n\t\trequestInfo?: ApiKeyRequestInfo,\n\t): Promise<void> {\n\t\ttry {\n\t\t\tawait dbContext.commandBus.execute(\n\t\t\t\tnew CreateAuthLogEntryCommand({\n\t\t\t\t\ttype: 'idp_session_revalidation_failed',\n\t\t\t\t\tinvokedById: apiKeyRow.identity_id,\n\t\t\t\t\tpersonId: apiKeyRow.person_id ?? undefined,\n\t\t\t\t\tidentityProviderId: row.identityProviderId,\n\t\t\t\t\tpersonTokenId: apiKeyRow.id,\n\t\t\t\t\t// not a security failure (the session is kept) — a fail-open marker the operator\n\t\t\t\t\t// can alert on. `success: true` keeps it out of the failed-login funnels.\n\t\t\t\t\tsuccess: true,\n\t\t\t\t\terrorCode,\n\t\t\t\t\tipAddress: requestInfo?.ip,\n\t\t\t\t\tuserAgent: requestInfo?.userAgent,\n\t\t\t\t}),\n\t\t\t)\n\t\t} catch {\n\t\t\t// best-effort observability — never fail the request because the audit write failed\n\t\t}\n\t}\n\n\tprivate async revoke(\n\t\tdbContext: DatabaseContext,\n\t\tapiKeyRow: ApiKeyRow,\n\t\trow: IdpSessionRow,\n\t\treason: string,\n\t\trequestInfo?: ApiKeyRequestInfo,\n\t): Promise<void> {\n\t\tawait dbContext.commandBus.execute(new DisableApiKeyCommand(apiKeyRow.id))\n\t\tawait dbContext.commandBus.execute(\n\t\t\tnew CreateAuthLogEntryCommand({\n\t\t\t\ttype: 'idp_session_revoked',\n\t\t\t\tinvokedById: apiKeyRow.identity_id,\n\t\t\t\tpersonId: apiKeyRow.person_id ?? undefined,\n\t\t\t\tidentityProviderId: row.identityProviderId,\n\t\t\t\tpersonTokenId: apiKeyRow.id,\n\t\t\t\tsuccess: false,\n\t\t\t\terrorCode: reason,\n\t\t\t\tipAddress: requestInfo?.ip,\n\t\t\t\tuserAgent: requestInfo?.userAgent,\n\t\t\t\t// the action payload belongs in `event_data` (where every other audit event puts\n\t\t\t\t// it and where the admin UI / AuthLogQueryResolver reads it); `metadata` is for\n\t\t\t\t// transport context (forwarder IP/UA).\n\t\t\t\teventData: { reason },\n\t\t\t}),\n\t\t)\n\t}\n\n\tprivate resolveConfig(configuration: Record<string, unknown>): ResolvedRevalidationConfig {\n\t\tconst raw = (configuration.revalidation ?? {}) as Record<string, unknown>\n\t\tconst threshold = typeof raw.softRefreshThreshold === 'number' && raw.softRefreshThreshold > 0 && raw.softRefreshThreshold <= 1\n\t\t\t? raw.softRefreshThreshold\n\t\t\t: REVALIDATION_DEFAULT_SOFT_THRESHOLD\n\t\treturn {\n\t\t\tenabled: raw.enabled === true,\n\t\t\tsoftThreshold: threshold,\n\t\t\tminInterval: typeof raw.minInterval === 'string' ? raw.minInterval : REVALIDATION_DEFAULT_MIN_INTERVAL,\n\t\t\tfallbackInterval: typeof raw.fallbackInterval === 'string' ? raw.fallbackInterval : REVALIDATION_DEFAULT_FALLBACK_INTERVAL,\n\t\t\tmode: raw.mode === 'blocking' ? 'blocking' : 'auto',\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;AAyCO,MAAM,sBAAsB;AAAA,EAClC,YACkB,aAChB;AADgB,SAAA,cAAA;AAAA,EAElB;AAAA,EAEA,MAAM,WACL,WACA,eACA,WACA,aAC+B;AAC/B,UAAM,MAAM,MAAM,cAAc,aAAa,MAAM,IAAI,wBAAwB,UAAU,IAAI,cAAc,SAAS,CAAC;AACrH,QAAI,CAAC,KAAK;AAET,aAAO;AAAA,IACR;AAEA,UAAM,SAAS,KAAK,cAAc,IAAI,qBAAqB;AAC3D,QAAI,CAAC,OAAO,SAAS;AACpB,aAAO;AAAA,IACR;AAGA,QAAI,IAAI,oBAAoB;AAC3B,YAAM,KAAK,OAAO,WAAW,WAAW,KAAK,gBAAgB,WAAW;AACxE,aAAO;AAAA,IACR;AAEA,UAAM,UAAU,KAAK,YAAY,iBAAiB,IAAI,YAAY;AAClE,QAAI,CAAC,SAAS,YAAY;AAEzB,aAAO;AAAA,IACR;AAEA,UAAM,WAAW,KAAK,OAAO,KAAK,QAAQ,UAAU,UAAU,KAAK;AACnE,QAAI,CAAC,UAAU;AAEd,aAAO;AAAA,IACR;AAGA,QAAI;AACJ,QAAI;AACH,gBAAU,MAAM,UAAU,WAAW,QAAQ,IAAI,4BAA4B,IAAI,IAAI,SAAS,aAAa,CAAC;AAAA,IAC7G,QAAQ;AAEP,aAAO;AAAA,IACR;AACA,QAAI,CAAC,SAAS;AACb,aAAO;AAAA,IACR;AAEA,QAAI,SAAS,UAAU;AACtB,aAAO,MAAM,KAAK,gBAAgB,WAAW,SAAS,KAAK,WAAW,WAAW;AAAA,IAClF;AAOA,iBAAa,MAAM;AAClB,WAAK,gBAAgB,WAAW,SAAS,KAAK,WAAW,WAAW,EAAE,MAAM,MAAM;AAAA,MAAC,CAAC;AAAA,IACrF,CAAC;AACD,WAAO;AAAA,EACR;AAAA;AAAA;AAAA;AAAA;AAAA,EAMQ,OAAO,KAAoB,QAAoC,KAAqB;AAC3F,UAAM,YAAY,IAAI,QAAQ;AAC9B,UAAM,aAAa,IAAI;AAGvB,QAAI,CAAC,aAAa,CAAC,YAAY;AAC9B,aAAO,EAAE,UAAU,OAAO,SAAS,YAAY,eAAe,OAAO,iBAAA;AAAA,IACtE;AAEA,UAAM,aAAa,UAAU,QAAA,IAAY,WAAW,QAAA;AACpD,UAAM,WAAW,WAAW,QAAA,IAAY,aAAa,OAAO;AAC5D,UAAM,QAAQ,IAAI,QAAA;AAElB,QAAI,QAAQ,UAAU;AACrB,aAAO;AAAA,IACR;AAEA,UAAM,UAAU,SAAS,UAAU,QAAA;AACnC,WAAO,EAAE,UAAU,OAAO,SAAS,cAAc,SAAS,eAAe,OAAO,YAAA;AAAA,EACjF;AAAA,EAEA,MAAc,gBACb,WACA,SACA,KACA,WACA,aAC+B;AAC/B,QAAI;AACJ,QAAI;AACH,eAAS,QAAQ,sBAAsB,IAAI,qBAAqB;AAAA,IACjE,QAAQ;AAIP,YAAM,KAAK,sBAAsB,WAAW,WAAW,KAAK,kBAAkB,WAAW;AACzF,aAAO;AAAA,IACR;AAEA,QAAI;AACJ,QAAI;AACH,eAAS,MAAM,QAAQ,WAAY,QAAQ,IAAI,OAAO;AAAA,IACvD,QAAQ;AAKP,YAAM,KAAK,sBAAsB,WAAW,WAAW,KAAK,sBAAsB,WAAW;AAC7F,aAAO;AAAA,IACR;AAEA,QAAI,OAAO,WAAW,WAAW;AAChC,YAAM,KAAK,OAAO,WAAW,WAAW,KAAK,OAAO,QAAQ,WAAW;AACvE,aAAO;AAAA,IACR;AAYA,QAAI,OAAO,YAAY;AACtB,UAAI;AACH,cAAM,UAAU,WAAW,QAAQ,IAAI,wBAAwB,IAAI,IAAI,OAAO,UAAU,CAAC;AACzF,cAAM,KAAK,eAAe,WAAW,WAAW,KAAK,WAAW;AAAA,MACjE,QAAQ;AAAA,MAER;AAAA,IACD;AACA,WAAO;AAAA,EACR;AAAA,EAEA,MAAc,eAAe,WAA4B,WAAsB,KAAoB,aAAgD;AAClJ,UAAM,UAAU,WAAW;AAAA,MAC1B,IAAI,0BAA0B;AAAA,QAC7B,MAAM;AAAA,QACN,aAAa,UAAU;AAAA,QACvB,UAAU,UAAU,aAAa;AAAA,QACjC,oBAAoB,IAAI;AAAA,QACxB,eAAe,UAAU;AAAA,QACzB,SAAS;AAAA,QACT,WAAW,aAAa;AAAA,QACxB,WAAW,aAAa;AAAA,MAAA,CACxB;AAAA,IAAA;AAAA,EAEH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAc,sBACb,WACA,WACA,KACA,WACA,aACgB;AAChB,QAAI;AACH,YAAM,UAAU,WAAW;AAAA,QAC1B,IAAI,0BAA0B;AAAA,UAC7B,MAAM;AAAA,UACN,aAAa,UAAU;AAAA,UACvB,UAAU,UAAU,aAAa;AAAA,UACjC,oBAAoB,IAAI;AAAA,UACxB,eAAe,UAAU;AAAA;AAAA;AAAA,UAGzB,SAAS;AAAA,UACT;AAAA,UACA,WAAW,aAAa;AAAA,UACxB,WAAW,aAAa;AAAA,QAAA,CACxB;AAAA,MAAA;AAAA,IAEH,QAAQ;AAAA,IAER;AAAA,EACD;AAAA,EAEA,MAAc,OACb,WACA,WACA,KACA,QACA,aACgB;AAChB,UAAM,UAAU,WAAW,QAAQ,IAAI,qBAAqB,UAAU,EAAE,CAAC;AACzE,UAAM,UAAU,WAAW;AAAA,MAC1B,IAAI,0BAA0B;AAAA,QAC7B,MAAM;AAAA,QACN,aAAa,UAAU;AAAA,QACvB,UAAU,UAAU,aAAa;AAAA,QACjC,oBAAoB,IAAI;AAAA,QACxB,eAAe,UAAU;AAAA,QACzB,SAAS;AAAA,QACT,WAAW;AAAA,QACX,WAAW,aAAa;AAAA,QACxB,WAAW,aAAa;AAAA;AAAA;AAAA;AAAA,QAIxB,WAAW,EAAE,OAAA;AAAA,MAAO,CACpB;AAAA,IAAA;AAAA,EAEH;AAAA,EAEQ,cAAc,eAAoE;AACzF,UAAM,MAAO,cAAc,gBAAgB,CAAA;AAC3C,UAAM,YAAY,OAAO,IAAI,yBAAyB,YAAY,IAAI,uBAAuB,KAAK,IAAI,wBAAwB,IAC3H,IAAI,uBACJ;AACH,WAAO;AAAA,MACN,SAAS,IAAI,YAAY;AAAA,MACzB,eAAe;AAAA,MACf,aAAa,OAAO,IAAI,gBAAgB,WAAW,IAAI,cAAc;AAAA,MACrE,kBAAkB,OAAO,IAAI,qBAAqB,WAAW,IAAI,mBAAmB;AAAA,MACpF,MAAM,IAAI,SAAS,aAAa,aAAa;AAAA,IAAA;AAAA,EAE/C;AACD;"}
1
+ {"version":3,"file":"IdpSessionRevalidator.js","sources":["../../../../../../../packages/engine-tenant-api/src/model/service/idp/IdpSessionRevalidator.ts"],"sourcesContent":["import { DatabaseContext } from '../../utils/index.js'\nimport { ApiKeyRequestInfo } from '../../commands/index.js'\nimport { ApiKeyRow } from '../../queries/apiKey/ApiKeyQuery.js'\nimport { IdpSessionByApiKeyQuery, IdpSessionRow } from '../../queries/idp/IdpSessionByApiKeyQuery.js'\nimport { IDPHandlerRegistry } from './IDPHandlerRegistry.js'\nimport { ClaimIdpRevalidationCommand } from '../../commands/idp/ClaimIdpRevalidationCommand.js'\nimport { UpdateIdpSessionCommand } from '../../commands/idp/UpdateIdpSessionCommand.js'\nimport { DisableApiKeyCommand } from '../../commands/index.js'\nimport { CreateAuthLogEntryCommand } from '../../commands/authLog/CreateAuthLogEntryCommand.js'\nimport { REVALIDATION_DEFAULT_FALLBACK_INTERVAL, REVALIDATION_DEFAULT_MIN_INTERVAL, REVALIDATION_DEFAULT_SOFT_THRESHOLD } from './IDPRevalidation.js'\nimport { IdentityProviderHandler, RevalidationResult } from './IdentityProviderHandler.js'\nimport { IDPClaimSyncService } from './IDPClaimSyncService.js'\nimport { Logger } from '@contember/logger'\nimport { parseClaimMapping } from './ClaimMapping.js'\nimport { JSONValue } from '@contember/schema'\n\nexport type RevalidationOutcome = 'valid' | 'revoked'\n\ntype ResolvedRevalidationConfig = {\n\tenabled: boolean\n\tsoftThreshold: number\n\tminInterval: string\n\tfallbackInterval: string\n\tmode: 'auto' | 'blocking'\n}\n\n/**\n * Decision for the current request: whether to attempt a revalidation, and if so whether it\n * must block the request. `claimInterval` is the single-flight floor for the atomic claim.\n */\ntype Decision = null | { blocking: boolean; claimInterval: string }\n\n/**\n * Re-validates IdP-backed sessions against their identity provider on the verify hot path\n * (A24). Invoked from `ApiKeyManager.verifyAndProlong`. Operates entirely through the supplied\n * database contexts and the command bus, so it does not depend on `ApiKeyManager` (no DI cycle).\n *\n * The cadence is driven by the **access-token lifetime**, not a fixed interval:\n * - while the token is fresh (before `softRefreshThreshold` of its lifetime) → skip, free;\n * - past the threshold but not yet expired → a proactive **background (SWR)** refresh, so the\n * request keeps zero added latency and the token is renewed before it dies;\n * - once the token has actually expired → a **blocking** refresh (we can't serve a dead token).\n * `mode: 'blocking'` forces every revalidation synchronous (zero revocation lag). When the IdP\n * returns no token expiry, falls back to a plain `fallbackInterval` background throttle.\n */\nexport class IdpSessionRevalidator {\n\tconstructor(\n\t\tprivate readonly idpRegistry: IDPHandlerRegistry,\n\t\tprivate readonly claimSyncService: IDPClaimSyncService,\n\t\tprivate readonly logger: Logger,\n\t) {\n\t}\n\n\tasync revalidate(\n\t\tdbContext: DatabaseContext,\n\t\treadDbContext: DatabaseContext,\n\t\tapiKeyRow: ApiKeyRow,\n\t\trequestInfo?: ApiKeyRequestInfo,\n\t): Promise<RevalidationOutcome> {\n\t\tconst row = await readDbContext.queryHandler.fetch(new IdpSessionByApiKeyQuery(apiKeyRow.id, readDbContext.providers))\n\t\tif (!row) {\n\t\t\t// not a federated session (password / IdP without revalidation) — fast no-op\n\t\t\treturn 'valid'\n\t\t}\n\n\t\tconst config = this.resolveConfig(row.providerConfiguration)\n\t\tif (!config.enabled) {\n\t\t\treturn 'valid'\n\t\t}\n\n\t\t// A disabled IdP no longer vouches for its sessions.\n\t\tif (row.providerDisabledAt) {\n\t\t\tawait this.revoke(dbContext, apiKeyRow, row, 'idp_disabled', requestInfo)\n\t\t\treturn 'revoked'\n\t\t}\n\n\t\tconst handler = this.idpRegistry.getHandlerOrNull(row.providerType)\n\t\tif (!handler?.revalidate) {\n\t\t\t// provider can't actively re-validate (e.g. SAML) — rely on expiry / SLO\n\t\t\treturn 'valid'\n\t\t}\n\n\t\tconst decision = this.decide(row, config, dbContext.providers.now())\n\t\tif (!decision) {\n\t\t\t// token still fresh — vouched for, no IdP call\n\t\t\treturn 'valid'\n\t\t}\n\n\t\t// Atomic claim = single-flight. Loser (within the floor window, or lost the race) serves stale.\n\t\tlet claimed: boolean\n\t\ttry {\n\t\t\tclaimed = await dbContext.commandBus.execute(new ClaimIdpRevalidationCommand(row.id, decision.claimInterval))\n\t\t} catch (e) {\n\t\t\tthis.logger.warn(e, { message: 'IdP session revalidation: claim failed', idpSessionId: row.id })\n\t\t\t// invalid interval string or transient DB error — fail open, retry next request\n\t\t\treturn 'valid'\n\t\t}\n\t\tif (!claimed) {\n\t\t\treturn 'valid'\n\t\t}\n\n\t\tif (decision.blocking) {\n\t\t\treturn await this.runRevalidation(dbContext, handler, row, apiKeyRow, requestInfo)\n\t\t}\n\n\t\t// SWR: serve this request from the (still valid) token, refresh after the response.\n\t\t// The work runs detached (after the response is sent), so any rejection — a transient\n\t\t// DB error in the revoke / persist writes, a corrupt-config throw — must be swallowed\n\t\t// here; otherwise it becomes an unhandledRejection and can take the worker down. The\n\t\t// session is simply kept and re-tried on a later request (the claim floor throttles).\n\t\tsetImmediate(() => {\n\t\t\tthis.runRevalidation(dbContext, handler, row, apiKeyRow, requestInfo).catch(e => {\n\t\t\t\tthis.logger.error(e, { message: 'IdP session revalidation: background run failed', idpSessionId: row.id })\n\t\t\t})\n\t\t})\n\t\treturn 'valid'\n\t}\n\n\t/**\n\t * Decide whether (and how) to revalidate, purely from timestamps — no interval parsing in\n\t * JS (the claim handles intervals in SQL). Returns null to skip.\n\t */\n\tprivate decide(row: IdpSessionRow, config: ResolvedRevalidationConfig, now: Date): Decision {\n\t\tconst expiresAt = row.session.expiresAt\n\t\tconst obtainedAt = row.tokenObtainedAt\n\n\t\t// No lifetime info from the IdP → plain background throttle on fallbackInterval.\n\t\tif (!expiresAt || !obtainedAt) {\n\t\t\treturn { blocking: config.mode === 'blocking', claimInterval: config.fallbackInterval }\n\t\t}\n\n\t\tconst lifetimeMs = expiresAt.getTime() - obtainedAt.getTime()\n\t\tconst softAtMs = obtainedAt.getTime() + lifetimeMs * config.softThreshold\n\t\tconst nowMs = now.getTime()\n\n\t\tif (nowMs < softAtMs) {\n\t\t\treturn null // still within the trusted window\n\t\t}\n\n\t\tconst expired = nowMs >= expiresAt.getTime()\n\t\treturn { blocking: config.mode === 'blocking' || expired, claimInterval: config.minInterval }\n\t}\n\n\tprivate async runRevalidation(\n\t\tdbContext: DatabaseContext,\n\t\thandler: IdentityProviderHandler<{}>,\n\t\trow: IdpSessionRow,\n\t\tapiKeyRow: ApiKeyRow,\n\t\trequestInfo?: ApiKeyRequestInfo,\n\t): Promise<RevalidationOutcome> {\n\t\tlet config: {}\n\t\ttry {\n\t\t\tconfig = handler.validateConfiguration(row.providerConfiguration)\n\t\t} catch (e) {\n\t\t\tthis.logger.warn(e, { message: 'IdP session revalidation: stored configuration is invalid', idpSessionId: row.id })\n\t\t\t// corrupt stored config — must NOT revoke; keep the session and retry later. Audit\n\t\t\t// it so the operator can tell \"vouched for\" apart from \"silently broken\" (without an\n\t\t\t// entry, a config typo disables re-validation invisibly for the life of every session).\n\t\t\tawait this.logRevalidationFailed(dbContext, apiKeyRow, row, 'config_invalid', requestInfo)\n\t\t\treturn 'valid'\n\t\t}\n\n\t\tlet result: RevalidationResult\n\t\ttry {\n\t\t\tresult = await handler.revalidate!(config, row.session)\n\t\t} catch (e) {\n\t\t\tthis.logger.warn(e, { message: 'IdP session revalidation: identity provider call failed', idpSessionId: row.id })\n\t\t\t// transient failure (network / IdP down) — must NOT revoke; keep the session and retry\n\t\t\t// on a later request (the claim floor prevents hammering the IdP). Audited (throttled\n\t\t\t// to one entry per claim window) so a prolonged IdP outage is visible rather than a\n\t\t\t// silent fail-open.\n\t\t\tawait this.logRevalidationFailed(dbContext, apiKeyRow, row, 'revalidation_error', requestInfo)\n\t\t\treturn 'valid'\n\t\t}\n\n\t\tif (result.status === 'revoked') {\n\t\t\tawait this.revoke(dbContext, apiKeyRow, row, result.reason, requestInfo)\n\t\t\treturn 'revoked'\n\t\t}\n\n\t\t// Still valid — persist the rotated token (resets the lifetime reference) / refreshed\n\t\t// expiry. A rotation is a real, low-frequency event (token-lifetime cadence), so we\n\t\t// audit it as `idp_session_revalidated`; the no-op userinfo/introspection probes\n\t\t// (no rotated session) are intentionally NOT logged to keep the audit log usable.\n\t\t//\n\t\t// The IdP has already vouched for the session, so these post-success writes are pure\n\t\t// best-effort bookkeeping (they only reset the SWR cadence reference). A transient DB\n\t\t// error or an `encrypt()` throw here must NOT fail the request — otherwise a blocking\n\t\t// revalidation fails closed on a successful refresh, contradicting \"fail open\" (the SWR\n\t\t// path already swallows this). Keep the existing row; the claim floor throttles a retry.\n\t\tif (result.idpSession) {\n\t\t\ttry {\n\t\t\t\tawait dbContext.commandBus.execute(new UpdateIdpSessionCommand(row.id, result.idpSession))\n\t\t\t\tawait this.logRevalidated(dbContext, apiKeyRow, row, requestInfo)\n\t\t\t} catch (e) {\n\t\t\t\tthis.logger.error(e, { message: 'IdP session revalidation: persisting the rotated session failed', idpSessionId: row.id })\n\t\t\t\t// fall through — session stays valid, persist retried on a later request\n\t\t\t}\n\t\t}\n\n\t\t// A09 — re-apply the IdP's claim mapping when the refresh returned fresh claims, so an `always`\n\t\t// mapping keeps an established session's project memberships in sync with the IdP's current claims\n\t\t// without requiring a full re-login. `sticky` mappings self-skip (the sync passes isNewPerson=false).\n\t\t// `claimsComplete` tells the sync whether the refresh rebuilt sign-in's full claim surface, so it can\n\t\t// reconcile (incl. `unmatched: \"remove\"`) exactly like sign-in. Strictly fail-open — see `syncClaims`.\n\t\tif (result.claims) {\n\t\t\tawait this.syncClaims(dbContext, row, apiKeyRow, result.claims, result.claimsComplete === true, requestInfo)\n\t\t}\n\t\treturn 'valid'\n\t}\n\n\t/**\n\t * Re-apply the claim mapping on a successful refresh. Runs in its own transaction (atomic apply of\n\t * the membership changes) and never throws: the IdP has already vouched for the session, so a\n\t * malformed mapping or a transient apply error must not revoke or fail it. A real membership change\n\t * is audited as `idp_role_mapped`; a failure is audited as `idp_role_mapping_failed` (fail-open\n\t * marker), mirroring the sign-in path. `claimsComplete` carries whether the refresh rebuilt sign-in's\n\t * full claim surface (so removal reconciliation is safe) — see `allowRemoval` below.\n\t */\n\tprivate async syncClaims(\n\t\tdbContext: DatabaseContext,\n\t\trow: IdpSessionRow,\n\t\tapiKeyRow: ApiKeyRow,\n\t\tclaims: Record<string, unknown>,\n\t\tclaimsComplete: boolean,\n\t\trequestInfo?: ApiKeyRequestInfo,\n\t): Promise<void> {\n\t\ttry {\n\t\t\tconst mapping = parseClaimMapping(row.providerConfiguration)\n\t\t\tif (!mapping) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// Atomic apply in its own transaction (the verify path has no surrounding one). `always`-only:\n\t\t\t// the sync passes isNewPerson=false, so a `sticky` mapping self-skips and returns a null audit.\n\t\t\t// Refresh mirrors sign-in as closely as the claim surface allows: when the provider returned its\n\t\t\t// COMPLETE surface (`claimsComplete` — `method: \"refresh\"` rebuilding sign-in's id-token + userinfo\n\t\t\t// merge), `unmatched: \"remove\"` reconciliation runs here too. A partial surface (a userinfo-only\n\t\t\t// probe, or a refresh whose userinfo fetch failed) passes `allowRemoval: false`, so refresh stays\n\t\t\t// additive-only and a membership the IdP still asserts is never stripped off an incomplete surface.\n\t\t\tconst { audit, droppedUnsafeRules } = await dbContext.transaction(db =>\n\t\t\t\tthis.claimSyncService.sync(db, mapping, claims, { id: apiKeyRow.identity_id }, false, { allowRemoval: claimsComplete })\n\t\t\t)\n\t\t\tif (audit) {\n\t\t\t\tawait this.logRoleMapping(dbContext, apiKeyRow, row, 'idp_role_mapped', audit, requestInfo)\n\t\t\t}\n\t\t\t// The apply-time safety backstop dropped a configured rule — emit the fail-open marker so a broken\n\t\t\t// mapping is visible on the refresh path too, mirroring sign-in (the marker carries no claim values).\n\t\t\tif (droppedUnsafeRules) {\n\t\t\t\tawait this.logRoleMapping(dbContext, apiKeyRow, row, 'idp_role_mapping_failed', undefined, requestInfo)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tthis.logger.warn(e, { message: 'IdP session revalidation: claim mapping sync failed', idpSessionId: row.id })\n\t\t\t// Strictly fail-open: a malformed mapping or a transient apply error must never revoke or\n\t\t\t// fail an already-vouched-for session. The transaction rolls back any partial apply.\n\t\t\tawait this.logRoleMapping(dbContext, apiKeyRow, row, 'idp_role_mapping_failed', undefined, requestInfo)\n\t\t}\n\t}\n\n\tprivate async logRoleMapping(\n\t\tdbContext: DatabaseContext,\n\t\tapiKeyRow: ApiKeyRow,\n\t\trow: IdpSessionRow,\n\t\ttype: 'idp_role_mapped' | 'idp_role_mapping_failed',\n\t\teventData: JSONValue | undefined,\n\t\trequestInfo?: ApiKeyRequestInfo,\n\t): Promise<void> {\n\t\ttry {\n\t\t\tawait dbContext.commandBus.execute(\n\t\t\t\tnew CreateAuthLogEntryCommand({\n\t\t\t\t\ttype,\n\t\t\t\t\tinvokedById: apiKeyRow.identity_id,\n\t\t\t\t\tpersonId: apiKeyRow.person_id ?? undefined,\n\t\t\t\t\t// The membership change affects this session's own person — record it as the target too,\n\t\t\t\t\t// so an admin querying membership changes by target_person_id sees IdP-driven grants/revokes\n\t\t\t\t\t// (consistent with the project_membership_* audit events).\n\t\t\t\t\ttargetPersonId: apiKeyRow.person_id ?? undefined,\n\t\t\t\t\tidentityProviderId: row.identityProviderId,\n\t\t\t\t\tsuccess: true,\n\t\t\t\t\teventData,\n\t\t\t\t\tipAddress: requestInfo?.ip,\n\t\t\t\t\tuserAgent: requestInfo?.userAgent,\n\t\t\t\t}),\n\t\t\t)\n\t\t} catch (e) {\n\t\t\tthis.logger.error(e, { message: `IdP session revalidation: writing the ${type} audit entry failed`, idpSessionId: row.id })\n\t\t\t// best-effort audit — never fail the request because the audit write failed\n\t\t}\n\t}\n\n\tprivate async logRevalidated(dbContext: DatabaseContext, apiKeyRow: ApiKeyRow, row: IdpSessionRow, requestInfo?: ApiKeyRequestInfo): Promise<void> {\n\t\tawait dbContext.commandBus.execute(\n\t\t\tnew CreateAuthLogEntryCommand({\n\t\t\t\ttype: 'idp_session_revalidated',\n\t\t\t\tinvokedById: apiKeyRow.identity_id,\n\t\t\t\tpersonId: apiKeyRow.person_id ?? undefined,\n\t\t\t\tidentityProviderId: row.identityProviderId,\n\t\t\t\tsuccess: true,\n\t\t\t\tipAddress: requestInfo?.ip,\n\t\t\t\tuserAgent: requestInfo?.userAgent,\n\t\t\t\teventData: { apiKeyId: apiKeyRow.id },\n\t\t\t}),\n\t\t)\n\t}\n\n\t/**\n\t * Audit a fail-open: the IdP couldn't be consulted (transient outage) or the stored config is\n\t * corrupt, so we kept the session rather than revoking it. Naturally throttled to one entry\n\t * per claim window (we only reach here after a successful claim, which bumps\n\t * `last_validated_at`). The write is best-effort and self-contained — a failure to audit must\n\t * never propagate and fail a blocking verify request (the whole point of failing open).\n\t */\n\tprivate async logRevalidationFailed(\n\t\tdbContext: DatabaseContext,\n\t\tapiKeyRow: ApiKeyRow,\n\t\trow: IdpSessionRow,\n\t\terrorCode: 'config_invalid' | 'revalidation_error',\n\t\trequestInfo?: ApiKeyRequestInfo,\n\t): Promise<void> {\n\t\ttry {\n\t\t\tawait dbContext.commandBus.execute(\n\t\t\t\tnew CreateAuthLogEntryCommand({\n\t\t\t\t\ttype: 'idp_session_revalidation_failed',\n\t\t\t\t\tinvokedById: apiKeyRow.identity_id,\n\t\t\t\t\tpersonId: apiKeyRow.person_id ?? undefined,\n\t\t\t\t\tidentityProviderId: row.identityProviderId,\n\t\t\t\t\t// not a security failure (the session is kept) — a fail-open marker the operator\n\t\t\t\t\t// can alert on. `success: true` keeps it out of the failed-login funnels.\n\t\t\t\t\tsuccess: true,\n\t\t\t\t\terrorCode,\n\t\t\t\t\tipAddress: requestInfo?.ip,\n\t\t\t\t\tuserAgent: requestInfo?.userAgent,\n\t\t\t\t\teventData: { apiKeyId: apiKeyRow.id },\n\t\t\t\t}),\n\t\t\t)\n\t\t} catch (e) {\n\t\t\tthis.logger.error(e, { message: 'IdP session revalidation: writing the idp_session_revalidation_failed audit entry failed', idpSessionId: row.id })\n\t\t\t// best-effort observability — never fail the request because the audit write failed\n\t\t}\n\t}\n\n\tprivate async revoke(\n\t\tdbContext: DatabaseContext,\n\t\tapiKeyRow: ApiKeyRow,\n\t\trow: IdpSessionRow,\n\t\treason: string,\n\t\trequestInfo?: ApiKeyRequestInfo,\n\t): Promise<void> {\n\t\tawait dbContext.commandBus.execute(new DisableApiKeyCommand(apiKeyRow.id))\n\t\ttry {\n\t\t\tawait dbContext.commandBus.execute(\n\t\t\t\tnew CreateAuthLogEntryCommand({\n\t\t\t\t\ttype: 'idp_session_revoked',\n\t\t\t\t\tinvokedById: apiKeyRow.identity_id,\n\t\t\t\t\tpersonId: apiKeyRow.person_id ?? undefined,\n\t\t\t\t\tidentityProviderId: row.identityProviderId,\n\t\t\t\t\tsuccess: false,\n\t\t\t\t\terrorCode: reason,\n\t\t\t\t\tipAddress: requestInfo?.ip,\n\t\t\t\t\tuserAgent: requestInfo?.userAgent,\n\t\t\t\t\t// the action payload belongs in `event_data` (where every other audit event puts\n\t\t\t\t\t// it and where the admin UI / AuthLogQueryResolver reads it); `metadata` is for\n\t\t\t\t\t// transport context (forwarder IP/UA).\n\t\t\t\t\teventData: { reason, apiKeyId: apiKeyRow.id },\n\t\t\t\t}),\n\t\t\t)\n\t\t} catch (e) {\n\t\t\tthis.logger.error(e, { message: 'IdP session revalidation: writing the idp_session_revoked audit entry failed', idpSessionId: row.id })\n\t\t\t// best-effort audit: the key is already disabled, so the request must still be answered\n\t\t\t// as revoked rather than fail on the audit write\n\t\t}\n\t}\n\n\tprivate resolveConfig(configuration: Record<string, unknown>): ResolvedRevalidationConfig {\n\t\tconst raw = (configuration.revalidation ?? {}) as Record<string, unknown>\n\t\tconst threshold = typeof raw.softRefreshThreshold === 'number' && raw.softRefreshThreshold > 0 && raw.softRefreshThreshold <= 1\n\t\t\t? raw.softRefreshThreshold\n\t\t\t: REVALIDATION_DEFAULT_SOFT_THRESHOLD\n\t\treturn {\n\t\t\tenabled: raw.enabled === true,\n\t\t\tsoftThreshold: threshold,\n\t\t\tminInterval: typeof raw.minInterval === 'string' ? raw.minInterval : REVALIDATION_DEFAULT_MIN_INTERVAL,\n\t\t\tfallbackInterval: typeof raw.fallbackInterval === 'string' ? raw.fallbackInterval : REVALIDATION_DEFAULT_FALLBACK_INTERVAL,\n\t\t\tmode: raw.mode === 'blocking' ? 'blocking' : 'auto',\n\t\t}\n\t}\n}\n"],"names":[],"mappings":"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"}
@@ -8,8 +8,9 @@ const ConfigurationQuery = require("../../queries/configuration/ConfigurationQue
8
8
  const PersonIdentityProvidersQuery = require("../../queries/idp/PersonIdentityProvidersQuery.cjs");
9
9
  require("../../authorization/PermissionActions.cjs");
10
10
  require("@contember/authorization");
11
+ require("../../authorization/CustomRolePermissions.cjs");
11
12
  require("../../authorization/PermissionContext.cjs");
12
- require("../../authorization/PermissionsFactory.cjs");
13
+ require("../../authorization/TargetIdentityPermission.cjs");
13
14
  require("@contember/schema");
14
15
  const DisconnectPersonIdentityProviderCommand = require("../../commands/idp/DisconnectPersonIdentityProviderCommand.cjs");
15
16
  const isPasswordlessEnabled = require("../helpers/isPasswordlessEnabled.cjs");
@@ -24,6 +25,12 @@ class PersonIdentityProviderManager {
24
25
  if (!connection) {
25
26
  return new Response.ResponseError("NOT_FOUND", `You are not connected to the identity provider connection "${connectionId}".`);
26
27
  }
28
+ if (connection.identityProviderDisableLocalAuthentication) {
29
+ return new Response.ResponseError(
30
+ "IDP_REQUIRED",
31
+ `The identity provider "${connection.identityProviderSlug}" is the only way you may sign in; its connection cannot be removed.`
32
+ );
33
+ }
27
34
  const configuration = await db2.queryHandler.fetch(new ConfigurationQuery.ConfigurationQuery(db2.providers));
28
35
  const hasPassword = person.password_hash !== null;
29
36
  const hasPasswordless = isPasswordlessEnabled.isPasswordlessEnabled(configuration.passwordless.enabled, person.passwordless_enabled);