@udibo/oauth2 0.14.1 → 0.15.1

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 (413) hide show
  1. package/README.md +45 -24
  2. package/{esm → dist}/adapters/hono/_common.d.ts +5 -5
  3. package/{esm → dist}/adapters/hono/_common.js +1 -1
  4. package/{esm → dist}/adapters/hono/authorization-server.d.ts +6 -7
  5. package/{esm → dist}/adapters/hono/authorization-server.js +0 -1
  6. package/{esm → dist}/adapters/hono/bff/auth-request-store.d.ts +2 -2
  7. package/{esm → dist}/adapters/hono/bff/auth-request-store.js +2 -2
  8. package/{esm → dist}/adapters/hono/bff/bff.d.ts +8 -8
  9. package/{esm → dist}/adapters/hono/bff/bff.js +33 -27
  10. package/{esm → dist}/adapters/hono/bff/cookie-prefix.js +1 -2
  11. package/{esm → dist}/adapters/hono/bff/mod.d.ts +5 -6
  12. package/{esm → dist}/adapters/hono/bff/mod.js +1 -2
  13. package/{esm → dist}/adapters/hono/bff/proxy.js +2 -1
  14. package/{esm → dist}/adapters/hono/bff/session-store.d.ts +2 -2
  15. package/{esm → dist}/adapters/hono/bff/session-store.js +7 -6
  16. package/{esm → dist}/adapters/hono/bff/testing.d.ts +7 -8
  17. package/{esm → dist}/adapters/hono/bff/testing.js +19 -22
  18. package/{esm → dist}/adapters/hono/identity.d.ts +1 -2
  19. package/{esm → dist}/adapters/hono/identity.js +10 -10
  20. package/{esm → dist}/adapters/hono/log.d.ts +0 -1
  21. package/{esm → dist}/adapters/hono/log.js +0 -6
  22. package/{esm → dist}/adapters/hono/resource-server.d.ts +5 -6
  23. package/{esm → dist}/adapters/hono/resource-server.js +0 -1
  24. package/dist/cli/bin.d.ts +2 -0
  25. package/dist/cli/bin.js +3 -0
  26. package/dist/cli/idp/config.d.ts +110 -0
  27. package/dist/cli/idp/config.js +269 -0
  28. package/dist/cli/idp/mod.d.ts +20 -0
  29. package/dist/cli/idp/mod.js +175 -0
  30. package/dist/cli/idp/pages.d.ts +56 -0
  31. package/dist/cli/idp/pages.js +190 -0
  32. package/dist/cli/idp/server.d.ts +93 -0
  33. package/dist/cli/idp/server.js +559 -0
  34. package/dist/cli/keygen.d.ts +13 -0
  35. package/dist/cli/keygen.js +30 -0
  36. package/dist/cli/mod.d.ts +34 -0
  37. package/dist/cli/mod.js +94 -0
  38. package/{esm → dist}/client/_http.d.ts +1 -1
  39. package/{esm → dist}/client/base.d.ts +1 -1
  40. package/{esm → dist}/client/bff-client.d.ts +1 -1
  41. package/{esm → dist}/client/bff-client.js +7 -6
  42. package/{esm → dist}/client/browser-storage.d.ts +1 -1
  43. package/{esm → dist}/client/check.js +1 -1
  44. package/{esm → dist}/client/direct-client.d.ts +6 -6
  45. package/{esm → dist}/client/direct-client.js +11 -13
  46. package/{esm → dist}/client/discovery-cache.d.ts +1 -1
  47. package/{esm → dist}/client/discovery-cache.js +2 -2
  48. package/{esm → dist}/client/events.d.ts +1 -1
  49. package/{esm → dist}/client/mod.d.ts +11 -12
  50. package/{esm → dist}/client/mod.js +1 -1
  51. package/{esm → dist}/errors.d.ts +1 -1
  52. package/{esm → dist}/errors.js +1 -1
  53. package/{esm → dist}/identity/events.d.ts +1 -1
  54. package/{esm → dist}/identity/external/_shared.d.ts +1 -1
  55. package/{esm → dist}/identity/external/_shared.js +1 -2
  56. package/{esm → dist}/identity/external/apple-client-secret.d.ts +1 -1
  57. package/{esm → dist}/identity/external/apple-client-secret.js +6 -7
  58. package/{esm → dist}/identity/external/apple.d.ts +5 -5
  59. package/{esm → dist}/identity/external/apple.js +10 -11
  60. package/{esm → dist}/identity/external/discord.d.ts +3 -3
  61. package/{esm → dist}/identity/external/discord.js +2 -2
  62. package/{esm → dist}/identity/external/flow.d.ts +1 -1
  63. package/{esm → dist}/identity/external/flow.js +2 -2
  64. package/{esm → dist}/identity/external/github.d.ts +3 -3
  65. package/{esm → dist}/identity/external/github.js +12 -17
  66. package/{esm → dist}/identity/external/google.d.ts +5 -5
  67. package/{esm → dist}/identity/external/google.js +2 -2
  68. package/{esm → dist}/identity/external/mod.d.ts +12 -13
  69. package/{esm → dist}/identity/external/mod.js +0 -1
  70. package/{esm → dist}/identity/external/oauth2.d.ts +1 -1
  71. package/{esm → dist}/identity/external/oauth2.js +8 -8
  72. package/{esm → dist}/identity/external/oidc.d.ts +4 -4
  73. package/{esm → dist}/identity/external/oidc.js +9 -8
  74. package/{esm → dist}/identity/hibp.d.ts +1 -1
  75. package/{esm → dist}/identity/hibp.js +1 -1
  76. package/{esm → dist}/identity/lockout.js +1 -2
  77. package/{esm → dist}/identity/mfa/mod.d.ts +4 -5
  78. package/{esm → dist}/identity/mfa/mod.js +1 -2
  79. package/{esm → dist}/identity/mfa/service.d.ts +3 -3
  80. package/{esm → dist}/identity/mfa/service.js +4 -3
  81. package/{esm → dist}/identity/mfa/totp.d.ts +1 -1
  82. package/{esm → dist}/identity/mfa/totp.js +2 -2
  83. package/{esm → dist}/identity/migration.d.ts +2 -3
  84. package/{esm → dist}/identity/migration.js +3 -4
  85. package/{esm → dist}/identity/mod.d.ts +14 -15
  86. package/{esm → dist}/identity/mod.js +0 -1
  87. package/{esm → dist}/identity/otp.d.ts +1 -1
  88. package/{esm → dist}/identity/otp.js +4 -2
  89. package/{esm → dist}/identity/password.js +8 -5
  90. package/{esm → dist}/identity/rate-limit.d.ts +1 -1
  91. package/{esm → dist}/identity/service.d.ts +10 -10
  92. package/{esm → dist}/identity/service.js +17 -18
  93. package/{esm → dist}/identity/session.js +2 -2
  94. package/{esm → dist}/identity/token-flow.js +3 -2
  95. package/{esm → dist}/models/authorization-code.d.ts +3 -3
  96. package/{esm → dist}/models/authorization.d.ts +1 -1
  97. package/{esm → dist}/models/authorization.js +1 -2
  98. package/{esm → dist}/models/device-authorization.d.ts +2 -2
  99. package/{esm → dist}/models/token.d.ts +3 -3
  100. package/{esm → dist}/react/callback.d.ts +1 -1
  101. package/{esm → dist}/react/callback.js +0 -1
  102. package/{esm → dist}/react/components/class-names.d.ts +1 -1
  103. package/{esm → dist}/react/components/class-names.js +3 -2
  104. package/{esm → dist}/react/components/internal.d.ts +2 -2
  105. package/{esm → dist}/react/components/internal.js +5 -11
  106. package/{esm → dist}/react/components/mfa-challenge-form.d.ts +2 -2
  107. package/{esm → dist}/react/components/mfa-challenge-form.js +4 -6
  108. package/{esm → dist}/react/components/mfa-enrollment-form.d.ts +2 -2
  109. package/{esm → dist}/react/components/mfa-enrollment-form.js +2 -6
  110. package/{esm → dist}/react/components/mod.d.ts +20 -21
  111. package/{esm → dist}/react/components/mod.js +1 -2
  112. package/{esm → dist}/react/components/request-password-reset-form.d.ts +2 -2
  113. package/{esm → dist}/react/components/request-password-reset-form.js +1 -3
  114. package/{esm → dist}/react/components/reset-password-form.d.ts +2 -2
  115. package/{esm → dist}/react/components/reset-password-form.js +2 -2
  116. package/{esm → dist}/react/components/sign-in-form.d.ts +2 -2
  117. package/{esm → dist}/react/components/sign-in-form.js +1 -5
  118. package/{esm → dist}/react/components/sign-up-form.d.ts +2 -2
  119. package/{esm → dist}/react/components/sign-up-form.js +4 -10
  120. package/{esm → dist}/react/components/types.d.ts +2 -2
  121. package/{esm → dist}/react/components/use-auth-form.d.ts +3 -3
  122. package/{esm → dist}/react/components/use-auth-form.js +4 -7
  123. package/{esm → dist}/react/components/user-menu.d.ts +2 -2
  124. package/{esm → dist}/react/components/user-menu.js +9 -14
  125. package/{esm → dist}/react/context.d.ts +1 -1
  126. package/{esm → dist}/react/mod.d.ts +6 -7
  127. package/{esm → dist}/react/mod.js +0 -1
  128. package/{esm → dist}/react/provider.d.ts +2 -2
  129. package/{esm → dist}/react/require-auth.js +1 -3
  130. package/{esm → dist}/react/testing.d.ts +2 -3
  131. package/{esm → dist}/react/testing.js +1 -2
  132. package/{esm → dist}/react/use-authorization.d.ts +1 -1
  133. package/{esm → dist}/react/use-oauth2.d.ts +8 -1
  134. package/{esm → dist}/react/use-oauth2.js +0 -1
  135. package/{esm → dist}/server/_clock-skew.js +2 -1
  136. package/{esm → dist}/server/authorization-server.d.ts +40 -41
  137. package/{esm → dist}/server/authorization-server.js +32 -42
  138. package/{esm → dist}/server/client-authentication.d.ts +2 -2
  139. package/{esm → dist}/server/grants/authorization-code.d.ts +9 -9
  140. package/{esm → dist}/server/grants/authorization-code.js +5 -6
  141. package/{esm → dist}/server/grants/client-credentials.d.ts +4 -4
  142. package/{esm → dist}/server/grants/device-authorization.d.ts +6 -6
  143. package/{esm → dist}/server/grants/device-authorization.js +4 -4
  144. package/{esm → dist}/server/grants/grant.d.ts +7 -7
  145. package/{esm → dist}/server/grants/grant.js +7 -7
  146. package/{esm → dist}/server/grants/password.d.ts +5 -5
  147. package/{esm → dist}/server/grants/refresh-token.d.ts +4 -4
  148. package/{esm → dist}/server/grants/refresh-token.js +5 -6
  149. package/{esm → dist}/server/introspection-token-reader.d.ts +5 -5
  150. package/{esm → dist}/server/introspection-token-reader.js +4 -4
  151. package/{esm → dist}/server/jwks-token-reader.d.ts +5 -5
  152. package/{esm → dist}/server/jwks-token-reader.js +4 -4
  153. package/{esm → dist}/server/mod.d.ts +12 -13
  154. package/{esm → dist}/server/mod.js +0 -1
  155. package/{esm → dist}/server/public-suffix/mod.d.ts +2 -3
  156. package/{esm → dist}/server/public-suffix/mod.js +1 -2
  157. package/{esm → dist}/server/public-suffix/rules.d.ts +1 -1
  158. package/{esm → dist}/server/public-suffix/rules.js +1 -1
  159. package/{esm → dist}/server/redirect-uri.js +5 -4
  160. package/{esm → dist}/server/resource-server.d.ts +11 -12
  161. package/{esm → dist}/server/resource-server.js +12 -14
  162. package/{esm → dist}/server/services/authorization-code.d.ts +5 -5
  163. package/{esm → dist}/server/services/client.d.ts +1 -1
  164. package/{esm → dist}/server/services/device-authorization.d.ts +3 -3
  165. package/{esm → dist}/server/services/token.d.ts +6 -6
  166. package/{esm → dist}/server/services/token.js +3 -1
  167. package/{esm → dist}/server/services/user.d.ts +1 -1
  168. package/{esm → dist}/server/signing-keys.d.ts +1 -1
  169. package/{esm → dist}/server/signing-keys.js +8 -2
  170. package/{esm → dist}/server/utils/hash.js +1 -1
  171. package/{esm → dist}/testing/contract/auth-request-storage.d.ts +1 -1
  172. package/{esm → dist}/testing/contract/auth-request-storage.js +24 -29
  173. package/{esm → dist}/testing/contract/authorization-code.d.ts +6 -6
  174. package/{esm → dist}/testing/contract/authorization-code.js +16 -17
  175. package/{esm → dist}/testing/contract/client.d.ts +4 -4
  176. package/{esm → dist}/testing/contract/client.js +14 -15
  177. package/{esm → dist}/testing/contract/device-authorization.d.ts +6 -6
  178. package/{esm → dist}/testing/contract/device-authorization.js +37 -39
  179. package/{esm → dist}/testing/contract/identity-session.d.ts +6 -1
  180. package/{esm → dist}/testing/contract/identity-session.js +44 -36
  181. package/{esm → dist}/testing/contract/identity-user-store.d.ts +8 -2
  182. package/{esm → dist}/testing/contract/identity-user-store.js +48 -46
  183. package/{esm → dist}/testing/contract/lockout-store.d.ts +1 -1
  184. package/{esm → dist}/testing/contract/lockout-store.js +23 -24
  185. package/{esm → dist}/testing/contract/mfa-store.d.ts +1 -1
  186. package/{esm → dist}/testing/contract/mfa-store.js +53 -54
  187. package/{esm → dist}/testing/contract/mod.d.ts +15 -16
  188. package/{esm → dist}/testing/contract/mod.js +0 -1
  189. package/{esm → dist}/testing/contract/otp-store.d.ts +1 -1
  190. package/{esm → dist}/testing/contract/otp-store.js +33 -34
  191. package/{esm → dist}/testing/contract/rate-limit-store.d.ts +1 -1
  192. package/{esm → dist}/testing/contract/rate-limit-store.js +15 -16
  193. package/{esm → dist}/testing/contract/tenant.js +361 -330
  194. package/{esm → dist}/testing/contract/token-flow-store.d.ts +1 -1
  195. package/{esm → dist}/testing/contract/token-flow-store.js +27 -32
  196. package/{esm → dist}/testing/contract/token-reader.d.ts +3 -3
  197. package/{esm → dist}/testing/contract/token-reader.js +6 -7
  198. package/{esm → dist}/testing/contract/token.d.ts +7 -7
  199. package/{esm → dist}/testing/contract/token.js +48 -53
  200. package/{esm → dist}/testing/contract/user.d.ts +2 -2
  201. package/{esm → dist}/testing/contract/user.js +8 -9
  202. package/{esm → dist}/testing/mod.d.ts +5 -6
  203. package/{esm → dist}/testing/mod.js +2 -3
  204. package/{esm → dist}/testing/server.d.ts +7 -6
  205. package/{esm → dist}/testing/server.js +2 -1
  206. package/{esm → dist}/testing/services.d.ts +11 -11
  207. package/{esm → dist}/testing/services.js +8 -8
  208. package/{esm → dist}/testing/tenant.d.ts +11 -7
  209. package/{esm → dist}/testing/tenant.js +109 -94
  210. package/dist/utils/_constant-time.d.ts +12 -0
  211. package/dist/utils/_constant-time.js +19 -0
  212. package/{esm → dist}/utils/_default-fetch.js +4 -1
  213. package/dist/utils/_delay.d.ts +13 -0
  214. package/dist/utils/_delay.js +28 -0
  215. package/dist/utils/_encoding.d.ts +39 -0
  216. package/dist/utils/_encoding.js +126 -0
  217. package/dist/utils/_inbound-request.d.ts +15 -0
  218. package/dist/utils/_inbound-request.js +25 -0
  219. package/{esm → dist}/utils/authentication-context.d.ts +1 -1
  220. package/{esm → dist}/utils/crypto.d.ts +2 -3
  221. package/{esm → dist}/utils/crypto.js +3 -4
  222. package/{esm → dist}/utils/pkce.js +1 -1
  223. package/{esm → dist}/utils/text.js +1 -1
  224. package/{esm → dist}/utils/url.d.ts +0 -1
  225. package/{esm → dist}/utils/url.js +0 -1
  226. package/package.json +156 -33
  227. package/esm/_dnt.polyfills.d.ts +0 -31
  228. package/esm/_dnt.polyfills.js +0 -26
  229. package/esm/deps/jsr.io/@std/assert/1.0.19/almost_equals.d.ts +0 -29
  230. package/esm/deps/jsr.io/@std/assert/1.0.19/almost_equals.js +0 -47
  231. package/esm/deps/jsr.io/@std/assert/1.0.19/array_includes.d.ts +0 -28
  232. package/esm/deps/jsr.io/@std/assert/1.0.19/array_includes.js +0 -65
  233. package/esm/deps/jsr.io/@std/assert/1.0.19/assert.d.ts +0 -16
  234. package/esm/deps/jsr.io/@std/assert/1.0.19/assert.js +0 -23
  235. package/esm/deps/jsr.io/@std/assert/1.0.19/assertion_error.d.ts +0 -25
  236. package/esm/deps/jsr.io/@std/assert/1.0.19/assertion_error.js +0 -30
  237. package/esm/deps/jsr.io/@std/assert/1.0.19/equal.d.ts +0 -24
  238. package/esm/deps/jsr.io/@std/assert/1.0.19/equal.js +0 -193
  239. package/esm/deps/jsr.io/@std/assert/1.0.19/equals.d.ts +0 -36
  240. package/esm/deps/jsr.io/@std/assert/1.0.19/equals.js +0 -61
  241. package/esm/deps/jsr.io/@std/assert/1.0.19/exists.d.ts +0 -17
  242. package/esm/deps/jsr.io/@std/assert/1.0.19/exists.js +0 -27
  243. package/esm/deps/jsr.io/@std/assert/1.0.19/fail.d.ts +0 -14
  244. package/esm/deps/jsr.io/@std/assert/1.0.19/fail.js +0 -20
  245. package/esm/deps/jsr.io/@std/assert/1.0.19/false.d.ts +0 -18
  246. package/esm/deps/jsr.io/@std/assert/1.0.19/false.js +0 -23
  247. package/esm/deps/jsr.io/@std/assert/1.0.19/greater.d.ts +0 -19
  248. package/esm/deps/jsr.io/@std/assert/1.0.19/greater.js +0 -29
  249. package/esm/deps/jsr.io/@std/assert/1.0.19/greater_or_equal.d.ts +0 -19
  250. package/esm/deps/jsr.io/@std/assert/1.0.19/greater_or_equal.js +0 -29
  251. package/esm/deps/jsr.io/@std/assert/1.0.19/instance_of.d.ts +0 -22
  252. package/esm/deps/jsr.io/@std/assert/1.0.19/instance_of.js +0 -52
  253. package/esm/deps/jsr.io/@std/assert/1.0.19/is_error.d.ts +0 -24
  254. package/esm/deps/jsr.io/@std/assert/1.0.19/is_error.js +0 -53
  255. package/esm/deps/jsr.io/@std/assert/1.0.19/less.d.ts +0 -18
  256. package/esm/deps/jsr.io/@std/assert/1.0.19/less.js +0 -28
  257. package/esm/deps/jsr.io/@std/assert/1.0.19/less_or_equal.d.ts +0 -19
  258. package/esm/deps/jsr.io/@std/assert/1.0.19/less_or_equal.js +0 -29
  259. package/esm/deps/jsr.io/@std/assert/1.0.19/match.d.ts +0 -17
  260. package/esm/deps/jsr.io/@std/assert/1.0.19/match.js +0 -26
  261. package/esm/deps/jsr.io/@std/assert/1.0.19/mod.d.ts +0 -43
  262. package/esm/deps/jsr.io/@std/assert/1.0.19/mod.js +0 -45
  263. package/esm/deps/jsr.io/@std/assert/1.0.19/not_equals.d.ts +0 -26
  264. package/esm/deps/jsr.io/@std/assert/1.0.19/not_equals.js +0 -39
  265. package/esm/deps/jsr.io/@std/assert/1.0.19/not_instance_of.d.ts +0 -19
  266. package/esm/deps/jsr.io/@std/assert/1.0.19/not_instance_of.js +0 -29
  267. package/esm/deps/jsr.io/@std/assert/1.0.19/not_match.d.ts +0 -17
  268. package/esm/deps/jsr.io/@std/assert/1.0.19/not_match.js +0 -26
  269. package/esm/deps/jsr.io/@std/assert/1.0.19/not_strict_equals.d.ts +0 -22
  270. package/esm/deps/jsr.io/@std/assert/1.0.19/not_strict_equals.js +0 -32
  271. package/esm/deps/jsr.io/@std/assert/1.0.19/object_match.d.ts +0 -28
  272. package/esm/deps/jsr.io/@std/assert/1.0.19/object_match.js +0 -177
  273. package/esm/deps/jsr.io/@std/assert/1.0.19/rejects.d.ts +0 -41
  274. package/esm/deps/jsr.io/@std/assert/1.0.19/rejects.js +0 -53
  275. package/esm/deps/jsr.io/@std/assert/1.0.19/strict_equals.d.ts +0 -23
  276. package/esm/deps/jsr.io/@std/assert/1.0.19/strict_equals.js +0 -58
  277. package/esm/deps/jsr.io/@std/assert/1.0.19/string_includes.d.ts +0 -17
  278. package/esm/deps/jsr.io/@std/assert/1.0.19/string_includes.js +0 -26
  279. package/esm/deps/jsr.io/@std/assert/1.0.19/throws.d.ts +0 -44
  280. package/esm/deps/jsr.io/@std/assert/1.0.19/throws.js +0 -44
  281. package/esm/deps/jsr.io/@std/assert/1.0.19/unimplemented.d.ts +0 -14
  282. package/esm/deps/jsr.io/@std/assert/1.0.19/unimplemented.js +0 -20
  283. package/esm/deps/jsr.io/@std/assert/1.0.19/unreachable.d.ts +0 -14
  284. package/esm/deps/jsr.io/@std/assert/1.0.19/unreachable.js +0 -20
  285. package/esm/deps/jsr.io/@std/async/1.5.0/delay.d.ts +0 -44
  286. package/esm/deps/jsr.io/@std/async/1.5.0/delay.js +0 -84
  287. package/esm/deps/jsr.io/@std/crypto/1.1.0/timing_safe_equal.d.ts +0 -39
  288. package/esm/deps/jsr.io/@std/crypto/1.1.0/timing_safe_equal.js +0 -61
  289. package/esm/deps/jsr.io/@std/encoding/1.0.11/_common16.d.ts +0 -22
  290. package/esm/deps/jsr.io/@std/encoding/1.0.11/_common16.js +0 -51
  291. package/esm/deps/jsr.io/@std/encoding/1.0.11/_common32.d.ts +0 -34
  292. package/esm/deps/jsr.io/@std/encoding/1.0.11/_common32.js +0 -192
  293. package/esm/deps/jsr.io/@std/encoding/1.0.11/_common64.d.ts +0 -34
  294. package/esm/deps/jsr.io/@std/encoding/1.0.11/_common64.js +0 -113
  295. package/esm/deps/jsr.io/@std/encoding/1.0.11/_common_detach.d.ts +0 -3
  296. package/esm/deps/jsr.io/@std/encoding/1.0.11/_common_detach.js +0 -13
  297. package/esm/deps/jsr.io/@std/encoding/1.0.11/_types.d.ts +0 -8
  298. package/esm/deps/jsr.io/@std/encoding/1.0.11/_types.js +0 -2
  299. package/esm/deps/jsr.io/@std/encoding/1.0.11/_validate_binary_like.d.ts +0 -1
  300. package/esm/deps/jsr.io/@std/encoding/1.0.11/_validate_binary_like.js +0 -26
  301. package/esm/deps/jsr.io/@std/encoding/1.0.11/ascii85.d.ts +0 -60
  302. package/esm/deps/jsr.io/@std/encoding/1.0.11/ascii85.js +0 -152
  303. package/esm/deps/jsr.io/@std/encoding/1.0.11/base32.d.ts +0 -39
  304. package/esm/deps/jsr.io/@std/encoding/1.0.11/base32.js +0 -87
  305. package/esm/deps/jsr.io/@std/encoding/1.0.11/base58.d.ts +0 -39
  306. package/esm/deps/jsr.io/@std/encoding/1.0.11/base58.js +0 -131
  307. package/esm/deps/jsr.io/@std/encoding/1.0.11/base64.d.ts +0 -39
  308. package/esm/deps/jsr.io/@std/encoding/1.0.11/base64.js +0 -82
  309. package/esm/deps/jsr.io/@std/encoding/1.0.11/base64url.d.ts +0 -39
  310. package/esm/deps/jsr.io/@std/encoding/1.0.11/base64url.js +0 -72
  311. package/esm/deps/jsr.io/@std/encoding/1.0.11/hex.d.ts +0 -38
  312. package/esm/deps/jsr.io/@std/encoding/1.0.11/hex.js +0 -87
  313. package/esm/deps/jsr.io/@std/encoding/1.0.11/mod.d.ts +0 -97
  314. package/esm/deps/jsr.io/@std/encoding/1.0.11/mod.js +0 -99
  315. package/esm/deps/jsr.io/@std/encoding/1.0.11/varint.d.ts +0 -119
  316. package/esm/deps/jsr.io/@std/encoding/1.0.11/varint.js +0 -209
  317. package/esm/deps/jsr.io/@std/http/1.1.3/status.d.ts +0 -343
  318. package/esm/deps/jsr.io/@std/http/1.1.3/status.js +0 -343
  319. package/esm/deps/jsr.io/@std/internal/1.0.14/assertion_state.d.ts +0 -159
  320. package/esm/deps/jsr.io/@std/internal/1.0.14/assertion_state.js +0 -223
  321. package/esm/deps/jsr.io/@std/internal/1.0.14/build_message.d.ts +0 -79
  322. package/esm/deps/jsr.io/@std/internal/1.0.14/build_message.js +0 -116
  323. package/esm/deps/jsr.io/@std/internal/1.0.14/diff.d.ts +0 -139
  324. package/esm/deps/jsr.io/@std/internal/1.0.14/diff.js +0 -277
  325. package/esm/deps/jsr.io/@std/internal/1.0.14/diff_str.d.ts +0 -98
  326. package/esm/deps/jsr.io/@std/internal/1.0.14/diff_str.js +0 -181
  327. package/esm/deps/jsr.io/@std/internal/1.0.14/format.d.ts +0 -29
  328. package/esm/deps/jsr.io/@std/internal/1.0.14/format.js +0 -68
  329. package/esm/deps/jsr.io/@std/internal/1.0.14/styles.d.ts +0 -158
  330. package/esm/deps/jsr.io/@std/internal/1.0.14/styles.js +0 -206
  331. package/esm/deps/jsr.io/@std/internal/1.0.14/types.d.ts +0 -24
  332. package/esm/deps/jsr.io/@std/internal/1.0.14/types.js +0 -3
  333. package/esm/deps/jsr.io/@std/testing/1.0.20/_test_suite.d.ts +0 -91
  334. package/esm/deps/jsr.io/@std/testing/1.0.20/_test_suite.js +0 -347
  335. package/esm/deps/jsr.io/@std/testing/1.0.20/bdd.d.ts +0 -382
  336. package/esm/deps/jsr.io/@std/testing/1.0.20/bdd.js +0 -1110
  337. package/esm/deps/jsr.io/@udibo/http-error/0.11.1/mod.d.ts +0 -363
  338. package/esm/deps/jsr.io/@udibo/http-error/0.11.1/mod.js +0 -616
  339. package/esm/package.json +0 -3
  340. /package/{esm → dist}/adapters/hono/bff/cookie-prefix.d.ts +0 -0
  341. /package/{esm → dist}/adapters/hono/bff/proxy.d.ts +0 -0
  342. /package/{esm → dist}/client/_http.js +0 -0
  343. /package/{esm → dist}/client/base.js +0 -0
  344. /package/{esm → dist}/client/browser-storage.js +0 -0
  345. /package/{esm → dist}/client/check.d.ts +0 -0
  346. /package/{esm → dist}/client/events.js +0 -0
  347. /package/{esm → dist}/client/storage.d.ts +0 -0
  348. /package/{esm → dist}/client/storage.js +0 -0
  349. /package/{esm → dist}/identity/captcha.d.ts +0 -0
  350. /package/{esm → dist}/identity/captcha.js +0 -0
  351. /package/{esm → dist}/identity/delivery.d.ts +0 -0
  352. /package/{esm → dist}/identity/delivery.js +0 -0
  353. /package/{esm → dist}/identity/errors.d.ts +0 -0
  354. /package/{esm → dist}/identity/errors.js +0 -0
  355. /package/{esm → dist}/identity/events.js +0 -0
  356. /package/{esm → dist}/identity/external/_token-exchange.d.ts +0 -0
  357. /package/{esm → dist}/identity/external/_token-exchange.js +0 -0
  358. /package/{esm → dist}/identity/external/errors.d.ts +0 -0
  359. /package/{esm → dist}/identity/external/errors.js +0 -0
  360. /package/{esm → dist}/identity/external/provider.d.ts +0 -0
  361. /package/{esm → dist}/identity/external/provider.js +0 -0
  362. /package/{esm → dist}/identity/identifier.d.ts +0 -0
  363. /package/{esm → dist}/identity/identifier.js +0 -0
  364. /package/{esm → dist}/identity/lockout.d.ts +0 -0
  365. /package/{esm → dist}/identity/mfa/recovery-codes.d.ts +0 -0
  366. /package/{esm → dist}/identity/mfa/recovery-codes.js +0 -0
  367. /package/{esm → dist}/identity/password-policy.d.ts +0 -0
  368. /package/{esm → dist}/identity/password-policy.js +0 -0
  369. /package/{esm → dist}/identity/password.d.ts +0 -0
  370. /package/{esm → dist}/identity/rate-limit.js +0 -0
  371. /package/{esm → dist}/identity/session.d.ts +0 -0
  372. /package/{esm → dist}/identity/token-flow.d.ts +0 -0
  373. /package/{esm → dist}/models/authentication.d.ts +0 -0
  374. /package/{esm → dist}/models/authentication.js +0 -0
  375. /package/{esm → dist}/models/authorization-code.js +0 -0
  376. /package/{esm → dist}/models/client.d.ts +0 -0
  377. /package/{esm → dist}/models/client.js +0 -0
  378. /package/{esm → dist}/models/device-authorization.js +0 -0
  379. /package/{esm → dist}/models/responses.d.ts +0 -0
  380. /package/{esm → dist}/models/responses.js +0 -0
  381. /package/{esm → dist}/models/scope.d.ts +0 -0
  382. /package/{esm → dist}/models/scope.js +0 -0
  383. /package/{esm → dist}/models/token.js +0 -0
  384. /package/{esm → dist}/react/components/types.js +0 -0
  385. /package/{esm → dist}/react/context.js +0 -0
  386. /package/{esm → dist}/react/provider.js +0 -0
  387. /package/{esm → dist}/react/require-auth.d.ts +0 -0
  388. /package/{esm → dist}/react/use-authorization.js +0 -0
  389. /package/{esm → dist}/server/_clock-skew.d.ts +0 -0
  390. /package/{esm → dist}/server/client-authentication.js +0 -0
  391. /package/{esm → dist}/server/grants/client-credentials.js +0 -0
  392. /package/{esm → dist}/server/grants/password.js +0 -0
  393. /package/{esm → dist}/server/redirect-uri.d.ts +0 -0
  394. /package/{esm → dist}/server/services/authorization-code.js +0 -0
  395. /package/{esm → dist}/server/services/client.js +0 -0
  396. /package/{esm → dist}/server/services/device-authorization.js +0 -0
  397. /package/{esm → dist}/server/services/user.js +0 -0
  398. /package/{esm → dist}/server/utils/hash.d.ts +0 -0
  399. /package/{esm → dist}/testing/contract/_race.d.ts +0 -0
  400. /package/{esm → dist}/testing/contract/_race.js +0 -0
  401. /package/{esm → dist}/testing/contract/tenant.d.ts +0 -0
  402. /package/{esm → dist}/utils/_body.d.ts +0 -0
  403. /package/{esm → dist}/utils/_body.js +0 -0
  404. /package/{esm → dist}/utils/_buffer.d.ts +0 -0
  405. /package/{esm → dist}/utils/_buffer.js +0 -0
  406. /package/{esm → dist}/utils/_default-fetch.d.ts +0 -0
  407. /package/{esm → dist}/utils/_timing-safe.d.ts +0 -0
  408. /package/{esm → dist}/utils/_timing-safe.js +0 -0
  409. /package/{esm → dist}/utils/authentication-context.js +0 -0
  410. /package/{esm → dist}/utils/basic-auth.d.ts +0 -0
  411. /package/{esm → dist}/utils/basic-auth.js +0 -0
  412. /package/{esm → dist}/utils/pkce.d.ts +0 -0
  413. /package/{esm → dist}/utils/text.d.ts +0 -0
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Internal constant-time byte comparison for modules that also run in
3
+ * browsers, where `node:crypto` is unavailable.
4
+ *
5
+ * @module
6
+ */
7
+ /**
8
+ * Compares two byte arrays without an early exit on the first differing byte.
9
+ * Returns `false` immediately when the lengths differ, so the length is not
10
+ * secret.
11
+ */
12
+ export function constantTimeEqual(a, b) {
13
+ if (a.byteLength !== b.byteLength)
14
+ return false;
15
+ let difference = 0;
16
+ for (let i = 0; i < a.byteLength; i++)
17
+ difference |= a[i] ^ b[i];
18
+ return difference === 0;
19
+ }
@@ -84,7 +84,10 @@ async function fetchOnOwnConnection(createHttpClient, input, init) {
84
84
  }
85
85
  function watchBody(response, onError) {
86
86
  const { body: source, status } = response;
87
- if (!source || status < 200 || status > 599 || NULL_BODY_STATUSES.has(status)) {
87
+ if (!source ||
88
+ status < 200 ||
89
+ status > 599 ||
90
+ NULL_BODY_STATUSES.has(status)) {
88
91
  return response;
89
92
  }
90
93
  const reader = source.getReader();
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Internal cancellable sleep shared by the client and the identity service.
3
+ *
4
+ * @module
5
+ */
6
+ /**
7
+ * Resolves after `ms` milliseconds. When `signal` aborts first, rejects with
8
+ * the signal's reason and clears the timer. Uses the global `setTimeout`, so
9
+ * fake timers control it.
10
+ */
11
+ export declare function delay(ms: number, options?: {
12
+ signal?: AbortSignal;
13
+ }): Promise<void>;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Internal cancellable sleep shared by the client and the identity service.
3
+ *
4
+ * @module
5
+ */
6
+ /**
7
+ * Resolves after `ms` milliseconds. When `signal` aborts first, rejects with
8
+ * the signal's reason and clears the timer. Uses the global `setTimeout`, so
9
+ * fake timers control it.
10
+ */
11
+ export function delay(ms, options = {}) {
12
+ const { signal } = options;
13
+ return new Promise((resolve, reject) => {
14
+ if (signal?.aborted) {
15
+ reject(signal.reason);
16
+ return;
17
+ }
18
+ const onAbort = () => {
19
+ clearTimeout(timer);
20
+ reject(signal?.reason);
21
+ };
22
+ const timer = setTimeout(() => {
23
+ signal?.removeEventListener("abort", onAbort);
24
+ resolve();
25
+ }, ms);
26
+ signal?.addEventListener("abort", onAbort, { once: true });
27
+ });
28
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Internal binary-to-text codecs shared by the modules that run in both
3
+ * browsers and servers.
4
+ *
5
+ * @module
6
+ */
7
+ /** Lowercase hexadecimal encoding of `bytes`. */
8
+ export declare function encodeHex(bytes: Uint8Array | ArrayBuffer): string;
9
+ /** Standard-alphabet base64 with `=` padding. */
10
+ export declare function encodeBase64(bytes: Uint8Array): string;
11
+ /**
12
+ * Decodes standard-alphabet base64, padded or not.
13
+ *
14
+ * @throws {TypeError} on a character outside the alphabet.
15
+ * @throws {RangeError} on a length that leaves a remainder of 1 when divided
16
+ * by 4.
17
+ */
18
+ export declare function decodeBase64(input: string): Uint8Array;
19
+ /** URL-safe base64 without padding. */
20
+ export declare function encodeBase64Url(bytes: Uint8Array): string;
21
+ /**
22
+ * Decodes URL-safe base64, padded or not.
23
+ *
24
+ * @throws {TypeError} on a character outside the alphabet.
25
+ * @throws {RangeError} on a length that leaves a remainder of 1 when divided
26
+ * by 4.
27
+ */
28
+ export declare function decodeBase64Url(input: string): Uint8Array;
29
+ /** RFC 4648 base32 with `=` padding. */
30
+ export declare function encodeBase32(bytes: Uint8Array): string;
31
+ /**
32
+ * Decodes RFC 4648 base32. The input length must be a multiple of 8,
33
+ * counting padding.
34
+ *
35
+ * @throws {TypeError} on a character outside the alphabet or an unpadded
36
+ * length.
37
+ * @throws {RangeError} on a length no encoding can produce.
38
+ */
39
+ export declare function decodeBase32(input: string): Uint8Array;
@@ -0,0 +1,126 @@
1
+ /**
2
+ * Internal binary-to-text codecs shared by the modules that run in both
3
+ * browsers and servers.
4
+ *
5
+ * @module
6
+ */
7
+ const BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
8
+ const BASE64URL = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
9
+ const BASE32 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
10
+ const lookup = (alphabet) => new Map([...alphabet].map((char, index) => [char, index]));
11
+ const BASE64_LOOKUP = lookup(BASE64);
12
+ const BASE64URL_LOOKUP = lookup(BASE64URL);
13
+ const BASE32_LOOKUP = lookup(BASE32);
14
+ const HEX = Array.from({ length: 256 }, (_, byte) => byte.toString(16).padStart(2, "0"));
15
+ /** Lowercase hexadecimal encoding of `bytes`. */
16
+ export function encodeHex(bytes) {
17
+ const view = bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes);
18
+ let out = "";
19
+ for (const byte of view)
20
+ out += HEX[byte];
21
+ return out;
22
+ }
23
+ function encodeBits(bytes, alphabet, bitsPerChar) {
24
+ let out = "";
25
+ let buffer = 0;
26
+ let bits = 0;
27
+ const mask = (1 << bitsPerChar) - 1;
28
+ for (const byte of bytes) {
29
+ buffer = (buffer << 8) | byte;
30
+ bits += 8;
31
+ while (bits >= bitsPerChar) {
32
+ bits -= bitsPerChar;
33
+ out += alphabet[(buffer >> bits) & mask];
34
+ }
35
+ buffer &= (1 << bits) - 1;
36
+ }
37
+ if (bits > 0)
38
+ out += alphabet[(buffer << (bitsPerChar - bits)) & mask];
39
+ return out;
40
+ }
41
+ function pad(encoded, multiple) {
42
+ return (encoded + "=".repeat((multiple - (encoded.length % multiple)) % multiple));
43
+ }
44
+ function decodeBits(input, table, bitsPerChar, name, paddingWindow, invalidRemainders) {
45
+ let text = input;
46
+ for (let x = Math.max(0, text.length - paddingWindow); x < text.length; ++x) {
47
+ if (text[x] === "=") {
48
+ for (let y = x + 1; y < text.length; ++y) {
49
+ if (text[y] !== "=") {
50
+ throw new TypeError(`Cannot decode input as ${name}: Invalid character (${text[y]})`);
51
+ }
52
+ }
53
+ text = text.slice(0, x);
54
+ break;
55
+ }
56
+ }
57
+ const modulus = name === "base32" ? 8 : 4;
58
+ if (invalidRemainders.includes(text.length % modulus)) {
59
+ throw new RangeError(`Cannot decode input as ${name}: Length (${text.length}), excluding ` +
60
+ `padding, must not have a remainder of ${invalidRemainders.join(", ")} when divided by ${modulus}`);
61
+ }
62
+ const out = new Uint8Array(Math.floor((text.length * bitsPerChar) / 8));
63
+ let buffer = 0;
64
+ let bits = 0;
65
+ let index = 0;
66
+ for (const char of text) {
67
+ const value = table.get(char);
68
+ if (value === undefined) {
69
+ throw new TypeError(`Cannot decode input as ${name}: Invalid character (${char})`);
70
+ }
71
+ buffer = (buffer << bitsPerChar) | value;
72
+ bits += bitsPerChar;
73
+ if (bits >= 8) {
74
+ bits -= 8;
75
+ out[index++] = (buffer >> bits) & 0xff;
76
+ buffer &= (1 << bits) - 1;
77
+ }
78
+ }
79
+ return out;
80
+ }
81
+ /** Standard-alphabet base64 with `=` padding. */
82
+ export function encodeBase64(bytes) {
83
+ return pad(encodeBits(bytes, BASE64, 6), 4);
84
+ }
85
+ /**
86
+ * Decodes standard-alphabet base64, padded or not.
87
+ *
88
+ * @throws {TypeError} on a character outside the alphabet.
89
+ * @throws {RangeError} on a length that leaves a remainder of 1 when divided
90
+ * by 4.
91
+ */
92
+ export function decodeBase64(input) {
93
+ return decodeBits(input, BASE64_LOOKUP, 6, "base64", 2, [1]);
94
+ }
95
+ /** URL-safe base64 without padding. */
96
+ export function encodeBase64Url(bytes) {
97
+ return encodeBits(bytes, BASE64URL, 6);
98
+ }
99
+ /**
100
+ * Decodes URL-safe base64, padded or not.
101
+ *
102
+ * @throws {TypeError} on a character outside the alphabet.
103
+ * @throws {RangeError} on a length that leaves a remainder of 1 when divided
104
+ * by 4.
105
+ */
106
+ export function decodeBase64Url(input) {
107
+ return decodeBits(input, BASE64URL_LOOKUP, 6, "base64", 2, [1]);
108
+ }
109
+ /** RFC 4648 base32 with `=` padding. */
110
+ export function encodeBase32(bytes) {
111
+ return pad(encodeBits(bytes, BASE32, 5), 8);
112
+ }
113
+ /**
114
+ * Decodes RFC 4648 base32. The input length must be a multiple of 8,
115
+ * counting padding.
116
+ *
117
+ * @throws {TypeError} on a character outside the alphabet or an unpadded
118
+ * length.
119
+ * @throws {RangeError} on a length no encoding can produce.
120
+ */
121
+ export function decodeBase32(input) {
122
+ if (input.length % 8 !== 0) {
123
+ throw new TypeError(`Invalid base32 string: length (${input.length}) must be a multiple of 8`);
124
+ }
125
+ return decodeBits(input, BASE32_LOOKUP, 5, "base32", 6, [1, 3, 6]);
126
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Not part of the public API. Copies a request the server received, for
3
+ * middleware that hands downstream handlers a changed `c.req.raw`.
4
+ *
5
+ * @module
6
+ */
7
+ /**
8
+ * `request` with `headers` in place of its own, keeping its URL, method, body
9
+ * stream and the client's abort signal. Built from those parts rather than
10
+ * `new Request(request, …)`, which throws on `@hono/node-server`'s lightweight
11
+ * request unless the adapter replaced the global `Request` (the Vite dev
12
+ * server's does not). The body moves to the copy, so reading it from
13
+ * `request` afterwards finds it used.
14
+ */
15
+ export declare function inboundRequestWithHeaders(request: Request, headers: Headers): Request;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Not part of the public API. Copies a request the server received, for
3
+ * middleware that hands downstream handlers a changed `c.req.raw`.
4
+ *
5
+ * @module
6
+ */
7
+ /**
8
+ * `request` with `headers` in place of its own, keeping its URL, method, body
9
+ * stream and the client's abort signal. Built from those parts rather than
10
+ * `new Request(request, …)`, which throws on `@hono/node-server`'s lightweight
11
+ * request unless the adapter replaced the global `Request` (the Vite dev
12
+ * server's does not). The body moves to the copy, so reading it from
13
+ * `request` afterwards finds it used.
14
+ */
15
+ export function inboundRequestWithHeaders(request, headers) {
16
+ const init = {
17
+ method: request.method,
18
+ headers,
19
+ body: request.body,
20
+ signal: request.signal,
21
+ redirect: request.redirect,
22
+ duplex: "half",
23
+ };
24
+ return new Request(request.url, init);
25
+ }
@@ -1,3 +1,3 @@
1
- import type { AuthenticationContext } from "../models/authentication.js";
1
+ import type { AuthenticationContext } from "../models/authentication.ts";
2
2
  /** Copies verified event claims without sharing mutable method arrays. */
3
3
  export declare function snapshotAuthenticationContext(context: AuthenticationContext | undefined): AuthenticationContext | undefined;
@@ -22,9 +22,8 @@
22
22
  *
23
23
  * @module
24
24
  */
25
- import "../_dnt.polyfills.js";
26
- import { sha256Hash } from "../server/utils/hash.js";
27
- import { toArrayBuffer } from "./_buffer.js";
25
+ import { sha256Hash } from "../server/utils/hash.ts";
26
+ import { toArrayBuffer } from "./_buffer.ts";
28
27
  export { sha256Hash };
29
28
  export { toArrayBuffer };
30
29
  /** Constant-time string equality (length difference short-circuits to false). */
@@ -22,11 +22,10 @@
22
22
  *
23
23
  * @module
24
24
  */
25
- import "../_dnt.polyfills.js";
26
- import { timingSafeEqual } from "../deps/jsr.io/@std/crypto/1.1.0/timing_safe_equal.js";
27
- import { decodeBase64Url, encodeBase64Url } from "../deps/jsr.io/@std/encoding/1.0.11/base64url.js";
28
25
  import { sha256Hash } from "../server/utils/hash.js";
29
26
  import { toArrayBuffer } from "./_buffer.js";
27
+ import { constantTimeEqual } from "./_constant-time.js";
28
+ import { decodeBase64Url, encodeBase64Url } from "./_encoding.js";
30
29
  export { sha256Hash };
31
30
  export { toArrayBuffer };
32
31
  function toBytes(secret) {
@@ -39,7 +38,7 @@ export function timingSafeEqualString(a, b) {
39
38
  const bBytes = encoder.encode(b);
40
39
  if (aBytes.byteLength !== bBytes.byteLength)
41
40
  return false;
42
- return timingSafeEqual(aBytes, bBytes);
41
+ return constantTimeEqual(aBytes, bBytes);
43
42
  }
44
43
  /** URL-safe base64 encode (no padding). */
45
44
  export function base64urlEncode(bytes) {
@@ -6,7 +6,7 @@
6
6
  * @see https://datatracker.ietf.org/doc/html/rfc7636
7
7
  * @module
8
8
  */
9
- import { encodeBase64Url } from "../deps/jsr.io/@std/encoding/1.0.11/base64url.js";
9
+ import { encodeBase64Url } from "./_encoding.js";
10
10
  /**
11
11
  * Minimum length for code verifier per RFC 7636 Section 4.1.
12
12
  * @see https://datatracker.ietf.org/doc/html/rfc7636#section-4.1
@@ -15,7 +15,7 @@ export const PROVIDER_TEXT_MAX_LENGTH = 200;
15
15
  * every byte a remote server chose that reaches a message.
16
16
  */
17
17
  export function sanitizeProviderText(value) {
18
- // deno-lint-ignore no-control-regex
18
+ // oxlint-disable-next-line no-control-regex
19
19
  const flattened = value.replace(/[\u0000-\u001F\u007F-\u009F]+/g, " ");
20
20
  return flattened.trim().slice(0, PROVIDER_TEXT_MAX_LENGTH).toWellFormed();
21
21
  }
@@ -3,7 +3,6 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import "../_dnt.polyfills.js";
7
6
  /**
8
7
  * Open-redirect guard for a `return_to` / redirect target.
9
8
  *
@@ -3,7 +3,6 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import "../_dnt.polyfills.js";
7
6
  const RESOLUTION_ORIGIN = "http://safe-return-to.invalid";
8
7
  function hasControlCharacter(value) {
9
8
  for (let index = 0; index < value.length; index++) {
package/package.json CHANGED
@@ -1,92 +1,215 @@
1
1
  {
2
2
  "name": "@udibo/oauth2",
3
- "version": "0.14.1",
3
+ "version": "0.15.1",
4
4
  "description": "A flexible OAuth2 toolkit: framework-agnostic authorization & resource servers, a typed client, Hono adapters (including a backend-for-frontend), and React bindings.",
5
+ "keywords": [
6
+ "authorization-server",
7
+ "bff",
8
+ "hono",
9
+ "oauth2",
10
+ "oidc",
11
+ "openid-connect",
12
+ "react",
13
+ "resource-server"
14
+ ],
15
+ "homepage": "https://github.com/udibo/oauth2#readme",
16
+ "bugs": {
17
+ "url": "https://github.com/udibo/oauth2/issues"
18
+ },
19
+ "license": "MIT",
20
+ "author": "Udibo",
5
21
  "repository": {
6
22
  "type": "git",
7
23
  "url": "git+https://github.com/udibo/oauth2.git"
8
24
  },
9
- "license": "MIT",
10
- "bugs": {
11
- "url": "https://github.com/udibo/oauth2/issues"
25
+ "bin": {
26
+ "udibo-oauth2": "./dist/cli/bin.js"
12
27
  },
13
- "module": "./esm/server/mod.js",
28
+ "files": [
29
+ "dist",
30
+ "!dist/**/*.test.*",
31
+ "README.md",
32
+ "LICENSE",
33
+ "SECURITY.md"
34
+ ],
35
+ "type": "module",
36
+ "sideEffects": false,
14
37
  "exports": {
15
38
  "./server": {
16
- "import": "./esm/server/mod.js"
39
+ "types": "./dist/server/mod.d.ts",
40
+ "default": "./dist/server/mod.js"
17
41
  },
18
42
  "./server/authorization": {
19
- "import": "./esm/server/authorization-server.js"
43
+ "types": "./dist/server/authorization-server.d.ts",
44
+ "default": "./dist/server/authorization-server.js"
20
45
  },
21
46
  "./server/resource": {
22
- "import": "./esm/server/resource-server.js"
47
+ "types": "./dist/server/resource-server.d.ts",
48
+ "default": "./dist/server/resource-server.js"
23
49
  },
24
50
  "./server/public-suffix": {
25
- "import": "./esm/server/public-suffix/mod.js"
51
+ "types": "./dist/server/public-suffix/mod.d.ts",
52
+ "default": "./dist/server/public-suffix/mod.js"
26
53
  },
27
54
  "./client": {
28
- "import": "./esm/client/mod.js"
55
+ "types": "./dist/client/mod.d.ts",
56
+ "default": "./dist/client/mod.js"
29
57
  },
30
58
  "./identity": {
31
- "import": "./esm/identity/mod.js"
59
+ "types": "./dist/identity/mod.d.ts",
60
+ "default": "./dist/identity/mod.js"
32
61
  },
33
62
  "./identity/external": {
34
- "import": "./esm/identity/external/mod.js"
63
+ "types": "./dist/identity/external/mod.d.ts",
64
+ "default": "./dist/identity/external/mod.js"
35
65
  },
36
66
  "./identity/mfa": {
37
- "import": "./esm/identity/mfa/mod.js"
67
+ "types": "./dist/identity/mfa/mod.d.ts",
68
+ "default": "./dist/identity/mfa/mod.js"
38
69
  },
39
70
  "./identity/migration": {
40
- "import": "./esm/identity/migration.js"
71
+ "types": "./dist/identity/migration.d.ts",
72
+ "default": "./dist/identity/migration.js"
41
73
  },
42
74
  "./hono/resource-server": {
43
- "import": "./esm/adapters/hono/resource-server.js"
75
+ "types": "./dist/adapters/hono/resource-server.d.ts",
76
+ "default": "./dist/adapters/hono/resource-server.js"
44
77
  },
45
78
  "./hono/authorization-server": {
46
- "import": "./esm/adapters/hono/authorization-server.js"
79
+ "types": "./dist/adapters/hono/authorization-server.d.ts",
80
+ "default": "./dist/adapters/hono/authorization-server.js"
47
81
  },
48
82
  "./hono/bff": {
49
- "import": "./esm/adapters/hono/bff/mod.js"
83
+ "types": "./dist/adapters/hono/bff/mod.d.ts",
84
+ "default": "./dist/adapters/hono/bff/mod.js"
50
85
  },
51
86
  "./hono/bff/testing": {
52
- "import": "./esm/adapters/hono/bff/testing.js"
87
+ "types": "./dist/adapters/hono/bff/testing.d.ts",
88
+ "default": "./dist/adapters/hono/bff/testing.js"
53
89
  },
54
90
  "./hono/identity": {
55
- "import": "./esm/adapters/hono/identity.js"
91
+ "types": "./dist/adapters/hono/identity.d.ts",
92
+ "default": "./dist/adapters/hono/identity.js"
56
93
  },
57
94
  "./hono/log": {
58
- "import": "./esm/adapters/hono/log.js"
95
+ "types": "./dist/adapters/hono/log.d.ts",
96
+ "default": "./dist/adapters/hono/log.js"
59
97
  },
60
98
  "./react": {
61
- "import": "./esm/react/mod.js"
99
+ "types": "./dist/react/mod.d.ts",
100
+ "default": "./dist/react/mod.js"
62
101
  },
63
102
  "./react/components": {
64
- "import": "./esm/react/components/mod.js"
103
+ "types": "./dist/react/components/mod.d.ts",
104
+ "default": "./dist/react/components/mod.js"
65
105
  },
66
106
  "./react/testing": {
67
- "import": "./esm/react/testing.js"
107
+ "types": "./dist/react/testing.d.ts",
108
+ "default": "./dist/react/testing.js"
68
109
  },
69
110
  "./testing": {
70
- "import": "./esm/testing/mod.js"
111
+ "types": "./dist/testing/mod.d.ts",
112
+ "default": "./dist/testing/mod.js"
71
113
  },
72
114
  "./testing/contract": {
73
- "import": "./esm/testing/contract/mod.js"
115
+ "types": "./dist/testing/contract/mod.d.ts",
116
+ "default": "./dist/testing/contract/mod.js"
74
117
  },
75
118
  "./crypto": {
76
- "import": "./esm/utils/crypto.js"
119
+ "types": "./dist/utils/crypto.d.ts",
120
+ "default": "./dist/utils/crypto.js"
77
121
  },
78
122
  "./url": {
79
- "import": "./esm/utils/url.js"
80
- }
123
+ "types": "./dist/utils/url.d.ts",
124
+ "default": "./dist/utils/url.js"
125
+ },
126
+ "./package.json": "./package.json"
81
127
  },
82
- "scripts": {},
83
128
  "publishConfig": {
84
- "access": "public"
129
+ "access": "public",
130
+ "provenance": true
131
+ },
132
+ "scripts": {
133
+ "build": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && tsc -p tsconfig.build.json",
134
+ "check": "pnpm build && pnpm typecheck:examples && pnpm lint && pnpm fmt:check && tsc --noEmit && pnpm doc:lint && pnpm doc:check && pnpm doc:links && pnpm llms:check",
135
+ "typecheck:examples": "pnpm -r --filter \"./examples/**\" --filter \"./templates/**\" typecheck",
136
+ "fmt": "oxfmt",
137
+ "fmt:check": "oxfmt --check",
138
+ "lint": "oxlint --type-aware --type-check",
139
+ "test": "vitest run",
140
+ "test:coverage": "vitest run --coverage",
141
+ "test:browser": "playwright test",
142
+ "smoke": "node scripts/npm-smoke.ts",
143
+ "jsr:dry-run": "jsr publish --dry-run --allow-dirty",
144
+ "doc:lint": "node scripts/doc-lint.ts",
145
+ "doc:check": "node scripts/doc-check.ts",
146
+ "doc:links": "node scripts/doc-links.ts",
147
+ "llms:generate": "node scripts/llms.ts",
148
+ "llms:check": "node scripts/llms.ts --check",
149
+ "psl:update": "node scripts/public-suffix-list.ts",
150
+ "psl:check": "node scripts/public-suffix-list.ts --check",
151
+ "release:verify": "node scripts/verify-release.ts"
85
152
  },
86
153
  "dependencies": {
87
- "@types/react": "^19.2.17",
154
+ "@hono/node-server": "^2.1.3",
155
+ "@udibo/http-error": "^0.12.0"
156
+ },
157
+ "devDependencies": {
158
+ "@playwright/test": "^1.63.0",
159
+ "@sebbo2002/semantic-release-jsr": "3.2.1",
160
+ "@semantic-release/changelog": "6.0.3",
161
+ "@semantic-release/exec": "7.1.0",
162
+ "@semantic-release/git": "10.0.1",
163
+ "@semantic-release/github": "12.0.8",
164
+ "@semantic-release/npm": "13.1.5",
165
+ "@testing-library/dom": "^10.4.2",
166
+ "@testing-library/react": "^16.3.3",
167
+ "@types/node": "^26.6.4",
168
+ "@types/react": "^19.3.0",
169
+ "@types/react-dom": "^19.3.0",
170
+ "@vitest/coverage-v8": "^5.0.3",
171
+ "axe-core": "^4.14.0",
172
+ "conventional-changelog-conventionalcommits": "9.3.1",
173
+ "hono": "^4.13.13",
174
+ "jsdom": "^30.1.2",
175
+ "jsr": "^0.14.3",
176
+ "oxfmt": "^0.72.0",
177
+ "oxlint": "^1.87.0",
178
+ "oxlint-tsgolint": "^7.0.2003",
179
+ "react": "^19.3.0",
180
+ "react-dom": "^19.3.0",
181
+ "semantic-release": "25.0.5",
182
+ "typescript": "^7.0.2",
183
+ "vite": "^8.3.3",
184
+ "vitest": "^5.0.3",
185
+ "yaml": "2.9.1"
186
+ },
187
+ "peerDependencies": {
188
+ "@types/react": "^19.0.0",
88
189
  "hono": "^4.7.0",
89
- "react": "^19.0.0"
190
+ "react": "^19.0.0",
191
+ "react-dom": "^19.0.0",
192
+ "vitest": ">=3.0.0"
193
+ },
194
+ "peerDependenciesMeta": {
195
+ "hono": {
196
+ "optional": true
197
+ },
198
+ "react": {
199
+ "optional": true
200
+ },
201
+ "react-dom": {
202
+ "optional": true
203
+ },
204
+ "@types/react": {
205
+ "optional": true
206
+ },
207
+ "vitest": {
208
+ "optional": true
209
+ }
210
+ },
211
+ "engines": {
212
+ "node": ">=22"
90
213
  },
91
- "_generatedBy": "dnt@0.43.2"
214
+ "packageManager": "pnpm@12.10.1"
92
215
  }
@@ -1,31 +0,0 @@
1
- declare global {
2
- interface Object {
3
- /**
4
- * Determines whether an object has a property with the specified name.
5
- * @param o An object.
6
- * @param v A property name.
7
- */
8
- hasOwn(o: object, v: PropertyKey): boolean;
9
- }
10
- }
11
- export {};
12
- declare global {
13
- interface Error {
14
- cause?: unknown;
15
- }
16
- }
17
- export {};
18
- declare global {
19
- interface PromiseConstructor {
20
- /**
21
- * Creates a Promise that can be resolved or rejected using provided functions.
22
- * @returns An object containing `promise` promise object, `resolve` and `reject` functions.
23
- */
24
- withResolvers<T>(): {
25
- promise: Promise<T>;
26
- resolve: (value: T | PromiseLike<T>) => void;
27
- reject: (reason?: any) => void;
28
- };
29
- }
30
- }
31
- export {};