Commit c3179487 authored by Kunihiko Sakamoto's avatar Kunihiko Sakamoto Committed by Commit Bot

Update remaining spec links for signed-exchanges

This is a follow-up to crrev.com/c/981813.
- Update spec links to the implementation checkpoint
- Use #section-name instead of #rfc.section.numbers as numbers may change
- Remove unused constants from signed_exchange_consts.h

Bug: 803774
Change-Id: I460d580f30275c6a586cee4b1c7540ff80a98791
Reviewed-on: https://chromium-review.googlesource.com/981874Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Reviewed-by: default avatarTsuyoshi Horo <horo@chromium.org>
Commit-Queue: Kunihiko Sakamoto <ksakamoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546056}
parent 58c94e45
...@@ -10,18 +10,14 @@ namespace content { ...@@ -10,18 +10,14 @@ namespace content {
constexpr char kAcceptHeaderSignedExchangeSuffix[] = constexpr char kAcceptHeaderSignedExchangeSuffix[] =
",application/signed-exchange;v=b0"; ",application/signed-exchange;v=b0";
// Field names defined in the application/http-exchange+cbor content type: // Field names defined in the application/signed-exchange content type:
// https://wicg.github.io/webpackage/draft-yasskin-http-origin-signed-responses.html#rfc.section.5 // https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#application-signed-exchange
constexpr char kCertSha256Key[] = "certSha256"; constexpr char kCertSha256Key[] = "certSha256";
constexpr char kDateKey[] = "date"; constexpr char kDateKey[] = "date";
constexpr char kExpiresKey[] = "expires"; constexpr char kExpiresKey[] = "expires";
constexpr char kHeadersKey[] = "headers"; constexpr char kHeadersKey[] = "headers";
constexpr char kHtxg[] = "htxg";
constexpr char kMethodKey[] = ":method"; constexpr char kMethodKey[] = ":method";
constexpr char kPayload[] = "payload";
constexpr char kRequest[] = "request";
constexpr char kResponse[] = "response";
constexpr char kSignature[] = "signature"; constexpr char kSignature[] = "signature";
constexpr char kStatusKey[] = ":status"; constexpr char kStatusKey[] = ":status";
constexpr char kUrlKey[] = ":url"; constexpr char kUrlKey[] = ":url";
......
...@@ -21,7 +21,7 @@ namespace { ...@@ -21,7 +21,7 @@ namespace {
// header field. Stateful header fields will cause validation failure of // header field. Stateful header fields will cause validation failure of
// signed exchanges. // signed exchanges.
// Note that |name| must be lower-cased. // Note that |name| must be lower-cased.
// https://wicg.github.io/webpackage/draft-yasskin-http-origin-signed-responses.html#rfc.section.4.1 // https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#stateful-headers
bool IsStatefulRequestHeader(base::StringPiece name) { bool IsStatefulRequestHeader(base::StringPiece name) {
DCHECK_EQ(name, base::ToLowerASCII(name)); DCHECK_EQ(name, base::ToLowerASCII(name));
......
...@@ -22,7 +22,7 @@ namespace content { ...@@ -22,7 +22,7 @@ namespace content {
// SignedExchangeHeader contains all information captured in signed exchange // SignedExchangeHeader contains all information captured in signed exchange
// envelope but the payload. // envelope but the payload.
// https://wicg.github.io/webpackage/draft-yasskin-http-origin-signed-responses.html // https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html
class CONTENT_EXPORT SignedExchangeHeader { class CONTENT_EXPORT SignedExchangeHeader {
public: public:
static constexpr size_t kEncodedHeaderLengthInBytes = 3; static constexpr size_t kEncodedHeaderLengthInBytes = 3;
...@@ -35,10 +35,10 @@ class CONTENT_EXPORT SignedExchangeHeader { ...@@ -35,10 +35,10 @@ class CONTENT_EXPORT SignedExchangeHeader {
using HeaderMap = std::map<std::string, std::string>; using HeaderMap = std::map<std::string, std::string>;
// Parse headers from the application/signed-exchange;v=b0 format. // Parse headers from the application/signed-exchange;v=b0 format.
// https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#rfc.section.5.3 // https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#application-signed-exchange
// //
// This also performs the step 3 and 4 of "Cross-origin trust" validation. // This also performs the step 3 and 4 of "Cross-origin trust" validation.
// https://wicg.github.io/webpackage/draft-yasskin-http-origin-signed-responses.html#rfc.section.4 // https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#cross-origin-trust
static base::Optional<SignedExchangeHeader> Parse( static base::Optional<SignedExchangeHeader> Parse(
base::span<const uint8_t> input); base::span<const uint8_t> input);
SignedExchangeHeader(); SignedExchangeHeader();
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
namespace content { namespace content {
// Provide parsers for signed-exchange headers. // Provide parsers for signed-exchange headers.
// https://wicg.github.io/webpackage/draft-yasskin-http-origin-signed-responses.html // https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html
class CONTENT_EXPORT SignedExchangeHeaderParser { class CONTENT_EXPORT SignedExchangeHeaderParser {
public: public:
struct CONTENT_EXPORT Signature { struct CONTENT_EXPORT Signature {
...@@ -40,7 +40,7 @@ class CONTENT_EXPORT SignedExchangeHeaderParser { ...@@ -40,7 +40,7 @@ class CONTENT_EXPORT SignedExchangeHeaderParser {
}; };
// Parses a value of the Signature header. // Parses a value of the Signature header.
// https://wicg.github.io/webpackage/draft-yasskin-http-origin-signed-responses.html#rfc.section.3.2 // https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#signature-header
static base::Optional<std::vector<Signature>> ParseSignature( static base::Optional<std::vector<Signature>> ParseSignature(
base::StringPiece signature_str); base::StringPiece signature_str);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment