@helia/verified-fetch 4.0.0 → 4.0.2

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 (126) hide show
  1. package/README.md +7 -49
  2. package/dist/index.min.js +56 -51
  3. package/dist/index.min.js.map +4 -4
  4. package/dist/src/index.d.ts +12 -52
  5. package/dist/src/index.d.ts.map +1 -1
  6. package/dist/src/index.js +8 -50
  7. package/dist/src/index.js.map +1 -1
  8. package/dist/src/plugins/index.d.ts +0 -1
  9. package/dist/src/plugins/index.d.ts.map +1 -1
  10. package/dist/src/plugins/index.js +0 -1
  11. package/dist/src/plugins/index.js.map +1 -1
  12. package/dist/src/plugins/plugin-base.d.ts.map +1 -1
  13. package/dist/src/plugins/plugin-base.js +3 -2
  14. package/dist/src/plugins/plugin-base.js.map +1 -1
  15. package/dist/src/plugins/plugin-handle-car.d.ts.map +1 -1
  16. package/dist/src/plugins/plugin-handle-car.js +0 -1
  17. package/dist/src/plugins/plugin-handle-car.js.map +1 -1
  18. package/dist/src/plugins/plugin-handle-dag-cbor-html-preview.d.ts +3 -3
  19. package/dist/src/plugins/plugin-handle-dag-cbor-html-preview.d.ts.map +1 -1
  20. package/dist/src/plugins/plugin-handle-dag-cbor-html-preview.js +5 -6
  21. package/dist/src/plugins/plugin-handle-dag-cbor-html-preview.js.map +1 -1
  22. package/dist/src/plugins/plugin-handle-dag-cbor.d.ts.map +1 -1
  23. package/dist/src/plugins/plugin-handle-dag-cbor.js +0 -1
  24. package/dist/src/plugins/plugin-handle-dag-cbor.js.map +1 -1
  25. package/dist/src/plugins/plugin-handle-dag-pb.d.ts.map +1 -1
  26. package/dist/src/plugins/plugin-handle-dag-pb.js +34 -39
  27. package/dist/src/plugins/plugin-handle-dag-pb.js.map +1 -1
  28. package/dist/src/plugins/plugin-handle-dag-walk.d.ts +8 -4
  29. package/dist/src/plugins/plugin-handle-dag-walk.d.ts.map +1 -1
  30. package/dist/src/plugins/plugin-handle-dag-walk.js +8 -5
  31. package/dist/src/plugins/plugin-handle-dag-walk.js.map +1 -1
  32. package/dist/src/plugins/plugin-handle-ipns-record.d.ts +1 -1
  33. package/dist/src/plugins/plugin-handle-ipns-record.d.ts.map +1 -1
  34. package/dist/src/plugins/plugin-handle-ipns-record.js +4 -6
  35. package/dist/src/plugins/plugin-handle-ipns-record.js.map +1 -1
  36. package/dist/src/plugins/plugin-handle-json.d.ts.map +1 -1
  37. package/dist/src/plugins/plugin-handle-json.js +0 -1
  38. package/dist/src/plugins/plugin-handle-json.js.map +1 -1
  39. package/dist/src/plugins/plugin-handle-raw.d.ts.map +1 -1
  40. package/dist/src/plugins/plugin-handle-raw.js +4 -8
  41. package/dist/src/plugins/plugin-handle-raw.js.map +1 -1
  42. package/dist/src/plugins/plugin-handle-tar.d.ts.map +1 -1
  43. package/dist/src/plugins/plugin-handle-tar.js +0 -1
  44. package/dist/src/plugins/plugin-handle-tar.js.map +1 -1
  45. package/dist/src/plugins/types.d.ts +6 -11
  46. package/dist/src/plugins/types.d.ts.map +1 -1
  47. package/dist/src/url-resolver.d.ts +4 -3
  48. package/dist/src/url-resolver.d.ts.map +1 -1
  49. package/dist/src/url-resolver.js +35 -47
  50. package/dist/src/url-resolver.js.map +1 -1
  51. package/dist/src/utils/byte-range-context.d.ts +2 -2
  52. package/dist/src/utils/byte-range-context.d.ts.map +1 -1
  53. package/dist/src/utils/byte-range-context.js +1 -1
  54. package/dist/src/utils/byte-range-context.js.map +1 -1
  55. package/dist/src/utils/content-type-parser.d.ts.map +1 -1
  56. package/dist/src/utils/content-type-parser.js +0 -10
  57. package/dist/src/utils/content-type-parser.js.map +1 -1
  58. package/dist/src/utils/dnslink-label.d.ts +26 -0
  59. package/dist/src/utils/dnslink-label.d.ts.map +1 -0
  60. package/dist/src/utils/dnslink-label.js +35 -0
  61. package/dist/src/utils/dnslink-label.js.map +1 -0
  62. package/dist/src/utils/error-to-object.d.ts +6 -0
  63. package/dist/src/utils/error-to-object.d.ts.map +1 -0
  64. package/dist/src/utils/error-to-object.js +20 -0
  65. package/dist/src/utils/error-to-object.js.map +1 -0
  66. package/dist/src/utils/get-content-type.d.ts +1 -1
  67. package/dist/src/utils/get-content-type.d.ts.map +1 -1
  68. package/dist/src/utils/get-content-type.js +1 -1
  69. package/dist/src/utils/get-content-type.js.map +1 -1
  70. package/dist/src/utils/get-stream-from-async-iterable.d.ts +1 -2
  71. package/dist/src/utils/get-stream-from-async-iterable.d.ts.map +1 -1
  72. package/dist/src/utils/get-stream-from-async-iterable.js +1 -3
  73. package/dist/src/utils/get-stream-from-async-iterable.js.map +1 -1
  74. package/dist/src/utils/handle-redirects.js +2 -2
  75. package/dist/src/utils/ipfs-path-to-url.d.ts +16 -0
  76. package/dist/src/utils/ipfs-path-to-url.d.ts.map +1 -0
  77. package/dist/src/utils/ipfs-path-to-url.js +45 -0
  78. package/dist/src/utils/ipfs-path-to-url.js.map +1 -0
  79. package/dist/src/utils/parse-url-string.d.ts +18 -5
  80. package/dist/src/utils/parse-url-string.d.ts.map +1 -1
  81. package/dist/src/utils/parse-url-string.js +126 -44
  82. package/dist/src/utils/parse-url-string.js.map +1 -1
  83. package/dist/src/utils/resource-to-cache-key.js +2 -2
  84. package/dist/src/utils/responses.d.ts +2 -1
  85. package/dist/src/utils/responses.d.ts.map +1 -1
  86. package/dist/src/utils/responses.js +16 -1
  87. package/dist/src/utils/responses.js.map +1 -1
  88. package/dist/src/utils/walk-path.js +1 -1
  89. package/dist/src/utils/walk-path.js.map +1 -1
  90. package/dist/src/verified-fetch.d.ts.map +1 -1
  91. package/dist/src/verified-fetch.js +36 -28
  92. package/dist/src/verified-fetch.js.map +1 -1
  93. package/dist/typedoc-urls.json +0 -2
  94. package/package.json +10 -10
  95. package/src/index.ts +12 -52
  96. package/src/plugins/index.ts +0 -1
  97. package/src/plugins/plugin-base.ts +3 -2
  98. package/src/plugins/plugin-handle-car.ts +0 -2
  99. package/src/plugins/plugin-handle-dag-cbor-html-preview.ts +10 -9
  100. package/src/plugins/plugin-handle-dag-cbor.ts +3 -1
  101. package/src/plugins/plugin-handle-dag-pb.ts +49 -37
  102. package/src/plugins/plugin-handle-dag-walk.ts +10 -5
  103. package/src/plugins/plugin-handle-ipns-record.ts +6 -6
  104. package/src/plugins/plugin-handle-json.ts +1 -1
  105. package/src/plugins/plugin-handle-raw.ts +7 -8
  106. package/src/plugins/plugin-handle-tar.ts +2 -1
  107. package/src/plugins/types.ts +7 -12
  108. package/src/url-resolver.ts +37 -56
  109. package/src/utils/byte-range-context.ts +3 -3
  110. package/src/utils/content-type-parser.ts +5 -11
  111. package/src/utils/dnslink-label.ts +38 -0
  112. package/src/utils/error-to-object.ts +22 -0
  113. package/src/utils/get-content-type.ts +2 -2
  114. package/src/utils/get-stream-from-async-iterable.ts +1 -4
  115. package/src/utils/handle-redirects.ts +2 -2
  116. package/src/utils/ipfs-path-to-url.ts +54 -0
  117. package/src/utils/parse-url-string.ts +166 -49
  118. package/src/utils/resource-to-cache-key.ts +2 -2
  119. package/src/utils/responses.ts +21 -1
  120. package/src/utils/walk-path.ts +1 -1
  121. package/src/verified-fetch.ts +46 -28
  122. package/dist/src/plugins/errors.d.ts +0 -25
  123. package/dist/src/plugins/errors.d.ts.map +0 -1
  124. package/dist/src/plugins/errors.js +0 -33
  125. package/dist/src/plugins/errors.js.map +0 -1
  126. package/src/plugins/errors.ts +0 -37
@@ -1 +1 @@
1
- {"version":3,"file":"verified-fetch.js","sourceRoot":"","sources":["../../src/verified-fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,QAAQ,MAAM,WAAW,CA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CAAA;IACzB,CAAC;CACF"}
@@ -4,8 +4,6 @@
4
4
  "BasePlugin": "https://ipfs.github.io/helia-verified-fetch/classes/index.BasePlugin.html",
5
5
  "DagCborHtmlPreviewPlugin": "https://ipfs.github.io/helia-verified-fetch/classes/index.DagCborHtmlPreviewPlugin.html",
6
6
  "DirIndexHtmlPlugin": "https://ipfs.github.io/helia-verified-fetch/classes/index.DirIndexHtmlPlugin.html",
7
- "PluginError": "https://ipfs.github.io/helia-verified-fetch/classes/index.PluginError.html",
8
- "PluginFatalError": "https://ipfs.github.io/helia-verified-fetch/classes/index.PluginFatalError.html",
9
7
  "CIDDetail": "https://ipfs.github.io/helia-verified-fetch/interfaces/index.CIDDetail.html",
10
8
  ".:CIDDetail": "https://ipfs.github.io/helia-verified-fetch/interfaces/index.CIDDetail.html",
11
9
  "CIDDetailError": "https://ipfs.github.io/helia-verified-fetch/interfaces/index.CIDDetailError.html",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helia/verified-fetch",
3
- "version": "4.0.0",
3
+ "version": "4.0.2",
4
4
  "description": "A fetch-like API for obtaining verified & trustless IPFS content on the web",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/ipfs/helia-verified-fetch/tree/main/packages/verified-fetch#readme",
@@ -175,13 +175,12 @@
175
175
  "@ipld/dag-cbor": "^9.2.3",
176
176
  "@ipld/dag-json": "^10.2.4",
177
177
  "@ipld/dag-pb": "^4.1.5",
178
- "@libp2p/interface": "^3.0.0",
179
- "@libp2p/kad-dht": "^16.0.0",
180
- "@libp2p/logger": "^6.0.0",
181
- "@libp2p/peer-id": "^6.0.0",
182
- "@libp2p/utils": "^7.0.5",
183
- "@libp2p/webrtc": "^6.0.0",
184
- "@libp2p/websockets": "^10.0.0",
178
+ "@libp2p/interface": "^3.1.0",
179
+ "@libp2p/kad-dht": "^16.1.0",
180
+ "@libp2p/peer-id": "^6.0.4",
181
+ "@libp2p/utils": "^7.0.7",
182
+ "@libp2p/webrtc": "^6.0.8",
183
+ "@libp2p/websockets": "^10.1.0",
185
184
  "@multiformats/dns": "^1.0.6",
186
185
  "cborg": "^4.2.11",
187
186
  "file-type": "^21.0.0",
@@ -194,7 +193,7 @@
194
193
  "it-tar": "^6.0.5",
195
194
  "it-to-browser-readablestream": "^2.0.11",
196
195
  "it-to-buffer": "^4.0.9",
197
- "libp2p": "^3.0.0",
196
+ "libp2p": "^3.1.0",
198
197
  "multiformats": "^13.3.6",
199
198
  "progress-events": "^1.0.1",
200
199
  "quick-lru": "^7.0.1"
@@ -205,7 +204,8 @@
205
204
  "@helia/http": "^3.0.5",
206
205
  "@helia/json": "^5.0.0",
207
206
  "@ipld/car": "^5.4.2",
208
- "@libp2p/crypto": "^5.1.3",
207
+ "@libp2p/crypto": "^5.1.13",
208
+ "@libp2p/logger": "^6.2.0",
209
209
  "@types/sinon": "^17.0.4",
210
210
  "aegir": "^47.0.24",
211
211
  "browser-readablestream-to-it": "^2.0.9",
package/src/index.ts CHANGED
@@ -641,13 +641,13 @@
641
641
  * Inspects the current `PluginContext` (which includes the CID, path, query, accept header, etc.)
642
642
  * and returns `true` if the plugin can operate on the current state of the request.
643
643
  *
644
- * - **`handle(context: PluginContext): Promise<Response | null>`**
645
- * Performs the plugin’s work. It may:
646
- * - **Return a final `Response`**: This stops the pipeline immediately.
647
- * - **Return `null`**: This indicates that the plugin has only partially processed the request
648
- * (for example, by performing path walking or decoding) and the pipeline should continue.
649
- * - **Throw a `PluginError`**: This logs a non-fatal error and continues the pipeline.
650
- * - **Throw a `PluginFatalError`**: This logs a fatal error and stops the pipeline immediately.
644
+ * - **`handle(context: PluginContext): Promise<Response | undefined>`**
645
+ * Performs the plugin’s work. It will only be executed if `canHandle` previously returned `true`.
646
+ * It may:
647
+ * - **Return a `Response`**: This stops the pipeline immediately and returns the response.
648
+ * - **Return `undefined`**: This indicates that the plugin has only partially processed the request
649
+ * (for example, by performing path walking or decoding) and the pipeline should continue.
650
+ * - **Throw an `Error`**: An Internal Server Error will be returned
651
651
  *
652
652
  * ### Plugin Pipeline
653
653
  *
@@ -784,47 +784,6 @@
784
784
  * const fetch = await createVerifiedFetch(helia, { plugins })
785
785
  * ```
786
786
  *
787
- * ---
788
- *
789
- * ### Error Handling in the Plugin Pipeline
790
- *
791
- * Verified‑Fetch distinguishes between two types of errors thrown by plugins:
792
- *
793
- * - **PluginError (Non‑Fatal):**
794
- * - Use this when your plugin encounters an issue that should be logged but does not prevent the pipeline
795
- * from continuing.
796
- * - When a plugin throws a `PluginError`, the error is logged and the pipeline continues with the next plugin.
797
- *
798
- * - **PluginFatalError (Fatal):**
799
- * - Use this when a critical error occurs that should immediately abort the request.
800
- * - When a plugin throws a `PluginFatalError`, the pipeline immediately terminates and the provided error
801
- * response is returned.
802
- *
803
- * @example Plugin error Handling
804
- *
805
- * ```typescript
806
- * import { PluginError, PluginFatalError } from '@helia/verified-fetch'
807
- *
808
- * // async handle(context: PluginContext): Promise<Response | null> {
809
- * const recoverable = Math.random() > 0.5 // Use more sophisticated logic here ;)
810
- * if (recoverable === true) {
811
- * throw new PluginError('MY_CUSTOM_WARNING', 'A non‑fatal issue occurred', {
812
- * details: {
813
- * someKey: 'Additional details here'
814
- * }
815
- * })
816
- * }
817
- *
818
- * if (recoverable === false) {
819
- * throw new PluginFatalError('MY_CUSTOM_FATAL', 'A critical error occurred', {
820
- * response: new Response('Something happened', { status: 500 }) // Required: supply your own error response
821
- * })
822
- * }
823
- *
824
- * // Otherwise, continue processing...
825
- * // }
826
- * ```
827
- *
828
787
  * ### How the Plugin Pipeline Works
829
788
  *
830
789
  * - **Shared Context:**
@@ -842,8 +801,7 @@
842
801
  * This means you do not have to specify a rigid order, each plugin simply checks the context and acts if appropriate.
843
802
  *
844
803
  * - **Error Handling:**
845
- * - A thrown `PluginError` is considered non‑fatal and is logged, allowing the pipeline to continue.
846
- * - A thrown `PluginFatalError` immediately stops the pipeline and returns the error response.
804
+ * - Any thrown error immediately stops the pipeline and returns the error response.
847
805
  *
848
806
  * For a detailed explanation of the pipeline, please refer to the discussion in [Issue #167](https://github.com/ipfs/helia-verified-fetch/issues/167).
849
807
  */
@@ -898,7 +856,7 @@ export interface ResourceDetail {
898
856
 
899
857
  export interface CIDDetail {
900
858
  cid: CID
901
- path?: string
859
+ path?: string[]
902
860
  }
903
861
 
904
862
  export interface CIDDetailError extends CIDDetail {
@@ -1111,10 +1069,12 @@ export interface UrlQuery extends Record<string, string | unknown> {
1111
1069
  }
1112
1070
 
1113
1071
  export interface ResolveURLResult {
1072
+ url: URL
1114
1073
  cid: CID
1115
1074
  protocol: string
1116
1075
  ttl: number
1117
- path: string
1076
+ path: string[]
1077
+ fragment: string
1118
1078
  query: UrlQuery
1119
1079
  ipfsPath: string
1120
1080
  }
@@ -2,7 +2,6 @@
2
2
  * This file is the entry into all things we export from the `src/plugins` directory.
3
3
  */
4
4
 
5
- export { PluginError, PluginFatalError } from './errors.js'
6
5
  export { BasePlugin } from './plugin-base.js'
7
6
  export type { PluginOptions, PluginContext, VerifiedFetchPluginFactory } from './types.js'
8
7
  export * from './plugins.js'
@@ -17,9 +17,10 @@ export abstract class BasePlugin implements VerifiedFetchPlugin {
17
17
  protected _log?: Logger
18
18
 
19
19
  get log (): Logger {
20
- // instantiate the logger lazily because it depends on the id, which is not set until after the constructor is called
20
+ // instantiate the logger lazily because it depends on the id, which is not
21
+ // set until after the constructor is called
21
22
  if (this._log == null) {
22
- this._log = this.pluginOptions.logger.forComponent(this.id)
23
+ this._log = this.pluginOptions.logger.newScope(this.id)
23
24
  }
24
25
  return this._log
25
26
  }
@@ -47,8 +47,6 @@ export class CarPlugin extends BasePlugin {
47
47
  readonly id = 'car-plugin'
48
48
 
49
49
  canHandle (context: PluginContext): boolean {
50
- this.log('checking if we can handle %c with accept %s', context.cid, context.accept)
51
-
52
50
  if (context.byteRangeContext == null) {
53
51
  return false
54
52
  }
@@ -51,13 +51,14 @@ export class DagCborHtmlPreviewPlugin extends BasePlugin {
51
51
  readonly codes = [ipldDagCbor.code]
52
52
 
53
53
  canHandle ({ cid, accept, pathDetails }: PluginContext): boolean {
54
- this.log('checking if we can handle %c with accept %s', cid, accept)
55
54
  if (pathDetails == null) {
56
55
  return false
57
56
  }
57
+
58
58
  if (!isObjectNode(pathDetails.terminalElement)) {
59
59
  return false
60
60
  }
61
+
61
62
  if (cid.code !== ipldDagCbor.code) {
62
63
  return false
63
64
  }
@@ -97,7 +98,7 @@ export class DagCborHtmlPreviewPlugin extends BasePlugin {
97
98
  })
98
99
  }
99
100
 
100
- getHtml ({ path, obj, cid }: { path?: string, obj: Record<string, any>, cid: CID }): string {
101
+ getHtml ({ path, obj, cid }: { path?: string[], obj: Record<string, any>, cid: CID }): string {
101
102
  const style = `
102
103
  :root {
103
104
  --sans-serif: "Plex", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
@@ -220,7 +221,7 @@ export class DagCborHtmlPreviewPlugin extends BasePlugin {
220
221
  <main>
221
222
  <header>
222
223
  <div><strong>CID: </strong> <code class="nowrap">${cid}</code></div>
223
- <div><strong>Codec: </strong> ${this.valueHTML('dag-cbor (0x71)', null)}</div>
224
+ <div><strong>Codec: </strong> ${this.valueHTML('dag-cbor (0x71)', [])}</div>
224
225
  </header>
225
226
  <section class="container">
226
227
  <p>You can download this block as:</p>
@@ -241,7 +242,7 @@ export class DagCborHtmlPreviewPlugin extends BasePlugin {
241
242
  </html>`
242
243
  }
243
244
 
244
- valueHTML (value: any, link: string | null): string {
245
+ valueHTML (value: any, link: string[]): string {
245
246
  let valueString: string
246
247
  const isALinkObject = isLink(value)
247
248
  if (!isALinkObject && typeof value !== 'string') {
@@ -258,11 +259,11 @@ export class DagCborHtmlPreviewPlugin extends BasePlugin {
258
259
  return valueCodeBlock
259
260
  }
260
261
 
261
- private renderValue (key: string, value: any, currentPath: string): string {
262
+ private renderValue (key: string, value: any, currentPath: string[]): string {
262
263
  let rows = ''
263
264
  value.forEach((item: any, idx: number) => {
264
- const itemPath = currentPath ? `${currentPath}/${key}/${idx}` : `${key}/${idx}`
265
- rows += `<div>${this.valueHTML(idx, null)}</div>`
265
+ const itemPath = [...currentPath, key, idx.toString()]
266
+ rows += `<div>${this.valueHTML(idx, [])}</div>`
266
267
  if (isPrimitive(item)) {
267
268
  rows += `<div>${this.valueHTML(item, itemPath)}</div>`
268
269
  } else {
@@ -274,7 +275,7 @@ export class DagCborHtmlPreviewPlugin extends BasePlugin {
274
275
  return rows
275
276
  }
276
277
 
277
- renderRows (obj: Record<string, any>, currentPath: string = ''): string {
278
+ renderRows (obj: Record<string, any>, currentPath: string[] = []): string {
278
279
  let rows = ''
279
280
  for (const [key, value] of Object.entries(obj)) {
280
281
  if (Array.isArray(value)) {
@@ -283,7 +284,7 @@ export class DagCborHtmlPreviewPlugin extends BasePlugin {
283
284
  rows += this.renderValue(key, value, currentPath)
284
285
  rows += '</div>'
285
286
  } else {
286
- const valuePath = currentPath ? `${currentPath}/${key}` : key
287
+ const valuePath = [...currentPath, key]
287
288
  rows += `<div>${key}</div><div>${this.valueHTML(value, valuePath)}</div>`
288
289
  }
289
290
  }
@@ -16,16 +16,18 @@ export class DagCborPlugin extends BasePlugin {
16
16
  readonly codes = [ipldDagCbor.code]
17
17
 
18
18
  canHandle ({ cid, accept, pathDetails, byteRangeContext, plugins }: PluginContext): boolean {
19
- this.log('checking if we can handle %c with accept %s', cid, accept)
20
19
  if (pathDetails == null) {
21
20
  return false
22
21
  }
22
+
23
23
  if (!isObjectNode(pathDetails.terminalElement)) {
24
24
  return false
25
25
  }
26
+
26
27
  if (cid.code !== ipldDagCbor.code) {
27
28
  return false
28
29
  }
30
+
29
31
  if (byteRangeContext == null) {
30
32
  return false
31
33
  }
@@ -6,7 +6,7 @@ import { CustomProgressEvent } from 'progress-events'
6
6
  import { getContentType } from '../utils/get-content-type.js'
7
7
  import { getStreamFromAsyncIterable } from '../utils/get-stream-from-async-iterable.js'
8
8
  import { setIpfsRoots } from '../utils/response-headers.js'
9
- import { badGatewayResponse, badRangeResponse, movedPermanentlyResponse, notSupportedResponse, okRangeResponse } from '../utils/responses.js'
9
+ import { badGatewayResponse, badRangeResponse, movedPermanentlyResponse, okRangeResponse } from '../utils/responses.js'
10
10
  import { BasePlugin } from './plugin-base.js'
11
11
  import type { PluginContext } from './types.js'
12
12
  import type { CIDDetail } from '../index.js'
@@ -18,15 +18,21 @@ import type { UnixFSEntry } from 'ipfs-unixfs-exporter'
18
18
  export class DagPbPlugin extends BasePlugin {
19
19
  readonly id = 'dag-pb-plugin'
20
20
  readonly codes = [dagPbCode]
21
+
21
22
  canHandle ({ cid, accept, pathDetails, byteRangeContext }: PluginContext): boolean {
22
- this.log('checking if we can handle %c with accept %s', cid, accept)
23
23
  if (pathDetails == null) {
24
24
  return false
25
25
  }
26
+
26
27
  if (byteRangeContext == null) {
27
28
  return false
28
29
  }
29
30
 
31
+ // TODO: this may be too restrictive?
32
+ if (accept != null && accept.mimeType !== 'application/octet-stream') {
33
+ return false
34
+ }
35
+
30
36
  return cid.code === dagPbCode
31
37
  }
32
38
 
@@ -34,23 +40,25 @@ export class DagPbPlugin extends BasePlugin {
34
40
  * @see https://specs.ipfs.tech/http-gateways/path-gateway/#use-in-directory-url-normalization
35
41
  */
36
42
  getRedirectUrl (context: PluginContext): string | null {
37
- const { resource, path } = context
38
- const redirectCheckNeeded = path === '' ? !resource.toString().endsWith('/') : !path.endsWith('/')
39
- if (redirectCheckNeeded) {
40
- try {
41
- const url = new URL(resource.toString())
42
- if (url.pathname.endsWith('/')) {
43
- // url already has a trailing slash
44
- return null
45
- }
46
- // make sure we append slash to end of the path
47
- url.pathname = `${url.pathname}/`
48
- return url.toString()
49
- } catch (err: any) {
50
- // resource is likely a CID
51
- return `${resource.toString()}/`
52
- }
43
+ const { resource, url, isDirectory } = context
44
+
45
+ let uri: URL
46
+
47
+ try {
48
+ // try the requested resource
49
+ uri = new URL(resource)
50
+ } catch {
51
+ // fall back to the canonical URL
52
+ uri = url
53
+ }
54
+
55
+ // directories must be requested with a trailing slash
56
+ if (isDirectory && !uri.pathname.endsWith('/')) {
57
+ // make sure we append slash to end of the path
58
+ uri.pathname += '/'
59
+ return uri.toString()
53
60
  }
61
+
54
62
  return null
55
63
  }
56
64
 
@@ -59,7 +67,7 @@ export class DagPbPlugin extends BasePlugin {
59
67
  const { contentTypeParser, helia, getBlockstore } = this.pluginOptions
60
68
  const log = this.log
61
69
  let resource = context.resource
62
- let path = context.path
70
+ const path = context.path
63
71
 
64
72
  let redirected = false
65
73
 
@@ -69,8 +77,9 @@ export class DagPbPlugin extends BasePlugin {
69
77
  let resolvedCID = terminalElement.cid
70
78
  const fs = unixfs({ ...helia, blockstore: getBlockstore(context.cid, context.resource, options?.session ?? true, options) })
71
79
 
80
+ context.isDirectory = terminalElement?.type === 'directory'
81
+
72
82
  if (terminalElement?.type === 'directory') {
73
- const dirCid = terminalElement.cid
74
83
  const redirectUrl = this.getRedirectUrl(context)
75
84
 
76
85
  if (redirectUrl != null) {
@@ -89,7 +98,9 @@ export class DagPbPlugin extends BasePlugin {
89
98
  redirected = true
90
99
  }
91
100
 
101
+ const dirCid = terminalElement.cid
92
102
  const rootFilePath = 'index.html'
103
+
93
104
  try {
94
105
  log.trace('found directory at %c/%s, looking for index.html', cid, path)
95
106
 
@@ -99,29 +110,27 @@ export class DagPbPlugin extends BasePlugin {
99
110
  }))
100
111
 
101
112
  log.trace('found root file at %c/%s with cid %c', dirCid, rootFilePath, entry.cid)
102
- path = rootFilePath
103
113
  resolvedCID = entry.cid
104
114
  } catch (err: any) {
105
115
  if (options?.signal?.aborted) {
106
116
  throw new AbortError(options?.signal?.reason)
107
117
  }
108
- this.log.error('error loading path %c/%s', dirCid, rootFilePath, err)
118
+
119
+ this.log.error('error loading path %c/%s - %e', dirCid, rootFilePath, err)
120
+
109
121
  context.isDirectory = true
110
122
  context.directoryEntries = []
111
123
  context.modified++
124
+
112
125
  this.log.trace('attempting to get directory entries because index.html was not found')
113
- try {
114
- for await (const dirItem of fs.ls(dirCid, { signal: options?.signal, onProgress: options?.onProgress, extended: false })) {
115
- context.directoryEntries.push(dirItem)
116
- }
117
- // dir-index-html plugin or dir-index-json (future idea?) plugin should handle this
118
- return null
119
- } catch (e) {
120
- log.error('error listing directory %c', dirCid, e)
121
- return notSupportedResponse('Unable to get directory contents')
126
+ for await (const dirItem of fs.ls(dirCid, { signal: options?.signal, onProgress: options?.onProgress, extended: false })) {
127
+ context.directoryEntries.push(dirItem)
122
128
  }
129
+
130
+ // dir-index-html plugin or dir-index-json (future idea?) plugin should handle this
131
+ return null
123
132
  } finally {
124
- options?.onProgress?.(new CustomProgressEvent<CIDDetail>('verified-fetch:request:end', { cid: dirCid, path: rootFilePath }))
133
+ options?.onProgress?.(new CustomProgressEvent<CIDDetail>('verified-fetch:request:end', { cid: dirCid, path: [rootFilePath] }))
125
134
  }
126
135
  }
127
136
 
@@ -152,13 +161,13 @@ export class DagPbPlugin extends BasePlugin {
152
161
  })
153
162
  log('got async iterator for %c/%s', cid, path)
154
163
 
155
- const streamAndFirstChunk = await context.serverTiming.time('stream-and-chunk', '', getStreamFromAsyncIterable(asyncIter, path ?? '', this.pluginOptions.logger, {
164
+ const streamAndFirstChunk = await context.serverTiming.time('stream-and-chunk', '', getStreamFromAsyncIterable(asyncIter, {
156
165
  onProgress: options?.onProgress,
157
166
  signal: options?.signal
158
167
  }))
159
168
  const stream = streamAndFirstChunk.stream
160
169
  firstChunk = streamAndFirstChunk.firstChunk
161
- contentType = await context.serverTiming.time('get-content-type', '', getContentType({ filename: query.filename, bytes: firstChunk, path, contentTypeParser, log }))
170
+ contentType = await context.serverTiming.time('get-content-type', '', getContentType({ path, filename: query.filename, bytes: firstChunk, contentTypeParser, log }))
162
171
 
163
172
  byteRangeContext.setBody(stream)
164
173
  }
@@ -177,11 +186,14 @@ export class DagPbPlugin extends BasePlugin {
177
186
  if (options?.signal?.aborted) {
178
187
  throw new AbortError(options?.signal?.reason)
179
188
  }
180
- log.error('error streaming %c/%s', cid, path, err)
189
+
190
+ log.error('error streaming %c/%s - %e', cid, path, err)
191
+
181
192
  if (byteRangeContext.isRangeRequest && err.code === 'ERR_INVALID_PARAMS') {
182
193
  return badRangeResponse(resource)
183
194
  }
184
- return badGatewayResponse(resource.toString(), 'Unable to stream content')
195
+
196
+ return badGatewayResponse(resource, 'Unable to stream content')
185
197
  }
186
198
  }
187
199
 
@@ -199,7 +211,7 @@ export class DagPbPlugin extends BasePlugin {
199
211
  length: 8192
200
212
  })
201
213
 
202
- const { firstChunk } = await getStreamFromAsyncIterable(asyncIter, path ?? '', this.pluginOptions.logger, {
214
+ const { firstChunk } = await getStreamFromAsyncIterable(asyncIter, {
203
215
  onProgress: options?.onProgress,
204
216
  signal: options?.signal
205
217
  })
@@ -6,19 +6,24 @@ import { BasePlugin } from './plugin-base.js'
6
6
  import type { PluginContext } from './types.js'
7
7
 
8
8
  /**
9
- * This plugin should almost always run first because it's going to handle path walking if needed, and will only say it can handle
10
- * the request if path walking is possible (path is not empty, terminalCid is unknown, and the path has not been walked yet).
9
+ * This plugin should almost always run first because it's going to handle path
10
+ * walking if needed, and will only say it can handle the request if path
11
+ * walking is possible (path is not empty, terminalCid is unknown, and the path
12
+ * has not been walked yet).
11
13
  *
12
- * Once this plugin has run, the PluginContext will be updated and then this plugin will return false for canHandle, so it won't run again.
14
+ * Once this plugin has run, the PluginContext will be updated and then this
15
+ * plugin will return false for canHandle, so it won't run again.
13
16
  */
14
17
  export class DagWalkPlugin extends BasePlugin {
15
18
  readonly id = 'dag-walk-plugin'
19
+
16
20
  /**
17
- * Return false if the path has already been walked, otherwise return true if the CID is encoded with a codec that supports pathing.
21
+ * Return false if the path has already been walked, otherwise return true if
22
+ * the CID is encoded with a codec that supports pathing.
18
23
  */
19
24
  canHandle (context: PluginContext): boolean {
20
- this.log('checking if we can handle %c with accept %s', context.cid, context.accept)
21
25
  const { pathDetails, cid } = context
26
+
22
27
  if (pathDetails != null) {
23
28
  // path has already been walked
24
29
  return false
@@ -1,7 +1,6 @@
1
1
  import { marshalIPNSRecord } from 'ipns'
2
2
  import { getPeerIdFromString } from '../utils/get-peer-id-from-string.js'
3
3
  import { badRequestResponse, okRangeResponse } from '../utils/responses.js'
4
- import { PluginFatalError } from './errors.js'
5
4
  import { BasePlugin } from './plugin-base.js'
6
5
  import type { PluginContext } from './types.js'
7
6
  import type { PeerId } from '@libp2p/interface'
@@ -13,8 +12,8 @@ import type { PeerId } from '@libp2p/interface'
13
12
  export class IpnsRecordPlugin extends BasePlugin {
14
13
  readonly id = 'ipns-record-plugin'
15
14
  readonly codes = []
16
- canHandle ({ cid, accept, query, byteRangeContext }: PluginContext): boolean {
17
- this.log('checking if we can handle %c with accept %s', cid, accept)
15
+
16
+ canHandle ({ accept, query, byteRangeContext }: PluginContext): boolean {
18
17
  if (byteRangeContext == null) {
19
18
  return false
20
19
  }
@@ -27,15 +26,16 @@ export class IpnsRecordPlugin extends BasePlugin {
27
26
  const { ipnsResolver } = this.pluginOptions
28
27
  context.reqFormat = 'ipns-record'
29
28
 
30
- if (path !== '' || !(resource.startsWith('ipns://') || resource.includes('.ipns.') || resource.includes('/ipns/'))) {
29
+ if (path.length > 0 || !(resource.startsWith('ipns://') || resource.includes('.ipns.') || resource.includes('/ipns/'))) {
31
30
  this.log.error('invalid request for IPNS name "%s" and path "%s"', resource, path)
32
- throw new PluginFatalError('ERR_INVALID_IPNS_NAME', 'Invalid IPNS name', { response: badRequestResponse(resource, new Error('Invalid IPNS name')) })
31
+ return badRequestResponse(resource, new Error('Invalid IPNS name'))
33
32
  }
34
33
 
35
34
  let peerId: PeerId
36
35
 
37
36
  try {
38
37
  let peerIdString: string
38
+
39
39
  if (resource.startsWith('ipns://')) {
40
40
  peerIdString = resource.replace('ipns://', '')
41
41
  } else if (resource.includes('/ipns/')) {
@@ -49,7 +49,7 @@ export class IpnsRecordPlugin extends BasePlugin {
49
49
  } catch (err: any) {
50
50
  this.log.error('could not parse peer id from IPNS url %s', resource, err)
51
51
 
52
- throw new PluginFatalError('ERR_NO_PEER_ID_FOUND', 'could not parse peer id from url', { response: badRequestResponse(resource, err) })
52
+ return badRequestResponse(resource, err)
53
53
  }
54
54
 
55
55
  // force download in handleFinalResponse
@@ -12,8 +12,8 @@ import type { PluginContext } from './types.js'
12
12
  export class JsonPlugin extends BasePlugin {
13
13
  readonly id = 'json-plugin'
14
14
  readonly codes = [ipldDagJson.code, jsonCode]
15
+
15
16
  canHandle ({ cid, accept, byteRangeContext }: PluginContext): boolean {
16
- this.log('checking if we can handle %c with accept %s', cid, accept)
17
17
  if (byteRangeContext == null) {
18
18
  return false
19
19
  }