@webiny/api-core 0.0.0-unstable.a4f3e4ea8b → 0.0.0-unstable.a85ef555b2

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 (442) hide show
  1. package/ApiCoreFeature.d.ts +2 -2
  2. package/ApiCoreFeature.js +35 -5
  3. package/ApiCoreFeature.js.map +1 -1
  4. package/exports/api/tasks.d.ts +1 -0
  5. package/exports/api/tasks.js +1 -1
  6. package/exports/api.d.ts +2 -1
  7. package/exports/api.js +2 -1
  8. package/features/ai/Ai.js +16 -6
  9. package/features/ai/Ai.js.map +1 -1
  10. package/features/ai/AiModelRegistry.d.ts +3 -1
  11. package/features/ai/AiModelRegistry.js +16 -7
  12. package/features/ai/AiModelRegistry.js.map +1 -1
  13. package/features/ai/AiSdkToolHandlerResolver.d.ts +11 -0
  14. package/features/ai/AiSdkToolHandlerResolver.js +19 -0
  15. package/features/ai/AiSdkToolHandlerResolver.js.map +1 -0
  16. package/features/ai/AiSdkTools.d.ts +4 -3
  17. package/features/ai/AiSdkTools.js +11 -9
  18. package/features/ai/AiSdkTools.js.map +1 -1
  19. package/features/ai/DEVELOPERS.md +69 -12
  20. package/features/ai/OpenRouterSdkFactory.d.ts +10 -0
  21. package/features/ai/OpenRouterSdkFactory.js +112 -0
  22. package/features/ai/OpenRouterSdkFactory.js.map +1 -0
  23. package/features/ai/RemoteAiModelCatalog.d.ts +13 -0
  24. package/features/ai/RemoteAiModelCatalog.js +74 -0
  25. package/features/ai/RemoteAiModelCatalog.js.map +1 -0
  26. package/features/ai/abstractions.d.ts +90 -7
  27. package/features/ai/abstractions.js +5 -2
  28. package/features/ai/abstractions.js.map +1 -1
  29. package/features/ai/feature.js +6 -0
  30. package/features/ai/feature.js.map +1 -1
  31. package/features/ai/index.d.ts +2 -4
  32. package/features/ai/index.js +1 -1
  33. package/features/dateFormatter/DefaultDateFormatter.d.ts +15 -0
  34. package/features/dateFormatter/DefaultDateFormatter.js +20 -0
  35. package/features/dateFormatter/DefaultDateFormatter.js.map +1 -0
  36. package/features/dateFormatter/abstractions.d.ts +13 -0
  37. package/features/dateFormatter/abstractions.js +5 -0
  38. package/features/dateFormatter/abstractions.js.map +1 -0
  39. package/features/dateFormatter/feature.d.ts +4 -0
  40. package/features/dateFormatter/feature.js +11 -0
  41. package/features/dateFormatter/feature.js.map +1 -0
  42. package/features/dateFormatter/index.d.ts +3 -0
  43. package/features/dateFormatter/index.js +2 -0
  44. package/features/debugger/Debugger.d.ts +30 -0
  45. package/features/debugger/Debugger.js +142 -0
  46. package/features/debugger/Debugger.js.map +1 -0
  47. package/features/debugger/DebuggerRouteDecorator.d.ts +45 -0
  48. package/features/debugger/DebuggerRouteDecorator.js +107 -0
  49. package/features/debugger/DebuggerRouteDecorator.js.map +1 -0
  50. package/features/debugger/GraphQLDebuggerTransport.d.ts +28 -0
  51. package/features/debugger/GraphQLDebuggerTransport.js +45 -0
  52. package/features/debugger/GraphQLDebuggerTransport.js.map +1 -0
  53. package/features/debugger/__tests__/matchNamespace.test.d.ts +1 -0
  54. package/features/debugger/__tests__/matchNamespace.test.js +68 -0
  55. package/features/debugger/__tests__/matchNamespace.test.js.map +1 -0
  56. package/features/debugger/__tests__/serialize.test.d.ts +1 -0
  57. package/features/debugger/__tests__/serialize.test.js +220 -0
  58. package/features/debugger/__tests__/serialize.test.js.map +1 -0
  59. package/features/debugger/abstractions.d.ts +100 -0
  60. package/features/debugger/abstractions.js +6 -0
  61. package/features/debugger/abstractions.js.map +1 -0
  62. package/features/debugger/feature.d.ts +5 -0
  63. package/features/debugger/feature.js +15 -0
  64. package/features/debugger/feature.js.map +1 -0
  65. package/features/debugger/index.d.ts +12 -0
  66. package/features/debugger/index.js +7 -0
  67. package/features/debugger/limits.d.ts +18 -0
  68. package/features/debugger/limits.js +11 -0
  69. package/features/debugger/limits.js.map +1 -0
  70. package/features/debugger/matchNamespace.d.ts +14 -0
  71. package/features/debugger/matchNamespace.js +35 -0
  72. package/features/debugger/matchNamespace.js.map +1 -0
  73. package/features/debugger/parseNamespaceHeader.d.ts +7 -0
  74. package/features/debugger/parseNamespaceHeader.js +16 -0
  75. package/features/debugger/parseNamespaceHeader.js.map +1 -0
  76. package/features/debugger/permissions.d.ts +14 -0
  77. package/features/debugger/permissions.js +8 -0
  78. package/features/debugger/permissions.js.map +1 -0
  79. package/features/debugger/permissionsSchema.d.ts +17 -0
  80. package/features/debugger/permissionsSchema.js +18 -0
  81. package/features/debugger/permissionsSchema.js.map +1 -0
  82. package/features/debugger/serialize.d.ts +11 -0
  83. package/features/debugger/serialize.js +121 -0
  84. package/features/debugger/serialize.js.map +1 -0
  85. package/features/encryption/EncryptionKeyCacheFeature.d.ts +8 -0
  86. package/features/encryption/EncryptionKeyCacheFeature.js +11 -0
  87. package/features/encryption/EncryptionKeyCacheFeature.js.map +1 -0
  88. package/features/encryption/EncryptionService.d.ts +2 -1
  89. package/features/encryption/EncryptionService.js +11 -4
  90. package/features/encryption/EncryptionService.js.map +1 -1
  91. package/features/encryption/MemoryEncryptionKeyCache.d.ts +13 -0
  92. package/features/encryption/MemoryEncryptionKeyCache.js +26 -0
  93. package/features/encryption/MemoryEncryptionKeyCache.js.map +1 -0
  94. package/features/encryption/abstractions.d.ts +11 -0
  95. package/features/encryption/abstractions.js +2 -1
  96. package/features/encryption/abstractions.js.map +1 -1
  97. package/features/encryption/index.d.ts +1 -0
  98. package/features/encryption/index.js +1 -0
  99. package/features/featureFlags/decorators/FeatureFlagsWithLicenseDecorator.d.ts +13 -0
  100. package/features/featureFlags/decorators/FeatureFlagsWithLicenseDecorator.js +62 -0
  101. package/features/featureFlags/decorators/FeatureFlagsWithLicenseDecorator.js.map +1 -0
  102. package/features/hashing/ScryptHasher.d.ts +11 -0
  103. package/features/hashing/ScryptHasher.js +74 -0
  104. package/features/hashing/ScryptHasher.js.map +1 -0
  105. package/features/hashing/abstractions.d.ts +18 -0
  106. package/features/hashing/abstractions.js +5 -0
  107. package/features/hashing/abstractions.js.map +1 -0
  108. package/features/hashing/feature.d.ts +4 -0
  109. package/features/hashing/feature.js +11 -0
  110. package/features/hashing/feature.js.map +1 -0
  111. package/features/hashing/index.d.ts +2 -0
  112. package/features/hashing/index.js +1 -0
  113. package/features/httpClient/HttpClient.d.ts +7 -0
  114. package/features/httpClient/HttpClient.js +72 -0
  115. package/features/httpClient/HttpClient.js.map +1 -0
  116. package/features/httpClient/HttpRequestError.d.ts +10 -0
  117. package/features/httpClient/HttpRequestError.js +13 -0
  118. package/features/httpClient/HttpRequestError.js.map +1 -0
  119. package/features/httpClient/HttpStatusError.d.ts +12 -0
  120. package/features/httpClient/HttpStatusError.js +12 -0
  121. package/features/httpClient/HttpStatusError.js.map +1 -0
  122. package/features/httpClient/abstractions.d.ts +32 -0
  123. package/features/httpClient/abstractions.js +5 -0
  124. package/features/httpClient/abstractions.js.map +1 -0
  125. package/features/httpClient/feature.d.ts +4 -0
  126. package/features/httpClient/feature.js +11 -0
  127. package/features/httpClient/feature.js.map +1 -0
  128. package/features/httpClient/index.d.ts +3 -0
  129. package/features/httpClient/index.js +3 -0
  130. package/features/keyValueStore/GlobalKeyValueStore.d.ts +9 -3
  131. package/features/keyValueStore/GlobalKeyValueStore.js +12 -2
  132. package/features/keyValueStore/GlobalKeyValueStore.js.map +1 -1
  133. package/features/keyValueStore/KeyValueStore.d.ts +6 -2
  134. package/features/keyValueStore/KeyValueStore.js +13 -3
  135. package/features/keyValueStore/KeyValueStore.js.map +1 -1
  136. package/features/keyValueStore/KeyValueStoreRepository.d.ts +8 -2
  137. package/features/keyValueStore/KeyValueStoreRepository.js +82 -4
  138. package/features/keyValueStore/KeyValueStoreRepository.js.map +1 -1
  139. package/features/keyValueStore/abstractions.d.ts +132 -14
  140. package/features/keyValueStore/abstractions.js.map +1 -1
  141. package/features/keyValueStore/errors.d.ts +29 -0
  142. package/features/keyValueStore/errors.js +49 -1
  143. package/features/keyValueStore/errors.js.map +1 -1
  144. package/features/keyValueStore/index.d.ts +4 -1
  145. package/features/keyValueStore/index.js +1 -1
  146. package/features/publicUrls/NullPublicUrls.d.ts +11 -0
  147. package/features/publicUrls/NullPublicUrls.js +17 -0
  148. package/features/publicUrls/NullPublicUrls.js.map +1 -0
  149. package/features/publicUrls/PublicUrl.d.ts +24 -0
  150. package/features/publicUrls/PublicUrl.js +43 -0
  151. package/features/publicUrls/PublicUrl.js.map +1 -0
  152. package/features/publicUrls/__tests__/PublicUrl.test.d.ts +1 -0
  153. package/features/publicUrls/__tests__/PublicUrl.test.js +38 -0
  154. package/features/publicUrls/__tests__/PublicUrl.test.js.map +1 -0
  155. package/features/publicUrls/__tests__/PublicUrls.test.d.ts +1 -0
  156. package/features/publicUrls/__tests__/PublicUrls.test.js +14 -0
  157. package/features/publicUrls/__tests__/PublicUrls.test.js.map +1 -0
  158. package/features/publicUrls/abstractions.d.ts +27 -0
  159. package/features/publicUrls/abstractions.js +5 -0
  160. package/features/publicUrls/abstractions.js.map +1 -0
  161. package/features/publicUrls/feature.d.ts +8 -0
  162. package/features/publicUrls/feature.js +11 -0
  163. package/features/publicUrls/feature.js.map +1 -0
  164. package/features/publicUrls/index.d.ts +3 -0
  165. package/features/publicUrls/index.js +3 -0
  166. package/features/requestContext/RawAssumePermissions.d.ts +14 -0
  167. package/features/requestContext/RawAssumePermissions.js +19 -0
  168. package/features/requestContext/RawAssumePermissions.js.map +1 -0
  169. package/features/requestContext/RawAuthToken.d.ts +14 -0
  170. package/features/requestContext/RawAuthToken.js +19 -0
  171. package/features/requestContext/RawAuthToken.js.map +1 -0
  172. package/features/requestContext/RawTenantId.d.ts +14 -0
  173. package/features/requestContext/RawTenantId.js +19 -0
  174. package/features/requestContext/RawTenantId.js.map +1 -0
  175. package/features/requestContext/RequestIdentityLoader.d.ts +19 -0
  176. package/features/requestContext/RequestIdentityLoader.js +26 -0
  177. package/features/requestContext/RequestIdentityLoader.js.map +1 -0
  178. package/features/requestContext/RequestTenantLoader.d.ts +18 -0
  179. package/features/requestContext/RequestTenantLoader.js +52 -0
  180. package/features/requestContext/RequestTenantLoader.js.map +1 -0
  181. package/features/requestContext/abstractions.d.ts +75 -0
  182. package/features/requestContext/abstractions.js +9 -0
  183. package/features/requestContext/abstractions.js.map +1 -0
  184. package/features/requestContext/extractAssumePermissions.d.ts +14 -0
  185. package/features/requestContext/extractAssumePermissions.js +32 -0
  186. package/features/requestContext/extractAssumePermissions.js.map +1 -0
  187. package/features/requestContext/feature.d.ts +12 -0
  188. package/features/requestContext/feature.js +19 -0
  189. package/features/requestContext/feature.js.map +1 -0
  190. package/features/requestContext/index.d.ts +4 -0
  191. package/features/requestContext/index.js +3 -0
  192. package/features/security/IdentityContext/IdentityContext.d.ts +4 -3
  193. package/features/security/IdentityContext/IdentityContext.js +9 -6
  194. package/features/security/IdentityContext/IdentityContext.js.map +1 -1
  195. package/features/security/IdentityContext/abstractions.d.ts +5 -0
  196. package/features/security/IdentityContext/abstractions.js.map +1 -1
  197. package/features/security/apiKeys/ApiKeyAuthenticator.d.ts +14 -0
  198. package/features/security/apiKeys/ApiKeyAuthenticator.js +36 -0
  199. package/features/security/apiKeys/ApiKeyAuthenticator.js.map +1 -0
  200. package/features/security/apiKeys/ApiKeyAuthorizer.d.ts +10 -0
  201. package/features/security/apiKeys/ApiKeyAuthorizer.js +15 -0
  202. package/features/security/apiKeys/ApiKeyAuthorizer.js.map +1 -0
  203. package/features/security/apiKeys/CreateApiKey/CreateApiKeyUseCase.js +11 -6
  204. package/features/security/apiKeys/CreateApiKey/CreateApiKeyUseCase.js.map +1 -1
  205. package/features/security/apiKeys/GetApiKeyBySlug/GetApiKeyBySlugUseCase.d.ts +1 -1
  206. package/features/security/apiKeys/GetApiKeyByToken/GetApiKeyByTokenUseCase.d.ts +1 -1
  207. package/features/security/apiKeys/UpdateApiKey/UpdateApiKeyUseCase.js +9 -3
  208. package/features/security/apiKeys/UpdateApiKey/UpdateApiKeyUseCase.js.map +1 -1
  209. package/features/security/apiKeys/feature.js +4 -0
  210. package/features/security/apiKeys/feature.js.map +1 -1
  211. package/features/security/apiKeys/shared/schemas.d.ts +2 -2
  212. package/features/security/apiKeys/shared/schemas.js +2 -2
  213. package/features/security/apiKeys/shared/schemas.js.map +1 -1
  214. package/features/security/authorization/AuthorizationContext/AuthorizationContext.d.ts +12 -3
  215. package/features/security/authorization/AuthorizationContext/AuthorizationContext.js +31 -18
  216. package/features/security/authorization/AuthorizationContext/AuthorizationContext.js.map +1 -1
  217. package/features/security/authorization/AuthorizationContext/abstractions.d.ts +2 -0
  218. package/features/security/authorization/AuthorizationContext/abstractions.js.map +1 -1
  219. package/features/security/authorization/AuthorizationContext/feature.js +6 -1
  220. package/features/security/authorization/AuthorizationContext/feature.js.map +1 -1
  221. package/features/security/authorization/GroupsTeamsAuthorizer/AssumedPermissions.d.ts +30 -0
  222. package/features/security/authorization/GroupsTeamsAuthorizer/AssumedPermissions.js +60 -0
  223. package/features/security/authorization/GroupsTeamsAuthorizer/AssumedPermissions.js.map +1 -0
  224. package/features/security/authorization/GroupsTeamsAuthorizer/GetPermissionsFromIdentity.d.ts +3 -3
  225. package/features/security/authorization/GroupsTeamsAuthorizer/GetPermissionsFromIdentity.js +5 -5
  226. package/features/security/authorization/GroupsTeamsAuthorizer/GetPermissionsFromIdentity.js.map +1 -1
  227. package/features/security/authorization/GroupsTeamsAuthorizer/feature.js +2 -0
  228. package/features/security/authorization/GroupsTeamsAuthorizer/feature.js.map +1 -1
  229. package/features/security/roles/CreateRole/CreateRoleUseCase.js +11 -6
  230. package/features/security/roles/CreateRole/CreateRoleUseCase.js.map +1 -1
  231. package/features/security/roles/CreateRole/schema.d.ts +1 -1
  232. package/features/security/roles/CreateRole/schema.js +1 -1
  233. package/features/security/roles/CreateRole/schema.js.map +1 -1
  234. package/features/security/roles/UpdateRole/UpdateRoleUseCase.js +9 -3
  235. package/features/security/roles/UpdateRole/UpdateRoleUseCase.js.map +1 -1
  236. package/features/security/roles/UpdateRole/schema.d.ts +1 -1
  237. package/features/security/roles/UpdateRole/schema.js +1 -1
  238. package/features/security/roles/UpdateRole/schema.js.map +1 -1
  239. package/features/security/shared/description.d.ts +4 -0
  240. package/features/security/shared/description.js +7 -0
  241. package/features/security/shared/description.js.map +1 -0
  242. package/features/security/shared/index.d.ts +1 -0
  243. package/features/security/shared/index.js +1 -0
  244. package/features/security/teams/CreateTeam/CreateTeamUseCase.d.ts +3 -1
  245. package/features/security/teams/CreateTeam/CreateTeamUseCase.js +20 -8
  246. package/features/security/teams/CreateTeam/CreateTeamUseCase.js.map +1 -1
  247. package/features/security/teams/CreateTeam/schema.d.ts +1 -1
  248. package/features/security/teams/CreateTeam/schema.js +1 -1
  249. package/features/security/teams/CreateTeam/schema.js.map +1 -1
  250. package/features/security/teams/UpdateTeam/UpdateTeamUseCase.d.ts +3 -1
  251. package/features/security/teams/UpdateTeam/UpdateTeamUseCase.js +20 -5
  252. package/features/security/teams/UpdateTeam/UpdateTeamUseCase.js.map +1 -1
  253. package/features/security/teams/UpdateTeam/schema.d.ts +1 -1
  254. package/features/security/teams/UpdateTeam/schema.js +1 -1
  255. package/features/security/teams/UpdateTeam/schema.js.map +1 -1
  256. package/features/security/teams/shared/resolveRoleIdentifiers.d.ts +17 -0
  257. package/features/security/teams/shared/resolveRoleIdentifiers.js +32 -0
  258. package/features/security/teams/shared/resolveRoleIdentifiers.js.map +1 -0
  259. package/features/slugify/DefaultSlugify.d.ts +8 -0
  260. package/features/slugify/DefaultSlugify.js +20 -0
  261. package/features/slugify/DefaultSlugify.js.map +1 -0
  262. package/features/slugify/abstractions.d.ts +12 -0
  263. package/features/slugify/abstractions.js +5 -0
  264. package/features/slugify/abstractions.js.map +1 -0
  265. package/features/slugify/feature.d.ts +4 -0
  266. package/features/slugify/feature.js +11 -0
  267. package/features/slugify/feature.js.map +1 -0
  268. package/features/slugify/index.d.ts +3 -0
  269. package/features/slugify/index.js +2 -0
  270. package/features/storageOperations/abstractions.d.ts +21 -0
  271. package/features/storageOperations/abstractions.js +10 -0
  272. package/features/storageOperations/abstractions.js.map +1 -0
  273. package/features/stringFormatter/DefaultStringFormatter.d.ts +17 -0
  274. package/features/stringFormatter/DefaultStringFormatter.js +19 -0
  275. package/features/stringFormatter/DefaultStringFormatter.js.map +1 -0
  276. package/features/stringFormatter/abstractions.d.ts +11 -0
  277. package/features/stringFormatter/abstractions.js +5 -0
  278. package/features/stringFormatter/abstractions.js.map +1 -0
  279. package/features/stringFormatter/feature.d.ts +4 -0
  280. package/features/stringFormatter/feature.js +13 -0
  281. package/features/stringFormatter/feature.js.map +1 -0
  282. package/features/stringFormatter/index.d.ts +3 -0
  283. package/features/stringFormatter/index.js +2 -0
  284. package/features/task/TaskDefinition/abstractions.d.ts +69 -4
  285. package/features/task/TaskDefinition/abstractions.js +2 -1
  286. package/features/task/TaskDefinition/abstractions.js.map +1 -1
  287. package/features/tenancy/TenantContext/TenantContext.d.ts +1 -0
  288. package/features/tenancy/TenantContext/TenantContext.js +13 -8
  289. package/features/tenancy/TenantContext/TenantContext.js.map +1 -1
  290. package/features/users/shared/types.d.ts +9 -7
  291. package/features/wcp/WcpContext/WcpContext.d.ts +12 -5
  292. package/features/wcp/WcpContext/WcpContext.js +29 -2
  293. package/features/wcp/WcpContext/WcpContext.js.map +1 -1
  294. package/features/wcp/WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.d.ts +11 -66
  295. package/features/wcp/WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.js +71 -33
  296. package/features/wcp/WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.js.map +1 -1
  297. package/features/wcp/WcpContext/feature.d.ts +1 -2
  298. package/features/wcp/WcpContext/feature.js +2 -2
  299. package/features/wcp/WcpContext/feature.js.map +1 -1
  300. package/features/wcp/WcpContext/index.d.ts +0 -1
  301. package/features/wcp/WcpContext/types.d.ts +0 -4
  302. package/features/wcp/WcpFeature.d.ts +1 -1
  303. package/features/wcp/WcpFeature.js +7 -2
  304. package/features/wcp/WcpFeature.js.map +1 -1
  305. package/features/wcp/WcpLicenseLoader.d.ts +25 -0
  306. package/features/wcp/WcpLicenseLoader.js +58 -0
  307. package/features/wcp/WcpLicenseLoader.js.map +1 -0
  308. package/features/wcp/WcpLicenseProvider.d.ts +21 -0
  309. package/features/wcp/WcpLicenseProvider.js +14 -0
  310. package/features/wcp/WcpLicenseProvider.js.map +1 -0
  311. package/features/wcp/resolveWcpProjectEnvironment.d.ts +9 -0
  312. package/features/wcp/resolveWcpProjectEnvironment.js +23 -0
  313. package/features/wcp/resolveWcpProjectEnvironment.js.map +1 -0
  314. package/graphql/ApiCoreSchemaFactory.d.ts +16 -0
  315. package/graphql/ApiCoreSchemaFactory.js +58 -0
  316. package/graphql/ApiCoreSchemaFactory.js.map +1 -0
  317. package/graphql/featureFlags/FeatureFlagsSchemaFactory.d.ts +10 -0
  318. package/graphql/featureFlags/FeatureFlagsSchemaFactory.js +53 -0
  319. package/graphql/featureFlags/FeatureFlagsSchemaFactory.js.map +1 -0
  320. package/graphql/security/NotAuthorizedResponse.d.ts +1 -1
  321. package/graphql/security/NotAuthorizedResponse.js +1 -1
  322. package/graphql/security/NotAuthorizedResponse.js.map +1 -1
  323. package/graphql/security/SecuritySchemaFactory.d.ts +15 -0
  324. package/graphql/security/SecuritySchemaFactory.js +27 -0
  325. package/graphql/security/SecuritySchemaFactory.js.map +1 -0
  326. package/graphql/security/addApiKeySchema.d.ts +2 -0
  327. package/graphql/security/{apiKey.gql.js → addApiKeySchema.js} +45 -27
  328. package/graphql/security/addApiKeySchema.js.map +1 -0
  329. package/graphql/security/addIdentitySchema.d.ts +2 -0
  330. package/graphql/security/{identity.gql.js → addIdentitySchema.js} +52 -35
  331. package/graphql/security/addIdentitySchema.js.map +1 -0
  332. package/graphql/security/addRoleSchema.d.ts +2 -0
  333. package/graphql/security/addRoleSchema.js +137 -0
  334. package/graphql/security/addRoleSchema.js.map +1 -0
  335. package/graphql/security/addSecurityBaseSchema.d.ts +2 -0
  336. package/graphql/security/{base.gql.js → addSecurityBaseSchema.js} +14 -16
  337. package/graphql/security/addSecurityBaseSchema.js.map +1 -0
  338. package/graphql/security/addTeamSchema.d.ts +2 -0
  339. package/graphql/security/addTeamSchema.js +157 -0
  340. package/graphql/security/addTeamSchema.js.map +1 -0
  341. package/graphql/system/SystemSchemaFactory.d.ts +10 -0
  342. package/graphql/system/SystemSchemaFactory.js +70 -0
  343. package/graphql/system/SystemSchemaFactory.js.map +1 -0
  344. package/graphql/users/UsersSchemaFactory.d.ts +10 -0
  345. package/graphql/users/UsersSchemaFactory.js +195 -0
  346. package/graphql/users/UsersSchemaFactory.js.map +1 -0
  347. package/graphql/wcp/WcpSchemaFactory.d.ts +10 -0
  348. package/graphql/wcp/{graphql.js → WcpSchemaFactory.js} +32 -18
  349. package/graphql/wcp/WcpSchemaFactory.js.map +1 -0
  350. package/idp/JwksCache.d.ts +14 -3
  351. package/idp/JwksCache.js +97 -17
  352. package/idp/JwksCache.js.map +1 -1
  353. package/idp/JwksStoreFeature.d.ts +8 -0
  354. package/idp/JwksStoreFeature.js +11 -0
  355. package/idp/JwksStoreFeature.js.map +1 -0
  356. package/idp/MemoryJwksStore.d.ts +14 -0
  357. package/idp/MemoryJwksStore.js +21 -0
  358. package/idp/MemoryJwksStore.js.map +1 -0
  359. package/idp/OidcJwtIdentityProvider.js +5 -1
  360. package/idp/OidcJwtIdentityProvider.js.map +1 -1
  361. package/idp/abstractions.d.ts +24 -0
  362. package/idp/abstractions.js +2 -1
  363. package/idp/abstractions.js.map +1 -1
  364. package/idp/feature.js +1 -2
  365. package/idp/feature.js.map +1 -1
  366. package/idp/index.d.ts +1 -0
  367. package/idp/index.js +1 -0
  368. package/index.d.ts +3 -1
  369. package/index.js +3 -1
  370. package/package.json +22 -22
  371. package/testing/environment.d.ts +14 -0
  372. package/testing/environment.js +18 -0
  373. package/testing/environment.js.map +1 -0
  374. package/types/core.d.ts +17 -5
  375. package/types/security.d.ts +0 -6
  376. package/types/tenancy.d.ts +0 -17
  377. package/types/users.d.ts +2 -16
  378. package/createApiCore.d.ts +0 -7
  379. package/createApiCore.js +0 -26
  380. package/createApiCore.js.map +0 -1
  381. package/graphql/security/apiKey.gql.d.ts +0 -4
  382. package/graphql/security/apiKey.gql.js.map +0 -1
  383. package/graphql/security/base.gql.d.ts +0 -4
  384. package/graphql/security/base.gql.js.map +0 -1
  385. package/graphql/security/identity.gql.d.ts +0 -4
  386. package/graphql/security/identity.gql.js.map +0 -1
  387. package/graphql/security/index.d.ts +0 -1
  388. package/graphql/security/index.js +0 -15
  389. package/graphql/security/index.js.map +0 -1
  390. package/graphql/security/role.gql.d.ts +0 -4
  391. package/graphql/security/role.gql.js +0 -106
  392. package/graphql/security/role.gql.js.map +0 -1
  393. package/graphql/security/team.gql.d.ts +0 -4
  394. package/graphql/security/team.gql.js +0 -119
  395. package/graphql/security/team.gql.js.map +0 -1
  396. package/graphql/system/createSystemGraphQL.d.ts +0 -2
  397. package/graphql/system/createSystemGraphQL.js +0 -54
  398. package/graphql/system/createSystemGraphQL.js.map +0 -1
  399. package/graphql/users/user.gql.d.ts +0 -3
  400. package/graphql/users/user.gql.js +0 -167
  401. package/graphql/users/user.gql.js.map +0 -1
  402. package/graphql/wcp/graphql.d.ts +0 -2
  403. package/graphql/wcp/graphql.js.map +0 -1
  404. package/legacy/security/LegacyContext.d.ts +0 -36
  405. package/legacy/security/LegacyContext.js +0 -152
  406. package/legacy/security/LegacyContext.js.map +0 -1
  407. package/legacy/security/createSecurityContext.d.ts +0 -3
  408. package/legacy/security/createSecurityContext.js +0 -10
  409. package/legacy/security/createSecurityContext.js.map +0 -1
  410. package/legacy/security/plugins/apiKeyAuthentication.d.ts +0 -7
  411. package/legacy/security/plugins/apiKeyAuthentication.js +0 -20
  412. package/legacy/security/plugins/apiKeyAuthentication.js.map +0 -1
  413. package/legacy/security/plugins/apiKeyAuthorization.d.ts +0 -6
  414. package/legacy/security/plugins/apiKeyAuthorization.js +0 -13
  415. package/legacy/security/plugins/apiKeyAuthorization.js.map +0 -1
  416. package/legacy/security/plugins/authenticateUsingCookie.d.ts +0 -5
  417. package/legacy/security/plugins/authenticateUsingCookie.js +0 -23
  418. package/legacy/security/plugins/authenticateUsingCookie.js.map +0 -1
  419. package/legacy/security/plugins/authenticateUsingHttpHeader.d.ts +0 -5
  420. package/legacy/security/plugins/authenticateUsingHttpHeader.js +0 -20
  421. package/legacy/security/plugins/authenticateUsingHttpHeader.js.map +0 -1
  422. package/legacy/security/plugins/secureHeaders.d.ts +0 -1
  423. package/legacy/security/plugins/secureHeaders.js +0 -30
  424. package/legacy/security/plugins/secureHeaders.js.map +0 -1
  425. package/legacy/tenancy/LegacyContext.d.ts +0 -15
  426. package/legacy/tenancy/LegacyContext.js +0 -57
  427. package/legacy/tenancy/LegacyContext.js.map +0 -1
  428. package/legacy/tenancy/createTenancyContext.d.ts +0 -3
  429. package/legacy/tenancy/createTenancyContext.js +0 -31
  430. package/legacy/tenancy/createTenancyContext.js.map +0 -1
  431. package/legacy/users/LegacyContext.d.ts +0 -13
  432. package/legacy/users/LegacyContext.js +0 -55
  433. package/legacy/users/LegacyContext.js.map +0 -1
  434. package/legacy/users/createAdminUsersContext.d.ts +0 -3
  435. package/legacy/users/createAdminUsersContext.js +0 -12
  436. package/legacy/users/createAdminUsersContext.js.map +0 -1
  437. package/legacy/wcp/LegacyWcpContext.d.ts +0 -37
  438. package/legacy/wcp/LegacyWcpContext.js +0 -96
  439. package/legacy/wcp/LegacyWcpContext.js.map +0 -1
  440. package/legacy/wcp/context.d.ts +0 -5
  441. package/legacy/wcp/context.js +0 -46
  442. package/legacy/wcp/context.js.map +0 -1
@@ -0,0 +1,19 @@
1
+ import { RawAssumePermissions } from "./abstractions.js";
2
+ class RawAssumePermissionsImpl {
3
+ get() {
4
+ return this.value;
5
+ }
6
+ set(value) {
7
+ this.value = value;
8
+ }
9
+ constructor(){
10
+ this.value = null;
11
+ }
12
+ }
13
+ const RawAssumePermissions_RawAssumePermissions = RawAssumePermissions.createImplementation({
14
+ implementation: RawAssumePermissionsImpl,
15
+ dependencies: []
16
+ });
17
+ export { RawAssumePermissions_RawAssumePermissions as RawAssumePermissions };
18
+
19
+ //# sourceMappingURL=RawAssumePermissions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/requestContext/RawAssumePermissions.js","sources":["../../../src/features/requestContext/RawAssumePermissions.ts"],"sourcesContent":["import { RawAssumePermissions as Abstraction } from \"./abstractions.js\";\n\n/**\n * Per-request holder for the transport-extracted preview target. Registered per request, so a\n * fresh instance holds the value for the current request only.\n */\nclass RawAssumePermissionsImpl implements Abstraction.Interface {\n private value: Abstraction.Target | null = null;\n\n get(): Abstraction.Target | null {\n return this.value;\n }\n\n set(value: Abstraction.Target | null): void {\n this.value = value;\n }\n}\n\nexport const RawAssumePermissions = Abstraction.createImplementation({\n implementation: RawAssumePermissionsImpl,\n dependencies: []\n});\n"],"names":["RawAssumePermissionsImpl","value","RawAssumePermissions","Abstraction"],"mappings":";AAMA,MAAMA;IAGF,MAAiC;QAC7B,OAAO,IAAI,CAAC,KAAK;IACrB;IAEA,IAAIC,KAAgC,EAAQ;QACxC,IAAI,CAAC,KAAK,GAAGA;IACjB;;aARQ,KAAK,GAA8B;;AAS/C;AAEO,MAAMC,4CAAuBC,qBAAAA,oBAAgC,CAAC;IACjE,gBAAgBH;IAChB,cAAc,EAAE;AACpB"}
@@ -0,0 +1,14 @@
1
+ import type { IRawAuthToken } from "./abstractions.js";
2
+ /**
3
+ * Per-request holder for the transport-extracted raw auth token. Registered per request, so a fresh
4
+ * instance holds the value for the current request only.
5
+ */
6
+ declare class RawAuthTokenImpl implements IRawAuthToken {
7
+ private value;
8
+ get(): string | null;
9
+ set(token: string | null): void;
10
+ }
11
+ export declare const RawAuthToken: typeof RawAuthTokenImpl & {
12
+ __abstraction: import("@webiny/di").Abstraction<IRawAuthToken>;
13
+ };
14
+ export {};
@@ -0,0 +1,19 @@
1
+ import { RawAuthToken } from "./abstractions.js";
2
+ class RawAuthTokenImpl {
3
+ get() {
4
+ return this.value;
5
+ }
6
+ set(token) {
7
+ this.value = token;
8
+ }
9
+ constructor(){
10
+ this.value = null;
11
+ }
12
+ }
13
+ const RawAuthToken_RawAuthToken = RawAuthToken.createImplementation({
14
+ implementation: RawAuthTokenImpl,
15
+ dependencies: []
16
+ });
17
+ export { RawAuthToken_RawAuthToken as RawAuthToken };
18
+
19
+ //# sourceMappingURL=RawAuthToken.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/requestContext/RawAuthToken.js","sources":["../../../src/features/requestContext/RawAuthToken.ts"],"sourcesContent":["import { RawAuthToken as Abstraction } from \"./abstractions.js\";\nimport type { IRawAuthToken } from \"./abstractions.js\";\n\n/**\n * Per-request holder for the transport-extracted raw auth token. Registered per request, so a fresh\n * instance holds the value for the current request only.\n */\nclass RawAuthTokenImpl implements IRawAuthToken {\n private value: string | null = null;\n\n get(): string | null {\n return this.value;\n }\n\n set(token: string | null): void {\n this.value = token;\n }\n}\n\nexport const RawAuthToken = Abstraction.createImplementation({\n implementation: RawAuthTokenImpl,\n dependencies: []\n});\n"],"names":["RawAuthTokenImpl","token","RawAuthToken","Abstraction"],"mappings":";AAOA,MAAMA;IAGF,MAAqB;QACjB,OAAO,IAAI,CAAC,KAAK;IACrB;IAEA,IAAIC,KAAoB,EAAQ;QAC5B,IAAI,CAAC,KAAK,GAAGA;IACjB;;aARQ,KAAK,GAAkB;;AASnC;AAEO,MAAMC,4BAAeC,aAAAA,oBAAgC,CAAC;IACzD,gBAAgBH;IAChB,cAAc,EAAE;AACpB"}
@@ -0,0 +1,14 @@
1
+ import type { IRawTenantId } from "./abstractions.js";
2
+ /**
3
+ * Per-request holder for the transport-extracted raw tenant id. Registered per request, so a fresh
4
+ * instance holds the value for the current request only.
5
+ */
6
+ declare class RawTenantIdImpl implements IRawTenantId {
7
+ private value;
8
+ get(): string | null;
9
+ set(id: string | null): void;
10
+ }
11
+ export declare const RawTenantId: typeof RawTenantIdImpl & {
12
+ __abstraction: import("@webiny/di").Abstraction<IRawTenantId>;
13
+ };
14
+ export {};
@@ -0,0 +1,19 @@
1
+ import { RawTenantId } from "./abstractions.js";
2
+ class RawTenantIdImpl {
3
+ get() {
4
+ return this.value;
5
+ }
6
+ set(id) {
7
+ this.value = id;
8
+ }
9
+ constructor(){
10
+ this.value = null;
11
+ }
12
+ }
13
+ const RawTenantId_RawTenantId = RawTenantId.createImplementation({
14
+ implementation: RawTenantIdImpl,
15
+ dependencies: []
16
+ });
17
+ export { RawTenantId_RawTenantId as RawTenantId };
18
+
19
+ //# sourceMappingURL=RawTenantId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/requestContext/RawTenantId.js","sources":["../../../src/features/requestContext/RawTenantId.ts"],"sourcesContent":["import { RawTenantId as Abstraction } from \"./abstractions.js\";\nimport type { IRawTenantId } from \"./abstractions.js\";\n\n/**\n * Per-request holder for the transport-extracted raw tenant id. Registered per request, so a fresh\n * instance holds the value for the current request only.\n */\nclass RawTenantIdImpl implements IRawTenantId {\n private value: string | null = null;\n\n get(): string | null {\n return this.value;\n }\n\n set(id: string | null): void {\n this.value = id;\n }\n}\n\nexport const RawTenantId = Abstraction.createImplementation({\n implementation: RawTenantIdImpl,\n dependencies: []\n});\n"],"names":["RawTenantIdImpl","id","RawTenantId","Abstraction"],"mappings":";AAOA,MAAMA;IAGF,MAAqB;QACjB,OAAO,IAAI,CAAC,KAAK;IACrB;IAEA,IAAIC,EAAiB,EAAQ;QACzB,IAAI,CAAC,KAAK,GAAGA;IACjB;;aARQ,KAAK,GAAkB;;AASnC;AAEO,MAAMC,0BAAcC,YAAAA,oBAAgC,CAAC;IACxD,gBAAgBH;IAChB,cAAc,EAAE;AACpB"}
@@ -0,0 +1,19 @@
1
+ import { RequestIdentityLoader as Abstraction } from "./abstractions.js";
2
+ import type { IRawAuthToken } from "./abstractions.js";
3
+ import type { IAuthenticationContext } from "../../features/security/authentication/AuthenticationContext/index.js";
4
+ import type { IIdentityContext } from "../../features/security/IdentityContext/abstractions.js";
5
+ /**
6
+ * LOAD step: authenticates the token set by the transport's EXTRACT step into RawAuthToken and sets
7
+ * IdentityContext. A null/absent token authenticates as anonymous (preserves the previous
8
+ * always-authenticate-the-header behavior). Transport-agnostic.
9
+ */
10
+ export declare class RequestIdentityLoaderImpl implements Abstraction.Interface {
11
+ private authentication;
12
+ private identityContext;
13
+ private rawAuthToken;
14
+ constructor(authentication: IAuthenticationContext, identityContext: IIdentityContext, rawAuthToken: IRawAuthToken);
15
+ establish(): Promise<void>;
16
+ }
17
+ export declare const RequestIdentityLoader: typeof RequestIdentityLoaderImpl & {
18
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IRequestIdentityLoader>;
19
+ };
@@ -0,0 +1,26 @@
1
+ import { RawAuthToken, RequestIdentityLoader } from "./abstractions.js";
2
+ import { AuthenticationContext } from "../security/authentication/AuthenticationContext/index.js";
3
+ import { IdentityContext } from "../security/IdentityContext/index.js";
4
+ class RequestIdentityLoaderImpl {
5
+ constructor(authentication, identityContext, rawAuthToken){
6
+ this.authentication = authentication;
7
+ this.identityContext = identityContext;
8
+ this.rawAuthToken = rawAuthToken;
9
+ }
10
+ async establish() {
11
+ const token = this.rawAuthToken.get() ?? "";
12
+ const identity = await this.authentication.authenticate(token);
13
+ this.identityContext.setIdentity(identity);
14
+ }
15
+ }
16
+ const RequestIdentityLoader_RequestIdentityLoader = RequestIdentityLoader.createImplementation({
17
+ implementation: RequestIdentityLoaderImpl,
18
+ dependencies: [
19
+ AuthenticationContext,
20
+ IdentityContext,
21
+ RawAuthToken
22
+ ]
23
+ });
24
+ export { RequestIdentityLoaderImpl, RequestIdentityLoader_RequestIdentityLoader as RequestIdentityLoader };
25
+
26
+ //# sourceMappingURL=RequestIdentityLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/requestContext/RequestIdentityLoader.js","sources":["../../../src/features/requestContext/RequestIdentityLoader.ts"],"sourcesContent":["import { RequestIdentityLoader as Abstraction, RawAuthToken } from \"./abstractions.js\";\nimport type { IRawAuthToken } from \"./abstractions.js\";\nimport { AuthenticationContext } from \"~/features/security/authentication/AuthenticationContext/index.js\";\nimport type { IAuthenticationContext } from \"~/features/security/authentication/AuthenticationContext/index.js\";\nimport { IdentityContext } from \"~/features/security/IdentityContext/index.js\";\nimport type { IIdentityContext } from \"~/features/security/IdentityContext/abstractions.js\";\n\n/**\n * LOAD step: authenticates the token set by the transport's EXTRACT step into RawAuthToken and sets\n * IdentityContext. A null/absent token authenticates as anonymous (preserves the previous\n * always-authenticate-the-header behavior). Transport-agnostic.\n */\nexport class RequestIdentityLoaderImpl implements Abstraction.Interface {\n constructor(\n private authentication: IAuthenticationContext,\n private identityContext: IIdentityContext,\n private rawAuthToken: IRawAuthToken\n ) {}\n\n async establish(): Promise<void> {\n const token = this.rawAuthToken.get() ?? \"\";\n const identity = await this.authentication.authenticate(token);\n this.identityContext.setIdentity(identity);\n }\n}\n\nexport const RequestIdentityLoader = Abstraction.createImplementation({\n implementation: RequestIdentityLoaderImpl,\n dependencies: [AuthenticationContext, IdentityContext, RawAuthToken]\n});\n"],"names":["RequestIdentityLoaderImpl","authentication","identityContext","rawAuthToken","token","identity","RequestIdentityLoader","Abstraction","AuthenticationContext","IdentityContext","RawAuthToken"],"mappings":";;;AAYO,MAAMA;IACT,YACYC,cAAsC,EACtCC,eAAiC,EACjCC,YAA2B,CACrC;aAHUF,cAAc,GAAdA;aACAC,eAAe,GAAfA;aACAC,YAAY,GAAZA;IACT;IAEH,MAAM,YAA2B;QAC7B,MAAMC,QAAQ,IAAI,CAAC,YAAY,CAAC,GAAG,MAAM;QACzC,MAAMC,WAAW,MAAM,IAAI,CAAC,cAAc,CAAC,YAAY,CAACD;QACxD,IAAI,CAAC,eAAe,CAAC,WAAW,CAACC;IACrC;AACJ;AAEO,MAAMC,8CAAwBC,sBAAAA,oBAAgC,CAAC;IAClE,gBAAgBP;IAChB,cAAc;QAACQ;QAAuBC;QAAiBC;KAAa;AACxE"}
@@ -0,0 +1,18 @@
1
+ import { RequestTenantLoader as Abstraction } from "./abstractions.js";
2
+ import type { IRawTenantId } from "./abstractions.js";
3
+ import type { ITenantContext } from "../../features/tenancy/TenantContext/abstractions.js";
4
+ import type { IGetTenantByIdUseCase } from "../../features/tenancy/GetTenantById/abstractions.js";
5
+ /**
6
+ * LOAD step: reads the raw tenant id (set by the transport's EXTRACT step into RawTenantId),
7
+ * resolves the Tenant, and sets TenantContext. Transport-agnostic.
8
+ */
9
+ export declare class RequestTenantLoaderImpl implements Abstraction.Interface {
10
+ private tenantContext;
11
+ private getTenantById;
12
+ private rawTenantId;
13
+ constructor(tenantContext: ITenantContext, getTenantById: IGetTenantByIdUseCase, rawTenantId: IRawTenantId);
14
+ establish(): Promise<void>;
15
+ }
16
+ export declare const RequestTenantLoader: typeof RequestTenantLoaderImpl & {
17
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IRequestTenantLoader>;
18
+ };
@@ -0,0 +1,52 @@
1
+ import { RawTenantId, RequestTenantLoader } from "./abstractions.js";
2
+ import { TenantContext } from "../tenancy/TenantContext/index.js";
3
+ import { GetTenantByIdUseCase } from "../tenancy/GetTenantById/index.js";
4
+ const DEFAULT_TENANT_ID = "root";
5
+ const createBootstrapRootTenant = ()=>{
6
+ const now = new Date().toISOString();
7
+ return {
8
+ id: DEFAULT_TENANT_ID,
9
+ name: "Root",
10
+ description: "",
11
+ status: "enabled",
12
+ isInstalled: false,
13
+ settings: {
14
+ name: {
15
+ full: "Root",
16
+ slug: "root"
17
+ },
18
+ social: {},
19
+ favicon: {},
20
+ logo: {}
21
+ },
22
+ tags: [],
23
+ parent: null,
24
+ createdOn: now,
25
+ savedOn: now
26
+ };
27
+ };
28
+ class RequestTenantLoaderImpl {
29
+ constructor(tenantContext, getTenantById, rawTenantId){
30
+ this.tenantContext = tenantContext;
31
+ this.getTenantById = getTenantById;
32
+ this.rawTenantId = rawTenantId;
33
+ }
34
+ async establish() {
35
+ const resolvedId = this.rawTenantId.get() || DEFAULT_TENANT_ID;
36
+ const result = await this.getTenantById.execute(resolvedId);
37
+ if (result.isOk()) return void this.tenantContext.setTenant(result.value);
38
+ if (resolvedId === DEFAULT_TENANT_ID) return void this.tenantContext.setTenant(createBootstrapRootTenant());
39
+ console.warn(`[RequestTenantLoader] Tenant "${resolvedId}" not found.`);
40
+ }
41
+ }
42
+ const RequestTenantLoader_RequestTenantLoader = RequestTenantLoader.createImplementation({
43
+ implementation: RequestTenantLoaderImpl,
44
+ dependencies: [
45
+ TenantContext,
46
+ GetTenantByIdUseCase,
47
+ RawTenantId
48
+ ]
49
+ });
50
+ export { RequestTenantLoaderImpl, RequestTenantLoader_RequestTenantLoader as RequestTenantLoader };
51
+
52
+ //# sourceMappingURL=RequestTenantLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/requestContext/RequestTenantLoader.js","sources":["../../../src/features/requestContext/RequestTenantLoader.ts"],"sourcesContent":["import { RequestTenantLoader as Abstraction, RawTenantId } from \"./abstractions.js\";\nimport type { IRawTenantId } from \"./abstractions.js\";\nimport { TenantContext } from \"~/features/tenancy/TenantContext/index.js\";\nimport type { ITenantContext } from \"~/features/tenancy/TenantContext/abstractions.js\";\nimport { GetTenantByIdUseCase } from \"~/features/tenancy/GetTenantById/index.js\";\nimport type { IGetTenantByIdUseCase } from \"~/features/tenancy/GetTenantById/abstractions.js\";\nimport type { Tenant } from \"~/types/tenancy.js\";\n\nconst DEFAULT_TENANT_ID = \"root\";\n\n/**\n * A minimal in-memory root tenant used only before the system is installed, when the real root\n * tenant record doesn't exist yet. It keeps the request pipeline + GraphQL schema build functional\n * (nothing dereferences a null tenant) so the install mutation can run and create the real root.\n * Once installed, getTenantById returns the persisted record and this is never used.\n */\nconst createBootstrapRootTenant = (): Tenant => {\n const now = new Date().toISOString();\n return {\n id: DEFAULT_TENANT_ID,\n name: \"Root\",\n description: \"\",\n status: \"enabled\",\n isInstalled: false,\n settings: {\n name: { full: \"Root\", slug: \"root\" },\n social: {},\n favicon: {},\n logo: {}\n } as any,\n tags: [],\n parent: null,\n createdOn: now,\n savedOn: now\n };\n};\n\n/**\n * LOAD step: reads the raw tenant id (set by the transport's EXTRACT step into RawTenantId),\n * resolves the Tenant, and sets TenantContext. Transport-agnostic.\n */\nexport class RequestTenantLoaderImpl implements Abstraction.Interface {\n constructor(\n private tenantContext: ITenantContext,\n private getTenantById: IGetTenantByIdUseCase,\n private rawTenantId: IRawTenantId\n ) {}\n\n async establish(): Promise<void> {\n const resolvedId = this.rawTenantId.get() || DEFAULT_TENANT_ID;\n const result = await this.getTenantById.execute(resolvedId);\n if (result.isOk()) {\n this.tenantContext.setTenant(result.value);\n return;\n }\n\n // Fresh, not-yet-installed environment: the root tenant record doesn't exist yet. Establish a\n // bootstrap root so the request pipeline + GraphQL schema build work and the install mutation\n // can create the real root tenant. Only ever taken for the root tenant pre-install.\n if (resolvedId === DEFAULT_TENANT_ID) {\n this.tenantContext.setTenant(createBootstrapRootTenant());\n return;\n }\n\n console.warn(`[RequestTenantLoader] Tenant \"${resolvedId}\" not found.`);\n }\n}\n\nexport const RequestTenantLoader = Abstraction.createImplementation({\n implementation: RequestTenantLoaderImpl,\n dependencies: [TenantContext, GetTenantByIdUseCase, RawTenantId]\n});\n"],"names":["DEFAULT_TENANT_ID","createBootstrapRootTenant","now","Date","RequestTenantLoaderImpl","tenantContext","getTenantById","rawTenantId","resolvedId","result","console","RequestTenantLoader","Abstraction","TenantContext","GetTenantByIdUseCase","RawTenantId"],"mappings":";;;AAQA,MAAMA,oBAAoB;AAQ1B,MAAMC,4BAA4B;IAC9B,MAAMC,MAAM,IAAIC,OAAO,WAAW;IAClC,OAAO;QACH,IAAIH;QACJ,MAAM;QACN,aAAa;QACb,QAAQ;QACR,aAAa;QACb,UAAU;YACN,MAAM;gBAAE,MAAM;gBAAQ,MAAM;YAAO;YACnC,QAAQ,CAAC;YACT,SAAS,CAAC;YACV,MAAM,CAAC;QACX;QACA,MAAM,EAAE;QACR,QAAQ;QACR,WAAWE;QACX,SAASA;IACb;AACJ;AAMO,MAAME;IACT,YACYC,aAA6B,EAC7BC,aAAoC,EACpCC,WAAyB,CACnC;aAHUF,aAAa,GAAbA;aACAC,aAAa,GAAbA;aACAC,WAAW,GAAXA;IACT;IAEH,MAAM,YAA2B;QAC7B,MAAMC,aAAa,IAAI,CAAC,WAAW,CAAC,GAAG,MAAMR;QAC7C,MAAMS,SAAS,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,CAACD;QAChD,IAAIC,OAAO,IAAI,IAAI,YACf,IAAI,CAAC,aAAa,CAAC,SAAS,CAACA,OAAO,KAAK;QAO7C,IAAID,eAAeR,mBAAmB,YAClC,IAAI,CAAC,aAAa,CAAC,SAAS,CAACC;QAIjCS,QAAQ,IAAI,CAAC,CAAC,8BAA8B,EAAEF,WAAW,YAAY,CAAC;IAC1E;AACJ;AAEO,MAAMG,0CAAsBC,oBAAAA,oBAAgC,CAAC;IAChE,gBAAgBR;IAChB,cAAc;QAACS;QAAeC;QAAsBC;KAAY;AACpE"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Per-request holder for the raw tenant id EXTRACTED by the transport (e.g. the `x-tenant` header
3
+ * of an API Gateway event, the bucket name of an S3 event, or `payload.tenant` of a background
4
+ * task). The transport-specific EXTRACT step sets this; the transport-agnostic LOAD step
5
+ * (RequestTenantLoader) reads it, resolves the Tenant, and sets TenantContext.
6
+ */
7
+ export interface IRawTenantId {
8
+ get(): string | null;
9
+ set(id: string | null): void;
10
+ }
11
+ export declare const RawTenantId: import("@webiny/di").Abstraction<IRawTenantId>;
12
+ export declare namespace RawTenantId {
13
+ type Interface = IRawTenantId;
14
+ }
15
+ /**
16
+ * Per-request holder for the raw auth token EXTRACTED by the transport (e.g. the `Authorization`
17
+ * bearer header or an auth cookie of an API Gateway event). Only token-based transports set this;
18
+ * the transport-agnostic LOAD step (RequestIdentityLoader) reads it, authenticates it, and
19
+ * sets IdentityContext. A null/absent value authenticates as anonymous.
20
+ *
21
+ * Note: non-token transports (S3, background tasks) never set this — S3 has no user identity, and
22
+ * background-task identity is derived from `task.createdBy` after the task is fetched.
23
+ */
24
+ export interface IRawAuthToken {
25
+ get(): string | null;
26
+ set(token: string | null): void;
27
+ }
28
+ export declare const RawAuthToken: import("@webiny/di").Abstraction<IRawAuthToken>;
29
+ export declare namespace RawAuthToken {
30
+ type Interface = IRawAuthToken;
31
+ }
32
+ /**
33
+ * Per-request holder for the role or team the caller asked to be evaluated as, EXTRACTED by the
34
+ * transport from the `x-webiny-assume-permissions` header. This is a preview mechanism: it can
35
+ * only ever narrow what a caller may do, never widen it. AssumedPermissions reads this holder and
36
+ * substitutes the permission set, but only after confirming the caller's own permissions grant
37
+ * full access.
38
+ *
39
+ * Note: only the HTTP transports set this. S3 and background tasks have no caller to preview as.
40
+ */
41
+ export interface IAssumePermissionsTarget {
42
+ type: "role" | "team";
43
+ id: string;
44
+ }
45
+ export interface IRawAssumePermissions {
46
+ get(): IAssumePermissionsTarget | null;
47
+ set(value: IAssumePermissionsTarget | null): void;
48
+ }
49
+ export declare const RawAssumePermissions: import("@webiny/di").Abstraction<IRawAssumePermissions>;
50
+ export declare namespace RawAssumePermissions {
51
+ type Interface = IRawAssumePermissions;
52
+ type Target = IAssumePermissionsTarget;
53
+ }
54
+ /**
55
+ * LOAD step: authenticates the token held by RawAuthToken and sets IdentityContext. Fully
56
+ * transport-agnostic — transports only EXTRACT the token into RawAuthToken.
57
+ */
58
+ export interface IRequestIdentityLoader {
59
+ establish(): Promise<void>;
60
+ }
61
+ export declare const RequestIdentityLoader: import("@webiny/di").Abstraction<IRequestIdentityLoader>;
62
+ export declare namespace RequestIdentityLoader {
63
+ type Interface = IRequestIdentityLoader;
64
+ }
65
+ /**
66
+ * LOAD step: resolves the Tenant for the id held by RawTenantId and sets TenantContext. Fully
67
+ * transport-agnostic — transports only EXTRACT the id into RawTenantId.
68
+ */
69
+ export interface IRequestTenantLoader {
70
+ establish(): Promise<void>;
71
+ }
72
+ export declare const RequestTenantLoader: import("@webiny/di").Abstraction<IRequestTenantLoader>;
73
+ export declare namespace RequestTenantLoader {
74
+ type Interface = IRequestTenantLoader;
75
+ }
@@ -0,0 +1,9 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const RawTenantId = createAbstraction("RequestContext/RawTenantId");
3
+ const RawAuthToken = createAbstraction("RequestContext/RawAuthToken");
4
+ const RawAssumePermissions = createAbstraction("RequestContext/RawAssumePermissions");
5
+ const RequestIdentityLoader = createAbstraction("RequestContext/RequestIdentityLoader");
6
+ const RequestTenantLoader = createAbstraction("RequestContext/RequestTenantLoader");
7
+ export { RawAssumePermissions, RawAuthToken, RawTenantId, RequestIdentityLoader, RequestTenantLoader };
8
+
9
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/requestContext/abstractions.js","sources":["../../../src/features/requestContext/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\n\n/**\n * Per-request holder for the raw tenant id EXTRACTED by the transport (e.g. the `x-tenant` header\n * of an API Gateway event, the bucket name of an S3 event, or `payload.tenant` of a background\n * task). The transport-specific EXTRACT step sets this; the transport-agnostic LOAD step\n * (RequestTenantLoader) reads it, resolves the Tenant, and sets TenantContext.\n */\nexport interface IRawTenantId {\n get(): string | null;\n set(id: string | null): void;\n}\n\nexport const RawTenantId = createAbstraction<IRawTenantId>(\"RequestContext/RawTenantId\");\n\nexport namespace RawTenantId {\n export type Interface = IRawTenantId;\n}\n\n/**\n * Per-request holder for the raw auth token EXTRACTED by the transport (e.g. the `Authorization`\n * bearer header or an auth cookie of an API Gateway event). Only token-based transports set this;\n * the transport-agnostic LOAD step (RequestIdentityLoader) reads it, authenticates it, and\n * sets IdentityContext. A null/absent value authenticates as anonymous.\n *\n * Note: non-token transports (S3, background tasks) never set this — S3 has no user identity, and\n * background-task identity is derived from `task.createdBy` after the task is fetched.\n */\nexport interface IRawAuthToken {\n get(): string | null;\n set(token: string | null): void;\n}\n\nexport const RawAuthToken = createAbstraction<IRawAuthToken>(\"RequestContext/RawAuthToken\");\n\nexport namespace RawAuthToken {\n export type Interface = IRawAuthToken;\n}\n\n/**\n * Per-request holder for the role or team the caller asked to be evaluated as, EXTRACTED by the\n * transport from the `x-webiny-assume-permissions` header. This is a preview mechanism: it can\n * only ever narrow what a caller may do, never widen it. AssumedPermissions reads this holder and\n * substitutes the permission set, but only after confirming the caller's own permissions grant\n * full access.\n *\n * Note: only the HTTP transports set this. S3 and background tasks have no caller to preview as.\n */\nexport interface IAssumePermissionsTarget {\n /*\n * Whose permissions to assume. A team is a set of roles, so assuming one means the union of its\n * roles' permissions. Assuming a user's permissions would be another type here, resolved to\n * that user's roles and teams the same way.\n */\n type: \"role\" | \"team\";\n id: string;\n}\n\nexport interface IRawAssumePermissions {\n get(): IAssumePermissionsTarget | null;\n set(value: IAssumePermissionsTarget | null): void;\n}\n\nexport const RawAssumePermissions = createAbstraction<IRawAssumePermissions>(\n \"RequestContext/RawAssumePermissions\"\n);\n\nexport namespace RawAssumePermissions {\n export type Interface = IRawAssumePermissions;\n export type Target = IAssumePermissionsTarget;\n}\n\n/**\n * LOAD step: authenticates the token held by RawAuthToken and sets IdentityContext. Fully\n * transport-agnostic — transports only EXTRACT the token into RawAuthToken.\n */\nexport interface IRequestIdentityLoader {\n establish(): Promise<void>;\n}\n\nexport const RequestIdentityLoader = createAbstraction<IRequestIdentityLoader>(\n \"RequestContext/RequestIdentityLoader\"\n);\n\nexport namespace RequestIdentityLoader {\n export type Interface = IRequestIdentityLoader;\n}\n\n/**\n * LOAD step: resolves the Tenant for the id held by RawTenantId and sets TenantContext. Fully\n * transport-agnostic — transports only EXTRACT the id into RawTenantId.\n */\nexport interface IRequestTenantLoader {\n establish(): Promise<void>;\n}\n\nexport const RequestTenantLoader = createAbstraction<IRequestTenantLoader>(\n \"RequestContext/RequestTenantLoader\"\n);\n\nexport namespace RequestTenantLoader {\n export type Interface = IRequestTenantLoader;\n}\n"],"names":["RawTenantId","createAbstraction","RawAuthToken","RawAssumePermissions","RequestIdentityLoader","RequestTenantLoader"],"mappings":";AAaO,MAAMA,cAAcC,kBAAgC;AAoBpD,MAAMC,eAAeD,kBAAiC;AA8BtD,MAAME,uBAAuBF,kBAChC;AAgBG,MAAMG,wBAAwBH,kBACjC;AAeG,MAAMI,sBAAsBJ,kBAC/B"}
@@ -0,0 +1,14 @@
1
+ import { RawAssumePermissions } from "./abstractions.js";
2
+ export declare const ASSUME_PERMISSIONS_HEADER = "x-webiny-assume-permissions";
3
+ type HeaderValue = string | string[] | undefined;
4
+ type Headers = Record<string, HeaderValue> | undefined;
5
+ /**
6
+ * Reads the `x-webiny-assume-permissions` header and parses it into the role or team whose
7
+ * permissions should be previewed. The value is `role:<id>` or `team:<id>`.
8
+ *
9
+ * Anything else parses to null, which leaves the caller's own permissions untouched. Lives in
10
+ * api-core rather than in a transport package so the HTTP transports cannot drift on the format or
11
+ * on header casing.
12
+ */
13
+ export declare function extractAssumePermissions(headers: Headers): RawAssumePermissions.Target | null;
14
+ export {};
@@ -0,0 +1,32 @@
1
+ const ASSUME_PERMISSIONS_HEADER = "x-webiny-assume-permissions";
2
+ function readHeader(headers, name) {
3
+ if (!headers) return null;
4
+ for (const key of Object.keys(headers)){
5
+ if (key.toLowerCase() !== name) continue;
6
+ const value = headers[key];
7
+ if (Array.isArray(value)) return value[0] ?? null;
8
+ return value ?? null;
9
+ }
10
+ return null;
11
+ }
12
+ function extractAssumePermissions(headers) {
13
+ const value = readHeader(headers, ASSUME_PERMISSIONS_HEADER);
14
+ if (!value) return null;
15
+ const separatorIndex = value.indexOf(":");
16
+ if (separatorIndex < 1) return null;
17
+ const type = value.slice(0, separatorIndex).trim();
18
+ const id = value.slice(separatorIndex + 1).trim();
19
+ if ("" === id) return null;
20
+ if ("role" === type) return {
21
+ type: "role",
22
+ id
23
+ };
24
+ if ("team" === type) return {
25
+ type: "team",
26
+ id
27
+ };
28
+ return null;
29
+ }
30
+ export { ASSUME_PERMISSIONS_HEADER, extractAssumePermissions };
31
+
32
+ //# sourceMappingURL=extractAssumePermissions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/requestContext/extractAssumePermissions.js","sources":["../../../src/features/requestContext/extractAssumePermissions.ts"],"sourcesContent":["import { RawAssumePermissions } from \"./abstractions.js\";\n\nexport const ASSUME_PERMISSIONS_HEADER = \"x-webiny-assume-permissions\";\n\ntype HeaderValue = string | string[] | undefined;\ntype Headers = Record<string, HeaderValue> | undefined;\n\nfunction readHeader(headers: Headers, name: string): string | null {\n if (!headers) {\n return null;\n }\n\n /*\n * Header names are case-insensitive, and the casing that reaches us depends on the transport\n * and on the client, so match on the lowercased key rather than guessing a spelling. Node's\n * IncomingMessage also hands back an array when a header repeats.\n */\n for (const key of Object.keys(headers)) {\n if (key.toLowerCase() !== name) {\n continue;\n }\n\n const value = headers[key];\n if (Array.isArray(value)) {\n return value[0] ?? null;\n }\n\n return value ?? null;\n }\n\n return null;\n}\n\n/**\n * Reads the `x-webiny-assume-permissions` header and parses it into the role or team whose\n * permissions should be previewed. The value is `role:<id>` or `team:<id>`.\n *\n * Anything else parses to null, which leaves the caller's own permissions untouched. Lives in\n * api-core rather than in a transport package so the HTTP transports cannot drift on the format or\n * on header casing.\n */\nexport function extractAssumePermissions(headers: Headers): RawAssumePermissions.Target | null {\n const value = readHeader(headers, ASSUME_PERMISSIONS_HEADER);\n if (!value) {\n return null;\n }\n\n const separatorIndex = value.indexOf(\":\");\n if (separatorIndex < 1) {\n return null;\n }\n\n const type = value.slice(0, separatorIndex).trim();\n const id = value.slice(separatorIndex + 1).trim();\n\n if (id === \"\") {\n return null;\n }\n\n if (type === \"role\") {\n return { type: \"role\", id };\n }\n\n if (type === \"team\") {\n return { type: \"team\", id };\n }\n\n return null;\n}\n"],"names":["ASSUME_PERMISSIONS_HEADER","readHeader","headers","name","key","Object","value","Array","extractAssumePermissions","separatorIndex","type","id"],"mappings":"AAEO,MAAMA,4BAA4B;AAKzC,SAASC,WAAWC,OAAgB,EAAEC,IAAY;IAC9C,IAAI,CAACD,SACD,OAAO;IAQX,KAAK,MAAME,OAAOC,OAAO,IAAI,CAACH,SAAU;QACpC,IAAIE,IAAI,WAAW,OAAOD,MACtB;QAGJ,MAAMG,QAAQJ,OAAO,CAACE,IAAI;QAC1B,IAAIG,MAAM,OAAO,CAACD,QACd,OAAOA,KAAK,CAAC,EAAE,IAAI;QAGvB,OAAOA,SAAS;IACpB;IAEA,OAAO;AACX;AAUO,SAASE,yBAAyBN,OAAgB;IACrD,MAAMI,QAAQL,WAAWC,SAASF;IAClC,IAAI,CAACM,OACD,OAAO;IAGX,MAAMG,iBAAiBH,MAAM,OAAO,CAAC;IACrC,IAAIG,iBAAiB,GACjB,OAAO;IAGX,MAAMC,OAAOJ,MAAM,KAAK,CAAC,GAAGG,gBAAgB,IAAI;IAChD,MAAME,KAAKL,MAAM,KAAK,CAACG,iBAAiB,GAAG,IAAI;IAE/C,IAAIE,AAAO,OAAPA,IACA,OAAO;IAGX,IAAID,AAAS,WAATA,MACA,OAAO;QAAE,MAAM;QAAQC;IAAG;IAG9B,IAAID,AAAS,WAATA,MACA,OAAO;QAAE,MAAM;QAAQC;IAAG;IAG9B,OAAO;AACX"}
@@ -0,0 +1,12 @@
1
+ import type { Container } from "@webiny/di";
2
+ /**
3
+ * Registers the request-context pieces:
4
+ * - RawTenantId / RawAuthToken / RawAssumePermissions: per-request holders that the transport's
5
+ * EXTRACT step writes to.
6
+ * - RequestIdentityLoader / RequestTenantLoader: transport-agnostic LOAD steps that read
7
+ * the holders and set IdentityContext / TenantContext.
8
+ */
9
+ export declare const RequestContextFeature: {
10
+ name: string;
11
+ register(container: Container): void;
12
+ };
@@ -0,0 +1,19 @@
1
+ import { createFeature } from "@webiny/feature/api";
2
+ import { RawTenantId } from "./RawTenantId.js";
3
+ import { RawAuthToken } from "./RawAuthToken.js";
4
+ import { RawAssumePermissions } from "./RawAssumePermissions.js";
5
+ import { RequestIdentityLoader } from "./RequestIdentityLoader.js";
6
+ import { RequestTenantLoader } from "./RequestTenantLoader.js";
7
+ const RequestContextFeature = createFeature({
8
+ name: "RequestContext",
9
+ register (container) {
10
+ container.register(RawTenantId).inSingletonScope();
11
+ container.register(RawAuthToken).inSingletonScope();
12
+ container.register(RawAssumePermissions).inSingletonScope();
13
+ container.register(RequestIdentityLoader);
14
+ container.register(RequestTenantLoader);
15
+ }
16
+ });
17
+ export { RequestContextFeature };
18
+
19
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/requestContext/feature.js","sources":["../../../src/features/requestContext/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport type { Container } from \"@webiny/di\";\nimport { RawTenantId } from \"./RawTenantId.js\";\nimport { RawAuthToken } from \"./RawAuthToken.js\";\nimport { RawAssumePermissions } from \"./RawAssumePermissions.js\";\nimport { RequestIdentityLoader } from \"./RequestIdentityLoader.js\";\nimport { RequestTenantLoader } from \"./RequestTenantLoader.js\";\n\n/**\n * Registers the request-context pieces:\n * - RawTenantId / RawAuthToken / RawAssumePermissions: per-request holders that the transport's\n * EXTRACT step writes to.\n * - RequestIdentityLoader / RequestTenantLoader: transport-agnostic LOAD steps that read\n * the holders and set IdentityContext / TenantContext.\n */\nexport const RequestContextFeature = createFeature({\n name: \"RequestContext\",\n register(container: Container) {\n // Singleton so the value the transport's EXTRACT step sets is the same instance the LOAD\n // establisher reads. Registered per request (RequestContextFeature runs per-request), so it's\n // singleton *within the request container* — a fresh holder per request.\n container.register(RawTenantId).inSingletonScope();\n container.register(RawAuthToken).inSingletonScope();\n container.register(RawAssumePermissions).inSingletonScope();\n container.register(RequestIdentityLoader);\n container.register(RequestTenantLoader);\n }\n});\n"],"names":["RequestContextFeature","createFeature","container","RawTenantId","RawAuthToken","RawAssumePermissions","RequestIdentityLoader","RequestTenantLoader"],"mappings":";;;;;;AAeO,MAAMA,wBAAwBC,cAAc;IAC/C,MAAM;IACN,UAASC,SAAoB;QAIzBA,UAAU,QAAQ,CAACC,aAAa,gBAAgB;QAChDD,UAAU,QAAQ,CAACE,cAAc,gBAAgB;QACjDF,UAAU,QAAQ,CAACG,sBAAsB,gBAAgB;QACzDH,UAAU,QAAQ,CAACI;QACnBJ,UAAU,QAAQ,CAACK;IACvB;AACJ"}
@@ -0,0 +1,4 @@
1
+ export { RawTenantId, RawAuthToken, RawAssumePermissions, RequestIdentityLoader, RequestTenantLoader } from "./abstractions.js";
2
+ export { RequestContextFeature } from "./feature.js";
3
+ export { ASSUME_PERMISSIONS_HEADER } from "./extractAssumePermissions.js";
4
+ export { extractAssumePermissions } from "./extractAssumePermissions.js";
@@ -0,0 +1,3 @@
1
+ export { RawAssumePermissions, RawAuthToken, RawTenantId, RequestIdentityLoader, RequestTenantLoader } from "./abstractions.js";
2
+ export { RequestContextFeature } from "./feature.js";
3
+ export { ASSUME_PERMISSIONS_HEADER, extractAssumePermissions } from "./extractAssumePermissions.js";
@@ -2,16 +2,17 @@ import { IdentityContext as Abstraction } from "./abstractions.js";
2
2
  import { Identity } from "./Identity.js";
3
3
  import { AuthorizationContext } from "../authorization/AuthorizationContext/index.js";
4
4
  import type { SecurityPermission } from "../../../types/security.js";
5
- import { WcpContext } from "../../wcp/WcpContext/index.js";
5
+ import { FeatureFlags } from "../../featureFlags/abstractions.js";
6
6
  declare class IdentityContextImpl implements Abstraction.Interface {
7
7
  private authorizationContext;
8
- private wcpContext;
8
+ private featureFlags;
9
9
  private identity;
10
- constructor(authorizationContext: AuthorizationContext.Interface, wcpContext: WcpContext.Interface);
10
+ constructor(authorizationContext: AuthorizationContext.Interface, featureFlags: FeatureFlags.Interface);
11
11
  getIdentity(): Identity;
12
12
  setIdentity(identity: Identity | undefined): void;
13
13
  withIdentity<T>(identity: Identity | undefined, cb: () => Promise<T>): Promise<T>;
14
14
  withoutAuthorization<T>(cb: () => Promise<T>): Promise<T>;
15
+ withAuthorization<T>(cb: () => Promise<T>): Promise<T>;
15
16
  isAuthorizationEnabled(): boolean;
16
17
  getPermission<TPermission extends SecurityPermission = SecurityPermission>(name: string): Promise<TPermission | null>;
17
18
  getPermissions<TPermission extends SecurityPermission = SecurityPermission>(name: string): Promise<TPermission[]>;
@@ -5,12 +5,12 @@ import { IdentityContext } from "./abstractions.js";
5
5
  import { AnonymousIdentity } from "./AnonymousIdentity.js";
6
6
  import { AuthorizationContext } from "../authorization/AuthorizationContext/index.js";
7
7
  import { filterOutCustomWbyAppsPermissions } from "../utils/filterOutCustomWbyAppsPermissions.js";
8
- import { WcpContext } from "../../wcp/WcpContext/index.js";
8
+ import { FeatureFlags } from "../../featureFlags/abstractions.js";
9
9
  const identityStorage = new AsyncLocalStorage();
10
10
  class IdentityContextImpl {
11
- constructor(authorizationContext, wcpContext){
11
+ constructor(authorizationContext, featureFlags){
12
12
  this.authorizationContext = authorizationContext;
13
- this.wcpContext = wcpContext;
13
+ this.featureFlags = featureFlags;
14
14
  this.identity = new AnonymousIdentity();
15
15
  }
16
16
  getIdentity() {
@@ -28,6 +28,9 @@ class IdentityContextImpl {
28
28
  withoutAuthorization(cb) {
29
29
  return this.authorizationContext.withoutAuthorization(cb);
30
30
  }
31
+ withAuthorization(cb) {
32
+ return this.authorizationContext.withAuthorization(cb);
33
+ }
31
34
  isAuthorizationEnabled() {
32
35
  return this.authorizationContext.isAuthorizationEnabled();
33
36
  }
@@ -63,8 +66,8 @@ class IdentityContextImpl {
63
66
  return permissions.some((p)=>"*" === p.name);
64
67
  }
65
68
  applyAaclLogic(permissions) {
66
- const aaclEnabled = this.wcpContext.canUseAacl();
67
- const teamsEnabled = this.wcpContext.canUseTeams();
69
+ const aaclEnabled = this.featureFlags.get().isEnabled("advancedAccessControlLayer");
70
+ const teamsEnabled = this.featureFlags.get().isEnabled("advancedAccessControlLayer.teams");
68
71
  if (aaclEnabled) return [
69
72
  ...permissions,
70
73
  {
@@ -80,7 +83,7 @@ const IdentityContext_IdentityContext = createImplementation({
80
83
  implementation: IdentityContextImpl,
81
84
  dependencies: [
82
85
  AuthorizationContext,
83
- WcpContext
86
+ FeatureFlags
84
87
  ]
85
88
  });
86
89
  export { IdentityContext_IdentityContext as IdentityContext };
@@ -1 +1 @@
1
- {"version":3,"file":"features/security/IdentityContext/IdentityContext.js","sources":["../../../../src/features/security/IdentityContext/IdentityContext.ts"],"sourcesContent":["import { AsyncLocalStorage } from \"async_hooks\";\nimport { minimatch } from \"minimatch\";\nimport { createImplementation } from \"@webiny/di\";\nimport { IdentityContext as Abstraction } from \"./abstractions.js\";\nimport { Identity } from \"./Identity.js\";\nimport { AnonymousIdentity } from \"./AnonymousIdentity.js\";\nimport { AuthorizationContext } from \"../authorization/AuthorizationContext/index.js\";\nimport { filterOutCustomWbyAppsPermissions } from \"../utils/filterOutCustomWbyAppsPermissions.js\";\nimport type { SecurityPermission } from \"~/types/security.js\";\nimport type { AaclPermission } from \"../../wcp/WcpContext/types.js\";\nimport { WcpContext } from \"../../wcp/WcpContext/index.js\";\n\nconst identityStorage = new AsyncLocalStorage<Identity | undefined>();\n\nclass IdentityContextImpl implements Abstraction.Interface {\n private identity: Identity = new AnonymousIdentity();\n\n constructor(\n private authorizationContext: AuthorizationContext.Interface,\n private wcpContext: WcpContext.Interface\n ) {}\n\n // ========================================================================\n // Identity Methods\n // ========================================================================\n\n getIdentity(): Identity {\n // Check for identity override first (from withIdentity())\n const override = identityStorage.getStore();\n if (override !== undefined) {\n return override;\n }\n return this.identity;\n }\n\n setIdentity(identity: Identity | undefined): void {\n // If undefined, set to anonymous identity\n this.identity = identity ?? new AnonymousIdentity();\n\n // Clear permissions cache when identity changes\n this.authorizationContext.clearPermissionsCache();\n }\n\n withIdentity<T>(identity: Identity | undefined, cb: () => Promise<T>): Promise<T> {\n return identityStorage.run(identity, cb);\n }\n\n // ========================================================================\n // Authorization State Methods\n // ========================================================================\n\n withoutAuthorization<T>(cb: () => Promise<T>): Promise<T> {\n return this.authorizationContext.withoutAuthorization(cb);\n }\n\n isAuthorizationEnabled(): boolean {\n return this.authorizationContext.isAuthorizationEnabled();\n }\n\n // ========================================================================\n // Permission Methods\n // ========================================================================\n\n async getPermission<TPermission extends SecurityPermission = SecurityPermission>(\n name: string\n ): Promise<TPermission | null> {\n if (!this.isAuthorizationEnabled()) {\n return { name: \"*\" } as TPermission;\n }\n\n const permissions = await this.listPermissions();\n\n // Try exact match first\n const exactMatch = permissions.find(p => p.name === name);\n if (exactMatch) {\n return exactMatch as TPermission;\n }\n\n // Try pattern matching\n const patternMatch = permissions.find(p => minimatch(name, p.name));\n if (patternMatch) {\n return patternMatch as TPermission;\n }\n\n return null;\n }\n\n async getPermissions<TPermission extends SecurityPermission = SecurityPermission>(\n name: string\n ): Promise<TPermission[]> {\n if (!this.isAuthorizationEnabled()) {\n return [{ name: \"*\" }] as TPermission[];\n }\n\n const permissions = await this.listPermissions();\n\n return permissions.filter(p => {\n if (p.name === name) {\n return true;\n }\n return minimatch(name, p.name);\n }) as TPermission[];\n }\n\n async listPermissions(): Promise<SecurityPermission[]> {\n const permissions = await this.authorizationContext.loadPermissions(this.getIdentity());\n // TODO: extract this into a decorator\n return this.applyAaclLogic(permissions);\n }\n\n async hasFullAccess(): Promise<boolean> {\n const permissions = await this.listPermissions();\n return permissions.some(p => p.name === \"*\");\n }\n\n // ========================================================================\n // Private Helper Methods\n // ========================================================================\n\n private applyAaclLogic(permissions: SecurityPermission[]): SecurityPermission[] {\n const aaclEnabled = this.wcpContext.canUseAacl();\n const teamsEnabled = this.wcpContext.canUseTeams();\n\n if (aaclEnabled) {\n // Add AACL metadata permission\n return [\n ...permissions,\n {\n name: \"aacl\",\n teams: teamsEnabled\n } as AaclPermission\n ];\n }\n\n // If AACL is not enabled, filter out custom Webiny apps permissions\n return filterOutCustomWbyAppsPermissions(permissions);\n }\n}\n\nexport const IdentityContext = createImplementation({\n abstraction: Abstraction,\n implementation: IdentityContextImpl,\n dependencies: [AuthorizationContext, WcpContext]\n});\n"],"names":["identityStorage","AsyncLocalStorage","IdentityContextImpl","authorizationContext","wcpContext","AnonymousIdentity","override","undefined","identity","cb","name","permissions","exactMatch","p","patternMatch","minimatch","aaclEnabled","teamsEnabled","filterOutCustomWbyAppsPermissions","IdentityContext","createImplementation","Abstraction","AuthorizationContext","WcpContext"],"mappings":";;;;;;;;AAYA,MAAMA,kBAAkB,IAAIC;AAE5B,MAAMC;IAGF,YACYC,oBAAoD,EACpDC,UAAgC,CAC1C;aAFUD,oBAAoB,GAApBA;aACAC,UAAU,GAAVA;aAJJ,QAAQ,GAAa,IAAIC;IAK9B;IAMH,cAAwB;QAEpB,MAAMC,WAAWN,gBAAgB,QAAQ;QACzC,IAAIM,AAAaC,WAAbD,UACA,OAAOA;QAEX,OAAO,IAAI,CAAC,QAAQ;IACxB;IAEA,YAAYE,QAA8B,EAAQ;QAE9C,IAAI,CAAC,QAAQ,GAAGA,YAAY,IAAIH;QAGhC,IAAI,CAAC,oBAAoB,CAAC,qBAAqB;IACnD;IAEA,aAAgBG,QAA8B,EAAEC,EAAoB,EAAc;QAC9E,OAAOT,gBAAgB,GAAG,CAACQ,UAAUC;IACzC;IAMA,qBAAwBA,EAAoB,EAAc;QACtD,OAAO,IAAI,CAAC,oBAAoB,CAAC,oBAAoB,CAACA;IAC1D;IAEA,yBAAkC;QAC9B,OAAO,IAAI,CAAC,oBAAoB,CAAC,sBAAsB;IAC3D;IAMA,MAAM,cACFC,IAAY,EACe;QAC3B,IAAI,CAAC,IAAI,CAAC,sBAAsB,IAC5B,OAAO;YAAE,MAAM;QAAI;QAGvB,MAAMC,cAAc,MAAM,IAAI,CAAC,eAAe;QAG9C,MAAMC,aAAaD,YAAY,IAAI,CAACE,CAAAA,IAAKA,EAAE,IAAI,KAAKH;QACpD,IAAIE,YACA,OAAOA;QAIX,MAAME,eAAeH,YAAY,IAAI,CAACE,CAAAA,IAAKE,UAAUL,MAAMG,EAAE,IAAI;QACjE,IAAIC,cACA,OAAOA;QAGX,OAAO;IACX;IAEA,MAAM,eACFJ,IAAY,EACU;QACtB,IAAI,CAAC,IAAI,CAAC,sBAAsB,IAC5B,OAAO;YAAC;gBAAE,MAAM;YAAI;SAAE;QAG1B,MAAMC,cAAc,MAAM,IAAI,CAAC,eAAe;QAE9C,OAAOA,YAAY,MAAM,CAACE,CAAAA;YACtB,IAAIA,EAAE,IAAI,KAAKH,MACX,OAAO;YAEX,OAAOK,UAAUL,MAAMG,EAAE,IAAI;QACjC;IACJ;IAEA,MAAM,kBAAiD;QACnD,MAAMF,cAAc,MAAM,IAAI,CAAC,oBAAoB,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW;QAEpF,OAAO,IAAI,CAAC,cAAc,CAACA;IAC/B;IAEA,MAAM,gBAAkC;QACpC,MAAMA,cAAc,MAAM,IAAI,CAAC,eAAe;QAC9C,OAAOA,YAAY,IAAI,CAACE,CAAAA,IAAKA,AAAW,QAAXA,EAAE,IAAI;IACvC;IAMQ,eAAeF,WAAiC,EAAwB;QAC5E,MAAMK,cAAc,IAAI,CAAC,UAAU,CAAC,UAAU;QAC9C,MAAMC,eAAe,IAAI,CAAC,UAAU,CAAC,WAAW;QAEhD,IAAID,aAEA,OAAO;eACAL;YACH;gBACI,MAAM;gBACN,OAAOM;YACX;SACH;QAIL,OAAOC,kCAAkCP;IAC7C;AACJ;AAEO,MAAMQ,kCAAkBC,qBAAqB;IAChD,aAAaC;IACb,gBAAgBnB;IAChB,cAAc;QAACoB;QAAsBC;KAAW;AACpD"}
1
+ {"version":3,"file":"features/security/IdentityContext/IdentityContext.js","sources":["../../../../src/features/security/IdentityContext/IdentityContext.ts"],"sourcesContent":["import { AsyncLocalStorage } from \"async_hooks\";\nimport { minimatch } from \"minimatch\";\nimport { createImplementation } from \"@webiny/di\";\nimport { IdentityContext as Abstraction } from \"./abstractions.js\";\nimport { Identity } from \"./Identity.js\";\nimport { AnonymousIdentity } from \"./AnonymousIdentity.js\";\nimport { AuthorizationContext } from \"../authorization/AuthorizationContext/index.js\";\nimport { filterOutCustomWbyAppsPermissions } from \"../utils/filterOutCustomWbyAppsPermissions.js\";\nimport type { SecurityPermission } from \"~/types/security.js\";\nimport type { AaclPermission } from \"../../wcp/WcpContext/types.js\";\nimport { FeatureFlags } from \"../../featureFlags/abstractions.js\";\n\nconst identityStorage = new AsyncLocalStorage<Identity | undefined>();\n\nclass IdentityContextImpl implements Abstraction.Interface {\n private identity: Identity = new AnonymousIdentity();\n\n constructor(\n private authorizationContext: AuthorizationContext.Interface,\n private featureFlags: FeatureFlags.Interface\n ) {}\n\n // ========================================================================\n // Identity Methods\n // ========================================================================\n\n getIdentity(): Identity {\n // Check for identity override first (from withIdentity())\n const override = identityStorage.getStore();\n if (override !== undefined) {\n return override;\n }\n return this.identity;\n }\n\n setIdentity(identity: Identity | undefined): void {\n // If undefined, set to anonymous identity\n this.identity = identity ?? new AnonymousIdentity();\n\n // Clear permissions cache when identity changes\n this.authorizationContext.clearPermissionsCache();\n }\n\n withIdentity<T>(identity: Identity | undefined, cb: () => Promise<T>): Promise<T> {\n return identityStorage.run(identity, cb);\n }\n\n // ========================================================================\n // Authorization State Methods\n // ========================================================================\n\n withoutAuthorization<T>(cb: () => Promise<T>): Promise<T> {\n return this.authorizationContext.withoutAuthorization(cb);\n }\n\n withAuthorization<T>(cb: () => Promise<T>): Promise<T> {\n return this.authorizationContext.withAuthorization(cb);\n }\n\n isAuthorizationEnabled(): boolean {\n return this.authorizationContext.isAuthorizationEnabled();\n }\n\n // ========================================================================\n // Permission Methods\n // ========================================================================\n\n async getPermission<TPermission extends SecurityPermission = SecurityPermission>(\n name: string\n ): Promise<TPermission | null> {\n if (!this.isAuthorizationEnabled()) {\n return { name: \"*\" } as TPermission;\n }\n\n const permissions = await this.listPermissions();\n\n // Try exact match first\n const exactMatch = permissions.find(p => p.name === name);\n if (exactMatch) {\n return exactMatch as TPermission;\n }\n\n // Try pattern matching\n const patternMatch = permissions.find(p => minimatch(name, p.name));\n if (patternMatch) {\n return patternMatch as TPermission;\n }\n\n return null;\n }\n\n async getPermissions<TPermission extends SecurityPermission = SecurityPermission>(\n name: string\n ): Promise<TPermission[]> {\n if (!this.isAuthorizationEnabled()) {\n return [{ name: \"*\" }] as TPermission[];\n }\n\n const permissions = await this.listPermissions();\n\n return permissions.filter(p => {\n if (p.name === name) {\n return true;\n }\n return minimatch(name, p.name);\n }) as TPermission[];\n }\n\n async listPermissions(): Promise<SecurityPermission[]> {\n const permissions = await this.authorizationContext.loadPermissions(this.getIdentity());\n // TODO: extract this into a decorator\n return this.applyAaclLogic(permissions);\n }\n\n async hasFullAccess(): Promise<boolean> {\n const permissions = await this.listPermissions();\n return permissions.some(p => p.name === \"*\");\n }\n\n // ========================================================================\n // Private Helper Methods\n // ========================================================================\n\n private applyAaclLogic(permissions: SecurityPermission[]): SecurityPermission[] {\n const aaclEnabled = this.featureFlags.get().isEnabled(\"advancedAccessControlLayer\");\n const teamsEnabled = this.featureFlags.get().isEnabled(\"advancedAccessControlLayer.teams\");\n\n if (aaclEnabled) {\n // Add AACL metadata permission\n return [\n ...permissions,\n {\n name: \"aacl\",\n teams: teamsEnabled\n } as AaclPermission\n ];\n }\n\n // If AACL is not enabled, filter out custom Webiny apps permissions\n return filterOutCustomWbyAppsPermissions(permissions);\n }\n}\n\nexport const IdentityContext = createImplementation({\n abstraction: Abstraction,\n implementation: IdentityContextImpl,\n dependencies: [AuthorizationContext, FeatureFlags]\n});\n"],"names":["identityStorage","AsyncLocalStorage","IdentityContextImpl","authorizationContext","featureFlags","AnonymousIdentity","override","undefined","identity","cb","name","permissions","exactMatch","p","patternMatch","minimatch","aaclEnabled","teamsEnabled","filterOutCustomWbyAppsPermissions","IdentityContext","createImplementation","Abstraction","AuthorizationContext","FeatureFlags"],"mappings":";;;;;;;;AAYA,MAAMA,kBAAkB,IAAIC;AAE5B,MAAMC;IAGF,YACYC,oBAAoD,EACpDC,YAAoC,CAC9C;aAFUD,oBAAoB,GAApBA;aACAC,YAAY,GAAZA;aAJJ,QAAQ,GAAa,IAAIC;IAK9B;IAMH,cAAwB;QAEpB,MAAMC,WAAWN,gBAAgB,QAAQ;QACzC,IAAIM,AAAaC,WAAbD,UACA,OAAOA;QAEX,OAAO,IAAI,CAAC,QAAQ;IACxB;IAEA,YAAYE,QAA8B,EAAQ;QAE9C,IAAI,CAAC,QAAQ,GAAGA,YAAY,IAAIH;QAGhC,IAAI,CAAC,oBAAoB,CAAC,qBAAqB;IACnD;IAEA,aAAgBG,QAA8B,EAAEC,EAAoB,EAAc;QAC9E,OAAOT,gBAAgB,GAAG,CAACQ,UAAUC;IACzC;IAMA,qBAAwBA,EAAoB,EAAc;QACtD,OAAO,IAAI,CAAC,oBAAoB,CAAC,oBAAoB,CAACA;IAC1D;IAEA,kBAAqBA,EAAoB,EAAc;QACnD,OAAO,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAACA;IACvD;IAEA,yBAAkC;QAC9B,OAAO,IAAI,CAAC,oBAAoB,CAAC,sBAAsB;IAC3D;IAMA,MAAM,cACFC,IAAY,EACe;QAC3B,IAAI,CAAC,IAAI,CAAC,sBAAsB,IAC5B,OAAO;YAAE,MAAM;QAAI;QAGvB,MAAMC,cAAc,MAAM,IAAI,CAAC,eAAe;QAG9C,MAAMC,aAAaD,YAAY,IAAI,CAACE,CAAAA,IAAKA,EAAE,IAAI,KAAKH;QACpD,IAAIE,YACA,OAAOA;QAIX,MAAME,eAAeH,YAAY,IAAI,CAACE,CAAAA,IAAKE,UAAUL,MAAMG,EAAE,IAAI;QACjE,IAAIC,cACA,OAAOA;QAGX,OAAO;IACX;IAEA,MAAM,eACFJ,IAAY,EACU;QACtB,IAAI,CAAC,IAAI,CAAC,sBAAsB,IAC5B,OAAO;YAAC;gBAAE,MAAM;YAAI;SAAE;QAG1B,MAAMC,cAAc,MAAM,IAAI,CAAC,eAAe;QAE9C,OAAOA,YAAY,MAAM,CAACE,CAAAA;YACtB,IAAIA,EAAE,IAAI,KAAKH,MACX,OAAO;YAEX,OAAOK,UAAUL,MAAMG,EAAE,IAAI;QACjC;IACJ;IAEA,MAAM,kBAAiD;QACnD,MAAMF,cAAc,MAAM,IAAI,CAAC,oBAAoB,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW;QAEpF,OAAO,IAAI,CAAC,cAAc,CAACA;IAC/B;IAEA,MAAM,gBAAkC;QACpC,MAAMA,cAAc,MAAM,IAAI,CAAC,eAAe;QAC9C,OAAOA,YAAY,IAAI,CAACE,CAAAA,IAAKA,AAAW,QAAXA,EAAE,IAAI;IACvC;IAMQ,eAAeF,WAAiC,EAAwB;QAC5E,MAAMK,cAAc,IAAI,CAAC,YAAY,CAAC,GAAG,GAAG,SAAS,CAAC;QACtD,MAAMC,eAAe,IAAI,CAAC,YAAY,CAAC,GAAG,GAAG,SAAS,CAAC;QAEvD,IAAID,aAEA,OAAO;eACAL;YACH;gBACI,MAAM;gBACN,OAAOM;YACX;SACH;QAIL,OAAOC,kCAAkCP;IAC7C;AACJ;AAEO,MAAMQ,kCAAkBC,qBAAqB;IAChD,aAAaC;IACb,gBAAgBnB;IAChB,cAAc;QAACoB;QAAsBC;KAAa;AACtD"}
@@ -9,6 +9,11 @@ export interface IIdentityContext {
9
9
  listPermissions(): Promise<SecurityPermission[]>;
10
10
  hasFullAccess(): Promise<boolean>;
11
11
  withoutAuthorization<T>(cb: () => Promise<T>): Promise<T>;
12
+ /**
13
+ * Runs `cb` with authorization enabled, also inside `withoutAuthorization`. Combine with
14
+ * `withIdentity` to evaluate another user's real permissions from a background task.
15
+ */
16
+ withAuthorization<T>(cb: () => Promise<T>): Promise<T>;
12
17
  isAuthorizationEnabled(): boolean;
13
18
  }
14
19
  /** Provides access to the current identity and its permissions. */
@@ -1 +1 @@
1
- {"version":3,"file":"features/security/IdentityContext/abstractions.js","sources":["../../../../src/features/security/IdentityContext/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { Identity } from \"./Identity.js\";\nimport type { SecurityPermission } from \"~/types/security.js\";\n\nexport interface IIdentityContext {\n // Identity methods\n getIdentity(): Identity;\n setIdentity(identity: Identity | undefined): void;\n withIdentity<T>(identity: Identity | undefined, cb: () => Promise<T>): Promise<T>;\n\n // Permission methods\n getPermission<TPermission extends SecurityPermission = SecurityPermission>(\n name: string\n ): Promise<TPermission | null>;\n\n getPermissions<TPermission extends SecurityPermission = SecurityPermission>(\n name: string\n ): Promise<TPermission[]>;\n\n listPermissions(): Promise<SecurityPermission[]>;\n\n hasFullAccess(): Promise<boolean>;\n\n // Authorization context methods\n withoutAuthorization<T>(cb: () => Promise<T>): Promise<T>;\n isAuthorizationEnabled(): boolean;\n}\n\n/** Provides access to the current identity and its permissions. */\nexport const IdentityContext = createAbstraction<IIdentityContext>(\"IdentityContext\");\n\nexport namespace IdentityContext {\n export type Interface = IIdentityContext;\n}\n"],"names":["IdentityContext","createAbstraction"],"mappings":";AA6BO,MAAMA,kBAAkBC,kBAAoC"}
1
+ {"version":3,"file":"features/security/IdentityContext/abstractions.js","sources":["../../../../src/features/security/IdentityContext/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { Identity } from \"./Identity.js\";\nimport type { SecurityPermission } from \"~/types/security.js\";\n\nexport interface IIdentityContext {\n // Identity methods\n getIdentity(): Identity;\n setIdentity(identity: Identity | undefined): void;\n withIdentity<T>(identity: Identity | undefined, cb: () => Promise<T>): Promise<T>;\n\n // Permission methods\n getPermission<TPermission extends SecurityPermission = SecurityPermission>(\n name: string\n ): Promise<TPermission | null>;\n\n getPermissions<TPermission extends SecurityPermission = SecurityPermission>(\n name: string\n ): Promise<TPermission[]>;\n\n listPermissions(): Promise<SecurityPermission[]>;\n\n hasFullAccess(): Promise<boolean>;\n\n // Authorization context methods\n withoutAuthorization<T>(cb: () => Promise<T>): Promise<T>;\n /**\n * Runs `cb` with authorization enabled, also inside `withoutAuthorization`. Combine with\n * `withIdentity` to evaluate another user's real permissions from a background task.\n */\n withAuthorization<T>(cb: () => Promise<T>): Promise<T>;\n isAuthorizationEnabled(): boolean;\n}\n\n/** Provides access to the current identity and its permissions. */\nexport const IdentityContext = createAbstraction<IIdentityContext>(\"IdentityContext\");\n\nexport namespace IdentityContext {\n export type Interface = IIdentityContext;\n}\n"],"names":["IdentityContext","createAbstraction"],"mappings":";AAkCO,MAAMA,kBAAkBC,kBAAoC"}
@@ -0,0 +1,14 @@
1
+ import { Logger } from "../../../features/logger/index.js";
2
+ import type { IAuthenticator } from "../../../features/security/authentication/Authenticator/abstractions.js";
3
+ import type { IApiKeysRepository } from "./shared/abstractions.js";
4
+ import type { IdentityData } from "../../../features/security/IdentityContext/Identity.js";
5
+ declare class ApiKeyAuthenticatorImpl implements IAuthenticator {
6
+ private repository;
7
+ private logger;
8
+ constructor(repository: IApiKeysRepository, logger: Logger.Interface);
9
+ authenticate(token: string): Promise<IdentityData | null>;
10
+ }
11
+ export declare const ApiKeyAuthenticator: typeof ApiKeyAuthenticatorImpl & {
12
+ __abstraction: import("@webiny/di").Abstraction<IAuthenticator>;
13
+ };
14
+ export {};