From b4676dd2d548ba29bc65a009f97dab28083a5989 Mon Sep 17 00:00:00 2001 From: Son Luong Ngoc Date: Thu, 18 Apr 2024 09:01:08 +0200 Subject: [PATCH] remote_asset: link digest_function & checksum qual Ensure that the digest function in requests is consistent with the digest function used in `checksum.sri` qualifier, this way server implementations do not have to support replicating blob from one digest function to another. Such functionality is not the intended use case of Remote Asset APIs and, instead, could be achieved via a different client-side API call. --- build/bazel/remote/asset/v1/remote_asset.proto | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build/bazel/remote/asset/v1/remote_asset.proto b/build/bazel/remote/asset/v1/remote_asset.proto index c896ec40..d2347f3a 100644 --- a/build/bazel/remote/asset/v1/remote_asset.proto +++ b/build/bazel/remote/asset/v1/remote_asset.proto @@ -205,6 +205,8 @@ message FetchBlobRequest { // The digest function the server must use to compute the digest. // // If unset, the server SHOULD default to SHA256. + // If set, the function MUST be the same with the digest function used in + // "checksum.sri", the subresource integrity qualifier. build.bazel.remote.execution.v2.DigestFunction.Value digest_function = 6; } @@ -300,6 +302,8 @@ message FetchDirectoryRequest { // The digest function the server must use to compute the digest. // // If unset, the server SHOULD default to SHA256. + // If set, the function MUST be the same with the digest function used in + // "checksum.sri", the subresource integrity qualifier. build.bazel.remote.execution.v2.DigestFunction.Value digest_function = 6; } @@ -438,6 +442,9 @@ message PushBlobRequest { // that case the server SHOULD infer the digest function using the // length of the action digest hash and the digest functions announced // in the server's capabilities. + // + // If set, the function MUST be the same with the digest function used in + // "checksum.sri", the subresource integrity qualifier. build.bazel.remote.execution.v2.DigestFunction.Value digest_function = 8; } @@ -487,6 +494,9 @@ message PushDirectoryRequest { // that case the server SHOULD infer the digest function using the // length of the action digest hash and the digest functions announced // in the server's capabilities. + // + // If set, the function MUST be the same with the digest function used in + // "checksum.sri", the subresource integrity qualifier. build.bazel.remote.execution.v2.DigestFunction.Value digest_function = 8; }