From b94f597f3f88c86f41733d8151cad478c413bf4e Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Wed, 17 Apr 2024 10:37:14 +0200 Subject: [PATCH 1/2] gateway: car-* request query parameters --- src/http-gateways/path-gateway.md | 12 ++++++++++++ src/http-gateways/trustless-gateway.md | 15 +++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/http-gateways/path-gateway.md b/src/http-gateways/path-gateway.md index f024fcab..a73e16e7 100644 --- a/src/http-gateways/path-gateway.md +++ b/src/http-gateways/path-gateway.md @@ -260,6 +260,18 @@ Only used on CAR requests, same as :ref[dag-scope] from :cite[trustless-gateway] Only used on CAR requests, same as :ref[entity-bytes] from :cite[trustless-gateway]. +### `car-version` (request query parameter) + +Only used on CAR requests, same as :ref[car-version] from :cite[trustless-gateway]. + +### `car-order` (request query parameter) + +Only used on CAR requests, same as :ref[car-order] from :cite[trustless-gateway]. + +### `car-dups` (request query parameter) + +Only used on CAR requests, same as :ref[car-dups] from :cite[trustless-gateway]. + # HTTP Response ## Response Status Codes diff --git a/src/http-gateways/trustless-gateway.md b/src/http-gateways/trustless-gateway.md index eaa59f5c..51b238f4 100644 --- a/src/http-gateways/trustless-gateway.md +++ b/src/http-gateways/trustless-gateway.md @@ -194,6 +194,21 @@ returned: returned to the client, the HTTP status code has already been sent to the client. +### :dfn[`car-version`] (request query parameter) + +Only used on CAR requests, it is the same as [CAR version](#car-version) content +type parameter. In case both are present, the value in the HTTP Header has priority. + +### :dfn[`car-order`] (request query parameter) + +Only used on CAR requests, it is the same as [CAR `order`](#car-order-content-type-parameter) +content type parameter. In case both are present, the value in the HTTP Header has priority. + +### :dfn[`car-dups`] (request query parameter) + +Only used on CAR requests, it is the same as [CAR `dups`](#car-dups-content-type-parameter) +content type parameter. In case both are present, the value in the HTTP Header has priority. + # HTTP Response Below MUST be implemented **in addition** to "HTTP Response" of :cite[path-gateway]. From 1defdd3f1df8512a96f5a2e84f9083584417c2bc Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Wed, 17 Apr 2024 22:01:42 +0200 Subject: [PATCH 2/2] gateway: car params and Content-Location --- src/http-gateways/path-gateway.md | 10 +++++----- src/http-gateways/trustless-gateway.md | 23 ++++++++++++++++------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/http-gateways/path-gateway.md b/src/http-gateways/path-gateway.md index a73e16e7..ca89bb61 100644 --- a/src/http-gateways/path-gateway.md +++ b/src/http-gateways/path-gateway.md @@ -254,23 +254,23 @@ A Gateway SHOULD include the ### `dag-scope` (request query parameter) -Only used on CAR requests, same as :ref[dag-scope] from :cite[trustless-gateway]. +Optional, can be used to limit the scope of verifiable DAG requests such as CAR, same as :ref[dag-scope] from :cite[trustless-gateway]. ### `entity-bytes` (request query parameter) -Only used on CAR requests, same as :ref[entity-bytes] from :cite[trustless-gateway]. +Optional, can be used to limit the scope of verifiable DAG requests such as CAR, same as :ref[entity-bytes] from :cite[trustless-gateway]. ### `car-version` (request query parameter) -Only used on CAR requests, same as :ref[car-version] from :cite[trustless-gateway]. +Optional, specific to CAR requests, same as :ref[car-version] from :cite[trustless-gateway]. ### `car-order` (request query parameter) -Only used on CAR requests, same as :ref[car-order] from :cite[trustless-gateway]. +Optional, specific to CAR requests, same as :ref[car-order] from :cite[trustless-gateway]. ### `car-dups` (request query parameter) -Only used on CAR requests, same as :ref[car-dups] from :cite[trustless-gateway]. +Optional, specific to CAR requests, same as :ref[car-dups] from :cite[trustless-gateway]. # HTTP Response diff --git a/src/http-gateways/trustless-gateway.md b/src/http-gateways/trustless-gateway.md index 51b238f4..4e728d5d 100644 --- a/src/http-gateways/trustless-gateway.md +++ b/src/http-gateways/trustless-gateway.md @@ -196,18 +196,27 @@ returned: ### :dfn[`car-version`] (request query parameter) -Only used on CAR requests, it is the same as [CAR version](#car-version) content -type parameter. In case both are present, the value in the HTTP Header has priority. +Optional, only used on CAR requests. + +Serves same purpose as [CAR `version` content type parameter](#car-version-content-type-parameter). + +In case both are present in the request, the value from the [`Accept`](#accept-request-header) HTTP Header has priority and a matching [`Content-Location`](#content-location-response-header) SHOULD be returned with the response. ### :dfn[`car-order`] (request query parameter) -Only used on CAR requests, it is the same as [CAR `order`](#car-order-content-type-parameter) -content type parameter. In case both are present, the value in the HTTP Header has priority. +Optional, only used on CAR requests. + +Serves same purpose as [CAR `order` content type parameter](#car-order-content-type-parameter). + +In case both are present in the request, the value from the [`Accept`](#accept-request-header) HTTP Header has priority and a matching [`Content-Location`](#content-location-response-header) SHOULD be returned with the response. ### :dfn[`car-dups`] (request query parameter) -Only used on CAR requests, it is the same as [CAR `dups`](#car-dups-content-type-parameter) -content type parameter. In case both are present, the value in the HTTP Header has priority. +Optional, only used on CAR requests. + +Serves same purpose as [CAR `dups` content type parameter](#car-dups-content-type-parameter). + +In case both are present in the request, the value from the [`Accept`](#accept-request-header) HTTP Header has priority and a matching [`Content-Location`](#content-location-response-header) SHOULD be returned with the response. # HTTP Response @@ -249,7 +258,7 @@ A CAR stream for the requested content type (with optional `order` and `dups` params), path and optional `dag-scope` and `entity-bytes` URL parameters. -## CAR version (content type parameter) +## CAR `version` (content type parameter) Value returned in [`CarV1Header.version`](https://ipld.io/specs/transport/car/carv1/#header)