From 233cd4a643563b5f579a2e6f786d35dcdd4c2ef1 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 12 Jun 2026 18:15:05 +0200 Subject: [PATCH] vendor: github.com/moby/moby/api v1.55.0-rc.1, moby/client v0.5.0-rc.1 Signed-off-by: Sebastiaan van Stijn --- vendor.mod | 4 +- vendor.sum | 8 +-- .../moby/moby/api/types/image/attestation.go | 19 +++++++ vendor/github.com/moby/moby/client/client.go | 2 +- .../moby/moby/client/client_interfaces.go | 1 + .../moby/moby/client/image_attestations.go | 51 +++++++++++++++++ .../moby/client/image_attestations_opts.go | 56 +++++++++++++++++++ vendor/modules.txt | 4 +- 8 files changed, 136 insertions(+), 9 deletions(-) create mode 100644 vendor/github.com/moby/moby/api/types/image/attestation.go create mode 100644 vendor/github.com/moby/moby/client/image_attestations.go create mode 100644 vendor/github.com/moby/moby/client/image_attestations_opts.go diff --git a/vendor.mod b/vendor.mod index 3d3162a64beb..2a2dd588bde9 100644 --- a/vendor.mod +++ b/vendor.mod @@ -32,8 +32,8 @@ require ( github.com/google/uuid v1.6.0 github.com/mattn/go-runewidth v0.0.24 github.com/moby/go-archive v0.2.0 - github.com/moby/moby/api v1.54.2 - github.com/moby/moby/client v0.4.1 + github.com/moby/moby/api v1.55.0-rc.1 + github.com/moby/moby/client v0.5.0-rc.1 github.com/moby/patternmatcher v0.6.1 github.com/moby/swarmkit/v2 v2.1.2 github.com/moby/sys/atomicwriter v0.1.0 diff --git a/vendor.sum b/vendor.sum index f57a188f1943..0ffff9c7154a 100644 --- a/vendor.sum +++ b/vendor.sum @@ -113,10 +113,10 @@ github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3N github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/go-archive v0.2.0 h1:zg5QDUM2mi0JIM9fdQZWC7U8+2ZfixfTYoHL7rWUcP8= github.com/moby/go-archive v0.2.0/go.mod h1:mNeivT14o8xU+5q1YnNrkQVpK+dnNe/K6fHqnTg4qPU= -github.com/moby/moby/api v1.54.2 h1:wiat9QAhnDQjA7wk1kh/TqHz2I1uUA7M7t9SAl/JNXg= -github.com/moby/moby/api v1.54.2/go.mod h1:+RQ6wluLwtYaTd1WnPLykIDPekkuyD/ROWQClE83pzs= -github.com/moby/moby/client v0.4.1 h1:DMQgisVoMkmMs7fp3ROSdiBnoAu8+vo3GggFl06M/wY= -github.com/moby/moby/client v0.4.1/go.mod h1:z52C9O2POPOsnxZAy//WtKcQ32P+jT/NGeXu/7nfjGQ= +github.com/moby/moby/api v1.55.0-rc.1 h1:PizbkLn9OMoMIkNrcR/eNVOhNQnvR0zsJkrcePTYaeA= +github.com/moby/moby/api v1.55.0-rc.1/go.mod h1:+RQ6wluLwtYaTd1WnPLykIDPekkuyD/ROWQClE83pzs= +github.com/moby/moby/client v0.5.0-rc.1 h1:ubz6nHbWuDjYGPWVKMazn//Ac93T2+41IgOtrndMgHU= +github.com/moby/moby/client v0.5.0-rc.1/go.mod h1:mw5zy3IR06oD8V7+LfHYtA+sVNsgnhdrb2um3bTFcUM= github.com/moby/patternmatcher v0.6.1 h1:qlhtafmr6kgMIJjKJMDmMWq7WLkKIo23hsrpR3x084U= github.com/moby/patternmatcher v0.6.1/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= github.com/moby/swarmkit/v2 v2.1.2 h1:1WDZAI6HVYNKdCG4zlXnTAPyLsLwuhRGWlHoOUf5Z6I= diff --git a/vendor/github.com/moby/moby/api/types/image/attestation.go b/vendor/github.com/moby/moby/api/types/image/attestation.go new file mode 100644 index 000000000000..4233d6833039 --- /dev/null +++ b/vendor/github.com/moby/moby/api/types/image/attestation.go @@ -0,0 +1,19 @@ +package image + +import ( + "encoding/json" + + ocispec "github.com/opencontainers/image-spec/specs-go/v1" +) + +// AttestationStatement is a single in-toto statement attached to an image. +type AttestationStatement struct { + // Descriptor is the OCI descriptor of the statement blob (media type, + // digest, size, annotations). + Descriptor ocispec.Descriptor `json:"Descriptor"` + // PredicateType is the in-toto predicate type URI of this statement. + PredicateType string `json:"PredicateType"` + // Statement is the verbatim in-toto statement JSON. Omitted unless the + // caller opts in via the statement=true query parameter. + Statement *json.RawMessage `json:"Statement,omitempty"` +} diff --git a/vendor/github.com/moby/moby/client/client.go b/vendor/github.com/moby/moby/client/client.go index 89ba88ee5c16..4b4ef976a31e 100644 --- a/vendor/github.com/moby/moby/client/client.go +++ b/vendor/github.com/moby/moby/client/client.go @@ -109,7 +109,7 @@ const DummyHost = "api.moby.localhost" // overriding the version and disable API-version negotiation. // // This version may be lower than the version of the api library module used. -const MaxAPIVersion = "1.54" +const MaxAPIVersion = "1.55" // MinAPIVersion is the minimum API version supported by the client. API versions // below this version are not considered when performing API-version negotiation. diff --git a/vendor/github.com/moby/moby/client/client_interfaces.go b/vendor/github.com/moby/moby/client/client_interfaces.go index 4bbd45a6e59f..fd1b9dac3943 100644 --- a/vendor/github.com/moby/moby/client/client_interfaces.go +++ b/vendor/github.com/moby/moby/client/client_interfaces.go @@ -133,6 +133,7 @@ type ImageAPIClient interface { ImageInspect(ctx context.Context, image string, _ ...ImageInspectOption) (ImageInspectResult, error) ImageHistory(ctx context.Context, image string, _ ...ImageHistoryOption) (ImageHistoryResult, error) + ImageAttestations(ctx context.Context, image string, _ ...ImageAttestationsOption) (ImageAttestationsResult, error) ImageLoad(ctx context.Context, input io.Reader, _ ...ImageLoadOption) (ImageLoadResult, error) ImageSave(ctx context.Context, images []string, _ ...ImageSaveOption) (ImageSaveResult, error) diff --git a/vendor/github.com/moby/moby/client/image_attestations.go b/vendor/github.com/moby/moby/client/image_attestations.go new file mode 100644 index 000000000000..c02d975197df --- /dev/null +++ b/vendor/github.com/moby/moby/client/image_attestations.go @@ -0,0 +1,51 @@ +package client + +import ( + "context" + "encoding/json" + "net/url" +) + +// ImageAttestations returns the in-toto attestation statements attached to an +// image for the given platform. This requires API version 1.55 or higher. +func (cli *Client) ImageAttestations(ctx context.Context, imageID string, opts ...ImageAttestationsOption) (ImageAttestationsResult, error) { + if imageID == "" { + return ImageAttestationsResult{}, objectNotFoundError{object: "image", id: imageID} + } + + if err := cli.requiresVersion(ctx, "1.55", "attestations"); err != nil { + return ImageAttestationsResult{}, err + } + + var o imageAttestationsOpts + for _, opt := range opts { + if err := opt.Apply(&o); err != nil { + return ImageAttestationsResult{}, err + } + } + + query := url.Values{} + if o.platform != nil { + p, err := encodePlatform(o.platform) + if err != nil { + return ImageAttestationsResult{}, err + } + query.Set("platform", p) + } + for _, pt := range o.predicateTypes { + query.Add("type", pt) + } + if o.includeStatement { + query.Set("statement", "1") + } + + resp, err := cli.get(ctx, "/images/"+imageID+"/attestations", query, nil) + defer ensureReaderClosed(resp) + if err != nil { + return ImageAttestationsResult{}, err + } + + var result ImageAttestationsResult + err = json.NewDecoder(resp.Body).Decode(&result.Items) + return result, err +} diff --git a/vendor/github.com/moby/moby/client/image_attestations_opts.go b/vendor/github.com/moby/moby/client/image_attestations_opts.go new file mode 100644 index 000000000000..4a7c3bcf844d --- /dev/null +++ b/vendor/github.com/moby/moby/client/image_attestations_opts.go @@ -0,0 +1,56 @@ +package client + +import ( + "github.com/moby/moby/api/types/image" + ocispec "github.com/opencontainers/image-spec/specs-go/v1" +) + +// ImageAttestationsResult is the result of an ImageAttestations operation. +type ImageAttestationsResult struct { + Items []image.AttestationStatement +} + +// ImageAttestationsOption is a functional option for the ImageAttestations operation. +type ImageAttestationsOption interface { + Apply(*imageAttestationsOpts) error +} + +type imageAttestationsOptionFunc func(*imageAttestationsOpts) error + +func (f imageAttestationsOptionFunc) Apply(o *imageAttestationsOpts) error { return f(o) } + +type imageAttestationsOpts struct { + platform *ocispec.Platform + predicateTypes []string + includeStatement bool +} + +// ImageAttestationsWithPlatform filters attestations to those for the given +// platform variant. If omitted, the daemon's default platform is used. +func ImageAttestationsWithPlatform(platform ocispec.Platform) ImageAttestationsOption { + return imageAttestationsOptionFunc(func(o *imageAttestationsOpts) error { + o.platform = &platform + return nil + }) +} + +// ImageAttestationsWithPredicateTypes filters returned statements to those +// whose in-toto predicate type matches one of the given URIs. +// If not set, all statements are returned. +func ImageAttestationsWithPredicateTypes(types ...string) ImageAttestationsOption { + return imageAttestationsOptionFunc(func(o *imageAttestationsOpts) error { + o.predicateTypes = append(o.predicateTypes, types...) + return nil + }) +} + +// ImageAttestationsWithStatement asks the daemon to include the verbatim +// in-toto statement body in each returned entry. Without this option, only +// the descriptor and predicate type are returned and statement blobs are +// not read. +func ImageAttestationsWithStatement() ImageAttestationsOption { + return imageAttestationsOptionFunc(func(o *imageAttestationsOpts) error { + o.includeStatement = true + return nil + }) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 0a60828f25c4..7f64d8924761 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -167,7 +167,7 @@ github.com/moby/docker-image-spec/specs-go/v1 github.com/moby/go-archive github.com/moby/go-archive/compression github.com/moby/go-archive/tarheader -# github.com/moby/moby/api v1.54.2 +# github.com/moby/moby/api v1.55.0-rc.1 ## explicit; go 1.24 github.com/moby/moby/api/pkg/authconfig github.com/moby/moby/api/pkg/stdcopy @@ -189,7 +189,7 @@ github.com/moby/moby/api/types/storage github.com/moby/moby/api/types/swarm github.com/moby/moby/api/types/system github.com/moby/moby/api/types/volume -# github.com/moby/moby/client v0.4.1 +# github.com/moby/moby/client v0.5.0-rc.1 ## explicit; go 1.24 github.com/moby/moby/client github.com/moby/moby/client/internal