alepha 0.20.2 → 0.20.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. package/README.md +0 -1
  2. package/assets/swagger-ui/swagger-ui-bundle.js +1 -1
  3. package/assets/swagger-ui/swagger-ui.css +1 -1
  4. package/dist/api/audits/index.browser.js +49 -0
  5. package/dist/api/audits/index.browser.js.map +1 -1
  6. package/dist/api/audits/index.d.ts.map +1 -1
  7. package/dist/api/audits/index.js +49 -0
  8. package/dist/api/audits/index.js.map +1 -1
  9. package/dist/api/files/index.d.ts.map +1 -1
  10. package/dist/api/files/index.js.map +1 -1
  11. package/dist/api/jobs/index.d.ts +16 -75
  12. package/dist/api/jobs/index.d.ts.map +1 -1
  13. package/dist/api/jobs/index.js.map +1 -1
  14. package/dist/api/keys/index.js.map +1 -1
  15. package/dist/api/notifications/index.d.ts +1 -10
  16. package/dist/api/notifications/index.d.ts.map +1 -1
  17. package/dist/api/organizations/index.d.ts.map +1 -1
  18. package/dist/api/parameters/index.browser.js +37 -0
  19. package/dist/api/parameters/index.browser.js.map +1 -1
  20. package/dist/api/parameters/index.d.ts +4 -65
  21. package/dist/api/parameters/index.d.ts.map +1 -1
  22. package/dist/api/parameters/index.js +37 -0
  23. package/dist/api/parameters/index.js.map +1 -1
  24. package/dist/api/payments/index.d.ts.map +1 -1
  25. package/dist/api/payments/index.js.map +1 -1
  26. package/dist/api/users/index.d.ts +207 -5184
  27. package/dist/api/users/index.d.ts.map +1 -1
  28. package/dist/api/users/index.js +2 -4
  29. package/dist/api/users/index.js.map +1 -1
  30. package/dist/api/verifications/index.d.ts.map +1 -1
  31. package/dist/api/verifications/index.js +2 -1
  32. package/dist/api/verifications/index.js.map +1 -1
  33. package/dist/bucket/index.js +5 -1
  34. package/dist/bucket/index.js.map +1 -1
  35. package/dist/bucket/index.workerd.js +5 -1
  36. package/dist/bucket/index.workerd.js.map +1 -1
  37. package/dist/cache/core/index.js.map +1 -1
  38. package/dist/cache/core/index.workerd.js.map +1 -1
  39. package/dist/captcha/index.js.map +1 -1
  40. package/dist/cli/core/index.d.ts +217 -11647
  41. package/dist/cli/core/index.d.ts.map +1 -1
  42. package/dist/cli/core/index.js +706 -42
  43. package/dist/cli/core/index.js.map +1 -1
  44. package/dist/cli/devtools/index.js +7 -1
  45. package/dist/cli/devtools/index.js.map +1 -1
  46. package/dist/cli/platform/index.d.ts +41 -64
  47. package/dist/cli/platform/index.d.ts.map +1 -1
  48. package/dist/cli/platform/index.js +47 -0
  49. package/dist/cli/platform/index.js.map +1 -1
  50. package/dist/cli/vendor/index.js +15 -0
  51. package/dist/cli/vendor/index.js.map +1 -1
  52. package/dist/command/index.js +1 -1
  53. package/dist/command/index.js.map +1 -1
  54. package/dist/core/index.browser.js.map +1 -1
  55. package/dist/core/index.d.ts +2 -8
  56. package/dist/core/index.d.ts.map +1 -1
  57. package/dist/core/index.js.map +1 -1
  58. package/dist/core/index.native.js.map +1 -1
  59. package/dist/core/index.workerd.js.map +1 -1
  60. package/dist/crypto/index.js.map +1 -1
  61. package/dist/datetime/index.js.map +1 -1
  62. package/dist/email/core/index.js.map +1 -1
  63. package/dist/email/smtp/index.js +2 -10522
  64. package/dist/email/smtp/index.js.map +1 -1
  65. package/dist/fake/index.d.ts +4 -8085
  66. package/dist/fake/index.d.ts.map +1 -1
  67. package/dist/fake/index.js +3 -33554
  68. package/dist/fake/index.js.map +1 -1
  69. package/dist/lock/core/index.js.map +1 -1
  70. package/dist/lock/redis/index.js.map +1 -1
  71. package/dist/logger/index.js +32 -1
  72. package/dist/logger/index.js.map +1 -1
  73. package/dist/mcp/index.js +5 -1
  74. package/dist/mcp/index.js.map +1 -1
  75. package/dist/orm/core/index.browser.js +1 -361
  76. package/dist/orm/core/index.browser.js.map +1 -1
  77. package/dist/orm/core/index.bun.js +14 -406
  78. package/dist/orm/core/index.bun.js.map +1 -1
  79. package/dist/orm/core/index.d.ts +96 -5117
  80. package/dist/orm/core/index.d.ts.map +1 -1
  81. package/dist/orm/core/index.js +23 -419
  82. package/dist/orm/core/index.js.map +1 -1
  83. package/dist/orm/postgres/index.bun.js +17 -20
  84. package/dist/orm/postgres/index.bun.js.map +1 -1
  85. package/dist/orm/postgres/index.d.ts +2 -613
  86. package/dist/orm/postgres/index.d.ts.map +1 -1
  87. package/dist/orm/postgres/index.js +17 -20
  88. package/dist/orm/postgres/index.js.map +1 -1
  89. package/dist/react/core/index.js.map +1 -1
  90. package/dist/react/i18n/index.js.map +1 -1
  91. package/dist/react/intro/index.js +22 -17
  92. package/dist/react/intro/index.js.map +1 -1
  93. package/dist/react/router/index.browser.js +78 -2
  94. package/dist/react/router/index.browser.js.map +1 -1
  95. package/dist/react/router/index.d.ts +22 -1
  96. package/dist/react/router/index.d.ts.map +1 -1
  97. package/dist/react/router/index.js +102 -4
  98. package/dist/react/router/index.js.map +1 -1
  99. package/dist/react/testing/index.d.ts +1 -411
  100. package/dist/react/testing/index.d.ts.map +1 -1
  101. package/dist/react/testing/index.js +13 -12293
  102. package/dist/react/testing/index.js.map +1 -1
  103. package/dist/react/ui/index.js +3 -0
  104. package/dist/react/ui/index.js.map +1 -1
  105. package/dist/react/websocket/index.js.map +1 -1
  106. package/dist/redis/index.js.map +1 -1
  107. package/dist/scheduler/index.d.ts +1 -83
  108. package/dist/scheduler/index.d.ts.map +1 -1
  109. package/dist/scheduler/index.js +2 -391
  110. package/dist/scheduler/index.js.map +1 -1
  111. package/dist/scheduler/index.workerd.js +2 -391
  112. package/dist/scheduler/index.workerd.js.map +1 -1
  113. package/dist/security/index.browser.js.map +1 -1
  114. package/dist/security/index.d.ts +2 -325
  115. package/dist/security/index.d.ts.map +1 -1
  116. package/dist/security/index.js +3 -1362
  117. package/dist/security/index.js.map +1 -1
  118. package/dist/server/auth/index.d.ts +1 -1054
  119. package/dist/server/auth/index.d.ts.map +1 -1
  120. package/dist/server/auth/index.js +16 -1224
  121. package/dist/server/auth/index.js.map +1 -1
  122. package/dist/server/cookies/index.js.map +1 -1
  123. package/dist/server/core/index.browser.js.map +1 -1
  124. package/dist/server/core/index.d.ts +1 -4
  125. package/dist/server/core/index.d.ts.map +1 -1
  126. package/dist/server/core/index.js +19 -4
  127. package/dist/server/core/index.js.map +1 -1
  128. package/dist/server/links/index.browser.js.map +1 -1
  129. package/dist/server/links/index.js.map +1 -1
  130. package/dist/server/metrics/index.d.ts +1 -514
  131. package/dist/server/metrics/index.d.ts.map +1 -1
  132. package/dist/server/metrics/index.js +4 -4356
  133. package/dist/server/metrics/index.js.map +1 -1
  134. package/dist/server/rate-limit/index.js.map +1 -1
  135. package/dist/server/static/index.js.map +1 -1
  136. package/dist/server/swagger/index.js +1 -1
  137. package/dist/server/swagger/index.js.map +1 -1
  138. package/dist/sms/index.js.map +1 -1
  139. package/dist/system/index.browser.js.map +1 -1
  140. package/dist/system/index.js.map +1 -1
  141. package/dist/system/index.workerd.js.map +1 -1
  142. package/dist/topic/core/index.js.map +1 -1
  143. package/dist/websocket/index.browser.js +21 -0
  144. package/dist/websocket/index.browser.js.map +1 -1
  145. package/dist/websocket/index.js +21 -0
  146. package/dist/websocket/index.js.map +1 -1
  147. package/package.json +18 -15
  148. package/src/api/files/__tests__/FileController.spec.ts +1 -1
  149. package/src/api/jobs/__tests__/$job.spec.ts +5 -1
  150. package/src/api/users/schemas/userQuerySchema.ts +0 -1
  151. package/src/api/users/services/UserService.ts +1 -5
  152. package/src/api/verifications/__tests__/CodeVerification.spec.ts +14 -0
  153. package/src/api/verifications/__tests__/LinkVerification.spec.ts +14 -0
  154. package/src/api/verifications/services/VerificationService.ts +1 -0
  155. package/src/cli/core/__tests__/init.spec.ts +208 -0
  156. package/src/cli/core/commands/init.ts +12 -0
  157. package/src/cli/core/services/PackageManagerUtils.ts +23 -6
  158. package/src/cli/core/services/ProjectScaffolder.ts +298 -20
  159. package/src/cli/core/tasks/BuildDockerTask.ts +9 -10
  160. package/src/cli/core/tasks/BuildServerTask.ts +8 -0
  161. package/src/cli/core/templates/apiIndexTs.ts +23 -1
  162. package/src/cli/core/templates/componentsJsonTs.ts +39 -0
  163. package/src/cli/core/templates/mainCss.ts +1 -0
  164. package/src/cli/core/templates/saasAdminLayoutTsx.ts +77 -0
  165. package/src/cli/core/templates/saasAdminPagesTsx.ts +26 -0
  166. package/src/cli/core/templates/saasAuthLayoutTsx.ts +20 -0
  167. package/src/cli/core/templates/saasAuthPagesTsx.ts +62 -0
  168. package/src/cli/core/templates/saasRealmProviderTs.ts +46 -0
  169. package/src/cli/core/templates/webAppRouterTs.ts +104 -1
  170. package/src/cli/core/templates/webIndexTs.ts +23 -1
  171. package/src/cli/platform/__tests__/SecretsCommand.spec.ts +2 -0
  172. package/src/command/providers/CliProvider.ts +1 -1
  173. package/src/core/interfaces/Service.ts +3 -1
  174. package/src/core/providers/TypeProvider.ts +1 -1
  175. package/src/logger/services/Logger.ts +1 -1
  176. package/src/mcp/__tests__/$resource.spec.ts +1 -1
  177. package/src/mcp/__tests__/$tool.spec.ts +1 -1
  178. package/src/mcp/__tests__/McpServerProvider.spec.ts +1 -1
  179. package/src/orm/__tests__/$repository-tests.ts +1 -0
  180. package/src/orm/__tests__/orm-next-tests.ts +2 -67
  181. package/src/orm/__tests__/orm-next.spec.ts +0 -21
  182. package/src/orm/core/index.shared.ts +0 -2
  183. package/src/orm/core/index.ts +1 -2
  184. package/src/orm/core/primitives/$repository.ts +3 -6
  185. package/src/orm/core/providers/drivers/DatabaseProvider.ts +0 -5
  186. package/src/orm/core/providers/drivers/NodeSqliteProvider.ts +11 -13
  187. package/src/orm/core/services/ModelBuilder.ts +1 -13
  188. package/src/orm/core/services/Repository.ts +1 -42
  189. package/src/orm/core/services/SqliteModelBuilder.ts +2 -33
  190. package/src/orm/postgres/services/PostgresModelBuilder.ts +10 -45
  191. package/src/react/intro/components/GettingStartedAuthSlide.tsx +11 -4
  192. package/src/react/router/__tests__/ReactBrowserProvider.browser.spec.ts +213 -2
  193. package/src/react/router/providers/ReactBrowserProvider.ts +73 -0
  194. package/src/react/router/providers/ReactBrowserRouterProvider.ts +1 -1
  195. package/src/react/router/providers/ReactPreloadProvider.ts +1 -1
  196. package/src/react/router/providers/ReactServerProvider.ts +1 -0
  197. package/src/scheduler/providers/CronProvider.ts +1 -1
  198. package/src/security/primitives/$basicAuth.ts +1 -1
  199. package/src/server/auth/providers/ServerAuthProvider.ts +5 -1
  200. package/src/server/core/interfaces/ServerRequest.ts +1 -0
  201. package/src/server/core/providers/ServerProvider.ts +1 -1
  202. package/src/server/core/providers/ServerRouterProvider.ts +2 -2
  203. package/src/server/core/services/HttpClient.ts +1 -1
  204. package/src/server/swagger/providers/ServerSwaggerProvider.ts +1 -1
  205. package/dist/react/testing/chunk-DBEY4PJZ.js +0 -16
  206. package/src/orm/core/__tests__/parseQueryString.spec.ts +0 -196
  207. package/src/orm/core/helpers/parseQueryString.ts +0 -502
  208. package/src/orm/core/primitives/$view.ts +0 -88
@@ -1 +1 @@
1
- {"version":3,"file":"index.browser.js","names":[],"sources":["../../src/security/schemas/userAccountInfoSchema.ts","../../src/security/atoms/currentUserAtom.ts","../../src/security/errors/InvalidCredentialsError.ts","../../src/security/errors/InvalidPermissionError.ts","../../src/security/errors/SecurityError.ts","../../src/security/primitives/$secure.browser.ts","../../src/security/schemas/permissionSchema.ts","../../src/security/schemas/roleSchema.ts","../../src/security/index.browser.ts"],"sourcesContent":["import type { Static } from \"alepha\";\nimport { t } from \"alepha\";\n\nexport const userAccountInfoSchema = t.object({\n id: t.text({\n description: \"Unique identifier for the user.\",\n }),\n\n name: t.optional(\n t.text({\n description: \"Full name of the user.\",\n }),\n ),\n\n email: t.optional(\n t.text({\n description: \"Email address of the user.\",\n format: \"email\",\n }),\n ),\n\n username: t.optional(\n t.text({\n description: \"Preferred username of the user.\",\n }),\n ),\n\n picture: t.optional(\n t.text({\n description: \"URL to the user's profile picture.\",\n }),\n ),\n\n sessionId: t.optional(\n t.text({\n description: \"Session identifier for the user, if applicable.\",\n }),\n ),\n\n // -------------------------------------------------------------------------------------------------------------------\n\n organization: t.optional(\n t.uuid({\n description: \"Organization the user belongs to.\",\n }),\n ),\n\n roles: t.optional(\n t.array(t.text(), {\n description: \"List of roles assigned to the user.\",\n }),\n ),\n\n realm: t.optional(\n t.text({\n description: \"The realm (issuer) the user was authenticated from.\",\n }),\n ),\n});\n\nexport type UserAccount = Static<typeof userAccountInfoSchema>;\n","import { $atom, t } from \"alepha\";\nimport { userAccountInfoSchema } from \"../schemas/userAccountInfoSchema.ts\";\n\n/**\n * Atom storing the current authenticated user.\n *\n * Transport-agnostic — works with HTTP, MCP, pipelines, jobs, and any context\n * that sets the atom before calling secured logic.\n */\nexport const currentUserAtom = $atom({\n name: \"alepha.security.user\",\n schema: t.optional(userAccountInfoSchema),\n});\n","import { UnauthorizedError } from \"alepha/server\";\n\n/**\n * Error thrown when the provided credentials are invalid.\n *\n * Message can not be changed to avoid leaking information.\n * Cause is omitted for the same reason.\n */\nexport class InvalidCredentialsError extends UnauthorizedError {\n readonly name = \"UnauthorizedError\";\n constructor() {\n super(\"Invalid credentials\");\n }\n}\n","export class InvalidPermissionError extends Error {\n constructor(name: string) {\n super(`Permission '${name}' is invalid`);\n }\n}\n","export class SecurityError extends Error {\n public name = \"SecurityError\";\n public readonly status = 403;\n}\n","import { createMiddleware, type Middleware } from \"alepha\";\nimport { currentUserAtom } from \"../atoms/currentUserAtom.ts\";\nimport type { UserAccountToken } from \"../interfaces/UserAccountToken.ts\";\nimport type { SecureOptions } from \"./$secure.ts\";\n\nexport type { SecureOptions };\n\n/**\n * Browser-side middleware that enforces authentication and authorization.\n *\n * Resolves the user from `currentUserAtom` only (no HTTP header resolution).\n * Checks roles from the user object and permissions from the user's roles.\n *\n * In the browser, an unauthenticated or unauthorized user is not an exception —\n * the middleware short-circuits by returning `undefined` and the handler is not called.\n * Components should use `action.can()` to conditionally render UI elements.\n *\n * ```typescript\n * class OrderController {\n * getOrders = $action({\n * use: [$secure()],\n * handler: async ({ query }) => { ... },\n * });\n *\n * deleteOrder = $action({\n * use: [$secure({ permissions: [\"orders:delete\"] })],\n * handler: async ({ params }) => { ... },\n * });\n * }\n * ```\n */\nexport function $secure(options?: SecureOptions): Middleware {\n return createMiddleware({\n name: \"$secure\",\n options: (options as unknown as Record<string, unknown>) ?? undefined,\n handler: ({ alepha, next }) => {\n return async (...args: any[]) => {\n const user: UserAccountToken | undefined =\n alepha.store.get(currentUserAtom);\n\n if (!user) {\n return undefined;\n }\n\n // Issuer check\n if (options?.issuers?.length) {\n if (!user.realm || !options.issuers.includes(user.realm)) {\n return undefined;\n }\n }\n\n // Role check\n if (options?.roles?.length) {\n const hasRole = options.roles.some((role) =>\n user.roles?.includes(role),\n );\n if (!hasRole) {\n return undefined;\n }\n }\n\n // Permission check (browser-side: check against user roles)\n // Server-side permissions are enforced by the API — the browser version\n // trusts that the API registry already filtered actions by permission.\n\n // Custom guard\n if (options?.guard) {\n if (!options.guard(user)) {\n return undefined;\n }\n }\n\n return next(...args);\n };\n },\n });\n}\n","import type { Static } from \"alepha\";\nimport { t } from \"alepha\";\n\nexport const permissionSchema = t.object({\n name: t.text({\n description: \"Name of the permission.\",\n }),\n\n group: t.optional(\n t.text({\n description: \"Group of the permission.\",\n }),\n ),\n\n description: t.optional(\n t.text({\n description: \"Describe the permission.\",\n }),\n ),\n\n // HTTP Only\n\n method: t.optional(\n t.text({\n description: \"HTTP method of the permission. When available.\",\n }),\n ),\n\n path: t.optional(\n t.text({\n description: \"Pathname of the permission. When available.\",\n }),\n ),\n});\n\nexport type Permission = Static<typeof permissionSchema>;\n","import type { Static } from \"alepha\";\nimport { t } from \"alepha\";\n\nexport const roleSchema = t.object({\n name: t.text({\n description: \"Name of the role.\",\n }),\n\n description: t.optional(\n t.text({\n description: \"Describe the role.\",\n }),\n ),\n\n default: t.optional(\n t.boolean({\n description:\n \"If true, this role will be assigned to all users by default.\",\n }),\n ),\n\n permissions: t.array(\n t.object({\n name: t.text({\n description: \"Name of the permission.\",\n }),\n ownership: t.optional(\n t.boolean({\n description:\n \"If true, user will only have access to it's own resources.\",\n }),\n ),\n exclude: t.optional(\n t.array(t.text(), {\n description:\n \"Exclude some permissions. Useful when 'name' is a wildcard.\",\n }),\n ),\n }),\n ),\n});\n\nexport type Role = Static<typeof roleSchema>;\n","import { $module } from \"alepha\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport * from \"./atoms/currentUserAtom.ts\";\nexport * from \"./errors/InvalidCredentialsError.ts\";\nexport * from \"./errors/InvalidPermissionError.ts\";\nexport * from \"./errors/SecurityError.ts\";\nexport * from \"./interfaces/UserAccountToken.ts\";\nexport * from \"./primitives/$secure.browser.ts\";\nexport * from \"./schemas/permissionSchema.ts\";\nexport * from \"./schemas/roleSchema.ts\";\nexport * from \"./schemas/userAccountInfoSchema.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport const AlephaSecurity = $module({\n name: \"alepha.security\",\n});\n"],"mappings":";;;AAGA,MAAa,wBAAwB,EAAE,OAAO;CAC5C,IAAI,EAAE,KAAK,EACT,aAAa,mCACd,CAAC;CAEF,MAAM,EAAE,SACN,EAAE,KAAK,EACL,aAAa,0BACd,CAAC,CACH;CAED,OAAO,EAAE,SACP,EAAE,KAAK;EACL,aAAa;EACb,QAAQ;EACT,CAAC,CACH;CAED,UAAU,EAAE,SACV,EAAE,KAAK,EACL,aAAa,mCACd,CAAC,CACH;CAED,SAAS,EAAE,SACT,EAAE,KAAK,EACL,aAAa,sCACd,CAAC,CACH;CAED,WAAW,EAAE,SACX,EAAE,KAAK,EACL,aAAa,mDACd,CAAC,CACH;CAID,cAAc,EAAE,SACd,EAAE,KAAK,EACL,aAAa,qCACd,CAAC,CACH;CAED,OAAO,EAAE,SACP,EAAE,MAAM,EAAE,MAAM,EAAE,EAChB,aAAa,uCACd,CAAC,CACH;CAED,OAAO,EAAE,SACP,EAAE,KAAK,EACL,aAAa,uDACd,CAAC,CACH;CACF,CAAC;;;;;;;;;ACjDF,MAAa,kBAAkB,MA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ACjC,MAAM,EAAE,KAAK,EACX,aAAa,qBACd,CAAC;CAEF,aAAa,EAAE,SACb,EAAE,KAAK,EACL,aAAa,sBACd,CAAC,CACH;CAED,SAAS,EAAE,SACT,EAAE,QAAQ,EACR,aACE,gEACH,CAAC,CACH;CAED,aAAa,EAAE,MACb,EAAE,OAAO;EACP,MAAM,EAAE,KAAK,EACX,aAAa,2BACd,CAAC;EACF,WAAW,EAAE,SACX,EAAE,QAAQ,EACR,aACE,8DACH,CAAC,CACH;EACD,SAAS,EAAE,SACT,EAAE,MAAM,EAAE,MAAM,EAAE,EAChB,aACE,+DACH,CAAC,CACH;EACF,CAAC,CACH;CACF,CAAC;;;ACxBF,MAAa,iBAAiB,QAAQ,EACpC,MAAM,mBACP,CAAC"}
1
+ {"version":3,"file":"index.browser.js","names":[],"sources":["../../src/security/schemas/userAccountInfoSchema.ts","../../src/security/atoms/currentUserAtom.ts","../../src/security/errors/InvalidCredentialsError.ts","../../src/security/errors/InvalidPermissionError.ts","../../src/security/errors/SecurityError.ts","../../src/security/primitives/$secure.browser.ts","../../src/security/schemas/permissionSchema.ts","../../src/security/schemas/roleSchema.ts","../../src/security/index.browser.ts"],"sourcesContent":["import type { Static } from \"alepha\";\nimport { t } from \"alepha\";\n\nexport const userAccountInfoSchema = t.object({\n id: t.text({\n description: \"Unique identifier for the user.\",\n }),\n\n name: t.optional(\n t.text({\n description: \"Full name of the user.\",\n }),\n ),\n\n email: t.optional(\n t.text({\n description: \"Email address of the user.\",\n format: \"email\",\n }),\n ),\n\n username: t.optional(\n t.text({\n description: \"Preferred username of the user.\",\n }),\n ),\n\n picture: t.optional(\n t.text({\n description: \"URL to the user's profile picture.\",\n }),\n ),\n\n sessionId: t.optional(\n t.text({\n description: \"Session identifier for the user, if applicable.\",\n }),\n ),\n\n // -------------------------------------------------------------------------------------------------------------------\n\n organization: t.optional(\n t.uuid({\n description: \"Organization the user belongs to.\",\n }),\n ),\n\n roles: t.optional(\n t.array(t.text(), {\n description: \"List of roles assigned to the user.\",\n }),\n ),\n\n realm: t.optional(\n t.text({\n description: \"The realm (issuer) the user was authenticated from.\",\n }),\n ),\n});\n\nexport type UserAccount = Static<typeof userAccountInfoSchema>;\n","import { $atom, t } from \"alepha\";\nimport { userAccountInfoSchema } from \"../schemas/userAccountInfoSchema.ts\";\n\n/**\n * Atom storing the current authenticated user.\n *\n * Transport-agnostic — works with HTTP, MCP, pipelines, jobs, and any context\n * that sets the atom before calling secured logic.\n */\nexport const currentUserAtom = $atom({\n name: \"alepha.security.user\",\n schema: t.optional(userAccountInfoSchema),\n});\n","import { UnauthorizedError } from \"alepha/server\";\n\n/**\n * Error thrown when the provided credentials are invalid.\n *\n * Message can not be changed to avoid leaking information.\n * Cause is omitted for the same reason.\n */\nexport class InvalidCredentialsError extends UnauthorizedError {\n readonly name = \"UnauthorizedError\";\n constructor() {\n super(\"Invalid credentials\");\n }\n}\n","export class InvalidPermissionError extends Error {\n constructor(name: string) {\n super(`Permission '${name}' is invalid`);\n }\n}\n","export class SecurityError extends Error {\n public name = \"SecurityError\";\n public readonly status = 403;\n}\n","import { createMiddleware, type Middleware } from \"alepha\";\nimport { currentUserAtom } from \"../atoms/currentUserAtom.ts\";\nimport type { UserAccountToken } from \"../interfaces/UserAccountToken.ts\";\nimport type { SecureOptions } from \"./$secure.ts\";\n\nexport type { SecureOptions };\n\n/**\n * Browser-side middleware that enforces authentication and authorization.\n *\n * Resolves the user from `currentUserAtom` only (no HTTP header resolution).\n * Checks roles from the user object and permissions from the user's roles.\n *\n * In the browser, an unauthenticated or unauthorized user is not an exception —\n * the middleware short-circuits by returning `undefined` and the handler is not called.\n * Components should use `action.can()` to conditionally render UI elements.\n *\n * ```typescript\n * class OrderController {\n * getOrders = $action({\n * use: [$secure()],\n * handler: async ({ query }) => { ... },\n * });\n *\n * deleteOrder = $action({\n * use: [$secure({ permissions: [\"orders:delete\"] })],\n * handler: async ({ params }) => { ... },\n * });\n * }\n * ```\n */\nexport function $secure(options?: SecureOptions): Middleware {\n return createMiddleware({\n name: \"$secure\",\n options: (options as unknown as Record<string, unknown>) ?? undefined,\n handler: ({ alepha, next }) => {\n return async (...args: any[]) => {\n const user: UserAccountToken | undefined =\n alepha.store.get(currentUserAtom);\n\n if (!user) {\n return undefined;\n }\n\n // Issuer check\n if (options?.issuers?.length) {\n if (!user.realm || !options.issuers.includes(user.realm)) {\n return undefined;\n }\n }\n\n // Role check\n if (options?.roles?.length) {\n const hasRole = options.roles.some((role) =>\n user.roles?.includes(role),\n );\n if (!hasRole) {\n return undefined;\n }\n }\n\n // Permission check (browser-side: check against user roles)\n // Server-side permissions are enforced by the API — the browser version\n // trusts that the API registry already filtered actions by permission.\n\n // Custom guard\n if (options?.guard) {\n if (!options.guard(user)) {\n return undefined;\n }\n }\n\n return next(...args);\n };\n },\n });\n}\n","import type { Static } from \"alepha\";\nimport { t } from \"alepha\";\n\nexport const permissionSchema = t.object({\n name: t.text({\n description: \"Name of the permission.\",\n }),\n\n group: t.optional(\n t.text({\n description: \"Group of the permission.\",\n }),\n ),\n\n description: t.optional(\n t.text({\n description: \"Describe the permission.\",\n }),\n ),\n\n // HTTP Only\n\n method: t.optional(\n t.text({\n description: \"HTTP method of the permission. When available.\",\n }),\n ),\n\n path: t.optional(\n t.text({\n description: \"Pathname of the permission. When available.\",\n }),\n ),\n});\n\nexport type Permission = Static<typeof permissionSchema>;\n","import type { Static } from \"alepha\";\nimport { t } from \"alepha\";\n\nexport const roleSchema = t.object({\n name: t.text({\n description: \"Name of the role.\",\n }),\n\n description: t.optional(\n t.text({\n description: \"Describe the role.\",\n }),\n ),\n\n default: t.optional(\n t.boolean({\n description:\n \"If true, this role will be assigned to all users by default.\",\n }),\n ),\n\n permissions: t.array(\n t.object({\n name: t.text({\n description: \"Name of the permission.\",\n }),\n ownership: t.optional(\n t.boolean({\n description:\n \"If true, user will only have access to it's own resources.\",\n }),\n ),\n exclude: t.optional(\n t.array(t.text(), {\n description:\n \"Exclude some permissions. Useful when 'name' is a wildcard.\",\n }),\n ),\n }),\n ),\n});\n\nexport type Role = Static<typeof roleSchema>;\n","import { $module } from \"alepha\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport * from \"./atoms/currentUserAtom.ts\";\nexport * from \"./errors/InvalidCredentialsError.ts\";\nexport * from \"./errors/InvalidPermissionError.ts\";\nexport * from \"./errors/SecurityError.ts\";\nexport * from \"./interfaces/UserAccountToken.ts\";\nexport * from \"./primitives/$secure.browser.ts\";\nexport * from \"./schemas/permissionSchema.ts\";\nexport * from \"./schemas/roleSchema.ts\";\nexport * from \"./schemas/userAccountInfoSchema.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport const AlephaSecurity = $module({\n name: \"alepha.security\",\n});\n"],"mappings":";;;AAGA,MAAa,wBAAwB,EAAE,OAAO;CAC5C,IAAI,EAAE,KAAK,EACT,aAAa,mCACd,CAAC;CAEF,MAAM,EAAE,SACN,EAAE,KAAK,EACL,aAAa,0BACd,CAAC,CACH;CAED,OAAO,EAAE,SACP,EAAE,KAAK;EACL,aAAa;EACb,QAAQ;EACT,CAAC,CACH;CAED,UAAU,EAAE,SACV,EAAE,KAAK,EACL,aAAa,mCACd,CAAC,CACH;CAED,SAAS,EAAE,SACT,EAAE,KAAK,EACL,aAAa,sCACd,CAAC,CACH;CAED,WAAW,EAAE,SACX,EAAE,KAAK,EACL,aAAa,mDACd,CAAC,CACH;CAID,cAAc,EAAE,SACd,EAAE,KAAK,EACL,aAAa,qCACd,CAAC,CACH;CAED,OAAO,EAAE,SACP,EAAE,MAAM,EAAE,MAAM,EAAE,EAChB,aAAa,uCACd,CAAC,CACH;CAED,OAAO,EAAE,SACP,EAAE,KAAK,EACL,aAAa,uDACd,CAAC,CACH;CACF,CAAC;;;;;;;;;ACjDF,MAAa,kBAAkB,MAAM;CACnC,MAAM;CACN,QAAQ,EAAE,SAAS,sBAAsB;CAC1C,CAAC;;;;;;;;;ACJF,IAAa,0BAAb,cAA6C,kBAAkB;CAC7D,OAA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,EAAE,SACT,EAAE,QAAQ,EACR,aACE,gEACH,CAAC,CACH;CAED,aAAa,EAAE,MACb,EAAE,OAAO;EACP,MAAM,EAAE,KAAK,EACX,aAAa,2BACd,CAAC;EACF,WAAW,EAAE,SACX,EAAE,QAAQ,EACR,aACE,8DACH,CAAC,CACH;EACD,SAAS,EAAE,SACT,EAAE,MAAM,EAAE,MAAM,EAAE,EAChB,aACE,+DACH,CAAC,CACH;EACF,CAAC,CACH;CACF,CAAC;;;ACxBF,MAAa,iBAAiB,QAAQ,EACpC,MAAM,mBACP,CAAC"}
@@ -2,8 +2,10 @@ import * as _$alepha from "alepha";
2
2
  import { Alepha, KIND, Middleware, Primitive, Static } from "alepha";
3
3
  import { DateTimeProvider, Duration, DurationLike } from "alepha/datetime";
4
4
  import * as _$alepha_logger0 from "alepha/logger";
5
+ import { CryptoKey, FlattenedJWSInput, JSONWebKeySet, JWSHeaderParameters, JWTHeaderParameters, JWTPayload, JWTVerifyResult, KeyObject } from "jose";
5
6
  import { SecretProvider } from "alepha/crypto";
6
7
  import { FetchOptions, ServerRequest, UnauthorizedError } from "alepha/server";
8
+ import { JWTVerifyOptions } from "jose/jwt/verify";
7
9
  export * from "alepha/crypto";
8
10
 
9
11
  //#region ../../src/security/schemas/userAccountInfoSchema.d.ts
@@ -129,331 +131,6 @@ interface BasicAuthOptions {
129
131
  */
130
132
  declare function $basicAuth(options: BasicAuthOptions): Middleware;
131
133
  //#endregion
132
- //#region ../../../../node_modules/jose/dist/types/types.d.ts
133
- /** Generic JSON Web Key Parameters. */
134
- interface JWKParameters {
135
- /** JWK "kty" (Key Type) Parameter */
136
- kty?: string;
137
- /**
138
- * JWK "alg" (Algorithm) Parameter
139
- *
140
- * @see {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}
141
- */
142
- alg?: string;
143
- /** JWK "key_ops" (Key Operations) Parameter */
144
- key_ops?: string[];
145
- /** JWK "ext" (Extractable) Parameter */
146
- ext?: boolean;
147
- /** JWK "use" (Public Key Use) Parameter */
148
- use?: string;
149
- /** JWK "x5c" (X.509 Certificate Chain) Parameter */
150
- x5c?: string[];
151
- /** JWK "x5t" (X.509 Certificate SHA-1 Thumbprint) Parameter */
152
- x5t?: string;
153
- /** JWK "x5t#S256" (X.509 Certificate SHA-256 Thumbprint) Parameter */
154
- 'x5t#S256'?: string;
155
- /** JWK "x5u" (X.509 URL) Parameter */
156
- x5u?: string;
157
- /** JWK "kid" (Key ID) Parameter */
158
- kid?: string;
159
- }
160
- /**
161
- * JSON Web Key ({@link https://www.rfc-editor.org/rfc/rfc7517 JWK}). "RSA", "EC", "OKP", "AKP", and
162
- * "oct" key types are supported.
163
- *
164
- * @see {@link JWK_AKP_Public}
165
- * @see {@link JWK_AKP_Private}
166
- * @see {@link JWK_OKP_Public}
167
- * @see {@link JWK_OKP_Private}
168
- * @see {@link JWK_EC_Public}
169
- * @see {@link JWK_EC_Private}
170
- * @see {@link JWK_RSA_Public}
171
- * @see {@link JWK_RSA_Private}
172
- * @see {@link JWK_oct}
173
- */
174
- interface JWK extends JWKParameters {
175
- /**
176
- * - EC JWK "crv" (Curve) Parameter
177
- * - OKP JWK "crv" (The Subtype of Key Pair) Parameter
178
- */
179
- crv?: string;
180
- /**
181
- * - Private RSA JWK "d" (Private Exponent) Parameter
182
- * - Private EC JWK "d" (ECC Private Key) Parameter
183
- * - Private OKP JWK "d" (The Private Key) Parameter
184
- */
185
- d?: string;
186
- /** Private RSA JWK "dp" (First Factor CRT Exponent) Parameter */
187
- dp?: string;
188
- /** Private RSA JWK "dq" (Second Factor CRT Exponent) Parameter */
189
- dq?: string;
190
- /** RSA JWK "e" (Exponent) Parameter */
191
- e?: string;
192
- /** Oct JWK "k" (Key Value) Parameter */
193
- k?: string;
194
- /** RSA JWK "n" (Modulus) Parameter */
195
- n?: string;
196
- /** Private RSA JWK "p" (First Prime Factor) Parameter */
197
- p?: string;
198
- /** Private RSA JWK "q" (Second Prime Factor) Parameter */
199
- q?: string;
200
- /** Private RSA JWK "qi" (First CRT Coefficient) Parameter */
201
- qi?: string;
202
- /**
203
- * - EC JWK "x" (X Coordinate) Parameter
204
- * - OKP JWK "x" (The public key) Parameter
205
- */
206
- x?: string;
207
- /** EC JWK "y" (Y Coordinate) Parameter */
208
- y?: string;
209
- /** AKP JWK "pub" (Public Key) Parameter */
210
- pub?: string;
211
- /** AKP JWK "priv" (Private key) Parameter */
212
- priv?: string;
213
- }
214
- /**
215
- * Flattened JWS definition for verify function inputs, allows payload as {@link !Uint8Array} for
216
- * detached signature validation.
217
- */
218
- interface FlattenedJWSInput {
219
- /**
220
- * The "header" member MUST be present and contain the value JWS Unprotected Header when the JWS
221
- * Unprotected Header value is non- empty; otherwise, it MUST be absent. This value is represented
222
- * as an unencoded JSON object, rather than as a string. These Header Parameter values are not
223
- * integrity protected.
224
- */
225
- header?: JWSHeaderParameters;
226
- /**
227
- * The "payload" member MUST be present and contain the value BASE64URL(JWS Payload). When RFC7797
228
- * "b64": false is used the value passed may also be a {@link !Uint8Array}.
229
- */
230
- payload: string | Uint8Array;
231
- /**
232
- * The "protected" member MUST be present and contain the value BASE64URL(UTF8(JWS Protected
233
- * Header)) when the JWS Protected Header value is non-empty; otherwise, it MUST be absent. These
234
- * Header Parameter values are integrity protected.
235
- */
236
- protected?: string;
237
- /** The "signature" member MUST be present and contain the value BASE64URL(JWS Signature). */
238
- signature: string;
239
- }
240
- /** Header Parameters common to JWE and JWS */
241
- interface JoseHeaderParameters {
242
- /** "kid" (Key ID) Header Parameter */
243
- kid?: string;
244
- /** "x5t" (X.509 Certificate SHA-1 Thumbprint) Header Parameter */
245
- x5t?: string;
246
- /** "x5c" (X.509 Certificate Chain) Header Parameter */
247
- x5c?: string[];
248
- /** "x5u" (X.509 URL) Header Parameter */
249
- x5u?: string;
250
- /** "jku" (JWK Set URL) Header Parameter */
251
- jku?: string;
252
- /** "jwk" (JSON Web Key) Header Parameter */
253
- jwk?: Pick<JWK, 'kty' | 'crv' | 'x' | 'y' | 'e' | 'n' | 'alg' | 'pub'>;
254
- /** "typ" (Type) Header Parameter */
255
- typ?: string;
256
- /** "cty" (Content Type) Header Parameter */
257
- cty?: string;
258
- }
259
- /** Recognized JWS Header Parameters, any other Header Members may also be present. */
260
- interface JWSHeaderParameters extends JoseHeaderParameters {
261
- /**
262
- * JWS "alg" (Algorithm) Header Parameter
263
- *
264
- * @see {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}
265
- */
266
- alg?: string;
267
- /**
268
- * This JWS Extension Header Parameter modifies the JWS Payload representation and the JWS Signing
269
- * Input computation as per {@link https://www.rfc-editor.org/rfc/rfc7797 RFC7797}.
270
- */
271
- b64?: boolean;
272
- /** JWS "crit" (Critical) Header Parameter */
273
- crit?: string[];
274
- /** Any other JWS Header member. */
275
- [propName: string]: unknown;
276
- }
277
- /** Shared Interface with a "crit" property for all sign, verify, encrypt and decrypt operations. */
278
- interface CritOption {
279
- /**
280
- * An object with keys representing recognized "crit" (Critical) Header Parameter names. The value
281
- * for those is either `true` or `false`. `true` when the Header Parameter MUST be integrity
282
- * protected, `false` when it's irrelevant.
283
- *
284
- * This makes the "Extension Header Parameter "..." is not recognized" error go away.
285
- *
286
- * Use this when a given JWS/JWT/JWE profile requires the use of proprietary non-registered "crit"
287
- * (Critical) Header Parameters. This will only make sure the Header Parameter is syntactically
288
- * correct when provided and that it is optionally integrity protected. It will not process the
289
- * Header Parameter in any way or reject the operation if it is missing. You MUST still verify the
290
- * Header Parameter was present and process it according to the profile's validation steps after
291
- * the operation succeeds.
292
- *
293
- * The JWS extension Header Parameter `b64` is always recognized and processed properly. No other
294
- * registered Header Parameters that need this kind of default built-in treatment are currently
295
- * available.
296
- */
297
- crit?: {
298
- [propName: string]: boolean;
299
- };
300
- }
301
- /** JWT Claims Set verification options. */
302
- interface JWTClaimVerificationOptions {
303
- /**
304
- * Expected JWT "aud" (Audience) Claim value(s).
305
- *
306
- * This option makes the JWT "aud" (Audience) Claim presence required.
307
- */
308
- audience?: string | string[];
309
- /**
310
- * Clock skew tolerance
311
- *
312
- * - In seconds when number (e.g. 5)
313
- * - Resolved into a number of seconds when a string (e.g. "5 seconds", "10 minutes", "2 hours").
314
- *
315
- * Used when validating the JWT "nbf" (Not Before) and "exp" (Expiration Time) claims, and when
316
- * validating the "iat" (Issued At) claim if the {@link maxTokenAge `maxTokenAge` option} is set.
317
- */
318
- clockTolerance?: string | number;
319
- /**
320
- * Expected JWT "iss" (Issuer) Claim value(s).
321
- *
322
- * This option makes the JWT "iss" (Issuer) Claim presence required.
323
- */
324
- issuer?: string | string[];
325
- /**
326
- * Maximum time elapsed (in seconds) from the JWT "iat" (Issued At) Claim value.
327
- *
328
- * - In seconds when number (e.g. 5)
329
- * - Resolved into a number of seconds when a string (e.g. "5 seconds", "10 minutes", "2 hours").
330
- *
331
- * This option makes the JWT "iat" (Issued At) Claim presence required.
332
- */
333
- maxTokenAge?: string | number;
334
- /**
335
- * Expected JWT "sub" (Subject) Claim value.
336
- *
337
- * This option makes the JWT "sub" (Subject) Claim presence required.
338
- */
339
- subject?: string;
340
- /**
341
- * Expected JWT "typ" (Type) Header Parameter value.
342
- *
343
- * This option makes the JWT "typ" (Type) Header Parameter presence required.
344
- */
345
- typ?: string;
346
- /** Date to use when comparing NumericDate claims, defaults to `new Date()`. */
347
- currentDate?: Date;
348
- /**
349
- * Array of required Claim Names that must be present in the JWT Claims Set. Default is that: if
350
- * the {@link issuer `issuer` option} is set, then JWT "iss" (Issuer) Claim must be present; if the
351
- * {@link audience `audience` option} is set, then JWT "aud" (Audience) Claim must be present; if
352
- * the {@link subject `subject` option} is set, then JWT "sub" (Subject) Claim must be present; if
353
- * the {@link maxTokenAge `maxTokenAge` option} is set, then JWT "iat" (Issued At) Claim must be
354
- * present.
355
- */
356
- requiredClaims?: string[];
357
- }
358
- /** JWS Verification options. */
359
- interface VerifyOptions extends CritOption {
360
- /**
361
- * A list of accepted JWS "alg" (Algorithm) Header Parameter values. By default all "alg"
362
- * (Algorithm) values applicable for the used key/secret are allowed.
363
- *
364
- * > [!NOTE]\
365
- * > Unsecured JWTs (`{ "alg": "none" }`) are never accepted by this API.
366
- */
367
- algorithms?: string[];
368
- }
369
- /** Recognized JWT Claims Set members, any other members may also be present. */
370
- interface JWTPayload {
371
- /**
372
- * JWT Issuer
373
- *
374
- * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.1 RFC7519#section-4.1.1}
375
- */
376
- iss?: string;
377
- /**
378
- * JWT Subject
379
- *
380
- * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.2 RFC7519#section-4.1.2}
381
- */
382
- sub?: string;
383
- /**
384
- * JWT Audience
385
- *
386
- * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.3 RFC7519#section-4.1.3}
387
- */
388
- aud?: string | string[];
389
- /**
390
- * JWT ID
391
- *
392
- * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.7 RFC7519#section-4.1.7}
393
- */
394
- jti?: string;
395
- /**
396
- * JWT Not Before
397
- *
398
- * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.5 RFC7519#section-4.1.5}
399
- */
400
- nbf?: number;
401
- /**
402
- * JWT Expiration Time
403
- *
404
- * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.4 RFC7519#section-4.1.4}
405
- */
406
- exp?: number;
407
- /**
408
- * JWT Issued At
409
- *
410
- * @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.6 RFC7519#section-4.1.6}
411
- */
412
- iat?: number;
413
- /** Any other JWT Claim Set member. */
414
- [propName: string]: unknown;
415
- }
416
- /** Signed JSON Web Token (JWT) verification result */
417
- interface JWTVerifyResult<PayloadType = JWTPayload> {
418
- /** JWT Claims Set. */
419
- payload: PayloadType & JWTPayload;
420
- /** JWS Protected Header. */
421
- protectedHeader: JWTHeaderParameters;
422
- }
423
- /** Recognized Compact JWS Header Parameters, any other Header Members may also be present. */
424
- interface CompactJWSHeaderParameters extends JWSHeaderParameters {
425
- alg: string;
426
- }
427
- /** Recognized Signed JWT Header Parameters, any other Header Members may also be present. */
428
- interface JWTHeaderParameters extends CompactJWSHeaderParameters {
429
- b64?: true;
430
- }
431
- /** JSON Web Key Set */
432
- interface JSONWebKeySet {
433
- keys: JWK[];
434
- }
435
- /**
436
- * {@link !KeyObject} is a representation of a key/secret available in the Node.js runtime. You may
437
- * use the Node.js runtime APIs {@link !createPublicKey}, {@link !createPrivateKey}, and
438
- * {@link !createSecretKey} to obtain a {@link !KeyObject} from your existing key material.
439
- */
440
- interface KeyObject {
441
- type: string;
442
- }
443
- /**
444
- * {@link !CryptoKey} is a representation of a key/secret available in all supported runtimes. In
445
- * addition to the {@link key/import Key Import Functions} you may use the
446
- * {@link !SubtleCrypto.importKey} API to obtain a {@link !CryptoKey} from your existing key
447
- * material.
448
- */
449
- type CryptoKey = Extract<Awaited<ReturnType<typeof crypto.subtle.generateKey>>, {
450
- type: string;
451
- }>;
452
- //#endregion
453
- //#region ../../../../node_modules/jose/dist/types/jwt/verify.d.ts
454
- /** Combination of JWS Verification options and JWT Claims Set verification options. */
455
- interface JWTVerifyOptions extends VerifyOptions, JWTClaimVerificationOptions {}
456
- //#endregion
457
134
  //#region ../../src/security/providers/JwtProvider.d.ts
458
135
  /**
459
136
  * Provides utilities for working with JSON Web Tokens (JWT).
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["JWKParameters","kty","alg","key_ops","ext","use","x5c","x5t","x5u","kid","JWK_OKP_Public","crv","x","JWK_OKP_Private","d","JWK_AKP_Public","pub","JWK_AKP_Private","priv","JWK_EC_Public","y","JWK_EC_Private","JWK_RSA_Public","e","n","JWK_RSA_Private","dp","dq","p","q","qi","JWK_oct","k","JWK","GenericGetKeyFunction","IProtectedHeader","IToken","ReturnKeyTypes","Promise","protectedHeader","token","GetKeyFunction","CryptoKey","KeyObject","Uint8Array","FlattenedJWSInput","JWSHeaderParameters","header","payload","protected","signature","GeneralJWSInput","Omit","signatures","FlattenedJWS","Partial","GeneralJWS","JoseHeaderParameters","Pick","jku","jwk","typ","cty","b64","crit","propName","JWEKeyManagementHeaderParameters","apu","apv","p2c","p2s","iv","epk","FlattenedJWE","JWEHeaderParameters","aad","ciphertext","encrypted_key","tag","unprotected","GeneralJWE","recipients","enc","zip","CritOption","DecryptOptions","keyManagementAlgorithms","contentEncryptionAlgorithms","maxPBES2Count","maxDecompressedLength","EncryptOptions","JWTClaimVerificationOptions","Date","audience","clockTolerance","issuer","maxTokenAge","subject","currentDate","requiredClaims","VerifyOptions","algorithms","SignOptions","JWTPayload","iss","sub","aud","jti","nbf","exp","iat","FlattenedDecryptResult","additionalAuthenticatedData","plaintext","sharedUnprotectedHeader","unprotectedHeader","GeneralDecryptResult","CompactDecryptResult","CompactJWEHeaderParameters","FlattenedVerifyResult","GeneralVerifyResult","CompactVerifyResult","CompactJWSHeaderParameters","JWTVerifyResult","PayloadType","JWTHeaderParameters","JWTDecryptResult","ResolvedKey","key","JSONWebKeySet","keys","type","crypto","subtle","generateKey","ReturnType","Awaited","Extract","ProduceJWT","setIssuer","setSubject","setAudience","setJti","jwtId","setNotBefore","input","setExpirationTime","setIssuedAt","types","JWTVerifyOptions","VerifyOptions","JWTClaimVerificationOptions","JWTVerifyGetKey","JWTHeaderParameters","FlattenedJWSInput","CryptoKey","KeyObject","JWK","Uint8Array","GenericGetKeyFunction","jwtVerify","PayloadType","JWTPayload","JWTVerifyResult","Promise","jwt","key","options","ResolvedKey","getKey"],"sources":["../../src/security/schemas/userAccountInfoSchema.ts","../../src/security/interfaces/UserAccountToken.ts","../../src/security/atoms/currentUserAtom.ts","../../src/security/errors/InvalidCredentialsError.ts","../../src/security/errors/InvalidPermissionError.ts","../../src/security/errors/SecurityError.ts","../../src/security/interfaces/IssuerResolver.ts","../../src/security/primitives/$basicAuth.ts","../../../../node_modules/jose/dist/types/types.d.ts","../../../../node_modules/jose/dist/types/jwt/verify.d.ts","../../src/security/providers/JwtProvider.ts","../../src/security/schemas/permissionSchema.ts","../../src/security/schemas/roleSchema.ts","../../src/security/providers/SecurityProvider.ts","../../src/security/primitives/$issuer.ts","../../src/security/primitives/$permission.ts","../../src/security/primitives/$role.ts","../../src/security/primitives/$secure.ts","../../src/security/primitives/$serviceAccount.ts","../../src/security/providers/ServerSecurityProvider.ts","../../src/security/index.ts"],"x_google_ignoreList":[8,9],"mappings":";;;;;;;;;cAGa,qBAAA,WAAqB,OAAA;MAuDhC,QAAA,CAAA,OAAA;;;;;;;;;;KAEU,WAAA,GAAc,MAAA,QAAc,qBAAA;;;;;;;UCtDvB,gBAAA,SAAyB,WAAA;;;;EAIxC,KAAA;EDPW;;;ECYX,KAAA;;;;;EAMA,SAAA;AAAA;;;;;;;;;cCZW,eAAA,EAAe,QAAA,CAAA,IAAA,CAAA,QAAA,CAAA,SAAA,UAAA,OAAA;MAG1B,QAAA,CAAA,OAAA;;;;;;;;;;;;;;;;;;cCJW,uBAAA,SAAgC,iBAAA;EAAA,SAClC,IAAA;;;;;cCTE,sBAAA,SAA+B,KAAA;cAC9B,IAAA;AAAA;;;cCDD,aAAA,SAAsB,KAAA;EAC1B,IAAA;EAAA,SACS,MAAA;AAAA;;;;;;;KCKN,QAAA,GAAW,IAAA,CAAK,WAAA;EAC1B,SAAA;AAAA;;ANLF;;UMWiB,cAAA;EN4Cf;;;EMxCA,QAAA;;;;;;EAOA,SAAA,GAAY,GAAA,EAAK,aAAA,KAAkB,OAAA,CAAQ,QAAA;AAAA;;;UCrB5B,gBAAA;EACf,QAAA;EACA,QAAA;AAAA;;;;;;APHF;;;;;;;;;;iBOqBgB,UAAA,CAAW,OAAA,EAAS,gBAAA,GAAmB,UAAA;;;;UCvBtCA,aAAAA;;EAEfC,GAAAA;;;;;;EAMAC,GAAAA;ERNF;EQQEC,OAAAA;;EAEAC,GAAAA;;EAEAC,GAAAA;;EAEAC,GAAAA;;EAEAC,GAAAA;;EAEA,UAAA;;EAEAC,GAAAA;;EAEAC,GAAAA;AAAAA;;;;;;;;;;;;;;;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EACR,IAAA,EAAM,WAAA;AAAA;AAAA,UAIK,oCAAA;;;;EAIf,GAAA;;;;EAKA,QAAA;;;;EAKA,YAAA;AAAA;AAAA,UAGe,uBAAA;EACf,KAAA,QAAa,OAAA;AAAA;AAAA,UAGE,mBAAA;EACf,QAAA,GAAW,mBAAA;AAAA;;;cCjLA,sBAAA;EAAA,mBACQ,GAAA,EADc,gBAAA,CACX,MAAA;EAAA,mBACH,gBAAA,EAAgB,gBAAA;EAAA,mBAChB,WAAA,EAAW,WAAA;EAAA,mBACX,MAAA,EAAM,MAAA;EAAA,mBAEN,eAAA,EAFM,QAAA,CAES,aAAA;EAAA,mBA8Bf,eAAA,EA9Be,QAAA,CA8BA,aAAA;EAAA,UA0BxB,cAAA,CAAA,GAAkB,gBAAA;EAAA,mBAQT,eAAA,EARyB,QAAA,CAQV,aAAA;AAAA;AAAA,KAmCxB,0BAAA,IACV,OAAA,EAAS,aAAA,KACN,OAAA,CAAQ,gBAAA;;;;YC/ED,KAAA;IACR,uBAAA;MACE,KAAA;MACA,IAAA,EAAM,WAAA;IAAA;EAAA;EAAA,UAIA,KAAA;;;;;;;IAOR,6BAAA,GAAgC,gBAAA;;;;IAKhC,sBAAA,GAAyB,WAAA;EAAA;AAAA;AAAA;EAAA,UAKjB,aAAA;IACR,IAAA,GAAO,gBAAA;EAAA;EAAA,UAGC,mBAAA;IACR,IAAA,EAAM,gBAAA;EAAA;EAAA,UAGE,oBAAA,SAA6B,YAAA;;;;;;;;IAQrC,IAAA,GAAO,gBAAA;EAAA;AAAA;;;;ApBjBX;;;;;;;;ACtDA;;;;;cmB6Fa,cAAA,EAAc,QAAA,CAAA,OAAA,CAKzB,QAAA,CALyB,MAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/security/schemas/userAccountInfoSchema.ts","../../src/security/interfaces/UserAccountToken.ts","../../src/security/atoms/currentUserAtom.ts","../../src/security/errors/InvalidCredentialsError.ts","../../src/security/errors/InvalidPermissionError.ts","../../src/security/errors/SecurityError.ts","../../src/security/interfaces/IssuerResolver.ts","../../src/security/primitives/$basicAuth.ts","../../src/security/providers/JwtProvider.ts","../../src/security/schemas/permissionSchema.ts","../../src/security/schemas/roleSchema.ts","../../src/security/providers/SecurityProvider.ts","../../src/security/primitives/$issuer.ts","../../src/security/primitives/$permission.ts","../../src/security/primitives/$role.ts","../../src/security/primitives/$secure.ts","../../src/security/primitives/$serviceAccount.ts","../../src/security/providers/ServerSecurityProvider.ts","../../src/security/index.ts"],"mappings":";;;;;;;;;;;cAGa,qBAAA,WAAqB,OAAA;MAuDhC,QAAA,CAAA,OAAA;;;;;;;;;;KAEU,WAAA,GAAc,MAAA,QAAc,qBAAA;;;;;;;UCtDvB,gBAAA,SAAyB,WAAA;;;;EAIxC,KAAA;;;ADPF;ECYE,KAAA;;;;;EAMA,SAAA;AAAA;;;;;;;;;cCZW,eAAA,EAAe,QAAA,CAAA,IAAA,CAAA,QAAA,CAAA,SAAA,UAAA,OAAA;MAG1B,QAAA,CAAA,OAAA;;;;;;;;;;;;;;;;;;cCJW,uBAAA,SAAgC,iBAAA;EAAA,SAClC,IAAA;;;;;cCTE,sBAAA,SAA+B,KAAA;cAC9B,IAAA;AAAA;;;cCDD,aAAA,SAAsB,KAAA;EAC1B,IAAA;EAAA,SACS,MAAA;AAAA;;;;;;;KCKN,QAAA,GAAW,IAAA,CAAK,WAAA;EAC1B,SAAA;AAAA;;;;UAMe,cAAA;EN4Cf;;;EMxCA,QAAA;;;;;;EAOA,SAAA,GAAY,GAAA,EAAK,aAAA,KAAkB,OAAA,CAAQ,QAAA;AAAA;;;UCrB5B,gBAAA;EACf,QAAA;EACA,QAAA;AAAA;;;;;;;;APHF;;;;;;;;iBOqBgB,UAAA,CAAW,OAAA,EAAS,gBAAA,GAAmB,UAAA;;;;;;cCC1C,WAAA;EAAA,mBACQ,GAAA,EADG,gBAAA,CACA,MAAA;EAAA,mBACH,QAAA,EAAU,eAAA;EAAA,mBACV,gBAAA,EAAgB,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