Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gateway): Block and CAR response formats #8758

Merged
merged 17 commits into from Mar 17, 2022
Merged

Commits on Mar 2, 2022

  1. refactor(gw): move file logic to serveFile func

    one must imagine Sisyphus happy
    lidel committed Mar 2, 2022
    Configuration menu
    Copy the full SHA
    8eb1210 View commit details
    Browse the repository at this point in the history
  2. feat: serveRawBlock implements ?format=block

    This is mvp which reuses http header logic from serveFile, plus custom
    content-disposition to ensure browsers dont render garbage
    lidel committed Mar 2, 2022
    Configuration menu
    Copy the full SHA
    d2f563e View commit details
    Browse the repository at this point in the history

Commits on Mar 3, 2022

  1. feat: serveCar implements ?format=car

    This is PoC implementation that returns CAR as a chunked stream.
    It does not set cache-control nor it has content-length.
    
    TBD if we want/can have these things.
    lidel committed Mar 3, 2022
    Configuration menu
    Copy the full SHA
    e213164 View commit details
    Browse the repository at this point in the history

Commits on Mar 8, 2022

  1. feat(gw): ?format= or Accept HTTP header

    - extracted file-like content type responses to separate .go files
    - Accept HTTP header with support for application/vnd.ipld.* types
      (TBD, we did not register them yet, so for illustration purpose only)
    lidel committed Mar 8, 2022
    Configuration menu
    Copy the full SHA
    9fbfb0b View commit details
    Browse the repository at this point in the history
  2. refactor: unixfs_get_latency_seconds

    Include block and car in unixfs_get_latency_seconds for now,
    so we keep basic visibility into gateway behavior until better metrics
    are added by #8441
    lidel committed Mar 8, 2022
    Configuration menu
    Copy the full SHA
    ee7b0ae View commit details
    Browse the repository at this point in the history

Commits on Mar 9, 2022

  1. test: t0117-gateway-block.sh

    lidel committed Mar 9, 2022
    Configuration menu
    Copy the full SHA
    aed0bf5 View commit details
    Browse the repository at this point in the history
  2. test: t0118-gateway-car.sh

    lidel committed Mar 9, 2022
    Configuration menu
    Copy the full SHA
    43dc5bf View commit details
    Browse the repository at this point in the history
  3. fix: use .bin for raw block content-disposition

    .raw may be handled by something, depending on OS, and .bin
    seems to be universially "binary file" across all systems:
    https://en.wikipedia.org/wiki/List_of_filename_extensions_(A%E2%80%93E)
    lidel committed Mar 9, 2022
    Configuration menu
    Copy the full SHA
    c5b5f34 View commit details
    Browse the repository at this point in the history
  4. docs: docs/gateway.md

    lidel committed Mar 9, 2022
    Configuration menu
    Copy the full SHA
    b45198b View commit details
    Browse the repository at this point in the history
  5. test: t0118-gateway-car/carv1-basic.car

    This test uses official CARv1 fixture from
    https://ipld.io/specs/transport/car/fixture/carv1-basic/
    
    The CAR has two dag-cbor roots, and we use one of them, which represents
    a nice DAG with both dag-cbor, dag-pb and raw blocks
    lidel committed Mar 9, 2022
    Configuration menu
    Copy the full SHA
    17d00ce View commit details
    Browse the repository at this point in the history

Commits on Mar 15, 2022

  1. Configuration menu
    Copy the full SHA
    83fa845 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    84f2b05 View commit details
    Browse the repository at this point in the history
  3. refactor: gateway_handler_unixfs.go

    - Moved UnixFS response handling to gateway_handler_unixfs*.go files.
    - Removed support for X-Ipfs-Gateway-Prefix (Closes #7702)
    lidel committed Mar 15, 2022
    Configuration menu
    Copy the full SHA
    d849115 View commit details
    Browse the repository at this point in the history
  4. fix: exact match Etag

    lidel committed Mar 15, 2022
    Configuration menu
    Copy the full SHA
    26c122e View commit details
    Browse the repository at this point in the history
  5. refactor: prefix cleanup and readable paths

    - removed dead code after X-Ipfs-Gateway-Prefix is gone
      (#7702)
    - escaped special characters in content paths returned with http.Error
      making them both safer and easier to reason about (e.g. when invisible
      whitespace unicode is copied)
    lidel committed Mar 15, 2022
    Configuration menu
    Copy the full SHA
    eb95d2b View commit details
    Browse the repository at this point in the history
  6. refactor: cleanup

    lidel committed Mar 15, 2022
    Configuration menu
    Copy the full SHA
    aae5c28 View commit details
    Browse the repository at this point in the history

Commits on Mar 16, 2022

  1. fix: car response etag matching

    #8758 (comment)
    lidel needs some sleep
    lidel committed Mar 16, 2022
    Configuration menu
    Copy the full SHA
    5b43672 View commit details
    Browse the repository at this point in the history