Skip to content

Instantly share code, notes, and snippets.

@galargh
Created February 2, 2023 13:15
Show Gist options
  • Save galargh/74f2ecaf9da2f590756785694719566c to your computer and use it in GitHub Desktop.
Save galargh/74f2ecaf9da2f590756785694719566c to your computer and use it in GitHub Desktop.
ipfs/kubo/test/sharness/*gateway*.sh

Existing Gateway Tests

Test HTTP Gateway _redirects support

Timeline

  1. Init IPFS
  2. Launch IPFS Daemon
  3. Add the _redirects file test directory
  4. request for $REDIRECTS_DIR_HOSTNAME/redirect-one redirects with default of 301, per _redirects file
  5. request for $REDIRECTS_DIR_HOSTNAME/301-redirect-one redirects with 301, per _redirects file
  6. request for $REDIRECTS_DIR_HOSTNAME/302-redirect-two redirects with 302, per _redirects file
  7. request for $REDIRECTS_DIR_HOSTNAME/200-index returns 200, per _redirects file
  8. request for $REDIRECTS_DIR_HOSTNAME/posts/:year/:month/:day/:title redirects with 301 and placeholders, per _redirects file
  9. request for $REDIRECTS_DIR_HOSTNAME/splat/one.html redirects with 301 and splat placeholder, per _redirects file
  10. request for $REDIRECTS_DIR_HOSTNAME/not-found/has-no-redirects-entry returns custom 404, per _redirects file
  11. request for $REDIRECTS_DIR_HOSTNAME/gone/has-no-redirects-entry returns custom 410, per _redirects file
  12. request for $REDIRECTS_DIR_HOSTNAME/unavail/has-no-redirects-entry returns custom 451, per _redirects file
  13. request for $REDIRECTS_DIR_HOSTNAME/catch-all returns 200, per _redirects file
  14. request for http://127.0.0.1:$GWAY_PORT/ipfs/$REDIRECTS_DIR_CID/301-redirect-one returns generic 404 (no custom 404 from _redirects since no origin isolation)
  15. newline: _redirects has CRLF line terminators
  16. newline: request for $NEWLINE_REDIRECTS_DIR_HOSTNAME/redirect-one redirects with default of 301, per _redirects file
  17. good codes: request for $GOOD_REDIRECTS_DIR_HOSTNAME/redirect-one redirects with default of 301, per _redirects file
  18. bad codes: request for $BAD_REDIRECTS_DIR_HOSTNAME/not-found returns error about bad code
  19. bad codes: request for $BAD_REDIRECTS_DIR_HOSTNAME/found.html doesn't return error about bad code
  20. invalid file: request for $INVALID_REDIRECTS_DIR_HOSTNAME/not-found returns error about invalid redirects file
  21. invalid file: request for $INVALID_REDIRECTS_DIR_HOSTNAME/not-found returns error about invalid redirects file
  22. invalid file: request for $TOO_LARGE_REDIRECTS_DIR_HOSTNAME/not-found returns error about too large redirects file
  23. Restart IPFS Daemon
  24. spoofed DNSLink record resolves in cli
  25. request for $DNSLINK_FQDN/redirect-one redirects with default of 301, per _redirects file
  26. request for $DNSLINK_FQDN/en/has-no-redirects-entry returns custom 404, per _redirects file
  27. request for $NO_DNSLINK_FQDN/redirect-one does not redirect, since DNSLink is disabled
  28. Kill IPFS Daemon

Notes

  • requires CAR file import
  • checks if import didn't modify the newlines
  • reconfigures the gateway DNSLink settings

Test HTTP Gateway (Writable)

Timeline

  1. Init IPFS
  2. Launch IPFS Daemon --writable
  3. ipfs daemon --writable overrides config
  4. Kill IPFS Daemon
  5. prepare config -- gateway writable
  6. Launch IPFS Daemon --writable=false
  7. ipfs daemon --writable=false overrides Writable=true config
  8. Restart IPFS Daemon
  9. ipfs daemon up
  10. deprecation notice is printed when Gateway.Writable=true
  11. HTTP gateway gives access to sample file
  12. HTTP POST file gives Hash
  13. We can HTTP GET file just created
  14. We got the correct hash
  15. HTTP GET empty directory
  16. HTTP PUT file to construct a hierarchy
  17. We can HTTP GET file just created
  18. HTTP PUT file to append to existing hierarchy
  19. We can HTTP GET file just updated
  20. HTTP PUT to replace a directory
  21. We can HTTP GET file just put over a directory
  22. HTTP PUT to /ipns fails
  23. Kill IPFS Daemon

Notes

  • reconfigures the gateway writable settings first
  • is self-sufficient in a sense that it can create assets it verifies itself

Test CORS behavior on Gateway port

Timeline

  1. Init IPFS
  2. Default Gateway.HTTPHeaders config match expected values
  3. Launch IPFS Daemon
  4. GET to Gateway succeeds
  5. GET response for Gateway resource looks good
  6. OPTIONS to Gateway succeeds
  7. OPTIONS response for Gateway resource looks good
  8. Kill IPFS Daemon
  9. Can configure gateway headers
  10. Launch IPFS Daemon
  11. OPTIONS to Gateway without custom headers succeeds
  12. Access-Control-Allow-Headers extends the implicit list
  13. OPTIONS to Gateway with a custom header succeeds
  14. Access-Control-Allow-Headers extends the implicit list
  15. Access-Control-Allow-Origin replaces the implicit list
  16. Assert the default API.HTTPHeaders config is empty
  17. Default CORS GET to {gw}/api/v0
  18. Default CORS GET response from {gw}/api/v0 is 403 Forbidden and has no CORS headers
  19. Default OPTIONS to {gw}/api/v0
  20. OPTIONS response from {gw}/api/v0 has no CORS header
  21. Kill IPFS Daemon
  22. Manually set API.HTTPHeaders config to be as relaxed as Gateway.HTTPHeaders
  23. Launch IPFS Daemon
  24. Manually relaxed CORS GET to {gw}/api/v0
  25. Manually relaxed CORS GET response from {gw}/api/v0 is the same as Gateway
  26. Manually relaxed OPTIONS to {gw}/api/v0
  27. Manually relaxed OPTIONS response from {gw}/api/v0 is the same as Gateway
  28. Kill IPFS Daemon

Notes

  • queries preexisting hello file
  • reconfigures the gateway headers settings
  • sets Origin header

Test symlink support on the HTTP gateway

Timeline

  1. Init IPFS
  2. Launch IPFS Daemon
  3. Create a test directory with symlinks
  4. Add the test directory
  5. Test the directory listing
  6. Test the symlink
  7. Kill IPFS Daemon

Notes

  • requires adding a directory with symlinks first

Test subdomain support on the HTTP gateway

Timeline

  1. Init IPFS
  2. Launch IPFS Daemon without network
  3. Add test text file
  4. Add the test directory
  5. Publish test text file to IPNS using RSA keys
  6. Publish test text file to IPNS using ED25519 keys
  7. start daemon with empty config for Gateway.PublicGateways
  8. request for 127.0.0.1/ipfs/{CID} stays on path
  9. request for localhost/ipfs/{CIDv1} returns HTTP 301 Moved Permanently
  10. request for localhost/ipfs/{CIDv1} returns Location HTTP header for subdomain redirect in browsers
  11. request for localhost/ipfs/{DIR_CID} returns HTTP 301 Moved Permanently
  12. request for localhost/ipfs/{DIR_CID} returns Location HTTP header for subdomain redirect in browsers
  13. request for localhost/ipfs/{CIDv1} includes valid payload in body for CLI tools like curl
  14. request for localhost/ipfs/{CIDv0} redirects to CIDv1 representation in subdomain
  15. request for localhost/ipns/{CIDv0} redirects to CIDv1 with libp2p-key multicodec in subdomain
  16. request for localhost/ipns/{CIDv0} redirects to CIDv1 with libp2p-key multicodec in subdomain
  17. request for localhost/ipns/{fqdn} redirects to DNSLink in subdomain
  18. request for localhost/api
  19. request for {cid}.ipfs.localhost/api returns data if present on the content root
  20. request for {cid}.ipfs.localhost/api/v0/refs returns 404
  21. request for {CID}.ipfs.localhost should return expected payload
  22. request for {CID}.ipfs.localhost/ipfs/{CID} should return HTTP 404
  23. request for {CID}.ipfs.localhost/ipfs/file.txt should return data from a file in CID content root
  24. valid file and subdirectory paths in directory listing at {cid}.ipfs.localhost
  25. valid parent directory path in directory listing at {cid}.ipfs.localhost/sub/dir
  26. request for deep path resource at {cid}.ipfs.localhost/sub/dir/file
  27. request for {CIDv1-libp2p-key}.ipns.localhost returns expected payload
  28. request for {CIDv1-libp2p-key}.ipns.localhost returns expected payload
  29. localhost request for {CIDv1-dag-pb}.ipns.localhost redirects to CID with libp2p-key multicodec
  30. localhost request for {CIDv1-dag-pb}.ipns.localhost redirects to CID with libp2p-key multicodec
  31. Restart IPFS Daemon
  32. request for {dnslink}.ipns.localhost returns expected payload
  33. request for api.localhost returns API response
  34. Restart IPFS Daemon without network
  35. request for localhost/ipns/{fqdn} redirects to DNSLink in subdomain with DNS inlining
  36. request for example.com/ipns/{fqdn} redirects to DNSLink in subdomain with DNS inlining
  37. Restart IPFS Daemon without network
  38. request for example.com/ipfs/{CIDv1} produces redirect to {CIDv1}.ipfs.example.com
  39. request for example.com/ipfs/{InvalidCID} produces useful error before redirect
  40. request for example.com/ipfs/{CIDv0} produces redirect to {CIDv1}.ipfs.example.com
  41. request for http://example.com/ipfs/{CID} with X-Forwarded-Proto: https produces redirect to HTTPS URL
  42. request for example.com/ipfs/?uri=ipfs%3A%2F%2F.. produces redirect to /ipfs/.. content path
  43. request for example.com/ipns/{CIDv0} redirects to CIDv1 with libp2p-key multicodec in subdomain
  44. request for example.com/ipns/{CIDv0} redirects to CIDv1 with libp2p-key multicodec in subdomain
  45. request for example.com/ipns/{fqdn} redirects to DNSLink in subdomain
  46. request for example.com/ipns/{fqdn} with X-Forwarded-Proto redirects to TLS-safe label in subdomain
  47. request for example.com/ipns/?uri=ipns%3A%2F%2F.. produces redirect to /ipns/.. content path
  48. request for {CID}.ipfs.example.com should return expected payload
  49. request for {CID}.ipfs.example.com/ipfs/{CID} should return HTTP 404
  50. valid file and directory paths in directory listing at {cid}.ipfs.example.com
  51. valid parent directory path in directory listing at {cid}.ipfs.example.com/sub/dir
  52. valid breadcrumb links in the header of directory listing at {cid}.ipfs.example.com/sub/dir
  53. request for deep path resource {cid}.ipfs.example.com/sub/dir/file
  54. request for {CIDv1-libp2p-key}.ipns.example.com returns expected payload
  55. request for {CIDv1-libp2p-key}.ipns.example.com returns expected payload
  56. hostname request for {CIDv1-dag-pb}.ipns.localhost redirects to CID with libp2p-key multicodec
  57. hostname request for {CIDv1-dag-pb}.ipns.localhost redirects to CID with libp2p-key multicodec
  58. request for example.com/api/v0/refs returns expected payload when /api is on Paths whitelist
  59. request for {cid}.ipfs.example.com/api returns data if present on the content root
  60. request for {cid}.ipfs.example.com/api/v0/refs returns 404
  61. Restart IPFS Daemon without network
  62. request for example.com/api/v0/refs returns 404 if /api not on Paths whitelist
  63. request for {cid}.ipfs.example.com/api returns data if present on the content root
  64. Restart IPFS Daemon
  65. request for {dnslink}.ipns.example.com returns expected payload
  66. request for {single-label-dnslink}.ipns.example.com with X-Forwarded-Proto returns expected payload
  67. request for a ED25519 libp2p-key at localhost/ipns/{b58mh} returns Location HTTP header for DNS-safe subdomain redirect in browsers
  68. request for a too long CID at localhost/ipfs/{CIDv1} returns human readable error
  69. request for a too long CID at localhost/ipfs/{CIDv1} returns HTTP Error 400 Bad Request
  70. request for a too long CID at {CIDv1}.ipfs.localhost returns expected payload
  71. request for a ED25519 libp2p-key at example.com/ipns/{b58mh} returns Location HTTP header for DNS-safe subdomain redirect in browsers
  72. request for a too long CID at example.com/ipfs/{CIDv1} returns human readable error
  73. request for a too long CID at example.com/ipfs/{CIDv1} returns HTTP Error 400 Bad Request
  74. request for a too long CID at {CIDv1}.ipfs.example.com returns HTTP Error 400 Bad Request
  75. Restart IPFS Daemon without network
  76. request for *.ipns.example.com returns HTTP 404 Not Found when /ipns is not on Paths whitelist
  77. request for *.ipns.example.com returns HTTP 404 Not Found when /ipns is not on Paths whitelist
  78. Restart IPFS Daemon without network
  79. request for example.com/ipfs/{CIDv1} returns expected payload
  80. request for {CID}.ipfs.example.com/ipfs/{CID} should return HTTP 404 Not Found
  81. request for example.com/ipns/ returns HTTP 404 Not Found when /ipns is not on Paths whitelist
  82. request for example.com/ipns/ returns HTTP 404 Not Found when /ipns is not on Paths whitelist
  83. Restart IPFS Daemon
  84. spoofed DNSLink record resolves in cli
  85. request for http://{dnslink-fqdn}/ PublicGateway returns expected payload
  86. request for {dnslink-fqdn}/ipfs/{cid} returns expected payload when /ipfs is on Paths whitelist
  87. request for {dnslink-fqdn}/ipfs/file.txt returns data from content root when /ipfs in not on Paths whitelist
  88. request for {dnslink-fqdn}/ipns/{peerid} returns 404 when path is not whitelisted
  89. request for {dnslink-fqdn}/ipns/{peerid} returns 404 when path is not whitelisted
  90. request for http://{dnslink-fqdn}/ returns 404 when NoDNSLink=true
  91. request for {dnslink-fqdn}/ipfs/{cid} returns 404 when path is not whitelisted
  92. Restart IPFS Daemon
  93. spoofed DNSLink record resolves in cli
  94. request for http://{dnslink-fqdn}/ (wildcard) returns expected payload
  95. Restart IPFS Daemon without network
  96. request for http://fake.domain.com/ipfs/{CID} doesn't match the example.com gateway
  97. request for http://fake.domain.com/ipfs/{CID} with X-Forwarded-Host: example.com match the example.com gateway
  98. request for http://fake.domain.com/ipfs/{CID} with X-Forwarded-Host: example.com and X-Forwarded-Proto: https match the example.com gateway, redirect with https
  99. Restart IPFS Daemon without network
  100. request for foo.example1.com/ipfs/{CIDv1} produces redirect to {CIDv1}.ipfs.foo.example1.com
  101. request for {CID}.ipfs.foo.example1.com should return expected payload
  102. request for foo.bar.example2.com/ipfs/{CIDv1} produces redirect to {CIDv1}.ipfs.foo.bar.example2.com
  103. request for {CID}.ipfs.foo.bar.example2.com should return expected payload
  104. request for foo.bar.example3.com/ipfs/{CIDv1} produces redirect to {CIDv1}.ipfs.foo.bar.example3.com
  105. request for {CID}.ipfs.foo.bar.example3.com should return expected payload
  106. request for foo.bar-dev-boo.example4.com/ipfs/{CIDv1} produces redirect to {CIDv1}.ipfs.foo.bar-dev-boo.example4.com
  107. request for {CID}.ipfs.foo.bar-dev-boo.example4.com should return expected payload
  108. Restart IPFS Daemon without network
  109. request for localhost/ipfs/{CID} stays on path when subdomain gw is explicitly disabled
  110. Kill IPFS Daemon

Notes

  • requires adding files with different CID versions
  • requires adding directory first
  • requires IPNS publishing
  • reconfigures IPFS with different gateway configs

Test directory listing (dir-index-html) on the HTTP gateway

Timeline

  1. Init IPFS
  2. Launch IPFS Daemon without network
  3. Add the test directory
  4. path gw: backlink on root CID should be hidden
  5. path gw: redirect dir listing to URL with trailing slash
  6. path gw: Etag should be present
  7. path gw: breadcrumbs should point at /ipfs namespace mounted at Origin root
  8. path gw: backlink on subdirectory should point at parent directory
  9. path gw: name column should be a link to its content path
  10. path gw: hash column should be a CID link with filename param
  11. subdomain gw: backlink on root CID should be hidden
  12. subdomain gw: redirect dir listing to URL with trailing slash
  13. subdomain gw: Etag should be present
  14. subdomain gw: backlink on subdirectory should point at parent directory
  15. subdomain gw: breadcrumbs should leverage path-based router mounted on the parent domain
  16. subdomain gw: name column should be a link to content root mounted at subdomain origin
  17. subdomain gw: hash column should be a CID link to path router with filename param
  18. Restart IPFS Daemon
  19. dnslink gw: backlink on root CID should be hidden
  20. dnslink gw: redirect dir listing to URL with trailing slash
  21. dnslink gw: Etag should be present
  22. dnslink gw: backlink on subdirectory should point at parent directory
  23. dnslink gw: breadcrumbs should point at content root mounted at dnslink origin
  24. dnslink gw: name column should be a link to content root mounted at dnslink origin
  25. dnslink gw: hash column should be a CID link to cid.ipfs.tech
  26. Kill IPFS Daemon

Notes

  • requires adding multiple directories first
  • tests offline and online modes

Test HTTP Gateway Cache Control Support

Timeline

  1. Init IPFS
  2. Launch IPFS Daemon without network
  3. Add the test directory
  4. Prepare IPNS unixfs content path for testing
  5. GET for /ipfs/ unixfs dir listing succeeds
  6. GET for /ipfs/ unixfs dir with index.html succeeds
  7. GET for /ipfs/ unixfs file succeeds
  8. GET for /ipfs/ unixfs dir as DAG-JSON succeeds
  9. GET for /ipns/ unixfs dir listing succeeds
  10. GET for /ipns/ unixfs dir with index.html succeeds
  11. GET for /ipns/ unixfs file succeeds
  12. GET for /ipns/ unixfs dir as DAG-JSON succeeds
  13. GET /ipfs/ unixfs file has expected Cache-Control
  14. GET /ipfs/ unixfs dir listing has no Cache-Control
  15. GET /ipfs/ unixfs dir with index.html has expected Cache-Control
  16. GET /ipfs/ dag-json has expected Cache-Control
  17. GET /ipfs/ unixfs dir as json has expected Cache-Control
  18. GET /ipns/ unixfs file has no Cache-Control
  19. GET /ipns/ unixfs dir listing has no Cache-Control
  20. GET /ipns/ unixfs dir with index.html has no Cache-Control
  21. GET /ipns/ unixfs dir as dag-json has no Cache-Control
  22. GET /ipns/ unixfs dir as json has no Cache-Control
  23. HEAD for /ipfs/ with only-if-cached succeeds when in local datastore
  24. HEAD for /ipfs/ with only-if-cached fails when not in local datastore
  25. GET for /ipfs/ with only-if-cached succeeds when in local datastore
  26. GET for /ipfs/ with only-if-cached fails when not in local datastore
  27. GET /ipfs/ dir listing response has original content path in X-Ipfs-Path
  28. GET /ipns/ dir listing response has original content path in X-Ipfs-Path
  29. GET /ipfs/ dir index.html response has original content path in X-Ipfs-Path
  30. GET /ipns/ dir index.html response has original content path in X-Ipfs-Path
  31. GET /ipfs/ file response has original content path in X-Ipfs-Path
  32. GET /ipns/ file response has original content path in X-Ipfs-Path
  33. GET /ipfs/ dir listing response has logical CID roots in X-Ipfs-Roots
  34. GET /ipns/ dir listing response has logical CID roots in X-Ipfs-Roots
  35. GET /ipfs/ dir index.html response has logical CID roots in X-Ipfs-Roots
  36. GET /ipns/ dir index.html response has logical CID roots in X-Ipfs-Roots
  37. GET /ipfs/ file response has logical CID roots in X-Ipfs-Roots
  38. GET /ipns/ file response has logical CID roots in X-Ipfs-Roots
  39. GET /ipfs/ dir response has special Etag for generated dir listing
  40. GET /ipns/ dir response has special Etag for generated dir listing
  41. GET /ipfs/ dir index.html response has dir CID as Etag
  42. GET /ipns/ dir index.html response has dir CID as Etag
  43. GET /ipfs/ response has CID as Etag for a file
  44. GET /ipns/ response has CID as Etag for a file
  45. GET for /ipfs/ file with matching Etag in If-None-Match returns 304 Not Modified
  46. GET for /ipfs/ dir with index.html file with matching Etag in If-None-Match returns 304 Not Modified
  47. GET for /ipfs/ file with matching third Etag in If-None-Match returns 304 Not Modified
  48. GET for /ipfs/ file with matching weak Etag in If-None-Match returns 304 Not Modified
  49. GET for /ipfs/ file with wildcard Etag in If-None-Match returns 304 Not Modified
  50. GET for /ipns/ file with matching Etag in If-None-Match returns 304 Not Modified
  51. GET for /ipfs/ dir listing with matching weak Etag in If-None-Match returns 304 Not Modified
  52. GET for /ipfs/ dir listing with matching strong Etag in If-None-Match returns 304 Not Modified
  53. GET for /ipfs/ dir listing with matching weak Etag in If-None-Match returns 304 Not Modified
  54. Kill IPFS Daemon

Notes

  • requires adding a directory first

Test HTTP Gateway Raw Block (application/vnd.ipld.raw) Support

Timeline

  1. Init IPFS
  2. Launch IPFS Daemon without network
  3. Create text fixtures
  4. GET with format=raw param returns a raw block
  5. GET for application/vnd.ipld.raw returns a raw block
  6. GET response for application/vnd.ipld.raw has expected Content-Type
  7. GET response for application/vnd.ipld.raw includes Content-Length
  8. GET response for application/vnd.ipld.raw includes Content-Disposition
  9. GET response for application/vnd.ipld.raw includes nosniff hint
  10. GET for application/vnd.ipld.raw with query filename includes Content-Disposition with custom filename
  11. GET response for application/vnd.ipld.raw includes Etag
  12. GET response for application/vnd.ipld.raw includes X-Ipfs-Path and X-Ipfs-Roots
  13. GET response for application/vnd.ipld.raw includes Cache-Control
  14. Kill IPFS Daemon

Notes

  • requires adding a directory first

Test HTTP Gateway CAR (application/vnd.ipld.car) Support

Timeline

  1. Init IPFS
  2. Launch IPFS Daemon without network
  3. Create a deterministic CAR for testing
  4. GET for application/vnd.ipld.car with dag-cbor root returns a CARv1 stream with full DAG
  5. GET with format=car param returns a CARv1 stream
  6. GET for application/vnd.ipld.car returns a CARv1 stream
  7. GET for application/vnd.ipld.raw version=1 returns a CARv1 stream
  8. GET for application/vnd.ipld.raw version=1 returns a CARv1 stream (with whitespace)
  9. GET for application/vnd.ipld.raw version=2 returns HTTP 400 Bad Request error
  10. GET for application/vnd.ipld.car with unixfs dir returns a CARv1 stream with full DAG
  11. GET response for application/vnd.ipld.car has expected Content-Type
  12. GET response for application/vnd.ipld.car includes no Content-Length
  13. GET response for application/vnd.ipld.car includes Content-Disposition
  14. GET response for application/vnd.ipld.car includes nosniff hint
  15. GET response for application/vnd.ipld.car includes Accept-Ranges header
  16. GET for application/vnd.ipld.car with query filename includes Content-Disposition with custom filename
  17. GET response for application/vnd.ipld.car includes a weak Etag
  18. GET response for application/vnd.ipld.car includes X-Ipfs-Path and X-Ipfs-Roots
  19. GET response for application/vnd.ipld.car includes same Cache-Control as a block or a file
  20. Kill IPFS Daemon

Notes

  • requires car import
  • uses car import/stat to verify gateway response

Test HTTP Gateway TAR (application/x-tar) Support

Timeline

  1. Init IPFS
  2. Launch IPFS Daemon without network
  3. Add the test directory
  4. GET TAR with format=tar and extract
  5. GET TAR with 'Accept: application/x-tar' and extract
  6. GET TAR with format=tar has expected Content-Type
  7. GET TAR with 'Accept: application/x-tar' has expected Content-Type
  8. GET TAR has expected root file
  9. GET TAR has expected root directory
  10. GET TAR with explicit ?filename= succeeds with modified Content-Disposition header
  11. Add CARs with relative paths to test with
  12. GET TAR with relative paths outside root fails
  13. GET TAR with relative paths inside root works
  14. Kill IPFS Daemon

Notes

  • requires adding a directory first
  • requires car import

Test HTTP Gateway DAG-JSON (application/vnd.ipld.dag-json) and DAG-CBOR (application/vnd.ipld.dag-cbor) Support

Timeline

  1. Init IPFS
  2. Launch IPFS Daemon without network
  3. Add the test directory
  4. GET UnixFS file with JSON bytes is returned with application/json Content-Type
  5. test_dag_pb_conversion "DAG-JSON" "json" "inline"
  6. test_dag_pb_conversion "DAG-CBOR" "cbor" "attachment"
  7. test_plain_codec "plain JSON codec" "json" "inline"
  8. test_plain_codec "plain CBOR codec" "cbor" "attachment"
  9. Add CARs for path traversal and DAG-PB representation tests
  10. GET DAG-JSON traversal returns 501 if there is path remainder
  11. GET DAG-JSON traverses multiple links
  12. GET DAG-CBOR traversal returns 501 if there is path remainder
  13. GET DAG-CBOR traverses multiple links
  14. test_native_dag "DAG-JSON" "json" "inline" "$DAG_JSON_TRAVERSAL_CID"
  15. test_native_dag "DAG-CBOR" "cbor" "attachment" "$DAG_CBOR_TRAVERSAL_CID"
  16. Kill IPFS Daemon

Notes

  • requires adding a directory first
  • compares ipfs commands output with gateway responses, like ipfs dag get
  • requires car import

Test HTTP Gateway IPNS Record (application/vnd.ipfs.ipns-record) Support

Timeline

  1. Init IPFS
  2. Launch IPFS Daemon
  3. Create and Publish IPNS Key
  4. GET KEY with format=ipns-record and validate key
  5. GET KEY with 'Accept: application/vnd.ipfs.ipns-record' and validate key
  6. GET KEY with format=ipns-record has expected HTTP headers
  7. GET KEY with 'Accept: application/vnd.ipfs.ipns-record' has expected HTTP headers
  8. GET KEY with expliciy ?filename= succeeds with modified Content-Disposition header
  9. Kill IPFS Daemon

Notes

  • requires publishing IPNS key first
  • uses ipfs name inspect --verify to validate gateway response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment