diff --git a/containerz/containerz.pb.go b/containerz/containerz.pb.go index 9a4425dc..90cb483b 100644 --- a/containerz/containerz.pb.go +++ b/containerz/containerz.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 -// protoc v6.33.4 +// protoc v6.33.1 // source: github.com/openconfig/gnoi/containerz/containerz.proto package containerz @@ -430,14 +430,16 @@ func (*DeployRequest_Content) isDeployRequest_Request() {} func (*DeployRequest_ImageTransferEnd) isDeployRequest_Request() {} type ImageTransfer struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Tag string `protobuf:"bytes,2,opt,name=tag,proto3" json:"tag,omitempty"` - ImageSize uint64 `protobuf:"varint,3,opt,name=image_size,json=imageSize,proto3" json:"image_size,omitempty"` - RemoteDownload *common.RemoteDownload `protobuf:"bytes,4,opt,name=remote_download,json=remoteDownload,proto3" json:"remote_download,omitempty"` - IsPlugin bool `protobuf:"varint,5,opt,name=is_plugin,json=isPlugin,proto3" json:"is_plugin,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Tag string `protobuf:"bytes,2,opt,name=tag,proto3" json:"tag,omitempty"` + ImageSize uint64 `protobuf:"varint,3,opt,name=image_size,json=imageSize,proto3" json:"image_size,omitempty"` + RemoteDownload *common.RemoteDownload `protobuf:"bytes,4,opt,name=remote_download,json=remoteDownload,proto3" json:"remote_download,omitempty"` + IsPlugin bool `protobuf:"varint,5,opt,name=is_plugin,json=isPlugin,proto3" json:"is_plugin,omitempty"` + SignedBundleSize uint64 `protobuf:"varint,6,opt,name=signed_bundle_size,json=signedBundleSize,proto3" json:"signed_bundle_size,omitempty"` + SignedBundle []byte `protobuf:"bytes,7,opt,name=signed_bundle,json=signedBundle,proto3" json:"signed_bundle,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ImageTransfer) Reset() { @@ -505,6 +507,20 @@ func (x *ImageTransfer) GetIsPlugin() bool { return false } +func (x *ImageTransfer) GetSignedBundleSize() uint64 { + if x != nil { + return x.SignedBundleSize + } + return 0 +} + +func (x *ImageTransfer) GetSignedBundle() []byte { + if x != nil { + return x.SignedBundle + } + return nil +} + type ImageTransferEnd struct { state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields @@ -3509,27 +3525,29 @@ var File_github_com_openconfig_gnoi_containerz_containerz_proto protoreflect.Fil const file_github_com_openconfig_gnoi_containerz_containerz_proto_rawDesc = "" + "\n" + - "6github.com/openconfig/gnoi/containerz/containerz.proto\x12\x0fgnoi.containerz\x1a.github.com/openconfig/gnoi/common/common.proto\x1a,github.com/openconfig/gnoi/types/types.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xd2\x01\n" + + "6github.com/openconfig/gnoi/containerz/containerz.proto\x12\x0fgnoi.containerz\x1a.github.com/openconfig/gnoi/common/common.proto\x1a,github.com/openconfig/gnoi/types/types.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xde\x01\n" + "\rDeployRequest\x12G\n" + "\x0eimage_transfer\x18\x01 \x01(\v2\x1e.gnoi.containerz.ImageTransferH\x00R\rimageTransfer\x12\x1a\n" + "\acontent\x18\x02 \x01(\fH\x00R\acontent\x12Q\n" + "\x12image_transfer_end\x18\x03 \x01(\v2!.gnoi.containerz.ImageTransferEndH\x00R\x10imageTransferEndB\t\n" + - "\arequest\"\xb7\x01\n" + + "\arequestJ\x04\b\x04\x10\x05J\x04\b\x05\x10\x06\"\x8a\x02\n" + "\rImageTransfer\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x10\n" + "\x03tag\x18\x02 \x01(\tR\x03tag\x12\x1d\n" + "\n" + "image_size\x18\x03 \x01(\x04R\timageSize\x12D\n" + "\x0fremote_download\x18\x04 \x01(\v2\x1b.gnoi.common.RemoteDownloadR\x0eremoteDownload\x12\x1b\n" + - "\tis_plugin\x18\x05 \x01(\bR\bisPlugin\"\x12\n" + - "\x10ImageTransferEnd\"\xfe\x02\n" + + "\tis_plugin\x18\x05 \x01(\bR\bisPlugin\x12,\n" + + "\x12signed_bundle_size\x18\x06 \x01(\x04R\x10signedBundleSize\x12#\n" + + "\rsigned_bundle\x18\a \x01(\fR\fsignedBundle\"\x12\n" + + "\x10ImageTransferEnd\"\x8a\x03\n" + "\x0eDeployResponse\x12W\n" + "\x14image_transfer_ready\x18\x01 \x01(\v2#.gnoi.containerz.ImageTransferReadyH\x00R\x12imageTransferReady\x12`\n" + "\x17image_transfer_progress\x18\x02 \x01(\v2&.gnoi.containerz.ImageTransferProgressH\x00R\x15imageTransferProgress\x12]\n" + "\x16image_transfer_success\x18\x03 \x01(\v2%.gnoi.containerz.ImageTransferSuccessH\x00R\x14imageTransferSuccess\x12F\n" + "\x14image_transfer_error\x18\x04 \x01(\v2\x12.google.rpc.StatusH\x00R\x12imageTransferErrorB\n" + "\n" + - "\bresponse\"3\n" + + "\bresponseJ\x04\b\x05\x10\x06J\x04\b\x06\x10\a\"3\n" + "\x12ImageTransferReady\x12\x1d\n" + "\n" + "chunk_size\x18\x01 \x01(\x05R\tchunkSize\">\n" + @@ -3783,7 +3801,7 @@ const file_github_com_openconfig_gnoi_containerz_containerz_proto_rawDesc = "" + "StopPlugin\x12\".gnoi.containerz.StopPluginRequest\x1a#.gnoi.containerz.StopPluginResponse\"\x00\x12Z\n" + "\vListPlugins\x12#.gnoi.containerz.ListPluginsRequest\x1a$.gnoi.containerz.ListPluginsResponse\"\x00\x12]\n" + "\fRemovePlugin\x12$.gnoi.containerz.RemovePluginRequest\x1a%.gnoi.containerz.RemovePluginResponse\"\x00\x12f\n" + - "\x0fRemovePluginTar\x12'.gnoi.containerz.RemovePluginTarRequest\x1a(.gnoi.containerz.RemovePluginTarResponse\"\x00B/\xd2>\x050.2.0Z%github.com/openconfig/gnoi/containerzb\x06proto3" + "\x0fRemovePluginTar\x12'.gnoi.containerz.RemovePluginTarRequest\x1a(.gnoi.containerz.RemovePluginTarResponse\"\x00B/\xd2>\x050.3.0Z%github.com/openconfig/gnoi/containerzb\x06proto3" var ( file_github_com_openconfig_gnoi_containerz_containerz_proto_rawDescOnce sync.Once diff --git a/containerz/containerz.proto b/containerz/containerz.proto index 25b04b23..ff9a3cb6 100644 --- a/containerz/containerz.proto +++ b/containerz/containerz.proto @@ -33,7 +33,7 @@ import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; option go_package = "github.com/openconfig/gnoi/containerz"; -option (types.gnoi_version) = "0.2.0"; +option (types.gnoi_version) = "0.3.0"; service Containerz { // Deploy sets a container image on the target. The container is sent as @@ -43,10 +43,31 @@ service Containerz { // plugin, the target must save the file until StartPlugin is called. Whether // the registry is local or remote is target and deployment specific. A valid // container is one that has passed its checksum. + // + // When ImageTransfer.signed_bundle_size is non-zero, ImageTransfer must + // include signed_bundle whose length equals signed_bundle_size. After + // ImageTransferEnd the target verifies the signed bundle against the + // received image and then loads the image. The bundle format and signing + // mechanism are implementation-specific and opaque to this RPC. Typical + // Sigstore/cosign bundles are small enough to send in ImageTransfer + // without a separate streamed transfer. + // + // If signed_bundle_size is non-zero and the target does not support signed + // bundle transfer, the target must respond to ImageTransfer with + // image_transfer_error (google.rpc.Status code FAILED_PRECONDITION) before + // sending ImageTransferReady. The target must not accept image content in + // this case. + // + // When signed_bundle_size is zero, signed_bundle must be empty and behavior + // is unchanged; targets that do not implement signed bundle transfer remain + // compatible. // This RPC will return the following error codes in case of error: // - ResourceExhausted if there isn't enough disk space to save the image. - // - InvalidArgument sends more data than was advertised or if there is - // no image file associated with this transfer. + // - InvalidArgument sends more data than was advertised, if there is + // no image file associated with this transfer, or if + // signed_bundle_size does not match signed_bundle. + // - FailedPrecondition if signed_bundle_size is non-zero but the target + // does not support signed bundle transfer or verification fails. // - Internal if the container runtime is unable to store the image. // - Unavailable if the client is unable to receive responses from the // server. @@ -215,12 +236,31 @@ message ImageTransfer { // Indicates that the file to be transferred is a plugin. bool is_plugin = 5; + + // Optional size (in bytes) of a signed bundle included in signed_bundle. + // When non-zero, signed_bundle must be present and its length must equal + // this value. The target uses this field to validate the advertised bundle + // size and to reserve disk space before accepting image content. The bundle + // contents and signing scheme are opaque to this RPC. + // + // When non-zero, the target must support signed bundle transfer and + // verification. If the target does not support this feature, it must reject + // the Deploy stream by sending image_transfer_error with code + // FAILED_PRECONDITION in response to ImageTransfer, before + // ImageTransferReady. + uint64 signed_bundle_size = 6; + + // Optional signed bundle accompanying the container image. Present when + // signed_bundle_size is non-zero. Typical Sigstore/cosign bundles are on + // the order of 10KB and fit in a single ImageTransfer message. + bytes signed_bundle = 7; } // ImageTransferEnd indicates to the target that the client is finished sending -// and therefore no more content will be sent. Any content sent after this -// message should be discarded. This message serves as a signal to the target -// to begin integrity verifications on the received data. +// image content. If ImageTransfer.signed_bundle_size is zero, the target may +// begin integrity verification on the received image data. If +// signed_bundle_size is non-zero, the target must verify signed_bundle against +// the received image before loading it. message ImageTransferEnd { } @@ -229,6 +269,12 @@ message DeployResponse { ImageTransferReady image_transfer_ready = 1; ImageTransferProgress image_transfer_progress = 2; ImageTransferSuccess image_transfer_success = 3; + // Terminal error for the Deploy stream. Sent when the transfer or + // verification fails, or when ImageTransfer requests signed bundle + // transfer (signed_bundle_size non-zero) but the target does not support + // it. Unsupported signed bundle transfer must be reported here (code + // FAILED_PRECONDITION) in response to ImageTransfer, before + // ImageTransferReady. google.rpc.Status image_transfer_error = 4; } } diff --git a/containerz/containerz_grpc.pb.go b/containerz/containerz_grpc.pb.go index d319e84b..d8c3772a 100644 --- a/containerz/containerz_grpc.pb.go +++ b/containerz/containerz_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v6.33.4 +// - protoc v6.33.1 // source: github.com/openconfig/gnoi/containerz/containerz.proto package containerz