@atproto/oauth-provider 0.2.5 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (184) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/account/account-store.js +3 -3
  3. package/dist/account/account-store.js.map +1 -1
  4. package/dist/assets/app/bundle-manifest.json +2 -2
  5. package/dist/assets/app/main.js +3 -3
  6. package/dist/assets/app/main.js.map +1 -1
  7. package/dist/assets/asset.d.ts +0 -1
  8. package/dist/assets/asset.d.ts.map +1 -1
  9. package/dist/assets/assets-middleware.js +2 -3
  10. package/dist/assets/assets-middleware.js.map +1 -1
  11. package/dist/assets/index.js +2 -2
  12. package/dist/assets/index.js.map +1 -1
  13. package/dist/client/client-auth.js +2 -3
  14. package/dist/client/client-auth.js.map +1 -1
  15. package/dist/client/client-manager.d.ts +1 -1
  16. package/dist/client/client-manager.d.ts.map +1 -1
  17. package/dist/client/client-manager.js +3 -4
  18. package/dist/client/client-manager.js.map +1 -1
  19. package/dist/client/client-store.js +3 -4
  20. package/dist/client/client-store.js.map +1 -1
  21. package/dist/client/client-utils.d.ts +0 -1
  22. package/dist/client/client-utils.d.ts.map +1 -1
  23. package/dist/client/client-utils.js +2 -3
  24. package/dist/client/client-utils.js.map +1 -1
  25. package/dist/device/device-details.d.ts +0 -1
  26. package/dist/device/device-details.d.ts.map +1 -1
  27. package/dist/device/device-details.js +3 -3
  28. package/dist/device/device-details.js.map +1 -1
  29. package/dist/device/device-id.d.ts.map +1 -1
  30. package/dist/device/device-manager.d.ts +1 -2
  31. package/dist/device/device-manager.d.ts.map +1 -1
  32. package/dist/device/device-store.js +2 -3
  33. package/dist/device/device-store.js.map +1 -1
  34. package/dist/device/session-id.d.ts.map +1 -1
  35. package/dist/dpop/dpop-manager.d.ts +0 -1
  36. package/dist/dpop/dpop-manager.d.ts.map +1 -1
  37. package/dist/lib/html/build-document.d.ts +0 -1
  38. package/dist/lib/html/build-document.d.ts.map +1 -1
  39. package/dist/lib/html/escapers.js +4 -5
  40. package/dist/lib/html/escapers.js.map +1 -1
  41. package/dist/lib/html/util.js +2 -3
  42. package/dist/lib/html/util.js.map +1 -1
  43. package/dist/lib/http/accept.d.ts +1 -1
  44. package/dist/lib/http/accept.d.ts.map +1 -1
  45. package/dist/lib/http/accept.js +2 -2
  46. package/dist/lib/http/accept.js.map +1 -1
  47. package/dist/lib/http/context.js +1 -2
  48. package/dist/lib/http/context.js.map +1 -1
  49. package/dist/lib/http/method.d.ts +0 -1
  50. package/dist/lib/http/method.d.ts.map +1 -1
  51. package/dist/lib/http/method.js +1 -2
  52. package/dist/lib/http/method.js.map +1 -1
  53. package/dist/lib/http/middleware.d.ts +0 -1
  54. package/dist/lib/http/middleware.d.ts.map +1 -1
  55. package/dist/lib/http/middleware.js +5 -6
  56. package/dist/lib/http/middleware.js.map +1 -1
  57. package/dist/lib/http/parser.d.ts +2 -5
  58. package/dist/lib/http/parser.d.ts.map +1 -1
  59. package/dist/lib/http/parser.js +2 -2
  60. package/dist/lib/http/parser.js.map +1 -1
  61. package/dist/lib/http/path.js +1 -2
  62. package/dist/lib/http/path.js.map +1 -1
  63. package/dist/lib/http/request.d.ts +0 -1
  64. package/dist/lib/http/request.d.ts.map +1 -1
  65. package/dist/lib/http/request.js +9 -10
  66. package/dist/lib/http/request.js.map +1 -1
  67. package/dist/lib/http/response.d.ts +9 -8
  68. package/dist/lib/http/response.d.ts.map +1 -1
  69. package/dist/lib/http/response.js +24 -66
  70. package/dist/lib/http/response.js.map +1 -1
  71. package/dist/lib/http/route.d.ts +0 -1
  72. package/dist/lib/http/route.d.ts.map +1 -1
  73. package/dist/lib/http/route.js +1 -2
  74. package/dist/lib/http/route.js.map +1 -1
  75. package/dist/lib/http/router.d.ts +2 -4
  76. package/dist/lib/http/router.d.ts.map +1 -1
  77. package/dist/lib/http/stream.d.ts +2 -7
  78. package/dist/lib/http/stream.d.ts.map +1 -1
  79. package/dist/lib/http/stream.js +5 -5
  80. package/dist/lib/http/stream.js.map +1 -1
  81. package/dist/lib/http/types.d.ts +0 -1
  82. package/dist/lib/http/types.d.ts.map +1 -1
  83. package/dist/lib/http/url.d.ts +0 -1
  84. package/dist/lib/http/url.d.ts.map +1 -1
  85. package/dist/lib/http/url.js +1 -2
  86. package/dist/lib/http/url.js.map +1 -1
  87. package/dist/lib/redis.d.ts.map +1 -1
  88. package/dist/lib/redis.js +7 -6
  89. package/dist/lib/redis.js.map +1 -1
  90. package/dist/lib/util/cast.js +1 -2
  91. package/dist/lib/util/cast.js.map +1 -1
  92. package/dist/lib/util/crypto.js +2 -2
  93. package/dist/lib/util/crypto.js.map +1 -1
  94. package/dist/lib/util/date.js +2 -3
  95. package/dist/lib/util/date.js.map +1 -1
  96. package/dist/lib/util/hostname.d.ts +0 -1
  97. package/dist/lib/util/hostname.d.ts.map +1 -1
  98. package/dist/lib/util/hostname.js +4 -5
  99. package/dist/lib/util/hostname.js.map +1 -1
  100. package/dist/lib/util/redirect-uri.js +1 -2
  101. package/dist/lib/util/redirect-uri.js.map +1 -1
  102. package/dist/lib/util/time.js +1 -2
  103. package/dist/lib/util/time.js.map +1 -1
  104. package/dist/lib/util/well-known.d.ts +0 -1
  105. package/dist/lib/util/well-known.d.ts.map +1 -1
  106. package/dist/lib/util/well-known.js +1 -2
  107. package/dist/lib/util/well-known.js.map +1 -1
  108. package/dist/metadata/build-metadata.d.ts.map +1 -1
  109. package/dist/metadata/build-metadata.js +4 -4
  110. package/dist/metadata/build-metadata.js.map +1 -1
  111. package/dist/oauth-provider.d.ts +1 -2
  112. package/dist/oauth-provider.d.ts.map +1 -1
  113. package/dist/oauth-provider.js +19 -9
  114. package/dist/oauth-provider.js.map +1 -1
  115. package/dist/oauth-verifier.d.ts +1 -2
  116. package/dist/oauth-verifier.d.ts.map +1 -1
  117. package/dist/output/build-authorize-data.js +1 -2
  118. package/dist/output/build-authorize-data.js.map +1 -1
  119. package/dist/output/build-error-payload.js +2 -3
  120. package/dist/output/build-error-payload.js.map +1 -1
  121. package/dist/output/customization.d.ts +1 -1
  122. package/dist/output/customization.d.ts.map +1 -1
  123. package/dist/output/customization.js +3 -4
  124. package/dist/output/customization.js.map +1 -1
  125. package/dist/output/output-manager.d.ts +0 -1
  126. package/dist/output/output-manager.d.ts.map +1 -1
  127. package/dist/output/send-authorize-redirect.d.ts +0 -1
  128. package/dist/output/send-authorize-redirect.d.ts.map +1 -1
  129. package/dist/output/send-authorize-redirect.js +1 -2
  130. package/dist/output/send-authorize-redirect.js.map +1 -1
  131. package/dist/output/send-web-page.d.ts +3 -4
  132. package/dist/output/send-web-page.d.ts.map +1 -1
  133. package/dist/output/send-web-page.js +4 -5
  134. package/dist/output/send-web-page.js.map +1 -1
  135. package/dist/replay/replay-store-redis.d.ts +1 -1
  136. package/dist/replay/replay-store-redis.d.ts.map +1 -1
  137. package/dist/replay/replay-store.js +3 -4
  138. package/dist/replay/replay-store.js.map +1 -1
  139. package/dist/request/code.d.ts +1 -1
  140. package/dist/request/code.d.ts.map +1 -1
  141. package/dist/request/request-data.d.ts.map +1 -1
  142. package/dist/request/request-id.d.ts.map +1 -1
  143. package/dist/request/request-manager.d.ts.map +1 -1
  144. package/dist/request/request-manager.js +2 -1
  145. package/dist/request/request-manager.js.map +1 -1
  146. package/dist/request/request-store-redis.d.ts +1 -1
  147. package/dist/request/request-store-redis.d.ts.map +1 -1
  148. package/dist/request/request-store-redis.js.map +1 -1
  149. package/dist/request/request-store.js +2 -3
  150. package/dist/request/request-store.js.map +1 -1
  151. package/dist/request/request-uri.js +3 -3
  152. package/dist/request/request-uri.js.map +1 -1
  153. package/dist/signer/signed-token-payload.d.ts +90 -90
  154. package/dist/signer/signed-token-payload.d.ts.map +1 -1
  155. package/dist/signer/signer.d.ts +6 -6
  156. package/dist/signer/signer.d.ts.map +1 -1
  157. package/dist/token/refresh-token.d.ts +1 -1
  158. package/dist/token/refresh-token.d.ts.map +1 -1
  159. package/dist/token/token-claims.d.ts +90 -90
  160. package/dist/token/token-claims.d.ts.map +1 -1
  161. package/dist/token/token-id.d.ts +1 -1
  162. package/dist/token/token-id.d.ts.map +1 -1
  163. package/dist/token/token-store.js +2 -3
  164. package/dist/token/token-store.js.map +1 -1
  165. package/dist/token/verify-token-claims.js +1 -2
  166. package/dist/token/verify-token-claims.js.map +1 -1
  167. package/package.json +3 -7
  168. package/src/assets/assets-middleware.ts +1 -1
  169. package/src/client/client-manager.ts +3 -3
  170. package/src/lib/http/accept.ts +1 -0
  171. package/src/lib/http/middleware.ts +1 -1
  172. package/src/lib/http/response.ts +37 -78
  173. package/src/lib/http/stream.ts +4 -2
  174. package/src/lib/redis.ts +5 -3
  175. package/src/metadata/build-metadata.ts +6 -3
  176. package/src/oauth-provider.ts +19 -11
  177. package/src/oauth-verifier.ts +1 -1
  178. package/src/output/send-web-page.ts +5 -3
  179. package/src/replay/replay-store-redis.ts +1 -1
  180. package/src/request/request-manager.ts +4 -1
  181. package/src/request/request-store-redis.ts +2 -1
  182. package/tsconfig.backend.tsbuildinfo +1 -0
  183. package/tsconfig.frontend.tsbuildinfo +1 -0
  184. package/tsconfig.tools.tsbuildinfo +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"token-claims.d.ts","sourceRoot":"","sources":["../../src/token/token-claims.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,KAAK,CAAA;AAGnB,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAG9C,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AA4C,CAAC;eAAqC,CAAC;;;eAA4E,CAAC;eAAqC,CAAC;eAAqC,CAAC;eAAsC,CAAC;mBAAgD,CAAC;eAAmI,CAAC;eAAuC,CAAC;sBAA4C,CAAC;eAAqC,CAAC;;;;;;;;;GAH5wxD,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAA"}
@@ -3,5 +3,5 @@ export declare const TOKEN_ID_LENGTH: number;
3
3
  export declare const tokenIdSchema: z.ZodEffects<z.ZodString, `tok-${string}`, string>;
4
4
  export type TokenId = z.infer<typeof tokenIdSchema>;
5
5
  export declare const generateTokenId: () => Promise<TokenId>;
6
- export declare const isTokenId: (data: unknown) => data is `tok-${string}`;
6
+ export declare const isTokenId: (data: unknown) => data is TokenId;
7
7
  //# sourceMappingURL=token-id.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"token-id.d.ts","sourceRoot":"","sources":["../../src/token/token-id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB,eAAO,MAAM,eAAe,QACwB,CAAA;AAEpD,eAAO,MAAM,aAAa,oDASvB,CAAA;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AACnD,eAAO,MAAM,eAAe,QAAa,QAAQ,OAAO,CAEvD,CAAA;AAED,eAAO,MAAM,SAAS,SAAU,OAAO,4BACA,CAAA"}
1
+ {"version":3,"file":"token-id.d.ts","sourceRoot":"","sources":["../../src/token/token-id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB,eAAO,MAAM,eAAe,QACwB,CAAA;AAEpD,eAAO,MAAM,aAAa,oDASvB,CAAA;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AACnD,eAAO,MAAM,eAAe,QAAa,OAAO,CAAC,OAAO,CAEvD,CAAA;AAED,eAAO,MAAM,SAAS,SAAU,OAAO,KAAG,IAAI,IAAI,OACX,CAAA"}
@@ -14,7 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.asTokenStore = exports.isTokenStore = void 0;
17
+ exports.isTokenStore = isTokenStore;
18
+ exports.asTokenStore = asTokenStore;
18
19
  // Export all types needed to implement the TokenStore interface
19
20
  __exportStar(require("./token-id.js"), exports);
20
21
  __exportStar(require("./token-data.js"), exports);
@@ -27,12 +28,10 @@ function isTokenStore(implementation) {
27
28
  typeof implementation.findTokenByCode === 'function' &&
28
29
  typeof implementation.findTokenByRefreshToken === 'function');
29
30
  }
30
- exports.isTokenStore = isTokenStore;
31
31
  function asTokenStore(implementation) {
32
32
  if (!implementation || !isTokenStore(implementation)) {
33
33
  throw new Error('Invalid TokenStore implementation');
34
34
  }
35
35
  return implementation;
36
36
  }
37
- exports.asTokenStore = asTokenStore;
38
37
  //# sourceMappingURL=token-store.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"token-store.js","sourceRoot":"","sources":["../../src/token/token-store.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAQA,gEAAgE;AAChE,gDAA6B;AAC7B,kDAA+B;AAC/B,qDAAkC;AA8ClC,SAAgB,YAAY,CAC1B,cAA6D;IAE7D,OAAO,CACL,OAAO,cAAc,CAAC,WAAW,KAAK,UAAU;QAChD,OAAO,cAAc,CAAC,SAAS,KAAK,UAAU;QAC9C,OAAO,cAAc,CAAC,WAAW,KAAK,UAAU;QAChD,OAAO,cAAc,CAAC,WAAW,KAAK,UAAU;QAChD,OAAO,cAAc,CAAC,eAAe,KAAK,UAAU;QACpD,OAAO,cAAc,CAAC,uBAAuB,KAAK,UAAU,CAC7D,CAAA;AACH,CAAC;AAXD,oCAWC;AAED,SAAgB,YAAY,CAC1B,cAA8D;IAE9D,IAAI,CAAC,cAAc,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE,CAAC;QACrD,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAA;IACtD,CAAC;IACD,OAAO,cAAc,CAAA;AACvB,CAAC;AAPD,oCAOC"}
1
+ {"version":3,"file":"token-store.js","sourceRoot":"","sources":["../../src/token/token-store.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAyDA,oCAWC;AAED,oCAOC;AArED,gEAAgE;AAChE,gDAA6B;AAC7B,kDAA+B;AAC/B,qDAAkC;AA8ClC,SAAgB,YAAY,CAC1B,cAA6D;IAE7D,OAAO,CACL,OAAO,cAAc,CAAC,WAAW,KAAK,UAAU;QAChD,OAAO,cAAc,CAAC,SAAS,KAAK,UAAU;QAC9C,OAAO,cAAc,CAAC,WAAW,KAAK,UAAU;QAChD,OAAO,cAAc,CAAC,WAAW,KAAK,UAAU;QAChD,OAAO,cAAc,CAAC,eAAe,KAAK,UAAU;QACpD,OAAO,cAAc,CAAC,uBAAuB,KAAK,UAAU,CAC7D,CAAA;AACH,CAAC;AAED,SAAgB,YAAY,CAC1B,cAA8D;IAE9D,IAAI,CAAC,cAAc,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE,CAAC;QACrD,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAA;IACtD,CAAC;IACD,OAAO,cAAc,CAAA;AACvB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.verifyTokenClaims = void 0;
3
+ exports.verifyTokenClaims = verifyTokenClaims;
4
4
  const invalid_dpop_key_binding_error_js_1 = require("../errors/invalid-dpop-key-binding-error.js");
5
5
  const invalid_dpop_proof_error_js_1 = require("../errors/invalid-dpop-proof-error.js");
6
6
  const cast_js_1 = require("../lib/util/cast.js");
@@ -35,5 +35,4 @@ function verifyTokenClaims(token, tokenId, tokenType, dpopJkt, claims, options)
35
35
  }
36
36
  return { token, tokenId, tokenType, claims };
37
37
  }
38
- exports.verifyTokenClaims = verifyTokenClaims;
39
38
  //# sourceMappingURL=verify-token-claims.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"verify-token-claims.js","sourceRoot":"","sources":["../../src/token/verify-token-claims.ts"],"names":[],"mappings":";;;AAEA,mGAAwF;AACxF,uFAA6E;AAC7E,iDAA6C;AAC7C,wDAAsD;AAkBtD,SAAgB,iBAAiB,CAC/B,KAAuB,EACvB,OAAgB,EAChB,SAAyB,EACzB,OAAsB,EACtB,MAAmB,EACnB,OAAkC;IAElC,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;IAChC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,EAAE,GAAG,IAAI,IAAI,CAAA;IAEzC,MAAM,iBAAiB,GAAmB,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAA;IACvE,IAAI,iBAAiB,KAAK,SAAS,EAAE,CAAC;QACpC,MAAM,IAAI,mCAAiB,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,CAAA;IACtE,CAAC;IACD,IAAI,SAAS,KAAK,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACrC,MAAM,IAAI,mDAAqB,CAAC,iCAAiC,CAAC,CAAA;IACpE,CAAC;IACD,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;QAC1B,MAAM,IAAI,8DAA0B,EAAE,CAAA;IACxC,CAAC;IAED,IAAI,OAAO,EAAE,QAAQ,EAAE,CAAC;QACtB,MAAM,GAAG,GAAG,IAAA,iBAAO,EAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAC/B,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAA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K,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,CAAA;AAC9C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/oauth-provider",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "license": "MIT",
5
5
  "description": "Generic OAuth2 and OpenID Connect provider for Node.js. Currently only supports features needed for Atproto.",
6
6
  "keywords": [
@@ -46,7 +46,7 @@
46
46
  "@atproto/common": "^0.4.4",
47
47
  "@atproto/jwk": "0.1.1",
48
48
  "@atproto/jwk-jose": "0.1.2",
49
- "@atproto/oauth-types": "0.1.5"
49
+ "@atproto/oauth-types": "0.2.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@rollup/plugin-commonjs": "^25.0.7",
@@ -68,13 +68,9 @@
68
68
  "rollup": "^4.13.0",
69
69
  "rollup-plugin-postcss": "^4.0.2",
70
70
  "tailwindcss": "^3.4.1",
71
- "typescript": "^5.3.3",
71
+ "typescript": "^5.6.3",
72
72
  "@atproto-labs/rollup-plugin-bundle-manifest": "0.1.0"
73
73
  },
74
- "optionalDependencies": {
75
- "ioredis": "^5.3.2",
76
- "keygrip": "^1.1.0"
77
- },
78
74
  "scripts": {
79
75
  "build:frontend": "rollup --config rollup.config.js",
80
76
  "build:backend": "tsc --build --force tsconfig.backend.json",
@@ -41,6 +41,6 @@ export function authorizeAssetsMiddleware(): Middleware {
41
41
  res.setHeader('Cache-Control', 'public, max-age=31536000, immutable')
42
42
  }
43
43
 
44
- await writeStream(res, asset.createStream(), asset.type)
44
+ writeStream(res, asset.createStream(), { contentType: asset.type })
45
45
  }
46
46
  }
@@ -815,10 +815,10 @@ function isPrivateUseUriScheme(uri: URL) {
815
815
  }
816
816
 
817
817
  function buildJsonGetRequest(uri: string, options?: GetCachedOptions) {
818
- const headers = new Headers([['accept', 'application/json']])
819
- if (options?.noCache) headers.set('cache-control', 'no-cache')
820
818
  return new Request(uri, {
821
- headers,
819
+ headers: { accept: 'application/json' },
820
+ // @ts-expect-error invalid types in "undici-types"
821
+ cache: options?.noCache ? 'no-cache' : undefined,
822
822
  signal: options?.signal,
823
823
  redirect: 'error',
824
824
  })
@@ -39,6 +39,7 @@ type View<
39
39
  * }
40
40
  * )
41
41
  * )
42
+ * ```
42
43
  */
43
44
  export function acceptMiddleware<
44
45
  D,
@@ -95,7 +95,7 @@ export function createFinalHandler(
95
95
  res.setHeader('Content-Security-Policy', "default-src 'none'")
96
96
  res.setHeader('X-Content-Type-Options', 'nosniff')
97
97
 
98
- writeJson(res, payload, status)
98
+ writeJson(res, payload, { status })
99
99
  }
100
100
  }
101
101
 
@@ -1,6 +1,4 @@
1
- import { PassThrough, Readable, Transform } from 'node:stream'
2
- import { pipeline } from 'node:stream/promises'
3
- import { constants, createBrotliCompress, createGzip } from 'node:zlib'
1
+ import { Readable, pipeline } from 'node:stream'
4
2
 
5
3
  import { Handler, ServerResponse } from './types.js'
6
4
 
@@ -26,108 +24,69 @@ export function writeRedirect(
26
24
  res.writeHead(status, { Location: url }).end()
27
25
  }
28
26
 
29
- function negotiateEncoding(accept?: string | string[]) {
30
- if (accept?.includes('br')) return 'br'
31
- if (accept?.includes('gzip')) return 'gzip'
32
- return 'identity'
27
+ export type WriteResponseOptions = {
28
+ status?: number
29
+ contentType?: string
33
30
  }
34
31
 
35
- function getEncoder(encoding: string): Transform {
36
- switch (encoding) {
37
- case 'br':
38
- return createBrotliCompress({
39
- // Default quality is too slow
40
- params: { [constants.BROTLI_PARAM_QUALITY]: 5 },
41
- })
42
- case 'gzip':
43
- return createGzip()
44
- case 'identity':
45
- return new PassThrough()
46
- default:
47
- throw new Error(`Unsupported encoding: ${encoding}`)
48
- }
49
- }
50
-
51
- const ifString = (value: unknown): string | undefined =>
52
- typeof value === 'string' ? value : undefined
53
-
54
- export async function writeStream(
32
+ export function writeStream(
55
33
  res: ServerResponse,
56
34
  stream: Readable,
57
- contentType = ifString((stream as any).headers?.['content-type']) ||
58
- 'application/octet-stream',
59
- status = 200,
60
- ): Promise<void> {
35
+ {
36
+ status = 200,
37
+ contentType = 'application/octet-stream',
38
+ }: WriteResponseOptions = {},
39
+ ): void {
61
40
  res.statusCode = status
62
41
  res.setHeader('content-type', contentType)
63
- appendHeader(res, 'vary', 'accept-encoding')
64
-
65
- const encoding = negotiateEncoding(res.req.headers['accept-encoding'])
66
-
67
- res.setHeader('content-encoding', encoding)
68
- res.setHeader('transfer-encoding', 'chunked')
69
42
 
70
43
  if (res.req.method === 'HEAD') {
71
44
  res.end()
72
45
  stream.destroy()
73
- return
74
- }
75
-
76
- try {
77
- await pipeline(stream, getEncoder(encoding), res)
78
- } catch (err) {
79
- // Prevent the socket from being left open in a bad state
80
- res.socket?.destroy()
81
-
82
- if (err != null && typeof err === 'object') {
83
- // If an abort signal is used, we can consider this function's job successful
84
- if ('name' in err && err.name === 'AbortError') return
85
-
86
- // If the client closes the connection, we don't care about the error
87
- if ('code' in err && err.code === 'ERR_STREAM_PREMATURE_CLOSE') return
88
- }
89
-
90
- throw err
46
+ } else {
47
+ pipeline([stream, res], (_err: Error | null) => {
48
+ // The error will be propagated through the streams
49
+ })
91
50
  }
92
51
  }
93
52
 
94
- export async function writeBuffer(
53
+ export function writeBuffer(
95
54
  res: ServerResponse,
96
- buffer: Buffer,
97
- contentType?: string,
98
- status = 200,
99
- ): Promise<void> {
100
- const stream = Readable.from([buffer])
101
- return writeStream(res, stream, contentType, status)
55
+ chunk: string | Buffer,
56
+ {
57
+ status = 200,
58
+ contentType = 'application/octet-stream',
59
+ }: WriteResponseOptions = {},
60
+ ): void {
61
+ res.statusCode = status
62
+ res.setHeader('content-type', contentType)
63
+ res.end(chunk)
102
64
  }
103
65
 
104
- export async function writeJson(
66
+ export function writeJson(
105
67
  res: ServerResponse,
106
68
  payload: unknown,
107
- status = 200,
108
- contentType = 'application/json',
109
- ): Promise<void> {
69
+ { contentType = 'application/json', ...options }: WriteResponseOptions = {},
70
+ ): void {
110
71
  const buffer = Buffer.from(JSON.stringify(payload))
111
- return writeBuffer(res, buffer, contentType, status)
72
+ writeBuffer(res, buffer, { ...options, contentType })
112
73
  }
113
74
 
114
- export function staticJsonHandler(
75
+ export function staticJsonMiddleware(
115
76
  value: unknown,
116
- contentType = 'application/json',
117
- status = 200,
77
+ { contentType = 'application/json', ...options }: WriteResponseOptions = {},
118
78
  ): Handler<unknown> {
119
79
  const buffer = Buffer.from(JSON.stringify(value))
120
- return function (req, res, next) {
121
- void writeBuffer(res, buffer, contentType, status).catch(next)
80
+ const staticOptions: WriteResponseOptions = { ...options, contentType }
81
+ return function (req, res) {
82
+ writeBuffer(res, buffer, staticOptions)
122
83
  }
123
84
  }
124
85
 
125
- export async function writeHtml(
86
+ export function writeHtml(
126
87
  res: ServerResponse,
127
88
  html: Buffer | string,
128
- status = 200,
129
- contentType = 'text/html',
130
- ): Promise<void> {
131
- const buffer = Buffer.isBuffer(html) ? html : Buffer.from(html)
132
- return writeBuffer(res, buffer, contentType, status)
89
+ { contentType = 'text/html', ...options }: WriteResponseOptions = {},
90
+ ): void {
91
+ writeBuffer(res, html, { ...options, contentType })
133
92
  }
@@ -14,8 +14,10 @@ import {
14
14
  export function decodeHttpRequest(req: IncomingMessage): Readable {
15
15
  try {
16
16
  return decodeStream(req, req.headers['content-encoding'])
17
- } catch (err) {
18
- throw createHttpError(415, err, { expose: err instanceof TypeError })
17
+ } catch (cause) {
18
+ const message =
19
+ cause instanceof TypeError ? cause.message : `Invalid content-encoding`
20
+ throw createHttpError(415, message, { cause })
19
21
  }
20
22
  }
21
23
 
package/src/lib/redis.ts CHANGED
@@ -5,9 +5,7 @@ export type { Redis, RedisOptions }
5
5
  export type CreateRedisOptions = Redis | RedisOptions | string
6
6
 
7
7
  export function createRedis(options: CreateRedisOptions): Redis {
8
- if (options instanceof Redis) {
9
- return options
10
- } else if (typeof options === 'string') {
8
+ if (typeof options === 'string') {
11
9
  const url = new URL(
12
10
  options.startsWith('redis://') ? options : `redis://${options}`,
13
11
  )
@@ -17,6 +15,10 @@ export function createRedis(options: CreateRedisOptions): Redis {
17
15
  port: parseInt(url.port, 10),
18
16
  password: url.password,
19
17
  })
18
+ } else if ('on' in options && 'call' in options && 'acl' in options) {
19
+ // Not using "instanceof" here in case the options is an instance of another
20
+ // version of ioredis (Redis is both a class and an interface).
21
+ return options
20
22
  } else {
21
23
  return new Redis(options)
22
24
  }
@@ -1,5 +1,8 @@
1
1
  import { Keyset } from '@atproto/jwk'
2
- import { OAuthAuthorizationServerMetadata } from '@atproto/oauth-types'
2
+ import {
3
+ OAuthAuthorizationServerMetadata,
4
+ oauthAuthorizationServerMetadataSchema,
5
+ } from '@atproto/oauth-types'
3
6
 
4
7
  import { Client } from '../client/client.js'
5
8
  import { VERIFY_ALGOS } from '../lib/util/crypto.js'
@@ -19,7 +22,7 @@ export function buildMetadata(
19
22
  keyset: Keyset,
20
23
  customMetadata?: CustomMetadata,
21
24
  ): OAuthAuthorizationServerMetadata {
22
- return {
25
+ return oauthAuthorizationServerMetadataSchema.parse({
23
26
  issuer,
24
27
 
25
28
  scopes_supported: [
@@ -119,5 +122,5 @@ export function buildMetadata(
119
122
 
120
123
  // https://drafts.aaronpk.com/draft-parecki-oauth-client-id-metadata-document/draft-parecki-oauth-client-id-metadata-document.html
121
124
  client_id_metadata_document_supported: true,
122
- }
125
+ })
123
126
  }
@@ -29,7 +29,9 @@ import {
29
29
  oauthTokenIdentificationSchema,
30
30
  oauthTokenRequestSchema,
31
31
  } from '@atproto/oauth-types'
32
- import { Redis, type RedisOptions } from 'ioredis'
32
+ import { mediaType } from '@hapi/accept'
33
+ import createHttpError from 'http-errors'
34
+ import type { Redis, RedisOptions } from 'ioredis'
33
35
  import z, { ZodError } from 'zod'
34
36
 
35
37
  import { AccessTokenType } from './access-token/access-token-type.js'
@@ -75,7 +77,7 @@ import {
75
77
  combineMiddlewares,
76
78
  parseHttpRequest,
77
79
  setupCsrfToken,
78
- staticJsonHandler,
80
+ staticJsonMiddleware,
79
81
  validateCsrfToken,
80
82
  validateFetchDest,
81
83
  validateFetchMode,
@@ -1028,7 +1030,7 @@ export class OAuthProvider extends OAuthVerifier {
1028
1030
  res.setHeader('Cache-Control', 'max-age=300')
1029
1031
  next()
1030
1032
  },
1031
- staticJsonHandler(json),
1033
+ staticJsonMiddleware(json),
1032
1034
  ])
1033
1035
 
1034
1036
  /**
@@ -1056,9 +1058,18 @@ export class OAuthProvider extends OAuthVerifier {
1056
1058
  }
1057
1059
 
1058
1060
  try {
1061
+ // Ensure we can agree on a content encoding & type before starting to
1062
+ // build the JSON response.
1063
+ if (!mediaType(req.headers['accept'], ['application/json'])) {
1064
+ throw createHttpError(406, 'Unsupported media type')
1065
+ }
1066
+
1059
1067
  const result = await buildJson.call(this, req, res)
1060
- if (result !== undefined) writeJson(res, result, status)
1061
- else if (!res.headersSent) res.writeHead(status ?? 204).end()
1068
+ if (result !== undefined) {
1069
+ writeJson(res, result, { status })
1070
+ } else if (!res.headersSent) {
1071
+ res.writeHead(status ?? 204).end()
1072
+ }
1062
1073
  } catch (err) {
1063
1074
  if (!res.headersSent) {
1064
1075
  if (err instanceof WWWAuthenticateError) {
@@ -1067,7 +1078,9 @@ export class OAuthProvider extends OAuthVerifier {
1067
1078
  res.appendHeader('Access-Control-Expose-Headers', name)
1068
1079
  }
1069
1080
 
1070
- writeJson(res, buildErrorPayload(err), buildErrorStatus(err))
1081
+ const payload = buildErrorPayload(err)
1082
+ const status = buildErrorStatus(err)
1083
+ writeJson(res, payload, { status })
1071
1084
  } else {
1072
1085
  res.destroy()
1073
1086
  }
@@ -1096,11 +1109,6 @@ export class OAuthProvider extends OAuthVerifier {
1096
1109
  validateSameOrigin(req, res, issuerOrigin)
1097
1110
 
1098
1111
  await handler.call(this, req, res)
1099
-
1100
- // Should never happen (fool proofing)
1101
- if (!res.headersSent) {
1102
- throw new Error('Navigation handler did not send a response')
1103
- }
1104
1112
  } catch (err) {
1105
1113
  onError?.(
1106
1114
  req,
@@ -4,7 +4,7 @@ import {
4
4
  OAuthTokenType,
5
5
  oauthIssuerIdentifierSchema,
6
6
  } from '@atproto/oauth-types'
7
- import { Redis, type RedisOptions } from 'ioredis'
7
+ import type { Redis, RedisOptions } from 'ioredis'
8
8
 
9
9
  import { AccessTokenType } from './access-token/access-token-type.js'
10
10
  import { DpopManager, DpopManagerOptions } from './dpop/dpop-manager.js'
@@ -8,7 +8,7 @@ import {
8
8
  Html,
9
9
  js,
10
10
  } from '../lib/html/index.js'
11
- import { writeHtml } from '../lib/http/response.js'
11
+ import { writeHtml, WriteResponseOptions } from '../lib/http/response.js'
12
12
 
13
13
  export function declareBackendData(name: string, data: unknown) {
14
14
  // The script tag is removed after the data is assigned to the global variable
@@ -18,9 +18,11 @@ export function declareBackendData(name: string, data: unknown) {
18
18
  return js`window[${name}]=${data};document.currentScript.remove();`
19
19
  }
20
20
 
21
+ export type SendWebPageOptions = BuildDocumentOptions & WriteResponseOptions
22
+
21
23
  export async function sendWebPage(
22
24
  res: ServerResponse,
23
- { status = 200, ...options }: BuildDocumentOptions & { status?: number },
25
+ options: SendWebPageOptions,
24
26
  ): Promise<void> {
25
27
  // @TODO: make these headers configurable (?)
26
28
  res.setHeader('Permissions-Policy', 'otp-credentials=*, document-domain=()')
@@ -53,7 +55,7 @@ export async function sendWebPage(
53
55
 
54
56
  const html = buildDocument(options)
55
57
 
56
- return writeHtml(res, html.toString(), status)
58
+ return writeHtml(res, html.toString(), options)
57
59
  }
58
60
 
59
61
  function assetToHash(asset: Html | AssetRef): string {
@@ -1,4 +1,4 @@
1
- import { Redis } from 'ioredis'
1
+ import type { Redis } from 'ioredis'
2
2
 
3
3
  import { CreateRedisOptions, createRedis } from '../lib/redis.js'
4
4
  import type { ReplayStore } from './replay-store.js'
@@ -442,7 +442,10 @@ export class RequestManager {
442
442
  }
443
443
 
444
444
  if (data.clientId !== client.id) {
445
- throw new InvalidGrantError('This code was issued for another client')
445
+ // Note: do not reveal the original client ID to the client using an invalid id
446
+ throw new InvalidGrantError(
447
+ `The code was not issued to client "${client.id}"`,
448
+ )
446
449
  }
447
450
 
448
451
  if (data.expiresAt < new Date()) {
@@ -1,4 +1,5 @@
1
- import { Redis } from 'ioredis'
1
+ import type { Redis } from 'ioredis'
2
+
2
3
  import { CreateRedisOptions, createRedis } from '../lib/redis.js'
3
4
  import { Code } from './code.js'
4
5
  import { RequestData } from './request-data.js'
@@ -0,0 +1 @@
1
+ {"root":["./src/constants.ts","./src/index.ts","./src/oauth-client.ts","./src/oauth-dpop.ts","./src/oauth-errors.ts","./src/oauth-hooks.ts","./src/oauth-provider.ts","./src/oauth-store.ts","./src/oauth-verifier.ts","./src/access-token/access-token-type.ts","./src/account/account-manager.ts","./src/account/account-store.ts","./src/account/account.ts","./src/assets/asset.ts","./src/assets/assets-middleware.ts","./src/assets/index.ts","./src/client/client-auth.ts","./src/client/client-data.ts","./src/client/client-id.ts","./src/client/client-info.ts","./src/client/client-manager.ts","./src/client/client-store.ts","./src/client/client-utils.ts","./src/client/client.ts","./src/device/device-data.ts","./src/device/device-details.ts","./src/device/device-id.ts","./src/device/device-manager.ts","./src/device/device-store.ts","./src/device/session-id.ts","./src/dpop/dpop-manager.ts","./src/dpop/dpop-nonce.ts","./src/errors/access-denied-error.ts","./src/errors/account-selection-required-error.ts","./src/errors/consent-required-error.ts","./src/errors/invalid-authorization-details-error.ts","./src/errors/invalid-client-error.ts","./src/errors/invalid-client-id-error.ts","./src/errors/invalid-client-metadata-error.ts","./src/errors/invalid-dpop-key-binding-error.ts","./src/errors/invalid-dpop-proof-error.ts","./src/errors/invalid-grant-error.ts","./src/errors/invalid-parameters-error.ts","./src/errors/invalid-redirect-uri-error.ts","./src/errors/invalid-request-error.ts","./src/errors/invalid-scope-error.ts","./src/errors/invalid-token-error.ts","./src/errors/login-required-error.ts","./src/errors/oauth-error.ts","./src/errors/second-authentication-factor-required-error.ts","./src/errors/unauthorized-client-error.ts","./src/errors/use-dpop-nonce-error.ts","./src/errors/www-authenticate-error.ts","./src/lib/redis.ts","./src/lib/html/build-document.ts","./src/lib/html/escapers.ts","./src/lib/html/html.ts","./src/lib/html/index.ts","./src/lib/html/tags.ts","./src/lib/html/util.ts","./src/lib/http/accept.ts","./src/lib/http/context.ts","./src/lib/http/index.ts","./src/lib/http/method.ts","./src/lib/http/middleware.ts","./src/lib/http/parser.ts","./src/lib/http/path.ts","./src/lib/http/request.ts","./src/lib/http/response.ts","./src/lib/http/route.ts","./src/lib/http/router.ts","./src/lib/http/stream.ts","./src/lib/http/types.ts","./src/lib/http/url.ts","./src/lib/util/authorization-header.ts","./src/lib/util/cast.ts","./src/lib/util/crypto.ts","./src/lib/util/date.ts","./src/lib/util/hostname.ts","./src/lib/util/redirect-uri.ts","./src/lib/util/time.ts","./src/lib/util/type.ts","./src/lib/util/well-known.ts","./src/metadata/build-metadata.ts","./src/oidc/sub.ts","./src/output/build-authorize-data.ts","./src/output/build-error-payload.ts","./src/output/customization.ts","./src/output/output-manager.ts","./src/output/send-authorize-redirect.ts","./src/output/send-web-page.ts","./src/replay/replay-manager.ts","./src/replay/replay-store-memory.ts","./src/replay/replay-store-redis.ts","./src/replay/replay-store.ts","./src/request/code.ts","./src/request/request-data.ts","./src/request/request-id.ts","./src/request/request-info.ts","./src/request/request-manager.ts","./src/request/request-store-memory.ts","./src/request/request-store-redis.ts","./src/request/request-store.ts","./src/request/request-uri.ts","./src/signer/signed-token-payload.ts","./src/signer/signer.ts","./src/token/refresh-token.ts","./src/token/token-claims.ts","./src/token/token-data.ts","./src/token/token-id.ts","./src/token/token-manager.ts","./src/token/token-store.ts","./src/token/verify-token-claims.ts"],"version":"5.6.3"}
@@ -0,0 +1 @@
1
+ {"root":["./src/assets/app/backend-data.ts","./src/assets/app/cookies.ts","./src/assets/app/hooks/use-api.ts","./src/assets/app/hooks/use-bound-dispatch.ts","./src/assets/app/hooks/use-csrf-token.ts","./src/assets/app/lib/api.ts","./src/assets/app/lib/clsx.ts","./src/assets/app/lib/util.ts","./src/assets/app/app.tsx","./src/assets/app/main.tsx","./src/assets/app/components/accept-form.tsx","./src/assets/app/components/account-identifier.tsx","./src/assets/app/components/account-picker.tsx","./src/assets/app/components/button.tsx","./src/assets/app/components/client-name.tsx","./src/assets/app/components/fieldset.tsx","./src/assets/app/components/form-card.tsx","./src/assets/app/components/help-card.tsx","./src/assets/app/components/info-card.tsx","./src/assets/app/components/input-checkbox.tsx","./src/assets/app/components/input-container.tsx","./src/assets/app/components/input-layout.tsx","./src/assets/app/components/input-text.tsx","./src/assets/app/components/layout-title-page.tsx","./src/assets/app/components/layout-welcome.tsx","./src/assets/app/components/sign-in-form.tsx","./src/assets/app/components/sign-up-account-form.tsx","./src/assets/app/components/sign-up-disclaimer.tsx","./src/assets/app/components/url-viewer.tsx","./src/assets/app/components/icons/alert-icon.tsx","./src/assets/app/components/icons/at-symbol-icon.tsx","./src/assets/app/components/icons/caret-right-icon.tsx","./src/assets/app/components/icons/lock-icon.tsx","./src/assets/app/components/icons/token-icon.tsx","./src/assets/app/components/icons/util.tsx","./src/assets/app/views/accept-view.tsx","./src/assets/app/views/authorize-view.tsx","./src/assets/app/views/error-view.tsx","./src/assets/app/views/sign-in-view.tsx","./src/assets/app/views/sign-up-view.tsx","./src/assets/app/views/welcome-view.tsx"],"version":"5.6.3"}
@@ -0,0 +1 @@
1
+ {"root":["./rollup.config.js","./tailwind.config.js"],"version":"5.6.3"}