diff --git a/openshift/default-catalog-consistency/go.mod b/openshift/default-catalog-consistency/go.mod
index c1db12fef..5cf2cd524 100644
--- a/openshift/default-catalog-consistency/go.mod
+++ b/openshift/default-catalog-consistency/go.mod
@@ -1,26 +1,26 @@
module github/operator-framework-operator-controller/openshift/default-catalog-consistency
-go 1.24.3
+go 1.24.6
require (
- github.com/containerd/containerd v1.7.27
- github.com/containers/image/v5 v5.35.0
- github.com/onsi/ginkgo/v2 v2.23.4
- github.com/onsi/gomega v1.37.0
+ github.com/containerd/containerd v1.7.29
+ github.com/containers/image/v5 v5.36.2
+ github.com/onsi/ginkgo/v2 v2.27.2
+ github.com/onsi/gomega v1.38.2
github.com/opencontainers/image-spec v1.1.1
- github.com/operator-framework/operator-controller v1.3.0
- github.com/operator-framework/operator-registry v1.55.0
- k8s.io/apimachinery v0.33.2
+ github.com/operator-framework/operator-controller v1.5.1
+ github.com/operator-framework/operator-registry v1.57.0
+ k8s.io/apimachinery v0.33.4
oras.land/oras-go/v2 v2.6.0
)
require (
github.com/BurntSushi/toml v1.5.0 // indirect
+ github.com/Masterminds/semver/v3 v3.4.0 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/Microsoft/hcsshim v0.13.0 // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
- github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/containerd/cgroups/v3 v3.0.5 // indirect
github.com/containerd/continuity v0.4.5 // indirect
@@ -30,31 +30,24 @@ require (
github.com/containerd/typeurl/v2 v2.2.3 // indirect
github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 // indirect
github.com/containers/ocicrypt v1.2.1 // indirect
- github.com/containers/storage v1.58.0 // indirect
+ github.com/containers/storage v1.59.1 // indirect
github.com/cyberphone/json-canonicalization v0.0.0-20241213102144-19d51d7fe467 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
- github.com/docker/docker v28.3.0+incompatible // indirect
+ github.com/docker/docker v28.3.3+incompatible // indirect
github.com/docker/docker-credential-helpers v0.9.3 // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
- github.com/fxamacker/cbor/v2 v2.8.0 // indirect
+ github.com/fxamacker/cbor/v2 v2.9.0 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.6.2 // indirect
github.com/go-git/go-git/v5 v5.16.2 // indirect
github.com/go-jose/go-jose/v4 v4.1.1 // indirect
github.com/go-logr/logr v1.4.3 // indirect
- github.com/go-openapi/analysis v0.23.0 // indirect
- github.com/go-openapi/errors v0.22.1 // indirect
github.com/go-openapi/jsonpointer v0.21.1 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
- github.com/go-openapi/loads v0.22.0 // indirect
- github.com/go-openapi/runtime v0.28.0 // indirect
- github.com/go-openapi/spec v0.21.0 // indirect
- github.com/go-openapi/strfmt v0.23.0 // indirect
github.com/go-openapi/swag v0.23.1 // indirect
- github.com/go-openapi/validate v0.24.0 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
@@ -62,7 +55,7 @@ require (
github.com/google/gnostic-models v0.7.0 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/go-containerregistry v0.20.6 // indirect
- github.com/google/pprof v0.0.0-20250423184734-337e5dd93bb4 // indirect
+ github.com/google/pprof v0.0.0-20250820193118-f64d9cf942d6 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/h2non/filetype v1.1.3 // indirect
@@ -73,70 +66,68 @@ require (
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/klauspost/pgzip v1.2.6 // indirect
- github.com/letsencrypt/boulder v0.20250701.0 // indirect
+ github.com/letsencrypt/boulder v0.0.0-20250624003606-5ddd5acf990d // indirect
github.com/mailru/easyjson v0.9.0 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
- github.com/mattn/go-sqlite3 v1.14.28 // indirect
+ github.com/mattn/go-sqlite3 v1.14.32 // indirect
github.com/miekg/pkcs11 v1.1.1 // indirect
- github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moby/sys/capability v0.4.0 // indirect
github.com/moby/sys/mountinfo v0.7.2 // indirect
github.com/moby/sys/sequential v0.6.0 // indirect
github.com/moby/sys/user v0.4.0 // indirect
github.com/moby/sys/userns v0.1.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
- github.com/modern-go/reflect2 v1.0.2 // indirect
+ github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
- github.com/oklog/ulid v1.3.1 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/runtime-spec v1.2.1 // indirect
- github.com/operator-framework/api v0.32.0 // indirect
+ github.com/operator-framework/api v0.34.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/proglottis/gpgme v0.1.4 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/secure-systems-lab/go-securesystemslib v0.9.0 // indirect
github.com/sigstore/fulcio v1.7.1 // indirect
github.com/sigstore/protobuf-specs v0.4.3 // indirect
- github.com/sigstore/rekor v1.3.10 // indirect
github.com/sigstore/sigstore v1.9.5 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/smallstep/pkcs7 v0.2.1 // indirect
github.com/stefanberger/go-pkcs11uri v0.0.0-20230803200340-78284954bff6 // indirect
github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 // indirect
- github.com/ulikunitz/xz v0.5.12 // indirect
+ github.com/ulikunitz/xz v0.5.14 // indirect
github.com/vbatts/tar-split v0.12.1 // indirect
github.com/vbauerster/mpb/v8 v8.10.2 // indirect
github.com/x448/float16 v0.8.4 // indirect
- go.mongodb.org/mongo-driver v1.17.4 // indirect
go.opencensus.io v0.24.0 // indirect
- go.uber.org/automaxprocs v1.6.0 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
- golang.org/x/crypto v0.39.0 // indirect
+ golang.org/x/crypto v0.41.0 // indirect
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect
- golang.org/x/net v0.41.0 // indirect
+ golang.org/x/mod v0.27.0 // indirect
+ golang.org/x/net v0.43.0 // indirect
golang.org/x/oauth2 v0.30.0 // indirect
- golang.org/x/sync v0.15.0 // indirect
- golang.org/x/sys v0.33.0 // indirect
- golang.org/x/term v0.32.0 // indirect
- golang.org/x/text v0.26.0 // indirect
+ golang.org/x/sync v0.16.0 // indirect
+ golang.org/x/sys v0.35.0 // indirect
+ golang.org/x/term v0.34.0 // indirect
+ golang.org/x/text v0.28.0 // indirect
golang.org/x/time v0.12.0 // indirect
- golang.org/x/tools v0.34.0 // indirect
- google.golang.org/genproto/googleapis/api v0.0.0-20250603155806-513f23925822 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 // indirect
- google.golang.org/grpc v1.73.0 // indirect
- google.golang.org/protobuf v1.36.6 // indirect
+ golang.org/x/tools v0.36.0 // indirect
+ google.golang.org/genproto/googleapis/api v0.0.0-20250707201910-8d1bb00bc6a7 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7 // indirect
+ google.golang.org/grpc v1.75.0 // indirect
+ google.golang.org/protobuf v1.36.8 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
- k8s.io/api v0.33.2 // indirect
- k8s.io/client-go v0.33.2 // indirect
+ k8s.io/api v0.33.4 // indirect
+ k8s.io/apiextensions-apiserver v0.33.4 // indirect
+ k8s.io/client-go v0.33.4 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
- k8s.io/kube-openapi v0.0.0-20250701173324-9bd5c66d9911 // indirect
+ k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect
sigs.k8s.io/controller-runtime v0.21.0 // indirect
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.7.0 // indirect
- sigs.k8s.io/yaml v1.5.0 // indirect
+ sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
+ sigs.k8s.io/yaml v1.6.0 // indirect
)
diff --git a/openshift/default-catalog-consistency/go.sum b/openshift/default-catalog-consistency/go.sum
index e160d41c5..1af116fdf 100644
--- a/openshift/default-catalog-consistency/go.sum
+++ b/openshift/default-catalog-consistency/go.sum
@@ -1,11 +1,13 @@
cel.dev/expr v0.24.0 h1:56OvJKSH3hDGL0ml5uSxZmz3/3Pq4tJ+fb1unVLAFcY=
cel.dev/expr v0.24.0/go.mod h1:hLPLo1W4QUmuYdA72RBX06QTs6MXw941piREPl3Yfiw=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
-dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s=
-dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
+dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8=
+dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg=
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
+github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0=
+github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
github.com/Microsoft/hcsshim v0.13.0 h1:/BcXOiS6Qi7N9XqUcv27vkIuVOkBEcWstd2pMlWSeaA=
@@ -16,8 +18,6 @@ github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpH
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo=
github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ=
github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw=
-github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
-github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
@@ -29,8 +29,8 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/containerd/cgroups/v3 v3.0.5 h1:44na7Ud+VwyE7LIoJ8JTNQOa549a8543BmzaJHo6Bzo=
github.com/containerd/cgroups/v3 v3.0.5/go.mod h1:SA5DLYnXO8pTGYiAHXz94qvLQTKfVM5GEVisn4jpins=
-github.com/containerd/containerd v1.7.27 h1:yFyEyojddO3MIGVER2xJLWoCIn+Up4GaHFquP7hsFII=
-github.com/containerd/containerd v1.7.27/go.mod h1:xZmPnl75Vc+BLGt4MIfu6bp+fy03gdHAn9bz+FreFR0=
+github.com/containerd/containerd v1.7.29 h1:90fWABQsaN9mJhGkoVnuzEY+o1XDPbg9BTC9QTAHnuE=
+github.com/containerd/containerd v1.7.29/go.mod h1:azUkWcOvHrWvaiUjSQH0fjzuHIwSPg1WL5PshGP4Szs=
github.com/containerd/continuity v0.4.5 h1:ZRoN1sXq9u7V6QoHMcVWGhOwDFqZ4B9i5H6un1Wh0x4=
github.com/containerd/continuity v0.4.5/go.mod h1:/lNJvtJKUQStBzpVQ1+rasXO1LAWtUQssk28EZvJ3nE=
github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI=
@@ -41,14 +41,14 @@ github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
github.com/containerd/typeurl/v2 v2.2.3 h1:yNA/94zxWdvYACdYO8zofhrTVuQY73fFU1y++dYSw40=
github.com/containerd/typeurl/v2 v2.2.3/go.mod h1:95ljDnPfD3bAbDJRugOiShd/DlAAsxGtUBhJxIn7SCk=
-github.com/containers/image/v5 v5.35.0 h1:T1OeyWp3GjObt47bchwD9cqiaAm/u4O4R9hIWdrdrP8=
-github.com/containers/image/v5 v5.35.0/go.mod h1:8vTsgb+1gKcBL7cnjyNOInhJQfTUQjJoO2WWkKDoebM=
+github.com/containers/image/v5 v5.36.2 h1:GcxYQyAHRF/pLqR4p4RpvKllnNL8mOBn0eZnqJbfTwk=
+github.com/containers/image/v5 v5.36.2/go.mod h1:b4GMKH2z/5t6/09utbse2ZiLK/c72GuGLFdp7K69eA4=
github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 h1:Qzk5C6cYglewc+UyGf6lc8Mj2UaPTHy/iF2De0/77CA=
github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01/go.mod h1:9rfv8iPl1ZP7aqh9YA68wnZv2NUDbXdcdPHVz0pFbPY=
github.com/containers/ocicrypt v1.2.1 h1:0qIOTT9DoYwcKmxSt8QJt+VzMY18onl9jUXsxpVhSmM=
github.com/containers/ocicrypt v1.2.1/go.mod h1:aD0AAqfMp0MtwqWgHM1bUwe1anx0VazI108CRrSKINQ=
-github.com/containers/storage v1.58.0 h1:Q7SyyCCjqgT3wYNgRNIL8o/wUS92heIj2/cc8Sewvcc=
-github.com/containers/storage v1.58.0/go.mod h1:w7Jl6oG+OpeLGLzlLyOZPkmUso40kjpzgrHUk5tyBlo=
+github.com/containers/storage v1.59.1 h1:11Zu68MXsEQGBBd+GadPrHPpWeqjKS8hJDGiAHgIqDs=
+github.com/containers/storage v1.59.1/go.mod h1:KoAYHnAjP3/cTsRS+mmWZGkufSY2GACiKQ4V3ZLQnR0=
github.com/cyberphone/json-canonicalization v0.0.0-20241213102144-19d51d7fe467 h1:uX1JmpONuD549D73r6cgnxyUu18Zb7yHAy5AYU0Pm4Q=
github.com/cyberphone/json-canonicalization v0.0.0-20241213102144-19d51d7fe467/go.mod h1:uzvlm1mxhHkdfqitSA92i7Se+S9ksOn3a3qmv/kyOCw=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -57,12 +57,12 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
-github.com/docker/cli v28.2.2+incompatible h1:qzx5BNUDFqlvyq4AHzdNB7gSyVTmU4cgsyN9SdInc1A=
-github.com/docker/cli v28.2.2+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
+github.com/docker/cli v28.3.3+incompatible h1:fp9ZHAr1WWPGdIWBM1b3zLtgCF+83gRdVMTJsUeiyAo=
+github.com/docker/cli v28.3.3+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
-github.com/docker/docker v28.3.0+incompatible h1:ffS62aKWupCWdvcee7nBU9fhnmknOqDPaJAMtfK0ImQ=
-github.com/docker/docker v28.3.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
+github.com/docker/docker v28.3.3+incompatible h1:Dypm25kh4rmk49v1eiVbsAtpAsYURjYkaKubwuBdxEI=
+github.com/docker/docker v28.3.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.9.3 h1:gAm/VtF9wgqJMoxzT3Gj5p4AqIjCBS4wrsOh9yRqcz8=
github.com/docker/docker-credential-helpers v0.9.3/go.mod h1:x+4Gbw9aGmChi3qTLZj8Dfn0TD20M/fuWy0E5+WDeCo=
github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=
@@ -71,16 +71,22 @@ github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQ
github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
-github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU=
-github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
+github.com/emicklei/go-restful/v3 v3.12.2 h1:DhwDP0vY3k8ZzE0RunuJy8GhNpPL6zqLkDf9B/a0/xU=
+github.com/emicklei/go-restful/v3 v3.12.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
-github.com/fxamacker/cbor/v2 v2.8.0 h1:fFtUGXUzXPHTIUdne5+zzMPTfffl3RD5qYnkY40vtxU=
-github.com/fxamacker/cbor/v2 v2.8.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=
+github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM=
+github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=
+github.com/gkampitakis/ciinfo v0.3.2 h1:JcuOPk8ZU7nZQjdUhctuhQofk7BGHuIy0c9Ez8BNhXs=
+github.com/gkampitakis/ciinfo v0.3.2/go.mod h1:1NIwaOcFChN4fa/B0hEBdAb6npDlFL8Bwx4dfRLRqAo=
+github.com/gkampitakis/go-diff v1.3.2 h1:Qyn0J9XJSDTgnsgHRdz9Zp24RaJeKMUHg2+PDZZdC4M=
+github.com/gkampitakis/go-diff v1.3.2/go.mod h1:LLgOrpqleQe26cte8s36HTWcTmMEur6OPYerdAAS9tk=
+github.com/gkampitakis/go-snaps v0.5.15 h1:amyJrvM1D33cPHwVrjo9jQxX8g/7E2wYdZ+01KS3zGE=
+github.com/gkampitakis/go-snaps v0.5.15/go.mod h1:HNpx/9GoKisdhw9AFOBT1N7DBs9DiHo/hGheFGBZ+mc=
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic=
github.com/go-git/go-billy/v5 v5.6.2 h1:6Q86EsPXMa7c3YZ3aLAQsMA0VlWmy43r6FHqa/UNbRM=
@@ -93,30 +99,18 @@ github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
-github.com/go-openapi/analysis v0.23.0 h1:aGday7OWupfMs+LbmLZG4k0MYXIANxcuBTYUC03zFCU=
-github.com/go-openapi/analysis v0.23.0/go.mod h1:9mz9ZWaSlV8TvjQHLl2mUW2PbZtemkE8yA5v22ohupo=
-github.com/go-openapi/errors v0.22.1 h1:kslMRRnK7NCb/CvR1q1VWuEQCEIsBGn5GgKD9e+HYhU=
-github.com/go-openapi/errors v0.22.1/go.mod h1:+n/5UdIqdVnLIJ6Q9Se8HNGUXYaY6CN8ImWzfi/Gzp0=
github.com/go-openapi/jsonpointer v0.21.1 h1:whnzv/pNXtK2FbX/W9yJfRmE2gsmkfahjMKB0fZvcic=
github.com/go-openapi/jsonpointer v0.21.1/go.mod h1:50I1STOfbY1ycR8jGz8DaMeLCdXiI6aDteEdRNNzpdk=
github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ=
github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
-github.com/go-openapi/loads v0.22.0 h1:ECPGd4jX1U6NApCGG1We+uEozOAvXvJSF4nnwHZ8Aco=
-github.com/go-openapi/loads v0.22.0/go.mod h1:yLsaTCS92mnSAZX5WWoxszLj0u+Ojl+Zs5Stn1oF+rs=
-github.com/go-openapi/runtime v0.28.0 h1:gpPPmWSNGo214l6n8hzdXYhPuJcGtziTOgUpvsFWGIQ=
-github.com/go-openapi/runtime v0.28.0/go.mod h1:QN7OzcS+XuYmkQLw05akXk0jRH/eZ3kb18+1KwW9gyc=
-github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY=
-github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk=
-github.com/go-openapi/strfmt v0.23.0 h1:nlUS6BCqcnAk0pyhi9Y+kdDVZdZMHfEKQiS4HaMgO/c=
-github.com/go-openapi/strfmt v0.23.0/go.mod h1:NrtIpfKtWIygRkKVsxh7XQMDQW5HKQl6S5ik2elW+K4=
github.com/go-openapi/swag v0.23.1 h1:lpsStH0n2ittzTnbaSloVZLuB5+fvSY/+hnagBjSNZU=
github.com/go-openapi/swag v0.23.1/go.mod h1:STZs8TbRvEQQKUA+JZNAm3EWlgaOBGpyFDqQnDHMef0=
-github.com/go-openapi/validate v0.24.0 h1:LdfDKwNbpB6Vn40xhTdNZAnfLECL81w+VX3BumrGD58=
-github.com/go-openapi/validate v0.24.0/go.mod h1:iyeX1sEufmv3nPbBdX3ieNviWnOZaJ1+zquzJEf2BAQ=
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
github.com/go-test/deep v1.1.1 h1:0r/53hagsehfO4bzD2Pgr/+RgHqhmf+k1Bpse2cTu1U=
github.com/go-test/deep v1.1.1/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
+github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=
+github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
@@ -135,8 +129,8 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
-github.com/google/cel-go v0.25.0 h1:jsFw9Fhn+3y2kBbltZR4VEz5xKkcIFRPDnuEzAGv5GY=
-github.com/google/cel-go v0.25.0/go.mod h1:hjEb6r5SuOSlhCHmFoLzu8HGCERvIsDAbxDAyNU/MmI=
+github.com/google/cel-go v0.26.0 h1:DPGjXackMpJWH680oGY4lZhYjIameYmR+/6RBdDGmaI=
+github.com/google/cel-go v0.26.0/go.mod h1:A9O8OU9rdvrK5MQyrqfIxo1a0u4g3sF8KB6PUIaryMM=
github.com/google/gnostic-models v0.7.0 h1:qwTtogB15McXDaNqTZdzPJRHvaVJlAl+HVQnLmJEJxo=
github.com/google/gnostic-models v0.7.0/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
@@ -152,13 +146,15 @@ github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX
github.com/google/go-containerregistry v0.20.6 h1:cvWX87UxxLgaH76b4hIvya6Dzz9qHB31qAwjAohdSTU=
github.com/google/go-containerregistry v0.20.6/go.mod h1:T0x8MuoAoKX/873bkeSfLD2FAkwCDf9/HZgsFJ02E2Y=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
-github.com/google/pprof v0.0.0-20250423184734-337e5dd93bb4 h1:gD0vax+4I+mAj+jEChEf25Ia07Jq7kYOFO5PPhAxFl4=
-github.com/google/pprof v0.0.0-20250423184734-337e5dd93bb4/go.mod h1:5hDyRhoBCxViHszMt12TnOpEI4VVi+U8Gm9iphldiMA=
+github.com/google/pprof v0.0.0-20250820193118-f64d9cf942d6 h1:EEHtgt9IwisQ2AZ4pIsMjahcegHh6rmhqxzIRQIyepY=
+github.com/google/pprof v0.0.0-20250820193118-f64d9cf942d6/go.mod h1:I6V7YzU0XDpsHqbsyrghnFZLO1gwK6NPTNvmetQIk9U=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
+github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc h1:GN2Lv3MGO7AS6PrRoT6yV5+wkrOpcszoIsO4+4ds248=
+github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc/go.mod h1:+JKpmjMGhpgPL+rXZ5nsZieVzvarn86asRlBg4uNGnk=
github.com/h2non/filetype v1.1.3 h1:FKkx9QbD7HR/zjK1Ia5XiBsq9zdLi5Kf3zGyFTAFkGg=
github.com/h2non/filetype v1.1.3/go.mod h1:319b3zT68BvV+WRj7cwy856M2ehB3HqNOt6sy1HndBY=
github.com/h2non/go-is-svg v0.0.0-20160927212452-35e8c4b0612c h1:fEE5/5VNnYUoBOj2I9TP8Jc+a7lge3QWn9DKE7NCwfc=
@@ -173,6 +169,8 @@ github.com/joelanford/ignore v0.1.1 h1:vKky5RDoPT+WbONrbQBgOn95VV/UPh4ejlyAbbzgn
github.com/joelanford/ignore v0.1.1/go.mod h1:8eho/D8fwQ3rIXrLwE23AaeaGDNXqLE9QJ3zJ4LIPCw=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
+github.com/joshdk/go-junit v1.0.0 h1:S86cUKIdwBHWwA6xCmFlf3RTLfVXYQfvanM5Uh+K6GE=
+github.com/joshdk/go-junit v1.0.0/go.mod h1:TiiV0PqkaNfFXjEiyjWM3XXrhVyCa1K4Zfga6W52ung=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
@@ -185,18 +183,20 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
-github.com/letsencrypt/boulder v0.20250701.0 h1:PMrLhkBSrAMgC/fGiEwMU8Vb0hVXn3LD2Y5Sv+ehloI=
-github.com/letsencrypt/boulder v0.20250701.0/go.mod h1:8FCmFZoomZMKQSid72Jhke4h08xFnhoiZz8OQysKazE=
+github.com/letsencrypt/boulder v0.0.0-20250624003606-5ddd5acf990d h1:fCRb9hXR4QQJpwc7xnGugnva0DD5ollTGkys0n8aXT4=
+github.com/letsencrypt/boulder v0.0.0-20250624003606-5ddd5acf990d/go.mod h1:BVoSL2Ed8oCncct0meeBqoTY7b1Mzx7WqEOZ8EisFmY=
github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4=
github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
+github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo=
+github.com/maruel/natural v1.1.1/go.mod h1:v+Rfd79xlw1AgVBjbO0BEQmptqb5HvL/k9GRHB7ZKEg=
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
-github.com/mattn/go-sqlite3 v1.14.28 h1:ThEiQrnbtumT+QMknw63Befp/ce/nUPgBPMlRFEum7A=
-github.com/mattn/go-sqlite3 v1.14.28/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
+github.com/mattn/go-sqlite3 v1.14.32 h1:JD12Ag3oLy1zQA+BNn74xRgaBbdhbNIDYvQUEuuErjs=
+github.com/mattn/go-sqlite3 v1.14.32/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
+github.com/mfridman/tparse v0.18.0 h1:wh6dzOKaIwkUGyKgOntDW4liXSo37qg5AXbIhkMV3vE=
+github.com/mfridman/tparse v0.18.0/go.mod h1:gEvqZTuCgEhPbYk/2lS3Kcxg1GmTxxU7kTC8DvP0i/A=
github.com/miekg/pkcs11 v1.1.1 h1:Ugu9pdy6vAYku5DEpVWVFPYnzV+bxB+iRdbuFSu7TvU=
github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs=
-github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
-github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/moby/sys/capability v0.4.0 h1:4D4mI6KlNtWMCM1Z/K0i7RV1FkX+DBDHKVJpCndZoHk=
github.com/moby/sys/capability v0.4.0/go.mod h1:4g9IK291rVkms3LKCDOoYlnV8xKwoDTpIrNEE35Wq0I=
github.com/moby/sys/mountinfo v0.7.2 h1:1shs6aH5s4o5H2zQLn796ADW1wMrIwHsyJ2v9KouLrg=
@@ -210,44 +210,41 @@ github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcY
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
-github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
+github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=
+github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
-github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=
-github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
-github.com/onsi/ginkgo/v2 v2.23.4 h1:ktYTpKJAVZnDT4VjxSbiBenUjmlL/5QkBEocaWXiQus=
-github.com/onsi/ginkgo/v2 v2.23.4/go.mod h1:Bt66ApGPBFzHyR+JO10Zbt0Gsp4uWxu5mIOTusL46e8=
-github.com/onsi/gomega v1.37.0 h1:CdEG8g0S133B4OswTDC/5XPSzE1OeP29QOioj2PID2Y=
-github.com/onsi/gomega v1.37.0/go.mod h1:8D9+Txp43QWKhM24yyOBEdpkzN8FvJyAwecBgsU4KU0=
+github.com/onsi/ginkgo/v2 v2.27.2 h1:LzwLj0b89qtIy6SSASkzlNvX6WktqurSHwkk2ipF/Ns=
+github.com/onsi/ginkgo/v2 v2.27.2/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo=
+github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A=
+github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040=
github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M=
github.com/opencontainers/runtime-spec v1.2.1 h1:S4k4ryNgEpxW1dzyqffOmhI1BHYcjzU8lpJfSlR0xww=
github.com/opencontainers/runtime-spec v1.2.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
-github.com/operator-framework/api v0.32.0 h1:LZSZr7at3NrjsjwQVNsYD+04o5wMq75jrR0dMYiIIH8=
-github.com/operator-framework/api v0.32.0/go.mod h1:OGJo6HUYxoQwpGaLr0lPJzSek51RiXajJSSa8Jzjvp8=
-github.com/operator-framework/operator-controller v1.3.0 h1:q/ROsJFpr6ZL0FfibAHJWtypgGdQ97yxl5hqXplFSVg=
-github.com/operator-framework/operator-controller v1.3.0/go.mod h1:FoNCY7Gclv7N6H7NS4gucUOS0AbBrCfN0gWt3xf3GN8=
-github.com/operator-framework/operator-registry v1.55.0 h1:iXlv53fYyg2VtLqSDEalXD72/5Uzc7Rfx17j35+8plA=
-github.com/operator-framework/operator-registry v1.55.0/go.mod h1:8htDRYKWZ6UWjGMXbBdwwHefsJknodOiGLnpjxgAflw=
+github.com/operator-framework/api v0.34.0 h1:REiEaYhG1CWmDoajdcAdZqtgoljWG+ixMY59vUX5pFI=
+github.com/operator-framework/api v0.34.0/go.mod h1:eGncUNIYvWtfGCCKmLzGXvoi3P0TDf3Yd/Z0Sn9E6SQ=
+github.com/operator-framework/operator-controller v1.5.1 h1:J3xdRHzh9ajuKt/i1fWxoOLUf3kMpaOnGf1XNZ6+Klg=
+github.com/operator-framework/operator-controller v1.5.1/go.mod h1:6BpO9yzrmr1s7zqnk7YUA9SJlNVD+gA25JS5sg6axCE=
+github.com/operator-framework/operator-registry v1.57.0 h1:mQ4c8A8VUxZPJ0QCFRNio+7JEsLX6eKxlDSl6ORCRdk=
+github.com/operator-framework/operator-registry v1.57.0/go.mod h1:9rAZH/LZ/ttEuTvL1D4KApGqOtRDE6fJzzOrJNcBu7g=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
-github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U=
github.com/proglottis/gpgme v0.1.4 h1:3nE7YNA70o2aLjcg63tXMOhPD7bplfE5CBdV+hLAm2M=
github.com/proglottis/gpgme v0.1.4/go.mod h1:5LoXMgpE4bttgwwdv9bLs/vwqv3qV7F4glEEZ7mRKrM=
-github.com/prometheus/client_golang v1.22.0 h1:rb93p9lokFEsctTys46VnV1kLCDpVZ0a/Y92Vm0Zc6Q=
-github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0=
+github.com/prometheus/client_golang v1.23.1 h1:w6gXMLQGgd0jXXlote9lRHMe0nG01EbnJT+C0EJru2Y=
+github.com/prometheus/client_golang v1.23.1/go.mod h1:br8j//v2eg2K5Vvna5klK8Ku5pcU5r4ll73v6ik5dIQ=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
-github.com/prometheus/common v0.65.0 h1:QDwzd+G1twt//Kwj/Ww6E9FQq1iVMmODnILtW1t2VzE=
-github.com/prometheus/common v0.65.0/go.mod h1:0gZns+BLRQ3V6NdaerOhMbwwRbNh9hkGINtQAsP5GS8=
+github.com/prometheus/common v0.66.0 h1:K/rJPHrG3+AoQs50r2+0t7zMnMzek2Vbv31OFVsMeVY=
+github.com/prometheus/common v0.66.0/go.mod h1:Ux6NtV1B4LatamKE63tJBntoxD++xmtI/lK0VtEplN4=
github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg=
github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
@@ -255,26 +252,24 @@ github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
-github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 h1:PKK9DyHxif4LZo+uQSgXNqs0jj5+xZwwfKHgph2lxBw=
-github.com/santhosh-tekuri/jsonschema/v6 v6.0.1/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU=
+github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 h1:KRzFb2m7YtdldCEkzs6KqmJw4nqEVZGK7IN2kJkjTuQ=
+github.com/santhosh-tekuri/jsonschema/v6 v6.0.2/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU=
github.com/secure-systems-lab/go-securesystemslib v0.9.0 h1:rf1HIbL64nUpEIZnjLZ3mcNEL9NBPB0iuVjyxvq3LZc=
github.com/secure-systems-lab/go-securesystemslib v0.9.0/go.mod h1:DVHKMcZ+V4/woA/peqr+L0joiRXbPpQ042GgJckkFgw=
github.com/sigstore/fulcio v1.7.1 h1:RcoW20Nz49IGeZyu3y9QYhyyV3ZKQ85T+FXPKkvE+aQ=
github.com/sigstore/fulcio v1.7.1/go.mod h1:7lYY+hsd8Dt+IvKQRC+KEhWpCZ/GlmNvwIa5JhypMS8=
github.com/sigstore/protobuf-specs v0.4.3 h1:kRgJ+ciznipH9xhrkAbAEHuuxD3GhYnGC873gZpjJT4=
github.com/sigstore/protobuf-specs v0.4.3/go.mod h1:+gXR+38nIa2oEupqDdzg4qSBT0Os+sP7oYv6alWewWc=
-github.com/sigstore/rekor v1.3.10 h1:/mSvRo4MZ/59ECIlARhyykAlQlkmeAQpvBPlmJtZOCU=
-github.com/sigstore/rekor v1.3.10/go.mod h1:JvryKJ40O0XA48MdzYUPu0y4fyvqt0C4iSY7ri9iu3A=
github.com/sigstore/sigstore v1.9.5 h1:Wm1LT9yF4LhQdEMy5A2JeGRHTrAWGjT3ubE5JUSrGVU=
github.com/sigstore/sigstore v1.9.5/go.mod h1:VtxgvGqCmEZN9X2zhFSOkfXxvKUjpy8RpUW39oCtoII=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/smallstep/pkcs7 v0.2.1 h1:6Kfzr/QizdIuB6LSv8y1LJdZ3aPSfTNhTLqAx9CTLfA=
github.com/smallstep/pkcs7 v0.2.1/go.mod h1:RcXHsMfL+BzH8tRhmrF1NkkpebKpq3JEM66cOFxanf0=
-github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
-github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
-github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
-github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
+github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s=
+github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0=
+github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY=
+github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stefanberger/go-pkcs11uri v0.0.0-20230803200340-78284954bff6 h1:pnnLyeX7o/5aX8qUQ69P/mLojDqwda8hFOCBTmP/6hw=
github.com/stefanberger/go-pkcs11uri v0.0.0-20230803200340-78284954bff6/go.mod h1:39R/xuhNgVhi+K0/zst4TLrJrVmbm6LVgl4A0+ZFS5M=
github.com/stoewer/go-strcase v1.3.1 h1:iS0MdW+kVTxgMoE1LAZyMiYJFKlOzLooE4MxjirtkAs=
@@ -289,12 +284,20 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
-github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
-github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
+github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
+github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
+github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY=
+github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
+github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
+github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
+github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
+github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
+github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY=
+github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28=
github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 h1:e/5i7d4oYZ+C1wj2THlRK+oAhjeS/TRQwMfkIuet3w0=
github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399/go.mod h1:LdwHTNJT99C5fTAzDz0ud328OgXz+gierycbcIx2fRs=
-github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc=
-github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
+github.com/ulikunitz/xz v0.5.14 h1:uv/0Bq533iFdnMHZdRBTOlaNMdb1+ZxXIlHDZHIHcvg=
+github.com/ulikunitz/xz v0.5.14/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/vbatts/tar-split v0.12.1 h1:CqKoORW7BUWBe7UL/iqTVvkTBOF8UvOMKOIZykxnnbo=
github.com/vbatts/tar-split v0.12.1/go.mod h1:eF6B6i6ftWQcDqEn3/iGFRFRo8cBIMSJVOpnNdfTMFA=
github.com/vbauerster/mpb/v8 v8.10.2 h1:2uBykSHAYHekE11YvJhKxYmLATKHAGorZwFlyNw4hHM=
@@ -304,26 +307,22 @@ github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcY
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
-go.mongodb.org/mongo-driver v1.17.4 h1:jUorfmVzljjr0FLzYQsGP8cgN/qzzxlY9Vh0C9KFXVw=
-go.mongodb.org/mongo-driver v1.17.4/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 h1:F7Jx+6hwnZ41NSFTO5q4LYDtJRXBf2PD0rNBkeB/lus=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0/go.mod h1:UHB22Z8QsdRDrnAtX4PntOl36ajSxcdUMt1sF7Y6E7Q=
-go.opentelemetry.io/otel v1.36.0 h1:UumtzIklRBY6cI/lllNZlALOF5nNIzJVb16APdvgTXg=
-go.opentelemetry.io/otel v1.36.0/go.mod h1:/TcFMXYjyRNh8khOAO9ybYkqaDBb/70aVwkNML4pP8E=
-go.opentelemetry.io/otel/metric v1.36.0 h1:MoWPKVhQvJ+eeXWHFBOPoBOi20jh6Iq2CcCREuTYufE=
-go.opentelemetry.io/otel/metric v1.36.0/go.mod h1:zC7Ks+yeyJt4xig9DEw9kuUFe5C3zLbVjV2PzT6qzbs=
-go.opentelemetry.io/otel/sdk v1.36.0 h1:b6SYIuLRs88ztox4EyrvRti80uXIFy+Sqzoh9kFULbs=
-go.opentelemetry.io/otel/sdk v1.36.0/go.mod h1:+lC+mTgD+MUWfjJubi2vvXWcVxyr9rmlshZni72pXeY=
-go.opentelemetry.io/otel/sdk/metric v1.35.0 h1:1RriWBmCKgkeHEhM7a2uMjMUfP7MsOF5JpUCaEqEI9o=
-go.opentelemetry.io/otel/sdk/metric v1.35.0/go.mod h1:is6XYCUMpcKi+ZsOvfluY5YstFnhW0BidkR+gL+qN+w=
-go.opentelemetry.io/otel/trace v1.36.0 h1:ahxWNuqZjpdiFAyrIoQ4GIiAIhxAunQR6MUoKrsNd4w=
-go.opentelemetry.io/otel/trace v1.36.0/go.mod h1:gQ+OnDZzrybY4k4seLzPAWNwVBBVlF2szhehOBB/tGA=
-go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs=
-go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8=
+go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ=
+go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I=
+go.opentelemetry.io/otel/metric v1.37.0 h1:mvwbQS5m0tbmqML4NqK+e3aDiO02vsf/WgbsdpcPoZE=
+go.opentelemetry.io/otel/metric v1.37.0/go.mod h1:04wGrZurHYKOc+RKeye86GwKiTb9FKm1WHtO+4EVr2E=
+go.opentelemetry.io/otel/sdk v1.37.0 h1:ItB0QUqnjesGRvNcmAcU0LyvkVyGJ2xftD29bWdDvKI=
+go.opentelemetry.io/otel/sdk v1.37.0/go.mod h1:VredYzxUvuo2q3WRcDnKDjbdvmO0sCzOvVAiY+yUkAg=
+go.opentelemetry.io/otel/sdk/metric v1.37.0 h1:90lI228XrB9jCMuSdA0673aubgRobVZFhbjxHHspCPc=
+go.opentelemetry.io/otel/sdk/metric v1.37.0/go.mod h1:cNen4ZWfiD37l5NhS+Keb5RXVWZWpRE+9WyVCpbo5ps=
+go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4=
+go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI=
@@ -338,8 +337,8 @@ golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliY
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
-golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM=
-golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U=
+golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4=
+golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b h1:M2rDM6z3Fhozi9O7NWsxAkg/yqS/lQJ6PmkyIV3YP+o=
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8=
@@ -353,6 +352,8 @@ golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
+golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ=
+golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -369,8 +370,8 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
-golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw=
-golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA=
+golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE=
+golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI=
golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU=
@@ -385,8 +386,8 @@ golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
-golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8=
-golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
+golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
+golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -402,8 +403,8 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
-golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
+golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
+golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
@@ -413,8 +414,8 @@ golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s=
-golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg=
-golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ=
+golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4=
+golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
@@ -424,8 +425,8 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
-golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M=
-golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA=
+golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng=
+golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU=
golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE=
golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -440,28 +441,30 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
-golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo=
-golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg=
+golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg=
+golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
+gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
-google.golang.org/genproto/googleapis/api v0.0.0-20250603155806-513f23925822 h1:oWVWY3NzT7KJppx2UKhKmzPq4SRe0LdCijVRwvGeikY=
-google.golang.org/genproto/googleapis/api v0.0.0-20250603155806-513f23925822/go.mod h1:h3c4v36UTKzUiuaOKQ6gr3S+0hovBtUrXzTG/i3+XEc=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 h1:fc6jSaCT0vBduLYZHYrBBNY4dsWuvgyff9noRNDdBeE=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
+google.golang.org/genproto/googleapis/api v0.0.0-20250707201910-8d1bb00bc6a7 h1:FiusG7LWj+4byqhbvmB+Q93B/mOxJLN2DTozDuZm4EU=
+google.golang.org/genproto/googleapis/api v0.0.0-20250707201910-8d1bb00bc6a7/go.mod h1:kXqgZtrWaf6qS3jZOCnCH7WYfrvFjkC51bM8fz3RsCA=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7 h1:pFyd6EwwL2TqFf8emdthzeX+gZE1ElRq3iM8pui4KBY=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
-google.golang.org/grpc v1.73.0 h1:VIWSmpI2MegBtTuFt5/JWy2oXxtjJ/e89Z70ImfD2ok=
-google.golang.org/grpc v1.73.0/go.mod h1:50sbHOUqWoCQGI8V2HQLJM0B+LMlIUjNSZmow7EVBQc=
+google.golang.org/grpc v1.75.0 h1:+TW+dqTd2Biwe6KKfhE5JpiYIBWq865PhKGSXiivqt4=
+google.golang.org/grpc v1.75.0/go.mod h1:JtPAzKiq4v1xcAB2hydNlWI2RnF85XXcV0mhKXr2ecQ=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
@@ -471,8 +474,8 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
-google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
-google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
+google.golang.org/protobuf v1.36.8 h1:xHScyCOEuuwZEc6UtSOvPbAT4zRh0xcNRYekJwfqyMc=
+google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
@@ -482,27 +485,29 @@ gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
+gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
+gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-k8s.io/api v0.33.2 h1:YgwIS5jKfA+BZg//OQhkJNIfie/kmRsO0BmNaVSimvY=
-k8s.io/api v0.33.2/go.mod h1:fhrbphQJSM2cXzCWgqU29xLDuks4mu7ti9vveEnpSXs=
-k8s.io/apiextensions-apiserver v0.33.2 h1:6gnkIbngnaUflR3XwE1mCefN3YS8yTD631JXQhsU6M8=
-k8s.io/apiextensions-apiserver v0.33.2/go.mod h1:IvVanieYsEHJImTKXGP6XCOjTwv2LUMos0YWc9O+QP8=
-k8s.io/apimachinery v0.33.2 h1:IHFVhqg59mb8PJWTLi8m1mAoepkUNYmptHsV+Z1m5jY=
-k8s.io/apimachinery v0.33.2/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM=
-k8s.io/apiserver v0.33.2 h1:KGTRbxn2wJagJowo29kKBp4TchpO1DRO3g+dB/KOJN4=
-k8s.io/apiserver v0.33.2/go.mod h1:9qday04wEAMLPWWo9AwqCZSiIn3OYSZacDyu/AcoM/M=
-k8s.io/client-go v0.33.2 h1:z8CIcc0P581x/J1ZYf4CNzRKxRvQAwoAolYPbtQes+E=
-k8s.io/client-go v0.33.2/go.mod h1:9mCgT4wROvL948w6f6ArJNb7yQd7QsvqavDeZHvNmHo=
-k8s.io/component-base v0.33.2 h1:sCCsn9s/dG3ZrQTX/Us0/Sx2R0G5kwa0wbZFYoVp/+0=
-k8s.io/component-base v0.33.2/go.mod h1:/41uw9wKzuelhN+u+/C59ixxf4tYQKW7p32ddkYNe2k=
+k8s.io/api v0.33.4 h1:oTzrFVNPXBjMu0IlpA2eDDIU49jsuEorGHB4cvKupkk=
+k8s.io/api v0.33.4/go.mod h1:VHQZ4cuxQ9sCUMESJV5+Fe8bGnqAARZ08tSTdHWfeAc=
+k8s.io/apiextensions-apiserver v0.33.4 h1:rtq5SeXiDbXmSwxsF0MLe2Mtv3SwprA6wp+5qh/CrOU=
+k8s.io/apiextensions-apiserver v0.33.4/go.mod h1:mWXcZQkQV1GQyxeIjYApuqsn/081hhXPZwZ2URuJeSs=
+k8s.io/apimachinery v0.33.4 h1:SOf/JW33TP0eppJMkIgQ+L6atlDiP/090oaX0y9pd9s=
+k8s.io/apimachinery v0.33.4/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM=
+k8s.io/apiserver v0.33.4 h1:6N0TEVA6kASUS3owYDIFJjUH6lgN8ogQmzZvaFFj1/Y=
+k8s.io/apiserver v0.33.4/go.mod h1:8ODgXMnOoSPLMUg1aAzMFx+7wTJM+URil+INjbTZCok=
+k8s.io/client-go v0.33.4 h1:TNH+CSu8EmXfitntjUPwaKVPN0AYMbc9F1bBS8/ABpw=
+k8s.io/client-go v0.33.4/go.mod h1:LsA0+hBG2DPwovjd931L/AoaezMPX9CmBgyVyBZmbCY=
+k8s.io/component-base v0.33.4 h1:Jvb/aw/tl3pfgnJ0E0qPuYLT0NwdYs1VXXYQmSuxJGY=
+k8s.io/component-base v0.33.4/go.mod h1:567TeSdixWW2Xb1yYUQ7qk5Docp2kNznKL87eygY8Rc=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
-k8s.io/kube-openapi v0.0.0-20250701173324-9bd5c66d9911 h1:gAXU86Fmbr/ktY17lkHwSjw5aoThQvhnstGGIYKlKYc=
-k8s.io/kube-openapi v0.0.0-20250701173324-9bd5c66d9911/go.mod h1:GLOk5B+hDbRROvt0X2+hqX64v/zO3vXN7J78OUmBSKw=
+k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b h1:MloQ9/bdJyIu9lb1PzujOPolHyvO06MXG5TUIj2mNAA=
+k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b/go.mod h1:UZ2yyWbFTpuhSbFhv24aGNOdoRdJZgsIObGBUaYVsts=
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 h1:hwvWFiBzdWw1FhfY1FooPn3kzWuJ8tmbZBHi4zVsl1Y=
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
oras.land/oras-go/v2 v2.6.0 h1:X4ELRsiGkrbeox69+9tzTu492FMUu7zJQW6eJU+I2oc=
@@ -516,6 +521,8 @@ sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU=
sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
sigs.k8s.io/structured-merge-diff/v4 v4.7.0 h1:qPeWmscJcXP0snki5IYF79Z8xrl8ETFxgMd7wez1XkI=
sigs.k8s.io/structured-merge-diff/v4 v4.7.0/go.mod h1:dDy58f92j70zLsuZVuUX5Wp9vtxXpaZnkPGWeqDfCps=
+sigs.k8s.io/structured-merge-diff/v6 v6.3.0 h1:jTijUJbW353oVOd9oTlifJqOGEkUw2jB/fXCbTiQEco=
+sigs.k8s.io/structured-merge-diff/v6 v6.3.0/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE=
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
-sigs.k8s.io/yaml v1.5.0 h1:M10b2U7aEUY6hRtU870n2VTPgR5RZiL/I6Lcc2F4NUQ=
-sigs.k8s.io/yaml v1.5.0/go.mod h1:wZs27Rbxoai4C0f8/9urLZtZtF3avA3gKvGyPdDqTO4=
+sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs=
+sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4=
diff --git a/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/.gitignore b/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/.gitignore
new file mode 100644
index 000000000..6b061e617
--- /dev/null
+++ b/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/.gitignore
@@ -0,0 +1 @@
+_fuzz/
\ No newline at end of file
diff --git a/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/.golangci.yml b/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/.golangci.yml
new file mode 100644
index 000000000..fbc633259
--- /dev/null
+++ b/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/.golangci.yml
@@ -0,0 +1,27 @@
+run:
+ deadline: 2m
+
+linters:
+ disable-all: true
+ enable:
+ - misspell
+ - govet
+ - staticcheck
+ - errcheck
+ - unparam
+ - ineffassign
+ - nakedret
+ - gocyclo
+ - dupl
+ - goimports
+ - revive
+ - gosec
+ - gosimple
+ - typecheck
+ - unused
+
+linters-settings:
+ gofmt:
+ simplify: true
+ dupl:
+ threshold: 600
diff --git a/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/CHANGELOG.md b/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/CHANGELOG.md
new file mode 100644
index 000000000..fabe5e43d
--- /dev/null
+++ b/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/CHANGELOG.md
@@ -0,0 +1,268 @@
+# Changelog
+
+## 3.4.0 (2025-06-27)
+
+### Added
+
+- #268: Added property to Constraints to include prereleases for Check and Validate
+
+### Changed
+
+- #263: Updated Go testing for 1.24, 1.23, and 1.22
+- #269: Updated the error message handling for message case and wrapping errors
+- #266: Restore the ability to have leading 0's when parsing with NewVersion.
+ Opt-out of this by setting CoerceNewVersion to false.
+
+### Fixed
+
+- #257: Fixed the CodeQL link (thanks @dmitris)
+- #262: Restored detailed errors when failed to parse with NewVersion. Opt-out
+ of this by setting DetailedNewVersionErrors to false for faster performance.
+- #267: Handle pre-releases for an "and" group if one constraint includes them
+
+## 3.3.1 (2024-11-19)
+
+### Fixed
+
+- #253: Fix for allowing some version that were invalid
+
+## 3.3.0 (2024-08-27)
+
+### Added
+
+- #238: Add LessThanEqual and GreaterThanEqual functions (thanks @grosser)
+- #213: nil version equality checking (thanks @KnutZuidema)
+
+### Changed
+
+- #241: Simplify StrictNewVersion parsing (thanks @grosser)
+- Testing support up through Go 1.23
+- Minimum version set to 1.21 as this is what's tested now
+- Fuzz testing now supports caching
+
+## 3.2.1 (2023-04-10)
+
+### Changed
+
+- #198: Improved testing around pre-release names
+- #200: Improved code scanning with addition of CodeQL
+- #201: Testing now includes Go 1.20. Go 1.17 has been dropped
+- #202: Migrated Fuzz testing to Go built-in Fuzzing. CI runs daily
+- #203: Docs updated for security details
+
+### Fixed
+
+- #199: Fixed issue with range transformations
+
+## 3.2.0 (2022-11-28)
+
+### Added
+
+- #190: Added text marshaling and unmarshaling
+- #167: Added JSON marshalling for constraints (thanks @SimonTheLeg)
+- #173: Implement encoding.TextMarshaler and encoding.TextUnmarshaler on Version (thanks @MarkRosemaker)
+- #179: Added New() version constructor (thanks @kazhuravlev)
+
+### Changed
+
+- #182/#183: Updated CI testing setup
+
+### Fixed
+
+- #186: Fixing issue where validation of constraint section gave false positives
+- #176: Fix constraints check with *-0 (thanks @mtt0)
+- #181: Fixed Caret operator (^) gives unexpected results when the minor version in constraint is 0 (thanks @arshchimni)
+- #161: Fixed godoc (thanks @afirth)
+
+## 3.1.1 (2020-11-23)
+
+### Fixed
+
+- #158: Fixed issue with generated regex operation order that could cause problem
+
+## 3.1.0 (2020-04-15)
+
+### Added
+
+- #131: Add support for serializing/deserializing SQL (thanks @ryancurrah)
+
+### Changed
+
+- #148: More accurate validation messages on constraints
+
+## 3.0.3 (2019-12-13)
+
+### Fixed
+
+- #141: Fixed issue with <= comparison
+
+## 3.0.2 (2019-11-14)
+
+### Fixed
+
+- #134: Fixed broken constraint checking with ^0.0 (thanks @krmichelos)
+
+## 3.0.1 (2019-09-13)
+
+### Fixed
+
+- #125: Fixes issue with module path for v3
+
+## 3.0.0 (2019-09-12)
+
+This is a major release of the semver package which includes API changes. The Go
+API is compatible with ^1. The Go API was not changed because many people are using
+`go get` without Go modules for their applications and API breaking changes cause
+errors which we have or would need to support.
+
+The changes in this release are the handling based on the data passed into the
+functions. These are described in the added and changed sections below.
+
+### Added
+
+- StrictNewVersion function. This is similar to NewVersion but will return an
+ error if the version passed in is not a strict semantic version. For example,
+ 1.2.3 would pass but v1.2.3 or 1.2 would fail because they are not strictly
+ speaking semantic versions. This function is faster, performs fewer operations,
+ and uses fewer allocations than NewVersion.
+- Fuzzing has been performed on NewVersion, StrictNewVersion, and NewConstraint.
+ The Makefile contains the operations used. For more information on you can start
+ on Wikipedia at https://en.wikipedia.org/wiki/Fuzzing
+- Now using Go modules
+
+### Changed
+
+- NewVersion has proper prerelease and metadata validation with error messages
+ to signal an issue with either of them
+- ^ now operates using a similar set of rules to npm/js and Rust/Cargo. If the
+ version is >=1 the ^ ranges works the same as v1. For major versions of 0 the
+ rules have changed. The minor version is treated as the stable version unless
+ a patch is specified and then it is equivalent to =. One difference from npm/js
+ is that prereleases there are only to a specific version (e.g. 1.2.3).
+ Prereleases here look over multiple versions and follow semantic version
+ ordering rules. This pattern now follows along with the expected and requested
+ handling of this packaged by numerous users.
+
+## 1.5.0 (2019-09-11)
+
+### Added
+
+- #103: Add basic fuzzing for `NewVersion()` (thanks @jesse-c)
+
+### Changed
+
+- #82: Clarify wildcard meaning in range constraints and update tests for it (thanks @greysteil)
+- #83: Clarify caret operator range for pre-1.0.0 dependencies (thanks @greysteil)
+- #72: Adding docs comment pointing to vert for a cli
+- #71: Update the docs on pre-release comparator handling
+- #89: Test with new go versions (thanks @thedevsaddam)
+- #87: Added $ to ValidPrerelease for better validation (thanks @jeremycarroll)
+
+### Fixed
+
+- #78: Fix unchecked error in example code (thanks @ravron)
+- #70: Fix the handling of pre-releases and the 0.0.0 release edge case
+- #97: Fixed copyright file for proper display on GitHub
+- #107: Fix handling prerelease when sorting alphanum and num
+- #109: Fixed where Validate sometimes returns wrong message on error
+
+## 1.4.2 (2018-04-10)
+
+### Changed
+
+- #72: Updated the docs to point to vert for a console appliaction
+- #71: Update the docs on pre-release comparator handling
+
+### Fixed
+
+- #70: Fix the handling of pre-releases and the 0.0.0 release edge case
+
+## 1.4.1 (2018-04-02)
+
+### Fixed
+
+- Fixed #64: Fix pre-release precedence issue (thanks @uudashr)
+
+## 1.4.0 (2017-10-04)
+
+### Changed
+
+- #61: Update NewVersion to parse ints with a 64bit int size (thanks @zknill)
+
+## 1.3.1 (2017-07-10)
+
+### Fixed
+
+- Fixed #57: number comparisons in prerelease sometimes inaccurate
+
+## 1.3.0 (2017-05-02)
+
+### Added
+
+- #45: Added json (un)marshaling support (thanks @mh-cbon)
+- Stability marker. See https://masterminds.github.io/stability/
+
+### Fixed
+
+- #51: Fix handling of single digit tilde constraint (thanks @dgodd)
+
+### Changed
+
+- #55: The godoc icon moved from png to svg
+
+## 1.2.3 (2017-04-03)
+
+### Fixed
+
+- #46: Fixed 0.x.x and 0.0.x in constraints being treated as *
+
+## Release 1.2.2 (2016-12-13)
+
+### Fixed
+
+- #34: Fixed issue where hyphen range was not working with pre-release parsing.
+
+## Release 1.2.1 (2016-11-28)
+
+### Fixed
+
+- #24: Fixed edge case issue where constraint "> 0" does not handle "0.0.1-alpha"
+ properly.
+
+## Release 1.2.0 (2016-11-04)
+
+### Added
+
+- #20: Added MustParse function for versions (thanks @adamreese)
+- #15: Added increment methods on versions (thanks @mh-cbon)
+
+### Fixed
+
+- Issue #21: Per the SemVer spec (section 9) a pre-release is unstable and
+ might not satisfy the intended compatibility. The change here ignores pre-releases
+ on constraint checks (e.g., ~ or ^) when a pre-release is not part of the
+ constraint. For example, `^1.2.3` will ignore pre-releases while
+ `^1.2.3-alpha` will include them.
+
+## Release 1.1.1 (2016-06-30)
+
+### Changed
+
+- Issue #9: Speed up version comparison performance (thanks @sdboyer)
+- Issue #8: Added benchmarks (thanks @sdboyer)
+- Updated Go Report Card URL to new location
+- Updated Readme to add code snippet formatting (thanks @mh-cbon)
+- Updating tagging to v[SemVer] structure for compatibility with other tools.
+
+## Release 1.1.0 (2016-03-11)
+
+- Issue #2: Implemented validation to provide reasons a versions failed a
+ constraint.
+
+## Release 1.0.1 (2015-12-31)
+
+- Fixed #1: * constraint failing on valid versions.
+
+## Release 1.0.0 (2015-10-20)
+
+- Initial release
diff --git a/openshift/default-catalog-consistency/vendor/github.com/mitchellh/mapstructure/LICENSE b/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/LICENSE.txt
similarity index 94%
rename from openshift/default-catalog-consistency/vendor/github.com/mitchellh/mapstructure/LICENSE
rename to openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/LICENSE.txt
index f9c841a51..9ff7da9c4 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/mitchellh/mapstructure/LICENSE
+++ b/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/LICENSE.txt
@@ -1,6 +1,4 @@
-The MIT License (MIT)
-
-Copyright (c) 2013 Mitchell Hashimoto
+Copyright (C) 2014-2019, Matt Butcher and Matt Farina
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/Makefile b/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/Makefile
new file mode 100644
index 000000000..9ca87a2c7
--- /dev/null
+++ b/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/Makefile
@@ -0,0 +1,31 @@
+GOPATH=$(shell go env GOPATH)
+GOLANGCI_LINT=$(GOPATH)/bin/golangci-lint
+
+.PHONY: lint
+lint: $(GOLANGCI_LINT)
+ @echo "==> Linting codebase"
+ @$(GOLANGCI_LINT) run
+
+.PHONY: test
+test:
+ @echo "==> Running tests"
+ GO111MODULE=on go test -v
+
+.PHONY: test-cover
+test-cover:
+ @echo "==> Running Tests with coverage"
+ GO111MODULE=on go test -cover .
+
+.PHONY: fuzz
+fuzz:
+ @echo "==> Running Fuzz Tests"
+ go env GOCACHE
+ go test -fuzz=FuzzNewVersion -fuzztime=15s .
+ go test -fuzz=FuzzStrictNewVersion -fuzztime=15s .
+ go test -fuzz=FuzzNewConstraint -fuzztime=15s .
+
+$(GOLANGCI_LINT):
+ # Install golangci-lint. The configuration for it is in the .golangci.yml
+ # file in the root of the repository
+ echo ${GOPATH}
+ curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(GOPATH)/bin v1.56.2
diff --git a/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/README.md b/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/README.md
new file mode 100644
index 000000000..2f56c676a
--- /dev/null
+++ b/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/README.md
@@ -0,0 +1,274 @@
+# SemVer
+
+The `semver` package provides the ability to work with [Semantic Versions](http://semver.org) in Go. Specifically it provides the ability to:
+
+* Parse semantic versions
+* Sort semantic versions
+* Check if a semantic version fits within a set of constraints
+* Optionally work with a `v` prefix
+
+[](https://masterminds.github.io/stability/active.html)
+[](https://github.com/Masterminds/semver/actions)
+[](https://pkg.go.dev/github.com/Masterminds/semver/v3)
+[](https://goreportcard.com/report/github.com/Masterminds/semver)
+
+## Package Versions
+
+Note, import `github.com/Masterminds/semver/v3` to use the latest version.
+
+There are three major versions fo the `semver` package.
+
+* 3.x.x is the stable and active version. This version is focused on constraint
+ compatibility for range handling in other tools from other languages. It has
+ a similar API to the v1 releases. The development of this version is on the master
+ branch. The documentation for this version is below.
+* 2.x was developed primarily for [dep](https://github.com/golang/dep). There are
+ no tagged releases and the development was performed by [@sdboyer](https://github.com/sdboyer).
+ There are API breaking changes from v1. This version lives on the [2.x branch](https://github.com/Masterminds/semver/tree/2.x).
+* 1.x.x is the original release. It is no longer maintained. You should use the
+ v3 release instead. You can read the documentation for the 1.x.x release
+ [here](https://github.com/Masterminds/semver/blob/release-1/README.md).
+
+## Parsing Semantic Versions
+
+There are two functions that can parse semantic versions. The `StrictNewVersion`
+function only parses valid version 2 semantic versions as outlined in the
+specification. The `NewVersion` function attempts to coerce a version into a
+semantic version and parse it. For example, if there is a leading v or a version
+listed without all 3 parts (e.g. `v1.2`) it will attempt to coerce it into a valid
+semantic version (e.g., 1.2.0). In both cases a `Version` object is returned
+that can be sorted, compared, and used in constraints.
+
+When parsing a version an error is returned if there is an issue parsing the
+version. For example,
+
+ v, err := semver.NewVersion("1.2.3-beta.1+build345")
+
+The version object has methods to get the parts of the version, compare it to
+other versions, convert the version back into a string, and get the original
+string. Getting the original string is useful if the semantic version was coerced
+into a valid form.
+
+There are package level variables that affect how `NewVersion` handles parsing.
+
+- `CoerceNewVersion` is `true` by default. When set to `true` it coerces non-compliant
+ versions into SemVer. For example, allowing a leading 0 in a major, minor, or patch
+ part. This enables the use of CalVer in versions even when not compliant with SemVer.
+ When set to `false` less coercion work is done.
+- `DetailedNewVersionErrors` provides more detailed errors. It only has an affect when
+ `CoerceNewVersion` is set to `false`. When `DetailedNewVersionErrors` is set to `true`
+ it can provide some more insight into why a version is invalid. Setting
+ `DetailedNewVersionErrors` to `false` is faster on performance but provides less
+ detailed error messages if a version fails to parse.
+
+## Sorting Semantic Versions
+
+A set of versions can be sorted using the `sort` package from the standard library.
+For example,
+
+```go
+raw := []string{"1.2.3", "1.0", "1.3", "2", "0.4.2",}
+vs := make([]*semver.Version, len(raw))
+for i, r := range raw {
+ v, err := semver.NewVersion(r)
+ if err != nil {
+ t.Errorf("Error parsing version: %s", err)
+ }
+
+ vs[i] = v
+}
+
+sort.Sort(semver.Collection(vs))
+```
+
+## Checking Version Constraints
+
+There are two methods for comparing versions. One uses comparison methods on
+`Version` instances and the other uses `Constraints`. There are some important
+differences to notes between these two methods of comparison.
+
+1. When two versions are compared using functions such as `Compare`, `LessThan`,
+ and others it will follow the specification and always include pre-releases
+ within the comparison. It will provide an answer that is valid with the
+ comparison section of the spec at https://semver.org/#spec-item-11
+2. When constraint checking is used for checks or validation it will follow a
+ different set of rules that are common for ranges with tools like npm/js
+ and Rust/Cargo. This includes considering pre-releases to be invalid if the
+ ranges does not include one. If you want to have it include pre-releases a
+ simple solution is to include `-0` in your range.
+3. Constraint ranges can have some complex rules including the shorthand use of
+ ~ and ^. For more details on those see the options below.
+
+There are differences between the two methods or checking versions because the
+comparison methods on `Version` follow the specification while comparison ranges
+are not part of the specification. Different packages and tools have taken it
+upon themselves to come up with range rules. This has resulted in differences.
+For example, npm/js and Cargo/Rust follow similar patterns while PHP has a
+different pattern for ^. The comparison features in this package follow the
+npm/js and Cargo/Rust lead because applications using it have followed similar
+patters with their versions.
+
+Checking a version against version constraints is one of the most featureful
+parts of the package.
+
+```go
+c, err := semver.NewConstraint(">= 1.2.3")
+if err != nil {
+ // Handle constraint not being parsable.
+}
+
+v, err := semver.NewVersion("1.3")
+if err != nil {
+ // Handle version not being parsable.
+}
+// Check if the version meets the constraints. The variable a will be true.
+a := c.Check(v)
+```
+
+### Basic Comparisons
+
+There are two elements to the comparisons. First, a comparison string is a list
+of space or comma separated AND comparisons. These are then separated by || (OR)
+comparisons. For example, `">= 1.2 < 3.0.0 || >= 4.2.3"` is looking for a
+comparison that's greater than or equal to 1.2 and less than 3.0.0 or is
+greater than or equal to 4.2.3.
+
+The basic comparisons are:
+
+* `=`: equal (aliased to no operator)
+* `!=`: not equal
+* `>`: greater than
+* `<`: less than
+* `>=`: greater than or equal to
+* `<=`: less than or equal to
+
+### Working With Prerelease Versions
+
+Pre-releases, for those not familiar with them, are used for software releases
+prior to stable or generally available releases. Examples of pre-releases include
+development, alpha, beta, and release candidate releases. A pre-release may be
+a version such as `1.2.3-beta.1` while the stable release would be `1.2.3`. In the
+order of precedence, pre-releases come before their associated releases. In this
+example `1.2.3-beta.1 < 1.2.3`.
+
+According to the Semantic Version specification, pre-releases may not be
+API compliant with their release counterpart. It says,
+
+> A pre-release version indicates that the version is unstable and might not satisfy the intended compatibility requirements as denoted by its associated normal version.
+
+SemVer's comparisons using constraints without a pre-release comparator will skip
+pre-release versions. For example, `>=1.2.3` will skip pre-releases when looking
+at a list of releases while `>=1.2.3-0` will evaluate and find pre-releases.
+
+The reason for the `0` as a pre-release version in the example comparison is
+because pre-releases can only contain ASCII alphanumerics and hyphens (along with
+`.` separators), per the spec. Sorting happens in ASCII sort order, again per the
+spec. The lowest character is a `0` in ASCII sort order
+(see an [ASCII Table](http://www.asciitable.com/))
+
+Understanding ASCII sort ordering is important because A-Z comes before a-z. That
+means `>=1.2.3-BETA` will return `1.2.3-alpha`. What you might expect from case
+sensitivity doesn't apply here. This is due to ASCII sort ordering which is what
+the spec specifies.
+
+The `Constraints` instance returned from `semver.NewConstraint()` has a property
+`IncludePrerelease` that, when set to true, will return prerelease versions when calls
+to `Check()` and `Validate()` are made.
+
+### Hyphen Range Comparisons
+
+There are multiple methods to handle ranges and the first is hyphens ranges.
+These look like:
+
+* `1.2 - 1.4.5` which is equivalent to `>= 1.2 <= 1.4.5`
+* `2.3.4 - 4.5` which is equivalent to `>= 2.3.4 <= 4.5`
+
+Note that `1.2-1.4.5` without whitespace is parsed completely differently; it's
+parsed as a single constraint `1.2.0` with _prerelease_ `1.4.5`.
+
+### Wildcards In Comparisons
+
+The `x`, `X`, and `*` characters can be used as a wildcard character. This works
+for all comparison operators. When used on the `=` operator it falls
+back to the patch level comparison (see tilde below). For example,
+
+* `1.2.x` is equivalent to `>= 1.2.0, < 1.3.0`
+* `>= 1.2.x` is equivalent to `>= 1.2.0`
+* `<= 2.x` is equivalent to `< 3`
+* `*` is equivalent to `>= 0.0.0`
+
+### Tilde Range Comparisons (Patch)
+
+The tilde (`~`) comparison operator is for patch level ranges when a minor
+version is specified and major level changes when the minor number is missing.
+For example,
+
+* `~1.2.3` is equivalent to `>= 1.2.3, < 1.3.0`
+* `~1` is equivalent to `>= 1, < 2`
+* `~2.3` is equivalent to `>= 2.3, < 2.4`
+* `~1.2.x` is equivalent to `>= 1.2.0, < 1.3.0`
+* `~1.x` is equivalent to `>= 1, < 2`
+
+### Caret Range Comparisons (Major)
+
+The caret (`^`) comparison operator is for major level changes once a stable
+(1.0.0) release has occurred. Prior to a 1.0.0 release the minor versions acts
+as the API stability level. This is useful when comparisons of API versions as a
+major change is API breaking. For example,
+
+* `^1.2.3` is equivalent to `>= 1.2.3, < 2.0.0`
+* `^1.2.x` is equivalent to `>= 1.2.0, < 2.0.0`
+* `^2.3` is equivalent to `>= 2.3, < 3`
+* `^2.x` is equivalent to `>= 2.0.0, < 3`
+* `^0.2.3` is equivalent to `>=0.2.3 <0.3.0`
+* `^0.2` is equivalent to `>=0.2.0 <0.3.0`
+* `^0.0.3` is equivalent to `>=0.0.3 <0.0.4`
+* `^0.0` is equivalent to `>=0.0.0 <0.1.0`
+* `^0` is equivalent to `>=0.0.0 <1.0.0`
+
+## Validation
+
+In addition to testing a version against a constraint, a version can be validated
+against a constraint. When validation fails a slice of errors containing why a
+version didn't meet the constraint is returned. For example,
+
+```go
+c, err := semver.NewConstraint("<= 1.2.3, >= 1.4")
+if err != nil {
+ // Handle constraint not being parseable.
+}
+
+v, err := semver.NewVersion("1.3")
+if err != nil {
+ // Handle version not being parseable.
+}
+
+// Validate a version against a constraint.
+a, msgs := c.Validate(v)
+// a is false
+for _, m := range msgs {
+ fmt.Println(m)
+
+ // Loops over the errors which would read
+ // "1.3 is greater than 1.2.3"
+ // "1.3 is less than 1.4"
+}
+```
+
+## Contribute
+
+If you find an issue or want to contribute please file an [issue](https://github.com/Masterminds/semver/issues)
+or [create a pull request](https://github.com/Masterminds/semver/pulls).
+
+## Security
+
+Security is an important consideration for this project. The project currently
+uses the following tools to help discover security issues:
+
+* [CodeQL](https://codeql.github.com)
+* [gosec](https://github.com/securego/gosec)
+* Daily Fuzz testing
+
+If you believe you have found a security vulnerability you can privately disclose
+it through the [GitHub security page](https://github.com/Masterminds/semver/security).
diff --git a/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/SECURITY.md b/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/SECURITY.md
new file mode 100644
index 000000000..a30a66b1f
--- /dev/null
+++ b/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/SECURITY.md
@@ -0,0 +1,19 @@
+# Security Policy
+
+## Supported Versions
+
+The following versions of semver are currently supported:
+
+| Version | Supported |
+| ------- | ------------------ |
+| 3.x | :white_check_mark: |
+| 2.x | :x: |
+| 1.x | :x: |
+
+Fixes are only released for the latest minor version in the form of a patch release.
+
+## Reporting a Vulnerability
+
+You can privately disclose a vulnerability through GitHubs
+[private vulnerability reporting](https://github.com/Masterminds/semver/security/advisories)
+mechanism.
diff --git a/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/collection.go b/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/collection.go
new file mode 100644
index 000000000..a78235895
--- /dev/null
+++ b/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/collection.go
@@ -0,0 +1,24 @@
+package semver
+
+// Collection is a collection of Version instances and implements the sort
+// interface. See the sort package for more details.
+// https://golang.org/pkg/sort/
+type Collection []*Version
+
+// Len returns the length of a collection. The number of Version instances
+// on the slice.
+func (c Collection) Len() int {
+ return len(c)
+}
+
+// Less is needed for the sort interface to compare two Version objects on the
+// slice. If checks if one is less than the other.
+func (c Collection) Less(i, j int) bool {
+ return c[i].LessThan(c[j])
+}
+
+// Swap is needed for the sort interface to replace the Version objects
+// at two different positions in the slice.
+func (c Collection) Swap(i, j int) {
+ c[i], c[j] = c[j], c[i]
+}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/constraints.go b/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/constraints.go
new file mode 100644
index 000000000..8b7a10f83
--- /dev/null
+++ b/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/constraints.go
@@ -0,0 +1,601 @@
+package semver
+
+import (
+ "bytes"
+ "errors"
+ "fmt"
+ "regexp"
+ "strings"
+)
+
+// Constraints is one or more constraint that a semantic version can be
+// checked against.
+type Constraints struct {
+ constraints [][]*constraint
+ containsPre []bool
+
+ // IncludePrerelease specifies if pre-releases should be included in
+ // the results. Note, if a constraint range has a prerelease than
+ // prereleases will be included for that AND group even if this is
+ // set to false.
+ IncludePrerelease bool
+}
+
+// NewConstraint returns a Constraints instance that a Version instance can
+// be checked against. If there is a parse error it will be returned.
+func NewConstraint(c string) (*Constraints, error) {
+
+ // Rewrite - ranges into a comparison operation.
+ c = rewriteRange(c)
+
+ ors := strings.Split(c, "||")
+ lenors := len(ors)
+ or := make([][]*constraint, lenors)
+ hasPre := make([]bool, lenors)
+ for k, v := range ors {
+ // Validate the segment
+ if !validConstraintRegex.MatchString(v) {
+ return nil, fmt.Errorf("improper constraint: %s", v)
+ }
+
+ cs := findConstraintRegex.FindAllString(v, -1)
+ if cs == nil {
+ cs = append(cs, v)
+ }
+ result := make([]*constraint, len(cs))
+ for i, s := range cs {
+ pc, err := parseConstraint(s)
+ if err != nil {
+ return nil, err
+ }
+
+ // If one of the constraints has a prerelease record this.
+ // This information is used when checking all in an "and"
+ // group to ensure they all check for prereleases.
+ if pc.con.pre != "" {
+ hasPre[k] = true
+ }
+
+ result[i] = pc
+ }
+ or[k] = result
+ }
+
+ o := &Constraints{
+ constraints: or,
+ containsPre: hasPre,
+ }
+ return o, nil
+}
+
+// Check tests if a version satisfies the constraints.
+func (cs Constraints) Check(v *Version) bool {
+ // TODO(mattfarina): For v4 of this library consolidate the Check and Validate
+ // functions as the underlying functions make that possible now.
+ // loop over the ORs and check the inner ANDs
+ for i, o := range cs.constraints {
+ joy := true
+ for _, c := range o {
+ if check, _ := c.check(v, (cs.IncludePrerelease || cs.containsPre[i])); !check {
+ joy = false
+ break
+ }
+ }
+
+ if joy {
+ return true
+ }
+ }
+
+ return false
+}
+
+// Validate checks if a version satisfies a constraint. If not a slice of
+// reasons for the failure are returned in addition to a bool.
+func (cs Constraints) Validate(v *Version) (bool, []error) {
+ // loop over the ORs and check the inner ANDs
+ var e []error
+
+ // Capture the prerelease message only once. When it happens the first time
+ // this var is marked
+ var prerelesase bool
+ for i, o := range cs.constraints {
+ joy := true
+ for _, c := range o {
+ // Before running the check handle the case there the version is
+ // a prerelease and the check is not searching for prereleases.
+ if !(cs.IncludePrerelease || cs.containsPre[i]) && v.pre != "" {
+ if !prerelesase {
+ em := fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v)
+ e = append(e, em)
+ prerelesase = true
+ }
+ joy = false
+
+ } else {
+
+ if _, err := c.check(v, (cs.IncludePrerelease || cs.containsPre[i])); err != nil {
+ e = append(e, err)
+ joy = false
+ }
+ }
+ }
+
+ if joy {
+ return true, []error{}
+ }
+ }
+
+ return false, e
+}
+
+func (cs Constraints) String() string {
+ buf := make([]string, len(cs.constraints))
+ var tmp bytes.Buffer
+
+ for k, v := range cs.constraints {
+ tmp.Reset()
+ vlen := len(v)
+ for kk, c := range v {
+ tmp.WriteString(c.string())
+
+ // Space separate the AND conditions
+ if vlen > 1 && kk < vlen-1 {
+ tmp.WriteString(" ")
+ }
+ }
+ buf[k] = tmp.String()
+ }
+
+ return strings.Join(buf, " || ")
+}
+
+// UnmarshalText implements the encoding.TextUnmarshaler interface.
+func (cs *Constraints) UnmarshalText(text []byte) error {
+ temp, err := NewConstraint(string(text))
+ if err != nil {
+ return err
+ }
+
+ *cs = *temp
+
+ return nil
+}
+
+// MarshalText implements the encoding.TextMarshaler interface.
+func (cs Constraints) MarshalText() ([]byte, error) {
+ return []byte(cs.String()), nil
+}
+
+var constraintOps map[string]cfunc
+var constraintRegex *regexp.Regexp
+var constraintRangeRegex *regexp.Regexp
+
+// Used to find individual constraints within a multi-constraint string
+var findConstraintRegex *regexp.Regexp
+
+// Used to validate an segment of ANDs is valid
+var validConstraintRegex *regexp.Regexp
+
+const cvRegex string = `v?([0-9|x|X|\*]+)(\.[0-9|x|X|\*]+)?(\.[0-9|x|X|\*]+)?` +
+ `(-([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` +
+ `(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?`
+
+func init() {
+ constraintOps = map[string]cfunc{
+ "": constraintTildeOrEqual,
+ "=": constraintTildeOrEqual,
+ "!=": constraintNotEqual,
+ ">": constraintGreaterThan,
+ "<": constraintLessThan,
+ ">=": constraintGreaterThanEqual,
+ "=>": constraintGreaterThanEqual,
+ "<=": constraintLessThanEqual,
+ "=<": constraintLessThanEqual,
+ "~": constraintTilde,
+ "~>": constraintTilde,
+ "^": constraintCaret,
+ }
+
+ ops := `=||!=|>|<|>=|=>|<=|=<|~|~>|\^`
+
+ constraintRegex = regexp.MustCompile(fmt.Sprintf(
+ `^\s*(%s)\s*(%s)\s*$`,
+ ops,
+ cvRegex))
+
+ constraintRangeRegex = regexp.MustCompile(fmt.Sprintf(
+ `\s*(%s)\s+-\s+(%s)\s*`,
+ cvRegex, cvRegex))
+
+ findConstraintRegex = regexp.MustCompile(fmt.Sprintf(
+ `(%s)\s*(%s)`,
+ ops,
+ cvRegex))
+
+ // The first time a constraint shows up will look slightly different from
+ // future times it shows up due to a leading space or comma in a given
+ // string.
+ validConstraintRegex = regexp.MustCompile(fmt.Sprintf(
+ `^(\s*(%s)\s*(%s)\s*)((?:\s+|,\s*)(%s)\s*(%s)\s*)*$`,
+ ops,
+ cvRegex,
+ ops,
+ cvRegex))
+}
+
+// An individual constraint
+type constraint struct {
+ // The version used in the constraint check. For example, if a constraint
+ // is '<= 2.0.0' the con a version instance representing 2.0.0.
+ con *Version
+
+ // The original parsed version (e.g., 4.x from != 4.x)
+ orig string
+
+ // The original operator for the constraint
+ origfunc string
+
+ // When an x is used as part of the version (e.g., 1.x)
+ minorDirty bool
+ dirty bool
+ patchDirty bool
+}
+
+// Check if a version meets the constraint
+func (c *constraint) check(v *Version, includePre bool) (bool, error) {
+ return constraintOps[c.origfunc](v, c, includePre)
+}
+
+// String prints an individual constraint into a string
+func (c *constraint) string() string {
+ return c.origfunc + c.orig
+}
+
+type cfunc func(v *Version, c *constraint, includePre bool) (bool, error)
+
+func parseConstraint(c string) (*constraint, error) {
+ if len(c) > 0 {
+ m := constraintRegex.FindStringSubmatch(c)
+ if m == nil {
+ return nil, fmt.Errorf("improper constraint: %s", c)
+ }
+
+ cs := &constraint{
+ orig: m[2],
+ origfunc: m[1],
+ }
+
+ ver := m[2]
+ minorDirty := false
+ patchDirty := false
+ dirty := false
+ if isX(m[3]) || m[3] == "" {
+ ver = fmt.Sprintf("0.0.0%s", m[6])
+ dirty = true
+ } else if isX(strings.TrimPrefix(m[4], ".")) || m[4] == "" {
+ minorDirty = true
+ dirty = true
+ ver = fmt.Sprintf("%s.0.0%s", m[3], m[6])
+ } else if isX(strings.TrimPrefix(m[5], ".")) || m[5] == "" {
+ dirty = true
+ patchDirty = true
+ ver = fmt.Sprintf("%s%s.0%s", m[3], m[4], m[6])
+ }
+
+ con, err := NewVersion(ver)
+ if err != nil {
+
+ // The constraintRegex should catch any regex parsing errors. So,
+ // we should never get here.
+ return nil, errors.New("constraint parser error")
+ }
+
+ cs.con = con
+ cs.minorDirty = minorDirty
+ cs.patchDirty = patchDirty
+ cs.dirty = dirty
+
+ return cs, nil
+ }
+
+ // The rest is the special case where an empty string was passed in which
+ // is equivalent to * or >=0.0.0
+ con, err := StrictNewVersion("0.0.0")
+ if err != nil {
+
+ // The constraintRegex should catch any regex parsing errors. So,
+ // we should never get here.
+ return nil, errors.New("constraint parser error")
+ }
+
+ cs := &constraint{
+ con: con,
+ orig: c,
+ origfunc: "",
+ minorDirty: false,
+ patchDirty: false,
+ dirty: true,
+ }
+ return cs, nil
+}
+
+// Constraint functions
+func constraintNotEqual(v *Version, c *constraint, includePre bool) (bool, error) {
+ // The existence of prereleases is checked at the group level and passed in.
+ // Exit early if the version has a prerelease but those are to be ignored.
+ if v.Prerelease() != "" && !includePre {
+ return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v)
+ }
+
+ if c.dirty {
+ if c.con.Major() != v.Major() {
+ return true, nil
+ }
+ if c.con.Minor() != v.Minor() && !c.minorDirty {
+ return true, nil
+ } else if c.minorDirty {
+ return false, fmt.Errorf("%s is equal to %s", v, c.orig)
+ } else if c.con.Patch() != v.Patch() && !c.patchDirty {
+ return true, nil
+ } else if c.patchDirty {
+ // Need to handle prereleases if present
+ if v.Prerelease() != "" || c.con.Prerelease() != "" {
+ eq := comparePrerelease(v.Prerelease(), c.con.Prerelease()) != 0
+ if eq {
+ return true, nil
+ }
+ return false, fmt.Errorf("%s is equal to %s", v, c.orig)
+ }
+ return false, fmt.Errorf("%s is equal to %s", v, c.orig)
+ }
+ }
+
+ eq := v.Equal(c.con)
+ if eq {
+ return false, fmt.Errorf("%s is equal to %s", v, c.orig)
+ }
+
+ return true, nil
+}
+
+func constraintGreaterThan(v *Version, c *constraint, includePre bool) (bool, error) {
+
+ // The existence of prereleases is checked at the group level and passed in.
+ // Exit early if the version has a prerelease but those are to be ignored.
+ if v.Prerelease() != "" && !includePre {
+ return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v)
+ }
+
+ var eq bool
+
+ if !c.dirty {
+ eq = v.Compare(c.con) == 1
+ if eq {
+ return true, nil
+ }
+ return false, fmt.Errorf("%s is less than or equal to %s", v, c.orig)
+ }
+
+ if v.Major() > c.con.Major() {
+ return true, nil
+ } else if v.Major() < c.con.Major() {
+ return false, fmt.Errorf("%s is less than or equal to %s", v, c.orig)
+ } else if c.minorDirty {
+ // This is a range case such as >11. When the version is something like
+ // 11.1.0 is it not > 11. For that we would need 12 or higher
+ return false, fmt.Errorf("%s is less than or equal to %s", v, c.orig)
+ } else if c.patchDirty {
+ // This is for ranges such as >11.1. A version of 11.1.1 is not greater
+ // which one of 11.2.1 is greater
+ eq = v.Minor() > c.con.Minor()
+ if eq {
+ return true, nil
+ }
+ return false, fmt.Errorf("%s is less than or equal to %s", v, c.orig)
+ }
+
+ // If we have gotten here we are not comparing pre-preleases and can use the
+ // Compare function to accomplish that.
+ eq = v.Compare(c.con) == 1
+ if eq {
+ return true, nil
+ }
+ return false, fmt.Errorf("%s is less than or equal to %s", v, c.orig)
+}
+
+func constraintLessThan(v *Version, c *constraint, includePre bool) (bool, error) {
+ // The existence of prereleases is checked at the group level and passed in.
+ // Exit early if the version has a prerelease but those are to be ignored.
+ if v.Prerelease() != "" && !includePre {
+ return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v)
+ }
+
+ eq := v.Compare(c.con) < 0
+ if eq {
+ return true, nil
+ }
+ return false, fmt.Errorf("%s is greater than or equal to %s", v, c.orig)
+}
+
+func constraintGreaterThanEqual(v *Version, c *constraint, includePre bool) (bool, error) {
+
+ // The existence of prereleases is checked at the group level and passed in.
+ // Exit early if the version has a prerelease but those are to be ignored.
+ if v.Prerelease() != "" && !includePre {
+ return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v)
+ }
+
+ eq := v.Compare(c.con) >= 0
+ if eq {
+ return true, nil
+ }
+ return false, fmt.Errorf("%s is less than %s", v, c.orig)
+}
+
+func constraintLessThanEqual(v *Version, c *constraint, includePre bool) (bool, error) {
+ // The existence of prereleases is checked at the group level and passed in.
+ // Exit early if the version has a prerelease but those are to be ignored.
+ if v.Prerelease() != "" && !includePre {
+ return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v)
+ }
+
+ var eq bool
+
+ if !c.dirty {
+ eq = v.Compare(c.con) <= 0
+ if eq {
+ return true, nil
+ }
+ return false, fmt.Errorf("%s is greater than %s", v, c.orig)
+ }
+
+ if v.Major() > c.con.Major() {
+ return false, fmt.Errorf("%s is greater than %s", v, c.orig)
+ } else if v.Major() == c.con.Major() && v.Minor() > c.con.Minor() && !c.minorDirty {
+ return false, fmt.Errorf("%s is greater than %s", v, c.orig)
+ }
+
+ return true, nil
+}
+
+// ~*, ~>* --> >= 0.0.0 (any)
+// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0, <3.0.0
+// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0, <2.1.0
+// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0, <1.3.0
+// ~1.2.3, ~>1.2.3 --> >=1.2.3, <1.3.0
+// ~1.2.0, ~>1.2.0 --> >=1.2.0, <1.3.0
+func constraintTilde(v *Version, c *constraint, includePre bool) (bool, error) {
+ // The existence of prereleases is checked at the group level and passed in.
+ // Exit early if the version has a prerelease but those are to be ignored.
+ if v.Prerelease() != "" && !includePre {
+ return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v)
+ }
+
+ if v.LessThan(c.con) {
+ return false, fmt.Errorf("%s is less than %s", v, c.orig)
+ }
+
+ // ~0.0.0 is a special case where all constraints are accepted. It's
+ // equivalent to >= 0.0.0.
+ if c.con.Major() == 0 && c.con.Minor() == 0 && c.con.Patch() == 0 &&
+ !c.minorDirty && !c.patchDirty {
+ return true, nil
+ }
+
+ if v.Major() != c.con.Major() {
+ return false, fmt.Errorf("%s does not have same major version as %s", v, c.orig)
+ }
+
+ if v.Minor() != c.con.Minor() && !c.minorDirty {
+ return false, fmt.Errorf("%s does not have same major and minor version as %s", v, c.orig)
+ }
+
+ return true, nil
+}
+
+// When there is a .x (dirty) status it automatically opts in to ~. Otherwise
+// it's a straight =
+func constraintTildeOrEqual(v *Version, c *constraint, includePre bool) (bool, error) {
+ // The existence of prereleases is checked at the group level and passed in.
+ // Exit early if the version has a prerelease but those are to be ignored.
+ if v.Prerelease() != "" && !includePre {
+ return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v)
+ }
+
+ if c.dirty {
+ return constraintTilde(v, c, includePre)
+ }
+
+ eq := v.Equal(c.con)
+ if eq {
+ return true, nil
+ }
+
+ return false, fmt.Errorf("%s is not equal to %s", v, c.orig)
+}
+
+// ^* --> (any)
+// ^1.2.3 --> >=1.2.3 <2.0.0
+// ^1.2 --> >=1.2.0 <2.0.0
+// ^1 --> >=1.0.0 <2.0.0
+// ^0.2.3 --> >=0.2.3 <0.3.0
+// ^0.2 --> >=0.2.0 <0.3.0
+// ^0.0.3 --> >=0.0.3 <0.0.4
+// ^0.0 --> >=0.0.0 <0.1.0
+// ^0 --> >=0.0.0 <1.0.0
+func constraintCaret(v *Version, c *constraint, includePre bool) (bool, error) {
+ // The existence of prereleases is checked at the group level and passed in.
+ // Exit early if the version has a prerelease but those are to be ignored.
+ if v.Prerelease() != "" && !includePre {
+ return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v)
+ }
+
+ // This less than handles prereleases
+ if v.LessThan(c.con) {
+ return false, fmt.Errorf("%s is less than %s", v, c.orig)
+ }
+
+ var eq bool
+
+ // ^ when the major > 0 is >=x.y.z < x+1
+ if c.con.Major() > 0 || c.minorDirty {
+
+ // ^ has to be within a major range for > 0. Everything less than was
+ // filtered out with the LessThan call above. This filters out those
+ // that greater but not within the same major range.
+ eq = v.Major() == c.con.Major()
+ if eq {
+ return true, nil
+ }
+ return false, fmt.Errorf("%s does not have same major version as %s", v, c.orig)
+ }
+
+ // ^ when the major is 0 and minor > 0 is >=0.y.z < 0.y+1
+ if c.con.Major() == 0 && v.Major() > 0 {
+ return false, fmt.Errorf("%s does not have same major version as %s", v, c.orig)
+ }
+ // If the con Minor is > 0 it is not dirty
+ if c.con.Minor() > 0 || c.patchDirty {
+ eq = v.Minor() == c.con.Minor()
+ if eq {
+ return true, nil
+ }
+ return false, fmt.Errorf("%s does not have same minor version as %s. Expected minor versions to match when constraint major version is 0", v, c.orig)
+ }
+ // ^ when the minor is 0 and minor > 0 is =0.0.z
+ if c.con.Minor() == 0 && v.Minor() > 0 {
+ return false, fmt.Errorf("%s does not have same minor version as %s", v, c.orig)
+ }
+
+ // At this point the major is 0 and the minor is 0 and not dirty. The patch
+ // is not dirty so we need to check if they are equal. If they are not equal
+ eq = c.con.Patch() == v.Patch()
+ if eq {
+ return true, nil
+ }
+ return false, fmt.Errorf("%s does not equal %s. Expect version and constraint to equal when major and minor versions are 0", v, c.orig)
+}
+
+func isX(x string) bool {
+ switch x {
+ case "x", "*", "X":
+ return true
+ default:
+ return false
+ }
+}
+
+func rewriteRange(i string) string {
+ m := constraintRangeRegex.FindAllStringSubmatch(i, -1)
+ if m == nil {
+ return i
+ }
+ o := i
+ for _, v := range m {
+ t := fmt.Sprintf(">= %s, <= %s ", v[1], v[11])
+ o = strings.Replace(o, v[0], t, 1)
+ }
+
+ return o
+}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/doc.go b/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/doc.go
new file mode 100644
index 000000000..74f97caa5
--- /dev/null
+++ b/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/doc.go
@@ -0,0 +1,184 @@
+/*
+Package semver provides the ability to work with Semantic Versions (http://semver.org) in Go.
+
+Specifically it provides the ability to:
+
+ - Parse semantic versions
+ - Sort semantic versions
+ - Check if a semantic version fits within a set of constraints
+ - Optionally work with a `v` prefix
+
+# Parsing Semantic Versions
+
+There are two functions that can parse semantic versions. The `StrictNewVersion`
+function only parses valid version 2 semantic versions as outlined in the
+specification. The `NewVersion` function attempts to coerce a version into a
+semantic version and parse it. For example, if there is a leading v or a version
+listed without all 3 parts (e.g. 1.2) it will attempt to coerce it into a valid
+semantic version (e.g., 1.2.0). In both cases a `Version` object is returned
+that can be sorted, compared, and used in constraints.
+
+When parsing a version an optional error can be returned if there is an issue
+parsing the version. For example,
+
+ v, err := semver.NewVersion("1.2.3-beta.1+b345")
+
+The version object has methods to get the parts of the version, compare it to
+other versions, convert the version back into a string, and get the original
+string. For more details please see the documentation
+at https://godoc.org/github.com/Masterminds/semver.
+
+# Sorting Semantic Versions
+
+A set of versions can be sorted using the `sort` package from the standard library.
+For example,
+
+ raw := []string{"1.2.3", "1.0", "1.3", "2", "0.4.2",}
+ vs := make([]*semver.Version, len(raw))
+ for i, r := range raw {
+ v, err := semver.NewVersion(r)
+ if err != nil {
+ t.Errorf("Error parsing version: %s", err)
+ }
+
+ vs[i] = v
+ }
+
+ sort.Sort(semver.Collection(vs))
+
+# Checking Version Constraints and Comparing Versions
+
+There are two methods for comparing versions. One uses comparison methods on
+`Version` instances and the other is using Constraints. There are some important
+differences to notes between these two methods of comparison.
+
+ 1. When two versions are compared using functions such as `Compare`, `LessThan`,
+ and others it will follow the specification and always include prereleases
+ within the comparison. It will provide an answer valid with the comparison
+ spec section at https://semver.org/#spec-item-11
+ 2. When constraint checking is used for checks or validation it will follow a
+ different set of rules that are common for ranges with tools like npm/js
+ and Rust/Cargo. This includes considering prereleases to be invalid if the
+ ranges does not include on. If you want to have it include pre-releases a
+ simple solution is to include `-0` in your range.
+ 3. Constraint ranges can have some complex rules including the shorthard use of
+ ~ and ^. For more details on those see the options below.
+
+There are differences between the two methods or checking versions because the
+comparison methods on `Version` follow the specification while comparison ranges
+are not part of the specification. Different packages and tools have taken it
+upon themselves to come up with range rules. This has resulted in differences.
+For example, npm/js and Cargo/Rust follow similar patterns which PHP has a
+different pattern for ^. The comparison features in this package follow the
+npm/js and Cargo/Rust lead because applications using it have followed similar
+patters with their versions.
+
+Checking a version against version constraints is one of the most featureful
+parts of the package.
+
+ c, err := semver.NewConstraint(">= 1.2.3")
+ if err != nil {
+ // Handle constraint not being parsable.
+ }
+
+ v, err := semver.NewVersion("1.3")
+ if err != nil {
+ // Handle version not being parsable.
+ }
+ // Check if the version meets the constraints. The a variable will be true.
+ a := c.Check(v)
+
+# Basic Comparisons
+
+There are two elements to the comparisons. First, a comparison string is a list
+of comma or space separated AND comparisons. These are then separated by || (OR)
+comparisons. For example, `">= 1.2 < 3.0.0 || >= 4.2.3"` is looking for a
+comparison that's greater than or equal to 1.2 and less than 3.0.0 or is
+greater than or equal to 4.2.3. This can also be written as
+`">= 1.2, < 3.0.0 || >= 4.2.3"`
+
+The basic comparisons are:
+
+ - `=`: equal (aliased to no operator)
+ - `!=`: not equal
+ - `>`: greater than
+ - `<`: less than
+ - `>=`: greater than or equal to
+ - `<=`: less than or equal to
+
+# Hyphen Range Comparisons
+
+There are multiple methods to handle ranges and the first is hyphens ranges.
+These look like:
+
+ - `1.2 - 1.4.5` which is equivalent to `>= 1.2, <= 1.4.5`
+ - `2.3.4 - 4.5` which is equivalent to `>= 2.3.4 <= 4.5`
+
+# Wildcards In Comparisons
+
+The `x`, `X`, and `*` characters can be used as a wildcard character. This works
+for all comparison operators. When used on the `=` operator it falls
+back to the tilde operation. For example,
+
+ - `1.2.x` is equivalent to `>= 1.2.0 < 1.3.0`
+ - `>= 1.2.x` is equivalent to `>= 1.2.0`
+ - `<= 2.x` is equivalent to `<= 3`
+ - `*` is equivalent to `>= 0.0.0`
+
+Tilde Range Comparisons (Patch)
+
+The tilde (`~`) comparison operator is for patch level ranges when a minor
+version is specified and major level changes when the minor number is missing.
+For example,
+
+ - `~1.2.3` is equivalent to `>= 1.2.3 < 1.3.0`
+ - `~1` is equivalent to `>= 1, < 2`
+ - `~2.3` is equivalent to `>= 2.3 < 2.4`
+ - `~1.2.x` is equivalent to `>= 1.2.0 < 1.3.0`
+ - `~1.x` is equivalent to `>= 1 < 2`
+
+Caret Range Comparisons (Major)
+
+The caret (`^`) comparison operator is for major level changes once a stable
+(1.0.0) release has occurred. Prior to a 1.0.0 release the minor versions acts
+as the API stability level. This is useful when comparisons of API versions as a
+major change is API breaking. For example,
+
+ - `^1.2.3` is equivalent to `>= 1.2.3, < 2.0.0`
+ - `^1.2.x` is equivalent to `>= 1.2.0, < 2.0.0`
+ - `^2.3` is equivalent to `>= 2.3, < 3`
+ - `^2.x` is equivalent to `>= 2.0.0, < 3`
+ - `^0.2.3` is equivalent to `>=0.2.3 <0.3.0`
+ - `^0.2` is equivalent to `>=0.2.0 <0.3.0`
+ - `^0.0.3` is equivalent to `>=0.0.3 <0.0.4`
+ - `^0.0` is equivalent to `>=0.0.0 <0.1.0`
+ - `^0` is equivalent to `>=0.0.0 <1.0.0`
+
+# Validation
+
+In addition to testing a version against a constraint, a version can be validated
+against a constraint. When validation fails a slice of errors containing why a
+version didn't meet the constraint is returned. For example,
+
+ c, err := semver.NewConstraint("<= 1.2.3, >= 1.4")
+ if err != nil {
+ // Handle constraint not being parseable.
+ }
+
+ v, _ := semver.NewVersion("1.3")
+ if err != nil {
+ // Handle version not being parseable.
+ }
+
+ // Validate a version against a constraint.
+ a, msgs := c.Validate(v)
+ // a is false
+ for _, m := range msgs {
+ fmt.Println(m)
+
+ // Loops over the errors which would read
+ // "1.3 is greater than 1.2.3"
+ // "1.3 is less than 1.4"
+ }
+*/
+package semver
diff --git a/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/version.go b/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/version.go
new file mode 100644
index 000000000..7a3ba7388
--- /dev/null
+++ b/openshift/default-catalog-consistency/vendor/github.com/Masterminds/semver/v3/version.go
@@ -0,0 +1,788 @@
+package semver
+
+import (
+ "bytes"
+ "database/sql/driver"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "regexp"
+ "strconv"
+ "strings"
+)
+
+// The compiled version of the regex created at init() is cached here so it
+// only needs to be created once.
+var versionRegex *regexp.Regexp
+var looseVersionRegex *regexp.Regexp
+
+// CoerceNewVersion sets if leading 0's are allowd in the version part. Leading 0's are
+// not allowed in a valid semantic version. When set to true, NewVersion will coerce
+// leading 0's into a valid version.
+var CoerceNewVersion = true
+
+// DetailedNewVersionErrors specifies if detailed errors are returned from the NewVersion
+// function. This is used when CoerceNewVersion is set to false. If set to false
+// ErrInvalidSemVer is returned for an invalid version. This does not apply to
+// StrictNewVersion. Setting this function to false returns errors more quickly.
+var DetailedNewVersionErrors = true
+
+var (
+ // ErrInvalidSemVer is returned a version is found to be invalid when
+ // being parsed.
+ ErrInvalidSemVer = errors.New("invalid semantic version")
+
+ // ErrEmptyString is returned when an empty string is passed in for parsing.
+ ErrEmptyString = errors.New("version string empty")
+
+ // ErrInvalidCharacters is returned when invalid characters are found as
+ // part of a version
+ ErrInvalidCharacters = errors.New("invalid characters in version")
+
+ // ErrSegmentStartsZero is returned when a version segment starts with 0.
+ // This is invalid in SemVer.
+ ErrSegmentStartsZero = errors.New("version segment starts with 0")
+
+ // ErrInvalidMetadata is returned when the metadata is an invalid format
+ ErrInvalidMetadata = errors.New("invalid metadata string")
+
+ // ErrInvalidPrerelease is returned when the pre-release is an invalid format
+ ErrInvalidPrerelease = errors.New("invalid prerelease string")
+)
+
+// semVerRegex is the regular expression used to parse a semantic version.
+// This is not the official regex from the semver spec. It has been modified to allow for loose handling
+// where versions like 2.1 are detected.
+const semVerRegex string = `v?(0|[1-9]\d*)(?:\.(0|[1-9]\d*))?(?:\.(0|[1-9]\d*))?` +
+ `(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?` +
+ `(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?`
+
+// looseSemVerRegex is a regular expression that lets invalid semver expressions through
+// with enough detail that certain errors can be checked for.
+const looseSemVerRegex string = `v?([0-9]+)(\.[0-9]+)?(\.[0-9]+)?` +
+ `(-([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` +
+ `(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?`
+
+// Version represents a single semantic version.
+type Version struct {
+ major, minor, patch uint64
+ pre string
+ metadata string
+ original string
+}
+
+func init() {
+ versionRegex = regexp.MustCompile("^" + semVerRegex + "$")
+ looseVersionRegex = regexp.MustCompile("^" + looseSemVerRegex + "$")
+}
+
+const (
+ num string = "0123456789"
+ allowed string = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-" + num
+)
+
+// StrictNewVersion parses a given version and returns an instance of Version or
+// an error if unable to parse the version. Only parses valid semantic versions.
+// Performs checking that can find errors within the version.
+// If you want to coerce a version such as 1 or 1.2 and parse it as the 1.x
+// releases of semver did, use the NewVersion() function.
+func StrictNewVersion(v string) (*Version, error) {
+ // Parsing here does not use RegEx in order to increase performance and reduce
+ // allocations.
+
+ if len(v) == 0 {
+ return nil, ErrEmptyString
+ }
+
+ // Split the parts into [0]major, [1]minor, and [2]patch,prerelease,build
+ parts := strings.SplitN(v, ".", 3)
+ if len(parts) != 3 {
+ return nil, ErrInvalidSemVer
+ }
+
+ sv := &Version{
+ original: v,
+ }
+
+ // Extract build metadata
+ if strings.Contains(parts[2], "+") {
+ extra := strings.SplitN(parts[2], "+", 2)
+ sv.metadata = extra[1]
+ parts[2] = extra[0]
+ if err := validateMetadata(sv.metadata); err != nil {
+ return nil, err
+ }
+ }
+
+ // Extract build prerelease
+ if strings.Contains(parts[2], "-") {
+ extra := strings.SplitN(parts[2], "-", 2)
+ sv.pre = extra[1]
+ parts[2] = extra[0]
+ if err := validatePrerelease(sv.pre); err != nil {
+ return nil, err
+ }
+ }
+
+ // Validate the number segments are valid. This includes only having positive
+ // numbers and no leading 0's.
+ for _, p := range parts {
+ if !containsOnly(p, num) {
+ return nil, ErrInvalidCharacters
+ }
+
+ if len(p) > 1 && p[0] == '0' {
+ return nil, ErrSegmentStartsZero
+ }
+ }
+
+ // Extract major, minor, and patch
+ var err error
+ sv.major, err = strconv.ParseUint(parts[0], 10, 64)
+ if err != nil {
+ return nil, err
+ }
+
+ sv.minor, err = strconv.ParseUint(parts[1], 10, 64)
+ if err != nil {
+ return nil, err
+ }
+
+ sv.patch, err = strconv.ParseUint(parts[2], 10, 64)
+ if err != nil {
+ return nil, err
+ }
+
+ return sv, nil
+}
+
+// NewVersion parses a given version and returns an instance of Version or
+// an error if unable to parse the version. If the version is SemVer-ish it
+// attempts to convert it to SemVer. If you want to validate it was a strict
+// semantic version at parse time see StrictNewVersion().
+func NewVersion(v string) (*Version, error) {
+ if CoerceNewVersion {
+ return coerceNewVersion(v)
+ }
+ m := versionRegex.FindStringSubmatch(v)
+ if m == nil {
+
+ // Disabling detailed errors is first so that it is in the fast path.
+ if !DetailedNewVersionErrors {
+ return nil, ErrInvalidSemVer
+ }
+
+ // Check for specific errors with the semver string and return a more detailed
+ // error.
+ m = looseVersionRegex.FindStringSubmatch(v)
+ if m == nil {
+ return nil, ErrInvalidSemVer
+ }
+ err := validateVersion(m)
+ if err != nil {
+ return nil, err
+ }
+ return nil, ErrInvalidSemVer
+ }
+
+ sv := &Version{
+ metadata: m[5],
+ pre: m[4],
+ original: v,
+ }
+
+ var err error
+ sv.major, err = strconv.ParseUint(m[1], 10, 64)
+ if err != nil {
+ return nil, fmt.Errorf("error parsing version segment: %w", err)
+ }
+
+ if m[2] != "" {
+ sv.minor, err = strconv.ParseUint(m[2], 10, 64)
+ if err != nil {
+ return nil, fmt.Errorf("error parsing version segment: %w", err)
+ }
+ } else {
+ sv.minor = 0
+ }
+
+ if m[3] != "" {
+ sv.patch, err = strconv.ParseUint(m[3], 10, 64)
+ if err != nil {
+ return nil, fmt.Errorf("error parsing version segment: %w", err)
+ }
+ } else {
+ sv.patch = 0
+ }
+
+ // Perform some basic due diligence on the extra parts to ensure they are
+ // valid.
+
+ if sv.pre != "" {
+ if err = validatePrerelease(sv.pre); err != nil {
+ return nil, err
+ }
+ }
+
+ if sv.metadata != "" {
+ if err = validateMetadata(sv.metadata); err != nil {
+ return nil, err
+ }
+ }
+
+ return sv, nil
+}
+
+func coerceNewVersion(v string) (*Version, error) {
+ m := looseVersionRegex.FindStringSubmatch(v)
+ if m == nil {
+ return nil, ErrInvalidSemVer
+ }
+
+ sv := &Version{
+ metadata: m[8],
+ pre: m[5],
+ original: v,
+ }
+
+ var err error
+ sv.major, err = strconv.ParseUint(m[1], 10, 64)
+ if err != nil {
+ return nil, fmt.Errorf("error parsing version segment: %w", err)
+ }
+
+ if m[2] != "" {
+ sv.minor, err = strconv.ParseUint(strings.TrimPrefix(m[2], "."), 10, 64)
+ if err != nil {
+ return nil, fmt.Errorf("error parsing version segment: %w", err)
+ }
+ } else {
+ sv.minor = 0
+ }
+
+ if m[3] != "" {
+ sv.patch, err = strconv.ParseUint(strings.TrimPrefix(m[3], "."), 10, 64)
+ if err != nil {
+ return nil, fmt.Errorf("error parsing version segment: %w", err)
+ }
+ } else {
+ sv.patch = 0
+ }
+
+ // Perform some basic due diligence on the extra parts to ensure they are
+ // valid.
+
+ if sv.pre != "" {
+ if err = validatePrerelease(sv.pre); err != nil {
+ return nil, err
+ }
+ }
+
+ if sv.metadata != "" {
+ if err = validateMetadata(sv.metadata); err != nil {
+ return nil, err
+ }
+ }
+
+ return sv, nil
+}
+
+// New creates a new instance of Version with each of the parts passed in as
+// arguments instead of parsing a version string.
+func New(major, minor, patch uint64, pre, metadata string) *Version {
+ v := Version{
+ major: major,
+ minor: minor,
+ patch: patch,
+ pre: pre,
+ metadata: metadata,
+ original: "",
+ }
+
+ v.original = v.String()
+
+ return &v
+}
+
+// MustParse parses a given version and panics on error.
+func MustParse(v string) *Version {
+ sv, err := NewVersion(v)
+ if err != nil {
+ panic(err)
+ }
+ return sv
+}
+
+// String converts a Version object to a string.
+// Note, if the original version contained a leading v this version will not.
+// See the Original() method to retrieve the original value. Semantic Versions
+// don't contain a leading v per the spec. Instead it's optional on
+// implementation.
+func (v Version) String() string {
+ var buf bytes.Buffer
+
+ fmt.Fprintf(&buf, "%d.%d.%d", v.major, v.minor, v.patch)
+ if v.pre != "" {
+ fmt.Fprintf(&buf, "-%s", v.pre)
+ }
+ if v.metadata != "" {
+ fmt.Fprintf(&buf, "+%s", v.metadata)
+ }
+
+ return buf.String()
+}
+
+// Original returns the original value passed in to be parsed.
+func (v *Version) Original() string {
+ return v.original
+}
+
+// Major returns the major version.
+func (v Version) Major() uint64 {
+ return v.major
+}
+
+// Minor returns the minor version.
+func (v Version) Minor() uint64 {
+ return v.minor
+}
+
+// Patch returns the patch version.
+func (v Version) Patch() uint64 {
+ return v.patch
+}
+
+// Prerelease returns the pre-release version.
+func (v Version) Prerelease() string {
+ return v.pre
+}
+
+// Metadata returns the metadata on the version.
+func (v Version) Metadata() string {
+ return v.metadata
+}
+
+// originalVPrefix returns the original 'v' prefix if any.
+func (v Version) originalVPrefix() string {
+ // Note, only lowercase v is supported as a prefix by the parser.
+ if v.original != "" && v.original[:1] == "v" {
+ return v.original[:1]
+ }
+ return ""
+}
+
+// IncPatch produces the next patch version.
+// If the current version does not have prerelease/metadata information,
+// it unsets metadata and prerelease values, increments patch number.
+// If the current version has any of prerelease or metadata information,
+// it unsets both values and keeps current patch value
+func (v Version) IncPatch() Version {
+ vNext := v
+ // according to http://semver.org/#spec-item-9
+ // Pre-release versions have a lower precedence than the associated normal version.
+ // according to http://semver.org/#spec-item-10
+ // Build metadata SHOULD be ignored when determining version precedence.
+ if v.pre != "" {
+ vNext.metadata = ""
+ vNext.pre = ""
+ } else {
+ vNext.metadata = ""
+ vNext.pre = ""
+ vNext.patch = v.patch + 1
+ }
+ vNext.original = v.originalVPrefix() + "" + vNext.String()
+ return vNext
+}
+
+// IncMinor produces the next minor version.
+// Sets patch to 0.
+// Increments minor number.
+// Unsets metadata.
+// Unsets prerelease status.
+func (v Version) IncMinor() Version {
+ vNext := v
+ vNext.metadata = ""
+ vNext.pre = ""
+ vNext.patch = 0
+ vNext.minor = v.minor + 1
+ vNext.original = v.originalVPrefix() + "" + vNext.String()
+ return vNext
+}
+
+// IncMajor produces the next major version.
+// Sets patch to 0.
+// Sets minor to 0.
+// Increments major number.
+// Unsets metadata.
+// Unsets prerelease status.
+func (v Version) IncMajor() Version {
+ vNext := v
+ vNext.metadata = ""
+ vNext.pre = ""
+ vNext.patch = 0
+ vNext.minor = 0
+ vNext.major = v.major + 1
+ vNext.original = v.originalVPrefix() + "" + vNext.String()
+ return vNext
+}
+
+// SetPrerelease defines the prerelease value.
+// Value must not include the required 'hyphen' prefix.
+func (v Version) SetPrerelease(prerelease string) (Version, error) {
+ vNext := v
+ if len(prerelease) > 0 {
+ if err := validatePrerelease(prerelease); err != nil {
+ return vNext, err
+ }
+ }
+ vNext.pre = prerelease
+ vNext.original = v.originalVPrefix() + "" + vNext.String()
+ return vNext, nil
+}
+
+// SetMetadata defines metadata value.
+// Value must not include the required 'plus' prefix.
+func (v Version) SetMetadata(metadata string) (Version, error) {
+ vNext := v
+ if len(metadata) > 0 {
+ if err := validateMetadata(metadata); err != nil {
+ return vNext, err
+ }
+ }
+ vNext.metadata = metadata
+ vNext.original = v.originalVPrefix() + "" + vNext.String()
+ return vNext, nil
+}
+
+// LessThan tests if one version is less than another one.
+func (v *Version) LessThan(o *Version) bool {
+ return v.Compare(o) < 0
+}
+
+// LessThanEqual tests if one version is less or equal than another one.
+func (v *Version) LessThanEqual(o *Version) bool {
+ return v.Compare(o) <= 0
+}
+
+// GreaterThan tests if one version is greater than another one.
+func (v *Version) GreaterThan(o *Version) bool {
+ return v.Compare(o) > 0
+}
+
+// GreaterThanEqual tests if one version is greater or equal than another one.
+func (v *Version) GreaterThanEqual(o *Version) bool {
+ return v.Compare(o) >= 0
+}
+
+// Equal tests if two versions are equal to each other.
+// Note, versions can be equal with different metadata since metadata
+// is not considered part of the comparable version.
+func (v *Version) Equal(o *Version) bool {
+ if v == o {
+ return true
+ }
+ if v == nil || o == nil {
+ return false
+ }
+ return v.Compare(o) == 0
+}
+
+// Compare compares this version to another one. It returns -1, 0, or 1 if
+// the version smaller, equal, or larger than the other version.
+//
+// Versions are compared by X.Y.Z. Build metadata is ignored. Prerelease is
+// lower than the version without a prerelease. Compare always takes into account
+// prereleases. If you want to work with ranges using typical range syntaxes that
+// skip prereleases if the range is not looking for them use constraints.
+func (v *Version) Compare(o *Version) int {
+ // Compare the major, minor, and patch version for differences. If a
+ // difference is found return the comparison.
+ if d := compareSegment(v.Major(), o.Major()); d != 0 {
+ return d
+ }
+ if d := compareSegment(v.Minor(), o.Minor()); d != 0 {
+ return d
+ }
+ if d := compareSegment(v.Patch(), o.Patch()); d != 0 {
+ return d
+ }
+
+ // At this point the major, minor, and patch versions are the same.
+ ps := v.pre
+ po := o.Prerelease()
+
+ if ps == "" && po == "" {
+ return 0
+ }
+ if ps == "" {
+ return 1
+ }
+ if po == "" {
+ return -1
+ }
+
+ return comparePrerelease(ps, po)
+}
+
+// UnmarshalJSON implements JSON.Unmarshaler interface.
+func (v *Version) UnmarshalJSON(b []byte) error {
+ var s string
+ if err := json.Unmarshal(b, &s); err != nil {
+ return err
+ }
+ temp, err := NewVersion(s)
+ if err != nil {
+ return err
+ }
+ v.major = temp.major
+ v.minor = temp.minor
+ v.patch = temp.patch
+ v.pre = temp.pre
+ v.metadata = temp.metadata
+ v.original = temp.original
+ return nil
+}
+
+// MarshalJSON implements JSON.Marshaler interface.
+func (v Version) MarshalJSON() ([]byte, error) {
+ return json.Marshal(v.String())
+}
+
+// UnmarshalText implements the encoding.TextUnmarshaler interface.
+func (v *Version) UnmarshalText(text []byte) error {
+ temp, err := NewVersion(string(text))
+ if err != nil {
+ return err
+ }
+
+ *v = *temp
+
+ return nil
+}
+
+// MarshalText implements the encoding.TextMarshaler interface.
+func (v Version) MarshalText() ([]byte, error) {
+ return []byte(v.String()), nil
+}
+
+// Scan implements the SQL.Scanner interface.
+func (v *Version) Scan(value interface{}) error {
+ var s string
+ s, _ = value.(string)
+ temp, err := NewVersion(s)
+ if err != nil {
+ return err
+ }
+ v.major = temp.major
+ v.minor = temp.minor
+ v.patch = temp.patch
+ v.pre = temp.pre
+ v.metadata = temp.metadata
+ v.original = temp.original
+ return nil
+}
+
+// Value implements the Driver.Valuer interface.
+func (v Version) Value() (driver.Value, error) {
+ return v.String(), nil
+}
+
+func compareSegment(v, o uint64) int {
+ if v < o {
+ return -1
+ }
+ if v > o {
+ return 1
+ }
+
+ return 0
+}
+
+func comparePrerelease(v, o string) int {
+ // split the prelease versions by their part. The separator, per the spec,
+ // is a .
+ sparts := strings.Split(v, ".")
+ oparts := strings.Split(o, ".")
+
+ // Find the longer length of the parts to know how many loop iterations to
+ // go through.
+ slen := len(sparts)
+ olen := len(oparts)
+
+ l := slen
+ if olen > slen {
+ l = olen
+ }
+
+ // Iterate over each part of the prereleases to compare the differences.
+ for i := 0; i < l; i++ {
+ // Since the lentgh of the parts can be different we need to create
+ // a placeholder. This is to avoid out of bounds issues.
+ stemp := ""
+ if i < slen {
+ stemp = sparts[i]
+ }
+
+ otemp := ""
+ if i < olen {
+ otemp = oparts[i]
+ }
+
+ d := comparePrePart(stemp, otemp)
+ if d != 0 {
+ return d
+ }
+ }
+
+ // Reaching here means two versions are of equal value but have different
+ // metadata (the part following a +). They are not identical in string form
+ // but the version comparison finds them to be equal.
+ return 0
+}
+
+func comparePrePart(s, o string) int {
+ // Fastpath if they are equal
+ if s == o {
+ return 0
+ }
+
+ // When s or o are empty we can use the other in an attempt to determine
+ // the response.
+ if s == "" {
+ if o != "" {
+ return -1
+ }
+ return 1
+ }
+
+ if o == "" {
+ if s != "" {
+ return 1
+ }
+ return -1
+ }
+
+ // When comparing strings "99" is greater than "103". To handle
+ // cases like this we need to detect numbers and compare them. According
+ // to the semver spec, numbers are always positive. If there is a - at the
+ // start like -99 this is to be evaluated as an alphanum. numbers always
+ // have precedence over alphanum. Parsing as Uints because negative numbers
+ // are ignored.
+
+ oi, n1 := strconv.ParseUint(o, 10, 64)
+ si, n2 := strconv.ParseUint(s, 10, 64)
+
+ // The case where both are strings compare the strings
+ if n1 != nil && n2 != nil {
+ if s > o {
+ return 1
+ }
+ return -1
+ } else if n1 != nil {
+ // o is a string and s is a number
+ return -1
+ } else if n2 != nil {
+ // s is a string and o is a number
+ return 1
+ }
+ // Both are numbers
+ if si > oi {
+ return 1
+ }
+ return -1
+}
+
+// Like strings.ContainsAny but does an only instead of any.
+func containsOnly(s string, comp string) bool {
+ return strings.IndexFunc(s, func(r rune) bool {
+ return !strings.ContainsRune(comp, r)
+ }) == -1
+}
+
+// From the spec, "Identifiers MUST comprise only
+// ASCII alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty.
+// Numeric identifiers MUST NOT include leading zeroes.". These segments can
+// be dot separated.
+func validatePrerelease(p string) error {
+ eparts := strings.Split(p, ".")
+ for _, p := range eparts {
+ if p == "" {
+ return ErrInvalidPrerelease
+ } else if containsOnly(p, num) {
+ if len(p) > 1 && p[0] == '0' {
+ return ErrSegmentStartsZero
+ }
+ } else if !containsOnly(p, allowed) {
+ return ErrInvalidPrerelease
+ }
+ }
+
+ return nil
+}
+
+// From the spec, "Build metadata MAY be denoted by
+// appending a plus sign and a series of dot separated identifiers immediately
+// following the patch or pre-release version. Identifiers MUST comprise only
+// ASCII alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty."
+func validateMetadata(m string) error {
+ eparts := strings.Split(m, ".")
+ for _, p := range eparts {
+ if p == "" {
+ return ErrInvalidMetadata
+ } else if !containsOnly(p, allowed) {
+ return ErrInvalidMetadata
+ }
+ }
+ return nil
+}
+
+// validateVersion checks for common validation issues but may not catch all errors
+func validateVersion(m []string) error {
+ var err error
+ var v string
+ if m[1] != "" {
+ if len(m[1]) > 1 && m[1][0] == '0' {
+ return ErrSegmentStartsZero
+ }
+ _, err = strconv.ParseUint(m[1], 10, 64)
+ if err != nil {
+ return fmt.Errorf("error parsing version segment: %w", err)
+ }
+ }
+
+ if m[2] != "" {
+ v = strings.TrimPrefix(m[2], ".")
+ if len(v) > 1 && v[0] == '0' {
+ return ErrSegmentStartsZero
+ }
+ _, err = strconv.ParseUint(v, 10, 64)
+ if err != nil {
+ return fmt.Errorf("error parsing version segment: %w", err)
+ }
+ }
+
+ if m[3] != "" {
+ v = strings.TrimPrefix(m[3], ".")
+ if len(v) > 1 && v[0] == '0' {
+ return ErrSegmentStartsZero
+ }
+ _, err = strconv.ParseUint(v, 10, 64)
+ if err != nil {
+ return fmt.Errorf("error parsing version segment: %w", err)
+ }
+ }
+
+ if m[5] != "" {
+ if err = validatePrerelease(m[5]); err != nil {
+ return err
+ }
+ }
+
+ if m[8] != "" {
+ if err = validateMetadata(m[8]); err != nil {
+ return err
+ }
+ }
+
+ return nil
+}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/.gitignore b/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/.gitignore
deleted file mode 100644
index 8d69a9418..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/.gitignore
+++ /dev/null
@@ -1,15 +0,0 @@
-bin/
-.idea/
-# Binaries for programs and plugins
-*.exe
-*.exe~
-*.dll
-*.so
-*.dylib
-
-# Test binary, built with `go test -c`
-*.test
-
-# Output of the go coverage tool, specifically when used with LiteIDE
-*.out
-
diff --git a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/.travis.yml b/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/.travis.yml
deleted file mode 100644
index bb83c6670..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/.travis.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-language: go
-dist: xenial
-go:
- - '1.10'
- - '1.11'
- - '1.12'
- - '1.13'
- - 'tip'
-
-script:
- - go test -coverpkg=./... -coverprofile=coverage.info -timeout=5s
- - bash <(curl -s https://codecov.io/bash)
diff --git a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md b/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md
deleted file mode 100644
index 4b462b0d8..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md
+++ /dev/null
@@ -1,43 +0,0 @@
-# Contributor Code of Conduct
-
-This project adheres to [The Code Manifesto](http://codemanifesto.com)
-as its guidelines for contributor interactions.
-
-## The Code Manifesto
-
-We want to work in an ecosystem that empowers developers to reach their
-potential — one that encourages growth and effective collaboration. A space
-that is safe for all.
-
-A space such as this benefits everyone that participates in it. It encourages
-new developers to enter our field. It is through discussion and collaboration
-that we grow, and through growth that we improve.
-
-In the effort to create such a place, we hold to these values:
-
-1. **Discrimination limits us.** This includes discrimination on the basis of
- race, gender, sexual orientation, gender identity, age, nationality,
- technology and any other arbitrary exclusion of a group of people.
-2. **Boundaries honor us.** Your comfort levels are not everyone’s comfort
- levels. Remember that, and if brought to your attention, heed it.
-3. **We are our biggest assets.** None of us were born masters of our trade.
- Each of us has been helped along the way. Return that favor, when and where
- you can.
-4. **We are resources for the future.** As an extension of #3, share what you
- know. Make yourself a resource to help those that come after you.
-5. **Respect defines us.** Treat others as you wish to be treated. Make your
- discussions, criticisms and debates from a position of respectfulness. Ask
- yourself, is it true? Is it necessary? Is it constructive? Anything less is
- unacceptable.
-6. **Reactions require grace.** Angry responses are valid, but abusive language
- and vindictive actions are toxic. When something happens that offends you,
- handle it assertively, but be respectful. Escalate reasonably, and try to
- allow the offender an opportunity to explain themselves, and possibly
- correct the issue.
-7. **Opinions are just that: opinions.** Each and every one of us, due to our
- background and upbringing, have varying opinions. That is perfectly
- acceptable. Remember this: if you respect your own opinions, you should
- respect the opinions of others.
-8. **To err is human.** You might not intend it, but mistakes do happen and
- contribute to build experience. Tolerate honest mistakes, and don't
- hesitate to apologize if you make one yourself.
diff --git a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md b/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md
deleted file mode 100644
index 7ed268a1e..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md
+++ /dev/null
@@ -1,63 +0,0 @@
-#### Support
-If you do have a contribution to the package, feel free to create a Pull Request or an Issue.
-
-#### What to contribute
-If you don't know what to do, there are some features and functions that need to be done
-
-- [ ] Refactor code
-- [ ] Edit docs and [README](https://github.com/asaskevich/govalidator/README.md): spellcheck, grammar and typo check
-- [ ] Create actual list of contributors and projects that currently using this package
-- [ ] Resolve [issues and bugs](https://github.com/asaskevich/govalidator/issues)
-- [ ] Update actual [list of functions](https://github.com/asaskevich/govalidator#list-of-functions)
-- [ ] Update [list of validators](https://github.com/asaskevich/govalidator#validatestruct-2) that available for `ValidateStruct` and add new
-- [ ] Implement new validators: `IsFQDN`, `IsIMEI`, `IsPostalCode`, `IsISIN`, `IsISRC` etc
-- [x] Implement [validation by maps](https://github.com/asaskevich/govalidator/issues/224)
-- [ ] Implement fuzzing testing
-- [ ] Implement some struct/map/array utilities
-- [ ] Implement map/array validation
-- [ ] Implement benchmarking
-- [ ] Implement batch of examples
-- [ ] Look at forks for new features and fixes
-
-#### Advice
-Feel free to create what you want, but keep in mind when you implement new features:
-- Code must be clear and readable, names of variables/constants clearly describes what they are doing
-- Public functions must be documented and described in source file and added to README.md to the list of available functions
-- There are must be unit-tests for any new functions and improvements
-
-## Financial contributions
-
-We also welcome financial contributions in full transparency on our [open collective](https://opencollective.com/govalidator).
-Anyone can file an expense. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed.
-
-
-## Credits
-
-
-### Contributors
-
-Thank you to all the people who have already contributed to govalidator!
-
-
-
-### Backers
-
-Thank you to all our backers! [[Become a backer](https://opencollective.com/govalidator#backer)]
-
-
-
-
-### Sponsors
-
-Thank you to all our sponsors! (please ask your company to also support this open source project by [becoming a sponsor](https://opencollective.com/govalidator#sponsor))
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/LICENSE b/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/LICENSE
deleted file mode 100644
index cacba9102..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014-2020 Alex Saskevich
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
\ No newline at end of file
diff --git a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/README.md b/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/README.md
deleted file mode 100644
index 2c3fc35eb..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/README.md
+++ /dev/null
@@ -1,622 +0,0 @@
-govalidator
-===========
-[](https://gitter.im/asaskevich/govalidator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [](https://godoc.org/github.com/asaskevich/govalidator)
-[](https://travis-ci.org/asaskevich/govalidator)
-[](https://codecov.io/gh/asaskevich/govalidator) [](https://goreportcard.com/report/github.com/asaskevich/govalidator) [](http://go-search.org/view?id=github.com%2Fasaskevich%2Fgovalidator) [](#backers) [](#sponsors) [](https://app.fossa.io/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator?ref=badge_shield)
-
-A package of validators and sanitizers for strings, structs and collections. Based on [validator.js](https://github.com/chriso/validator.js).
-
-#### Installation
-Make sure that Go is installed on your computer.
-Type the following command in your terminal:
-
- go get github.com/asaskevich/govalidator
-
-or you can get specified release of the package with `gopkg.in`:
-
- go get gopkg.in/asaskevich/govalidator.v10
-
-After it the package is ready to use.
-
-
-#### Import package in your project
-Add following line in your `*.go` file:
-```go
-import "github.com/asaskevich/govalidator"
-```
-If you are unhappy to use long `govalidator`, you can do something like this:
-```go
-import (
- valid "github.com/asaskevich/govalidator"
-)
-```
-
-#### Activate behavior to require all fields have a validation tag by default
-`SetFieldsRequiredByDefault` causes validation to fail when struct fields do not include validations or are not explicitly marked as exempt (using `valid:"-"` or `valid:"email,optional"`). A good place to activate this is a package init function or the main() function.
-
-`SetNilPtrAllowedByRequired` causes validation to pass when struct fields marked by `required` are set to nil. This is disabled by default for consistency, but some packages that need to be able to determine between `nil` and `zero value` state can use this. If disabled, both `nil` and `zero` values cause validation errors.
-
-```go
-import "github.com/asaskevich/govalidator"
-
-func init() {
- govalidator.SetFieldsRequiredByDefault(true)
-}
-```
-
-Here's some code to explain it:
-```go
-// this struct definition will fail govalidator.ValidateStruct() (and the field values do not matter):
-type exampleStruct struct {
- Name string ``
- Email string `valid:"email"`
-}
-
-// this, however, will only fail when Email is empty or an invalid email address:
-type exampleStruct2 struct {
- Name string `valid:"-"`
- Email string `valid:"email"`
-}
-
-// lastly, this will only fail when Email is an invalid email address but not when it's empty:
-type exampleStruct2 struct {
- Name string `valid:"-"`
- Email string `valid:"email,optional"`
-}
-```
-
-#### Recent breaking changes (see [#123](https://github.com/asaskevich/govalidator/pull/123))
-##### Custom validator function signature
-A context was added as the second parameter, for structs this is the object being validated – this makes dependent validation possible.
-```go
-import "github.com/asaskevich/govalidator"
-
-// old signature
-func(i interface{}) bool
-
-// new signature
-func(i interface{}, o interface{}) bool
-```
-
-##### Adding a custom validator
-This was changed to prevent data races when accessing custom validators.
-```go
-import "github.com/asaskevich/govalidator"
-
-// before
-govalidator.CustomTypeTagMap["customByteArrayValidator"] = func(i interface{}, o interface{}) bool {
- // ...
-}
-
-// after
-govalidator.CustomTypeTagMap.Set("customByteArrayValidator", func(i interface{}, o interface{}) bool {
- // ...
-})
-```
-
-#### List of functions:
-```go
-func Abs(value float64) float64
-func BlackList(str, chars string) string
-func ByteLength(str string, params ...string) bool
-func CamelCaseToUnderscore(str string) string
-func Contains(str, substring string) bool
-func Count(array []interface{}, iterator ConditionIterator) int
-func Each(array []interface{}, iterator Iterator)
-func ErrorByField(e error, field string) string
-func ErrorsByField(e error) map[string]string
-func Filter(array []interface{}, iterator ConditionIterator) []interface{}
-func Find(array []interface{}, iterator ConditionIterator) interface{}
-func GetLine(s string, index int) (string, error)
-func GetLines(s string) []string
-func HasLowerCase(str string) bool
-func HasUpperCase(str string) bool
-func HasWhitespace(str string) bool
-func HasWhitespaceOnly(str string) bool
-func InRange(value interface{}, left interface{}, right interface{}) bool
-func InRangeFloat32(value, left, right float32) bool
-func InRangeFloat64(value, left, right float64) bool
-func InRangeInt(value, left, right interface{}) bool
-func IsASCII(str string) bool
-func IsAlpha(str string) bool
-func IsAlphanumeric(str string) bool
-func IsBase64(str string) bool
-func IsByteLength(str string, min, max int) bool
-func IsCIDR(str string) bool
-func IsCRC32(str string) bool
-func IsCRC32b(str string) bool
-func IsCreditCard(str string) bool
-func IsDNSName(str string) bool
-func IsDataURI(str string) bool
-func IsDialString(str string) bool
-func IsDivisibleBy(str, num string) bool
-func IsEmail(str string) bool
-func IsExistingEmail(email string) bool
-func IsFilePath(str string) (bool, int)
-func IsFloat(str string) bool
-func IsFullWidth(str string) bool
-func IsHalfWidth(str string) bool
-func IsHash(str string, algorithm string) bool
-func IsHexadecimal(str string) bool
-func IsHexcolor(str string) bool
-func IsHost(str string) bool
-func IsIP(str string) bool
-func IsIPv4(str string) bool
-func IsIPv6(str string) bool
-func IsISBN(str string, version int) bool
-func IsISBN10(str string) bool
-func IsISBN13(str string) bool
-func IsISO3166Alpha2(str string) bool
-func IsISO3166Alpha3(str string) bool
-func IsISO4217(str string) bool
-func IsISO693Alpha2(str string) bool
-func IsISO693Alpha3b(str string) bool
-func IsIn(str string, params ...string) bool
-func IsInRaw(str string, params ...string) bool
-func IsInt(str string) bool
-func IsJSON(str string) bool
-func IsLatitude(str string) bool
-func IsLongitude(str string) bool
-func IsLowerCase(str string) bool
-func IsMAC(str string) bool
-func IsMD4(str string) bool
-func IsMD5(str string) bool
-func IsMagnetURI(str string) bool
-func IsMongoID(str string) bool
-func IsMultibyte(str string) bool
-func IsNatural(value float64) bool
-func IsNegative(value float64) bool
-func IsNonNegative(value float64) bool
-func IsNonPositive(value float64) bool
-func IsNotNull(str string) bool
-func IsNull(str string) bool
-func IsNumeric(str string) bool
-func IsPort(str string) bool
-func IsPositive(value float64) bool
-func IsPrintableASCII(str string) bool
-func IsRFC3339(str string) bool
-func IsRFC3339WithoutZone(str string) bool
-func IsRGBcolor(str string) bool
-func IsRegex(str string) bool
-func IsRequestURI(rawurl string) bool
-func IsRequestURL(rawurl string) bool
-func IsRipeMD128(str string) bool
-func IsRipeMD160(str string) bool
-func IsRsaPub(str string, params ...string) bool
-func IsRsaPublicKey(str string, keylen int) bool
-func IsSHA1(str string) bool
-func IsSHA256(str string) bool
-func IsSHA384(str string) bool
-func IsSHA512(str string) bool
-func IsSSN(str string) bool
-func IsSemver(str string) bool
-func IsTiger128(str string) bool
-func IsTiger160(str string) bool
-func IsTiger192(str string) bool
-func IsTime(str string, format string) bool
-func IsType(v interface{}, params ...string) bool
-func IsURL(str string) bool
-func IsUTFDigit(str string) bool
-func IsUTFLetter(str string) bool
-func IsUTFLetterNumeric(str string) bool
-func IsUTFNumeric(str string) bool
-func IsUUID(str string) bool
-func IsUUIDv3(str string) bool
-func IsUUIDv4(str string) bool
-func IsUUIDv5(str string) bool
-func IsULID(str string) bool
-func IsUnixTime(str string) bool
-func IsUpperCase(str string) bool
-func IsVariableWidth(str string) bool
-func IsWhole(value float64) bool
-func LeftTrim(str, chars string) string
-func Map(array []interface{}, iterator ResultIterator) []interface{}
-func Matches(str, pattern string) bool
-func MaxStringLength(str string, params ...string) bool
-func MinStringLength(str string, params ...string) bool
-func NormalizeEmail(str string) (string, error)
-func PadBoth(str string, padStr string, padLen int) string
-func PadLeft(str string, padStr string, padLen int) string
-func PadRight(str string, padStr string, padLen int) string
-func PrependPathToErrors(err error, path string) error
-func Range(str string, params ...string) bool
-func RemoveTags(s string) string
-func ReplacePattern(str, pattern, replace string) string
-func Reverse(s string) string
-func RightTrim(str, chars string) string
-func RuneLength(str string, params ...string) bool
-func SafeFileName(str string) string
-func SetFieldsRequiredByDefault(value bool)
-func SetNilPtrAllowedByRequired(value bool)
-func Sign(value float64) float64
-func StringLength(str string, params ...string) bool
-func StringMatches(s string, params ...string) bool
-func StripLow(str string, keepNewLines bool) string
-func ToBoolean(str string) (bool, error)
-func ToFloat(str string) (float64, error)
-func ToInt(value interface{}) (res int64, err error)
-func ToJSON(obj interface{}) (string, error)
-func ToString(obj interface{}) string
-func Trim(str, chars string) string
-func Truncate(str string, length int, ending string) string
-func TruncatingErrorf(str string, args ...interface{}) error
-func UnderscoreToCamelCase(s string) string
-func ValidateMap(inputMap map[string]interface{}, validationMap map[string]interface{}) (bool, error)
-func ValidateStruct(s interface{}) (bool, error)
-func WhiteList(str, chars string) string
-type ConditionIterator
-type CustomTypeValidator
-type Error
-func (e Error) Error() string
-type Errors
-func (es Errors) Error() string
-func (es Errors) Errors() []error
-type ISO3166Entry
-type ISO693Entry
-type InterfaceParamValidator
-type Iterator
-type ParamValidator
-type ResultIterator
-type UnsupportedTypeError
-func (e *UnsupportedTypeError) Error() string
-type Validator
-```
-
-#### Examples
-###### IsURL
-```go
-println(govalidator.IsURL(`http://user@pass:domain.com/path/page`))
-```
-###### IsType
-```go
-println(govalidator.IsType("Bob", "string"))
-println(govalidator.IsType(1, "int"))
-i := 1
-println(govalidator.IsType(&i, "*int"))
-```
-
-IsType can be used through the tag `type` which is essential for map validation:
-```go
-type User struct {
- Name string `valid:"type(string)"`
- Age int `valid:"type(int)"`
- Meta interface{} `valid:"type(string)"`
-}
-result, err := govalidator.ValidateStruct(User{"Bob", 20, "meta"})
-if err != nil {
- println("error: " + err.Error())
-}
-println(result)
-```
-###### ToString
-```go
-type User struct {
- FirstName string
- LastName string
-}
-
-str := govalidator.ToString(&User{"John", "Juan"})
-println(str)
-```
-###### Each, Map, Filter, Count for slices
-Each iterates over the slice/array and calls Iterator for every item
-```go
-data := []interface{}{1, 2, 3, 4, 5}
-var fn govalidator.Iterator = func(value interface{}, index int) {
- println(value.(int))
-}
-govalidator.Each(data, fn)
-```
-```go
-data := []interface{}{1, 2, 3, 4, 5}
-var fn govalidator.ResultIterator = func(value interface{}, index int) interface{} {
- return value.(int) * 3
-}
-_ = govalidator.Map(data, fn) // result = []interface{}{1, 6, 9, 12, 15}
-```
-```go
-data := []interface{}{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
-var fn govalidator.ConditionIterator = func(value interface{}, index int) bool {
- return value.(int)%2 == 0
-}
-_ = govalidator.Filter(data, fn) // result = []interface{}{2, 4, 6, 8, 10}
-_ = govalidator.Count(data, fn) // result = 5
-```
-###### ValidateStruct [#2](https://github.com/asaskevich/govalidator/pull/2)
-If you want to validate structs, you can use tag `valid` for any field in your structure. All validators used with this field in one tag are separated by comma. If you want to skip validation, place `-` in your tag. If you need a validator that is not on the list below, you can add it like this:
-```go
-govalidator.TagMap["duck"] = govalidator.Validator(func(str string) bool {
- return str == "duck"
-})
-```
-For completely custom validators (interface-based), see below.
-
-Here is a list of available validators for struct fields (validator - used function):
-```go
-"email": IsEmail,
-"url": IsURL,
-"dialstring": IsDialString,
-"requrl": IsRequestURL,
-"requri": IsRequestURI,
-"alpha": IsAlpha,
-"utfletter": IsUTFLetter,
-"alphanum": IsAlphanumeric,
-"utfletternum": IsUTFLetterNumeric,
-"numeric": IsNumeric,
-"utfnumeric": IsUTFNumeric,
-"utfdigit": IsUTFDigit,
-"hexadecimal": IsHexadecimal,
-"hexcolor": IsHexcolor,
-"rgbcolor": IsRGBcolor,
-"lowercase": IsLowerCase,
-"uppercase": IsUpperCase,
-"int": IsInt,
-"float": IsFloat,
-"null": IsNull,
-"uuid": IsUUID,
-"uuidv3": IsUUIDv3,
-"uuidv4": IsUUIDv4,
-"uuidv5": IsUUIDv5,
-"creditcard": IsCreditCard,
-"isbn10": IsISBN10,
-"isbn13": IsISBN13,
-"json": IsJSON,
-"multibyte": IsMultibyte,
-"ascii": IsASCII,
-"printableascii": IsPrintableASCII,
-"fullwidth": IsFullWidth,
-"halfwidth": IsHalfWidth,
-"variablewidth": IsVariableWidth,
-"base64": IsBase64,
-"datauri": IsDataURI,
-"ip": IsIP,
-"port": IsPort,
-"ipv4": IsIPv4,
-"ipv6": IsIPv6,
-"dns": IsDNSName,
-"host": IsHost,
-"mac": IsMAC,
-"latitude": IsLatitude,
-"longitude": IsLongitude,
-"ssn": IsSSN,
-"semver": IsSemver,
-"rfc3339": IsRFC3339,
-"rfc3339WithoutZone": IsRFC3339WithoutZone,
-"ISO3166Alpha2": IsISO3166Alpha2,
-"ISO3166Alpha3": IsISO3166Alpha3,
-"ulid": IsULID,
-```
-Validators with parameters
-
-```go
-"range(min|max)": Range,
-"length(min|max)": ByteLength,
-"runelength(min|max)": RuneLength,
-"stringlength(min|max)": StringLength,
-"matches(pattern)": StringMatches,
-"in(string1|string2|...|stringN)": IsIn,
-"rsapub(keylength)" : IsRsaPub,
-"minstringlength(int): MinStringLength,
-"maxstringlength(int): MaxStringLength,
-```
-Validators with parameters for any type
-
-```go
-"type(type)": IsType,
-```
-
-And here is small example of usage:
-```go
-type Post struct {
- Title string `valid:"alphanum,required"`
- Message string `valid:"duck,ascii"`
- Message2 string `valid:"animal(dog)"`
- AuthorIP string `valid:"ipv4"`
- Date string `valid:"-"`
-}
-post := &Post{
- Title: "My Example Post",
- Message: "duck",
- Message2: "dog",
- AuthorIP: "123.234.54.3",
-}
-
-// Add your own struct validation tags
-govalidator.TagMap["duck"] = govalidator.Validator(func(str string) bool {
- return str == "duck"
-})
-
-// Add your own struct validation tags with parameter
-govalidator.ParamTagMap["animal"] = govalidator.ParamValidator(func(str string, params ...string) bool {
- species := params[0]
- return str == species
-})
-govalidator.ParamTagRegexMap["animal"] = regexp.MustCompile("^animal\\((\\w+)\\)$")
-
-result, err := govalidator.ValidateStruct(post)
-if err != nil {
- println("error: " + err.Error())
-}
-println(result)
-```
-###### ValidateMap [#2](https://github.com/asaskevich/govalidator/pull/338)
-If you want to validate maps, you can use the map to be validated and a validation map that contain the same tags used in ValidateStruct, both maps have to be in the form `map[string]interface{}`
-
-So here is small example of usage:
-```go
-var mapTemplate = map[string]interface{}{
- "name":"required,alpha",
- "family":"required,alpha",
- "email":"required,email",
- "cell-phone":"numeric",
- "address":map[string]interface{}{
- "line1":"required,alphanum",
- "line2":"alphanum",
- "postal-code":"numeric",
- },
-}
-
-var inputMap = map[string]interface{}{
- "name":"Bob",
- "family":"Smith",
- "email":"foo@bar.baz",
- "address":map[string]interface{}{
- "line1":"",
- "line2":"",
- "postal-code":"",
- },
-}
-
-result, err := govalidator.ValidateMap(inputMap, mapTemplate)
-if err != nil {
- println("error: " + err.Error())
-}
-println(result)
-```
-
-###### WhiteList
-```go
-// Remove all characters from string ignoring characters between "a" and "z"
-println(govalidator.WhiteList("a3a43a5a4a3a2a23a4a5a4a3a4", "a-z") == "aaaaaaaaaaaa")
-```
-
-###### Custom validation functions
-Custom validation using your own domain specific validators is also available - here's an example of how to use it:
-```go
-import "github.com/asaskevich/govalidator"
-
-type CustomByteArray [6]byte // custom types are supported and can be validated
-
-type StructWithCustomByteArray struct {
- ID CustomByteArray `valid:"customByteArrayValidator,customMinLengthValidator"` // multiple custom validators are possible as well and will be evaluated in sequence
- Email string `valid:"email"`
- CustomMinLength int `valid:"-"`
-}
-
-govalidator.CustomTypeTagMap.Set("customByteArrayValidator", func(i interface{}, context interface{}) bool {
- switch v := context.(type) { // you can type switch on the context interface being validated
- case StructWithCustomByteArray:
- // you can check and validate against some other field in the context,
- // return early or not validate against the context at all – your choice
- case SomeOtherType:
- // ...
- default:
- // expecting some other type? Throw/panic here or continue
- }
-
- switch v := i.(type) { // type switch on the struct field being validated
- case CustomByteArray:
- for _, e := range v { // this validator checks that the byte array is not empty, i.e. not all zeroes
- if e != 0 {
- return true
- }
- }
- }
- return false
-})
-govalidator.CustomTypeTagMap.Set("customMinLengthValidator", func(i interface{}, context interface{}) bool {
- switch v := context.(type) { // this validates a field against the value in another field, i.e. dependent validation
- case StructWithCustomByteArray:
- return len(v.ID) >= v.CustomMinLength
- }
- return false
-})
-```
-
-###### Loop over Error()
-By default .Error() returns all errors in a single String. To access each error you can do this:
-```go
- if err != nil {
- errs := err.(govalidator.Errors).Errors()
- for _, e := range errs {
- fmt.Println(e.Error())
- }
- }
-```
-
-###### Custom error messages
-Custom error messages are supported via annotations by adding the `~` separator - here's an example of how to use it:
-```go
-type Ticket struct {
- Id int64 `json:"id"`
- FirstName string `json:"firstname" valid:"required~First name is blank"`
-}
-```
-
-#### Notes
-Documentation is available here: [godoc.org](https://godoc.org/github.com/asaskevich/govalidator).
-Full information about code coverage is also available here: [govalidator on gocover.io](http://gocover.io/github.com/asaskevich/govalidator).
-
-#### Support
-If you do have a contribution to the package, feel free to create a Pull Request or an Issue.
-
-#### What to contribute
-If you don't know what to do, there are some features and functions that need to be done
-
-- [ ] Refactor code
-- [ ] Edit docs and [README](https://github.com/asaskevich/govalidator/README.md): spellcheck, grammar and typo check
-- [ ] Create actual list of contributors and projects that currently using this package
-- [ ] Resolve [issues and bugs](https://github.com/asaskevich/govalidator/issues)
-- [ ] Update actual [list of functions](https://github.com/asaskevich/govalidator#list-of-functions)
-- [ ] Update [list of validators](https://github.com/asaskevich/govalidator#validatestruct-2) that available for `ValidateStruct` and add new
-- [ ] Implement new validators: `IsFQDN`, `IsIMEI`, `IsPostalCode`, `IsISIN`, `IsISRC` etc
-- [x] Implement [validation by maps](https://github.com/asaskevich/govalidator/issues/224)
-- [ ] Implement fuzzing testing
-- [ ] Implement some struct/map/array utilities
-- [ ] Implement map/array validation
-- [ ] Implement benchmarking
-- [ ] Implement batch of examples
-- [ ] Look at forks for new features and fixes
-
-#### Advice
-Feel free to create what you want, but keep in mind when you implement new features:
-- Code must be clear and readable, names of variables/constants clearly describes what they are doing
-- Public functions must be documented and described in source file and added to README.md to the list of available functions
-- There are must be unit-tests for any new functions and improvements
-
-## Credits
-### Contributors
-
-This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
-
-#### Special thanks to [contributors](https://github.com/asaskevich/govalidator/graphs/contributors)
-* [Daniel Lohse](https://github.com/annismckenzie)
-* [Attila Oláh](https://github.com/attilaolah)
-* [Daniel Korner](https://github.com/Dadie)
-* [Steven Wilkin](https://github.com/stevenwilkin)
-* [Deiwin Sarjas](https://github.com/deiwin)
-* [Noah Shibley](https://github.com/slugmobile)
-* [Nathan Davies](https://github.com/nathj07)
-* [Matt Sanford](https://github.com/mzsanford)
-* [Simon ccl1115](https://github.com/ccl1115)
-
-
-
-
-### Backers
-
-Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/govalidator#backer)]
-
-
-
-
-### Sponsors
-
-Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/govalidator#sponsor)]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-## License
-[](https://app.fossa.io/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator?ref=badge_large)
diff --git a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/arrays.go b/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/arrays.go
deleted file mode 100644
index 3e1da7cb4..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/arrays.go
+++ /dev/null
@@ -1,87 +0,0 @@
-package govalidator
-
-// Iterator is the function that accepts element of slice/array and its index
-type Iterator func(interface{}, int)
-
-// ResultIterator is the function that accepts element of slice/array and its index and returns any result
-type ResultIterator func(interface{}, int) interface{}
-
-// ConditionIterator is the function that accepts element of slice/array and its index and returns boolean
-type ConditionIterator func(interface{}, int) bool
-
-// ReduceIterator is the function that accepts two element of slice/array and returns result of merging those values
-type ReduceIterator func(interface{}, interface{}) interface{}
-
-// Some validates that any item of array corresponds to ConditionIterator. Returns boolean.
-func Some(array []interface{}, iterator ConditionIterator) bool {
- res := false
- for index, data := range array {
- res = res || iterator(data, index)
- }
- return res
-}
-
-// Every validates that every item of array corresponds to ConditionIterator. Returns boolean.
-func Every(array []interface{}, iterator ConditionIterator) bool {
- res := true
- for index, data := range array {
- res = res && iterator(data, index)
- }
- return res
-}
-
-// Reduce boils down a list of values into a single value by ReduceIterator
-func Reduce(array []interface{}, iterator ReduceIterator, initialValue interface{}) interface{} {
- for _, data := range array {
- initialValue = iterator(initialValue, data)
- }
- return initialValue
-}
-
-// Each iterates over the slice and apply Iterator to every item
-func Each(array []interface{}, iterator Iterator) {
- for index, data := range array {
- iterator(data, index)
- }
-}
-
-// Map iterates over the slice and apply ResultIterator to every item. Returns new slice as a result.
-func Map(array []interface{}, iterator ResultIterator) []interface{} {
- var result = make([]interface{}, len(array))
- for index, data := range array {
- result[index] = iterator(data, index)
- }
- return result
-}
-
-// Find iterates over the slice and apply ConditionIterator to every item. Returns first item that meet ConditionIterator or nil otherwise.
-func Find(array []interface{}, iterator ConditionIterator) interface{} {
- for index, data := range array {
- if iterator(data, index) {
- return data
- }
- }
- return nil
-}
-
-// Filter iterates over the slice and apply ConditionIterator to every item. Returns new slice.
-func Filter(array []interface{}, iterator ConditionIterator) []interface{} {
- var result = make([]interface{}, 0)
- for index, data := range array {
- if iterator(data, index) {
- result = append(result, data)
- }
- }
- return result
-}
-
-// Count iterates over the slice and apply ConditionIterator to every item. Returns count of items that meets ConditionIterator.
-func Count(array []interface{}, iterator ConditionIterator) int {
- count := 0
- for index, data := range array {
- if iterator(data, index) {
- count = count + 1
- }
- }
- return count
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/converter.go b/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/converter.go
deleted file mode 100644
index d68e990fc..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/converter.go
+++ /dev/null
@@ -1,81 +0,0 @@
-package govalidator
-
-import (
- "encoding/json"
- "fmt"
- "reflect"
- "strconv"
-)
-
-// ToString convert the input to a string.
-func ToString(obj interface{}) string {
- res := fmt.Sprintf("%v", obj)
- return res
-}
-
-// ToJSON convert the input to a valid JSON string
-func ToJSON(obj interface{}) (string, error) {
- res, err := json.Marshal(obj)
- if err != nil {
- res = []byte("")
- }
- return string(res), err
-}
-
-// ToFloat convert the input string to a float, or 0.0 if the input is not a float.
-func ToFloat(value interface{}) (res float64, err error) {
- val := reflect.ValueOf(value)
-
- switch value.(type) {
- case int, int8, int16, int32, int64:
- res = float64(val.Int())
- case uint, uint8, uint16, uint32, uint64:
- res = float64(val.Uint())
- case float32, float64:
- res = val.Float()
- case string:
- res, err = strconv.ParseFloat(val.String(), 64)
- if err != nil {
- res = 0
- }
- default:
- err = fmt.Errorf("ToInt: unknown interface type %T", value)
- res = 0
- }
-
- return
-}
-
-// ToInt convert the input string or any int type to an integer type 64, or 0 if the input is not an integer.
-func ToInt(value interface{}) (res int64, err error) {
- val := reflect.ValueOf(value)
-
- switch value.(type) {
- case int, int8, int16, int32, int64:
- res = val.Int()
- case uint, uint8, uint16, uint32, uint64:
- res = int64(val.Uint())
- case float32, float64:
- res = int64(val.Float())
- case string:
- if IsInt(val.String()) {
- res, err = strconv.ParseInt(val.String(), 0, 64)
- if err != nil {
- res = 0
- }
- } else {
- err = fmt.Errorf("ToInt: invalid numeric format %g", value)
- res = 0
- }
- default:
- err = fmt.Errorf("ToInt: unknown interface type %T", value)
- res = 0
- }
-
- return
-}
-
-// ToBoolean convert the input string to a boolean.
-func ToBoolean(str string) (bool, error) {
- return strconv.ParseBool(str)
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/doc.go b/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/doc.go
deleted file mode 100644
index 55dce62dc..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/doc.go
+++ /dev/null
@@ -1,3 +0,0 @@
-package govalidator
-
-// A package of validators and sanitizers for strings, structures and collections.
diff --git a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/error.go b/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/error.go
deleted file mode 100644
index 1da2336f4..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/error.go
+++ /dev/null
@@ -1,47 +0,0 @@
-package govalidator
-
-import (
- "sort"
- "strings"
-)
-
-// Errors is an array of multiple errors and conforms to the error interface.
-type Errors []error
-
-// Errors returns itself.
-func (es Errors) Errors() []error {
- return es
-}
-
-func (es Errors) Error() string {
- var errs []string
- for _, e := range es {
- errs = append(errs, e.Error())
- }
- sort.Strings(errs)
- return strings.Join(errs, ";")
-}
-
-// Error encapsulates a name, an error and whether there's a custom error message or not.
-type Error struct {
- Name string
- Err error
- CustomErrorMessageExists bool
-
- // Validator indicates the name of the validator that failed
- Validator string
- Path []string
-}
-
-func (e Error) Error() string {
- if e.CustomErrorMessageExists {
- return e.Err.Error()
- }
-
- errName := e.Name
- if len(e.Path) > 0 {
- errName = strings.Join(append(e.Path, e.Name), ".")
- }
-
- return errName + ": " + e.Err.Error()
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/numerics.go b/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/numerics.go
deleted file mode 100644
index 5041d9e86..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/numerics.go
+++ /dev/null
@@ -1,100 +0,0 @@
-package govalidator
-
-import (
- "math"
-)
-
-// Abs returns absolute value of number
-func Abs(value float64) float64 {
- return math.Abs(value)
-}
-
-// Sign returns signum of number: 1 in case of value > 0, -1 in case of value < 0, 0 otherwise
-func Sign(value float64) float64 {
- if value > 0 {
- return 1
- } else if value < 0 {
- return -1
- } else {
- return 0
- }
-}
-
-// IsNegative returns true if value < 0
-func IsNegative(value float64) bool {
- return value < 0
-}
-
-// IsPositive returns true if value > 0
-func IsPositive(value float64) bool {
- return value > 0
-}
-
-// IsNonNegative returns true if value >= 0
-func IsNonNegative(value float64) bool {
- return value >= 0
-}
-
-// IsNonPositive returns true if value <= 0
-func IsNonPositive(value float64) bool {
- return value <= 0
-}
-
-// InRangeInt returns true if value lies between left and right border
-func InRangeInt(value, left, right interface{}) bool {
- value64, _ := ToInt(value)
- left64, _ := ToInt(left)
- right64, _ := ToInt(right)
- if left64 > right64 {
- left64, right64 = right64, left64
- }
- return value64 >= left64 && value64 <= right64
-}
-
-// InRangeFloat32 returns true if value lies between left and right border
-func InRangeFloat32(value, left, right float32) bool {
- if left > right {
- left, right = right, left
- }
- return value >= left && value <= right
-}
-
-// InRangeFloat64 returns true if value lies between left and right border
-func InRangeFloat64(value, left, right float64) bool {
- if left > right {
- left, right = right, left
- }
- return value >= left && value <= right
-}
-
-// InRange returns true if value lies between left and right border, generic type to handle int, float32, float64 and string.
-// All types must the same type.
-// False if value doesn't lie in range or if it incompatible or not comparable
-func InRange(value interface{}, left interface{}, right interface{}) bool {
- switch value.(type) {
- case int:
- intValue, _ := ToInt(value)
- intLeft, _ := ToInt(left)
- intRight, _ := ToInt(right)
- return InRangeInt(intValue, intLeft, intRight)
- case float32, float64:
- intValue, _ := ToFloat(value)
- intLeft, _ := ToFloat(left)
- intRight, _ := ToFloat(right)
- return InRangeFloat64(intValue, intLeft, intRight)
- case string:
- return value.(string) >= left.(string) && value.(string) <= right.(string)
- default:
- return false
- }
-}
-
-// IsWhole returns true if value is whole number
-func IsWhole(value float64) bool {
- return math.Remainder(value, 1) == 0
-}
-
-// IsNatural returns true if value is natural number (positive and whole)
-func IsNatural(value float64) bool {
- return IsWhole(value) && IsPositive(value)
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/patterns.go b/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/patterns.go
deleted file mode 100644
index bafc3765e..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/patterns.go
+++ /dev/null
@@ -1,113 +0,0 @@
-package govalidator
-
-import "regexp"
-
-// Basic regular expressions for validating strings
-const (
- Email string = "^(((([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])+(\\.([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])([a-zA-Z]|\\d|-|\\.|_|~|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])*([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])))\\.)+(([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])([a-zA-Z]|\\d|-|_|~|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])*([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])))\\.?$"
- CreditCard string = "^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\d{3})\\d{11}|6[27][0-9]{14})$"
- ISBN10 string = "^(?:[0-9]{9}X|[0-9]{10})$"
- ISBN13 string = "^(?:[0-9]{13})$"
- UUID3 string = "^[0-9a-f]{8}-[0-9a-f]{4}-3[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$"
- UUID4 string = "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
- UUID5 string = "^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
- UUID string = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
- Alpha string = "^[a-zA-Z]+$"
- Alphanumeric string = "^[a-zA-Z0-9]+$"
- Numeric string = "^[0-9]+$"
- Int string = "^(?:[-+]?(?:0|[1-9][0-9]*))$"
- Float string = "^(?:[-+]?(?:[0-9]+))?(?:\\.[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$"
- Hexadecimal string = "^[0-9a-fA-F]+$"
- Hexcolor string = "^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$"
- RGBcolor string = "^rgb\\(\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*\\)$"
- ASCII string = "^[\x00-\x7F]+$"
- Multibyte string = "[^\x00-\x7F]"
- FullWidth string = "[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]"
- HalfWidth string = "[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]"
- Base64 string = "^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=|[A-Za-z0-9+\\/]{4})$"
- PrintableASCII string = "^[\x20-\x7E]+$"
- DataURI string = "^data:.+\\/(.+);base64$"
- MagnetURI string = "^magnet:\\?xt=urn:[a-zA-Z0-9]+:[a-zA-Z0-9]{32,40}&dn=.+&tr=.+$"
- Latitude string = "^[-+]?([1-8]?\\d(\\.\\d+)?|90(\\.0+)?)$"
- Longitude string = "^[-+]?(180(\\.0+)?|((1[0-7]\\d)|([1-9]?\\d))(\\.\\d+)?)$"
- DNSName string = `^([a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62}){1}(\.[a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62})*[\._]?$`
- IP string = `(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))`
- URLSchema string = `((ftp|tcp|udp|wss?|https?):\/\/)`
- URLUsername string = `(\S+(:\S*)?@)`
- URLPath string = `((\/|\?|#)[^\s]*)`
- URLPort string = `(:(\d{1,5}))`
- URLIP string = `([1-9]\d?|1\d\d|2[01]\d|22[0-3]|24\d|25[0-5])(\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])){2}(?:\.([0-9]\d?|1\d\d|2[0-4]\d|25[0-5]))`
- URLSubdomain string = `((www\.)|([a-zA-Z0-9]+([-_\.]?[a-zA-Z0-9])*[a-zA-Z0-9]\.[a-zA-Z0-9]+))`
- URL = `^` + URLSchema + `?` + URLUsername + `?` + `((` + URLIP + `|(\[` + IP + `\])|(([a-zA-Z0-9]([a-zA-Z0-9-_]+)?[a-zA-Z0-9]([-\.][a-zA-Z0-9]+)*)|(` + URLSubdomain + `?))?(([a-zA-Z\x{00a1}-\x{ffff}0-9]+-?-?)*[a-zA-Z\x{00a1}-\x{ffff}0-9]+)(?:\.([a-zA-Z\x{00a1}-\x{ffff}]{1,}))?))\.?` + URLPort + `?` + URLPath + `?$`
- SSN string = `^\d{3}[- ]?\d{2}[- ]?\d{4}$`
- WinPath string = `^[a-zA-Z]:\\(?:[^\\/:*?"<>|\r\n]+\\)*[^\\/:*?"<>|\r\n]*$`
- UnixPath string = `^(/[^/\x00]*)+/?$`
- WinARPath string = `^(?:(?:[a-zA-Z]:|\\\\[a-z0-9_.$●-]+\\[a-z0-9_.$●-]+)\\|\\?[^\\/:*?"<>|\r\n]+\\?)(?:[^\\/:*?"<>|\r\n]+\\)*[^\\/:*?"<>|\r\n]*$`
- UnixARPath string = `^((\.{0,2}/)?([^/\x00]*))+/?$`
- Semver string = "^v?(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(-(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(\\.(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\\+[0-9a-zA-Z-]+(\\.[0-9a-zA-Z-]+)*)?$"
- tagName string = "valid"
- hasLowerCase string = ".*[[:lower:]]"
- hasUpperCase string = ".*[[:upper:]]"
- hasWhitespace string = ".*[[:space:]]"
- hasWhitespaceOnly string = "^[[:space:]]+$"
- IMEI string = "^[0-9a-f]{14}$|^\\d{15}$|^\\d{18}$"
- IMSI string = "^\\d{14,15}$"
- E164 string = `^\+?[1-9]\d{1,14}$`
-)
-
-// Used by IsFilePath func
-const (
- // Unknown is unresolved OS type
- Unknown = iota
- // Win is Windows type
- Win
- // Unix is *nix OS types
- Unix
-)
-
-var (
- userRegexp = regexp.MustCompile("^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~.-]+$")
- hostRegexp = regexp.MustCompile("^[^\\s]+\\.[^\\s]+$")
- userDotRegexp = regexp.MustCompile("(^[.]{1})|([.]{1}$)|([.]{2,})")
- rxEmail = regexp.MustCompile(Email)
- rxCreditCard = regexp.MustCompile(CreditCard)
- rxISBN10 = regexp.MustCompile(ISBN10)
- rxISBN13 = regexp.MustCompile(ISBN13)
- rxUUID3 = regexp.MustCompile(UUID3)
- rxUUID4 = regexp.MustCompile(UUID4)
- rxUUID5 = regexp.MustCompile(UUID5)
- rxUUID = regexp.MustCompile(UUID)
- rxAlpha = regexp.MustCompile(Alpha)
- rxAlphanumeric = regexp.MustCompile(Alphanumeric)
- rxNumeric = regexp.MustCompile(Numeric)
- rxInt = regexp.MustCompile(Int)
- rxFloat = regexp.MustCompile(Float)
- rxHexadecimal = regexp.MustCompile(Hexadecimal)
- rxHexcolor = regexp.MustCompile(Hexcolor)
- rxRGBcolor = regexp.MustCompile(RGBcolor)
- rxASCII = regexp.MustCompile(ASCII)
- rxPrintableASCII = regexp.MustCompile(PrintableASCII)
- rxMultibyte = regexp.MustCompile(Multibyte)
- rxFullWidth = regexp.MustCompile(FullWidth)
- rxHalfWidth = regexp.MustCompile(HalfWidth)
- rxBase64 = regexp.MustCompile(Base64)
- rxDataURI = regexp.MustCompile(DataURI)
- rxMagnetURI = regexp.MustCompile(MagnetURI)
- rxLatitude = regexp.MustCompile(Latitude)
- rxLongitude = regexp.MustCompile(Longitude)
- rxDNSName = regexp.MustCompile(DNSName)
- rxURL = regexp.MustCompile(URL)
- rxSSN = regexp.MustCompile(SSN)
- rxWinPath = regexp.MustCompile(WinPath)
- rxUnixPath = regexp.MustCompile(UnixPath)
- rxARWinPath = regexp.MustCompile(WinARPath)
- rxARUnixPath = regexp.MustCompile(UnixARPath)
- rxSemver = regexp.MustCompile(Semver)
- rxHasLowerCase = regexp.MustCompile(hasLowerCase)
- rxHasUpperCase = regexp.MustCompile(hasUpperCase)
- rxHasWhitespace = regexp.MustCompile(hasWhitespace)
- rxHasWhitespaceOnly = regexp.MustCompile(hasWhitespaceOnly)
- rxIMEI = regexp.MustCompile(IMEI)
- rxIMSI = regexp.MustCompile(IMSI)
- rxE164 = regexp.MustCompile(E164)
-)
diff --git a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/types.go b/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/types.go
deleted file mode 100644
index c573abb51..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/types.go
+++ /dev/null
@@ -1,656 +0,0 @@
-package govalidator
-
-import (
- "reflect"
- "regexp"
- "sort"
- "sync"
-)
-
-// Validator is a wrapper for a validator function that returns bool and accepts string.
-type Validator func(str string) bool
-
-// CustomTypeValidator is a wrapper for validator functions that returns bool and accepts any type.
-// The second parameter should be the context (in the case of validating a struct: the whole object being validated).
-type CustomTypeValidator func(i interface{}, o interface{}) bool
-
-// ParamValidator is a wrapper for validator functions that accept additional parameters.
-type ParamValidator func(str string, params ...string) bool
-
-// InterfaceParamValidator is a wrapper for functions that accept variants parameters for an interface value
-type InterfaceParamValidator func(in interface{}, params ...string) bool
-type tagOptionsMap map[string]tagOption
-
-func (t tagOptionsMap) orderedKeys() []string {
- var keys []string
- for k := range t {
- keys = append(keys, k)
- }
-
- sort.Slice(keys, func(a, b int) bool {
- return t[keys[a]].order < t[keys[b]].order
- })
-
- return keys
-}
-
-type tagOption struct {
- name string
- customErrorMessage string
- order int
-}
-
-// UnsupportedTypeError is a wrapper for reflect.Type
-type UnsupportedTypeError struct {
- Type reflect.Type
-}
-
-// stringValues is a slice of reflect.Value holding *reflect.StringValue.
-// It implements the methods to sort by string.
-type stringValues []reflect.Value
-
-// InterfaceParamTagMap is a map of functions accept variants parameters for an interface value
-var InterfaceParamTagMap = map[string]InterfaceParamValidator{
- "type": IsType,
-}
-
-// InterfaceParamTagRegexMap maps interface param tags to their respective regexes.
-var InterfaceParamTagRegexMap = map[string]*regexp.Regexp{
- "type": regexp.MustCompile(`^type\((.*)\)$`),
-}
-
-// ParamTagMap is a map of functions accept variants parameters
-var ParamTagMap = map[string]ParamValidator{
- "length": ByteLength,
- "range": Range,
- "runelength": RuneLength,
- "stringlength": StringLength,
- "matches": StringMatches,
- "in": IsInRaw,
- "rsapub": IsRsaPub,
- "minstringlength": MinStringLength,
- "maxstringlength": MaxStringLength,
-}
-
-// ParamTagRegexMap maps param tags to their respective regexes.
-var ParamTagRegexMap = map[string]*regexp.Regexp{
- "range": regexp.MustCompile("^range\\((\\d+)\\|(\\d+)\\)$"),
- "length": regexp.MustCompile("^length\\((\\d+)\\|(\\d+)\\)$"),
- "runelength": regexp.MustCompile("^runelength\\((\\d+)\\|(\\d+)\\)$"),
- "stringlength": regexp.MustCompile("^stringlength\\((\\d+)\\|(\\d+)\\)$"),
- "in": regexp.MustCompile(`^in\((.*)\)`),
- "matches": regexp.MustCompile(`^matches\((.+)\)$`),
- "rsapub": regexp.MustCompile("^rsapub\\((\\d+)\\)$"),
- "minstringlength": regexp.MustCompile("^minstringlength\\((\\d+)\\)$"),
- "maxstringlength": regexp.MustCompile("^maxstringlength\\((\\d+)\\)$"),
-}
-
-type customTypeTagMap struct {
- validators map[string]CustomTypeValidator
-
- sync.RWMutex
-}
-
-func (tm *customTypeTagMap) Get(name string) (CustomTypeValidator, bool) {
- tm.RLock()
- defer tm.RUnlock()
- v, ok := tm.validators[name]
- return v, ok
-}
-
-func (tm *customTypeTagMap) Set(name string, ctv CustomTypeValidator) {
- tm.Lock()
- defer tm.Unlock()
- tm.validators[name] = ctv
-}
-
-// CustomTypeTagMap is a map of functions that can be used as tags for ValidateStruct function.
-// Use this to validate compound or custom types that need to be handled as a whole, e.g.
-// `type UUID [16]byte` (this would be handled as an array of bytes).
-var CustomTypeTagMap = &customTypeTagMap{validators: make(map[string]CustomTypeValidator)}
-
-// TagMap is a map of functions, that can be used as tags for ValidateStruct function.
-var TagMap = map[string]Validator{
- "email": IsEmail,
- "url": IsURL,
- "dialstring": IsDialString,
- "requrl": IsRequestURL,
- "requri": IsRequestURI,
- "alpha": IsAlpha,
- "utfletter": IsUTFLetter,
- "alphanum": IsAlphanumeric,
- "utfletternum": IsUTFLetterNumeric,
- "numeric": IsNumeric,
- "utfnumeric": IsUTFNumeric,
- "utfdigit": IsUTFDigit,
- "hexadecimal": IsHexadecimal,
- "hexcolor": IsHexcolor,
- "rgbcolor": IsRGBcolor,
- "lowercase": IsLowerCase,
- "uppercase": IsUpperCase,
- "int": IsInt,
- "float": IsFloat,
- "null": IsNull,
- "notnull": IsNotNull,
- "uuid": IsUUID,
- "uuidv3": IsUUIDv3,
- "uuidv4": IsUUIDv4,
- "uuidv5": IsUUIDv5,
- "creditcard": IsCreditCard,
- "isbn10": IsISBN10,
- "isbn13": IsISBN13,
- "json": IsJSON,
- "multibyte": IsMultibyte,
- "ascii": IsASCII,
- "printableascii": IsPrintableASCII,
- "fullwidth": IsFullWidth,
- "halfwidth": IsHalfWidth,
- "variablewidth": IsVariableWidth,
- "base64": IsBase64,
- "datauri": IsDataURI,
- "ip": IsIP,
- "port": IsPort,
- "ipv4": IsIPv4,
- "ipv6": IsIPv6,
- "dns": IsDNSName,
- "host": IsHost,
- "mac": IsMAC,
- "latitude": IsLatitude,
- "longitude": IsLongitude,
- "ssn": IsSSN,
- "semver": IsSemver,
- "rfc3339": IsRFC3339,
- "rfc3339WithoutZone": IsRFC3339WithoutZone,
- "ISO3166Alpha2": IsISO3166Alpha2,
- "ISO3166Alpha3": IsISO3166Alpha3,
- "ISO4217": IsISO4217,
- "IMEI": IsIMEI,
- "ulid": IsULID,
-}
-
-// ISO3166Entry stores country codes
-type ISO3166Entry struct {
- EnglishShortName string
- FrenchShortName string
- Alpha2Code string
- Alpha3Code string
- Numeric string
-}
-
-//ISO3166List based on https://www.iso.org/obp/ui/#search/code/ Code Type "Officially Assigned Codes"
-var ISO3166List = []ISO3166Entry{
- {"Afghanistan", "Afghanistan (l')", "AF", "AFG", "004"},
- {"Albania", "Albanie (l')", "AL", "ALB", "008"},
- {"Antarctica", "Antarctique (l')", "AQ", "ATA", "010"},
- {"Algeria", "Algérie (l')", "DZ", "DZA", "012"},
- {"American Samoa", "Samoa américaines (les)", "AS", "ASM", "016"},
- {"Andorra", "Andorre (l')", "AD", "AND", "020"},
- {"Angola", "Angola (l')", "AO", "AGO", "024"},
- {"Antigua and Barbuda", "Antigua-et-Barbuda", "AG", "ATG", "028"},
- {"Azerbaijan", "Azerbaïdjan (l')", "AZ", "AZE", "031"},
- {"Argentina", "Argentine (l')", "AR", "ARG", "032"},
- {"Australia", "Australie (l')", "AU", "AUS", "036"},
- {"Austria", "Autriche (l')", "AT", "AUT", "040"},
- {"Bahamas (the)", "Bahamas (les)", "BS", "BHS", "044"},
- {"Bahrain", "Bahreïn", "BH", "BHR", "048"},
- {"Bangladesh", "Bangladesh (le)", "BD", "BGD", "050"},
- {"Armenia", "Arménie (l')", "AM", "ARM", "051"},
- {"Barbados", "Barbade (la)", "BB", "BRB", "052"},
- {"Belgium", "Belgique (la)", "BE", "BEL", "056"},
- {"Bermuda", "Bermudes (les)", "BM", "BMU", "060"},
- {"Bhutan", "Bhoutan (le)", "BT", "BTN", "064"},
- {"Bolivia (Plurinational State of)", "Bolivie (État plurinational de)", "BO", "BOL", "068"},
- {"Bosnia and Herzegovina", "Bosnie-Herzégovine (la)", "BA", "BIH", "070"},
- {"Botswana", "Botswana (le)", "BW", "BWA", "072"},
- {"Bouvet Island", "Bouvet (l'Île)", "BV", "BVT", "074"},
- {"Brazil", "Brésil (le)", "BR", "BRA", "076"},
- {"Belize", "Belize (le)", "BZ", "BLZ", "084"},
- {"British Indian Ocean Territory (the)", "Indien (le Territoire britannique de l'océan)", "IO", "IOT", "086"},
- {"Solomon Islands", "Salomon (Îles)", "SB", "SLB", "090"},
- {"Virgin Islands (British)", "Vierges britanniques (les Îles)", "VG", "VGB", "092"},
- {"Brunei Darussalam", "Brunéi Darussalam (le)", "BN", "BRN", "096"},
- {"Bulgaria", "Bulgarie (la)", "BG", "BGR", "100"},
- {"Myanmar", "Myanmar (le)", "MM", "MMR", "104"},
- {"Burundi", "Burundi (le)", "BI", "BDI", "108"},
- {"Belarus", "Bélarus (le)", "BY", "BLR", "112"},
- {"Cambodia", "Cambodge (le)", "KH", "KHM", "116"},
- {"Cameroon", "Cameroun (le)", "CM", "CMR", "120"},
- {"Canada", "Canada (le)", "CA", "CAN", "124"},
- {"Cabo Verde", "Cabo Verde", "CV", "CPV", "132"},
- {"Cayman Islands (the)", "Caïmans (les Îles)", "KY", "CYM", "136"},
- {"Central African Republic (the)", "République centrafricaine (la)", "CF", "CAF", "140"},
- {"Sri Lanka", "Sri Lanka", "LK", "LKA", "144"},
- {"Chad", "Tchad (le)", "TD", "TCD", "148"},
- {"Chile", "Chili (le)", "CL", "CHL", "152"},
- {"China", "Chine (la)", "CN", "CHN", "156"},
- {"Taiwan (Province of China)", "Taïwan (Province de Chine)", "TW", "TWN", "158"},
- {"Christmas Island", "Christmas (l'Île)", "CX", "CXR", "162"},
- {"Cocos (Keeling) Islands (the)", "Cocos (les Îles)/ Keeling (les Îles)", "CC", "CCK", "166"},
- {"Colombia", "Colombie (la)", "CO", "COL", "170"},
- {"Comoros (the)", "Comores (les)", "KM", "COM", "174"},
- {"Mayotte", "Mayotte", "YT", "MYT", "175"},
- {"Congo (the)", "Congo (le)", "CG", "COG", "178"},
- {"Congo (the Democratic Republic of the)", "Congo (la République démocratique du)", "CD", "COD", "180"},
- {"Cook Islands (the)", "Cook (les Îles)", "CK", "COK", "184"},
- {"Costa Rica", "Costa Rica (le)", "CR", "CRI", "188"},
- {"Croatia", "Croatie (la)", "HR", "HRV", "191"},
- {"Cuba", "Cuba", "CU", "CUB", "192"},
- {"Cyprus", "Chypre", "CY", "CYP", "196"},
- {"Czech Republic (the)", "tchèque (la République)", "CZ", "CZE", "203"},
- {"Benin", "Bénin (le)", "BJ", "BEN", "204"},
- {"Denmark", "Danemark (le)", "DK", "DNK", "208"},
- {"Dominica", "Dominique (la)", "DM", "DMA", "212"},
- {"Dominican Republic (the)", "dominicaine (la République)", "DO", "DOM", "214"},
- {"Ecuador", "Équateur (l')", "EC", "ECU", "218"},
- {"El Salvador", "El Salvador", "SV", "SLV", "222"},
- {"Equatorial Guinea", "Guinée équatoriale (la)", "GQ", "GNQ", "226"},
- {"Ethiopia", "Éthiopie (l')", "ET", "ETH", "231"},
- {"Eritrea", "Érythrée (l')", "ER", "ERI", "232"},
- {"Estonia", "Estonie (l')", "EE", "EST", "233"},
- {"Faroe Islands (the)", "Féroé (les Îles)", "FO", "FRO", "234"},
- {"Falkland Islands (the) [Malvinas]", "Falkland (les Îles)/Malouines (les Îles)", "FK", "FLK", "238"},
- {"South Georgia and the South Sandwich Islands", "Géorgie du Sud-et-les Îles Sandwich du Sud (la)", "GS", "SGS", "239"},
- {"Fiji", "Fidji (les)", "FJ", "FJI", "242"},
- {"Finland", "Finlande (la)", "FI", "FIN", "246"},
- {"Åland Islands", "Åland(les Îles)", "AX", "ALA", "248"},
- {"France", "France (la)", "FR", "FRA", "250"},
- {"French Guiana", "Guyane française (la )", "GF", "GUF", "254"},
- {"French Polynesia", "Polynésie française (la)", "PF", "PYF", "258"},
- {"French Southern Territories (the)", "Terres australes françaises (les)", "TF", "ATF", "260"},
- {"Djibouti", "Djibouti", "DJ", "DJI", "262"},
- {"Gabon", "Gabon (le)", "GA", "GAB", "266"},
- {"Georgia", "Géorgie (la)", "GE", "GEO", "268"},
- {"Gambia (the)", "Gambie (la)", "GM", "GMB", "270"},
- {"Palestine, State of", "Palestine, État de", "PS", "PSE", "275"},
- {"Germany", "Allemagne (l')", "DE", "DEU", "276"},
- {"Ghana", "Ghana (le)", "GH", "GHA", "288"},
- {"Gibraltar", "Gibraltar", "GI", "GIB", "292"},
- {"Kiribati", "Kiribati", "KI", "KIR", "296"},
- {"Greece", "Grèce (la)", "GR", "GRC", "300"},
- {"Greenland", "Groenland (le)", "GL", "GRL", "304"},
- {"Grenada", "Grenade (la)", "GD", "GRD", "308"},
- {"Guadeloupe", "Guadeloupe (la)", "GP", "GLP", "312"},
- {"Guam", "Guam", "GU", "GUM", "316"},
- {"Guatemala", "Guatemala (le)", "GT", "GTM", "320"},
- {"Guinea", "Guinée (la)", "GN", "GIN", "324"},
- {"Guyana", "Guyana (le)", "GY", "GUY", "328"},
- {"Haiti", "Haïti", "HT", "HTI", "332"},
- {"Heard Island and McDonald Islands", "Heard-et-Îles MacDonald (l'Île)", "HM", "HMD", "334"},
- {"Holy See (the)", "Saint-Siège (le)", "VA", "VAT", "336"},
- {"Honduras", "Honduras (le)", "HN", "HND", "340"},
- {"Hong Kong", "Hong Kong", "HK", "HKG", "344"},
- {"Hungary", "Hongrie (la)", "HU", "HUN", "348"},
- {"Iceland", "Islande (l')", "IS", "ISL", "352"},
- {"India", "Inde (l')", "IN", "IND", "356"},
- {"Indonesia", "Indonésie (l')", "ID", "IDN", "360"},
- {"Iran (Islamic Republic of)", "Iran (République Islamique d')", "IR", "IRN", "364"},
- {"Iraq", "Iraq (l')", "IQ", "IRQ", "368"},
- {"Ireland", "Irlande (l')", "IE", "IRL", "372"},
- {"Israel", "Israël", "IL", "ISR", "376"},
- {"Italy", "Italie (l')", "IT", "ITA", "380"},
- {"Côte d'Ivoire", "Côte d'Ivoire (la)", "CI", "CIV", "384"},
- {"Jamaica", "Jamaïque (la)", "JM", "JAM", "388"},
- {"Japan", "Japon (le)", "JP", "JPN", "392"},
- {"Kazakhstan", "Kazakhstan (le)", "KZ", "KAZ", "398"},
- {"Jordan", "Jordanie (la)", "JO", "JOR", "400"},
- {"Kenya", "Kenya (le)", "KE", "KEN", "404"},
- {"Korea (the Democratic People's Republic of)", "Corée (la République populaire démocratique de)", "KP", "PRK", "408"},
- {"Korea (the Republic of)", "Corée (la République de)", "KR", "KOR", "410"},
- {"Kuwait", "Koweït (le)", "KW", "KWT", "414"},
- {"Kyrgyzstan", "Kirghizistan (le)", "KG", "KGZ", "417"},
- {"Lao People's Democratic Republic (the)", "Lao, République démocratique populaire", "LA", "LAO", "418"},
- {"Lebanon", "Liban (le)", "LB", "LBN", "422"},
- {"Lesotho", "Lesotho (le)", "LS", "LSO", "426"},
- {"Latvia", "Lettonie (la)", "LV", "LVA", "428"},
- {"Liberia", "Libéria (le)", "LR", "LBR", "430"},
- {"Libya", "Libye (la)", "LY", "LBY", "434"},
- {"Liechtenstein", "Liechtenstein (le)", "LI", "LIE", "438"},
- {"Lithuania", "Lituanie (la)", "LT", "LTU", "440"},
- {"Luxembourg", "Luxembourg (le)", "LU", "LUX", "442"},
- {"Macao", "Macao", "MO", "MAC", "446"},
- {"Madagascar", "Madagascar", "MG", "MDG", "450"},
- {"Malawi", "Malawi (le)", "MW", "MWI", "454"},
- {"Malaysia", "Malaisie (la)", "MY", "MYS", "458"},
- {"Maldives", "Maldives (les)", "MV", "MDV", "462"},
- {"Mali", "Mali (le)", "ML", "MLI", "466"},
- {"Malta", "Malte", "MT", "MLT", "470"},
- {"Martinique", "Martinique (la)", "MQ", "MTQ", "474"},
- {"Mauritania", "Mauritanie (la)", "MR", "MRT", "478"},
- {"Mauritius", "Maurice", "MU", "MUS", "480"},
- {"Mexico", "Mexique (le)", "MX", "MEX", "484"},
- {"Monaco", "Monaco", "MC", "MCO", "492"},
- {"Mongolia", "Mongolie (la)", "MN", "MNG", "496"},
- {"Moldova (the Republic of)", "Moldova , République de", "MD", "MDA", "498"},
- {"Montenegro", "Monténégro (le)", "ME", "MNE", "499"},
- {"Montserrat", "Montserrat", "MS", "MSR", "500"},
- {"Morocco", "Maroc (le)", "MA", "MAR", "504"},
- {"Mozambique", "Mozambique (le)", "MZ", "MOZ", "508"},
- {"Oman", "Oman", "OM", "OMN", "512"},
- {"Namibia", "Namibie (la)", "NA", "NAM", "516"},
- {"Nauru", "Nauru", "NR", "NRU", "520"},
- {"Nepal", "Népal (le)", "NP", "NPL", "524"},
- {"Netherlands (the)", "Pays-Bas (les)", "NL", "NLD", "528"},
- {"Curaçao", "Curaçao", "CW", "CUW", "531"},
- {"Aruba", "Aruba", "AW", "ABW", "533"},
- {"Sint Maarten (Dutch part)", "Saint-Martin (partie néerlandaise)", "SX", "SXM", "534"},
- {"Bonaire, Sint Eustatius and Saba", "Bonaire, Saint-Eustache et Saba", "BQ", "BES", "535"},
- {"New Caledonia", "Nouvelle-Calédonie (la)", "NC", "NCL", "540"},
- {"Vanuatu", "Vanuatu (le)", "VU", "VUT", "548"},
- {"New Zealand", "Nouvelle-Zélande (la)", "NZ", "NZL", "554"},
- {"Nicaragua", "Nicaragua (le)", "NI", "NIC", "558"},
- {"Niger (the)", "Niger (le)", "NE", "NER", "562"},
- {"Nigeria", "Nigéria (le)", "NG", "NGA", "566"},
- {"Niue", "Niue", "NU", "NIU", "570"},
- {"Norfolk Island", "Norfolk (l'Île)", "NF", "NFK", "574"},
- {"Norway", "Norvège (la)", "NO", "NOR", "578"},
- {"Northern Mariana Islands (the)", "Mariannes du Nord (les Îles)", "MP", "MNP", "580"},
- {"United States Minor Outlying Islands (the)", "Îles mineures éloignées des États-Unis (les)", "UM", "UMI", "581"},
- {"Micronesia (Federated States of)", "Micronésie (États fédérés de)", "FM", "FSM", "583"},
- {"Marshall Islands (the)", "Marshall (Îles)", "MH", "MHL", "584"},
- {"Palau", "Palaos (les)", "PW", "PLW", "585"},
- {"Pakistan", "Pakistan (le)", "PK", "PAK", "586"},
- {"Panama", "Panama (le)", "PA", "PAN", "591"},
- {"Papua New Guinea", "Papouasie-Nouvelle-Guinée (la)", "PG", "PNG", "598"},
- {"Paraguay", "Paraguay (le)", "PY", "PRY", "600"},
- {"Peru", "Pérou (le)", "PE", "PER", "604"},
- {"Philippines (the)", "Philippines (les)", "PH", "PHL", "608"},
- {"Pitcairn", "Pitcairn", "PN", "PCN", "612"},
- {"Poland", "Pologne (la)", "PL", "POL", "616"},
- {"Portugal", "Portugal (le)", "PT", "PRT", "620"},
- {"Guinea-Bissau", "Guinée-Bissau (la)", "GW", "GNB", "624"},
- {"Timor-Leste", "Timor-Leste (le)", "TL", "TLS", "626"},
- {"Puerto Rico", "Porto Rico", "PR", "PRI", "630"},
- {"Qatar", "Qatar (le)", "QA", "QAT", "634"},
- {"Réunion", "Réunion (La)", "RE", "REU", "638"},
- {"Romania", "Roumanie (la)", "RO", "ROU", "642"},
- {"Russian Federation (the)", "Russie (la Fédération de)", "RU", "RUS", "643"},
- {"Rwanda", "Rwanda (le)", "RW", "RWA", "646"},
- {"Saint Barthélemy", "Saint-Barthélemy", "BL", "BLM", "652"},
- {"Saint Helena, Ascension and Tristan da Cunha", "Sainte-Hélène, Ascension et Tristan da Cunha", "SH", "SHN", "654"},
- {"Saint Kitts and Nevis", "Saint-Kitts-et-Nevis", "KN", "KNA", "659"},
- {"Anguilla", "Anguilla", "AI", "AIA", "660"},
- {"Saint Lucia", "Sainte-Lucie", "LC", "LCA", "662"},
- {"Saint Martin (French part)", "Saint-Martin (partie française)", "MF", "MAF", "663"},
- {"Saint Pierre and Miquelon", "Saint-Pierre-et-Miquelon", "PM", "SPM", "666"},
- {"Saint Vincent and the Grenadines", "Saint-Vincent-et-les Grenadines", "VC", "VCT", "670"},
- {"San Marino", "Saint-Marin", "SM", "SMR", "674"},
- {"Sao Tome and Principe", "Sao Tomé-et-Principe", "ST", "STP", "678"},
- {"Saudi Arabia", "Arabie saoudite (l')", "SA", "SAU", "682"},
- {"Senegal", "Sénégal (le)", "SN", "SEN", "686"},
- {"Serbia", "Serbie (la)", "RS", "SRB", "688"},
- {"Seychelles", "Seychelles (les)", "SC", "SYC", "690"},
- {"Sierra Leone", "Sierra Leone (la)", "SL", "SLE", "694"},
- {"Singapore", "Singapour", "SG", "SGP", "702"},
- {"Slovakia", "Slovaquie (la)", "SK", "SVK", "703"},
- {"Viet Nam", "Viet Nam (le)", "VN", "VNM", "704"},
- {"Slovenia", "Slovénie (la)", "SI", "SVN", "705"},
- {"Somalia", "Somalie (la)", "SO", "SOM", "706"},
- {"South Africa", "Afrique du Sud (l')", "ZA", "ZAF", "710"},
- {"Zimbabwe", "Zimbabwe (le)", "ZW", "ZWE", "716"},
- {"Spain", "Espagne (l')", "ES", "ESP", "724"},
- {"South Sudan", "Soudan du Sud (le)", "SS", "SSD", "728"},
- {"Sudan (the)", "Soudan (le)", "SD", "SDN", "729"},
- {"Western Sahara*", "Sahara occidental (le)*", "EH", "ESH", "732"},
- {"Suriname", "Suriname (le)", "SR", "SUR", "740"},
- {"Svalbard and Jan Mayen", "Svalbard et l'Île Jan Mayen (le)", "SJ", "SJM", "744"},
- {"Swaziland", "Swaziland (le)", "SZ", "SWZ", "748"},
- {"Sweden", "Suède (la)", "SE", "SWE", "752"},
- {"Switzerland", "Suisse (la)", "CH", "CHE", "756"},
- {"Syrian Arab Republic", "République arabe syrienne (la)", "SY", "SYR", "760"},
- {"Tajikistan", "Tadjikistan (le)", "TJ", "TJK", "762"},
- {"Thailand", "Thaïlande (la)", "TH", "THA", "764"},
- {"Togo", "Togo (le)", "TG", "TGO", "768"},
- {"Tokelau", "Tokelau (les)", "TK", "TKL", "772"},
- {"Tonga", "Tonga (les)", "TO", "TON", "776"},
- {"Trinidad and Tobago", "Trinité-et-Tobago (la)", "TT", "TTO", "780"},
- {"United Arab Emirates (the)", "Émirats arabes unis (les)", "AE", "ARE", "784"},
- {"Tunisia", "Tunisie (la)", "TN", "TUN", "788"},
- {"Turkey", "Turquie (la)", "TR", "TUR", "792"},
- {"Turkmenistan", "Turkménistan (le)", "TM", "TKM", "795"},
- {"Turks and Caicos Islands (the)", "Turks-et-Caïcos (les Îles)", "TC", "TCA", "796"},
- {"Tuvalu", "Tuvalu (les)", "TV", "TUV", "798"},
- {"Uganda", "Ouganda (l')", "UG", "UGA", "800"},
- {"Ukraine", "Ukraine (l')", "UA", "UKR", "804"},
- {"Macedonia (the former Yugoslav Republic of)", "Macédoine (l'ex‑République yougoslave de)", "MK", "MKD", "807"},
- {"Egypt", "Égypte (l')", "EG", "EGY", "818"},
- {"United Kingdom of Great Britain and Northern Ireland (the)", "Royaume-Uni de Grande-Bretagne et d'Irlande du Nord (le)", "GB", "GBR", "826"},
- {"Guernsey", "Guernesey", "GG", "GGY", "831"},
- {"Jersey", "Jersey", "JE", "JEY", "832"},
- {"Isle of Man", "Île de Man", "IM", "IMN", "833"},
- {"Tanzania, United Republic of", "Tanzanie, République-Unie de", "TZ", "TZA", "834"},
- {"United States of America (the)", "États-Unis d'Amérique (les)", "US", "USA", "840"},
- {"Virgin Islands (U.S.)", "Vierges des États-Unis (les Îles)", "VI", "VIR", "850"},
- {"Burkina Faso", "Burkina Faso (le)", "BF", "BFA", "854"},
- {"Uruguay", "Uruguay (l')", "UY", "URY", "858"},
- {"Uzbekistan", "Ouzbékistan (l')", "UZ", "UZB", "860"},
- {"Venezuela (Bolivarian Republic of)", "Venezuela (République bolivarienne du)", "VE", "VEN", "862"},
- {"Wallis and Futuna", "Wallis-et-Futuna", "WF", "WLF", "876"},
- {"Samoa", "Samoa (le)", "WS", "WSM", "882"},
- {"Yemen", "Yémen (le)", "YE", "YEM", "887"},
- {"Zambia", "Zambie (la)", "ZM", "ZMB", "894"},
-}
-
-// ISO4217List is the list of ISO currency codes
-var ISO4217List = []string{
- "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN",
- "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD",
- "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK",
- "DJF", "DKK", "DOP", "DZD",
- "EGP", "ERN", "ETB", "EUR",
- "FJD", "FKP",
- "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD",
- "HKD", "HNL", "HRK", "HTG", "HUF",
- "IDR", "ILS", "INR", "IQD", "IRR", "ISK",
- "JMD", "JOD", "JPY",
- "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT",
- "LAK", "LBP", "LKR", "LRD", "LSL", "LYD",
- "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN",
- "NAD", "NGN", "NIO", "NOK", "NPR", "NZD",
- "OMR",
- "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG",
- "QAR",
- "RON", "RSD", "RUB", "RWF",
- "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "STN", "SVC", "SYP", "SZL",
- "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS",
- "UAH", "UGX", "USD", "USN", "UYI", "UYU", "UYW", "UZS",
- "VEF", "VES", "VND", "VUV",
- "WST",
- "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XSU", "XTS", "XUA", "XXX",
- "YER",
- "ZAR", "ZMW", "ZWL",
-}
-
-// ISO693Entry stores ISO language codes
-type ISO693Entry struct {
- Alpha3bCode string
- Alpha2Code string
- English string
-}
-
-//ISO693List based on http://data.okfn.org/data/core/language-codes/r/language-codes-3b2.json
-var ISO693List = []ISO693Entry{
- {Alpha3bCode: "aar", Alpha2Code: "aa", English: "Afar"},
- {Alpha3bCode: "abk", Alpha2Code: "ab", English: "Abkhazian"},
- {Alpha3bCode: "afr", Alpha2Code: "af", English: "Afrikaans"},
- {Alpha3bCode: "aka", Alpha2Code: "ak", English: "Akan"},
- {Alpha3bCode: "alb", Alpha2Code: "sq", English: "Albanian"},
- {Alpha3bCode: "amh", Alpha2Code: "am", English: "Amharic"},
- {Alpha3bCode: "ara", Alpha2Code: "ar", English: "Arabic"},
- {Alpha3bCode: "arg", Alpha2Code: "an", English: "Aragonese"},
- {Alpha3bCode: "arm", Alpha2Code: "hy", English: "Armenian"},
- {Alpha3bCode: "asm", Alpha2Code: "as", English: "Assamese"},
- {Alpha3bCode: "ava", Alpha2Code: "av", English: "Avaric"},
- {Alpha3bCode: "ave", Alpha2Code: "ae", English: "Avestan"},
- {Alpha3bCode: "aym", Alpha2Code: "ay", English: "Aymara"},
- {Alpha3bCode: "aze", Alpha2Code: "az", English: "Azerbaijani"},
- {Alpha3bCode: "bak", Alpha2Code: "ba", English: "Bashkir"},
- {Alpha3bCode: "bam", Alpha2Code: "bm", English: "Bambara"},
- {Alpha3bCode: "baq", Alpha2Code: "eu", English: "Basque"},
- {Alpha3bCode: "bel", Alpha2Code: "be", English: "Belarusian"},
- {Alpha3bCode: "ben", Alpha2Code: "bn", English: "Bengali"},
- {Alpha3bCode: "bih", Alpha2Code: "bh", English: "Bihari languages"},
- {Alpha3bCode: "bis", Alpha2Code: "bi", English: "Bislama"},
- {Alpha3bCode: "bos", Alpha2Code: "bs", English: "Bosnian"},
- {Alpha3bCode: "bre", Alpha2Code: "br", English: "Breton"},
- {Alpha3bCode: "bul", Alpha2Code: "bg", English: "Bulgarian"},
- {Alpha3bCode: "bur", Alpha2Code: "my", English: "Burmese"},
- {Alpha3bCode: "cat", Alpha2Code: "ca", English: "Catalan; Valencian"},
- {Alpha3bCode: "cha", Alpha2Code: "ch", English: "Chamorro"},
- {Alpha3bCode: "che", Alpha2Code: "ce", English: "Chechen"},
- {Alpha3bCode: "chi", Alpha2Code: "zh", English: "Chinese"},
- {Alpha3bCode: "chu", Alpha2Code: "cu", English: "Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic"},
- {Alpha3bCode: "chv", Alpha2Code: "cv", English: "Chuvash"},
- {Alpha3bCode: "cor", Alpha2Code: "kw", English: "Cornish"},
- {Alpha3bCode: "cos", Alpha2Code: "co", English: "Corsican"},
- {Alpha3bCode: "cre", Alpha2Code: "cr", English: "Cree"},
- {Alpha3bCode: "cze", Alpha2Code: "cs", English: "Czech"},
- {Alpha3bCode: "dan", Alpha2Code: "da", English: "Danish"},
- {Alpha3bCode: "div", Alpha2Code: "dv", English: "Divehi; Dhivehi; Maldivian"},
- {Alpha3bCode: "dut", Alpha2Code: "nl", English: "Dutch; Flemish"},
- {Alpha3bCode: "dzo", Alpha2Code: "dz", English: "Dzongkha"},
- {Alpha3bCode: "eng", Alpha2Code: "en", English: "English"},
- {Alpha3bCode: "epo", Alpha2Code: "eo", English: "Esperanto"},
- {Alpha3bCode: "est", Alpha2Code: "et", English: "Estonian"},
- {Alpha3bCode: "ewe", Alpha2Code: "ee", English: "Ewe"},
- {Alpha3bCode: "fao", Alpha2Code: "fo", English: "Faroese"},
- {Alpha3bCode: "fij", Alpha2Code: "fj", English: "Fijian"},
- {Alpha3bCode: "fin", Alpha2Code: "fi", English: "Finnish"},
- {Alpha3bCode: "fre", Alpha2Code: "fr", English: "French"},
- {Alpha3bCode: "fry", Alpha2Code: "fy", English: "Western Frisian"},
- {Alpha3bCode: "ful", Alpha2Code: "ff", English: "Fulah"},
- {Alpha3bCode: "geo", Alpha2Code: "ka", English: "Georgian"},
- {Alpha3bCode: "ger", Alpha2Code: "de", English: "German"},
- {Alpha3bCode: "gla", Alpha2Code: "gd", English: "Gaelic; Scottish Gaelic"},
- {Alpha3bCode: "gle", Alpha2Code: "ga", English: "Irish"},
- {Alpha3bCode: "glg", Alpha2Code: "gl", English: "Galician"},
- {Alpha3bCode: "glv", Alpha2Code: "gv", English: "Manx"},
- {Alpha3bCode: "gre", Alpha2Code: "el", English: "Greek, Modern (1453-)"},
- {Alpha3bCode: "grn", Alpha2Code: "gn", English: "Guarani"},
- {Alpha3bCode: "guj", Alpha2Code: "gu", English: "Gujarati"},
- {Alpha3bCode: "hat", Alpha2Code: "ht", English: "Haitian; Haitian Creole"},
- {Alpha3bCode: "hau", Alpha2Code: "ha", English: "Hausa"},
- {Alpha3bCode: "heb", Alpha2Code: "he", English: "Hebrew"},
- {Alpha3bCode: "her", Alpha2Code: "hz", English: "Herero"},
- {Alpha3bCode: "hin", Alpha2Code: "hi", English: "Hindi"},
- {Alpha3bCode: "hmo", Alpha2Code: "ho", English: "Hiri Motu"},
- {Alpha3bCode: "hrv", Alpha2Code: "hr", English: "Croatian"},
- {Alpha3bCode: "hun", Alpha2Code: "hu", English: "Hungarian"},
- {Alpha3bCode: "ibo", Alpha2Code: "ig", English: "Igbo"},
- {Alpha3bCode: "ice", Alpha2Code: "is", English: "Icelandic"},
- {Alpha3bCode: "ido", Alpha2Code: "io", English: "Ido"},
- {Alpha3bCode: "iii", Alpha2Code: "ii", English: "Sichuan Yi; Nuosu"},
- {Alpha3bCode: "iku", Alpha2Code: "iu", English: "Inuktitut"},
- {Alpha3bCode: "ile", Alpha2Code: "ie", English: "Interlingue; Occidental"},
- {Alpha3bCode: "ina", Alpha2Code: "ia", English: "Interlingua (International Auxiliary Language Association)"},
- {Alpha3bCode: "ind", Alpha2Code: "id", English: "Indonesian"},
- {Alpha3bCode: "ipk", Alpha2Code: "ik", English: "Inupiaq"},
- {Alpha3bCode: "ita", Alpha2Code: "it", English: "Italian"},
- {Alpha3bCode: "jav", Alpha2Code: "jv", English: "Javanese"},
- {Alpha3bCode: "jpn", Alpha2Code: "ja", English: "Japanese"},
- {Alpha3bCode: "kal", Alpha2Code: "kl", English: "Kalaallisut; Greenlandic"},
- {Alpha3bCode: "kan", Alpha2Code: "kn", English: "Kannada"},
- {Alpha3bCode: "kas", Alpha2Code: "ks", English: "Kashmiri"},
- {Alpha3bCode: "kau", Alpha2Code: "kr", English: "Kanuri"},
- {Alpha3bCode: "kaz", Alpha2Code: "kk", English: "Kazakh"},
- {Alpha3bCode: "khm", Alpha2Code: "km", English: "Central Khmer"},
- {Alpha3bCode: "kik", Alpha2Code: "ki", English: "Kikuyu; Gikuyu"},
- {Alpha3bCode: "kin", Alpha2Code: "rw", English: "Kinyarwanda"},
- {Alpha3bCode: "kir", Alpha2Code: "ky", English: "Kirghiz; Kyrgyz"},
- {Alpha3bCode: "kom", Alpha2Code: "kv", English: "Komi"},
- {Alpha3bCode: "kon", Alpha2Code: "kg", English: "Kongo"},
- {Alpha3bCode: "kor", Alpha2Code: "ko", English: "Korean"},
- {Alpha3bCode: "kua", Alpha2Code: "kj", English: "Kuanyama; Kwanyama"},
- {Alpha3bCode: "kur", Alpha2Code: "ku", English: "Kurdish"},
- {Alpha3bCode: "lao", Alpha2Code: "lo", English: "Lao"},
- {Alpha3bCode: "lat", Alpha2Code: "la", English: "Latin"},
- {Alpha3bCode: "lav", Alpha2Code: "lv", English: "Latvian"},
- {Alpha3bCode: "lim", Alpha2Code: "li", English: "Limburgan; Limburger; Limburgish"},
- {Alpha3bCode: "lin", Alpha2Code: "ln", English: "Lingala"},
- {Alpha3bCode: "lit", Alpha2Code: "lt", English: "Lithuanian"},
- {Alpha3bCode: "ltz", Alpha2Code: "lb", English: "Luxembourgish; Letzeburgesch"},
- {Alpha3bCode: "lub", Alpha2Code: "lu", English: "Luba-Katanga"},
- {Alpha3bCode: "lug", Alpha2Code: "lg", English: "Ganda"},
- {Alpha3bCode: "mac", Alpha2Code: "mk", English: "Macedonian"},
- {Alpha3bCode: "mah", Alpha2Code: "mh", English: "Marshallese"},
- {Alpha3bCode: "mal", Alpha2Code: "ml", English: "Malayalam"},
- {Alpha3bCode: "mao", Alpha2Code: "mi", English: "Maori"},
- {Alpha3bCode: "mar", Alpha2Code: "mr", English: "Marathi"},
- {Alpha3bCode: "may", Alpha2Code: "ms", English: "Malay"},
- {Alpha3bCode: "mlg", Alpha2Code: "mg", English: "Malagasy"},
- {Alpha3bCode: "mlt", Alpha2Code: "mt", English: "Maltese"},
- {Alpha3bCode: "mon", Alpha2Code: "mn", English: "Mongolian"},
- {Alpha3bCode: "nau", Alpha2Code: "na", English: "Nauru"},
- {Alpha3bCode: "nav", Alpha2Code: "nv", English: "Navajo; Navaho"},
- {Alpha3bCode: "nbl", Alpha2Code: "nr", English: "Ndebele, South; South Ndebele"},
- {Alpha3bCode: "nde", Alpha2Code: "nd", English: "Ndebele, North; North Ndebele"},
- {Alpha3bCode: "ndo", Alpha2Code: "ng", English: "Ndonga"},
- {Alpha3bCode: "nep", Alpha2Code: "ne", English: "Nepali"},
- {Alpha3bCode: "nno", Alpha2Code: "nn", English: "Norwegian Nynorsk; Nynorsk, Norwegian"},
- {Alpha3bCode: "nob", Alpha2Code: "nb", English: "Bokmål, Norwegian; Norwegian Bokmål"},
- {Alpha3bCode: "nor", Alpha2Code: "no", English: "Norwegian"},
- {Alpha3bCode: "nya", Alpha2Code: "ny", English: "Chichewa; Chewa; Nyanja"},
- {Alpha3bCode: "oci", Alpha2Code: "oc", English: "Occitan (post 1500); Provençal"},
- {Alpha3bCode: "oji", Alpha2Code: "oj", English: "Ojibwa"},
- {Alpha3bCode: "ori", Alpha2Code: "or", English: "Oriya"},
- {Alpha3bCode: "orm", Alpha2Code: "om", English: "Oromo"},
- {Alpha3bCode: "oss", Alpha2Code: "os", English: "Ossetian; Ossetic"},
- {Alpha3bCode: "pan", Alpha2Code: "pa", English: "Panjabi; Punjabi"},
- {Alpha3bCode: "per", Alpha2Code: "fa", English: "Persian"},
- {Alpha3bCode: "pli", Alpha2Code: "pi", English: "Pali"},
- {Alpha3bCode: "pol", Alpha2Code: "pl", English: "Polish"},
- {Alpha3bCode: "por", Alpha2Code: "pt", English: "Portuguese"},
- {Alpha3bCode: "pus", Alpha2Code: "ps", English: "Pushto; Pashto"},
- {Alpha3bCode: "que", Alpha2Code: "qu", English: "Quechua"},
- {Alpha3bCode: "roh", Alpha2Code: "rm", English: "Romansh"},
- {Alpha3bCode: "rum", Alpha2Code: "ro", English: "Romanian; Moldavian; Moldovan"},
- {Alpha3bCode: "run", Alpha2Code: "rn", English: "Rundi"},
- {Alpha3bCode: "rus", Alpha2Code: "ru", English: "Russian"},
- {Alpha3bCode: "sag", Alpha2Code: "sg", English: "Sango"},
- {Alpha3bCode: "san", Alpha2Code: "sa", English: "Sanskrit"},
- {Alpha3bCode: "sin", Alpha2Code: "si", English: "Sinhala; Sinhalese"},
- {Alpha3bCode: "slo", Alpha2Code: "sk", English: "Slovak"},
- {Alpha3bCode: "slv", Alpha2Code: "sl", English: "Slovenian"},
- {Alpha3bCode: "sme", Alpha2Code: "se", English: "Northern Sami"},
- {Alpha3bCode: "smo", Alpha2Code: "sm", English: "Samoan"},
- {Alpha3bCode: "sna", Alpha2Code: "sn", English: "Shona"},
- {Alpha3bCode: "snd", Alpha2Code: "sd", English: "Sindhi"},
- {Alpha3bCode: "som", Alpha2Code: "so", English: "Somali"},
- {Alpha3bCode: "sot", Alpha2Code: "st", English: "Sotho, Southern"},
- {Alpha3bCode: "spa", Alpha2Code: "es", English: "Spanish; Castilian"},
- {Alpha3bCode: "srd", Alpha2Code: "sc", English: "Sardinian"},
- {Alpha3bCode: "srp", Alpha2Code: "sr", English: "Serbian"},
- {Alpha3bCode: "ssw", Alpha2Code: "ss", English: "Swati"},
- {Alpha3bCode: "sun", Alpha2Code: "su", English: "Sundanese"},
- {Alpha3bCode: "swa", Alpha2Code: "sw", English: "Swahili"},
- {Alpha3bCode: "swe", Alpha2Code: "sv", English: "Swedish"},
- {Alpha3bCode: "tah", Alpha2Code: "ty", English: "Tahitian"},
- {Alpha3bCode: "tam", Alpha2Code: "ta", English: "Tamil"},
- {Alpha3bCode: "tat", Alpha2Code: "tt", English: "Tatar"},
- {Alpha3bCode: "tel", Alpha2Code: "te", English: "Telugu"},
- {Alpha3bCode: "tgk", Alpha2Code: "tg", English: "Tajik"},
- {Alpha3bCode: "tgl", Alpha2Code: "tl", English: "Tagalog"},
- {Alpha3bCode: "tha", Alpha2Code: "th", English: "Thai"},
- {Alpha3bCode: "tib", Alpha2Code: "bo", English: "Tibetan"},
- {Alpha3bCode: "tir", Alpha2Code: "ti", English: "Tigrinya"},
- {Alpha3bCode: "ton", Alpha2Code: "to", English: "Tonga (Tonga Islands)"},
- {Alpha3bCode: "tsn", Alpha2Code: "tn", English: "Tswana"},
- {Alpha3bCode: "tso", Alpha2Code: "ts", English: "Tsonga"},
- {Alpha3bCode: "tuk", Alpha2Code: "tk", English: "Turkmen"},
- {Alpha3bCode: "tur", Alpha2Code: "tr", English: "Turkish"},
- {Alpha3bCode: "twi", Alpha2Code: "tw", English: "Twi"},
- {Alpha3bCode: "uig", Alpha2Code: "ug", English: "Uighur; Uyghur"},
- {Alpha3bCode: "ukr", Alpha2Code: "uk", English: "Ukrainian"},
- {Alpha3bCode: "urd", Alpha2Code: "ur", English: "Urdu"},
- {Alpha3bCode: "uzb", Alpha2Code: "uz", English: "Uzbek"},
- {Alpha3bCode: "ven", Alpha2Code: "ve", English: "Venda"},
- {Alpha3bCode: "vie", Alpha2Code: "vi", English: "Vietnamese"},
- {Alpha3bCode: "vol", Alpha2Code: "vo", English: "Volapük"},
- {Alpha3bCode: "wel", Alpha2Code: "cy", English: "Welsh"},
- {Alpha3bCode: "wln", Alpha2Code: "wa", English: "Walloon"},
- {Alpha3bCode: "wol", Alpha2Code: "wo", English: "Wolof"},
- {Alpha3bCode: "xho", Alpha2Code: "xh", English: "Xhosa"},
- {Alpha3bCode: "yid", Alpha2Code: "yi", English: "Yiddish"},
- {Alpha3bCode: "yor", Alpha2Code: "yo", English: "Yoruba"},
- {Alpha3bCode: "zha", Alpha2Code: "za", English: "Zhuang; Chuang"},
- {Alpha3bCode: "zul", Alpha2Code: "zu", English: "Zulu"},
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/utils.go b/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/utils.go
deleted file mode 100644
index f4c30f824..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/utils.go
+++ /dev/null
@@ -1,270 +0,0 @@
-package govalidator
-
-import (
- "errors"
- "fmt"
- "html"
- "math"
- "path"
- "regexp"
- "strings"
- "unicode"
- "unicode/utf8"
-)
-
-// Contains checks if the string contains the substring.
-func Contains(str, substring string) bool {
- return strings.Contains(str, substring)
-}
-
-// Matches checks if string matches the pattern (pattern is regular expression)
-// In case of error return false
-func Matches(str, pattern string) bool {
- match, _ := regexp.MatchString(pattern, str)
- return match
-}
-
-// LeftTrim trims characters from the left side of the input.
-// If second argument is empty, it will remove leading spaces.
-func LeftTrim(str, chars string) string {
- if chars == "" {
- return strings.TrimLeftFunc(str, unicode.IsSpace)
- }
- r, _ := regexp.Compile("^[" + chars + "]+")
- return r.ReplaceAllString(str, "")
-}
-
-// RightTrim trims characters from the right side of the input.
-// If second argument is empty, it will remove trailing spaces.
-func RightTrim(str, chars string) string {
- if chars == "" {
- return strings.TrimRightFunc(str, unicode.IsSpace)
- }
- r, _ := regexp.Compile("[" + chars + "]+$")
- return r.ReplaceAllString(str, "")
-}
-
-// Trim trims characters from both sides of the input.
-// If second argument is empty, it will remove spaces.
-func Trim(str, chars string) string {
- return LeftTrim(RightTrim(str, chars), chars)
-}
-
-// WhiteList removes characters that do not appear in the whitelist.
-func WhiteList(str, chars string) string {
- pattern := "[^" + chars + "]+"
- r, _ := regexp.Compile(pattern)
- return r.ReplaceAllString(str, "")
-}
-
-// BlackList removes characters that appear in the blacklist.
-func BlackList(str, chars string) string {
- pattern := "[" + chars + "]+"
- r, _ := regexp.Compile(pattern)
- return r.ReplaceAllString(str, "")
-}
-
-// StripLow removes characters with a numerical value < 32 and 127, mostly control characters.
-// If keep_new_lines is true, newline characters are preserved (\n and \r, hex 0xA and 0xD).
-func StripLow(str string, keepNewLines bool) string {
- chars := ""
- if keepNewLines {
- chars = "\x00-\x09\x0B\x0C\x0E-\x1F\x7F"
- } else {
- chars = "\x00-\x1F\x7F"
- }
- return BlackList(str, chars)
-}
-
-// ReplacePattern replaces regular expression pattern in string
-func ReplacePattern(str, pattern, replace string) string {
- r, _ := regexp.Compile(pattern)
- return r.ReplaceAllString(str, replace)
-}
-
-// Escape replaces <, >, & and " with HTML entities.
-var Escape = html.EscapeString
-
-func addSegment(inrune, segment []rune) []rune {
- if len(segment) == 0 {
- return inrune
- }
- if len(inrune) != 0 {
- inrune = append(inrune, '_')
- }
- inrune = append(inrune, segment...)
- return inrune
-}
-
-// UnderscoreToCamelCase converts from underscore separated form to camel case form.
-// Ex.: my_func => MyFunc
-func UnderscoreToCamelCase(s string) string {
- return strings.Replace(strings.Title(strings.Replace(strings.ToLower(s), "_", " ", -1)), " ", "", -1)
-}
-
-// CamelCaseToUnderscore converts from camel case form to underscore separated form.
-// Ex.: MyFunc => my_func
-func CamelCaseToUnderscore(str string) string {
- var output []rune
- var segment []rune
- for _, r := range str {
-
- // not treat number as separate segment
- if !unicode.IsLower(r) && string(r) != "_" && !unicode.IsNumber(r) {
- output = addSegment(output, segment)
- segment = nil
- }
- segment = append(segment, unicode.ToLower(r))
- }
- output = addSegment(output, segment)
- return string(output)
-}
-
-// Reverse returns reversed string
-func Reverse(s string) string {
- r := []rune(s)
- for i, j := 0, len(r)-1; i < j; i, j = i+1, j-1 {
- r[i], r[j] = r[j], r[i]
- }
- return string(r)
-}
-
-// GetLines splits string by "\n" and return array of lines
-func GetLines(s string) []string {
- return strings.Split(s, "\n")
-}
-
-// GetLine returns specified line of multiline string
-func GetLine(s string, index int) (string, error) {
- lines := GetLines(s)
- if index < 0 || index >= len(lines) {
- return "", errors.New("line index out of bounds")
- }
- return lines[index], nil
-}
-
-// RemoveTags removes all tags from HTML string
-func RemoveTags(s string) string {
- return ReplacePattern(s, "<[^>]*>", "")
-}
-
-// SafeFileName returns safe string that can be used in file names
-func SafeFileName(str string) string {
- name := strings.ToLower(str)
- name = path.Clean(path.Base(name))
- name = strings.Trim(name, " ")
- separators, err := regexp.Compile(`[ &_=+:]`)
- if err == nil {
- name = separators.ReplaceAllString(name, "-")
- }
- legal, err := regexp.Compile(`[^[:alnum:]-.]`)
- if err == nil {
- name = legal.ReplaceAllString(name, "")
- }
- for strings.Contains(name, "--") {
- name = strings.Replace(name, "--", "-", -1)
- }
- return name
-}
-
-// NormalizeEmail canonicalize an email address.
-// The local part of the email address is lowercased for all domains; the hostname is always lowercased and
-// the local part of the email address is always lowercased for hosts that are known to be case-insensitive (currently only GMail).
-// Normalization follows special rules for known providers: currently, GMail addresses have dots removed in the local part and
-// are stripped of tags (e.g. some.one+tag@gmail.com becomes someone@gmail.com) and all @googlemail.com addresses are
-// normalized to @gmail.com.
-func NormalizeEmail(str string) (string, error) {
- if !IsEmail(str) {
- return "", fmt.Errorf("%s is not an email", str)
- }
- parts := strings.Split(str, "@")
- parts[0] = strings.ToLower(parts[0])
- parts[1] = strings.ToLower(parts[1])
- if parts[1] == "gmail.com" || parts[1] == "googlemail.com" {
- parts[1] = "gmail.com"
- parts[0] = strings.Split(ReplacePattern(parts[0], `\.`, ""), "+")[0]
- }
- return strings.Join(parts, "@"), nil
-}
-
-// Truncate a string to the closest length without breaking words.
-func Truncate(str string, length int, ending string) string {
- var aftstr, befstr string
- if len(str) > length {
- words := strings.Fields(str)
- before, present := 0, 0
- for i := range words {
- befstr = aftstr
- before = present
- aftstr = aftstr + words[i] + " "
- present = len(aftstr)
- if present > length && i != 0 {
- if (length - before) < (present - length) {
- return Trim(befstr, " /\\.,\"'#!?&@+-") + ending
- }
- return Trim(aftstr, " /\\.,\"'#!?&@+-") + ending
- }
- }
- }
-
- return str
-}
-
-// PadLeft pads left side of a string if size of string is less then indicated pad length
-func PadLeft(str string, padStr string, padLen int) string {
- return buildPadStr(str, padStr, padLen, true, false)
-}
-
-// PadRight pads right side of a string if size of string is less then indicated pad length
-func PadRight(str string, padStr string, padLen int) string {
- return buildPadStr(str, padStr, padLen, false, true)
-}
-
-// PadBoth pads both sides of a string if size of string is less then indicated pad length
-func PadBoth(str string, padStr string, padLen int) string {
- return buildPadStr(str, padStr, padLen, true, true)
-}
-
-// PadString either left, right or both sides.
-// Note that padding string can be unicode and more then one character
-func buildPadStr(str string, padStr string, padLen int, padLeft bool, padRight bool) string {
-
- // When padded length is less then the current string size
- if padLen < utf8.RuneCountInString(str) {
- return str
- }
-
- padLen -= utf8.RuneCountInString(str)
-
- targetLen := padLen
-
- targetLenLeft := targetLen
- targetLenRight := targetLen
- if padLeft && padRight {
- targetLenLeft = padLen / 2
- targetLenRight = padLen - targetLenLeft
- }
-
- strToRepeatLen := utf8.RuneCountInString(padStr)
-
- repeatTimes := int(math.Ceil(float64(targetLen) / float64(strToRepeatLen)))
- repeatedString := strings.Repeat(padStr, repeatTimes)
-
- leftSide := ""
- if padLeft {
- leftSide = repeatedString[0:targetLenLeft]
- }
-
- rightSide := ""
- if padRight {
- rightSide = repeatedString[0:targetLenRight]
- }
-
- return leftSide + str + rightSide
-}
-
-// TruncatingErrorf removes extra args from fmt.Errorf if not formatted in the str object
-func TruncatingErrorf(str string, args ...interface{}) error {
- n := strings.Count(str, "%s")
- return fmt.Errorf(str, args[:n]...)
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/validator.go b/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/validator.go
deleted file mode 100644
index c9c4fac06..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/validator.go
+++ /dev/null
@@ -1,1768 +0,0 @@
-// Package govalidator is package of validators and sanitizers for strings, structs and collections.
-package govalidator
-
-import (
- "bytes"
- "crypto/rsa"
- "crypto/x509"
- "encoding/base64"
- "encoding/json"
- "encoding/pem"
- "fmt"
- "io/ioutil"
- "net"
- "net/url"
- "reflect"
- "regexp"
- "sort"
- "strconv"
- "strings"
- "time"
- "unicode"
- "unicode/utf8"
-)
-
-var (
- fieldsRequiredByDefault bool
- nilPtrAllowedByRequired = false
- notNumberRegexp = regexp.MustCompile("[^0-9]+")
- whiteSpacesAndMinus = regexp.MustCompile(`[\s-]+`)
- paramsRegexp = regexp.MustCompile(`\(.*\)$`)
-)
-
-const maxURLRuneCount = 2083
-const minURLRuneCount = 3
-const rfc3339WithoutZone = "2006-01-02T15:04:05"
-
-// SetFieldsRequiredByDefault causes validation to fail when struct fields
-// do not include validations or are not explicitly marked as exempt (using `valid:"-"` or `valid:"email,optional"`).
-// This struct definition will fail govalidator.ValidateStruct() (and the field values do not matter):
-// type exampleStruct struct {
-// Name string ``
-// Email string `valid:"email"`
-// This, however, will only fail when Email is empty or an invalid email address:
-// type exampleStruct2 struct {
-// Name string `valid:"-"`
-// Email string `valid:"email"`
-// Lastly, this will only fail when Email is an invalid email address but not when it's empty:
-// type exampleStruct2 struct {
-// Name string `valid:"-"`
-// Email string `valid:"email,optional"`
-func SetFieldsRequiredByDefault(value bool) {
- fieldsRequiredByDefault = value
-}
-
-// SetNilPtrAllowedByRequired causes validation to pass for nil ptrs when a field is set to required.
-// The validation will still reject ptr fields in their zero value state. Example with this enabled:
-// type exampleStruct struct {
-// Name *string `valid:"required"`
-// With `Name` set to "", this will be considered invalid input and will cause a validation error.
-// With `Name` set to nil, this will be considered valid by validation.
-// By default this is disabled.
-func SetNilPtrAllowedByRequired(value bool) {
- nilPtrAllowedByRequired = value
-}
-
-// IsEmail checks if the string is an email.
-func IsEmail(str string) bool {
- // TODO uppercase letters are not supported
- return rxEmail.MatchString(str)
-}
-
-// IsExistingEmail checks if the string is an email of existing domain
-func IsExistingEmail(email string) bool {
-
- if len(email) < 6 || len(email) > 254 {
- return false
- }
- at := strings.LastIndex(email, "@")
- if at <= 0 || at > len(email)-3 {
- return false
- }
- user := email[:at]
- host := email[at+1:]
- if len(user) > 64 {
- return false
- }
- switch host {
- case "localhost", "example.com":
- return true
- }
- if userDotRegexp.MatchString(user) || !userRegexp.MatchString(user) || !hostRegexp.MatchString(host) {
- return false
- }
- if _, err := net.LookupMX(host); err != nil {
- if _, err := net.LookupIP(host); err != nil {
- return false
- }
- }
-
- return true
-}
-
-// IsURL checks if the string is an URL.
-func IsURL(str string) bool {
- if str == "" || utf8.RuneCountInString(str) >= maxURLRuneCount || len(str) <= minURLRuneCount || strings.HasPrefix(str, ".") {
- return false
- }
- strTemp := str
- if strings.Contains(str, ":") && !strings.Contains(str, "://") {
- // support no indicated urlscheme but with colon for port number
- // http:// is appended so url.Parse will succeed, strTemp used so it does not impact rxURL.MatchString
- strTemp = "http://" + str
- }
- u, err := url.Parse(strTemp)
- if err != nil {
- return false
- }
- if strings.HasPrefix(u.Host, ".") {
- return false
- }
- if u.Host == "" && (u.Path != "" && !strings.Contains(u.Path, ".")) {
- return false
- }
- return rxURL.MatchString(str)
-}
-
-// IsRequestURL checks if the string rawurl, assuming
-// it was received in an HTTP request, is a valid
-// URL confirm to RFC 3986
-func IsRequestURL(rawurl string) bool {
- url, err := url.ParseRequestURI(rawurl)
- if err != nil {
- return false //Couldn't even parse the rawurl
- }
- if len(url.Scheme) == 0 {
- return false //No Scheme found
- }
- return true
-}
-
-// IsRequestURI checks if the string rawurl, assuming
-// it was received in an HTTP request, is an
-// absolute URI or an absolute path.
-func IsRequestURI(rawurl string) bool {
- _, err := url.ParseRequestURI(rawurl)
- return err == nil
-}
-
-// IsAlpha checks if the string contains only letters (a-zA-Z). Empty string is valid.
-func IsAlpha(str string) bool {
- if IsNull(str) {
- return true
- }
- return rxAlpha.MatchString(str)
-}
-
-//IsUTFLetter checks if the string contains only unicode letter characters.
-//Similar to IsAlpha but for all languages. Empty string is valid.
-func IsUTFLetter(str string) bool {
- if IsNull(str) {
- return true
- }
-
- for _, c := range str {
- if !unicode.IsLetter(c) {
- return false
- }
- }
- return true
-
-}
-
-// IsAlphanumeric checks if the string contains only letters and numbers. Empty string is valid.
-func IsAlphanumeric(str string) bool {
- if IsNull(str) {
- return true
- }
- return rxAlphanumeric.MatchString(str)
-}
-
-// IsUTFLetterNumeric checks if the string contains only unicode letters and numbers. Empty string is valid.
-func IsUTFLetterNumeric(str string) bool {
- if IsNull(str) {
- return true
- }
- for _, c := range str {
- if !unicode.IsLetter(c) && !unicode.IsNumber(c) { //letters && numbers are ok
- return false
- }
- }
- return true
-
-}
-
-// IsNumeric checks if the string contains only numbers. Empty string is valid.
-func IsNumeric(str string) bool {
- if IsNull(str) {
- return true
- }
- return rxNumeric.MatchString(str)
-}
-
-// IsUTFNumeric checks if the string contains only unicode numbers of any kind.
-// Numbers can be 0-9 but also Fractions ¾,Roman Ⅸ and Hangzhou 〩. Empty string is valid.
-func IsUTFNumeric(str string) bool {
- if IsNull(str) {
- return true
- }
- if strings.IndexAny(str, "+-") > 0 {
- return false
- }
- if len(str) > 1 {
- str = strings.TrimPrefix(str, "-")
- str = strings.TrimPrefix(str, "+")
- }
- for _, c := range str {
- if !unicode.IsNumber(c) { //numbers && minus sign are ok
- return false
- }
- }
- return true
-
-}
-
-// IsUTFDigit checks if the string contains only unicode radix-10 decimal digits. Empty string is valid.
-func IsUTFDigit(str string) bool {
- if IsNull(str) {
- return true
- }
- if strings.IndexAny(str, "+-") > 0 {
- return false
- }
- if len(str) > 1 {
- str = strings.TrimPrefix(str, "-")
- str = strings.TrimPrefix(str, "+")
- }
- for _, c := range str {
- if !unicode.IsDigit(c) { //digits && minus sign are ok
- return false
- }
- }
- return true
-
-}
-
-// IsHexadecimal checks if the string is a hexadecimal number.
-func IsHexadecimal(str string) bool {
- return rxHexadecimal.MatchString(str)
-}
-
-// IsHexcolor checks if the string is a hexadecimal color.
-func IsHexcolor(str string) bool {
- return rxHexcolor.MatchString(str)
-}
-
-// IsRGBcolor checks if the string is a valid RGB color in form rgb(RRR, GGG, BBB).
-func IsRGBcolor(str string) bool {
- return rxRGBcolor.MatchString(str)
-}
-
-// IsLowerCase checks if the string is lowercase. Empty string is valid.
-func IsLowerCase(str string) bool {
- if IsNull(str) {
- return true
- }
- return str == strings.ToLower(str)
-}
-
-// IsUpperCase checks if the string is uppercase. Empty string is valid.
-func IsUpperCase(str string) bool {
- if IsNull(str) {
- return true
- }
- return str == strings.ToUpper(str)
-}
-
-// HasLowerCase checks if the string contains at least 1 lowercase. Empty string is valid.
-func HasLowerCase(str string) bool {
- if IsNull(str) {
- return true
- }
- return rxHasLowerCase.MatchString(str)
-}
-
-// HasUpperCase checks if the string contains as least 1 uppercase. Empty string is valid.
-func HasUpperCase(str string) bool {
- if IsNull(str) {
- return true
- }
- return rxHasUpperCase.MatchString(str)
-}
-
-// IsInt checks if the string is an integer. Empty string is valid.
-func IsInt(str string) bool {
- if IsNull(str) {
- return true
- }
- return rxInt.MatchString(str)
-}
-
-// IsFloat checks if the string is a float.
-func IsFloat(str string) bool {
- return str != "" && rxFloat.MatchString(str)
-}
-
-// IsDivisibleBy checks if the string is a number that's divisible by another.
-// If second argument is not valid integer or zero, it's return false.
-// Otherwise, if first argument is not valid integer or zero, it's return true (Invalid string converts to zero).
-func IsDivisibleBy(str, num string) bool {
- f, _ := ToFloat(str)
- p := int64(f)
- q, _ := ToInt(num)
- if q == 0 {
- return false
- }
- return (p == 0) || (p%q == 0)
-}
-
-// IsNull checks if the string is null.
-func IsNull(str string) bool {
- return len(str) == 0
-}
-
-// IsNotNull checks if the string is not null.
-func IsNotNull(str string) bool {
- return !IsNull(str)
-}
-
-// HasWhitespaceOnly checks the string only contains whitespace
-func HasWhitespaceOnly(str string) bool {
- return len(str) > 0 && rxHasWhitespaceOnly.MatchString(str)
-}
-
-// HasWhitespace checks if the string contains any whitespace
-func HasWhitespace(str string) bool {
- return len(str) > 0 && rxHasWhitespace.MatchString(str)
-}
-
-// IsByteLength checks if the string's length (in bytes) falls in a range.
-func IsByteLength(str string, min, max int) bool {
- return len(str) >= min && len(str) <= max
-}
-
-// IsUUIDv3 checks if the string is a UUID version 3.
-func IsUUIDv3(str string) bool {
- return rxUUID3.MatchString(str)
-}
-
-// IsUUIDv4 checks if the string is a UUID version 4.
-func IsUUIDv4(str string) bool {
- return rxUUID4.MatchString(str)
-}
-
-// IsUUIDv5 checks if the string is a UUID version 5.
-func IsUUIDv5(str string) bool {
- return rxUUID5.MatchString(str)
-}
-
-// IsUUID checks if the string is a UUID (version 3, 4 or 5).
-func IsUUID(str string) bool {
- return rxUUID.MatchString(str)
-}
-
-// Byte to index table for O(1) lookups when unmarshaling.
-// We use 0xFF as sentinel value for invalid indexes.
-var ulidDec = [...]byte{
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x01,
- 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E,
- 0x0F, 0x10, 0x11, 0xFF, 0x12, 0x13, 0xFF, 0x14, 0x15, 0xFF,
- 0x16, 0x17, 0x18, 0x19, 0x1A, 0xFF, 0x1B, 0x1C, 0x1D, 0x1E,
- 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0A, 0x0B, 0x0C,
- 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0xFF, 0x12, 0x13, 0xFF, 0x14,
- 0x15, 0xFF, 0x16, 0x17, 0x18, 0x19, 0x1A, 0xFF, 0x1B, 0x1C,
- 0x1D, 0x1E, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-}
-
-// EncodedSize is the length of a text encoded ULID.
-const ulidEncodedSize = 26
-
-// IsULID checks if the string is a ULID.
-//
-// Implementation got from:
-// https://github.com/oklog/ulid (Apache-2.0 License)
-//
-func IsULID(str string) bool {
- // Check if a base32 encoded ULID is the right length.
- if len(str) != ulidEncodedSize {
- return false
- }
-
- // Check if all the characters in a base32 encoded ULID are part of the
- // expected base32 character set.
- if ulidDec[str[0]] == 0xFF ||
- ulidDec[str[1]] == 0xFF ||
- ulidDec[str[2]] == 0xFF ||
- ulidDec[str[3]] == 0xFF ||
- ulidDec[str[4]] == 0xFF ||
- ulidDec[str[5]] == 0xFF ||
- ulidDec[str[6]] == 0xFF ||
- ulidDec[str[7]] == 0xFF ||
- ulidDec[str[8]] == 0xFF ||
- ulidDec[str[9]] == 0xFF ||
- ulidDec[str[10]] == 0xFF ||
- ulidDec[str[11]] == 0xFF ||
- ulidDec[str[12]] == 0xFF ||
- ulidDec[str[13]] == 0xFF ||
- ulidDec[str[14]] == 0xFF ||
- ulidDec[str[15]] == 0xFF ||
- ulidDec[str[16]] == 0xFF ||
- ulidDec[str[17]] == 0xFF ||
- ulidDec[str[18]] == 0xFF ||
- ulidDec[str[19]] == 0xFF ||
- ulidDec[str[20]] == 0xFF ||
- ulidDec[str[21]] == 0xFF ||
- ulidDec[str[22]] == 0xFF ||
- ulidDec[str[23]] == 0xFF ||
- ulidDec[str[24]] == 0xFF ||
- ulidDec[str[25]] == 0xFF {
- return false
- }
-
- // Check if the first character in a base32 encoded ULID will overflow. This
- // happens because the base32 representation encodes 130 bits, while the
- // ULID is only 128 bits.
- //
- // See https://github.com/oklog/ulid/issues/9 for details.
- if str[0] > '7' {
- return false
- }
- return true
-}
-
-// IsCreditCard checks if the string is a credit card.
-func IsCreditCard(str string) bool {
- sanitized := whiteSpacesAndMinus.ReplaceAllString(str, "")
- if !rxCreditCard.MatchString(sanitized) {
- return false
- }
-
- number, _ := ToInt(sanitized)
- number, lastDigit := number / 10, number % 10
-
- var sum int64
- for i:=0; number > 0; i++ {
- digit := number % 10
-
- if i % 2 == 0 {
- digit *= 2
- if digit > 9 {
- digit -= 9
- }
- }
-
- sum += digit
- number = number / 10
- }
-
- return (sum + lastDigit) % 10 == 0
-}
-
-// IsISBN10 checks if the string is an ISBN version 10.
-func IsISBN10(str string) bool {
- return IsISBN(str, 10)
-}
-
-// IsISBN13 checks if the string is an ISBN version 13.
-func IsISBN13(str string) bool {
- return IsISBN(str, 13)
-}
-
-// IsISBN checks if the string is an ISBN (version 10 or 13).
-// If version value is not equal to 10 or 13, it will be checks both variants.
-func IsISBN(str string, version int) bool {
- sanitized := whiteSpacesAndMinus.ReplaceAllString(str, "")
- var checksum int32
- var i int32
- if version == 10 {
- if !rxISBN10.MatchString(sanitized) {
- return false
- }
- for i = 0; i < 9; i++ {
- checksum += (i + 1) * int32(sanitized[i]-'0')
- }
- if sanitized[9] == 'X' {
- checksum += 10 * 10
- } else {
- checksum += 10 * int32(sanitized[9]-'0')
- }
- if checksum%11 == 0 {
- return true
- }
- return false
- } else if version == 13 {
- if !rxISBN13.MatchString(sanitized) {
- return false
- }
- factor := []int32{1, 3}
- for i = 0; i < 12; i++ {
- checksum += factor[i%2] * int32(sanitized[i]-'0')
- }
- return (int32(sanitized[12]-'0'))-((10-(checksum%10))%10) == 0
- }
- return IsISBN(str, 10) || IsISBN(str, 13)
-}
-
-// IsJSON checks if the string is valid JSON (note: uses json.Unmarshal).
-func IsJSON(str string) bool {
- var js json.RawMessage
- return json.Unmarshal([]byte(str), &js) == nil
-}
-
-// IsMultibyte checks if the string contains one or more multibyte chars. Empty string is valid.
-func IsMultibyte(str string) bool {
- if IsNull(str) {
- return true
- }
- return rxMultibyte.MatchString(str)
-}
-
-// IsASCII checks if the string contains ASCII chars only. Empty string is valid.
-func IsASCII(str string) bool {
- if IsNull(str) {
- return true
- }
- return rxASCII.MatchString(str)
-}
-
-// IsPrintableASCII checks if the string contains printable ASCII chars only. Empty string is valid.
-func IsPrintableASCII(str string) bool {
- if IsNull(str) {
- return true
- }
- return rxPrintableASCII.MatchString(str)
-}
-
-// IsFullWidth checks if the string contains any full-width chars. Empty string is valid.
-func IsFullWidth(str string) bool {
- if IsNull(str) {
- return true
- }
- return rxFullWidth.MatchString(str)
-}
-
-// IsHalfWidth checks if the string contains any half-width chars. Empty string is valid.
-func IsHalfWidth(str string) bool {
- if IsNull(str) {
- return true
- }
- return rxHalfWidth.MatchString(str)
-}
-
-// IsVariableWidth checks if the string contains a mixture of full and half-width chars. Empty string is valid.
-func IsVariableWidth(str string) bool {
- if IsNull(str) {
- return true
- }
- return rxHalfWidth.MatchString(str) && rxFullWidth.MatchString(str)
-}
-
-// IsBase64 checks if a string is base64 encoded.
-func IsBase64(str string) bool {
- return rxBase64.MatchString(str)
-}
-
-// IsFilePath checks is a string is Win or Unix file path and returns it's type.
-func IsFilePath(str string) (bool, int) {
- if rxWinPath.MatchString(str) {
- //check windows path limit see:
- // http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath
- if len(str[3:]) > 32767 {
- return false, Win
- }
- return true, Win
- } else if rxUnixPath.MatchString(str) {
- return true, Unix
- }
- return false, Unknown
-}
-
-//IsWinFilePath checks both relative & absolute paths in Windows
-func IsWinFilePath(str string) bool {
- if rxARWinPath.MatchString(str) {
- //check windows path limit see:
- // http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath
- if len(str[3:]) > 32767 {
- return false
- }
- return true
- }
- return false
-}
-
-//IsUnixFilePath checks both relative & absolute paths in Unix
-func IsUnixFilePath(str string) bool {
- if rxARUnixPath.MatchString(str) {
- return true
- }
- return false
-}
-
-// IsDataURI checks if a string is base64 encoded data URI such as an image
-func IsDataURI(str string) bool {
- dataURI := strings.Split(str, ",")
- if !rxDataURI.MatchString(dataURI[0]) {
- return false
- }
- return IsBase64(dataURI[1])
-}
-
-// IsMagnetURI checks if a string is valid magnet URI
-func IsMagnetURI(str string) bool {
- return rxMagnetURI.MatchString(str)
-}
-
-// IsISO3166Alpha2 checks if a string is valid two-letter country code
-func IsISO3166Alpha2(str string) bool {
- for _, entry := range ISO3166List {
- if str == entry.Alpha2Code {
- return true
- }
- }
- return false
-}
-
-// IsISO3166Alpha3 checks if a string is valid three-letter country code
-func IsISO3166Alpha3(str string) bool {
- for _, entry := range ISO3166List {
- if str == entry.Alpha3Code {
- return true
- }
- }
- return false
-}
-
-// IsISO693Alpha2 checks if a string is valid two-letter language code
-func IsISO693Alpha2(str string) bool {
- for _, entry := range ISO693List {
- if str == entry.Alpha2Code {
- return true
- }
- }
- return false
-}
-
-// IsISO693Alpha3b checks if a string is valid three-letter language code
-func IsISO693Alpha3b(str string) bool {
- for _, entry := range ISO693List {
- if str == entry.Alpha3bCode {
- return true
- }
- }
- return false
-}
-
-// IsDNSName will validate the given string as a DNS name
-func IsDNSName(str string) bool {
- if str == "" || len(strings.Replace(str, ".", "", -1)) > 255 {
- // constraints already violated
- return false
- }
- return !IsIP(str) && rxDNSName.MatchString(str)
-}
-
-// IsHash checks if a string is a hash of type algorithm.
-// Algorithm is one of ['md4', 'md5', 'sha1', 'sha256', 'sha384', 'sha512', 'ripemd128', 'ripemd160', 'tiger128', 'tiger160', 'tiger192', 'crc32', 'crc32b']
-func IsHash(str string, algorithm string) bool {
- var len string
- algo := strings.ToLower(algorithm)
-
- if algo == "crc32" || algo == "crc32b" {
- len = "8"
- } else if algo == "md5" || algo == "md4" || algo == "ripemd128" || algo == "tiger128" {
- len = "32"
- } else if algo == "sha1" || algo == "ripemd160" || algo == "tiger160" {
- len = "40"
- } else if algo == "tiger192" {
- len = "48"
- } else if algo == "sha3-224" {
- len = "56"
- } else if algo == "sha256" || algo == "sha3-256" {
- len = "64"
- } else if algo == "sha384" || algo == "sha3-384" {
- len = "96"
- } else if algo == "sha512" || algo == "sha3-512" {
- len = "128"
- } else {
- return false
- }
-
- return Matches(str, "^[a-f0-9]{"+len+"}$")
-}
-
-// IsSHA3224 checks is a string is a SHA3-224 hash. Alias for `IsHash(str, "sha3-224")`
-func IsSHA3224(str string) bool {
- return IsHash(str, "sha3-224")
-}
-
-// IsSHA3256 checks is a string is a SHA3-256 hash. Alias for `IsHash(str, "sha3-256")`
-func IsSHA3256(str string) bool {
- return IsHash(str, "sha3-256")
-}
-
-// IsSHA3384 checks is a string is a SHA3-384 hash. Alias for `IsHash(str, "sha3-384")`
-func IsSHA3384(str string) bool {
- return IsHash(str, "sha3-384")
-}
-
-// IsSHA3512 checks is a string is a SHA3-512 hash. Alias for `IsHash(str, "sha3-512")`
-func IsSHA3512(str string) bool {
- return IsHash(str, "sha3-512")
-}
-
-// IsSHA512 checks is a string is a SHA512 hash. Alias for `IsHash(str, "sha512")`
-func IsSHA512(str string) bool {
- return IsHash(str, "sha512")
-}
-
-// IsSHA384 checks is a string is a SHA384 hash. Alias for `IsHash(str, "sha384")`
-func IsSHA384(str string) bool {
- return IsHash(str, "sha384")
-}
-
-// IsSHA256 checks is a string is a SHA256 hash. Alias for `IsHash(str, "sha256")`
-func IsSHA256(str string) bool {
- return IsHash(str, "sha256")
-}
-
-// IsTiger192 checks is a string is a Tiger192 hash. Alias for `IsHash(str, "tiger192")`
-func IsTiger192(str string) bool {
- return IsHash(str, "tiger192")
-}
-
-// IsTiger160 checks is a string is a Tiger160 hash. Alias for `IsHash(str, "tiger160")`
-func IsTiger160(str string) bool {
- return IsHash(str, "tiger160")
-}
-
-// IsRipeMD160 checks is a string is a RipeMD160 hash. Alias for `IsHash(str, "ripemd160")`
-func IsRipeMD160(str string) bool {
- return IsHash(str, "ripemd160")
-}
-
-// IsSHA1 checks is a string is a SHA-1 hash. Alias for `IsHash(str, "sha1")`
-func IsSHA1(str string) bool {
- return IsHash(str, "sha1")
-}
-
-// IsTiger128 checks is a string is a Tiger128 hash. Alias for `IsHash(str, "tiger128")`
-func IsTiger128(str string) bool {
- return IsHash(str, "tiger128")
-}
-
-// IsRipeMD128 checks is a string is a RipeMD128 hash. Alias for `IsHash(str, "ripemd128")`
-func IsRipeMD128(str string) bool {
- return IsHash(str, "ripemd128")
-}
-
-// IsCRC32 checks is a string is a CRC32 hash. Alias for `IsHash(str, "crc32")`
-func IsCRC32(str string) bool {
- return IsHash(str, "crc32")
-}
-
-// IsCRC32b checks is a string is a CRC32b hash. Alias for `IsHash(str, "crc32b")`
-func IsCRC32b(str string) bool {
- return IsHash(str, "crc32b")
-}
-
-// IsMD5 checks is a string is a MD5 hash. Alias for `IsHash(str, "md5")`
-func IsMD5(str string) bool {
- return IsHash(str, "md5")
-}
-
-// IsMD4 checks is a string is a MD4 hash. Alias for `IsHash(str, "md4")`
-func IsMD4(str string) bool {
- return IsHash(str, "md4")
-}
-
-// IsDialString validates the given string for usage with the various Dial() functions
-func IsDialString(str string) bool {
- if h, p, err := net.SplitHostPort(str); err == nil && h != "" && p != "" && (IsDNSName(h) || IsIP(h)) && IsPort(p) {
- return true
- }
-
- return false
-}
-
-// IsIP checks if a string is either IP version 4 or 6. Alias for `net.ParseIP`
-func IsIP(str string) bool {
- return net.ParseIP(str) != nil
-}
-
-// IsPort checks if a string represents a valid port
-func IsPort(str string) bool {
- if i, err := strconv.Atoi(str); err == nil && i > 0 && i < 65536 {
- return true
- }
- return false
-}
-
-// IsIPv4 checks if the string is an IP version 4.
-func IsIPv4(str string) bool {
- ip := net.ParseIP(str)
- return ip != nil && strings.Contains(str, ".")
-}
-
-// IsIPv6 checks if the string is an IP version 6.
-func IsIPv6(str string) bool {
- ip := net.ParseIP(str)
- return ip != nil && strings.Contains(str, ":")
-}
-
-// IsCIDR checks if the string is an valid CIDR notiation (IPV4 & IPV6)
-func IsCIDR(str string) bool {
- _, _, err := net.ParseCIDR(str)
- return err == nil
-}
-
-// IsMAC checks if a string is valid MAC address.
-// Possible MAC formats:
-// 01:23:45:67:89:ab
-// 01:23:45:67:89:ab:cd:ef
-// 01-23-45-67-89-ab
-// 01-23-45-67-89-ab-cd-ef
-// 0123.4567.89ab
-// 0123.4567.89ab.cdef
-func IsMAC(str string) bool {
- _, err := net.ParseMAC(str)
- return err == nil
-}
-
-// IsHost checks if the string is a valid IP (both v4 and v6) or a valid DNS name
-func IsHost(str string) bool {
- return IsIP(str) || IsDNSName(str)
-}
-
-// IsMongoID checks if the string is a valid hex-encoded representation of a MongoDB ObjectId.
-func IsMongoID(str string) bool {
- return rxHexadecimal.MatchString(str) && (len(str) == 24)
-}
-
-// IsLatitude checks if a string is valid latitude.
-func IsLatitude(str string) bool {
- return rxLatitude.MatchString(str)
-}
-
-// IsLongitude checks if a string is valid longitude.
-func IsLongitude(str string) bool {
- return rxLongitude.MatchString(str)
-}
-
-// IsIMEI checks if a string is valid IMEI
-func IsIMEI(str string) bool {
- return rxIMEI.MatchString(str)
-}
-
-// IsIMSI checks if a string is valid IMSI
-func IsIMSI(str string) bool {
- if !rxIMSI.MatchString(str) {
- return false
- }
-
- mcc, err := strconv.ParseInt(str[0:3], 10, 32)
- if err != nil {
- return false
- }
-
- switch mcc {
- case 202, 204, 206, 208, 212, 213, 214, 216, 218, 219:
- case 220, 221, 222, 226, 228, 230, 231, 232, 234, 235:
- case 238, 240, 242, 244, 246, 247, 248, 250, 255, 257:
- case 259, 260, 262, 266, 268, 270, 272, 274, 276, 278:
- case 280, 282, 283, 284, 286, 288, 289, 290, 292, 293:
- case 294, 295, 297, 302, 308, 310, 311, 312, 313, 314:
- case 315, 316, 330, 332, 334, 338, 340, 342, 344, 346:
- case 348, 350, 352, 354, 356, 358, 360, 362, 363, 364:
- case 365, 366, 368, 370, 372, 374, 376, 400, 401, 402:
- case 404, 405, 406, 410, 412, 413, 414, 415, 416, 417:
- case 418, 419, 420, 421, 422, 424, 425, 426, 427, 428:
- case 429, 430, 431, 432, 434, 436, 437, 438, 440, 441:
- case 450, 452, 454, 455, 456, 457, 460, 461, 466, 467:
- case 470, 472, 502, 505, 510, 514, 515, 520, 525, 528:
- case 530, 536, 537, 539, 540, 541, 542, 543, 544, 545:
- case 546, 547, 548, 549, 550, 551, 552, 553, 554, 555:
- case 602, 603, 604, 605, 606, 607, 608, 609, 610, 611:
- case 612, 613, 614, 615, 616, 617, 618, 619, 620, 621:
- case 622, 623, 624, 625, 626, 627, 628, 629, 630, 631:
- case 632, 633, 634, 635, 636, 637, 638, 639, 640, 641:
- case 642, 643, 645, 646, 647, 648, 649, 650, 651, 652:
- case 653, 654, 655, 657, 658, 659, 702, 704, 706, 708:
- case 710, 712, 714, 716, 722, 724, 730, 732, 734, 736:
- case 738, 740, 742, 744, 746, 748, 750, 995:
- return true
- default:
- return false
- }
- return true
-}
-
-// IsRsaPublicKey checks if a string is valid public key with provided length
-func IsRsaPublicKey(str string, keylen int) bool {
- bb := bytes.NewBufferString(str)
- pemBytes, err := ioutil.ReadAll(bb)
- if err != nil {
- return false
- }
- block, _ := pem.Decode(pemBytes)
- if block != nil && block.Type != "PUBLIC KEY" {
- return false
- }
- var der []byte
-
- if block != nil {
- der = block.Bytes
- } else {
- der, err = base64.StdEncoding.DecodeString(str)
- if err != nil {
- return false
- }
- }
-
- key, err := x509.ParsePKIXPublicKey(der)
- if err != nil {
- return false
- }
- pubkey, ok := key.(*rsa.PublicKey)
- if !ok {
- return false
- }
- bitlen := len(pubkey.N.Bytes()) * 8
- return bitlen == int(keylen)
-}
-
-// IsRegex checks if a give string is a valid regex with RE2 syntax or not
-func IsRegex(str string) bool {
- if _, err := regexp.Compile(str); err == nil {
- return true
- }
- return false
-}
-
-func toJSONName(tag string) string {
- if tag == "" {
- return ""
- }
-
- // JSON name always comes first. If there's no options then split[0] is
- // JSON name, if JSON name is not set, then split[0] is an empty string.
- split := strings.SplitN(tag, ",", 2)
-
- name := split[0]
-
- // However it is possible that the field is skipped when
- // (de-)serializing from/to JSON, in which case assume that there is no
- // tag name to use
- if name == "-" {
- return ""
- }
- return name
-}
-
-func prependPathToErrors(err error, path string) error {
- switch err2 := err.(type) {
- case Error:
- err2.Path = append([]string{path}, err2.Path...)
- return err2
- case Errors:
- errors := err2.Errors()
- for i, err3 := range errors {
- errors[i] = prependPathToErrors(err3, path)
- }
- return err2
- }
- return err
-}
-
-// ValidateArray performs validation according to condition iterator that validates every element of the array
-func ValidateArray(array []interface{}, iterator ConditionIterator) bool {
- return Every(array, iterator)
-}
-
-// ValidateMap use validation map for fields.
-// result will be equal to `false` if there are any errors.
-// s is the map containing the data to be validated.
-// m is the validation map in the form:
-// map[string]interface{}{"name":"required,alpha","address":map[string]interface{}{"line1":"required,alphanum"}}
-func ValidateMap(s map[string]interface{}, m map[string]interface{}) (bool, error) {
- if s == nil {
- return true, nil
- }
- result := true
- var err error
- var errs Errors
- var index int
- val := reflect.ValueOf(s)
- for key, value := range s {
- presentResult := true
- validator, ok := m[key]
- if !ok {
- presentResult = false
- var err error
- err = fmt.Errorf("all map keys has to be present in the validation map; got %s", key)
- err = prependPathToErrors(err, key)
- errs = append(errs, err)
- }
- valueField := reflect.ValueOf(value)
- mapResult := true
- typeResult := true
- structResult := true
- resultField := true
- switch subValidator := validator.(type) {
- case map[string]interface{}:
- var err error
- if v, ok := value.(map[string]interface{}); !ok {
- mapResult = false
- err = fmt.Errorf("map validator has to be for the map type only; got %s", valueField.Type().String())
- err = prependPathToErrors(err, key)
- errs = append(errs, err)
- } else {
- mapResult, err = ValidateMap(v, subValidator)
- if err != nil {
- mapResult = false
- err = prependPathToErrors(err, key)
- errs = append(errs, err)
- }
- }
- case string:
- if (valueField.Kind() == reflect.Struct ||
- (valueField.Kind() == reflect.Ptr && valueField.Elem().Kind() == reflect.Struct)) &&
- subValidator != "-" {
- var err error
- structResult, err = ValidateStruct(valueField.Interface())
- if err != nil {
- err = prependPathToErrors(err, key)
- errs = append(errs, err)
- }
- }
- resultField, err = typeCheck(valueField, reflect.StructField{
- Name: key,
- PkgPath: "",
- Type: val.Type(),
- Tag: reflect.StructTag(fmt.Sprintf("%s:%q", tagName, subValidator)),
- Offset: 0,
- Index: []int{index},
- Anonymous: false,
- }, val, nil)
- if err != nil {
- errs = append(errs, err)
- }
- case nil:
- // already handlerd when checked before
- default:
- typeResult = false
- err = fmt.Errorf("map validator has to be either map[string]interface{} or string; got %s", valueField.Type().String())
- err = prependPathToErrors(err, key)
- errs = append(errs, err)
- }
- result = result && presentResult && typeResult && resultField && structResult && mapResult
- index++
- }
- // checks required keys
- requiredResult := true
- for key, value := range m {
- if schema, ok := value.(string); ok {
- tags := parseTagIntoMap(schema)
- if required, ok := tags["required"]; ok {
- if _, ok := s[key]; !ok {
- requiredResult = false
- if required.customErrorMessage != "" {
- err = Error{key, fmt.Errorf(required.customErrorMessage), true, "required", []string{}}
- } else {
- err = Error{key, fmt.Errorf("required field missing"), false, "required", []string{}}
- }
- errs = append(errs, err)
- }
- }
- }
- }
-
- if len(errs) > 0 {
- err = errs
- }
- return result && requiredResult, err
-}
-
-// ValidateStruct use tags for fields.
-// result will be equal to `false` if there are any errors.
-// todo currently there is no guarantee that errors will be returned in predictable order (tests may to fail)
-func ValidateStruct(s interface{}) (bool, error) {
- if s == nil {
- return true, nil
- }
- result := true
- var err error
- val := reflect.ValueOf(s)
- if val.Kind() == reflect.Interface || val.Kind() == reflect.Ptr {
- val = val.Elem()
- }
- // we only accept structs
- if val.Kind() != reflect.Struct {
- return false, fmt.Errorf("function only accepts structs; got %s", val.Kind())
- }
- var errs Errors
- for i := 0; i < val.NumField(); i++ {
- valueField := val.Field(i)
- typeField := val.Type().Field(i)
- if typeField.PkgPath != "" {
- continue // Private field
- }
- structResult := true
- if valueField.Kind() == reflect.Interface {
- valueField = valueField.Elem()
- }
- if (valueField.Kind() == reflect.Struct ||
- (valueField.Kind() == reflect.Ptr && valueField.Elem().Kind() == reflect.Struct)) &&
- typeField.Tag.Get(tagName) != "-" {
- var err error
- structResult, err = ValidateStruct(valueField.Interface())
- if err != nil {
- err = prependPathToErrors(err, typeField.Name)
- errs = append(errs, err)
- }
- }
- resultField, err2 := typeCheck(valueField, typeField, val, nil)
- if err2 != nil {
-
- // Replace structure name with JSON name if there is a tag on the variable
- jsonTag := toJSONName(typeField.Tag.Get("json"))
- if jsonTag != "" {
- switch jsonError := err2.(type) {
- case Error:
- jsonError.Name = jsonTag
- err2 = jsonError
- case Errors:
- for i2, err3 := range jsonError {
- switch customErr := err3.(type) {
- case Error:
- customErr.Name = jsonTag
- jsonError[i2] = customErr
- }
- }
-
- err2 = jsonError
- }
- }
-
- errs = append(errs, err2)
- }
- result = result && resultField && structResult
- }
- if len(errs) > 0 {
- err = errs
- }
- return result, err
-}
-
-// ValidateStructAsync performs async validation of the struct and returns results through the channels
-func ValidateStructAsync(s interface{}) (<-chan bool, <-chan error) {
- res := make(chan bool)
- errors := make(chan error)
-
- go func() {
- defer close(res)
- defer close(errors)
-
- isValid, isFailed := ValidateStruct(s)
-
- res <- isValid
- errors <- isFailed
- }()
-
- return res, errors
-}
-
-// ValidateMapAsync performs async validation of the map and returns results through the channels
-func ValidateMapAsync(s map[string]interface{}, m map[string]interface{}) (<-chan bool, <-chan error) {
- res := make(chan bool)
- errors := make(chan error)
-
- go func() {
- defer close(res)
- defer close(errors)
-
- isValid, isFailed := ValidateMap(s, m)
-
- res <- isValid
- errors <- isFailed
- }()
-
- return res, errors
-}
-
-// parseTagIntoMap parses a struct tag `valid:required~Some error message,length(2|3)` into map[string]string{"required": "Some error message", "length(2|3)": ""}
-func parseTagIntoMap(tag string) tagOptionsMap {
- optionsMap := make(tagOptionsMap)
- options := strings.Split(tag, ",")
-
- for i, option := range options {
- option = strings.TrimSpace(option)
-
- validationOptions := strings.Split(option, "~")
- if !isValidTag(validationOptions[0]) {
- continue
- }
- if len(validationOptions) == 2 {
- optionsMap[validationOptions[0]] = tagOption{validationOptions[0], validationOptions[1], i}
- } else {
- optionsMap[validationOptions[0]] = tagOption{validationOptions[0], "", i}
- }
- }
- return optionsMap
-}
-
-func isValidTag(s string) bool {
- if s == "" {
- return false
- }
- for _, c := range s {
- switch {
- case strings.ContainsRune("\\'\"!#$%&()*+-./:<=>?@[]^_{|}~ ", c):
- // Backslash and quote chars are reserved, but
- // otherwise any punctuation chars are allowed
- // in a tag name.
- default:
- if !unicode.IsLetter(c) && !unicode.IsDigit(c) {
- return false
- }
- }
- }
- return true
-}
-
-// IsSSN will validate the given string as a U.S. Social Security Number
-func IsSSN(str string) bool {
- if str == "" || len(str) != 11 {
- return false
- }
- return rxSSN.MatchString(str)
-}
-
-// IsSemver checks if string is valid semantic version
-func IsSemver(str string) bool {
- return rxSemver.MatchString(str)
-}
-
-// IsType checks if interface is of some type
-func IsType(v interface{}, params ...string) bool {
- if len(params) == 1 {
- typ := params[0]
- return strings.Replace(reflect.TypeOf(v).String(), " ", "", -1) == strings.Replace(typ, " ", "", -1)
- }
- return false
-}
-
-// IsTime checks if string is valid according to given format
-func IsTime(str string, format string) bool {
- _, err := time.Parse(format, str)
- return err == nil
-}
-
-// IsUnixTime checks if string is valid unix timestamp value
-func IsUnixTime(str string) bool {
- if _, err := strconv.Atoi(str); err == nil {
- return true
- }
- return false
-}
-
-// IsRFC3339 checks if string is valid timestamp value according to RFC3339
-func IsRFC3339(str string) bool {
- return IsTime(str, time.RFC3339)
-}
-
-// IsRFC3339WithoutZone checks if string is valid timestamp value according to RFC3339 which excludes the timezone.
-func IsRFC3339WithoutZone(str string) bool {
- return IsTime(str, rfc3339WithoutZone)
-}
-
-// IsISO4217 checks if string is valid ISO currency code
-func IsISO4217(str string) bool {
- for _, currency := range ISO4217List {
- if str == currency {
- return true
- }
- }
-
- return false
-}
-
-// ByteLength checks string's length
-func ByteLength(str string, params ...string) bool {
- if len(params) == 2 {
- min, _ := ToInt(params[0])
- max, _ := ToInt(params[1])
- return len(str) >= int(min) && len(str) <= int(max)
- }
-
- return false
-}
-
-// RuneLength checks string's length
-// Alias for StringLength
-func RuneLength(str string, params ...string) bool {
- return StringLength(str, params...)
-}
-
-// IsRsaPub checks whether string is valid RSA key
-// Alias for IsRsaPublicKey
-func IsRsaPub(str string, params ...string) bool {
- if len(params) == 1 {
- len, _ := ToInt(params[0])
- return IsRsaPublicKey(str, int(len))
- }
-
- return false
-}
-
-// StringMatches checks if a string matches a given pattern.
-func StringMatches(s string, params ...string) bool {
- if len(params) == 1 {
- pattern := params[0]
- return Matches(s, pattern)
- }
- return false
-}
-
-// StringLength checks string's length (including multi byte strings)
-func StringLength(str string, params ...string) bool {
-
- if len(params) == 2 {
- strLength := utf8.RuneCountInString(str)
- min, _ := ToInt(params[0])
- max, _ := ToInt(params[1])
- return strLength >= int(min) && strLength <= int(max)
- }
-
- return false
-}
-
-// MinStringLength checks string's minimum length (including multi byte strings)
-func MinStringLength(str string, params ...string) bool {
-
- if len(params) == 1 {
- strLength := utf8.RuneCountInString(str)
- min, _ := ToInt(params[0])
- return strLength >= int(min)
- }
-
- return false
-}
-
-// MaxStringLength checks string's maximum length (including multi byte strings)
-func MaxStringLength(str string, params ...string) bool {
-
- if len(params) == 1 {
- strLength := utf8.RuneCountInString(str)
- max, _ := ToInt(params[0])
- return strLength <= int(max)
- }
-
- return false
-}
-
-// Range checks string's length
-func Range(str string, params ...string) bool {
- if len(params) == 2 {
- value, _ := ToFloat(str)
- min, _ := ToFloat(params[0])
- max, _ := ToFloat(params[1])
- return InRange(value, min, max)
- }
-
- return false
-}
-
-// IsInRaw checks if string is in list of allowed values
-func IsInRaw(str string, params ...string) bool {
- if len(params) == 1 {
- rawParams := params[0]
-
- parsedParams := strings.Split(rawParams, "|")
-
- return IsIn(str, parsedParams...)
- }
-
- return false
-}
-
-// IsIn checks if string str is a member of the set of strings params
-func IsIn(str string, params ...string) bool {
- for _, param := range params {
- if str == param {
- return true
- }
- }
-
- return false
-}
-
-func checkRequired(v reflect.Value, t reflect.StructField, options tagOptionsMap) (bool, error) {
- if nilPtrAllowedByRequired {
- k := v.Kind()
- if (k == reflect.Ptr || k == reflect.Interface) && v.IsNil() {
- return true, nil
- }
- }
-
- if requiredOption, isRequired := options["required"]; isRequired {
- if len(requiredOption.customErrorMessage) > 0 {
- return false, Error{t.Name, fmt.Errorf(requiredOption.customErrorMessage), true, "required", []string{}}
- }
- return false, Error{t.Name, fmt.Errorf("non zero value required"), false, "required", []string{}}
- } else if _, isOptional := options["optional"]; fieldsRequiredByDefault && !isOptional {
- return false, Error{t.Name, fmt.Errorf("Missing required field"), false, "required", []string{}}
- }
- // not required and empty is valid
- return true, nil
-}
-
-func typeCheck(v reflect.Value, t reflect.StructField, o reflect.Value, options tagOptionsMap) (isValid bool, resultErr error) {
- if !v.IsValid() {
- return false, nil
- }
-
- tag := t.Tag.Get(tagName)
-
- // checks if the field should be ignored
- switch tag {
- case "":
- if v.Kind() != reflect.Slice && v.Kind() != reflect.Map {
- if !fieldsRequiredByDefault {
- return true, nil
- }
- return false, Error{t.Name, fmt.Errorf("All fields are required to at least have one validation defined"), false, "required", []string{}}
- }
- case "-":
- return true, nil
- }
-
- isRootType := false
- if options == nil {
- isRootType = true
- options = parseTagIntoMap(tag)
- }
-
- if isEmptyValue(v) {
- // an empty value is not validated, checks only required
- isValid, resultErr = checkRequired(v, t, options)
- for key := range options {
- delete(options, key)
- }
- return isValid, resultErr
- }
-
- var customTypeErrors Errors
- optionsOrder := options.orderedKeys()
- for _, validatorName := range optionsOrder {
- validatorStruct := options[validatorName]
- if validatefunc, ok := CustomTypeTagMap.Get(validatorName); ok {
- delete(options, validatorName)
-
- if result := validatefunc(v.Interface(), o.Interface()); !result {
- if len(validatorStruct.customErrorMessage) > 0 {
- customTypeErrors = append(customTypeErrors, Error{Name: t.Name, Err: TruncatingErrorf(validatorStruct.customErrorMessage, fmt.Sprint(v), validatorName), CustomErrorMessageExists: true, Validator: stripParams(validatorName)})
- continue
- }
- customTypeErrors = append(customTypeErrors, Error{Name: t.Name, Err: fmt.Errorf("%s does not validate as %s", fmt.Sprint(v), validatorName), CustomErrorMessageExists: false, Validator: stripParams(validatorName)})
- }
- }
- }
-
- if len(customTypeErrors.Errors()) > 0 {
- return false, customTypeErrors
- }
-
- if isRootType {
- // Ensure that we've checked the value by all specified validators before report that the value is valid
- defer func() {
- delete(options, "optional")
- delete(options, "required")
-
- if isValid && resultErr == nil && len(options) != 0 {
- optionsOrder := options.orderedKeys()
- for _, validator := range optionsOrder {
- isValid = false
- resultErr = Error{t.Name, fmt.Errorf(
- "The following validator is invalid or can't be applied to the field: %q", validator), false, stripParams(validator), []string{}}
- return
- }
- }
- }()
- }
-
- for _, validatorSpec := range optionsOrder {
- validatorStruct := options[validatorSpec]
- var negate bool
- validator := validatorSpec
- customMsgExists := len(validatorStruct.customErrorMessage) > 0
-
- // checks whether the tag looks like '!something' or 'something'
- if validator[0] == '!' {
- validator = validator[1:]
- negate = true
- }
-
- // checks for interface param validators
- for key, value := range InterfaceParamTagRegexMap {
- ps := value.FindStringSubmatch(validator)
- if len(ps) == 0 {
- continue
- }
-
- validatefunc, ok := InterfaceParamTagMap[key]
- if !ok {
- continue
- }
-
- delete(options, validatorSpec)
-
- field := fmt.Sprint(v)
- if result := validatefunc(v.Interface(), ps[1:]...); (!result && !negate) || (result && negate) {
- if customMsgExists {
- return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}}
- }
- if negate {
- return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}}
- }
- return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}}
- }
- }
- }
-
- switch v.Kind() {
- case reflect.Bool,
- reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
- reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr,
- reflect.Float32, reflect.Float64,
- reflect.String:
- // for each tag option checks the map of validator functions
- for _, validatorSpec := range optionsOrder {
- validatorStruct := options[validatorSpec]
- var negate bool
- validator := validatorSpec
- customMsgExists := len(validatorStruct.customErrorMessage) > 0
-
- // checks whether the tag looks like '!something' or 'something'
- if validator[0] == '!' {
- validator = validator[1:]
- negate = true
- }
-
- // checks for param validators
- for key, value := range ParamTagRegexMap {
- ps := value.FindStringSubmatch(validator)
- if len(ps) == 0 {
- continue
- }
-
- validatefunc, ok := ParamTagMap[key]
- if !ok {
- continue
- }
-
- delete(options, validatorSpec)
-
- switch v.Kind() {
- case reflect.String,
- reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
- reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,
- reflect.Float32, reflect.Float64:
-
- field := fmt.Sprint(v) // make value into string, then validate with regex
- if result := validatefunc(field, ps[1:]...); (!result && !negate) || (result && negate) {
- if customMsgExists {
- return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}}
- }
- if negate {
- return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}}
- }
- return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}}
- }
- default:
- // type not yet supported, fail
- return false, Error{t.Name, fmt.Errorf("Validator %s doesn't support kind %s", validator, v.Kind()), false, stripParams(validatorSpec), []string{}}
- }
- }
-
- if validatefunc, ok := TagMap[validator]; ok {
- delete(options, validatorSpec)
-
- switch v.Kind() {
- case reflect.String,
- reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
- reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,
- reflect.Float32, reflect.Float64:
- field := fmt.Sprint(v) // make value into string, then validate with regex
- if result := validatefunc(field); !result && !negate || result && negate {
- if customMsgExists {
- return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}}
- }
- if negate {
- return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}}
- }
- return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}}
- }
- default:
- //Not Yet Supported Types (Fail here!)
- err := fmt.Errorf("Validator %s doesn't support kind %s for value %v", validator, v.Kind(), v)
- return false, Error{t.Name, err, false, stripParams(validatorSpec), []string{}}
- }
- }
- }
- return true, nil
- case reflect.Map:
- if v.Type().Key().Kind() != reflect.String {
- return false, &UnsupportedTypeError{v.Type()}
- }
- var sv stringValues
- sv = v.MapKeys()
- sort.Sort(sv)
- result := true
- for i, k := range sv {
- var resultItem bool
- var err error
- if v.MapIndex(k).Kind() != reflect.Struct {
- resultItem, err = typeCheck(v.MapIndex(k), t, o, options)
- if err != nil {
- return false, err
- }
- } else {
- resultItem, err = ValidateStruct(v.MapIndex(k).Interface())
- if err != nil {
- err = prependPathToErrors(err, t.Name+"."+sv[i].Interface().(string))
- return false, err
- }
- }
- result = result && resultItem
- }
- return result, nil
- case reflect.Slice, reflect.Array:
- result := true
- for i := 0; i < v.Len(); i++ {
- var resultItem bool
- var err error
- if v.Index(i).Kind() != reflect.Struct {
- resultItem, err = typeCheck(v.Index(i), t, o, options)
- if err != nil {
- return false, err
- }
- } else {
- resultItem, err = ValidateStruct(v.Index(i).Interface())
- if err != nil {
- err = prependPathToErrors(err, t.Name+"."+strconv.Itoa(i))
- return false, err
- }
- }
- result = result && resultItem
- }
- return result, nil
- case reflect.Interface:
- // If the value is an interface then encode its element
- if v.IsNil() {
- return true, nil
- }
- return ValidateStruct(v.Interface())
- case reflect.Ptr:
- // If the value is a pointer then checks its element
- if v.IsNil() {
- return true, nil
- }
- return typeCheck(v.Elem(), t, o, options)
- case reflect.Struct:
- return true, nil
- default:
- return false, &UnsupportedTypeError{v.Type()}
- }
-}
-
-func stripParams(validatorString string) string {
- return paramsRegexp.ReplaceAllString(validatorString, "")
-}
-
-// isEmptyValue checks whether value empty or not
-func isEmptyValue(v reflect.Value) bool {
- switch v.Kind() {
- case reflect.String, reflect.Array:
- return v.Len() == 0
- case reflect.Map, reflect.Slice:
- return v.Len() == 0 || v.IsNil()
- case reflect.Bool:
- return !v.Bool()
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- return v.Int() == 0
- case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
- return v.Uint() == 0
- case reflect.Float32, reflect.Float64:
- return v.Float() == 0
- case reflect.Interface, reflect.Ptr:
- return v.IsNil()
- }
-
- return reflect.DeepEqual(v.Interface(), reflect.Zero(v.Type()).Interface())
-}
-
-// ErrorByField returns error for specified field of the struct
-// validated by ValidateStruct or empty string if there are no errors
-// or this field doesn't exists or doesn't have any errors.
-func ErrorByField(e error, field string) string {
- if e == nil {
- return ""
- }
- return ErrorsByField(e)[field]
-}
-
-// ErrorsByField returns map of errors of the struct validated
-// by ValidateStruct or empty map if there are no errors.
-func ErrorsByField(e error) map[string]string {
- m := make(map[string]string)
- if e == nil {
- return m
- }
- // prototype for ValidateStruct
-
- switch e := e.(type) {
- case Error:
- m[e.Name] = e.Err.Error()
- case Errors:
- for _, item := range e.Errors() {
- n := ErrorsByField(item)
- for k, v := range n {
- m[k] = v
- }
- }
- }
-
- return m
-}
-
-// Error returns string equivalent for reflect.Type
-func (e *UnsupportedTypeError) Error() string {
- return "validator: unsupported type: " + e.Type.String()
-}
-
-func (sv stringValues) Len() int { return len(sv) }
-func (sv stringValues) Swap(i, j int) { sv[i], sv[j] = sv[j], sv[i] }
-func (sv stringValues) Less(i, j int) bool { return sv.get(i) < sv.get(j) }
-func (sv stringValues) get(i int) string { return sv[i].String() }
-
-func IsE164(str string) bool {
- return rxE164.MatchString(str)
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/wercker.yml b/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/wercker.yml
deleted file mode 100644
index bc5f7b086..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/asaskevich/govalidator/wercker.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-box: golang
-build:
- steps:
- - setup-go-workspace
-
- - script:
- name: go get
- code: |
- go version
- go get -t ./...
-
- - script:
- name: go test
- code: |
- go test -race -v ./...
diff --git a/openshift/default-catalog-consistency/vendor/github.com/containerd/containerd/pkg/epoch/epoch.go b/openshift/default-catalog-consistency/vendor/github.com/containerd/containerd/pkg/epoch/epoch.go
index 124e8edb5..1e4e06c20 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/containerd/containerd/pkg/epoch/epoch.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/containerd/containerd/pkg/epoch/epoch.go
@@ -37,12 +37,11 @@ func SourceDateEpoch() (*time.Time, error) {
if !ok || v == "" {
return nil, nil // not an error
}
- i64, err := strconv.ParseInt(v, 10, 64)
+ t, err := ParseSourceDateEpoch(v)
if err != nil {
- return nil, fmt.Errorf("invalid %s value %q: %w", SourceDateEpochEnv, v, err)
+ return nil, fmt.Errorf("invalid %s value: %w", SourceDateEpochEnv, err)
}
- unix := time.Unix(i64, 0).UTC()
- return &unix, nil
+ return t, nil
}
// SourceDateEpochOrNow returns the SOURCE_DATE_EPOCH time if available,
@@ -58,12 +57,26 @@ func SourceDateEpochOrNow() time.Time {
return time.Now().UTC()
}
+// ParseSourceDateEpoch parses the given source date epoch, as *time.Time.
+// It returns an error if sourceDateEpoch is empty or not well-formatted.
+func ParseSourceDateEpoch(sourceDateEpoch string) (*time.Time, error) {
+ if sourceDateEpoch == "" {
+ return nil, fmt.Errorf("value is empty")
+ }
+ i64, err := strconv.ParseInt(sourceDateEpoch, 10, 64)
+ if err != nil {
+ return nil, fmt.Errorf("invalid value: %w", err)
+ }
+ unix := time.Unix(i64, 0).UTC()
+ return &unix, nil
+}
+
// SetSourceDateEpoch sets the SOURCE_DATE_EPOCH env var.
func SetSourceDateEpoch(tm time.Time) {
- os.Setenv(SourceDateEpochEnv, fmt.Sprintf("%d", tm.Unix()))
+ _ = os.Setenv(SourceDateEpochEnv, strconv.Itoa(int(tm.Unix())))
}
// UnsetSourceDateEpoch unsets the SOURCE_DATE_EPOCH env var.
func UnsetSourceDateEpoch() {
- os.Unsetenv(SourceDateEpochEnv)
+ _ = os.Unsetenv(SourceDateEpochEnv)
}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/copy/single.go b/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/copy/single.go
index f7aca8381..19d410a61 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/copy/single.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/copy/single.go
@@ -812,6 +812,7 @@ func (ic *imageCopier) copyLayer(ctx context.Context, srcInfo types.BlobInfo, to
}
uploadedBlob, err := ic.c.dest.PutBlobPartial(ctx, &proxy, srcInfo, private.PutBlobPartialOptions{
Cache: ic.c.blobInfoCache,
+ EmptyLayer: emptyLayer,
LayerIndex: layerIndex,
})
if err == nil {
diff --git a/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/docker/docker_image_dest.go b/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/docker/docker_image_dest.go
index b08ebc6fe..76e48a384 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/docker/docker_image_dest.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/docker/docker_image_dest.go
@@ -615,11 +615,11 @@ func (d *dockerImageDestination) PutSignaturesWithFormat(ctx context.Context, si
}
switch {
case d.c.supportsSignatures:
- if err := d.putSignaturesToAPIExtension(ctx, signatures, *instanceDigest); err != nil {
+ if err := d.putSignaturesToAPIExtension(ctx, otherSignatures, *instanceDigest); err != nil {
return err
}
case d.c.signatureBase != nil:
- if err := d.putSignaturesToLookaside(signatures, *instanceDigest); err != nil {
+ if err := d.putSignaturesToLookaside(otherSignatures, *instanceDigest); err != nil {
return err
}
default:
diff --git a/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/internal/private/private.go b/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/internal/private/private.go
index d9466e900..ae0cbdf22 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/internal/private/private.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/internal/private/private.go
@@ -118,6 +118,7 @@ type PutBlobOptions struct {
// PutBlobPartialOptions are used in PutBlobPartial.
type PutBlobPartialOptions struct {
Cache blobinfocache.BlobInfoCache2 // Cache to use and/or update.
+ EmptyLayer bool // True if the blob is an "empty"/"throwaway" layer, and may not necessarily be physically represented.
LayerIndex int // A zero-based index of the layer within the image (PutBlobPartial is only called with layer-like blobs, not configs)
}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/signature/fulcio_cert.go b/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/signature/fulcio_cert.go
index cce467748..908dd0fd5 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/signature/fulcio_cert.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/signature/fulcio_cert.go
@@ -1,5 +1,3 @@
-//go:build !containers_image_fulcio_stub
-
package signature
import (
diff --git a/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/signature/fulcio_cert_stub.go b/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/signature/fulcio_cert_stub.go
deleted file mode 100644
index da8e13c1d..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/signature/fulcio_cert_stub.go
+++ /dev/null
@@ -1,27 +0,0 @@
-//go:build containers_image_fulcio_stub
-
-package signature
-
-import (
- "crypto"
- "crypto/ecdsa"
- "crypto/x509"
- "errors"
-)
-
-type fulcioTrustRoot struct {
- caCertificates *x509.CertPool
- oidcIssuer string
- subjectEmail string
-}
-
-func (f *fulcioTrustRoot) validate() error {
- return errors.New("fulcio disabled at compile-time")
-}
-
-func verifyRekorFulcio(rekorPublicKeys []*ecdsa.PublicKey, fulcioTrustRoot *fulcioTrustRoot, untrustedRekorSET []byte,
- untrustedCertificateBytes []byte, untrustedIntermediateChainBytes []byte, untrustedBase64Signature string,
- untrustedPayloadBytes []byte) (crypto.PublicKey, error) {
- return nil, errors.New("fulcio disabled at compile-time")
-
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/signature/internal/rekor_api_types.go b/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/signature/internal/rekor_api_types.go
new file mode 100644
index 000000000..7b941f536
--- /dev/null
+++ b/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/signature/internal/rekor_api_types.go
@@ -0,0 +1,95 @@
+package internal
+
+import (
+ "bytes"
+ "encoding/json"
+ "fmt"
+)
+
+const rekorHashedrekordKind = "hashedrekord"
+
+type RekorHashedrekord struct {
+ APIVersion *string `json:"apiVersion"`
+ Spec json.RawMessage `json:"spec"`
+}
+
+func (m *RekorHashedrekord) Kind() string {
+ return rekorHashedrekordKind
+}
+
+func (m *RekorHashedrekord) SetKind(val string) {
+}
+
+func (m *RekorHashedrekord) UnmarshalJSON(raw []byte) error {
+ var base struct {
+ Kind string `json:"kind"`
+ }
+ dec := json.NewDecoder(bytes.NewReader(raw))
+ dec.UseNumber()
+ if err := dec.Decode(&base); err != nil {
+ return err
+ }
+
+ switch base.Kind {
+ case rekorHashedrekordKind:
+ var data struct { // We can’t use RekorHashedRekord directly, because that would be an infinite recursion.
+ APIVersion *string `json:"apiVersion"`
+ Spec json.RawMessage `json:"spec"`
+ }
+ dec = json.NewDecoder(bytes.NewReader(raw))
+ dec.UseNumber()
+ if err := dec.Decode(&data); err != nil {
+ return err
+ }
+ res := RekorHashedrekord{
+ APIVersion: data.APIVersion,
+ Spec: data.Spec,
+ }
+ *m = res
+ return nil
+
+ default:
+ return fmt.Errorf("invalid kind value: %q", base.Kind)
+ }
+}
+
+func (m RekorHashedrekord) MarshalJSON() ([]byte, error) {
+ return json.Marshal(struct {
+ Kind string `json:"kind"`
+ APIVersion *string `json:"apiVersion"`
+ Spec json.RawMessage `json:"spec"`
+ }{
+ Kind: m.Kind(),
+ APIVersion: m.APIVersion,
+ Spec: m.Spec,
+ })
+}
+
+type RekorHashedrekordV001Schema struct {
+ Data *RekorHashedrekordV001SchemaData `json:"data"`
+ Signature *RekorHashedrekordV001SchemaSignature `json:"signature"`
+}
+
+type RekorHashedrekordV001SchemaData struct {
+ Hash *RekorHashedrekordV001SchemaDataHash `json:"hash,omitempty"`
+}
+
+type RekorHashedrekordV001SchemaDataHash struct {
+ Algorithm *string `json:"algorithm"`
+ Value *string `json:"value"`
+}
+
+const (
+ RekorHashedrekordV001SchemaDataHashAlgorithmSha256 string = "sha256"
+ RekorHashedrekordV001SchemaDataHashAlgorithmSha384 string = "sha384"
+ RekorHashedrekordV001SchemaDataHashAlgorithmSha512 string = "sha512"
+)
+
+type RekorHashedrekordV001SchemaSignature struct {
+ Content []byte `json:"content,omitempty"`
+ PublicKey *RekorHashedrekordV001SchemaSignaturePublicKey `json:"publicKey,omitempty"`
+}
+
+type RekorHashedrekordV001SchemaSignaturePublicKey struct {
+ Content []byte `json:"content,omitempty"`
+}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/signature/internal/rekor_set.go b/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/signature/internal/rekor_set.go
index f26a97870..1c20e496a 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/signature/internal/rekor_set.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/signature/internal/rekor_set.go
@@ -1,5 +1,3 @@
-//go:build !containers_image_rekor_stub
-
package internal
import (
@@ -14,12 +12,11 @@ import (
"time"
"github.com/cyberphone/json-canonicalization/go/src/webpki.org/jsoncanonicalizer"
- "github.com/sigstore/rekor/pkg/generated/models"
)
// This is the github.com/sigstore/rekor/pkg/generated/models.Hashedrekord.APIVersion for github.com/sigstore/rekor/pkg/generated/models.HashedrekordV001Schema.
// We could alternatively use github.com/sigstore/rekor/pkg/types/hashedrekord.APIVERSION, but that subpackage adds too many dependencies.
-const HashedRekordV001APIVersion = "0.0.1"
+const RekorHashedRekordV001APIVersion = "0.0.1"
// UntrustedRekorSET is a parsed content of the sigstore-signature Rekor SET
// (note that this a signature-specific format, not a format directly used by the Rekor API).
@@ -137,31 +134,20 @@ func VerifyRekorSET(publicKeys []*ecdsa.PublicKey, unverifiedRekorSET []byte, un
if err := json.Unmarshal(untrustedSETPayloadCanonicalBytes, &rekorPayload); err != nil {
return time.Time{}, NewInvalidSignatureError(fmt.Sprintf("parsing Rekor SET payload: %v", err.Error()))
}
- // FIXME: Use a different decoder implementation? The Swagger-generated code is kinda ridiculous, with the need to re-marshal
- // hashedRekor.Spec and so on.
- // Especially if we anticipate needing to decode different data formats…
- // That would also allow being much more strict about JSON.
- //
- // Alternatively, rely on the existing .Validate() methods instead of manually checking for nil all over the place.
- var hashedRekord models.Hashedrekord
+ // FIXME: Consider being much more strict about decoding JSON.
+ var hashedRekord RekorHashedrekord
if err := json.Unmarshal(rekorPayload.Body, &hashedRekord); err != nil {
return time.Time{}, NewInvalidSignatureError(fmt.Sprintf("decoding the body of a Rekor SET payload: %v", err))
}
- // The decode of models.HashedRekord validates the "kind": "hashedrecord" field, which is otherwise invisible to us.
+ // The decode of HashedRekord validates the "kind": "hashedrecord" field, which is otherwise invisible to us.
if hashedRekord.APIVersion == nil {
return time.Time{}, NewInvalidSignatureError("missing Rekor SET Payload API version")
}
- if *hashedRekord.APIVersion != HashedRekordV001APIVersion {
+ if *hashedRekord.APIVersion != RekorHashedRekordV001APIVersion {
return time.Time{}, NewInvalidSignatureError(fmt.Sprintf("unsupported Rekor SET Payload hashedrekord version %#v", hashedRekord.APIVersion))
}
- hashedRekordV001Bytes, err := json.Marshal(hashedRekord.Spec)
- if err != nil {
- // Coverage: hashedRekord.Spec is an any that was just unmarshaled,
- // so this should never fail.
- return time.Time{}, NewInvalidSignatureError(fmt.Sprintf("re-creating hashedrekord spec: %v", err))
- }
- var hashedRekordV001 models.HashedrekordV001Schema
- if err := json.Unmarshal(hashedRekordV001Bytes, &hashedRekordV001); err != nil {
+ var hashedRekordV001 RekorHashedrekordV001Schema
+ if err := json.Unmarshal(hashedRekord.Spec, &hashedRekordV001); err != nil {
return time.Time{}, NewInvalidSignatureError(fmt.Sprintf("decoding hashedrekod spec: %v", err))
}
@@ -217,7 +203,7 @@ func VerifyRekorSET(publicKeys []*ecdsa.PublicKey, unverifiedRekorSET []byte, un
// Eventually we should support them as well.
// Short-term, Cosign (as of 2024-02 and Cosign 2.2.3) only produces and accepts SHA-256, so right now that’s not a compatibility
// issue.
- if *hashedRekordV001.Data.Hash.Algorithm != models.HashedrekordV001SchemaDataHashAlgorithmSha256 {
+ if *hashedRekordV001.Data.Hash.Algorithm != RekorHashedrekordV001SchemaDataHashAlgorithmSha256 {
return time.Time{}, NewInvalidSignatureError(fmt.Sprintf(`Unexpected "data.hash.algorithm" value %#v`, *hashedRekordV001.Data.Hash.Algorithm))
}
if hashedRekordV001.Data.Hash.Value == nil {
diff --git a/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/signature/internal/rekor_set_stub.go b/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/signature/internal/rekor_set_stub.go
deleted file mode 100644
index 4ff3da7ed..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/signature/internal/rekor_set_stub.go
+++ /dev/null
@@ -1,14 +0,0 @@
-//go:build containers_image_rekor_stub
-
-package internal
-
-import (
- "crypto/ecdsa"
- "time"
-)
-
-// VerifyRekorSET verifies that unverifiedRekorSET is correctly signed by publicKey and matches the rest of the data.
-// Returns bundle upload time on success.
-func VerifyRekorSET(publicKeys []*ecdsa.PublicKey, unverifiedRekorSET []byte, unverifiedKeyOrCertBytes []byte, unverifiedBase64Signature string, unverifiedPayloadBytes []byte) (time.Time, error) {
- return time.Time{}, NewInvalidSignatureError("rekor disabled at compile-time")
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/transports/transports.go b/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/transports/transports.go
index 834f33b48..4c9c0889c 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/transports/transports.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/transports/transports.go
@@ -72,7 +72,7 @@ func ImageName(ref types.ImageReference) string {
return ref.Transport().Name() + ":" + ref.StringWithinTransport()
}
-var deprecatedTransports = set.NewWithValues("atomic")
+var deprecatedTransports = set.NewWithValues("atomic", "ostree")
// ListNames returns a list of non deprecated transport names.
// Deprecated transports can be used, but are not presented to users.
diff --git a/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/types/types.go b/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/types/types.go
index 9883bde6d..a93951780 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/types/types.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/types/types.go
@@ -659,6 +659,8 @@ type SystemContext struct {
// If true, the physical pull source of docker transport images logged as info level
DockerLogMirrorChoice bool
// Directory to use for OSTree temporary files
+ //
+ // Deprecated: The OSTree transport has been removed.
OSTreeTmpDirPath string
// If true, all blobs will have precomputed digests to ensure layers are not uploaded that already exist on the registry.
// Note that this requires writing blobs to temporary files, and takes more time than the default behavior,
diff --git a/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/version/version.go b/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/version/version.go
index e9d548a85..f494845b8 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/version/version.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/containers/image/v5/version/version.go
@@ -6,9 +6,9 @@ const (
// VersionMajor is for an API incompatible changes
VersionMajor = 5
// VersionMinor is for functionality in a backwards-compatible manner
- VersionMinor = 35
+ VersionMinor = 36
// VersionPatch is for backwards-compatible bug fixes
- VersionPatch = 0
+ VersionPatch = 2
// VersionDev indicates development branch. Releases will be empty string.
VersionDev = ""
diff --git a/openshift/default-catalog-consistency/vendor/github.com/containers/storage/internal/rawfilelock/rawfilelock.go b/openshift/default-catalog-consistency/vendor/github.com/containers/storage/internal/rawfilelock/rawfilelock.go
new file mode 100644
index 000000000..4f340ae3c
--- /dev/null
+++ b/openshift/default-catalog-consistency/vendor/github.com/containers/storage/internal/rawfilelock/rawfilelock.go
@@ -0,0 +1,64 @@
+package rawfilelock
+
+import (
+ "os"
+)
+
+type LockType byte
+
+const (
+ ReadLock LockType = iota
+ WriteLock
+)
+
+type FileHandle = fileHandle
+
+// OpenLock opens a file for locking
+// WARNING: This is the underlying file locking primitive of the OS;
+// because closing FileHandle releases the lock, it is not suitable for use
+// if there is any chance of two concurrent goroutines attempting to use the same lock.
+// Most users should use the higher-level operations from internal/staging_lockfile or pkg/lockfile.
+func OpenLock(path string, readOnly bool) (FileHandle, error) {
+ flags := os.O_CREATE
+ if readOnly {
+ flags |= os.O_RDONLY
+ } else {
+ flags |= os.O_RDWR
+ }
+
+ fd, err := openHandle(path, flags)
+ if err == nil {
+ return fd, nil
+ }
+
+ return fd, &os.PathError{Op: "open", Path: path, Err: err}
+}
+
+// TryLockFile attempts to lock a file handle
+func TryLockFile(fd FileHandle, lockType LockType) error {
+ return lockHandle(fd, lockType, true)
+}
+
+// LockFile locks a file handle
+func LockFile(fd FileHandle, lockType LockType) error {
+ return lockHandle(fd, lockType, false)
+}
+
+// UnlockAndClose unlocks and closes a file handle
+func UnlockAndCloseHandle(fd FileHandle) {
+ unlockAndCloseHandle(fd)
+}
+
+// CloseHandle closes a file handle without unlocking
+//
+// WARNING: This is a last-resort function for error handling only!
+// On Unix systems, closing a file descriptor automatically releases any locks,
+// so "closing without unlocking" is impossible. This function will release
+// the lock as a side effect of closing the file.
+//
+// This function should only be used in error paths where the lock state
+// is already corrupted or when giving up on lock management entirely.
+// Normal code should use UnlockAndCloseHandle instead.
+func CloseHandle(fd FileHandle) {
+ closeHandle(fd)
+}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/containers/storage/internal/rawfilelock/rawfilelock_unix.go b/openshift/default-catalog-consistency/vendor/github.com/containers/storage/internal/rawfilelock/rawfilelock_unix.go
new file mode 100644
index 000000000..268554076
--- /dev/null
+++ b/openshift/default-catalog-consistency/vendor/github.com/containers/storage/internal/rawfilelock/rawfilelock_unix.go
@@ -0,0 +1,49 @@
+//go:build !windows
+
+package rawfilelock
+
+import (
+ "time"
+
+ "golang.org/x/sys/unix"
+)
+
+type fileHandle uintptr
+
+func openHandle(path string, mode int) (fileHandle, error) {
+ mode |= unix.O_CLOEXEC
+ fd, err := unix.Open(path, mode, 0o644)
+ return fileHandle(fd), err
+}
+
+func lockHandle(fd fileHandle, lType LockType, nonblocking bool) error {
+ fType := unix.F_RDLCK
+ if lType != ReadLock {
+ fType = unix.F_WRLCK
+ }
+ lk := unix.Flock_t{
+ Type: int16(fType),
+ Whence: int16(unix.SEEK_SET),
+ Start: 0,
+ Len: 0,
+ }
+ cmd := unix.F_SETLKW
+ if nonblocking {
+ cmd = unix.F_SETLK
+ }
+ for {
+ err := unix.FcntlFlock(uintptr(fd), cmd, &lk)
+ if err == nil || nonblocking {
+ return err
+ }
+ time.Sleep(10 * time.Millisecond)
+ }
+}
+
+func unlockAndCloseHandle(fd fileHandle) {
+ unix.Close(int(fd))
+}
+
+func closeHandle(fd fileHandle) {
+ unix.Close(int(fd))
+}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/containers/storage/internal/rawfilelock/rawfilelock_windows.go b/openshift/default-catalog-consistency/vendor/github.com/containers/storage/internal/rawfilelock/rawfilelock_windows.go
new file mode 100644
index 000000000..9c0d692f8
--- /dev/null
+++ b/openshift/default-catalog-consistency/vendor/github.com/containers/storage/internal/rawfilelock/rawfilelock_windows.go
@@ -0,0 +1,48 @@
+//go:build windows
+
+package rawfilelock
+
+import (
+ "golang.org/x/sys/windows"
+)
+
+const (
+ reserved = 0
+ allBytes = ^uint32(0)
+)
+
+type fileHandle windows.Handle
+
+func openHandle(path string, mode int) (fileHandle, error) {
+ mode |= windows.O_CLOEXEC
+ fd, err := windows.Open(path, mode, windows.S_IWRITE)
+ return fileHandle(fd), err
+}
+
+func lockHandle(fd fileHandle, lType LockType, nonblocking bool) error {
+ flags := 0
+ if lType != ReadLock {
+ flags = windows.LOCKFILE_EXCLUSIVE_LOCK
+ }
+ if nonblocking {
+ flags |= windows.LOCKFILE_FAIL_IMMEDIATELY
+ }
+ ol := new(windows.Overlapped)
+ if err := windows.LockFileEx(windows.Handle(fd), uint32(flags), reserved, allBytes, allBytes, ol); err != nil {
+ if nonblocking {
+ return err
+ }
+ panic(err)
+ }
+ return nil
+}
+
+func unlockAndCloseHandle(fd fileHandle) {
+ ol := new(windows.Overlapped)
+ windows.UnlockFileEx(windows.Handle(fd), reserved, allBytes, allBytes, ol)
+ closeHandle(fd)
+}
+
+func closeHandle(fd fileHandle) {
+ windows.Close(windows.Handle(fd))
+}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/archive/archive.go b/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/archive/archive.go
index aee06d71c..a66d2b891 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/archive/archive.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/archive/archive.go
@@ -528,11 +528,29 @@ func canonicalTarName(name string, isDir bool) (string, error) {
return name, nil
}
-// addFile adds a file from `path` as `name` to the tar archive.
-func (ta *tarWriter) addFile(path, name string) error {
+type addFileData struct {
+ // The path from which to read contents.
+ path string
+
+ // os.Stat for the above.
+ fi os.FileInfo
+
+ // The file header of the above.
+ hdr *tar.Header
+
+ // if present, an extra whiteout entry to write after the header.
+ extraWhiteout *tar.Header
+}
+
+// prepareAddFile generates the tar file header(s) for adding a file
+// from path as name to the tar archive, without writing to the
+// tar stream. Thus, any error may be ignored without corrupting the
+// tar file. A (nil, nil) return means that the file should be
+// ignored for non-error reasons.
+func (ta *tarWriter) prepareAddFile(path, name string) (*addFileData, error) {
fi, err := os.Lstat(path)
if err != nil {
- return err
+ return nil, err
}
var link string
@@ -540,26 +558,26 @@ func (ta *tarWriter) addFile(path, name string) error {
var err error
link, err = os.Readlink(path)
if err != nil {
- return err
+ return nil, err
}
}
if fi.Mode()&os.ModeSocket != 0 {
logrus.Infof("archive: skipping %q since it is a socket", path)
- return nil
+ return nil, nil
}
hdr, err := FileInfoHeader(name, fi, link)
if err != nil {
- return err
+ return nil, err
}
if err := readSecurityXattrToTarHeader(path, hdr); err != nil {
- return err
+ return nil, err
}
if err := readUserXattrToTarHeader(path, hdr); err != nil {
- return err
+ return nil, err
}
if err := ReadFileFlagsToTarHeader(path, hdr); err != nil {
- return err
+ return nil, err
}
if ta.CopyPass {
copyPassHeader(hdr)
@@ -568,18 +586,13 @@ func (ta *tarWriter) addFile(path, name string) error {
// if it's not a directory and has more than 1 link,
// it's hard linked, so set the type flag accordingly
if !fi.IsDir() && hasHardlinks(fi) {
- inode, err := getInodeFromStat(fi.Sys())
- if err != nil {
- return err
- }
+ inode := getInodeFromStat(fi.Sys())
// a link should have a name that it links too
// and that linked name should be first in the tar archive
if oldpath, ok := ta.SeenFiles[inode]; ok {
hdr.Typeflag = tar.TypeLink
hdr.Linkname = oldpath
- hdr.Size = 0 // This Must be here for the writer math to add up!
- } else {
- ta.SeenFiles[inode] = name
+ hdr.Size = 0 // This must be here for the writer math to add up!
}
}
@@ -589,11 +602,11 @@ func (ta *tarWriter) addFile(path, name string) error {
if !strings.HasPrefix(filepath.Base(hdr.Name), WhiteoutPrefix) && !ta.IDMappings.Empty() {
fileIDPair, err := getFileUIDGID(fi.Sys())
if err != nil {
- return err
+ return nil, err
}
hdr.Uid, hdr.Gid, err = ta.IDMappings.ToContainer(fileIDPair)
if err != nil {
- return err
+ return nil, err
}
}
@@ -616,26 +629,48 @@ func (ta *tarWriter) addFile(path, name string) error {
maybeTruncateHeaderModTime(hdr)
+ result := &addFileData{
+ path: path,
+ hdr: hdr,
+ fi: fi,
+ }
if ta.WhiteoutConverter != nil {
- wo, err := ta.WhiteoutConverter.ConvertWrite(hdr, path, fi)
+ // The WhiteoutConverter suggests a generic mechanism,
+ // but this code is only used to convert between
+ // overlayfs (on-disk) and AUFS (in the tar file)
+ // whiteouts, and is initiated because the overlayfs
+ // storage driver returns OverlayWhiteoutFormat from
+ // Driver.getWhiteoutFormat().
+ //
+ // For AUFS, a directory with all its contents deleted
+ // should be represented as a directory containing a
+ // magic whiteout empty regular file, hence the
+ // extraWhiteout header returned here.
+ result.extraWhiteout, err = ta.WhiteoutConverter.ConvertWrite(hdr, path, fi)
if err != nil {
- return err
+ return nil, err
}
+ }
- // If a new whiteout file exists, write original hdr, then
- // replace hdr with wo to be written after. Whiteouts should
- // always be written after the original. Note the original
- // hdr may have been updated to be a whiteout with returning
- // a whiteout header
- if wo != nil {
- if err := ta.TarWriter.WriteHeader(hdr); err != nil {
- return err
- }
- if hdr.Typeflag == tar.TypeReg && hdr.Size > 0 {
- return fmt.Errorf("tar: cannot use whiteout for non-empty file")
- }
- hdr = wo
+ return result, nil
+}
+
+// addFile performs the write. An error here corrupts the tar file.
+func (ta *tarWriter) addFile(headers *addFileData) error {
+ hdr := headers.hdr
+ if headers.extraWhiteout != nil {
+ if hdr.Typeflag == tar.TypeReg && hdr.Size > 0 {
+ // If we write hdr with hdr.Size > 0, we have
+ // to write the body before we can write the
+ // extraWhiteout header. This can only happen
+ // if the contract for WhiteoutConverter is
+ // not honored, so bail out.
+ return fmt.Errorf("tar: cannot use extra whiteout with non-empty file %s", hdr.Name)
+ }
+ if err := ta.TarWriter.WriteHeader(hdr); err != nil {
+ return err
}
+ hdr = headers.extraWhiteout
}
if err := ta.TarWriter.WriteHeader(hdr); err != nil {
@@ -643,7 +678,7 @@ func (ta *tarWriter) addFile(path, name string) error {
}
if hdr.Typeflag == tar.TypeReg && hdr.Size > 0 {
- file, err := os.Open(path)
+ file, err := os.Open(headers.path)
if err != nil {
return err
}
@@ -661,6 +696,13 @@ func (ta *tarWriter) addFile(path, name string) error {
}
}
+ if !headers.fi.IsDir() && hasHardlinks(headers.fi) {
+ ino := getInodeFromStat(headers.fi.Sys())
+ if _, seen := ta.SeenFiles[ino]; !seen {
+ ta.SeenFiles[ino] = headers.hdr.Name
+ }
+ }
+
return nil
}
@@ -853,184 +895,189 @@ func extractTarFileEntry(path, extractDir string, hdr *tar.Header, reader io.Rea
}
// Tar creates an archive from the directory at `path`, and returns it as a
-// stream of bytes.
+// stream of bytes. This is a convenience wrapper for [TarWithOptions].
func Tar(path string, compression Compression) (io.ReadCloser, error) {
return TarWithOptions(path, &TarOptions{Compression: compression})
}
-// TarWithOptions creates an archive from the directory at `path`, only including files whose relative
-// paths are included in `options.IncludeFiles` (if non-nil) or not in `options.ExcludePatterns`.
-func TarWithOptions(srcPath string, options *TarOptions) (io.ReadCloser, error) {
- tarWithOptionsTo := func(dest io.WriteCloser, srcPath string, options *TarOptions) (result error) {
- // Fix the source path to work with long path names. This is a no-op
- // on platforms other than Windows.
- srcPath = fixVolumePathPrefix(srcPath)
- defer func() {
- if err := dest.Close(); err != nil && result == nil {
- result = err
- }
- }()
-
- pm, err := fileutils.NewPatternMatcher(options.ExcludePatterns)
- if err != nil {
- return err
+func tarWithOptionsTo(dest io.WriteCloser, srcPath string, options *TarOptions) (result error) {
+ // Fix the source path to work with long path names. This is a no-op
+ // on platforms other than Windows.
+ srcPath = fixVolumePathPrefix(srcPath)
+ defer func() {
+ if err := dest.Close(); err != nil && result == nil {
+ result = err
}
+ }()
- compressWriter, err := CompressStream(dest, options.Compression)
- if err != nil {
- return err
- }
+ pm, err := fileutils.NewPatternMatcher(options.ExcludePatterns)
+ if err != nil {
+ return err
+ }
- ta := newTarWriter(
- idtools.NewIDMappingsFromMaps(options.UIDMaps, options.GIDMaps),
- compressWriter,
- options.ChownOpts,
- options.Timestamp,
- )
- ta.WhiteoutConverter = GetWhiteoutConverter(options.WhiteoutFormat, options.WhiteoutData)
- ta.CopyPass = options.CopyPass
+ compressWriter, err := CompressStream(dest, options.Compression)
+ if err != nil {
+ return err
+ }
- includeFiles := options.IncludeFiles
- defer func() {
- if err := compressWriter.Close(); err != nil && result == nil {
- result = err
- }
- }()
+ ta := newTarWriter(
+ idtools.NewIDMappingsFromMaps(options.UIDMaps, options.GIDMaps),
+ compressWriter,
+ options.ChownOpts,
+ options.Timestamp,
+ )
+ ta.WhiteoutConverter = GetWhiteoutConverter(options.WhiteoutFormat, options.WhiteoutData)
+ ta.CopyPass = options.CopyPass
- // this buffer is needed for the duration of this piped stream
- defer pools.BufioWriter32KPool.Put(ta.Buffer)
+ includeFiles := options.IncludeFiles
+ defer func() {
+ if err := compressWriter.Close(); err != nil && result == nil {
+ result = err
+ }
+ }()
- // In general we log errors here but ignore them because
- // during e.g. a diff operation the container can continue
- // mutating the filesystem and we can see transient errors
- // from this
+ // this buffer is needed for the duration of this piped stream
+ defer pools.BufioWriter32KPool.Put(ta.Buffer)
- stat, err := os.Lstat(srcPath)
- if err != nil {
- return err
- }
+ // In general we log errors here but ignore them because
+ // during e.g. a diff operation the container can continue
+ // mutating the filesystem and we can see transient errors
+ // from this
- if !stat.IsDir() {
- // We can't later join a non-dir with any includes because the
- // 'walk' will error if "file/." is stat-ed and "file" is not a
- // directory. So, we must split the source path and use the
- // basename as the include.
- if len(includeFiles) > 0 {
- logrus.Warn("Tar: Can't archive a file with includes")
- }
+ stat, err := os.Lstat(srcPath)
+ if err != nil {
+ return err
+ }
- dir, base := SplitPathDirEntry(srcPath)
- srcPath = dir
- includeFiles = []string{base}
+ if !stat.IsDir() {
+ // We can't later join a non-dir with any includes because the
+ // 'walk' will error if "file/." is stat-ed and "file" is not a
+ // directory. So, we must split the source path and use the
+ // basename as the include.
+ if len(includeFiles) > 0 {
+ logrus.Warn("Tar: Can't archive a file with includes")
}
- if len(includeFiles) == 0 {
- includeFiles = []string{"."}
- }
+ dir, base := SplitPathDirEntry(srcPath)
+ srcPath = dir
+ includeFiles = []string{base}
+ }
- seen := make(map[string]bool)
+ if len(includeFiles) == 0 {
+ includeFiles = []string{"."}
+ }
- for _, include := range includeFiles {
- rebaseName := options.RebaseNames[include]
+ seen := make(map[string]bool)
- walkRoot := getWalkRoot(srcPath, include)
- if err := filepath.WalkDir(walkRoot, func(filePath string, d fs.DirEntry, err error) error {
- if err != nil {
- logrus.Errorf("Tar: Can't stat file %s to tar: %s", srcPath, err)
- return nil
- }
+ for _, include := range includeFiles {
+ rebaseName := options.RebaseNames[include]
- relFilePath, err := filepath.Rel(srcPath, filePath)
- if err != nil || (!options.IncludeSourceDir && relFilePath == "." && d.IsDir()) {
- // Error getting relative path OR we are looking
- // at the source directory path. Skip in both situations.
- return nil //nolint: nilerr
- }
+ walkRoot := getWalkRoot(srcPath, include)
+ if err := filepath.WalkDir(walkRoot, func(filePath string, d fs.DirEntry, err error) error {
+ if err != nil {
+ logrus.Errorf("Tar: Can't stat file %s to tar: %s", srcPath, err)
+ return nil
+ }
- if options.IncludeSourceDir && include == "." && relFilePath != "." {
- relFilePath = strings.Join([]string{".", relFilePath}, string(filepath.Separator))
- }
+ relFilePath, err := filepath.Rel(srcPath, filePath)
+ if err != nil || (!options.IncludeSourceDir && relFilePath == "." && d.IsDir()) {
+ // Error getting relative path OR we are looking
+ // at the source directory path. Skip in both situations.
+ return nil //nolint: nilerr
+ }
+
+ if options.IncludeSourceDir && include == "." && relFilePath != "." {
+ relFilePath = strings.Join([]string{".", relFilePath}, string(filepath.Separator))
+ }
- skip := false
+ skip := false
- // If "include" is an exact match for the current file
- // then even if there's an "excludePatterns" pattern that
- // matches it, don't skip it. IOW, assume an explicit 'include'
- // is asking for that file no matter what - which is true
- // for some files, like .dockerignore and Dockerfile (sometimes)
- if include != relFilePath {
- matches, err := pm.IsMatch(relFilePath)
- if err != nil {
- return fmt.Errorf("matching %s: %w", relFilePath, err)
- }
- skip = matches
+ // If "include" is an exact match for the current file
+ // then even if there's an "excludePatterns" pattern that
+ // matches it, don't skip it. IOW, assume an explicit 'include'
+ // is asking for that file no matter what - which is true
+ // for some files, like .dockerignore and Dockerfile (sometimes)
+ if include != relFilePath {
+ matches, err := pm.IsMatch(relFilePath)
+ if err != nil {
+ return fmt.Errorf("matching %s: %w", relFilePath, err)
}
+ skip = matches
+ }
- if skip {
- // If we want to skip this file and its a directory
- // then we should first check to see if there's an
- // excludes pattern (e.g. !dir/file) that starts with this
- // dir. If so then we can't skip this dir.
+ if skip {
+ // If we want to skip this file and its a directory
+ // then we should first check to see if there's an
+ // excludes pattern (e.g. !dir/file) that starts with this
+ // dir. If so then we can't skip this dir.
- // Its not a dir then so we can just return/skip.
- if !d.IsDir() {
- return nil
- }
+ // Its not a dir then so we can just return/skip.
+ if !d.IsDir() {
+ return nil
+ }
- // No exceptions (!...) in patterns so just skip dir
- if !pm.Exclusions() {
- return filepath.SkipDir
- }
+ // No exceptions (!...) in patterns so just skip dir
+ if !pm.Exclusions() {
+ return filepath.SkipDir
+ }
- dirSlash := relFilePath + string(filepath.Separator)
+ dirSlash := relFilePath + string(filepath.Separator)
- for _, pat := range pm.Patterns() {
- if !pat.Exclusion() {
- continue
- }
- if strings.HasPrefix(pat.String()+string(filepath.Separator), dirSlash) {
- // found a match - so can't skip this dir
- return nil
- }
+ for _, pat := range pm.Patterns() {
+ if !pat.Exclusion() {
+ continue
+ }
+ if strings.HasPrefix(pat.String()+string(filepath.Separator), dirSlash) {
+ // found a match - so can't skip this dir
+ return nil
}
-
- // No matching exclusion dir so just skip dir
- return filepath.SkipDir
}
- if seen[relFilePath] {
- return nil
- }
- seen[relFilePath] = true
-
- // Rename the base resource.
- if rebaseName != "" {
- var replacement string
- if rebaseName != string(filepath.Separator) {
- // Special case the root directory to replace with an
- // empty string instead so that we don't end up with
- // double slashes in the paths.
- replacement = rebaseName
- }
+ // No matching exclusion dir so just skip dir
+ return filepath.SkipDir
+ }
- relFilePath = strings.Replace(relFilePath, include, replacement, 1)
+ if seen[relFilePath] {
+ return nil
+ }
+ seen[relFilePath] = true
+
+ // Rename the base resource.
+ if rebaseName != "" {
+ var replacement string
+ if rebaseName != string(filepath.Separator) {
+ // Special case the root directory to replace with an
+ // empty string instead so that we don't end up with
+ // double slashes in the paths.
+ replacement = rebaseName
}
- if err := ta.addFile(filePath, relFilePath); err != nil {
- logrus.Errorf("Can't add file %s to tar: %s", filePath, err)
- // if pipe is broken, stop writing tar stream to it
- if err == io.ErrClosedPipe {
- return err
- }
+ relFilePath = strings.Replace(relFilePath, include, replacement, 1)
+ }
+
+ headers, err := ta.prepareAddFile(filePath, relFilePath)
+ if err != nil {
+ logrus.Errorf("Can't add file %s to tar: %s; skipping", filePath, err)
+ } else if headers != nil {
+ if err := ta.addFile(headers); err != nil {
+ return err
}
- return nil
- }); err != nil {
- return err
}
+ return nil
+ }); err != nil {
+ return err
}
- return ta.TarWriter.Close()
}
+ return ta.TarWriter.Close()
+}
+// TarWithOptions creates an archive from the directory at `path`, only including files whose relative
+// paths are included in `options.IncludeFiles` (if non-nil) or not in `options.ExcludePatterns`.
+//
+// If used on a file system being modified concurrently,
+// TarWithOptions will create a valid tar archive, but may leave out
+// some files.
+func TarWithOptions(srcPath string, options *TarOptions) (io.ReadCloser, error) {
pipeReader, pipeWriter := io.Pipe()
go func() {
err := tarWithOptionsTo(pipeWriter, srcPath, options)
@@ -1446,7 +1493,7 @@ func NewTempArchive(src io.Reader, dir string) (*TempArchive, error) {
if _, err := io.Copy(f, src); err != nil {
return nil, err
}
- if _, err := f.Seek(0, 0); err != nil {
+ if _, err := f.Seek(0, io.SeekStart); err != nil {
return nil, err
}
st, err := f.Stat()
diff --git a/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/archive/archive_unix.go b/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/archive/archive_unix.go
index 3a02a88c1..d9bcb97ba 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/archive/archive_unix.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/archive/archive_unix.go
@@ -82,7 +82,7 @@ func setHeaderForSpecialDevice(hdr *tar.Header, name string, stat any) (err erro
return
}
-func getInodeFromStat(stat any) (inode uint64, err error) {
+func getInodeFromStat(stat any) (inode uint64) {
s, ok := stat.(*syscall.Stat_t)
if ok {
diff --git a/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/archive/archive_windows.go b/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/archive/archive_windows.go
index 6db31cf4c..e98782869 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/archive/archive_windows.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/archive/archive_windows.go
@@ -57,7 +57,7 @@ func setHeaderForSpecialDevice(hdr *tar.Header, name string, stat interface{}) (
return
}
-func getInodeFromStat(stat interface{}) (inode uint64, err error) {
+func getInodeFromStat(stat interface{}) (inode uint64) {
// do nothing. no notion of Inode in stat on Windows
return
}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/archive/changes.go b/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/archive/changes.go
index a5847cca5..76edac85d 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/archive/changes.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/archive/changes.go
@@ -481,8 +481,14 @@ func ExportChanges(dir string, changes []Change, uidMaps, gidMaps []idtools.IDMa
}
} else {
path := filepath.Join(dir, change.Path)
- if err := ta.addFile(path, change.Path[1:]); err != nil {
+ headers, err := ta.prepareAddFile(path, change.Path[1:])
+ if err != nil {
logrus.Debugf("Can't add file %s to tar: %s", path, err)
+ } else if headers != nil {
+ if err := ta.addFile(headers); err != nil {
+ writer.CloseWithError(err)
+ return
+ }
}
}
}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/chunked/compressor/compressor.go b/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/chunked/compressor/compressor.go
index 0de063a24..2930723aa 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/chunked/compressor/compressor.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/chunked/compressor/compressor.go
@@ -11,7 +11,6 @@ import (
"github.com/containers/storage/pkg/chunked/internal/minimal"
"github.com/containers/storage/pkg/ioutils"
- "github.com/klauspost/compress/zstd"
"github.com/opencontainers/go-digest"
"github.com/vbatts/tar-split/archive/tar"
"github.com/vbatts/tar-split/tar/asm"
@@ -202,15 +201,15 @@ type tarSplitData struct {
compressed *bytes.Buffer
digester digest.Digester
uncompressedCounter *ioutils.WriteCounter
- zstd *zstd.Encoder
+ zstd minimal.ZstdWriter
packer storage.Packer
}
-func newTarSplitData(level int) (*tarSplitData, error) {
+func newTarSplitData(createZstdWriter minimal.CreateZstdWriterFunc) (*tarSplitData, error) {
compressed := bytes.NewBuffer(nil)
digester := digest.Canonical.Digester()
- zstdWriter, err := minimal.ZstdWriterWithLevel(io.MultiWriter(compressed, digester.Hash()), level)
+ zstdWriter, err := createZstdWriter(io.MultiWriter(compressed, digester.Hash()))
if err != nil {
return nil, err
}
@@ -227,11 +226,11 @@ func newTarSplitData(level int) (*tarSplitData, error) {
}, nil
}
-func writeZstdChunkedStream(destFile io.Writer, outMetadata map[string]string, reader io.Reader, level int) error {
+func writeZstdChunkedStream(destFile io.Writer, outMetadata map[string]string, reader io.Reader, createZstdWriter minimal.CreateZstdWriterFunc) error {
// total written so far. Used to retrieve partial offsets in the file
dest := ioutils.NewWriteCounter(destFile)
- tarSplitData, err := newTarSplitData(level)
+ tarSplitData, err := newTarSplitData(createZstdWriter)
if err != nil {
return err
}
@@ -251,7 +250,7 @@ func writeZstdChunkedStream(destFile io.Writer, outMetadata map[string]string, r
buf := make([]byte, 4096)
- zstdWriter, err := minimal.ZstdWriterWithLevel(dest, level)
+ zstdWriter, err := createZstdWriter(dest)
if err != nil {
return err
}
@@ -404,18 +403,11 @@ func writeZstdChunkedStream(destFile io.Writer, outMetadata map[string]string, r
return err
}
- if err := zstdWriter.Flush(); err != nil {
- zstdWriter.Close()
- return err
- }
if err := zstdWriter.Close(); err != nil {
return err
}
zstdWriter = nil
- if err := tarSplitData.zstd.Flush(); err != nil {
- return err
- }
if err := tarSplitData.zstd.Close(); err != nil {
return err
}
@@ -427,7 +419,7 @@ func writeZstdChunkedStream(destFile io.Writer, outMetadata map[string]string, r
UncompressedSize: tarSplitData.uncompressedCounter.Count,
}
- return minimal.WriteZstdChunkedManifest(dest, outMetadata, uint64(dest.Count), &ts, metadata, level)
+ return minimal.WriteZstdChunkedManifest(dest, outMetadata, uint64(dest.Count), &ts, metadata, createZstdWriter)
}
type zstdChunkedWriter struct {
@@ -454,7 +446,7 @@ func (w zstdChunkedWriter) Write(p []byte) (int, error) {
}
}
-// zstdChunkedWriterWithLevel writes a zstd compressed tarball where each file is
+// makeZstdChunkedWriter writes a zstd compressed tarball where each file is
// compressed separately so it can be addressed separately. Idea based on CRFS:
// https://github.com/google/crfs
// The difference with CRFS is that the zstd compression is used instead of gzip.
@@ -469,12 +461,12 @@ func (w zstdChunkedWriter) Write(p []byte) (int, error) {
// [SKIPPABLE FRAME 1]: [ZSTD SKIPPABLE FRAME, SIZE=MANIFEST LENGTH][MANIFEST]
// [SKIPPABLE FRAME 2]: [ZSTD SKIPPABLE FRAME, SIZE=16][MANIFEST_OFFSET][MANIFEST_LENGTH][MANIFEST_LENGTH_UNCOMPRESSED][MANIFEST_TYPE][CHUNKED_ZSTD_MAGIC_NUMBER]
// MANIFEST_OFFSET, MANIFEST_LENGTH, MANIFEST_LENGTH_UNCOMPRESSED and CHUNKED_ZSTD_MAGIC_NUMBER are 64 bits unsigned in little endian format.
-func zstdChunkedWriterWithLevel(out io.Writer, metadata map[string]string, level int) (io.WriteCloser, error) {
+func makeZstdChunkedWriter(out io.Writer, metadata map[string]string, createZstdWriter minimal.CreateZstdWriterFunc) (io.WriteCloser, error) {
ch := make(chan error, 1)
r, w := io.Pipe()
go func() {
- ch <- writeZstdChunkedStream(out, metadata, r, level)
+ ch <- writeZstdChunkedStream(out, metadata, r, createZstdWriter)
_, _ = io.Copy(io.Discard, r) // Ordinarily writeZstdChunkedStream consumes all of r. If it fails, ensure the write end never blocks and eventually terminates.
r.Close()
close(ch)
@@ -493,5 +485,40 @@ func ZstdCompressor(r io.Writer, metadata map[string]string, level *int) (io.Wri
level = &l
}
- return zstdChunkedWriterWithLevel(r, metadata, *level)
+ createZstdWriter := func(dest io.Writer) (minimal.ZstdWriter, error) {
+ return minimal.ZstdWriterWithLevel(dest, *level)
+ }
+
+ return makeZstdChunkedWriter(r, metadata, createZstdWriter)
+}
+
+type noCompression struct {
+ dest io.Writer
+}
+
+func (n *noCompression) Write(p []byte) (int, error) {
+ return n.dest.Write(p)
+}
+
+func (n *noCompression) Close() error {
+ return nil
+}
+
+func (n *noCompression) Flush() error {
+ return nil
+}
+
+func (n *noCompression) Reset(dest io.Writer) {
+ n.dest = dest
+}
+
+// NoCompression writes directly to the output file without any compression
+//
+// Such an output does not follow the zstd:chunked spec and cannot be generally consumed; this function
+// only exists for internal purposes and should not be called from outside c/storage.
+func NoCompression(r io.Writer, metadata map[string]string) (io.WriteCloser, error) {
+ createZstdWriter := func(dest io.Writer) (minimal.ZstdWriter, error) {
+ return &noCompression{dest: dest}, nil
+ }
+ return makeZstdChunkedWriter(r, metadata, createZstdWriter)
}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/chunked/internal/minimal/compression.go b/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/chunked/internal/minimal/compression.go
index f85c5973c..4191524cc 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/chunked/internal/minimal/compression.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/chunked/internal/minimal/compression.go
@@ -20,6 +20,15 @@ import (
"github.com/vbatts/tar-split/archive/tar"
)
+// ZstdWriter is an interface that wraps standard io.WriteCloser and Reset() to reuse the compressor with a new writer.
+type ZstdWriter interface {
+ io.WriteCloser
+ Reset(dest io.Writer)
+}
+
+// CreateZstdWriterFunc is a function that creates a ZstdWriter for the provided destination writer.
+type CreateZstdWriterFunc func(dest io.Writer) (ZstdWriter, error)
+
// TOC is short for Table of Contents and is used by the zstd:chunked
// file format to effectively add an overall index into the contents
// of a tarball; it also includes file metadata.
@@ -179,7 +188,7 @@ type TarSplitData struct {
UncompressedSize int64
}
-func WriteZstdChunkedManifest(dest io.Writer, outMetadata map[string]string, offset uint64, tarSplitData *TarSplitData, metadata []FileMetadata, level int) error {
+func WriteZstdChunkedManifest(dest io.Writer, outMetadata map[string]string, offset uint64, tarSplitData *TarSplitData, metadata []FileMetadata, createZstdWriter CreateZstdWriterFunc) error {
// 8 is the size of the zstd skippable frame header + the frame size
const zstdSkippableFrameHeader = 8
manifestOffset := offset + zstdSkippableFrameHeader
@@ -198,7 +207,7 @@ func WriteZstdChunkedManifest(dest io.Writer, outMetadata map[string]string, off
}
var compressedBuffer bytes.Buffer
- zstdWriter, err := ZstdWriterWithLevel(&compressedBuffer, level)
+ zstdWriter, err := createZstdWriter(&compressedBuffer)
if err != nil {
return err
}
@@ -244,7 +253,7 @@ func WriteZstdChunkedManifest(dest io.Writer, outMetadata map[string]string, off
return appendZstdSkippableFrame(dest, manifestDataLE)
}
-func ZstdWriterWithLevel(dest io.Writer, level int) (*zstd.Encoder, error) {
+func ZstdWriterWithLevel(dest io.Writer, level int) (ZstdWriter, error) {
el := zstd.EncoderLevelFromZstd(level)
return zstd.NewWriter(dest, zstd.WithEncoderLevel(el))
}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/lockfile/lockfile.go b/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/lockfile/lockfile.go
index 52f6c0a62..dfe81c245 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/lockfile/lockfile.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/lockfile/lockfile.go
@@ -6,6 +6,8 @@ import (
"path/filepath"
"sync"
"time"
+
+ "github.com/containers/storage/internal/rawfilelock"
)
// A Locker represents a file lock where the file is used to cache an
@@ -55,13 +57,6 @@ type Locker interface {
AssertLockedForWriting()
}
-type lockType byte
-
-const (
- readLock lockType = iota
- writeLock
-)
-
// LockFile represents a file lock where the file is used to cache an
// identifier of the last party that made changes to whatever's being protected
// by the lock.
@@ -79,12 +74,12 @@ type LockFile struct {
stateMutex *sync.Mutex
counter int64
lw LastWrite // A global value valid as of the last .Touch() or .Modified()
- lockType lockType
+ lockType rawfilelock.LockType
locked bool
// The following fields are only modified on transitions between counter == 0 / counter != 0.
// Thus, they can be safely accessed by users _that currently hold the LockFile_ without locking.
// In other cases, they need to be protected using stateMutex.
- fd fileHandle
+ fd rawfilelock.FileHandle
}
var (
@@ -129,12 +124,12 @@ func (l *LockFile) Lock() {
if l.ro {
panic("can't take write lock on read-only lock file")
}
- l.lock(writeLock)
+ l.lock(rawfilelock.WriteLock)
}
// RLock locks the lockfile as a reader.
func (l *LockFile) RLock() {
- l.lock(readLock)
+ l.lock(rawfilelock.ReadLock)
}
// TryLock attempts to lock the lockfile as a writer. Panic if the lock is a read-only one.
@@ -142,12 +137,12 @@ func (l *LockFile) TryLock() error {
if l.ro {
panic("can't take write lock on read-only lock file")
}
- return l.tryLock(writeLock)
+ return l.tryLock(rawfilelock.WriteLock)
}
// TryRLock attempts to lock the lockfile as a reader.
func (l *LockFile) TryRLock() error {
- return l.tryLock(readLock)
+ return l.tryLock(rawfilelock.ReadLock)
}
// Unlock unlocks the lockfile.
@@ -172,9 +167,9 @@ func (l *LockFile) Unlock() {
l.locked = false
// Close the file descriptor on the last unlock, releasing the
// file lock.
- unlockAndCloseHandle(l.fd)
+ rawfilelock.UnlockAndCloseHandle(l.fd)
}
- if l.lockType == readLock {
+ if l.lockType == rawfilelock.ReadLock {
l.rwMutex.RUnlock()
} else {
l.rwMutex.Unlock()
@@ -206,7 +201,7 @@ func (l *LockFile) AssertLockedForWriting() {
l.AssertLocked()
// Like AssertLocked, don’t even bother with l.stateMutex.
- if l.lockType == readLock {
+ if l.lockType == rawfilelock.ReadLock {
panic("internal error: lock is not held for writing")
}
}
@@ -273,7 +268,7 @@ func (l *LockFile) Touch() error {
return err
}
l.stateMutex.Lock()
- if !l.locked || (l.lockType == readLock) {
+ if !l.locked || (l.lockType == rawfilelock.ReadLock) {
panic("attempted to update last-writer in lockfile without the write lock")
}
defer l.stateMutex.Unlock()
@@ -324,6 +319,24 @@ func getLockfile(path string, ro bool) (*LockFile, error) {
return lockFile, nil
}
+// openLock opens a lock file at the specified path, creating the parent directory if it does not exist.
+func openLock(path string, readOnly bool) (rawfilelock.FileHandle, error) {
+ fd, err := rawfilelock.OpenLock(path, readOnly)
+ if err == nil {
+ return fd, nil
+ }
+
+ // the directory of the lockfile seems to be removed, try to create it
+ if os.IsNotExist(err) {
+ if err := os.MkdirAll(filepath.Dir(path), 0o700); err != nil {
+ return fd, fmt.Errorf("creating lock file directory: %w", err)
+ }
+
+ return openLock(path, readOnly)
+ }
+ return fd, &os.PathError{Op: "open", Path: path, Err: err}
+}
+
// createLockFileForPath returns new *LockFile object, possibly (depending on the platform)
// working inter-process and associated with the specified path.
//
@@ -343,11 +356,11 @@ func createLockFileForPath(path string, ro bool) (*LockFile, error) {
if err != nil {
return nil, err
}
- unlockAndCloseHandle(fd)
+ rawfilelock.UnlockAndCloseHandle(fd)
- lType := writeLock
+ lType := rawfilelock.WriteLock
if ro {
- lType = readLock
+ lType = rawfilelock.ReadLock
}
return &LockFile{
@@ -362,40 +375,10 @@ func createLockFileForPath(path string, ro bool) (*LockFile, error) {
}, nil
}
-// openLock opens the file at path and returns the corresponding file
-// descriptor. The path is opened either read-only or read-write,
-// depending on the value of ro argument.
-//
-// openLock will create the file and its parent directories,
-// if necessary.
-func openLock(path string, ro bool) (fd fileHandle, err error) {
- flags := os.O_CREATE
- if ro {
- flags |= os.O_RDONLY
- } else {
- flags |= os.O_RDWR
- }
- fd, err = openHandle(path, flags)
- if err == nil {
- return fd, nil
- }
-
- // the directory of the lockfile seems to be removed, try to create it
- if os.IsNotExist(err) {
- if err := os.MkdirAll(filepath.Dir(path), 0o700); err != nil {
- return fd, fmt.Errorf("creating lock file directory: %w", err)
- }
-
- return openLock(path, ro)
- }
-
- return fd, &os.PathError{Op: "open", Path: path, Err: err}
-}
-
// lock locks the lockfile via syscall based on the specified type and
// command.
-func (l *LockFile) lock(lType lockType) {
- if lType == readLock {
+func (l *LockFile) lock(lType rawfilelock.LockType) {
+ if lType == rawfilelock.ReadLock {
l.rwMutex.RLock()
} else {
l.rwMutex.Lock()
@@ -413,7 +396,7 @@ func (l *LockFile) lock(lType lockType) {
// Optimization: only use the (expensive) syscall when
// the counter is 0. In this case, we're either the first
// reader lock or a writer lock.
- if err := lockHandle(l.fd, lType, false); err != nil {
+ if err := rawfilelock.LockFile(l.fd, lType); err != nil {
panic(err)
}
}
@@ -424,10 +407,10 @@ func (l *LockFile) lock(lType lockType) {
// lock locks the lockfile via syscall based on the specified type and
// command.
-func (l *LockFile) tryLock(lType lockType) error {
+func (l *LockFile) tryLock(lType rawfilelock.LockType) error {
var success bool
var rwMutexUnlocker func()
- if lType == readLock {
+ if lType == rawfilelock.ReadLock {
success = l.rwMutex.TryRLock()
rwMutexUnlocker = l.rwMutex.RUnlock
} else {
@@ -451,8 +434,8 @@ func (l *LockFile) tryLock(lType lockType) error {
// Optimization: only use the (expensive) syscall when
// the counter is 0. In this case, we're either the first
// reader lock or a writer lock.
- if err = lockHandle(l.fd, lType, true); err != nil {
- closeHandle(fd)
+ if err = rawfilelock.TryLockFile(l.fd, lType); err != nil {
+ rawfilelock.CloseHandle(fd)
rwMutexUnlocker()
return err
}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/lockfile/lockfile_unix.go b/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/lockfile/lockfile_unix.go
index 885f2f88a..14c27c51f 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/lockfile/lockfile_unix.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/lockfile/lockfile_unix.go
@@ -9,8 +9,6 @@ import (
"golang.org/x/sys/unix"
)
-type fileHandle uintptr
-
// GetLastWrite returns a LastWrite value corresponding to current state of the lock.
// This is typically called before (_not after_) loading the state when initializing a consumer
// of the data protected by the lock.
@@ -66,41 +64,3 @@ func (l *LockFile) TouchedSince(when time.Time) bool {
touched := time.Unix(mtim.Unix())
return when.Before(touched)
}
-
-func openHandle(path string, mode int) (fileHandle, error) {
- mode |= unix.O_CLOEXEC
- fd, err := unix.Open(path, mode, 0o644)
- return fileHandle(fd), err
-}
-
-func lockHandle(fd fileHandle, lType lockType, nonblocking bool) error {
- fType := unix.F_RDLCK
- if lType != readLock {
- fType = unix.F_WRLCK
- }
- lk := unix.Flock_t{
- Type: int16(fType),
- Whence: int16(unix.SEEK_SET),
- Start: 0,
- Len: 0,
- }
- cmd := unix.F_SETLKW
- if nonblocking {
- cmd = unix.F_SETLK
- }
- for {
- err := unix.FcntlFlock(uintptr(fd), cmd, &lk)
- if err == nil || nonblocking {
- return err
- }
- time.Sleep(10 * time.Millisecond)
- }
-}
-
-func unlockAndCloseHandle(fd fileHandle) {
- unix.Close(int(fd))
-}
-
-func closeHandle(fd fileHandle) {
- unix.Close(int(fd))
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/lockfile/lockfile_windows.go b/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/lockfile/lockfile_windows.go
index 0cc1c50cc..e66f7bfbb 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/lockfile/lockfile_windows.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/containers/storage/pkg/lockfile/lockfile_windows.go
@@ -14,8 +14,6 @@ const (
allBytes = ^uint32(0)
)
-type fileHandle windows.Handle
-
// GetLastWrite returns a LastWrite value corresponding to current state of the lock.
// This is typically called before (_not after_) loading the state when initializing a consumer
// of the data protected by the lock.
@@ -73,37 +71,3 @@ func (l *LockFile) TouchedSince(when time.Time) bool {
}
return when.Before(stat.ModTime())
}
-
-func openHandle(path string, mode int) (fileHandle, error) {
- mode |= windows.O_CLOEXEC
- fd, err := windows.Open(path, mode, windows.S_IWRITE)
- return fileHandle(fd), err
-}
-
-func lockHandle(fd fileHandle, lType lockType, nonblocking bool) error {
- flags := 0
- if lType != readLock {
- flags = windows.LOCKFILE_EXCLUSIVE_LOCK
- }
- if nonblocking {
- flags |= windows.LOCKFILE_FAIL_IMMEDIATELY
- }
- ol := new(windows.Overlapped)
- if err := windows.LockFileEx(windows.Handle(fd), uint32(flags), reserved, allBytes, allBytes, ol); err != nil {
- if nonblocking {
- return err
- }
- panic(err)
- }
- return nil
-}
-
-func unlockAndCloseHandle(fd fileHandle) {
- ol := new(windows.Overlapped)
- windows.UnlockFileEx(windows.Handle(fd), reserved, allBytes, allBytes, ol)
- closeHandle(fd)
-}
-
-func closeHandle(fd fileHandle) {
- windows.Close(windows.Handle(fd))
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/README.md b/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/README.md
index da9f9e6f0..d072b81c7 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/README.md
+++ b/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/README.md
@@ -4,7 +4,7 @@
CBOR is a [trusted alternative](https://www.rfc-editor.org/rfc/rfc8949.html#name-comparison-of-other-binary-) to JSON, MessagePack, Protocol Buffers, etc. CBOR is an Internet Standard defined by [IETF STD 94 (RFC 8949)](https://www.rfc-editor.org/info/std94) and is designed to be relevant for decades.
-`fxamacker/cbor` is used in projects by Arm Ltd., Cisco, EdgeX Foundry, Flow Foundation, Fraunhofer‑AISEC, Kubernetes, Let's Encrypt (ISRG), Linux Foundation, Microsoft, Mozilla, Oasis Protocol, Tailscale, Teleport, [etc](https://github.com/fxamacker/cbor#who-uses-fxamackercbor).
+`fxamacker/cbor` is used in projects by Arm Ltd., EdgeX Foundry, Flow Foundation, Fraunhofer‑AISEC, IBM, Kubernetes[*](https://github.com/search?q=org%3Akubernetes%20fxamacker%2Fcbor&type=code), Let's Encrypt, Linux Foundation, Microsoft, Oasis Protocol, Red Hat[*](https://github.com/search?q=org%3Aopenshift+fxamacker%2Fcbor&type=code), Tailscale[*](https://github.com/search?q=org%3Atailscale+fxamacker%2Fcbor&type=code), Veraison[*](https://github.com/search?q=org%3Averaison+fxamacker%2Fcbor&type=code), [etc](https://github.com/fxamacker/cbor#who-uses-fxamackercbor).
See [Quick Start](#quick-start) and [Releases](https://github.com/fxamacker/cbor/releases/). 🆕 `UnmarshalFirst` and `DiagnoseFirst` can decode CBOR Sequences. `MarshalToBuffer` and `UserBufferEncMode` accepts user-specified buffer.
@@ -39,7 +39,7 @@ Codec passed multiple confidential security assessments in 2022. No vulnerabili
__🗜️ Data Size__
-Struct tag options (`toarray`, `keyasint`, `omitempty`, `omitzero`) automatically reduce size of encoded structs. Encoding optionally shrinks float64→32→16 when values fit.
+Struct tag options (`toarray`, `keyasint`, `omitempty`, `omitzero`) and field tag "-" automatically reduce size of encoded structs. Encoding optionally shrinks float64→32→16 when values fit.
__:jigsaw: Usability__
@@ -146,8 +146,12 @@ Struct tags automatically reduce encoded size of structs and improve speed.
We can write less code by using struct tag options:
- `toarray`: encode without field names (decode back to original struct)
- `keyasint`: encode field names as integers (decode back to original struct)
-- `omitempty`: omit empty fields when encoding
-- `omitzero`: omit zero-value fields when encoding
+- `omitempty`: omit empty field when encoding
+- `omitzero`: omit zero-value field when encoding
+
+As a special case, struct field tag "-" omits the field.
+
+NOTE: When a struct uses `toarray`, the encoder will ignore `omitempty` and `omitzero` to prevent position of encoded array elements from changing. This allows decoder to match encoded elements to their Go struct field.

@@ -353,6 +357,60 @@ err = em.MarshalToBuffer(v, &buf) // encode v to provided buf
Struct tag options (`toarray`, `keyasint`, `omitempty`, `omitzero`) reduce encoded size of structs.
+As a special case, struct field tag "-" omits the field.
+
+ 🔎 Example encoding with struct field tag "-"
+
+https://go.dev/play/p/aWEIFxd7InX
+
+```Go
+// https://github.com/fxamacker/cbor/issues/652
+package main
+
+import (
+ "encoding/json"
+ "fmt"
+
+ "github.com/fxamacker/cbor/v2"
+)
+
+// The `cbor:"-"` tag omits the Type field when encoding to CBOR.
+type Entity struct {
+ _ struct{} `cbor:",toarray"`
+ ID uint64 `json:"id"`
+ Type string `cbor:"-" json:"typeOf"`
+ Name string `json:"name"`
+}
+
+func main() {
+ entity := Entity{
+ ID: 1,
+ Type: "int64",
+ Name: "Identifier",
+ }
+
+ c, _ := cbor.Marshal(entity)
+ diag, _ := cbor.Diagnose(c)
+ fmt.Printf("CBOR in hex: %x\n", c)
+ fmt.Printf("CBOR in edn: %s\n", diag)
+
+ j, _ := json.Marshal(entity)
+ fmt.Printf("JSON: %s\n", string(j))
+
+ fmt.Printf("JSON encoding is %d bytes\n", len(j))
+ fmt.Printf("CBOR encoding is %d bytes\n", len(c))
+
+ // Output:
+ // CBOR in hex: 82016a4964656e746966696572
+ // CBOR in edn: [1, "Identifier"]
+ // JSON: {"id":1,"typeOf":"int64","name":"Identifier"}
+ // JSON encoding is 45 bytes
+ // CBOR encoding is 13 bytes
+}
+```
+
+
+
🔎 Example encoding 3-level nested Go struct to 1 byte CBOR
https://go.dev/play/p/YxwvfPdFQG2
@@ -476,6 +534,139 @@ if data, err := em.Marshal(v); err != nil {
+👉 `fxamacker/cbor` allows user apps to use almost any current or future CBOR tag number by implementing `cbor.Marshaler` and `cbor.Unmarshaler` interfaces.
+
+Basically, `MarshalCBOR` and `UnmarshalCBOR` functions can be implemented by user apps and those functions will automatically be called by this CBOR codec's `Marshal`, `Unmarshal`, etc.
+
+The following [example](https://github.com/fxamacker/cbor/blob/master/example_embedded_json_tag_for_cbor_test.go) shows how to encode and decode a tagged CBOR data item with tag number 262. The tag content is a JSON object "embedded" as a CBOR byte string (major type 2).
+
+ 🔎 Example using Embedded JSON Tag for CBOR (tag 262)
+
+```go
+// https://github.com/fxamacker/cbor/issues/657
+
+package cbor_test
+
+// NOTE: RFC 8949 does not mention tag number 262. IANA assigned
+// CBOR tag number 262 as "Embedded JSON Object" specified by the
+// document Embedded JSON Tag for CBOR:
+//
+// "Tag 262 can be applied to a byte string (major type 2) to indicate
+// that the byte string is a JSON Object. The length of the byte string
+// indicates the content."
+//
+// For more info, see Embedded JSON Tag for CBOR at:
+// https://github.com/toravir/CBOR-Tag-Specs/blob/master/embeddedJSON.md
+
+import (
+ "bytes"
+ "encoding/json"
+ "fmt"
+
+ "github.com/fxamacker/cbor/v2"
+)
+
+// cborTagNumForEmbeddedJSON is the CBOR tag number 262.
+const cborTagNumForEmbeddedJSON = 262
+
+// EmbeddedJSON represents a Go value to be encoded as a tagged CBOR data item
+// with tag number 262 and the tag content is a JSON object "embedded" as a
+// CBOR byte string (major type 2).
+type EmbeddedJSON struct {
+ any
+}
+
+func NewEmbeddedJSON(val any) EmbeddedJSON {
+ return EmbeddedJSON{val}
+}
+
+// MarshalCBOR encodes EmbeddedJSON to a tagged CBOR data item with the
+// tag number 262 and the tag content is a JSON object that is
+// "embedded" as a CBOR byte string.
+func (v EmbeddedJSON) MarshalCBOR() ([]byte, error) {
+ // Encode v to JSON object.
+ data, err := json.Marshal(v)
+ if err != nil {
+ return nil, err
+ }
+
+ // Create cbor.Tag representing a tagged CBOR data item.
+ tag := cbor.Tag{
+ Number: cborTagNumForEmbeddedJSON,
+ Content: data,
+ }
+
+ // Marshal to a tagged CBOR data item.
+ return cbor.Marshal(tag)
+}
+
+// UnmarshalCBOR decodes a tagged CBOR data item to EmbeddedJSON.
+// The byte slice provided to this function must contain a single
+// tagged CBOR data item with the tag number 262 and tag content
+// must be a JSON object "embedded" as a CBOR byte string.
+func (v *EmbeddedJSON) UnmarshalCBOR(b []byte) error {
+ // Unmarshal tagged CBOR data item.
+ var tag cbor.Tag
+ if err := cbor.Unmarshal(b, &tag); err != nil {
+ return err
+ }
+
+ // Check tag number.
+ if tag.Number != cborTagNumForEmbeddedJSON {
+ return fmt.Errorf("got tag number %d, expect tag number %d", tag.Number, cborTagNumForEmbeddedJSON)
+ }
+
+ // Check tag content.
+ jsonData, isByteString := tag.Content.([]byte)
+ if !isByteString {
+ return fmt.Errorf("got tag content type %T, expect tag content []byte", tag.Content)
+ }
+
+ // Unmarshal JSON object.
+ return json.Unmarshal(jsonData, v)
+}
+
+// MarshalJSON encodes EmbeddedJSON to a JSON object.
+func (v EmbeddedJSON) MarshalJSON() ([]byte, error) {
+ return json.Marshal(v.any)
+}
+
+// UnmarshalJSON decodes a JSON object.
+func (v *EmbeddedJSON) UnmarshalJSON(b []byte) error {
+ dec := json.NewDecoder(bytes.NewReader(b))
+ dec.UseNumber()
+ return dec.Decode(&v.any)
+}
+
+func Example_embeddedJSONTagForCBOR() {
+ value := NewEmbeddedJSON(map[string]any{
+ "name": "gopher",
+ "id": json.Number("42"),
+ })
+
+ data, err := cbor.Marshal(value)
+ if err != nil {
+ panic(err)
+ }
+
+ fmt.Printf("cbor: %x\n", data)
+
+ var v EmbeddedJSON
+ err = cbor.Unmarshal(data, &v)
+ if err != nil {
+ panic(err)
+ }
+
+ fmt.Printf("%+v\n", v.any)
+ for k, v := range v.any.(map[string]any) {
+ fmt.Printf(" %s: %v (%T)\n", k, v, v)
+ }
+}
+```
+
+
+
+
### Functions and Interfaces
🔎 Functions and interfaces at a glance
@@ -492,7 +683,7 @@ because RFC 8949 treats CBOR data item with remaining bytes as malformed.
Other useful functions:
- `Diagnose`, `DiagnoseFirst` produce human-readable [Extended Diagnostic Notation](https://www.rfc-editor.org/rfc/rfc8610.html#appendix-G) from CBOR data.
- `UnmarshalFirst` decodes first CBOR data item and return any remaining bytes.
-- `Wellformed` returns true if the the CBOR data item is well-formed.
+- `Wellformed` returns true if the CBOR data item is well-formed.
Interfaces identical or comparable to Go `encoding` packages include:
`Marshaler`, `Unmarshaler`, `BinaryMarshaler`, and `BinaryUnmarshaler`.
@@ -511,28 +702,28 @@ Default limits may need to be increased for systems handling very large data (e.
## Status
-v2.8.0 (March 30, 2025) is a small release primarily to add `omitzero` option to struct field tags and fix bugs. It passed fuzz tests (billions of executions) and is production quality.
-
-v2.8.0 and v2.7.1 fixes these 3 functions (when called directly by user apps) to use same error handling on bad inputs as `cbor.Unmarshal()`:
-- `ByteString.UnmarshalCBOR()`
-- `RawTag.UnmarshalCBOR()`
-- `SimpleValue.UnmarshalCBOR()`
+[v2.9.0](https://github.com/fxamacker/cbor/releases/tag/v2.9.0) (Jul 13, 2025) improved interoperability/transcoding between CBOR & JSON, refactored tests, and improved docs.
+- Add opt-in support for `encoding.TextMarshaler` and `encoding.TextUnmarshaler` to encode and decode from CBOR text string.
+- Add opt-in support for `json.Marshaler` and `json.Unmarshaler` via user-provided transcoding function.
+- Update docs for TimeMode, Tag, RawTag, and add example for Embedded JSON Tag for CBOR.
-The above 3 `UnmarshalCBOR()` functions were initially created for internal use and are deprecated now, so please use `Unmarshal()` or `UnmarshalFirst()` instead. To preserve backward compatibility, these deprecated functions were added to fuzz tests and will not be removed in v2.
+v2.9.0 passed fuzz tests and is production quality.
The minimum version of Go required to build:
-- v2.8.0 requires go 1.20.
-- v2.7.1 and older releases require go 1.17.
+- v2.8.0 and newer releases require go 1.20+.
+- v2.7.1 and older releases require go 1.17+.
For more details, see [release notes](https://github.com/fxamacker/cbor/releases).
### Prior Releases
-v2.7.0 (June 23, 2024) adds features and improvements that help large projects (e.g. Kubernetes) use CBOR as an alternative to JSON and Protocol Buffers. Other improvements include speedups, improved memory use, bug fixes, new serialization options, etc. It passed fuzz tests (5+ billion executions) and is production quality.
+[v2.8.0](https://github.com/fxamacker/cbor/releases/tag/v2.8.0) (March 30, 2025) is a small release primarily to add `omitzero` option to struct field tags and fix bugs. It passed fuzz tests (billions of executions) and is production quality.
+
+[v2.7.0](https://github.com/fxamacker/cbor/releases/tag/v2.7.0) (June 23, 2024) adds features and improvements that help large projects (e.g. Kubernetes) use CBOR as an alternative to JSON and Protocol Buffers. Other improvements include speedups, improved memory use, bug fixes, new serialization options, etc. It passed fuzz tests (5+ billion executions) and is production quality.
[v2.6.0](https://github.com/fxamacker/cbor/releases/tag/v2.6.0) (February 2024) adds important new features, optimizations, and bug fixes. It is especially useful to systems that need to convert data between CBOR and JSON. New options and optimizations improve handling of bignum, integers, maps, and strings.
-v2.5.0 was released on Sunday, August 13, 2023 with new features and important bug fixes. It is fuzz tested and production quality after extended beta [v2.5.0-beta](https://github.com/fxamacker/cbor/releases/tag/v2.5.0-beta) (Dec 2022) -> [v2.5.0](https://github.com/fxamacker/cbor/releases/tag/v2.5.0) (Aug 2023).
+[v2.5.0](https://github.com/fxamacker/cbor/releases/tag/v2.5.0) was released on Sunday, August 13, 2023 with new features and important bug fixes. It is fuzz tested and production quality after extended beta [v2.5.0-beta](https://github.com/fxamacker/cbor/releases/tag/v2.5.0-beta) (Dec 2022) -> [v2.5.0](https://github.com/fxamacker/cbor/releases/tag/v2.5.0) (Aug 2023).
__IMPORTANT__: 👉 Before upgrading from v2.4 or older release, please read the notable changes highlighted in the release notes. v2.5.0 is a large release with bug fixes to error handling for extraneous data in `Unmarshal`, etc. that should be reviewed before upgrading.
@@ -601,9 +792,9 @@ geomean 2.782
## Who uses fxamacker/cbor
-`fxamacker/cbor` is used in projects by Arm Ltd., Berlin Institute of Health at Charité, Chainlink, Cisco, Confidential Computing Consortium, ConsenSys, EdgeX Foundry, F5, Flow Foundation, Fraunhofer‑AISEC, IBM, Kubernetes, Let's Encrypt (ISRG), Linux Foundation, Matrix.org, Microsoft, Mozilla, National Cybersecurity Agency of France (govt), Netherlands (govt), Oasis Protocol, Smallstep, Tailscale, Taurus SA, Teleport, TIBCO, and others.
+`fxamacker/cbor` is used in projects by Arm Ltd., Berlin Institute of Health at Charité, Chainlink, Confidential Computing Consortium, ConsenSys, EdgeX Foundry, F5, Flow Foundation, Fraunhofer‑AISEC, IBM, Kubernetes, Let's Encrypt (ISRG), Linaro, Linux Foundation, Matrix.org, Microsoft, National Cybersecurity Agency of France (govt), Netherlands (govt), Oasis Protocol, Red Hat OpenShift, Smallstep, Tailscale, Taurus SA, TIBCO, Veraison, and others.
-`fxamacker/cbor` passed multiple confidential security assessments. A [nonconfidential security assessment](https://github.com/veraison/go-cose/blob/v1.0.0-rc.1/reports/NCC_Microsoft-go-cose-Report_2022-05-26_v1.0.pdf) (prepared by NCC Group for Microsoft Corporation) includes a subset of fxamacker/cbor v2.4.0 in its scope.
+`fxamacker/cbor` passed multiple confidential security assessments in 2022. A [nonconfidential security assessment](https://github.com/veraison/go-cose/blob/v1.0.0-rc.1/reports/NCC_Microsoft-go-cose-Report_2022-05-26_v1.0.pdf) (prepared by NCC Group for Microsoft Corporation) assessed a subset of fxamacker/cbor v2.4.
## Standards
diff --git a/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/cache.go b/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/cache.go
index 0d96b9882..5051f110f 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/cache.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/cache.go
@@ -37,6 +37,7 @@ const (
specialTypeIface
specialTypeTag
specialTypeTime
+ specialTypeJSONUnmarshalerIface
)
type typeInfo struct {
@@ -75,6 +76,8 @@ func newTypeInfo(t reflect.Type) *typeInfo {
tInfo.spclType = specialTypeUnexportedUnmarshalerIface
} else if reflect.PointerTo(t).Implements(typeUnmarshaler) {
tInfo.spclType = specialTypeUnmarshalerIface
+ } else if reflect.PointerTo(t).Implements(typeJSONUnmarshaler) {
+ tInfo.spclType = specialTypeJSONUnmarshalerIface
}
switch k {
diff --git a/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/common.go b/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/common.go
index ec038a49e..9cf33cd20 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/common.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/common.go
@@ -5,6 +5,7 @@ package cbor
import (
"fmt"
+ "io"
"strconv"
)
@@ -180,3 +181,11 @@ func validBuiltinTag(tagNum uint64, contentHead byte) error {
return nil
}
+
+// Transcoder is a scheme for transcoding a single CBOR encoded data item to or from a different
+// data format.
+type Transcoder interface {
+ // Transcode reads the data item in its source format from a Reader and writes a
+ // corresponding representation in its destination format to a Writer.
+ Transcode(dst io.Writer, src io.Reader) error
+}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/decode.go b/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/decode.go
index 3c1c168f3..f0bdc3b38 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/decode.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/decode.go
@@ -4,6 +4,7 @@
package cbor
import (
+ "bytes"
"encoding"
"encoding/base64"
"encoding/binary"
@@ -94,7 +95,7 @@ import (
//
// To unmarshal CBOR null (0xf6) and undefined (0xf7) values into a
// slice/map/pointer, Unmarshal sets Go value to nil. Because null is often
-// used to mean "not present", unmarshalling CBOR null and undefined value
+// used to mean "not present", unmarshaling CBOR null and undefined value
// into any other Go type has no effect and returns no error.
//
// Unmarshal supports CBOR tag 55799 (self-describe CBOR), tag 0 and 1 (time),
@@ -202,7 +203,7 @@ type DupMapKeyError struct {
}
func (e *DupMapKeyError) Error() string {
- return fmt.Sprintf("cbor: found duplicate map key \"%v\" at map element index %d", e.Key, e.Index)
+ return fmt.Sprintf("cbor: found duplicate map key %#v at map element index %d", e.Key, e.Index)
}
// UnknownFieldError describes detected unknown field in CBOR map when decoding to Go struct.
@@ -387,7 +388,7 @@ const (
// - return UnmarshalTypeError if value doesn't fit into int64
IntDecConvertSignedOrFail
- // IntDecConvertSigned affects how CBOR integers (major type 0 and 1) decode to Go interface{}.
+ // IntDecConvertSignedOrBigInt affects how CBOR integers (major type 0 and 1) decode to Go interface{}.
// It makes CBOR integers (major type 0 and 1) decode to:
// - int64 if value fits
// - big.Int or *big.Int (see BigIntDecMode) if value doesn't fit into int64
@@ -493,11 +494,11 @@ type BigIntDecMode int
const (
// BigIntDecodeValue makes CBOR bignum decode to big.Int (instead of *big.Int)
- // when unmarshalling into a Go interface{}.
+ // when unmarshaling into a Go interface{}.
BigIntDecodeValue BigIntDecMode = iota
// BigIntDecodePointer makes CBOR bignum decode to *big.Int when
- // unmarshalling into a Go interface{}.
+ // unmarshaling into a Go interface{}.
BigIntDecodePointer
maxBigIntDecMode
@@ -749,6 +750,25 @@ func (bum BinaryUnmarshalerMode) valid() bool {
return bum >= 0 && bum < maxBinaryUnmarshalerMode
}
+// TextUnmarshalerMode specifies how to decode into types that implement
+// encoding.TextUnmarshaler.
+type TextUnmarshalerMode int
+
+const (
+ // TextUnmarshalerNone does not recognize TextUnmarshaler implementations during decode.
+ TextUnmarshalerNone TextUnmarshalerMode = iota
+
+ // TextUnmarshalerTextString will invoke UnmarshalText on the contents of a CBOR text
+ // string when decoding into a value that implements TextUnmarshaler.
+ TextUnmarshalerTextString
+
+ maxTextUnmarshalerMode
+)
+
+func (tum TextUnmarshalerMode) valid() bool {
+ return tum >= 0 && tum < maxTextUnmarshalerMode
+}
+
// DecOptions specifies decoding options.
type DecOptions struct {
// DupMapKey specifies whether to enforce duplicate map key.
@@ -797,7 +817,7 @@ type DecOptions struct {
// TagsMd specifies whether to allow CBOR tags (major type 6).
TagsMd TagsMode
- // IntDec specifies which Go integer type (int64 or uint64) to use
+ // IntDec specifies which Go integer type (int64, uint64, or [big.Int]) to use
// when decoding CBOR int (major type 0 and 1) to Go interface{}.
IntDec IntDecMode
@@ -811,7 +831,7 @@ type DecOptions struct {
ExtraReturnErrors ExtraDecErrorCond
// DefaultMapType specifies Go map type to create and decode to
- // when unmarshalling CBOR into an empty interface value.
+ // when unmarshaling CBOR into an empty interface value.
// By default, unmarshal uses map[interface{}]interface{}.
DefaultMapType reflect.Type
@@ -883,6 +903,15 @@ type DecOptions struct {
// BinaryUnmarshaler specifies how to decode into types that implement
// encoding.BinaryUnmarshaler.
BinaryUnmarshaler BinaryUnmarshalerMode
+
+ // TextUnmarshaler specifies how to decode into types that implement
+ // encoding.TextUnmarshaler.
+ TextUnmarshaler TextUnmarshalerMode
+
+ // JSONUnmarshalerTranscoder sets the transcoding scheme used to unmarshal types that
+ // implement json.Unmarshaler but do not also implement cbor.Unmarshaler. If nil, decoding
+ // behavior is not influenced by whether or not a type implements json.Unmarshaler.
+ JSONUnmarshalerTranscoder Transcoder
}
// DecMode returns DecMode with immutable options and no tags (safe for concurrency).
@@ -1095,33 +1124,39 @@ func (opts DecOptions) decMode() (*decMode, error) { //nolint:gocritic // ignore
return nil, errors.New("cbor: invalid BinaryUnmarshaler " + strconv.Itoa(int(opts.BinaryUnmarshaler)))
}
+ if !opts.TextUnmarshaler.valid() {
+ return nil, errors.New("cbor: invalid TextUnmarshaler " + strconv.Itoa(int(opts.TextUnmarshaler)))
+ }
+
dm := decMode{
- dupMapKey: opts.DupMapKey,
- timeTag: opts.TimeTag,
- maxNestedLevels: opts.MaxNestedLevels,
- maxArrayElements: opts.MaxArrayElements,
- maxMapPairs: opts.MaxMapPairs,
- indefLength: opts.IndefLength,
- tagsMd: opts.TagsMd,
- intDec: opts.IntDec,
- mapKeyByteString: opts.MapKeyByteString,
- extraReturnErrors: opts.ExtraReturnErrors,
- defaultMapType: opts.DefaultMapType,
- utf8: opts.UTF8,
- fieldNameMatching: opts.FieldNameMatching,
- bigIntDec: opts.BigIntDec,
- defaultByteStringType: opts.DefaultByteStringType,
- byteStringToString: opts.ByteStringToString,
- fieldNameByteString: opts.FieldNameByteString,
- unrecognizedTagToAny: opts.UnrecognizedTagToAny,
- timeTagToAny: opts.TimeTagToAny,
- simpleValues: simpleValues,
- nanDec: opts.NaN,
- infDec: opts.Inf,
- byteStringToTime: opts.ByteStringToTime,
- byteStringExpectedFormat: opts.ByteStringExpectedFormat,
- bignumTag: opts.BignumTag,
- binaryUnmarshaler: opts.BinaryUnmarshaler,
+ dupMapKey: opts.DupMapKey,
+ timeTag: opts.TimeTag,
+ maxNestedLevels: opts.MaxNestedLevels,
+ maxArrayElements: opts.MaxArrayElements,
+ maxMapPairs: opts.MaxMapPairs,
+ indefLength: opts.IndefLength,
+ tagsMd: opts.TagsMd,
+ intDec: opts.IntDec,
+ mapKeyByteString: opts.MapKeyByteString,
+ extraReturnErrors: opts.ExtraReturnErrors,
+ defaultMapType: opts.DefaultMapType,
+ utf8: opts.UTF8,
+ fieldNameMatching: opts.FieldNameMatching,
+ bigIntDec: opts.BigIntDec,
+ defaultByteStringType: opts.DefaultByteStringType,
+ byteStringToString: opts.ByteStringToString,
+ fieldNameByteString: opts.FieldNameByteString,
+ unrecognizedTagToAny: opts.UnrecognizedTagToAny,
+ timeTagToAny: opts.TimeTagToAny,
+ simpleValues: simpleValues,
+ nanDec: opts.NaN,
+ infDec: opts.Inf,
+ byteStringToTime: opts.ByteStringToTime,
+ byteStringExpectedFormat: opts.ByteStringExpectedFormat,
+ bignumTag: opts.BignumTag,
+ binaryUnmarshaler: opts.BinaryUnmarshaler,
+ textUnmarshaler: opts.TextUnmarshaler,
+ jsonUnmarshalerTranscoder: opts.JSONUnmarshalerTranscoder,
}
return &dm, nil
@@ -1174,33 +1209,35 @@ type DecMode interface {
}
type decMode struct {
- tags tagProvider
- dupMapKey DupMapKeyMode
- timeTag DecTagMode
- maxNestedLevels int
- maxArrayElements int
- maxMapPairs int
- indefLength IndefLengthMode
- tagsMd TagsMode
- intDec IntDecMode
- mapKeyByteString MapKeyByteStringMode
- extraReturnErrors ExtraDecErrorCond
- defaultMapType reflect.Type
- utf8 UTF8Mode
- fieldNameMatching FieldNameMatchingMode
- bigIntDec BigIntDecMode
- defaultByteStringType reflect.Type
- byteStringToString ByteStringToStringMode
- fieldNameByteString FieldNameByteStringMode
- unrecognizedTagToAny UnrecognizedTagToAnyMode
- timeTagToAny TimeTagToAnyMode
- simpleValues *SimpleValueRegistry
- nanDec NaNMode
- infDec InfMode
- byteStringToTime ByteStringToTimeMode
- byteStringExpectedFormat ByteStringExpectedFormatMode
- bignumTag BignumTagMode
- binaryUnmarshaler BinaryUnmarshalerMode
+ tags tagProvider
+ dupMapKey DupMapKeyMode
+ timeTag DecTagMode
+ maxNestedLevels int
+ maxArrayElements int
+ maxMapPairs int
+ indefLength IndefLengthMode
+ tagsMd TagsMode
+ intDec IntDecMode
+ mapKeyByteString MapKeyByteStringMode
+ extraReturnErrors ExtraDecErrorCond
+ defaultMapType reflect.Type
+ utf8 UTF8Mode
+ fieldNameMatching FieldNameMatchingMode
+ bigIntDec BigIntDecMode
+ defaultByteStringType reflect.Type
+ byteStringToString ByteStringToStringMode
+ fieldNameByteString FieldNameByteStringMode
+ unrecognizedTagToAny UnrecognizedTagToAnyMode
+ timeTagToAny TimeTagToAnyMode
+ simpleValues *SimpleValueRegistry
+ nanDec NaNMode
+ infDec InfMode
+ byteStringToTime ByteStringToTimeMode
+ byteStringExpectedFormat ByteStringExpectedFormatMode
+ bignumTag BignumTagMode
+ binaryUnmarshaler BinaryUnmarshalerMode
+ textUnmarshaler TextUnmarshalerMode
+ jsonUnmarshalerTranscoder Transcoder
}
var defaultDecMode, _ = DecOptions{}.decMode()
@@ -1215,32 +1252,34 @@ func (dm *decMode) DecOptions() DecOptions {
}
return DecOptions{
- DupMapKey: dm.dupMapKey,
- TimeTag: dm.timeTag,
- MaxNestedLevels: dm.maxNestedLevels,
- MaxArrayElements: dm.maxArrayElements,
- MaxMapPairs: dm.maxMapPairs,
- IndefLength: dm.indefLength,
- TagsMd: dm.tagsMd,
- IntDec: dm.intDec,
- MapKeyByteString: dm.mapKeyByteString,
- ExtraReturnErrors: dm.extraReturnErrors,
- DefaultMapType: dm.defaultMapType,
- UTF8: dm.utf8,
- FieldNameMatching: dm.fieldNameMatching,
- BigIntDec: dm.bigIntDec,
- DefaultByteStringType: dm.defaultByteStringType,
- ByteStringToString: dm.byteStringToString,
- FieldNameByteString: dm.fieldNameByteString,
- UnrecognizedTagToAny: dm.unrecognizedTagToAny,
- TimeTagToAny: dm.timeTagToAny,
- SimpleValues: simpleValues,
- NaN: dm.nanDec,
- Inf: dm.infDec,
- ByteStringToTime: dm.byteStringToTime,
- ByteStringExpectedFormat: dm.byteStringExpectedFormat,
- BignumTag: dm.bignumTag,
- BinaryUnmarshaler: dm.binaryUnmarshaler,
+ DupMapKey: dm.dupMapKey,
+ TimeTag: dm.timeTag,
+ MaxNestedLevels: dm.maxNestedLevels,
+ MaxArrayElements: dm.maxArrayElements,
+ MaxMapPairs: dm.maxMapPairs,
+ IndefLength: dm.indefLength,
+ TagsMd: dm.tagsMd,
+ IntDec: dm.intDec,
+ MapKeyByteString: dm.mapKeyByteString,
+ ExtraReturnErrors: dm.extraReturnErrors,
+ DefaultMapType: dm.defaultMapType,
+ UTF8: dm.utf8,
+ FieldNameMatching: dm.fieldNameMatching,
+ BigIntDec: dm.bigIntDec,
+ DefaultByteStringType: dm.defaultByteStringType,
+ ByteStringToString: dm.byteStringToString,
+ FieldNameByteString: dm.fieldNameByteString,
+ UnrecognizedTagToAny: dm.unrecognizedTagToAny,
+ TimeTagToAny: dm.timeTagToAny,
+ SimpleValues: simpleValues,
+ NaN: dm.nanDec,
+ Inf: dm.infDec,
+ ByteStringToTime: dm.byteStringToTime,
+ ByteStringExpectedFormat: dm.byteStringExpectedFormat,
+ BignumTag: dm.bignumTag,
+ BinaryUnmarshaler: dm.binaryUnmarshaler,
+ TextUnmarshaler: dm.textUnmarshaler,
+ JSONUnmarshalerTranscoder: dm.jsonUnmarshalerTranscoder,
}
}
@@ -1367,7 +1406,7 @@ func (d *decoder) parseToValue(v reflect.Value, tInfo *typeInfo) error { //nolin
// Decode CBOR nil or CBOR undefined to pointer value by setting pointer value to nil.
if d.nextCBORNil() && v.Kind() == reflect.Pointer {
d.skip()
- v.Set(reflect.Zero(v.Type()))
+ v.SetZero()
return nil
}
@@ -1467,6 +1506,14 @@ func (d *decoder) parseToValue(v reflect.Value, tInfo *typeInfo) error { //nolin
case specialTypeUnexportedUnmarshalerIface:
return d.parseToUnexportedUnmarshaler(v)
+
+ case specialTypeJSONUnmarshalerIface:
+ // This special type implies that the type does not also implement
+ // cbor.Umarshaler.
+ if d.dm.jsonUnmarshalerTranscoder == nil {
+ break
+ }
+ return d.parseToJSONUnmarshaler(v)
}
}
@@ -1523,14 +1570,14 @@ func (d *decoder) parseToValue(v reflect.Value, tInfo *typeInfo) error { //nolin
return err
}
copied = copied || converted
- return fillByteString(t, b, !copied, v, d.dm.byteStringToString, d.dm.binaryUnmarshaler)
+ return fillByteString(t, b, !copied, v, d.dm.byteStringToString, d.dm.binaryUnmarshaler, d.dm.textUnmarshaler)
case cborTypeTextString:
b, err := d.parseTextString()
if err != nil {
return err
}
- return fillTextString(t, b, v)
+ return fillTextString(t, b, v, d.dm.textUnmarshaler)
case cborTypePrimitives:
_, ai, val := d.getHead()
@@ -1582,7 +1629,7 @@ func (d *decoder) parseToValue(v reflect.Value, tInfo *typeInfo) error { //nolin
return nil
}
if tInfo.nonPtrKind == reflect.Slice || tInfo.nonPtrKind == reflect.Array {
- return fillByteString(t, b, !copied, v, ByteStringToStringForbidden, d.dm.binaryUnmarshaler)
+ return fillByteString(t, b, !copied, v, ByteStringToStringForbidden, d.dm.binaryUnmarshaler, d.dm.textUnmarshaler)
}
if bi.IsUint64() {
return fillPositiveInt(t, bi.Uint64(), v)
@@ -1605,7 +1652,7 @@ func (d *decoder) parseToValue(v reflect.Value, tInfo *typeInfo) error { //nolin
return nil
}
if tInfo.nonPtrKind == reflect.Slice || tInfo.nonPtrKind == reflect.Array {
- return fillByteString(t, b, !copied, v, ByteStringToStringForbidden, d.dm.binaryUnmarshaler)
+ return fillByteString(t, b, !copied, v, ByteStringToStringForbidden, d.dm.binaryUnmarshaler, d.dm.textUnmarshaler)
}
if bi.IsInt64() {
return fillNegativeInt(t, bi.Int64(), v)
@@ -1832,6 +1879,32 @@ func (d *decoder) parseToUnexportedUnmarshaler(v reflect.Value) error {
return errors.New("cbor: failed to assert " + v.Type().String() + " as cbor.unmarshaler")
}
+// parseToJSONUnmarshaler parses CBOR data to be transcoded to JSON and passed to the value's
+// implementation of the json.Unmarshaler interface. It assumes data is well-formed, and does not
+// perform bounds checking.
+func (d *decoder) parseToJSONUnmarshaler(v reflect.Value) error {
+ if d.nextCBORNil() && v.Kind() == reflect.Pointer && v.IsNil() {
+ d.skip()
+ return nil
+ }
+
+ if v.Kind() != reflect.Pointer && v.CanAddr() {
+ v = v.Addr()
+ }
+ if u, ok := v.Interface().(jsonUnmarshaler); ok {
+ start := d.off
+ d.skip()
+ e := getEncodeBuffer()
+ defer putEncodeBuffer(e)
+ if err := d.dm.jsonUnmarshalerTranscoder.Transcode(e, bytes.NewReader(d.data[start:d.off])); err != nil {
+ return &TranscodeError{err: err, rtype: v.Type(), sourceFormat: "cbor", targetFormat: "json"}
+ }
+ return u.UnmarshalJSON(e.Bytes())
+ }
+ d.skip()
+ return errors.New("cbor: failed to assert " + v.Type().String() + " as json.Unmarshaler")
+}
+
// parse parses CBOR data and returns value in default Go type.
// It assumes data is well-formed, and does not perform bounds checking.
func (d *decoder) parse(skipSelfDescribedTag bool) (any, error) { //nolint:gocyclo
@@ -2317,9 +2390,8 @@ func (d *decoder) parseArrayToArray(v reflect.Value, tInfo *typeInfo) error {
}
// Set remaining Go array elements to zero values.
if gi < vLen {
- zeroV := reflect.Zero(tInfo.elemTypeInfo.typ)
for ; gi < vLen; gi++ {
- v.Index(gi).Set(zeroV)
+ v.Index(gi).SetZero()
}
}
return err
@@ -2403,7 +2475,7 @@ func (d *decoder) parseMapToMap(v reflect.Value, tInfo *typeInfo) error { //noli
}
keyType, eleType := tInfo.keyTypeInfo.typ, tInfo.elemTypeInfo.typ
reuseKey, reuseEle := isImmutableKind(tInfo.keyTypeInfo.kind), isImmutableKind(tInfo.elemTypeInfo.kind)
- var keyValue, eleValue, zeroKeyValue, zeroEleValue reflect.Value
+ var keyValue, eleValue reflect.Value
keyIsInterfaceType := keyType == typeIntf // If key type is interface{}, need to check if key value is hashable.
var err, lastErr error
keyCount := v.Len()
@@ -2422,10 +2494,7 @@ func (d *decoder) parseMapToMap(v reflect.Value, tInfo *typeInfo) error { //noli
if !keyValue.IsValid() {
keyValue = reflect.New(keyType).Elem()
} else if !reuseKey {
- if !zeroKeyValue.IsValid() {
- zeroKeyValue = reflect.Zero(keyType)
- }
- keyValue.Set(zeroKeyValue)
+ keyValue.SetZero()
}
if lastErr = d.parseToValue(keyValue, tInfo.keyTypeInfo); lastErr != nil {
if err == nil {
@@ -2460,10 +2529,7 @@ func (d *decoder) parseMapToMap(v reflect.Value, tInfo *typeInfo) error { //noli
if !eleValue.IsValid() {
eleValue = reflect.New(eleType).Elem()
} else if !reuseEle {
- if !zeroEleValue.IsValid() {
- zeroEleValue = reflect.Zero(eleType)
- }
- eleValue.Set(zeroEleValue)
+ eleValue.SetZero()
}
if lastErr := d.parseToValue(eleValue, tInfo.elemTypeInfo); lastErr != nil {
if err == nil {
@@ -2995,6 +3061,8 @@ func (d *decoder) nextCBORNil() bool {
return d.data[d.off] == 0xf6 || d.data[d.off] == 0xf7
}
+type jsonUnmarshaler interface{ UnmarshalJSON([]byte) error }
+
var (
typeIntf = reflect.TypeOf([]any(nil)).Elem()
typeTime = reflect.TypeOf(time.Time{})
@@ -3002,6 +3070,8 @@ var (
typeUnmarshaler = reflect.TypeOf((*Unmarshaler)(nil)).Elem()
typeUnexportedUnmarshaler = reflect.TypeOf((*unmarshaler)(nil)).Elem()
typeBinaryUnmarshaler = reflect.TypeOf((*encoding.BinaryUnmarshaler)(nil)).Elem()
+ typeTextUnmarshaler = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem()
+ typeJSONUnmarshaler = reflect.TypeOf((*jsonUnmarshaler)(nil)).Elem()
typeString = reflect.TypeOf("")
typeByteSlice = reflect.TypeOf([]byte(nil))
)
@@ -3009,7 +3079,7 @@ var (
func fillNil(_ cborType, v reflect.Value) error {
switch v.Kind() {
case reflect.Slice, reflect.Map, reflect.Interface, reflect.Pointer:
- v.Set(reflect.Zero(v.Type()))
+ v.SetZero()
return nil
}
return nil
@@ -3110,7 +3180,7 @@ func fillFloat(t cborType, val float64, v reflect.Value) error {
return &UnmarshalTypeError{CBORType: t.String(), GoType: v.Type().String()}
}
-func fillByteString(t cborType, val []byte, shared bool, v reflect.Value, bsts ByteStringToStringMode, bum BinaryUnmarshalerMode) error {
+func fillByteString(t cborType, val []byte, shared bool, v reflect.Value, bsts ByteStringToStringMode, bum BinaryUnmarshalerMode, tum TextUnmarshalerMode) error {
if bum == BinaryUnmarshalerByteString && reflect.PointerTo(v.Type()).Implements(typeBinaryUnmarshaler) {
if v.CanAddr() {
v = v.Addr()
@@ -3123,9 +3193,26 @@ func fillByteString(t cborType, val []byte, shared bool, v reflect.Value, bsts B
}
return errors.New("cbor: cannot set new value for " + v.Type().String())
}
- if bsts != ByteStringToStringForbidden && v.Kind() == reflect.String {
- v.SetString(string(val))
- return nil
+ if bsts != ByteStringToStringForbidden {
+ if tum == TextUnmarshalerTextString && reflect.PointerTo(v.Type()).Implements(typeTextUnmarshaler) {
+ if v.CanAddr() {
+ v = v.Addr()
+ if u, ok := v.Interface().(encoding.TextUnmarshaler); ok {
+ // The contract of TextUnmarshaler forbids retaining the input
+ // bytes, so no copying is required even if val is shared.
+ if err := u.UnmarshalText(val); err != nil {
+ return fmt.Errorf("cbor: cannot unmarshal text for %s: %w", v.Type(), err)
+ }
+ return nil
+ }
+ }
+ return errors.New("cbor: cannot set new value for " + v.Type().String())
+ }
+
+ if v.Kind() == reflect.String {
+ v.SetString(string(val))
+ return nil
+ }
}
if v.Kind() == reflect.Slice && v.Type().Elem().Kind() == reflect.Uint8 {
src := val
@@ -3145,9 +3232,8 @@ func fillByteString(t cborType, val []byte, shared bool, v reflect.Value, bsts B
}
// Set remaining Go array elements to zero values.
if i < vLen {
- zeroV := reflect.Zero(reflect.TypeOf(byte(0)))
for ; i < vLen; i++ {
- v.Index(i).Set(zeroV)
+ v.Index(i).SetZero()
}
}
return nil
@@ -3155,11 +3241,28 @@ func fillByteString(t cborType, val []byte, shared bool, v reflect.Value, bsts B
return &UnmarshalTypeError{CBORType: t.String(), GoType: v.Type().String()}
}
-func fillTextString(t cborType, val []byte, v reflect.Value) error {
+func fillTextString(t cborType, val []byte, v reflect.Value, tum TextUnmarshalerMode) error {
+ // Check if the value implements TextUnmarshaler and the mode allows it
+ if tum == TextUnmarshalerTextString && reflect.PointerTo(v.Type()).Implements(typeTextUnmarshaler) {
+ if v.CanAddr() {
+ v = v.Addr()
+ if u, ok := v.Interface().(encoding.TextUnmarshaler); ok {
+ // The contract of TextUnmarshaler forbids retaining the input
+ // bytes, so no copying is required even if val is shared.
+ if err := u.UnmarshalText(val); err != nil {
+ return fmt.Errorf("cbor: cannot unmarshal text for %s: %w", v.Type(), err)
+ }
+ return nil
+ }
+ }
+ return errors.New("cbor: cannot set new value for " + v.Type().String())
+ }
+
if v.Kind() == reflect.String {
v.SetString(string(val))
return nil
}
+
return &UnmarshalTypeError{CBORType: t.String(), GoType: v.Type().String()}
}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/encode.go b/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/encode.go
index a3f999221..c550617c3 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/encode.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/encode.go
@@ -132,6 +132,20 @@ func (e *MarshalerError) Unwrap() error {
return e.err
}
+type TranscodeError struct {
+ err error
+ rtype reflect.Type
+ sourceFormat, targetFormat string
+}
+
+func (e TranscodeError) Error() string {
+ return "cbor: cannot transcode from " + e.sourceFormat + " to " + e.targetFormat + ": " + e.err.Error()
+}
+
+func (e TranscodeError) Unwrap() error {
+ return e.err
+}
+
// UnsupportedTypeError is returned by Marshal when attempting to encode value
// of an unsupported type.
type UnsupportedTypeError struct {
@@ -293,24 +307,51 @@ func (icm InfConvertMode) valid() bool {
return icm >= 0 && icm < maxInfConvert
}
-// TimeMode specifies how to encode time.Time values.
+// TimeMode specifies how to encode time.Time values in compliance with RFC 8949 (CBOR):
+// - Section 3.4.1: Standard Date/Time String
+// - Section 3.4.2: Epoch-Based Date/Time
+// For more info, see:
+// - https://www.rfc-editor.org/rfc/rfc8949.html
+// NOTE: User applications that prefer to encode time with fractional seconds to an integer
+// (instead of floating point or text string) can use a CBOR tag number not assigned by IANA:
+// 1. Define a user-defined type in Go with just a time.Time or int64 as its data.
+// 2. Implement the cbor.Marshaler and cbor.Unmarshaler interface for that user-defined type
+// to encode or decode the tagged data item with an enclosed integer content.
type TimeMode int
const (
- // TimeUnix causes time.Time to be encoded as epoch time in integer with second precision.
+ // TimeUnix causes time.Time to encode to a CBOR time (tag 1) with an integer content
+ // representing seconds elapsed (with 1-second precision) since UNIX Epoch UTC.
+ // The TimeUnix option is location independent and has a clear precision guarantee.
TimeUnix TimeMode = iota
- // TimeUnixMicro causes time.Time to be encoded as epoch time in float-point rounded to microsecond precision.
+ // TimeUnixMicro causes time.Time to encode to a CBOR time (tag 1) with a floating point content
+ // representing seconds elapsed (with up to 1-microsecond precision) since UNIX Epoch UTC.
+ // NOTE: The floating point content is encoded to the shortest floating-point encoding that preserves
+ // the 64-bit floating point value. I.e., the floating point encoding can be IEEE 764:
+ // binary64, binary32, or binary16 depending on the content's value.
TimeUnixMicro
- // TimeUnixDynamic causes time.Time to be encoded as integer if time.Time doesn't have fractional seconds,
- // otherwise float-point rounded to microsecond precision.
+ // TimeUnixDynamic causes time.Time to encode to a CBOR time (tag 1) with either an integer content or
+ // a floating point content, depending on the content's value. This option is equivalent to dynamically
+ // choosing TimeUnix if time.Time doesn't have fractional seconds, and using TimeUnixMicro if time.Time
+ // has fractional seconds.
TimeUnixDynamic
- // TimeRFC3339 causes time.Time to be encoded as RFC3339 formatted string with second precision.
+ // TimeRFC3339 causes time.Time to encode to a CBOR time (tag 0) with a text string content
+ // representing the time using 1-second precision in RFC3339 format. If the time.Time has a
+ // non-UTC timezone then a "localtime - UTC" numeric offset will be included as specified in RFC3339.
+ // NOTE: User applications can avoid including the RFC3339 numeric offset by:
+ // - providing a time.Time value set to UTC, or
+ // - using the TimeUnix, TimeUnixMicro, or TimeUnixDynamic option instead of TimeRFC3339.
TimeRFC3339
- // TimeRFC3339Nano causes time.Time to be encoded as RFC3339 formatted string with nanosecond precision.
+ // TimeRFC3339Nano causes time.Time to encode to a CBOR time (tag 0) with a text string content
+ // representing the time using 1-nanosecond precision in RFC3339 format. If the time.Time has a
+ // non-UTC timezone then a "localtime - UTC" numeric offset will be included as specified in RFC3339.
+ // NOTE: User applications can avoid including the RFC3339 numeric offset by:
+ // - providing a time.Time value set to UTC, or
+ // - using the TimeUnix, TimeUnixMicro, or TimeUnixDynamic option instead of TimeRFC3339Nano.
TimeRFC3339Nano
maxTimeMode
@@ -483,6 +524,24 @@ func (bmm BinaryMarshalerMode) valid() bool {
return bmm >= 0 && bmm < maxBinaryMarshalerMode
}
+// TextMarshalerMode specifies how to encode types that implement encoding.TextMarshaler.
+type TextMarshalerMode int
+
+const (
+ // TextMarshalerNone does not recognize TextMarshaler implementations during encode.
+ // This is the default behavior.
+ TextMarshalerNone TextMarshalerMode = iota
+
+ // TextMarshalerTextString encodes the output of MarshalText to a CBOR text string.
+ TextMarshalerTextString
+
+ maxTextMarshalerMode
+)
+
+func (tmm TextMarshalerMode) valid() bool {
+ return tmm >= 0 && tmm < maxTextMarshalerMode
+}
+
// EncOptions specifies encoding options.
type EncOptions struct {
// Sort specifies sorting order.
@@ -540,6 +599,14 @@ type EncOptions struct {
// BinaryMarshaler specifies how to encode types that implement encoding.BinaryMarshaler.
BinaryMarshaler BinaryMarshalerMode
+
+ // TextMarshaler specifies how to encode types that implement encoding.TextMarshaler.
+ TextMarshaler TextMarshalerMode
+
+ // JSONMarshalerTranscoder sets the transcoding scheme used to marshal types that implement
+ // json.Marshaler but do not also implement cbor.Marshaler. If nil, encoding behavior is not
+ // influenced by whether or not a type implements json.Marshaler.
+ JSONMarshalerTranscoder Transcoder
}
// CanonicalEncOptions returns EncOptions for "Canonical CBOR" encoding,
@@ -750,6 +817,9 @@ func (opts EncOptions) encMode() (*encMode, error) { //nolint:gocritic // ignore
if !opts.BinaryMarshaler.valid() {
return nil, errors.New("cbor: invalid BinaryMarshaler " + strconv.Itoa(int(opts.BinaryMarshaler)))
}
+ if !opts.TextMarshaler.valid() {
+ return nil, errors.New("cbor: invalid TextMarshaler " + strconv.Itoa(int(opts.TextMarshaler)))
+ }
em := encMode{
sort: opts.Sort,
shortestFloat: opts.ShortestFloat,
@@ -769,6 +839,8 @@ func (opts EncOptions) encMode() (*encMode, error) { //nolint:gocritic // ignore
byteSliceLaterEncodingTag: byteSliceLaterEncodingTag,
byteArray: opts.ByteArray,
binaryMarshaler: opts.BinaryMarshaler,
+ textMarshaler: opts.TextMarshaler,
+ jsonMarshalerTranscoder: opts.JSONMarshalerTranscoder,
}
return &em, nil
}
@@ -814,6 +886,8 @@ type encMode struct {
byteSliceLaterEncodingTag uint64
byteArray ByteArrayMode
binaryMarshaler BinaryMarshalerMode
+ textMarshaler TextMarshalerMode
+ jsonMarshalerTranscoder Transcoder
}
var defaultEncMode, _ = EncOptions{}.encMode()
@@ -890,22 +964,24 @@ func getMarshalerDecMode(indefLength IndefLengthMode, tagsMd TagsMode) *decMode
// EncOptions returns user specified options used to create this EncMode.
func (em *encMode) EncOptions() EncOptions {
return EncOptions{
- Sort: em.sort,
- ShortestFloat: em.shortestFloat,
- NaNConvert: em.nanConvert,
- InfConvert: em.infConvert,
- BigIntConvert: em.bigIntConvert,
- Time: em.time,
- TimeTag: em.timeTag,
- IndefLength: em.indefLength,
- NilContainers: em.nilContainers,
- TagsMd: em.tagsMd,
- OmitEmpty: em.omitEmpty,
- String: em.stringType,
- FieldName: em.fieldName,
- ByteSliceLaterFormat: em.byteSliceLaterFormat,
- ByteArray: em.byteArray,
- BinaryMarshaler: em.binaryMarshaler,
+ Sort: em.sort,
+ ShortestFloat: em.shortestFloat,
+ NaNConvert: em.nanConvert,
+ InfConvert: em.infConvert,
+ BigIntConvert: em.bigIntConvert,
+ Time: em.time,
+ TimeTag: em.timeTag,
+ IndefLength: em.indefLength,
+ NilContainers: em.nilContainers,
+ TagsMd: em.tagsMd,
+ OmitEmpty: em.omitEmpty,
+ String: em.stringType,
+ FieldName: em.fieldName,
+ ByteSliceLaterFormat: em.byteSliceLaterFormat,
+ ByteArray: em.byteArray,
+ BinaryMarshaler: em.binaryMarshaler,
+ TextMarshaler: em.textMarshaler,
+ JSONMarshalerTranscoder: em.jsonMarshalerTranscoder,
}
}
@@ -1677,6 +1753,107 @@ func (bme binaryMarshalerEncoder) isEmpty(em *encMode, v reflect.Value) (bool, e
return len(data) == 0, nil
}
+type textMarshalerEncoder struct {
+ alternateEncode encodeFunc
+ alternateIsEmpty isEmptyFunc
+}
+
+func (tme textMarshalerEncoder) encode(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if em.textMarshaler == TextMarshalerNone {
+ return tme.alternateEncode(e, em, v)
+ }
+
+ vt := v.Type()
+ m, ok := v.Interface().(encoding.TextMarshaler)
+ if !ok {
+ pv := reflect.New(vt)
+ pv.Elem().Set(v)
+ m = pv.Interface().(encoding.TextMarshaler)
+ }
+ data, err := m.MarshalText()
+ if err != nil {
+ return fmt.Errorf("cbor: cannot marshal text for %s: %w", vt, err)
+ }
+ if b := em.encTagBytes(vt); b != nil {
+ e.Write(b)
+ }
+
+ encodeHead(e, byte(cborTypeTextString), uint64(len(data)))
+ e.Write(data)
+ return nil
+}
+
+func (tme textMarshalerEncoder) isEmpty(em *encMode, v reflect.Value) (bool, error) {
+ if em.textMarshaler == TextMarshalerNone {
+ return tme.alternateIsEmpty(em, v)
+ }
+
+ m, ok := v.Interface().(encoding.TextMarshaler)
+ if !ok {
+ pv := reflect.New(v.Type())
+ pv.Elem().Set(v)
+ m = pv.Interface().(encoding.TextMarshaler)
+ }
+ data, err := m.MarshalText()
+ if err != nil {
+ return false, fmt.Errorf("cbor: cannot marshal text for %s: %w", v.Type(), err)
+ }
+ return len(data) == 0, nil
+}
+
+type jsonMarshalerEncoder struct {
+ alternateEncode encodeFunc
+ alternateIsEmpty isEmptyFunc
+}
+
+func (jme jsonMarshalerEncoder) encode(e *bytes.Buffer, em *encMode, v reflect.Value) error {
+ if em.jsonMarshalerTranscoder == nil {
+ return jme.alternateEncode(e, em, v)
+ }
+
+ vt := v.Type()
+ m, ok := v.Interface().(jsonMarshaler)
+ if !ok {
+ pv := reflect.New(vt)
+ pv.Elem().Set(v)
+ m = pv.Interface().(jsonMarshaler)
+ }
+
+ json, err := m.MarshalJSON()
+ if err != nil {
+ return err
+ }
+
+ offset := e.Len()
+
+ if b := em.encTagBytes(vt); b != nil {
+ e.Write(b)
+ }
+
+ if err := em.jsonMarshalerTranscoder.Transcode(e, bytes.NewReader(json)); err != nil {
+ return &TranscodeError{err: err, rtype: vt, sourceFormat: "json", targetFormat: "cbor"}
+ }
+
+ // Validate that the transcode function has written exactly one well-formed data item.
+ d := decoder{data: e.Bytes()[offset:], dm: getMarshalerDecMode(em.indefLength, em.tagsMd)}
+ if err := d.wellformed(false, true); err != nil {
+ e.Truncate(offset)
+ return &TranscodeError{err: err, rtype: vt, sourceFormat: "json", targetFormat: "cbor"}
+ }
+
+ return nil
+}
+
+func (jme jsonMarshalerEncoder) isEmpty(em *encMode, v reflect.Value) (bool, error) {
+ if em.jsonMarshalerTranscoder == nil {
+ return jme.alternateIsEmpty(em, v)
+ }
+
+ // As with types implementing cbor.Marshaler, transcoded json.Marshaler values always encode
+ // as exactly one complete CBOR data item.
+ return false, nil
+}
+
func encodeMarshalerType(e *bytes.Buffer, em *encMode, v reflect.Value) error {
if em.tagsMd == TagsForbidden && v.Type() == typeRawTag {
return errors.New("cbor: cannot encode cbor.RawTag when TagsMd is TagsForbidden")
@@ -1780,9 +1957,13 @@ func encodeHead(e *bytes.Buffer, t byte, n uint64) int {
return headSize
}
+type jsonMarshaler interface{ MarshalJSON() ([]byte, error) }
+
var (
typeMarshaler = reflect.TypeOf((*Marshaler)(nil)).Elem()
typeBinaryMarshaler = reflect.TypeOf((*encoding.BinaryMarshaler)(nil)).Elem()
+ typeTextMarshaler = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem()
+ typeJSONMarshaler = reflect.TypeOf((*jsonMarshaler)(nil)).Elem()
typeRawMessage = reflect.TypeOf(RawMessage(nil))
typeByteString = reflect.TypeOf(ByteString(""))
)
@@ -1825,6 +2006,30 @@ func getEncodeFuncInternal(t reflect.Type) (ef encodeFunc, ief isEmptyFunc, izf
ief = bme.isEmpty
}()
}
+ if reflect.PointerTo(t).Implements(typeTextMarshaler) {
+ defer func() {
+ // capture encoding method used for modes that disable TextMarshaler
+ tme := textMarshalerEncoder{
+ alternateEncode: ef,
+ alternateIsEmpty: ief,
+ }
+ ef = tme.encode
+ ief = tme.isEmpty
+ }()
+ }
+ if reflect.PointerTo(t).Implements(typeJSONMarshaler) {
+ defer func() {
+ // capture encoding method used for modes that don't support transcoding
+ // from types that implement json.Marshaler.
+ jme := jsonMarshalerEncoder{
+ alternateEncode: ef,
+ alternateIsEmpty: ief,
+ }
+ ef = jme.encode
+ ief = jme.isEmpty
+ }()
+ }
+
switch k {
case reflect.Bool:
return encodeBool, isEmptyBool, getIsZeroFunc(t)
diff --git a/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/structfields.go b/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/structfields.go
index 593508d9c..cf0a922cd 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/structfields.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/structfields.go
@@ -239,8 +239,7 @@ func appendFields(
// a nonexportable anonymous field of struct type.
// Nonexportable anonymous field of struct type can contain exportable fields.
func isFieldExportable(f reflect.StructField, fk reflect.Kind) bool { //nolint:gocritic // ignore hugeParam
- exportable := f.PkgPath == ""
- return exportable || (f.Anonymous && fk == reflect.Struct)
+ return f.IsExported() || (f.Anonymous && fk == reflect.Struct)
}
type embeddedFieldNullPtrFunc func(reflect.Value) (reflect.Value, error)
diff --git a/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/tag.go b/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/tag.go
index 47bcca801..bd8b773f5 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/tag.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/fxamacker/cbor/v2/tag.go
@@ -10,22 +10,23 @@ import (
"sync"
)
-// Tag represents CBOR tag data, including tag number and unmarshaled tag content. Marshaling and
-// unmarshaling of tag content is subject to any encode and decode options that would apply to
-// enclosed data item if it were to appear outside of a tag.
+// Tag represents a tagged data item (CBOR major type 6), comprising a tag number and the unmarshaled tag content.
+// NOTE: The same encoding and decoding options that apply to untagged CBOR data items also applies to tag content
+// during encoding and decoding.
type Tag struct {
Number uint64
Content any
}
-// RawTag represents CBOR tag data, including tag number and raw tag content.
-// RawTag implements Unmarshaler and Marshaler interfaces.
+// RawTag represents a tagged data item (CBOR major type 6), comprising a tag number and the raw tag content.
+// The raw tag content (enclosed data item) is a CBOR-encoded data item.
+// RawTag can be used to delay decoding a CBOR data item or precompute encoding a CBOR data item.
type RawTag struct {
Number uint64
Content RawMessage
}
-// UnmarshalCBOR sets *t with tag number and raw tag content copied from data.
+// UnmarshalCBOR sets *t with the tag number and the raw tag content copied from data.
//
// Deprecated: No longer used by this codec; kept for compatibility
// with user apps that directly call this function.
@@ -49,7 +50,7 @@ func (t *RawTag) UnmarshalCBOR(data []byte) error {
return t.unmarshalCBOR(data)
}
-// unmarshalCBOR sets *t with tag number and raw tag content copied from data.
+// unmarshalCBOR sets *t with the tag number and the raw tag content copied from data.
// This function assumes data is well-formed, and does not perform bounds checking.
// This function is called by Unmarshal().
func (t *RawTag) unmarshalCBOR(data []byte) error {
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/.codecov.yml b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/.codecov.yml
deleted file mode 100644
index 841c4281e..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/.codecov.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-coverage:
- status:
- patch:
- default:
- target: 80%
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/.gitattributes b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/.gitattributes
deleted file mode 100644
index d020be8ea..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/.gitattributes
+++ /dev/null
@@ -1,2 +0,0 @@
-*.go text eol=lf
-
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/.gitignore b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/.gitignore
deleted file mode 100644
index 87c3bd3e6..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-secrets.yml
-coverage.out
-coverage.txt
-*.cov
-.idea
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/.golangci.yml b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/.golangci.yml
deleted file mode 100644
index 22f8d21cc..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/.golangci.yml
+++ /dev/null
@@ -1,61 +0,0 @@
-linters-settings:
- govet:
- check-shadowing: true
- golint:
- min-confidence: 0
- gocyclo:
- min-complexity: 45
- maligned:
- suggest-new: true
- dupl:
- threshold: 200
- goconst:
- min-len: 2
- min-occurrences: 3
-
-linters:
- enable-all: true
- disable:
- - maligned
- - unparam
- - lll
- - gochecknoinits
- - gochecknoglobals
- - funlen
- - godox
- - gocognit
- - whitespace
- - wsl
- - wrapcheck
- - testpackage
- - nlreturn
- - gomnd
- - exhaustivestruct
- - goerr113
- - errorlint
- - nestif
- - godot
- - gofumpt
- - paralleltest
- - tparallel
- - thelper
- - ifshort
- - exhaustruct
- - varnamelen
- - gci
- - depguard
- - errchkjson
- - inamedparam
- - nonamedreturns
- - musttag
- - ireturn
- - forcetypeassert
- - cyclop
- # deprecated linters
- - deadcode
- - interfacer
- - scopelint
- - varcheck
- - structcheck
- - golint
- - nosnakecase
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/CODE_OF_CONDUCT.md b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/CODE_OF_CONDUCT.md
deleted file mode 100644
index 9322b065e..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/CODE_OF_CONDUCT.md
+++ /dev/null
@@ -1,74 +0,0 @@
-# Contributor Covenant Code of Conduct
-
-## Our Pledge
-
-In the interest of fostering an open and welcoming environment, we as
-contributors and maintainers pledge to making participation in our project and
-our community a harassment-free experience for everyone, regardless of age, body
-size, disability, ethnicity, gender identity and expression, level of experience,
-nationality, personal appearance, race, religion, or sexual identity and
-orientation.
-
-## Our Standards
-
-Examples of behavior that contributes to creating a positive environment
-include:
-
-* Using welcoming and inclusive language
-* Being respectful of differing viewpoints and experiences
-* Gracefully accepting constructive criticism
-* Focusing on what is best for the community
-* Showing empathy towards other community members
-
-Examples of unacceptable behavior by participants include:
-
-* The use of sexualized language or imagery and unwelcome sexual attention or
-advances
-* Trolling, insulting/derogatory comments, and personal or political attacks
-* Public or private harassment
-* Publishing others' private information, such as a physical or electronic
- address, without explicit permission
-* Other conduct which could reasonably be considered inappropriate in a
- professional setting
-
-## Our Responsibilities
-
-Project maintainers are responsible for clarifying the standards of acceptable
-behavior and are expected to take appropriate and fair corrective action in
-response to any instances of unacceptable behavior.
-
-Project maintainers have the right and responsibility to remove, edit, or
-reject comments, commits, code, wiki edits, issues, and other contributions
-that are not aligned to this Code of Conduct, or to ban temporarily or
-permanently any contributor for other behaviors that they deem inappropriate,
-threatening, offensive, or harmful.
-
-## Scope
-
-This Code of Conduct applies both within project spaces and in public spaces
-when an individual is representing the project or its community. Examples of
-representing a project or community include using an official project e-mail
-address, posting via an official social media account, or acting as an appointed
-representative at an online or offline event. Representation of a project may be
-further defined and clarified by project maintainers.
-
-## Enforcement
-
-Instances of abusive, harassing, or otherwise unacceptable behavior may be
-reported by contacting the project team at ivan+abuse@flanders.co.nz. All
-complaints will be reviewed and investigated and will result in a response that
-is deemed necessary and appropriate to the circumstances. The project team is
-obligated to maintain confidentiality with regard to the reporter of an incident.
-Further details of specific enforcement policies may be posted separately.
-
-Project maintainers who do not follow or enforce the Code of Conduct in good
-faith may face temporary or permanent repercussions as determined by other
-members of the project's leadership.
-
-## Attribution
-
-This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
-available at [http://contributor-covenant.org/version/1/4][version]
-
-[homepage]: http://contributor-covenant.org
-[version]: http://contributor-covenant.org/version/1/4/
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/README.md b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/README.md
deleted file mode 100644
index e005d4b37..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/README.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# OpenAPI analysis [](https://github.com/go-openapi/analysis/actions?query=workflow%3A"go+test") [](https://codecov.io/gh/go-openapi/analysis)
-
-[](https://slackin.goswagger.io)
-[](https://raw.githubusercontent.com/go-openapi/analysis/master/LICENSE)
-[](https://pkg.go.dev/github.com/go-openapi/analysis)
-[](https://goreportcard.com/report/github.com/go-openapi/analysis)
-
-
-A foundational library to analyze an OAI specification document for easier reasoning about the content.
-
-## What's inside?
-
-* An analyzer providing methods to walk the functional content of a specification
-* A spec flattener producing a self-contained document bundle, while preserving `$ref`s
-* A spec merger ("mixin") to merge several spec documents into a primary spec
-* A spec "fixer" ensuring that response descriptions are non empty
-
-[Documentation](https://pkg.go.dev/github.com/go-openapi/analysis)
-
-## FAQ
-
-* Does this library support OpenAPI 3?
-
-> No.
-> This package currently only supports OpenAPI 2.0 (aka Swagger 2.0).
-> There is no plan to make it evolve toward supporting OpenAPI 3.x.
-> This [discussion thread](https://github.com/go-openapi/spec/issues/21) relates the full story.
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/analyzer.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/analyzer.go
deleted file mode 100644
index c17aee1b6..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/analyzer.go
+++ /dev/null
@@ -1,1064 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package analysis
-
-import (
- "fmt"
- slashpath "path"
- "strconv"
- "strings"
-
- "github.com/go-openapi/jsonpointer"
- "github.com/go-openapi/spec"
- "github.com/go-openapi/swag"
-)
-
-type referenceAnalysis struct {
- schemas map[string]spec.Ref
- responses map[string]spec.Ref
- parameters map[string]spec.Ref
- items map[string]spec.Ref
- headerItems map[string]spec.Ref
- parameterItems map[string]spec.Ref
- allRefs map[string]spec.Ref
- pathItems map[string]spec.Ref
-}
-
-func (r *referenceAnalysis) addRef(key string, ref spec.Ref) {
- r.allRefs["#"+key] = ref
-}
-
-func (r *referenceAnalysis) addItemsRef(key string, items *spec.Items, location string) {
- r.items["#"+key] = items.Ref
- r.addRef(key, items.Ref)
- if location == "header" {
- // NOTE: in swagger 2.0, headers and parameters (but not body param schemas) are simple schemas
- // and $ref are not supported here. However it is possible to analyze this.
- r.headerItems["#"+key] = items.Ref
- } else {
- r.parameterItems["#"+key] = items.Ref
- }
-}
-
-func (r *referenceAnalysis) addSchemaRef(key string, ref SchemaRef) {
- r.schemas["#"+key] = ref.Schema.Ref
- r.addRef(key, ref.Schema.Ref)
-}
-
-func (r *referenceAnalysis) addResponseRef(key string, resp *spec.Response) {
- r.responses["#"+key] = resp.Ref
- r.addRef(key, resp.Ref)
-}
-
-func (r *referenceAnalysis) addParamRef(key string, param *spec.Parameter) {
- r.parameters["#"+key] = param.Ref
- r.addRef(key, param.Ref)
-}
-
-func (r *referenceAnalysis) addPathItemRef(key string, pathItem *spec.PathItem) {
- r.pathItems["#"+key] = pathItem.Ref
- r.addRef(key, pathItem.Ref)
-}
-
-type patternAnalysis struct {
- parameters map[string]string
- headers map[string]string
- items map[string]string
- schemas map[string]string
- allPatterns map[string]string
-}
-
-func (p *patternAnalysis) addPattern(key, pattern string) {
- p.allPatterns["#"+key] = pattern
-}
-
-func (p *patternAnalysis) addParameterPattern(key, pattern string) {
- p.parameters["#"+key] = pattern
- p.addPattern(key, pattern)
-}
-
-func (p *patternAnalysis) addHeaderPattern(key, pattern string) {
- p.headers["#"+key] = pattern
- p.addPattern(key, pattern)
-}
-
-func (p *patternAnalysis) addItemsPattern(key, pattern string) {
- p.items["#"+key] = pattern
- p.addPattern(key, pattern)
-}
-
-func (p *patternAnalysis) addSchemaPattern(key, pattern string) {
- p.schemas["#"+key] = pattern
- p.addPattern(key, pattern)
-}
-
-type enumAnalysis struct {
- parameters map[string][]interface{}
- headers map[string][]interface{}
- items map[string][]interface{}
- schemas map[string][]interface{}
- allEnums map[string][]interface{}
-}
-
-func (p *enumAnalysis) addEnum(key string, enum []interface{}) {
- p.allEnums["#"+key] = enum
-}
-
-func (p *enumAnalysis) addParameterEnum(key string, enum []interface{}) {
- p.parameters["#"+key] = enum
- p.addEnum(key, enum)
-}
-
-func (p *enumAnalysis) addHeaderEnum(key string, enum []interface{}) {
- p.headers["#"+key] = enum
- p.addEnum(key, enum)
-}
-
-func (p *enumAnalysis) addItemsEnum(key string, enum []interface{}) {
- p.items["#"+key] = enum
- p.addEnum(key, enum)
-}
-
-func (p *enumAnalysis) addSchemaEnum(key string, enum []interface{}) {
- p.schemas["#"+key] = enum
- p.addEnum(key, enum)
-}
-
-// New takes a swagger spec object and returns an analyzed spec document.
-// The analyzed document contains a number of indices that make it easier to
-// reason about semantics of a swagger specification for use in code generation
-// or validation etc.
-func New(doc *spec.Swagger) *Spec {
- a := &Spec{
- spec: doc,
- references: referenceAnalysis{},
- patterns: patternAnalysis{},
- enums: enumAnalysis{},
- }
- a.reset()
- a.initialize()
-
- return a
-}
-
-// Spec is an analyzed specification object. It takes a swagger spec object and turns it into a registry
-// with a bunch of utility methods to act on the information in the spec.
-type Spec struct {
- spec *spec.Swagger
- consumes map[string]struct{}
- produces map[string]struct{}
- authSchemes map[string]struct{}
- operations map[string]map[string]*spec.Operation
- references referenceAnalysis
- patterns patternAnalysis
- enums enumAnalysis
- allSchemas map[string]SchemaRef
- allOfs map[string]SchemaRef
-}
-
-func (s *Spec) reset() {
- s.consumes = make(map[string]struct{}, 150)
- s.produces = make(map[string]struct{}, 150)
- s.authSchemes = make(map[string]struct{}, 150)
- s.operations = make(map[string]map[string]*spec.Operation, 150)
- s.allSchemas = make(map[string]SchemaRef, 150)
- s.allOfs = make(map[string]SchemaRef, 150)
- s.references.schemas = make(map[string]spec.Ref, 150)
- s.references.pathItems = make(map[string]spec.Ref, 150)
- s.references.responses = make(map[string]spec.Ref, 150)
- s.references.parameters = make(map[string]spec.Ref, 150)
- s.references.items = make(map[string]spec.Ref, 150)
- s.references.headerItems = make(map[string]spec.Ref, 150)
- s.references.parameterItems = make(map[string]spec.Ref, 150)
- s.references.allRefs = make(map[string]spec.Ref, 150)
- s.patterns.parameters = make(map[string]string, 150)
- s.patterns.headers = make(map[string]string, 150)
- s.patterns.items = make(map[string]string, 150)
- s.patterns.schemas = make(map[string]string, 150)
- s.patterns.allPatterns = make(map[string]string, 150)
- s.enums.parameters = make(map[string][]interface{}, 150)
- s.enums.headers = make(map[string][]interface{}, 150)
- s.enums.items = make(map[string][]interface{}, 150)
- s.enums.schemas = make(map[string][]interface{}, 150)
- s.enums.allEnums = make(map[string][]interface{}, 150)
-}
-
-func (s *Spec) reload() {
- s.reset()
- s.initialize()
-}
-
-func (s *Spec) initialize() {
- for _, c := range s.spec.Consumes {
- s.consumes[c] = struct{}{}
- }
- for _, c := range s.spec.Produces {
- s.produces[c] = struct{}{}
- }
- for _, ss := range s.spec.Security {
- for k := range ss {
- s.authSchemes[k] = struct{}{}
- }
- }
- for path, pathItem := range s.AllPaths() {
- s.analyzeOperations(path, &pathItem) //#nosec
- }
-
- for name, parameter := range s.spec.Parameters {
- refPref := slashpath.Join("/parameters", jsonpointer.Escape(name))
- if parameter.Items != nil {
- s.analyzeItems("items", parameter.Items, refPref, "parameter")
- }
- if parameter.In == "body" && parameter.Schema != nil {
- s.analyzeSchema("schema", parameter.Schema, refPref)
- }
- if parameter.Pattern != "" {
- s.patterns.addParameterPattern(refPref, parameter.Pattern)
- }
- if len(parameter.Enum) > 0 {
- s.enums.addParameterEnum(refPref, parameter.Enum)
- }
- }
-
- for name, response := range s.spec.Responses {
- refPref := slashpath.Join("/responses", jsonpointer.Escape(name))
- for k, v := range response.Headers {
- hRefPref := slashpath.Join(refPref, "headers", k)
- if v.Items != nil {
- s.analyzeItems("items", v.Items, hRefPref, "header")
- }
- if v.Pattern != "" {
- s.patterns.addHeaderPattern(hRefPref, v.Pattern)
- }
- if len(v.Enum) > 0 {
- s.enums.addHeaderEnum(hRefPref, v.Enum)
- }
- }
- if response.Schema != nil {
- s.analyzeSchema("schema", response.Schema, refPref)
- }
- }
-
- for name := range s.spec.Definitions {
- schema := s.spec.Definitions[name]
- s.analyzeSchema(name, &schema, "/definitions")
- }
- // TODO: after analyzing all things and flattening schemas etc
- // resolve all the collected references to their final representations
- // best put in a separate method because this could get expensive
-}
-
-func (s *Spec) analyzeOperations(path string, pi *spec.PathItem) {
- // TODO: resolve refs here?
- // Currently, operations declared via pathItem $ref are known only after expansion
- op := pi
- if pi.Ref.String() != "" {
- key := slashpath.Join("/paths", jsonpointer.Escape(path))
- s.references.addPathItemRef(key, pi)
- }
- s.analyzeOperation("GET", path, op.Get)
- s.analyzeOperation("PUT", path, op.Put)
- s.analyzeOperation("POST", path, op.Post)
- s.analyzeOperation("PATCH", path, op.Patch)
- s.analyzeOperation("DELETE", path, op.Delete)
- s.analyzeOperation("HEAD", path, op.Head)
- s.analyzeOperation("OPTIONS", path, op.Options)
- for i, param := range op.Parameters {
- refPref := slashpath.Join("/paths", jsonpointer.Escape(path), "parameters", strconv.Itoa(i))
- if param.Ref.String() != "" {
- s.references.addParamRef(refPref, ¶m) //#nosec
- }
- if param.Pattern != "" {
- s.patterns.addParameterPattern(refPref, param.Pattern)
- }
- if len(param.Enum) > 0 {
- s.enums.addParameterEnum(refPref, param.Enum)
- }
- if param.Items != nil {
- s.analyzeItems("items", param.Items, refPref, "parameter")
- }
- if param.Schema != nil {
- s.analyzeSchema("schema", param.Schema, refPref)
- }
- }
-}
-
-func (s *Spec) analyzeItems(name string, items *spec.Items, prefix, location string) {
- if items == nil {
- return
- }
- refPref := slashpath.Join(prefix, name)
- s.analyzeItems(name, items.Items, refPref, location)
- if items.Ref.String() != "" {
- s.references.addItemsRef(refPref, items, location)
- }
- if items.Pattern != "" {
- s.patterns.addItemsPattern(refPref, items.Pattern)
- }
- if len(items.Enum) > 0 {
- s.enums.addItemsEnum(refPref, items.Enum)
- }
-}
-
-func (s *Spec) analyzeParameter(prefix string, i int, param spec.Parameter) {
- refPref := slashpath.Join(prefix, "parameters", strconv.Itoa(i))
- if param.Ref.String() != "" {
- s.references.addParamRef(refPref, ¶m) //#nosec
- }
-
- if param.Pattern != "" {
- s.patterns.addParameterPattern(refPref, param.Pattern)
- }
-
- if len(param.Enum) > 0 {
- s.enums.addParameterEnum(refPref, param.Enum)
- }
-
- s.analyzeItems("items", param.Items, refPref, "parameter")
- if param.In == "body" && param.Schema != nil {
- s.analyzeSchema("schema", param.Schema, refPref)
- }
-}
-
-func (s *Spec) analyzeOperation(method, path string, op *spec.Operation) {
- if op == nil {
- return
- }
-
- for _, c := range op.Consumes {
- s.consumes[c] = struct{}{}
- }
-
- for _, c := range op.Produces {
- s.produces[c] = struct{}{}
- }
-
- for _, ss := range op.Security {
- for k := range ss {
- s.authSchemes[k] = struct{}{}
- }
- }
-
- if _, ok := s.operations[method]; !ok {
- s.operations[method] = make(map[string]*spec.Operation)
- }
-
- s.operations[method][path] = op
- prefix := slashpath.Join("/paths", jsonpointer.Escape(path), strings.ToLower(method))
- for i, param := range op.Parameters {
- s.analyzeParameter(prefix, i, param)
- }
-
- if op.Responses == nil {
- return
- }
-
- if op.Responses.Default != nil {
- s.analyzeDefaultResponse(prefix, op.Responses.Default)
- }
-
- for k, res := range op.Responses.StatusCodeResponses {
- s.analyzeResponse(prefix, k, res)
- }
-}
-
-func (s *Spec) analyzeDefaultResponse(prefix string, res *spec.Response) {
- refPref := slashpath.Join(prefix, "responses", "default")
- if res.Ref.String() != "" {
- s.references.addResponseRef(refPref, res)
- }
-
- for k, v := range res.Headers {
- hRefPref := slashpath.Join(refPref, "headers", k)
- s.analyzeItems("items", v.Items, hRefPref, "header")
- if v.Pattern != "" {
- s.patterns.addHeaderPattern(hRefPref, v.Pattern)
- }
- }
-
- if res.Schema != nil {
- s.analyzeSchema("schema", res.Schema, refPref)
- }
-}
-
-func (s *Spec) analyzeResponse(prefix string, k int, res spec.Response) {
- refPref := slashpath.Join(prefix, "responses", strconv.Itoa(k))
- if res.Ref.String() != "" {
- s.references.addResponseRef(refPref, &res) //#nosec
- }
-
- for k, v := range res.Headers {
- hRefPref := slashpath.Join(refPref, "headers", k)
- s.analyzeItems("items", v.Items, hRefPref, "header")
- if v.Pattern != "" {
- s.patterns.addHeaderPattern(hRefPref, v.Pattern)
- }
-
- if len(v.Enum) > 0 {
- s.enums.addHeaderEnum(hRefPref, v.Enum)
- }
- }
-
- if res.Schema != nil {
- s.analyzeSchema("schema", res.Schema, refPref)
- }
-}
-
-func (s *Spec) analyzeSchema(name string, schema *spec.Schema, prefix string) {
- refURI := slashpath.Join(prefix, jsonpointer.Escape(name))
- schRef := SchemaRef{
- Name: name,
- Schema: schema,
- Ref: spec.MustCreateRef("#" + refURI),
- TopLevel: prefix == "/definitions",
- }
-
- s.allSchemas["#"+refURI] = schRef
-
- if schema.Ref.String() != "" {
- s.references.addSchemaRef(refURI, schRef)
- }
-
- if schema.Pattern != "" {
- s.patterns.addSchemaPattern(refURI, schema.Pattern)
- }
-
- if len(schema.Enum) > 0 {
- s.enums.addSchemaEnum(refURI, schema.Enum)
- }
-
- for k, v := range schema.Definitions {
- v := v
- s.analyzeSchema(k, &v, slashpath.Join(refURI, "definitions"))
- }
-
- for k, v := range schema.Properties {
- v := v
- s.analyzeSchema(k, &v, slashpath.Join(refURI, "properties"))
- }
-
- for k, v := range schema.PatternProperties {
- v := v
- // NOTE: swagger 2.0 does not support PatternProperties.
- // However it is possible to analyze this in a schema
- s.analyzeSchema(k, &v, slashpath.Join(refURI, "patternProperties"))
- }
-
- for i := range schema.AllOf {
- v := &schema.AllOf[i]
- s.analyzeSchema(strconv.Itoa(i), v, slashpath.Join(refURI, "allOf"))
- }
-
- if len(schema.AllOf) > 0 {
- s.allOfs["#"+refURI] = schRef
- }
-
- for i := range schema.AnyOf {
- v := &schema.AnyOf[i]
- // NOTE: swagger 2.0 does not support anyOf constructs.
- // However it is possible to analyze this in a schema
- s.analyzeSchema(strconv.Itoa(i), v, slashpath.Join(refURI, "anyOf"))
- }
-
- for i := range schema.OneOf {
- v := &schema.OneOf[i]
- // NOTE: swagger 2.0 does not support oneOf constructs.
- // However it is possible to analyze this in a schema
- s.analyzeSchema(strconv.Itoa(i), v, slashpath.Join(refURI, "oneOf"))
- }
-
- if schema.Not != nil {
- // NOTE: swagger 2.0 does not support "not" constructs.
- // However it is possible to analyze this in a schema
- s.analyzeSchema("not", schema.Not, refURI)
- }
-
- if schema.AdditionalProperties != nil && schema.AdditionalProperties.Schema != nil {
- s.analyzeSchema("additionalProperties", schema.AdditionalProperties.Schema, refURI)
- }
-
- if schema.AdditionalItems != nil && schema.AdditionalItems.Schema != nil {
- // NOTE: swagger 2.0 does not support AdditionalItems.
- // However it is possible to analyze this in a schema
- s.analyzeSchema("additionalItems", schema.AdditionalItems.Schema, refURI)
- }
-
- if schema.Items != nil {
- if schema.Items.Schema != nil {
- s.analyzeSchema("items", schema.Items.Schema, refURI)
- }
-
- for i := range schema.Items.Schemas {
- sch := &schema.Items.Schemas[i]
- s.analyzeSchema(strconv.Itoa(i), sch, slashpath.Join(refURI, "items"))
- }
- }
-}
-
-// SecurityRequirement is a representation of a security requirement for an operation
-type SecurityRequirement struct {
- Name string
- Scopes []string
-}
-
-// SecurityRequirementsFor gets the security requirements for the operation
-func (s *Spec) SecurityRequirementsFor(operation *spec.Operation) [][]SecurityRequirement {
- if s.spec.Security == nil && operation.Security == nil {
- return nil
- }
-
- schemes := s.spec.Security
- if operation.Security != nil {
- schemes = operation.Security
- }
-
- result := [][]SecurityRequirement{}
- for _, scheme := range schemes {
- if len(scheme) == 0 {
- // append a zero object for anonymous
- result = append(result, []SecurityRequirement{{}})
-
- continue
- }
-
- var reqs []SecurityRequirement
- for k, v := range scheme {
- if v == nil {
- v = []string{}
- }
- reqs = append(reqs, SecurityRequirement{Name: k, Scopes: v})
- }
-
- result = append(result, reqs)
- }
-
- return result
-}
-
-// SecurityDefinitionsForRequirements gets the matching security definitions for a set of requirements
-func (s *Spec) SecurityDefinitionsForRequirements(requirements []SecurityRequirement) map[string]spec.SecurityScheme {
- result := make(map[string]spec.SecurityScheme)
-
- for _, v := range requirements {
- if definition, ok := s.spec.SecurityDefinitions[v.Name]; ok {
- if definition != nil {
- result[v.Name] = *definition
- }
- }
- }
-
- return result
-}
-
-// SecurityDefinitionsFor gets the matching security definitions for a set of requirements
-func (s *Spec) SecurityDefinitionsFor(operation *spec.Operation) map[string]spec.SecurityScheme {
- requirements := s.SecurityRequirementsFor(operation)
- if len(requirements) == 0 {
- return nil
- }
-
- result := make(map[string]spec.SecurityScheme)
- for _, reqs := range requirements {
- for _, v := range reqs {
- if v.Name == "" {
- // optional requirement
- continue
- }
-
- if _, ok := result[v.Name]; ok {
- // duplicate requirement
- continue
- }
-
- if definition, ok := s.spec.SecurityDefinitions[v.Name]; ok {
- if definition != nil {
- result[v.Name] = *definition
- }
- }
- }
- }
-
- return result
-}
-
-// ConsumesFor gets the mediatypes for the operation
-func (s *Spec) ConsumesFor(operation *spec.Operation) []string {
- if len(operation.Consumes) == 0 {
- cons := make(map[string]struct{}, len(s.spec.Consumes))
- for _, k := range s.spec.Consumes {
- cons[k] = struct{}{}
- }
-
- return s.structMapKeys(cons)
- }
-
- cons := make(map[string]struct{}, len(operation.Consumes))
- for _, c := range operation.Consumes {
- cons[c] = struct{}{}
- }
-
- return s.structMapKeys(cons)
-}
-
-// ProducesFor gets the mediatypes for the operation
-func (s *Spec) ProducesFor(operation *spec.Operation) []string {
- if len(operation.Produces) == 0 {
- prod := make(map[string]struct{}, len(s.spec.Produces))
- for _, k := range s.spec.Produces {
- prod[k] = struct{}{}
- }
-
- return s.structMapKeys(prod)
- }
-
- prod := make(map[string]struct{}, len(operation.Produces))
- for _, c := range operation.Produces {
- prod[c] = struct{}{}
- }
-
- return s.structMapKeys(prod)
-}
-
-func mapKeyFromParam(param *spec.Parameter) string {
- return fmt.Sprintf("%s#%s", param.In, fieldNameFromParam(param))
-}
-
-func fieldNameFromParam(param *spec.Parameter) string {
- // TODO: this should be x-go-name
- if nm, ok := param.Extensions.GetString("go-name"); ok {
- return nm
- }
-
- return swag.ToGoName(param.Name)
-}
-
-// ErrorOnParamFunc is a callback function to be invoked
-// whenever an error is encountered while resolving references
-// on parameters.
-//
-// This function takes as input the spec.Parameter which triggered the
-// error and the error itself.
-//
-// If the callback function returns false, the calling function should bail.
-//
-// If it returns true, the calling function should continue evaluating parameters.
-// A nil ErrorOnParamFunc must be evaluated as equivalent to panic().
-type ErrorOnParamFunc func(spec.Parameter, error) bool
-
-func (s *Spec) paramsAsMap(parameters []spec.Parameter, res map[string]spec.Parameter, callmeOnError ErrorOnParamFunc) {
- for _, param := range parameters {
- pr := param
- if pr.Ref.String() == "" {
- res[mapKeyFromParam(&pr)] = pr
-
- continue
- }
-
- // resolve $ref
- if callmeOnError == nil {
- callmeOnError = func(_ spec.Parameter, err error) bool {
- panic(err)
- }
- }
-
- obj, _, err := pr.Ref.GetPointer().Get(s.spec)
- if err != nil {
- if callmeOnError(param, fmt.Errorf("invalid reference: %q", pr.Ref.String())) {
- continue
- }
-
- break
- }
-
- objAsParam, ok := obj.(spec.Parameter)
- if !ok {
- if callmeOnError(param, fmt.Errorf("resolved reference is not a parameter: %q", pr.Ref.String())) {
- continue
- }
-
- break
- }
-
- pr = objAsParam
- res[mapKeyFromParam(&pr)] = pr
- }
-}
-
-// ParametersFor the specified operation id.
-//
-// Assumes parameters properly resolve references if any and that
-// such references actually resolve to a parameter object.
-// Otherwise, panics.
-func (s *Spec) ParametersFor(operationID string) []spec.Parameter {
- return s.SafeParametersFor(operationID, nil)
-}
-
-// SafeParametersFor the specified operation id.
-//
-// Does not assume parameters properly resolve references or that
-// such references actually resolve to a parameter object.
-//
-// Upon error, invoke a ErrorOnParamFunc callback with the erroneous
-// parameters. If the callback is set to nil, panics upon errors.
-func (s *Spec) SafeParametersFor(operationID string, callmeOnError ErrorOnParamFunc) []spec.Parameter {
- gatherParams := func(pi *spec.PathItem, op *spec.Operation) []spec.Parameter {
- bag := make(map[string]spec.Parameter)
- s.paramsAsMap(pi.Parameters, bag, callmeOnError)
- s.paramsAsMap(op.Parameters, bag, callmeOnError)
-
- var res []spec.Parameter
- for _, v := range bag {
- res = append(res, v)
- }
-
- return res
- }
-
- for _, pi := range s.spec.Paths.Paths {
- if pi.Get != nil && pi.Get.ID == operationID {
- return gatherParams(&pi, pi.Get) //#nosec
- }
- if pi.Head != nil && pi.Head.ID == operationID {
- return gatherParams(&pi, pi.Head) //#nosec
- }
- if pi.Options != nil && pi.Options.ID == operationID {
- return gatherParams(&pi, pi.Options) //#nosec
- }
- if pi.Post != nil && pi.Post.ID == operationID {
- return gatherParams(&pi, pi.Post) //#nosec
- }
- if pi.Patch != nil && pi.Patch.ID == operationID {
- return gatherParams(&pi, pi.Patch) //#nosec
- }
- if pi.Put != nil && pi.Put.ID == operationID {
- return gatherParams(&pi, pi.Put) //#nosec
- }
- if pi.Delete != nil && pi.Delete.ID == operationID {
- return gatherParams(&pi, pi.Delete) //#nosec
- }
- }
-
- return nil
-}
-
-// ParamsFor the specified method and path. Aggregates them with the defaults etc, so it's all the params that
-// apply for the method and path.
-//
-// Assumes parameters properly resolve references if any and that
-// such references actually resolve to a parameter object.
-// Otherwise, panics.
-func (s *Spec) ParamsFor(method, path string) map[string]spec.Parameter {
- return s.SafeParamsFor(method, path, nil)
-}
-
-// SafeParamsFor the specified method and path. Aggregates them with the defaults etc, so it's all the params that
-// apply for the method and path.
-//
-// Does not assume parameters properly resolve references or that
-// such references actually resolve to a parameter object.
-//
-// Upon error, invoke a ErrorOnParamFunc callback with the erroneous
-// parameters. If the callback is set to nil, panics upon errors.
-func (s *Spec) SafeParamsFor(method, path string, callmeOnError ErrorOnParamFunc) map[string]spec.Parameter {
- res := make(map[string]spec.Parameter)
- if pi, ok := s.spec.Paths.Paths[path]; ok {
- s.paramsAsMap(pi.Parameters, res, callmeOnError)
- s.paramsAsMap(s.operations[strings.ToUpper(method)][path].Parameters, res, callmeOnError)
- }
-
- return res
-}
-
-// OperationForName gets the operation for the given id
-func (s *Spec) OperationForName(operationID string) (string, string, *spec.Operation, bool) {
- for method, pathItem := range s.operations {
- for path, op := range pathItem {
- if operationID == op.ID {
- return method, path, op, true
- }
- }
- }
-
- return "", "", nil, false
-}
-
-// OperationFor the given method and path
-func (s *Spec) OperationFor(method, path string) (*spec.Operation, bool) {
- if mp, ok := s.operations[strings.ToUpper(method)]; ok {
- op, fn := mp[path]
-
- return op, fn
- }
-
- return nil, false
-}
-
-// Operations gathers all the operations specified in the spec document
-func (s *Spec) Operations() map[string]map[string]*spec.Operation {
- return s.operations
-}
-
-func (s *Spec) structMapKeys(mp map[string]struct{}) []string {
- if len(mp) == 0 {
- return nil
- }
-
- result := make([]string, 0, len(mp))
- for k := range mp {
- result = append(result, k)
- }
-
- return result
-}
-
-// AllPaths returns all the paths in the swagger spec
-func (s *Spec) AllPaths() map[string]spec.PathItem {
- if s.spec == nil || s.spec.Paths == nil {
- return nil
- }
-
- return s.spec.Paths.Paths
-}
-
-// OperationIDs gets all the operation ids based on method an dpath
-func (s *Spec) OperationIDs() []string {
- if len(s.operations) == 0 {
- return nil
- }
-
- result := make([]string, 0, len(s.operations))
- for method, v := range s.operations {
- for p, o := range v {
- if o.ID != "" {
- result = append(result, o.ID)
- } else {
- result = append(result, fmt.Sprintf("%s %s", strings.ToUpper(method), p))
- }
- }
- }
-
- return result
-}
-
-// OperationMethodPaths gets all the operation ids based on method an dpath
-func (s *Spec) OperationMethodPaths() []string {
- if len(s.operations) == 0 {
- return nil
- }
-
- result := make([]string, 0, len(s.operations))
- for method, v := range s.operations {
- for p := range v {
- result = append(result, fmt.Sprintf("%s %s", strings.ToUpper(method), p))
- }
- }
-
- return result
-}
-
-// RequiredConsumes gets all the distinct consumes that are specified in the specification document
-func (s *Spec) RequiredConsumes() []string {
- return s.structMapKeys(s.consumes)
-}
-
-// RequiredProduces gets all the distinct produces that are specified in the specification document
-func (s *Spec) RequiredProduces() []string {
- return s.structMapKeys(s.produces)
-}
-
-// RequiredSecuritySchemes gets all the distinct security schemes that are specified in the swagger spec
-func (s *Spec) RequiredSecuritySchemes() []string {
- return s.structMapKeys(s.authSchemes)
-}
-
-// SchemaRef is a reference to a schema
-type SchemaRef struct {
- Name string
- Ref spec.Ref
- Schema *spec.Schema
- TopLevel bool
-}
-
-// SchemasWithAllOf returns schema references to all schemas that are defined
-// with an allOf key
-func (s *Spec) SchemasWithAllOf() (result []SchemaRef) {
- for _, v := range s.allOfs {
- result = append(result, v)
- }
-
- return
-}
-
-// AllDefinitions returns schema references for all the definitions that were discovered
-func (s *Spec) AllDefinitions() (result []SchemaRef) {
- for _, v := range s.allSchemas {
- result = append(result, v)
- }
-
- return
-}
-
-// AllDefinitionReferences returns json refs for all the discovered schemas
-func (s *Spec) AllDefinitionReferences() (result []string) {
- for _, v := range s.references.schemas {
- result = append(result, v.String())
- }
-
- return
-}
-
-// AllParameterReferences returns json refs for all the discovered parameters
-func (s *Spec) AllParameterReferences() (result []string) {
- for _, v := range s.references.parameters {
- result = append(result, v.String())
- }
-
- return
-}
-
-// AllResponseReferences returns json refs for all the discovered responses
-func (s *Spec) AllResponseReferences() (result []string) {
- for _, v := range s.references.responses {
- result = append(result, v.String())
- }
-
- return
-}
-
-// AllPathItemReferences returns the references for all the items
-func (s *Spec) AllPathItemReferences() (result []string) {
- for _, v := range s.references.pathItems {
- result = append(result, v.String())
- }
-
- return
-}
-
-// AllItemsReferences returns the references for all the items in simple schemas (parameters or headers).
-//
-// NOTE: since Swagger 2.0 forbids $ref in simple params, this should always yield an empty slice for a valid
-// Swagger 2.0 spec.
-func (s *Spec) AllItemsReferences() (result []string) {
- for _, v := range s.references.items {
- result = append(result, v.String())
- }
-
- return
-}
-
-// AllReferences returns all the references found in the document, with possible duplicates
-func (s *Spec) AllReferences() (result []string) {
- for _, v := range s.references.allRefs {
- result = append(result, v.String())
- }
-
- return
-}
-
-// AllRefs returns all the unique references found in the document
-func (s *Spec) AllRefs() (result []spec.Ref) {
- set := make(map[string]struct{})
- for _, v := range s.references.allRefs {
- a := v.String()
- if a == "" {
- continue
- }
-
- if _, ok := set[a]; !ok {
- set[a] = struct{}{}
- result = append(result, v)
- }
- }
-
- return
-}
-
-func cloneStringMap(source map[string]string) map[string]string {
- res := make(map[string]string, len(source))
- for k, v := range source {
- res[k] = v
- }
-
- return res
-}
-
-func cloneEnumMap(source map[string][]interface{}) map[string][]interface{} {
- res := make(map[string][]interface{}, len(source))
- for k, v := range source {
- res[k] = v
- }
-
- return res
-}
-
-// ParameterPatterns returns all the patterns found in parameters
-// the map is cloned to avoid accidental changes
-func (s *Spec) ParameterPatterns() map[string]string {
- return cloneStringMap(s.patterns.parameters)
-}
-
-// HeaderPatterns returns all the patterns found in response headers
-// the map is cloned to avoid accidental changes
-func (s *Spec) HeaderPatterns() map[string]string {
- return cloneStringMap(s.patterns.headers)
-}
-
-// ItemsPatterns returns all the patterns found in simple array items
-// the map is cloned to avoid accidental changes
-func (s *Spec) ItemsPatterns() map[string]string {
- return cloneStringMap(s.patterns.items)
-}
-
-// SchemaPatterns returns all the patterns found in schemas
-// the map is cloned to avoid accidental changes
-func (s *Spec) SchemaPatterns() map[string]string {
- return cloneStringMap(s.patterns.schemas)
-}
-
-// AllPatterns returns all the patterns found in the spec
-// the map is cloned to avoid accidental changes
-func (s *Spec) AllPatterns() map[string]string {
- return cloneStringMap(s.patterns.allPatterns)
-}
-
-// ParameterEnums returns all the enums found in parameters
-// the map is cloned to avoid accidental changes
-func (s *Spec) ParameterEnums() map[string][]interface{} {
- return cloneEnumMap(s.enums.parameters)
-}
-
-// HeaderEnums returns all the enums found in response headers
-// the map is cloned to avoid accidental changes
-func (s *Spec) HeaderEnums() map[string][]interface{} {
- return cloneEnumMap(s.enums.headers)
-}
-
-// ItemsEnums returns all the enums found in simple array items
-// the map is cloned to avoid accidental changes
-func (s *Spec) ItemsEnums() map[string][]interface{} {
- return cloneEnumMap(s.enums.items)
-}
-
-// SchemaEnums returns all the enums found in schemas
-// the map is cloned to avoid accidental changes
-func (s *Spec) SchemaEnums() map[string][]interface{} {
- return cloneEnumMap(s.enums.schemas)
-}
-
-// AllEnums returns all the enums found in the spec
-// the map is cloned to avoid accidental changes
-func (s *Spec) AllEnums() map[string][]interface{} {
- return cloneEnumMap(s.enums.allEnums)
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/debug.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/debug.go
deleted file mode 100644
index 33c15704e..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/debug.go
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package analysis
-
-import (
- "os"
-
- "github.com/go-openapi/analysis/internal/debug"
-)
-
-var debugLog = debug.GetLogger("analysis", os.Getenv("SWAGGER_DEBUG") != "")
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/doc.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/doc.go
deleted file mode 100644
index e8d9f9b13..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/doc.go
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-/*
-Package analysis provides methods to work with a Swagger specification document from
-package go-openapi/spec.
-
-## Analyzing a specification
-
-An analysed specification object (type Spec) provides methods to work with swagger definition.
-
-## Flattening or expanding a specification
-
-Flattening a specification bundles all remote $ref in the main spec document.
-Depending on flattening options, additional preprocessing may take place:
- - full flattening: replacing all inline complex constructs by a named entry in #/definitions
- - expand: replace all $ref's in the document by their expanded content
-
-## Merging several specifications
-
-Mixin several specifications merges all Swagger constructs, and warns about found conflicts.
-
-## Fixing a specification
-
-Unmarshalling a specification with golang json unmarshalling may lead to
-some unwanted result on present but empty fields.
-
-## Analyzing a Swagger schema
-
-Swagger schemas are analyzed to determine their complexity and qualify their content.
-*/
-package analysis
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/fixer.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/fixer.go
deleted file mode 100644
index 7c2ca0841..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/fixer.go
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package analysis
-
-import "github.com/go-openapi/spec"
-
-// FixEmptyResponseDescriptions replaces empty ("") response
-// descriptions in the input with "(empty)" to ensure that the
-// resulting Swagger is stays valid. The problem appears to arise
-// from reading in valid specs that have a explicit response
-// description of "" (valid, response.description is required), but
-// due to zero values being omitted upon re-serializing (omitempty) we
-// lose them unless we stick some chars in there.
-func FixEmptyResponseDescriptions(s *spec.Swagger) {
- for k, v := range s.Responses {
- FixEmptyDesc(&v) //#nosec
- s.Responses[k] = v
- }
-
- if s.Paths == nil {
- return
- }
-
- for _, v := range s.Paths.Paths {
- if v.Get != nil {
- FixEmptyDescs(v.Get.Responses)
- }
- if v.Put != nil {
- FixEmptyDescs(v.Put.Responses)
- }
- if v.Post != nil {
- FixEmptyDescs(v.Post.Responses)
- }
- if v.Delete != nil {
- FixEmptyDescs(v.Delete.Responses)
- }
- if v.Options != nil {
- FixEmptyDescs(v.Options.Responses)
- }
- if v.Head != nil {
- FixEmptyDescs(v.Head.Responses)
- }
- if v.Patch != nil {
- FixEmptyDescs(v.Patch.Responses)
- }
- }
-}
-
-// FixEmptyDescs adds "(empty)" as the description for any Response in
-// the given Responses object that doesn't already have one.
-func FixEmptyDescs(rs *spec.Responses) {
- FixEmptyDesc(rs.Default)
- for k, v := range rs.StatusCodeResponses {
- FixEmptyDesc(&v) //#nosec
- rs.StatusCodeResponses[k] = v
- }
-}
-
-// FixEmptyDesc adds "(empty)" as the description to the given
-// Response object if it doesn't already have one and isn't a
-// ref. No-op on nil input.
-func FixEmptyDesc(rs *spec.Response) {
- if rs == nil || rs.Description != "" || rs.Ref.Ref.GetURL() != nil {
- return
- }
- rs.Description = "(empty)"
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/flatten.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/flatten.go
deleted file mode 100644
index ebedcc9df..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/flatten.go
+++ /dev/null
@@ -1,814 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package analysis
-
-import (
- "fmt"
- "log"
- "path"
- "sort"
- "strings"
-
- "github.com/go-openapi/analysis/internal/flatten/normalize"
- "github.com/go-openapi/analysis/internal/flatten/operations"
- "github.com/go-openapi/analysis/internal/flatten/replace"
- "github.com/go-openapi/analysis/internal/flatten/schutils"
- "github.com/go-openapi/analysis/internal/flatten/sortref"
- "github.com/go-openapi/jsonpointer"
- "github.com/go-openapi/spec"
-)
-
-const definitionsPath = "#/definitions"
-
-// newRef stores information about refs created during the flattening process
-type newRef struct {
- key string
- newName string
- path string
- isOAIGen bool
- resolved bool
- schema *spec.Schema
- parents []string
-}
-
-// context stores intermediary results from flatten
-type context struct {
- newRefs map[string]*newRef
- warnings []string
- resolved map[string]string
-}
-
-func newContext() *context {
- return &context{
- newRefs: make(map[string]*newRef, 150),
- warnings: make([]string, 0),
- resolved: make(map[string]string, 50),
- }
-}
-
-// Flatten an analyzed spec and produce a self-contained spec bundle.
-//
-// There is a minimal and a full flattening mode.
-//
-// Minimally flattening a spec means:
-// - Expanding parameters, responses, path items, parameter items and header items (references to schemas are left
-// unscathed)
-// - Importing external (http, file) references so they become internal to the document
-// - Moving every JSON pointer to a $ref to a named definition (i.e. the reworked spec does not contain pointers
-// like "$ref": "#/definitions/myObject/allOfs/1")
-//
-// A minimally flattened spec thus guarantees the following properties:
-// - all $refs point to a local definition (i.e. '#/definitions/...')
-// - definitions are unique
-//
-// NOTE: arbitrary JSON pointers (other than $refs to top level definitions) are rewritten as definitions if they
-// represent a complex schema or express commonality in the spec.
-// Otherwise, they are simply expanded.
-// Self-referencing JSON pointers cannot resolve to a type and trigger an error.
-//
-// Minimal flattening is necessary and sufficient for codegen rendering using go-swagger.
-//
-// Fully flattening a spec means:
-// - Moving every complex inline schema to be a definition with an auto-generated name in a depth-first fashion.
-//
-// By complex, we mean every JSON object with some properties.
-// Arrays, when they do not define a tuple,
-// or empty objects with or without additionalProperties, are not considered complex and remain inline.
-//
-// NOTE: rewritten schemas get a vendor extension x-go-gen-location so we know from which part of the spec definitions
-// have been created.
-//
-// Available flattening options:
-// - Minimal: stops flattening after minimal $ref processing, leaving schema constructs untouched
-// - Expand: expand all $ref's in the document (inoperant if Minimal set to true)
-// - Verbose: croaks about name conflicts detected
-// - RemoveUnused: removes unused parameters, responses and definitions after expansion/flattening
-//
-// NOTE: expansion removes all $ref save circular $ref, which remain in place
-//
-// TODO: additional options
-// - ProgagateNameExtensions: ensure that created entries properly follow naming rules when their parent have set a
-// x-go-name extension
-// - LiftAllOfs:
-// - limit the flattening of allOf members when simple objects
-// - merge allOf with validation only
-// - merge allOf with extensions only
-// - ...
-func Flatten(opts FlattenOpts) error {
- debugLog("FlattenOpts: %#v", opts)
-
- opts.flattenContext = newContext()
-
- // 1. Recursively expand responses, parameters, path items and items in simple schemas.
- //
- // This simplifies the spec and leaves only the $ref's in schema objects.
- if err := expand(&opts); err != nil {
- return err
- }
-
- // 2. Strip the current document from absolute $ref's that actually a in the root,
- // so we can recognize them as proper definitions
- //
- // In particular, this works around issue go-openapi/spec#76: leading absolute file in $ref is stripped
- if err := normalizeRef(&opts); err != nil {
- return err
- }
-
- // 3. Optionally remove shared parameters and responses already expanded (now unused).
- //
- // Operation parameters (i.e. under paths) remain.
- if opts.RemoveUnused {
- removeUnusedShared(&opts)
- }
-
- // 4. Import all remote references.
- if err := importReferences(&opts); err != nil {
- return err
- }
-
- // 5. full flattening: rewrite inline schemas (schemas that aren't simple types or arrays or maps)
- if !opts.Minimal && !opts.Expand {
- if err := nameInlinedSchemas(&opts); err != nil {
- return err
- }
- }
-
- // 6. Rewrite JSON pointers other than $ref to named definitions
- // and attempt to resolve conflicting names whenever possible.
- if err := stripPointersAndOAIGen(&opts); err != nil {
- return err
- }
-
- // 7. Strip the spec from unused definitions
- if opts.RemoveUnused {
- removeUnused(&opts)
- }
-
- // 8. Issue warning notifications, if any
- opts.croak()
-
- // TODO: simplify known schema patterns to flat objects with properties
- // examples:
- // - lift simple allOf object,
- // - empty allOf with validation only or extensions only
- // - rework allOf arrays
- // - rework allOf additionalProperties
-
- return nil
-}
-
-func expand(opts *FlattenOpts) error {
- if err := spec.ExpandSpec(opts.Swagger(), opts.ExpandOpts(!opts.Expand)); err != nil {
- return err
- }
-
- opts.Spec.reload() // re-analyze
-
- return nil
-}
-
-// normalizeRef strips the current file from any absolute file $ref. This works around issue go-openapi/spec#76:
-// leading absolute file in $ref is stripped
-func normalizeRef(opts *FlattenOpts) error {
- debugLog("normalizeRef")
-
- altered := false
- for k, w := range opts.Spec.references.allRefs {
- if !strings.HasPrefix(w.String(), opts.BasePath+definitionsPath) { // may be a mix of / and \, depending on OS
- continue
- }
-
- altered = true
- debugLog("stripping absolute path for: %s", w.String())
-
- // strip the base path from definition
- if err := replace.UpdateRef(opts.Swagger(), k,
- spec.MustCreateRef(path.Join(definitionsPath, path.Base(w.String())))); err != nil {
- return err
- }
- }
-
- if altered {
- opts.Spec.reload() // re-analyze
- }
-
- return nil
-}
-
-func removeUnusedShared(opts *FlattenOpts) {
- opts.Swagger().Parameters = nil
- opts.Swagger().Responses = nil
-
- opts.Spec.reload() // re-analyze
-}
-
-func importReferences(opts *FlattenOpts) error {
- var (
- imported bool
- err error
- )
-
- for !imported && err == nil {
- // iteratively import remote references until none left.
- // This inlining deals with name conflicts by introducing auto-generated names ("OAIGen")
- imported, err = importExternalReferences(opts)
-
- opts.Spec.reload() // re-analyze
- }
-
- return err
-}
-
-// nameInlinedSchemas replaces every complex inline construct by a named definition.
-func nameInlinedSchemas(opts *FlattenOpts) error {
- debugLog("nameInlinedSchemas")
-
- namer := &InlineSchemaNamer{
- Spec: opts.Swagger(),
- Operations: operations.AllOpRefsByRef(opts.Spec, nil),
- flattenContext: opts.flattenContext,
- opts: opts,
- }
-
- depthFirst := sortref.DepthFirst(opts.Spec.allSchemas)
- for _, key := range depthFirst {
- sch := opts.Spec.allSchemas[key]
- if sch.Schema == nil || sch.Schema.Ref.String() != "" || sch.TopLevel {
- continue
- }
-
- asch, err := Schema(SchemaOpts{Schema: sch.Schema, Root: opts.Swagger(), BasePath: opts.BasePath})
- if err != nil {
- return fmt.Errorf("schema analysis [%s]: %w", key, err)
- }
-
- if asch.isAnalyzedAsComplex() { // move complex schemas to definitions
- if err := namer.Name(key, sch.Schema, asch); err != nil {
- return err
- }
- }
- }
-
- opts.Spec.reload() // re-analyze
-
- return nil
-}
-
-func removeUnused(opts *FlattenOpts) {
- for removeUnusedSinglePass(opts) {
- // continue until no unused definition remains
- }
-}
-
-func removeUnusedSinglePass(opts *FlattenOpts) (hasRemoved bool) {
- expected := make(map[string]struct{})
- for k := range opts.Swagger().Definitions {
- expected[path.Join(definitionsPath, jsonpointer.Escape(k))] = struct{}{}
- }
-
- for _, k := range opts.Spec.AllDefinitionReferences() {
- delete(expected, k)
- }
-
- for k := range expected {
- hasRemoved = true
- debugLog("removing unused definition %s", path.Base(k))
- if opts.Verbose {
- log.Printf("info: removing unused definition: %s", path.Base(k))
- }
- delete(opts.Swagger().Definitions, path.Base(k))
- }
-
- opts.Spec.reload() // re-analyze
-
- return hasRemoved
-}
-
-func importKnownRef(entry sortref.RefRevIdx, refStr, newName string, opts *FlattenOpts) error {
- // rewrite ref with already resolved external ref (useful for cyclical refs):
- // rewrite external refs to local ones
- debugLog("resolving known ref [%s] to %s", refStr, newName)
-
- for _, key := range entry.Keys {
- if err := replace.UpdateRef(opts.Swagger(), key, spec.MustCreateRef(path.Join(definitionsPath, newName))); err != nil {
- return err
- }
- }
-
- return nil
-}
-
-func importNewRef(entry sortref.RefRevIdx, refStr string, opts *FlattenOpts) error {
- var (
- isOAIGen bool
- newName string
- )
-
- debugLog("resolving schema from remote $ref [%s]", refStr)
-
- sch, err := spec.ResolveRefWithBase(opts.Swagger(), &entry.Ref, opts.ExpandOpts(false))
- if err != nil {
- return fmt.Errorf("could not resolve schema: %w", err)
- }
-
- // at this stage only $ref analysis matters
- partialAnalyzer := &Spec{
- references: referenceAnalysis{},
- patterns: patternAnalysis{},
- enums: enumAnalysis{},
- }
- partialAnalyzer.reset()
- partialAnalyzer.analyzeSchema("", sch, "/")
-
- // now rewrite those refs with rebase
- for key, ref := range partialAnalyzer.references.allRefs {
- if err := replace.UpdateRef(sch, key, spec.MustCreateRef(normalize.RebaseRef(entry.Ref.String(), ref.String()))); err != nil {
- return fmt.Errorf("failed to rewrite ref for key %q at %s: %w", key, entry.Ref.String(), err)
- }
- }
-
- // generate a unique name - isOAIGen means that a naming conflict was resolved by changing the name
- newName, isOAIGen = uniqifyName(opts.Swagger().Definitions, nameFromRef(entry.Ref, opts))
- debugLog("new name for [%s]: %s - with name conflict:%t", strings.Join(entry.Keys, ", "), newName, isOAIGen)
-
- opts.flattenContext.resolved[refStr] = newName
-
- // rewrite the external refs to local ones
- for _, key := range entry.Keys {
- if err := replace.UpdateRef(opts.Swagger(), key,
- spec.MustCreateRef(path.Join(definitionsPath, newName))); err != nil {
- return err
- }
-
- // keep track of created refs
- resolved := false
- if _, ok := opts.flattenContext.newRefs[key]; ok {
- resolved = opts.flattenContext.newRefs[key].resolved
- }
-
- debugLog("keeping track of ref: %s (%s), resolved: %t", key, newName, resolved)
- opts.flattenContext.newRefs[key] = &newRef{
- key: key,
- newName: newName,
- path: path.Join(definitionsPath, newName),
- isOAIGen: isOAIGen,
- resolved: resolved,
- schema: sch,
- }
- }
-
- // add the resolved schema to the definitions
- schutils.Save(opts.Swagger(), newName, sch)
-
- return nil
-}
-
-// importExternalReferences iteratively digs remote references and imports them into the main schema.
-//
-// At every iteration, new remotes may be found when digging deeper: they are rebased to the current schema before being imported.
-//
-// This returns true when no more remote references can be found.
-func importExternalReferences(opts *FlattenOpts) (bool, error) {
- debugLog("importExternalReferences")
-
- groupedRefs := sortref.ReverseIndex(opts.Spec.references.schemas, opts.BasePath)
- sortedRefStr := make([]string, 0, len(groupedRefs))
- if opts.flattenContext == nil {
- opts.flattenContext = newContext()
- }
-
- // sort $ref resolution to ensure deterministic name conflict resolution
- for refStr := range groupedRefs {
- sortedRefStr = append(sortedRefStr, refStr)
- }
- sort.Strings(sortedRefStr)
-
- complete := true
-
- for _, refStr := range sortedRefStr {
- entry := groupedRefs[refStr]
- if entry.Ref.HasFragmentOnly {
- continue
- }
-
- complete = false
-
- newName := opts.flattenContext.resolved[refStr]
- if newName != "" {
- if err := importKnownRef(entry, refStr, newName, opts); err != nil {
- return false, err
- }
-
- continue
- }
-
- // resolve schemas
- if err := importNewRef(entry, refStr, opts); err != nil {
- return false, err
- }
- }
-
- // maintains ref index entries
- for k := range opts.flattenContext.newRefs {
- r := opts.flattenContext.newRefs[k]
-
- // update tracking with resolved schemas
- if r.schema.Ref.String() != "" {
- ref := spec.MustCreateRef(r.path)
- sch, err := spec.ResolveRefWithBase(opts.Swagger(), &ref, opts.ExpandOpts(false))
- if err != nil {
- return false, fmt.Errorf("could not resolve schema: %w", err)
- }
-
- r.schema = sch
- }
-
- if r.path == k {
- continue
- }
-
- // update tracking with renamed keys: got a cascade of refs
- renamed := *r
- renamed.key = r.path
- opts.flattenContext.newRefs[renamed.path] = &renamed
-
- // indirect ref
- r.newName = path.Base(k)
- r.schema = spec.RefSchema(r.path)
- r.path = k
- r.isOAIGen = strings.Contains(k, "OAIGen")
- }
-
- return complete, nil
-}
-
-// stripPointersAndOAIGen removes anonymous JSON pointers from spec and chain with name conflicts handler.
-// This loops until the spec has no such pointer and all name conflicts have been reduced as much as possible.
-func stripPointersAndOAIGen(opts *FlattenOpts) error {
- // name all JSON pointers to anonymous documents
- if err := namePointers(opts); err != nil {
- return err
- }
-
- // remove unnecessary OAIGen ref (created when flattening external refs creates name conflicts)
- hasIntroducedPointerOrInline, ers := stripOAIGen(opts)
- if ers != nil {
- return ers
- }
-
- // iterate as pointer or OAIGen resolution may introduce inline schemas or pointers
- for hasIntroducedPointerOrInline {
- if !opts.Minimal {
- opts.Spec.reload() // re-analyze
- if err := nameInlinedSchemas(opts); err != nil {
- return err
- }
- }
-
- if err := namePointers(opts); err != nil {
- return err
- }
-
- // restrip and re-analyze
- var err error
- if hasIntroducedPointerOrInline, err = stripOAIGen(opts); err != nil {
- return err
- }
- }
-
- return nil
-}
-
-// stripOAIGen strips the spec from unnecessary OAIGen constructs, initially created to dedupe flattened definitions.
-//
-// A dedupe is deemed unnecessary whenever:
-// - the only conflict is with its (single) parent: OAIGen is merged into its parent (reinlining)
-// - there is a conflict with multiple parents: merge OAIGen in first parent, the rewrite other parents to point to
-// the first parent.
-//
-// This function returns true whenever it re-inlined a complex schema, so the caller may chose to iterate
-// pointer and name resolution again.
-func stripOAIGen(opts *FlattenOpts) (bool, error) {
- debugLog("stripOAIGen")
- replacedWithComplex := false
-
- // figure out referers of OAIGen definitions (doing it before the ref start mutating)
- for _, r := range opts.flattenContext.newRefs {
- updateRefParents(opts.Spec.references.allRefs, r)
- }
-
- for k := range opts.flattenContext.newRefs {
- r := opts.flattenContext.newRefs[k]
- debugLog("newRefs[%s]: isOAIGen: %t, resolved: %t, name: %s, path:%s, #parents: %d, parents: %v, ref: %s",
- k, r.isOAIGen, r.resolved, r.newName, r.path, len(r.parents), r.parents, r.schema.Ref.String())
-
- if !r.isOAIGen || len(r.parents) == 0 {
- continue
- }
-
- hasReplacedWithComplex, err := stripOAIGenForRef(opts, k, r)
- if err != nil {
- return replacedWithComplex, err
- }
-
- replacedWithComplex = replacedWithComplex || hasReplacedWithComplex
- }
-
- debugLog("replacedWithComplex: %t", replacedWithComplex)
- opts.Spec.reload() // re-analyze
-
- return replacedWithComplex, nil
-}
-
-// updateRefParents updates all parents of an updated $ref
-func updateRefParents(allRefs map[string]spec.Ref, r *newRef) {
- if !r.isOAIGen || r.resolved { // bail on already resolved entries (avoid looping)
- return
- }
- for k, v := range allRefs {
- if r.path != v.String() {
- continue
- }
-
- found := false
- for _, p := range r.parents {
- if p == k {
- found = true
-
- break
- }
- }
- if !found {
- r.parents = append(r.parents, k)
- }
- }
-}
-
-func stripOAIGenForRef(opts *FlattenOpts, k string, r *newRef) (bool, error) {
- replacedWithComplex := false
-
- pr := sortref.TopmostFirst(r.parents)
-
- // rewrite first parent schema in hierarchical then lexicographical order
- debugLog("rewrite first parent %s with schema", pr[0])
- if err := replace.UpdateRefWithSchema(opts.Swagger(), pr[0], r.schema); err != nil {
- return false, err
- }
-
- if pa, ok := opts.flattenContext.newRefs[pr[0]]; ok && pa.isOAIGen {
- // update parent in ref index entry
- debugLog("update parent entry: %s", pr[0])
- pa.schema = r.schema
- pa.resolved = false
- replacedWithComplex = true
- }
-
- // rewrite other parents to point to first parent
- if len(pr) > 1 {
- for _, p := range pr[1:] {
- replacingRef := spec.MustCreateRef(pr[0])
-
- // set complex when replacing ref is an anonymous jsonpointer: further processing may be required
- replacedWithComplex = replacedWithComplex || path.Dir(replacingRef.String()) != definitionsPath
- debugLog("rewrite parent with ref: %s", replacingRef.String())
-
- // NOTE: it is possible at this stage to introduce json pointers (to non-definitions places).
- // Those are stripped later on.
- if err := replace.UpdateRef(opts.Swagger(), p, replacingRef); err != nil {
- return false, err
- }
-
- if pa, ok := opts.flattenContext.newRefs[p]; ok && pa.isOAIGen {
- // update parent in ref index
- debugLog("update parent entry: %s", p)
- pa.schema = r.schema
- pa.resolved = false
- replacedWithComplex = true
- }
- }
- }
-
- // remove OAIGen definition
- debugLog("removing definition %s", path.Base(r.path))
- delete(opts.Swagger().Definitions, path.Base(r.path))
-
- // propagate changes in ref index for keys which have this one as a parent
- for kk, value := range opts.flattenContext.newRefs {
- if kk == k || !value.isOAIGen || value.resolved {
- continue
- }
-
- found := false
- newParents := make([]string, 0, len(value.parents))
- for _, parent := range value.parents {
- switch {
- case parent == r.path:
- found = true
- parent = pr[0]
- case strings.HasPrefix(parent, r.path+"/"):
- found = true
- parent = path.Join(pr[0], strings.TrimPrefix(parent, r.path))
- }
-
- newParents = append(newParents, parent)
- }
-
- if found {
- value.parents = newParents
- }
- }
-
- // mark naming conflict as resolved
- debugLog("marking naming conflict resolved for key: %s", r.key)
- opts.flattenContext.newRefs[r.key].isOAIGen = false
- opts.flattenContext.newRefs[r.key].resolved = true
-
- // determine if the previous substitution did inline a complex schema
- if r.schema != nil && r.schema.Ref.String() == "" { // inline schema
- asch, err := Schema(SchemaOpts{Schema: r.schema, Root: opts.Swagger(), BasePath: opts.BasePath})
- if err != nil {
- return false, err
- }
-
- debugLog("re-inlined schema: parent: %s, %t", pr[0], asch.isAnalyzedAsComplex())
- replacedWithComplex = replacedWithComplex || !(path.Dir(pr[0]) == definitionsPath) && asch.isAnalyzedAsComplex()
- }
-
- return replacedWithComplex, nil
-}
-
-// namePointers replaces all JSON pointers to anonymous documents by a $ref to a new named definitions.
-//
-// This is carried on depth-first. Pointers to $refs which are top level definitions are replaced by the $ref itself.
-// Pointers to simple types are expanded, unless they express commonality (i.e. several such $ref are used).
-func namePointers(opts *FlattenOpts) error {
- debugLog("name pointers")
-
- refsToReplace := make(map[string]SchemaRef, len(opts.Spec.references.schemas))
- for k, ref := range opts.Spec.references.allRefs {
- debugLog("name pointers: %q => %#v", k, ref)
- if path.Dir(ref.String()) == definitionsPath {
- // this a ref to a top-level definition: ok
- continue
- }
-
- result, err := replace.DeepestRef(opts.Swagger(), opts.ExpandOpts(false), ref)
- if err != nil {
- return fmt.Errorf("at %s, %w", k, err)
- }
-
- replacingRef := result.Ref
- sch := result.Schema
- if opts.flattenContext != nil {
- opts.flattenContext.warnings = append(opts.flattenContext.warnings, result.Warnings...)
- }
-
- debugLog("planning pointer to replace at %s: %s, resolved to: %s", k, ref.String(), replacingRef.String())
- refsToReplace[k] = SchemaRef{
- Name: k, // caller
- Ref: replacingRef, // called
- Schema: sch,
- TopLevel: path.Dir(replacingRef.String()) == definitionsPath,
- }
- }
-
- depthFirst := sortref.DepthFirst(refsToReplace)
- namer := &InlineSchemaNamer{
- Spec: opts.Swagger(),
- Operations: operations.AllOpRefsByRef(opts.Spec, nil),
- flattenContext: opts.flattenContext,
- opts: opts,
- }
-
- for _, key := range depthFirst {
- v := refsToReplace[key]
- // update current replacement, which may have been updated by previous changes of deeper elements
- result, erd := replace.DeepestRef(opts.Swagger(), opts.ExpandOpts(false), v.Ref)
- if erd != nil {
- return fmt.Errorf("at %s, %w", key, erd)
- }
-
- if opts.flattenContext != nil {
- opts.flattenContext.warnings = append(opts.flattenContext.warnings, result.Warnings...)
- }
-
- v.Ref = result.Ref
- v.Schema = result.Schema
- v.TopLevel = path.Dir(result.Ref.String()) == definitionsPath
- debugLog("replacing pointer at %s: resolved to: %s", key, v.Ref.String())
-
- if v.TopLevel {
- debugLog("replace pointer %s by canonical definition: %s", key, v.Ref.String())
-
- // if the schema is a $ref to a top level definition, just rewrite the pointer to this $ref
- if err := replace.UpdateRef(opts.Swagger(), key, v.Ref); err != nil {
- return err
- }
-
- continue
- }
-
- if err := flattenAnonPointer(key, v, refsToReplace, namer, opts); err != nil {
- return err
- }
- }
-
- opts.Spec.reload() // re-analyze
-
- return nil
-}
-
-func flattenAnonPointer(key string, v SchemaRef, refsToReplace map[string]SchemaRef, namer *InlineSchemaNamer, opts *FlattenOpts) error {
- // this is a JSON pointer to an anonymous document (internal or external):
- // create a definition for this schema when:
- // - it is a complex schema
- // - or it is pointed by more than one $ref (i.e. expresses commonality)
- // otherwise, expand the pointer (single reference to a simple type)
- //
- // The named definition for this follows the target's key, not the caller's
- debugLog("namePointers at %s for %s", key, v.Ref.String())
-
- // qualify the expanded schema
- asch, ers := Schema(SchemaOpts{Schema: v.Schema, Root: opts.Swagger(), BasePath: opts.BasePath})
- if ers != nil {
- return fmt.Errorf("schema analysis [%s]: %w", key, ers)
- }
- callers := make([]string, 0, 64)
-
- debugLog("looking for callers")
-
- an := New(opts.Swagger())
- for k, w := range an.references.allRefs {
- r, err := replace.DeepestRef(opts.Swagger(), opts.ExpandOpts(false), w)
- if err != nil {
- return fmt.Errorf("at %s, %w", key, err)
- }
-
- if opts.flattenContext != nil {
- opts.flattenContext.warnings = append(opts.flattenContext.warnings, r.Warnings...)
- }
-
- if r.Ref.String() == v.Ref.String() {
- callers = append(callers, k)
- }
- }
-
- debugLog("callers for %s: %d", v.Ref.String(), len(callers))
- if len(callers) == 0 {
- // has already been updated and resolved
- return nil
- }
-
- parts := sortref.KeyParts(v.Ref.String())
- debugLog("number of callers for %s: %d", v.Ref.String(), len(callers))
-
- // identifying edge case when the namer did nothing because we point to a non-schema object
- // no definition is created and we expand the $ref for all callers
- debugLog("decide what to do with the schema pointed to: asch.IsSimpleSchema=%t, len(callers)=%d, parts.IsSharedParam=%t, parts.IsSharedResponse=%t",
- asch.IsSimpleSchema, len(callers), parts.IsSharedParam(), parts.IsSharedResponse(),
- )
-
- if (!asch.IsSimpleSchema || len(callers) > 1) && !parts.IsSharedParam() && !parts.IsSharedResponse() {
- debugLog("replace JSON pointer at [%s] by definition: %s", key, v.Ref.String())
- if err := namer.Name(v.Ref.String(), v.Schema, asch); err != nil {
- return err
- }
-
- // regular case: we named the $ref as a definition, and we move all callers to this new $ref
- for _, caller := range callers {
- if caller == key {
- continue
- }
-
- // move $ref for next to resolve
- debugLog("identified caller of %s at [%s]", v.Ref.String(), caller)
- c := refsToReplace[caller]
- c.Ref = v.Ref
- refsToReplace[caller] = c
- }
-
- return nil
- }
-
- // everything that is a simple schema and not factorizable is expanded
- debugLog("expand JSON pointer for key=%s", key)
-
- if err := replace.UpdateRefWithSchema(opts.Swagger(), key, v.Schema); err != nil {
- return err
- }
- // NOTE: there is no other caller to update
-
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/flatten_name.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/flatten_name.go
deleted file mode 100644
index c7d7938eb..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/flatten_name.go
+++ /dev/null
@@ -1,308 +0,0 @@
-package analysis
-
-import (
- "fmt"
- "path"
- "sort"
- "strings"
-
- "github.com/go-openapi/analysis/internal/flatten/operations"
- "github.com/go-openapi/analysis/internal/flatten/replace"
- "github.com/go-openapi/analysis/internal/flatten/schutils"
- "github.com/go-openapi/analysis/internal/flatten/sortref"
- "github.com/go-openapi/spec"
- "github.com/go-openapi/swag"
-)
-
-// InlineSchemaNamer finds a new name for an inlined type
-type InlineSchemaNamer struct {
- Spec *spec.Swagger
- Operations map[string]operations.OpRef
- flattenContext *context
- opts *FlattenOpts
-}
-
-// Name yields a new name for the inline schema
-func (isn *InlineSchemaNamer) Name(key string, schema *spec.Schema, aschema *AnalyzedSchema) error {
- debugLog("naming inlined schema at %s", key)
-
- parts := sortref.KeyParts(key)
- for _, name := range namesFromKey(parts, aschema, isn.Operations) {
- if name == "" {
- continue
- }
-
- // create unique name
- mangle := mangler(isn.opts)
- newName, isOAIGen := uniqifyName(isn.Spec.Definitions, mangle(name))
-
- // clone schema
- sch := schutils.Clone(schema)
-
- // replace values on schema
- debugLog("rewriting schema to ref: key=%s with new name: %s", key, newName)
- if err := replace.RewriteSchemaToRef(isn.Spec, key,
- spec.MustCreateRef(path.Join(definitionsPath, newName))); err != nil {
- return fmt.Errorf("error while creating definition %q from inline schema: %w", newName, err)
- }
-
- // rewrite any dependent $ref pointing to this place,
- // when not already pointing to a top-level definition.
- //
- // NOTE: this is important if such referers use arbitrary JSON pointers.
- an := New(isn.Spec)
- for k, v := range an.references.allRefs {
- r, erd := replace.DeepestRef(isn.opts.Swagger(), isn.opts.ExpandOpts(false), v)
- if erd != nil {
- return fmt.Errorf("at %s, %w", k, erd)
- }
-
- if isn.opts.flattenContext != nil {
- isn.opts.flattenContext.warnings = append(isn.opts.flattenContext.warnings, r.Warnings...)
- }
-
- if r.Ref.String() != key && (r.Ref.String() != path.Join(definitionsPath, newName) || path.Dir(v.String()) == definitionsPath) {
- continue
- }
-
- debugLog("found a $ref to a rewritten schema: %s points to %s", k, v.String())
-
- // rewrite $ref to the new target
- if err := replace.UpdateRef(isn.Spec, k,
- spec.MustCreateRef(path.Join(definitionsPath, newName))); err != nil {
- return err
- }
- }
-
- // NOTE: this extension is currently not used by go-swagger (provided for information only)
- sch.AddExtension("x-go-gen-location", GenLocation(parts))
-
- // save cloned schema to definitions
- schutils.Save(isn.Spec, newName, sch)
-
- // keep track of created refs
- if isn.flattenContext == nil {
- continue
- }
-
- debugLog("track created ref: key=%s, newName=%s, isOAIGen=%t", key, newName, isOAIGen)
- resolved := false
-
- if _, ok := isn.flattenContext.newRefs[key]; ok {
- resolved = isn.flattenContext.newRefs[key].resolved
- }
-
- isn.flattenContext.newRefs[key] = &newRef{
- key: key,
- newName: newName,
- path: path.Join(definitionsPath, newName),
- isOAIGen: isOAIGen,
- resolved: resolved,
- schema: sch,
- }
- }
-
- return nil
-}
-
-// uniqifyName yields a unique name for a definition
-func uniqifyName(definitions spec.Definitions, name string) (string, bool) {
- isOAIGen := false
- if name == "" {
- name = "oaiGen"
- isOAIGen = true
- }
-
- if len(definitions) == 0 {
- return name, isOAIGen
- }
-
- unq := true
- for k := range definitions {
- if strings.EqualFold(k, name) {
- unq = false
-
- break
- }
- }
-
- if unq {
- return name, isOAIGen
- }
-
- name += "OAIGen"
- isOAIGen = true
- var idx int
- unique := name
- _, known := definitions[unique]
-
- for known {
- idx++
- unique = fmt.Sprintf("%s%d", name, idx)
- _, known = definitions[unique]
- }
-
- return unique, isOAIGen
-}
-
-func namesFromKey(parts sortref.SplitKey, aschema *AnalyzedSchema, operations map[string]operations.OpRef) []string {
- var (
- baseNames [][]string
- startIndex int
- )
-
- switch {
- case parts.IsOperation():
- baseNames, startIndex = namesForOperation(parts, operations)
- case parts.IsDefinition():
- baseNames, startIndex = namesForDefinition(parts)
- default:
- // this a non-standard pointer: build a name by concatenating its parts
- baseNames = [][]string{parts}
- startIndex = len(baseNames) + 1
- }
-
- result := make([]string, 0, len(baseNames))
- for _, segments := range baseNames {
- nm := parts.BuildName(segments, startIndex, partAdder(aschema))
- if nm == "" {
- continue
- }
-
- result = append(result, nm)
- }
- sort.Strings(result)
-
- debugLog("names from parts: %v => %v", parts, result)
- return result
-}
-
-func namesForParam(parts sortref.SplitKey, operations map[string]operations.OpRef) ([][]string, int) {
- var (
- baseNames [][]string
- startIndex int
- )
-
- piref := parts.PathItemRef()
- if piref.String() != "" && parts.IsOperationParam() {
- if op, ok := operations[piref.String()]; ok {
- startIndex = 5
- baseNames = append(baseNames, []string{op.ID, "params", "body"})
- }
- } else if parts.IsSharedOperationParam() {
- pref := parts.PathRef()
- for k, v := range operations {
- if strings.HasPrefix(k, pref.String()) {
- startIndex = 4
- baseNames = append(baseNames, []string{v.ID, "params", "body"})
- }
- }
- }
-
- return baseNames, startIndex
-}
-
-func namesForOperation(parts sortref.SplitKey, operations map[string]operations.OpRef) ([][]string, int) {
- var (
- baseNames [][]string
- startIndex int
- )
-
- // params
- if parts.IsOperationParam() || parts.IsSharedOperationParam() {
- baseNames, startIndex = namesForParam(parts, operations)
- }
-
- // responses
- if parts.IsOperationResponse() {
- piref := parts.PathItemRef()
- if piref.String() != "" {
- if op, ok := operations[piref.String()]; ok {
- startIndex = 6
- baseNames = append(baseNames, []string{op.ID, parts.ResponseName(), "body"})
- }
- }
- }
-
- return baseNames, startIndex
-}
-
-func namesForDefinition(parts sortref.SplitKey) ([][]string, int) {
- nm := parts.DefinitionName()
- if nm != "" {
- return [][]string{{parts.DefinitionName()}}, 2
- }
-
- return [][]string{}, 0
-}
-
-// partAdder knows how to interpret a schema when it comes to build a name from parts
-func partAdder(aschema *AnalyzedSchema) sortref.PartAdder {
- return func(part string) []string {
- segments := make([]string, 0, 2)
-
- if part == "items" || part == "additionalItems" {
- if aschema.IsTuple || aschema.IsTupleWithExtra {
- segments = append(segments, "tuple")
- } else {
- segments = append(segments, "items")
- }
-
- if part == "additionalItems" {
- segments = append(segments, part)
- }
-
- return segments
- }
-
- segments = append(segments, part)
-
- return segments
- }
-}
-
-func mangler(o *FlattenOpts) func(string) string {
- if o.KeepNames {
- return func(in string) string { return in }
- }
-
- return swag.ToJSONName
-}
-
-func nameFromRef(ref spec.Ref, o *FlattenOpts) string {
- mangle := mangler(o)
-
- u := ref.GetURL()
- if u.Fragment != "" {
- return mangle(path.Base(u.Fragment))
- }
-
- if u.Path != "" {
- bn := path.Base(u.Path)
- if bn != "" && bn != "/" {
- ext := path.Ext(bn)
- if ext != "" {
- return mangle(bn[:len(bn)-len(ext)])
- }
-
- return mangle(bn)
- }
- }
-
- return mangle(strings.ReplaceAll(u.Host, ".", " "))
-}
-
-// GenLocation indicates from which section of the specification (models or operations) a definition has been created.
-//
-// This is reflected in the output spec with a "x-go-gen-location" extension. At the moment, this is provided
-// for information only.
-func GenLocation(parts sortref.SplitKey) string {
- switch {
- case parts.IsOperation():
- return "operations"
- case parts.IsDefinition():
- return "models"
- default:
- return ""
- }
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/flatten_options.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/flatten_options.go
deleted file mode 100644
index c943fe1e8..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/flatten_options.go
+++ /dev/null
@@ -1,79 +0,0 @@
-package analysis
-
-import (
- "log"
-
- "github.com/go-openapi/spec"
-)
-
-// FlattenOpts configuration for flattening a swagger specification.
-//
-// The BasePath parameter is used to locate remote relative $ref found in the specification.
-// This path is a file: it points to the location of the root document and may be either a local
-// file path or a URL.
-//
-// If none specified, relative references (e.g. "$ref": "folder/schema.yaml#/definitions/...")
-// found in the spec are searched from the current working directory.
-type FlattenOpts struct {
- Spec *Spec // The analyzed spec to work with
- flattenContext *context // Internal context to track flattening activity
-
- BasePath string // The location of the root document for this spec to resolve relative $ref
-
- // Flattening options
- Expand bool // When true, skip flattening the spec and expand it instead (if Minimal is false)
- Minimal bool // When true, do not decompose complex structures such as allOf
- Verbose bool // enable some reporting on possible name conflicts detected
- RemoveUnused bool // When true, remove unused parameters, responses and definitions after expansion/flattening
- ContinueOnError bool // Continue when spec expansion issues are found
- KeepNames bool // Do not attempt to jsonify names from references when flattening
-
- /* Extra keys */
- _ struct{} // require keys
-}
-
-// ExpandOpts creates a spec.ExpandOptions to configure expanding a specification document.
-func (f *FlattenOpts) ExpandOpts(skipSchemas bool) *spec.ExpandOptions {
- return &spec.ExpandOptions{
- RelativeBase: f.BasePath,
- SkipSchemas: skipSchemas,
- ContinueOnError: f.ContinueOnError,
- }
-}
-
-// Swagger gets the swagger specification for this flatten operation
-func (f *FlattenOpts) Swagger() *spec.Swagger {
- return f.Spec.spec
-}
-
-// croak logs notifications and warnings about valid, but possibly unwanted constructs resulting
-// from flattening a spec
-func (f *FlattenOpts) croak() {
- if !f.Verbose {
- return
- }
-
- reported := make(map[string]bool, len(f.flattenContext.newRefs))
- for _, v := range f.Spec.references.allRefs {
- // warns about duplicate handling
- for _, r := range f.flattenContext.newRefs {
- if r.isOAIGen && r.path == v.String() {
- reported[r.newName] = true
- }
- }
- }
-
- for k := range reported {
- log.Printf("warning: duplicate flattened definition name resolved as %s", k)
- }
-
- // warns about possible type mismatches
- uniqueMsg := make(map[string]bool)
- for _, msg := range f.flattenContext.warnings {
- if _, ok := uniqueMsg[msg]; ok {
- continue
- }
- log.Printf("warning: %s", msg)
- uniqueMsg[msg] = true
- }
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/internal/debug/debug.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/internal/debug/debug.go
deleted file mode 100644
index 39f55a97b..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/internal/debug/debug.go
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package debug
-
-import (
- "fmt"
- "log"
- "os"
- "path/filepath"
- "runtime"
-)
-
-var (
- output = os.Stdout
-)
-
-// GetLogger provides a prefix debug logger
-func GetLogger(prefix string, debug bool) func(string, ...interface{}) {
- if debug {
- logger := log.New(output, prefix+":", log.LstdFlags)
-
- return func(msg string, args ...interface{}) {
- _, file1, pos1, _ := runtime.Caller(1)
- logger.Printf("%s:%d: %s", filepath.Base(file1), pos1, fmt.Sprintf(msg, args...))
- }
- }
-
- return func(_ string, _ ...interface{}) {}
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/internal/flatten/normalize/normalize.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/internal/flatten/normalize/normalize.go
deleted file mode 100644
index 8c9df0580..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/internal/flatten/normalize/normalize.go
+++ /dev/null
@@ -1,87 +0,0 @@
-package normalize
-
-import (
- "net/url"
- "path"
- "path/filepath"
- "strings"
-
- "github.com/go-openapi/spec"
-)
-
-// RebaseRef rebases a remote ref relative to a base ref.
-//
-// NOTE: does not support JSONschema ID for $ref (we assume we are working with swagger specs here).
-//
-// NOTE(windows):
-// * refs are assumed to have been normalized with drive letter lower cased (from go-openapi/spec)
-// * "/ in paths may appear as escape sequences
-func RebaseRef(baseRef string, ref string) string {
- baseRef, _ = url.PathUnescape(baseRef)
- ref, _ = url.PathUnescape(ref)
-
- if baseRef == "" || baseRef == "." || strings.HasPrefix(baseRef, "#") {
- return ref
- }
-
- parts := strings.Split(ref, "#")
-
- baseParts := strings.Split(baseRef, "#")
- baseURL, _ := url.Parse(baseParts[0])
- if strings.HasPrefix(ref, "#") {
- if baseURL.Host == "" {
- return strings.Join([]string{baseParts[0], parts[1]}, "#")
- }
-
- return strings.Join([]string{baseParts[0], parts[1]}, "#")
- }
-
- refURL, _ := url.Parse(parts[0])
- if refURL.Host != "" || filepath.IsAbs(parts[0]) {
- // not rebasing an absolute path
- return ref
- }
-
- // there is a relative path
- var basePath string
- if baseURL.Host != "" {
- // when there is a host, standard URI rules apply (with "/")
- baseURL.Path = path.Dir(baseURL.Path)
- baseURL.Path = path.Join(baseURL.Path, "/"+parts[0])
-
- return baseURL.String()
- }
-
- // this is a local relative path
- // basePart[0] and parts[0] are local filesystem directories/files
- basePath = filepath.Dir(baseParts[0])
- relPath := filepath.Join(basePath, string(filepath.Separator)+parts[0])
- if len(parts) > 1 {
- return strings.Join([]string{relPath, parts[1]}, "#")
- }
-
- return relPath
-}
-
-// Path renders absolute path on remote file refs
-//
-// NOTE(windows):
-// * refs are assumed to have been normalized with drive letter lower cased (from go-openapi/spec)
-// * "/ in paths may appear as escape sequences
-func Path(ref spec.Ref, basePath string) string {
- uri, _ := url.PathUnescape(ref.String())
- if ref.HasFragmentOnly || filepath.IsAbs(uri) {
- return uri
- }
-
- refURL, _ := url.Parse(uri)
- if refURL.Host != "" {
- return uri
- }
-
- parts := strings.Split(uri, "#")
- // BasePath, parts[0] are local filesystem directories, guaranteed to be absolute at this stage
- parts[0] = filepath.Join(filepath.Dir(basePath), parts[0])
-
- return strings.Join(parts, "#")
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/internal/flatten/operations/operations.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/internal/flatten/operations/operations.go
deleted file mode 100644
index 7f3a2b871..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/internal/flatten/operations/operations.go
+++ /dev/null
@@ -1,90 +0,0 @@
-package operations
-
-import (
- "path"
- "sort"
- "strings"
-
- "github.com/go-openapi/jsonpointer"
- "github.com/go-openapi/spec"
- "github.com/go-openapi/swag"
-)
-
-// AllOpRefsByRef returns an index of sortable operations
-func AllOpRefsByRef(specDoc Provider, operationIDs []string) map[string]OpRef {
- return OpRefsByRef(GatherOperations(specDoc, operationIDs))
-}
-
-// OpRefsByRef indexes a map of sortable operations
-func OpRefsByRef(oprefs map[string]OpRef) map[string]OpRef {
- result := make(map[string]OpRef, len(oprefs))
- for _, v := range oprefs {
- result[v.Ref.String()] = v
- }
-
- return result
-}
-
-// OpRef is an indexable, sortable operation
-type OpRef struct {
- Method string
- Path string
- Key string
- ID string
- Op *spec.Operation
- Ref spec.Ref
-}
-
-// OpRefs is a sortable collection of operations
-type OpRefs []OpRef
-
-func (o OpRefs) Len() int { return len(o) }
-func (o OpRefs) Swap(i, j int) { o[i], o[j] = o[j], o[i] }
-func (o OpRefs) Less(i, j int) bool { return o[i].Key < o[j].Key }
-
-// Provider knows how to collect operations from a spec
-type Provider interface {
- Operations() map[string]map[string]*spec.Operation
-}
-
-// GatherOperations builds a map of sorted operations from a spec
-func GatherOperations(specDoc Provider, operationIDs []string) map[string]OpRef {
- var oprefs OpRefs
-
- for method, pathItem := range specDoc.Operations() {
- for pth, operation := range pathItem {
- vv := *operation
- oprefs = append(oprefs, OpRef{
- Key: swag.ToGoName(strings.ToLower(method) + " " + pth),
- Method: method,
- Path: pth,
- ID: vv.ID,
- Op: &vv,
- Ref: spec.MustCreateRef("#" + path.Join("/paths", jsonpointer.Escape(pth), method)),
- })
- }
- }
-
- sort.Sort(oprefs)
-
- operations := make(map[string]OpRef)
- for _, opr := range oprefs {
- nm := opr.ID
- if nm == "" {
- nm = opr.Key
- }
-
- oo, found := operations[nm]
- if found && oo.Method != opr.Method && oo.Path != opr.Path {
- nm = opr.Key
- }
-
- if len(operationIDs) == 0 || swag.ContainsStrings(operationIDs, opr.ID) || swag.ContainsStrings(operationIDs, nm) {
- opr.ID = nm
- opr.Op.ID = nm
- operations[nm] = opr
- }
- }
-
- return operations
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/internal/flatten/replace/replace.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/internal/flatten/replace/replace.go
deleted file mode 100644
index c0f43e728..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/internal/flatten/replace/replace.go
+++ /dev/null
@@ -1,458 +0,0 @@
-package replace
-
-import (
- "encoding/json"
- "fmt"
- "net/url"
- "os"
- "path"
- "strconv"
-
- "github.com/go-openapi/analysis/internal/debug"
- "github.com/go-openapi/jsonpointer"
- "github.com/go-openapi/spec"
-)
-
-const definitionsPath = "#/definitions"
-
-var debugLog = debug.GetLogger("analysis/flatten/replace", os.Getenv("SWAGGER_DEBUG") != "")
-
-// RewriteSchemaToRef replaces a schema with a Ref
-func RewriteSchemaToRef(sp *spec.Swagger, key string, ref spec.Ref) error {
- debugLog("rewriting schema to ref for %s with %s", key, ref.String())
- _, value, err := getPointerFromKey(sp, key)
- if err != nil {
- return err
- }
-
- switch refable := value.(type) {
- case *spec.Schema:
- return rewriteParentRef(sp, key, ref)
-
- case spec.Schema:
- return rewriteParentRef(sp, key, ref)
-
- case *spec.SchemaOrArray:
- if refable.Schema != nil {
- refable.Schema = &spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}}
- }
-
- case *spec.SchemaOrBool:
- if refable.Schema != nil {
- refable.Schema = &spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}}
- }
- case map[string]interface{}: // this happens e.g. if a schema points to an extension unmarshaled as map[string]interface{}
- return rewriteParentRef(sp, key, ref)
- default:
- return fmt.Errorf("no schema with ref found at %s for %T", key, value)
- }
-
- return nil
-}
-
-func rewriteParentRef(sp *spec.Swagger, key string, ref spec.Ref) error {
- parent, entry, pvalue, err := getParentFromKey(sp, key)
- if err != nil {
- return err
- }
-
- debugLog("rewriting holder for %T", pvalue)
- switch container := pvalue.(type) {
- case spec.Response:
- if err := rewriteParentRef(sp, "#"+parent, ref); err != nil {
- return err
- }
-
- case *spec.Response:
- container.Schema = &spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}}
-
- case *spec.Responses:
- statusCode, err := strconv.Atoi(entry)
- if err != nil {
- return fmt.Errorf("%s not a number: %w", key[1:], err)
- }
- resp := container.StatusCodeResponses[statusCode]
- resp.Schema = &spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}}
- container.StatusCodeResponses[statusCode] = resp
-
- case map[string]spec.Response:
- resp := container[entry]
- resp.Schema = &spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}}
- container[entry] = resp
-
- case spec.Parameter:
- if err := rewriteParentRef(sp, "#"+parent, ref); err != nil {
- return err
- }
-
- case map[string]spec.Parameter:
- param := container[entry]
- param.Schema = &spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}}
- container[entry] = param
-
- case []spec.Parameter:
- idx, err := strconv.Atoi(entry)
- if err != nil {
- return fmt.Errorf("%s not a number: %w", key[1:], err)
- }
- param := container[idx]
- param.Schema = &spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}}
- container[idx] = param
-
- case spec.Definitions:
- container[entry] = spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}}
-
- case map[string]spec.Schema:
- container[entry] = spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}}
-
- case []spec.Schema:
- idx, err := strconv.Atoi(entry)
- if err != nil {
- return fmt.Errorf("%s not a number: %w", key[1:], err)
- }
- container[idx] = spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}}
-
- case *spec.SchemaOrArray:
- // NOTE: this is necessarily an array - otherwise, the parent would be *Schema
- idx, err := strconv.Atoi(entry)
- if err != nil {
- return fmt.Errorf("%s not a number: %w", key[1:], err)
- }
- container.Schemas[idx] = spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}}
-
- case spec.SchemaProperties:
- container[entry] = spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}}
-
- case *interface{}:
- *container = spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}}
-
- // NOTE: can't have case *spec.SchemaOrBool = parent in this case is *Schema
-
- default:
- return fmt.Errorf("unhandled parent schema rewrite %s (%T)", key, pvalue)
- }
-
- return nil
-}
-
-// getPointerFromKey retrieves the content of the JSON pointer "key"
-func getPointerFromKey(sp interface{}, key string) (string, interface{}, error) {
- switch sp.(type) {
- case *spec.Schema:
- case *spec.Swagger:
- default:
- panic("unexpected type used in getPointerFromKey")
- }
- if key == "#/" {
- return "", sp, nil
- }
- // unescape chars in key, e.g. "{}" from path params
- pth, _ := url.PathUnescape(key[1:])
- ptr, err := jsonpointer.New(pth)
- if err != nil {
- return "", nil, err
- }
-
- value, _, err := ptr.Get(sp)
- if err != nil {
- debugLog("error when getting key: %s with path: %s", key, pth)
-
- return "", nil, err
- }
-
- return pth, value, nil
-}
-
-// getParentFromKey retrieves the container of the JSON pointer "key"
-func getParentFromKey(sp interface{}, key string) (string, string, interface{}, error) {
- switch sp.(type) {
- case *spec.Schema:
- case *spec.Swagger:
- default:
- panic("unexpected type used in getPointerFromKey")
- }
- // unescape chars in key, e.g. "{}" from path params
- pth, _ := url.PathUnescape(key[1:])
-
- parent, entry := path.Dir(pth), path.Base(pth)
- debugLog("getting schema holder at: %s, with entry: %s", parent, entry)
-
- pptr, err := jsonpointer.New(parent)
- if err != nil {
- return "", "", nil, err
- }
- pvalue, _, err := pptr.Get(sp)
- if err != nil {
- return "", "", nil, fmt.Errorf("can't get parent for %s: %w", parent, err)
- }
-
- return parent, entry, pvalue, nil
-}
-
-// UpdateRef replaces a ref by another one
-func UpdateRef(sp interface{}, key string, ref spec.Ref) error {
- switch sp.(type) {
- case *spec.Schema:
- case *spec.Swagger:
- default:
- panic("unexpected type used in getPointerFromKey")
- }
- debugLog("updating ref for %s with %s", key, ref.String())
- pth, value, err := getPointerFromKey(sp, key)
- if err != nil {
- return err
- }
-
- switch refable := value.(type) {
- case *spec.Schema:
- refable.Ref = ref
- case *spec.SchemaOrArray:
- if refable.Schema != nil {
- refable.Schema.Ref = ref
- }
- case *spec.SchemaOrBool:
- if refable.Schema != nil {
- refable.Schema.Ref = ref
- }
- case spec.Schema:
- debugLog("rewriting holder for %T", refable)
- _, entry, pvalue, erp := getParentFromKey(sp, key)
- if erp != nil {
- return err
- }
- switch container := pvalue.(type) {
- case spec.Definitions:
- container[entry] = spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}}
-
- case map[string]spec.Schema:
- container[entry] = spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}}
-
- case []spec.Schema:
- idx, err := strconv.Atoi(entry)
- if err != nil {
- return fmt.Errorf("%s not a number: %w", pth, err)
- }
- container[idx] = spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}}
-
- case *spec.SchemaOrArray:
- // NOTE: this is necessarily an array - otherwise, the parent would be *Schema
- idx, err := strconv.Atoi(entry)
- if err != nil {
- return fmt.Errorf("%s not a number: %w", pth, err)
- }
- container.Schemas[idx] = spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}}
-
- case spec.SchemaProperties:
- container[entry] = spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}}
-
- // NOTE: can't have case *spec.SchemaOrBool = parent in this case is *Schema
-
- default:
- return fmt.Errorf("unhandled container type at %s: %T", key, value)
- }
-
- default:
- return fmt.Errorf("no schema with ref found at %s for %T", key, value)
- }
-
- return nil
-}
-
-// UpdateRefWithSchema replaces a ref with a schema (i.e. re-inline schema)
-func UpdateRefWithSchema(sp *spec.Swagger, key string, sch *spec.Schema) error {
- debugLog("updating ref for %s with schema", key)
- pth, value, err := getPointerFromKey(sp, key)
- if err != nil {
- return err
- }
-
- switch refable := value.(type) {
- case *spec.Schema:
- *refable = *sch
- case spec.Schema:
- _, entry, pvalue, erp := getParentFromKey(sp, key)
- if erp != nil {
- return err
- }
- switch container := pvalue.(type) {
- case spec.Definitions:
- container[entry] = *sch
-
- case map[string]spec.Schema:
- container[entry] = *sch
-
- case []spec.Schema:
- idx, err := strconv.Atoi(entry)
- if err != nil {
- return fmt.Errorf("%s not a number: %w", pth, err)
- }
- container[idx] = *sch
-
- case *spec.SchemaOrArray:
- // NOTE: this is necessarily an array - otherwise, the parent would be *Schema
- idx, err := strconv.Atoi(entry)
- if err != nil {
- return fmt.Errorf("%s not a number: %w", pth, err)
- }
- container.Schemas[idx] = *sch
-
- case spec.SchemaProperties:
- container[entry] = *sch
-
- // NOTE: can't have case *spec.SchemaOrBool = parent in this case is *Schema
-
- default:
- return fmt.Errorf("unhandled type for parent of [%s]: %T", key, value)
- }
- case *spec.SchemaOrArray:
- *refable.Schema = *sch
- // NOTE: can't have case *spec.SchemaOrBool = parent in this case is *Schema
- case *spec.SchemaOrBool:
- *refable.Schema = *sch
- default:
- return fmt.Errorf("no schema with ref found at %s for %T", key, value)
- }
-
- return nil
-}
-
-// DeepestRefResult holds the results from DeepestRef analysis
-type DeepestRefResult struct {
- Ref spec.Ref
- Schema *spec.Schema
- Warnings []string
-}
-
-// DeepestRef finds the first definition ref, from a cascade of nested refs which are not definitions.
-// - if no definition is found, returns the deepest ref.
-// - pointers to external files are expanded
-//
-// NOTE: all external $ref's are assumed to be already expanded at this stage.
-func DeepestRef(sp *spec.Swagger, opts *spec.ExpandOptions, ref spec.Ref) (*DeepestRefResult, error) {
- if !ref.HasFragmentOnly {
- // we found an external $ref, which is odd at this stage:
- // do nothing on external $refs
- return &DeepestRefResult{Ref: ref}, nil
- }
-
- currentRef := ref
- visited := make(map[string]bool, 64)
- warnings := make([]string, 0, 2)
-
-DOWNREF:
- for currentRef.String() != "" {
- if path.Dir(currentRef.String()) == definitionsPath {
- // this is a top-level definition: stop here and return this ref
- return &DeepestRefResult{Ref: currentRef}, nil
- }
-
- if _, beenThere := visited[currentRef.String()]; beenThere {
- return nil,
- fmt.Errorf("cannot resolve cyclic chain of pointers under %s", currentRef.String())
- }
-
- visited[currentRef.String()] = true
- value, _, err := currentRef.GetPointer().Get(sp)
- if err != nil {
- return nil, err
- }
-
- switch refable := value.(type) {
- case *spec.Schema:
- if refable.Ref.String() == "" {
- break DOWNREF
- }
- currentRef = refable.Ref
-
- case spec.Schema:
- if refable.Ref.String() == "" {
- break DOWNREF
- }
- currentRef = refable.Ref
-
- case *spec.SchemaOrArray:
- if refable.Schema == nil || refable.Schema != nil && refable.Schema.Ref.String() == "" {
- break DOWNREF
- }
- currentRef = refable.Schema.Ref
-
- case *spec.SchemaOrBool:
- if refable.Schema == nil || refable.Schema != nil && refable.Schema.Ref.String() == "" {
- break DOWNREF
- }
- currentRef = refable.Schema.Ref
-
- case spec.Response:
- // a pointer points to a schema initially marshalled in responses section...
- // Attempt to convert this to a schema. If this fails, the spec is invalid
- asJSON, _ := refable.MarshalJSON()
- var asSchema spec.Schema
-
- err := asSchema.UnmarshalJSON(asJSON)
- if err != nil {
- return nil,
- fmt.Errorf("invalid type for resolved JSON pointer %s. Expected a schema a, got: %T (%v)",
- currentRef.String(), value, err,
- )
- }
- warnings = append(warnings, fmt.Sprintf("found $ref %q (response) interpreted as schema", currentRef.String()))
-
- if asSchema.Ref.String() == "" {
- break DOWNREF
- }
- currentRef = asSchema.Ref
-
- case spec.Parameter:
- // a pointer points to a schema initially marshalled in parameters section...
- // Attempt to convert this to a schema. If this fails, the spec is invalid
- asJSON, _ := refable.MarshalJSON()
- var asSchema spec.Schema
- if err := asSchema.UnmarshalJSON(asJSON); err != nil {
- return nil,
- fmt.Errorf("invalid type for resolved JSON pointer %s. Expected a schema a, got: %T (%v)",
- currentRef.String(), value, err,
- )
- }
-
- warnings = append(warnings, fmt.Sprintf("found $ref %q (parameter) interpreted as schema", currentRef.String()))
-
- if asSchema.Ref.String() == "" {
- break DOWNREF
- }
- currentRef = asSchema.Ref
-
- default:
- // fallback: attempts to resolve the pointer as a schema
- if refable == nil {
- break DOWNREF
- }
-
- asJSON, _ := json.Marshal(refable)
- var asSchema spec.Schema
- if err := asSchema.UnmarshalJSON(asJSON); err != nil {
- return nil,
- fmt.Errorf("unhandled type to resolve JSON pointer %s. Expected a Schema, got: %T (%v)",
- currentRef.String(), value, err,
- )
- }
- warnings = append(warnings, fmt.Sprintf("found $ref %q (%T) interpreted as schema", currentRef.String(), refable))
-
- if asSchema.Ref.String() == "" {
- break DOWNREF
- }
- currentRef = asSchema.Ref
- }
- }
-
- // assess what schema we're ending with
- sch, erv := spec.ResolveRefWithBase(sp, ¤tRef, opts)
- if erv != nil {
- return nil, erv
- }
-
- if sch == nil {
- return nil, fmt.Errorf("no schema found at %s", currentRef.String())
- }
-
- return &DeepestRefResult{Ref: currentRef, Schema: sch, Warnings: warnings}, nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/internal/flatten/schutils/flatten_schema.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/internal/flatten/schutils/flatten_schema.go
deleted file mode 100644
index 4590236e6..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/internal/flatten/schutils/flatten_schema.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// Package schutils provides tools to save or clone a schema
-// when flattening a spec.
-package schutils
-
-import (
- "github.com/go-openapi/spec"
- "github.com/go-openapi/swag"
-)
-
-// Save registers a schema as an entry in spec #/definitions
-func Save(sp *spec.Swagger, name string, schema *spec.Schema) {
- if schema == nil {
- return
- }
-
- if sp.Definitions == nil {
- sp.Definitions = make(map[string]spec.Schema, 150)
- }
-
- sp.Definitions[name] = *schema
-}
-
-// Clone deep-clones a schema
-func Clone(schema *spec.Schema) *spec.Schema {
- var sch spec.Schema
- _ = swag.FromDynamicJSON(schema, &sch)
-
- return &sch
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/internal/flatten/sortref/keys.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/internal/flatten/sortref/keys.go
deleted file mode 100644
index ac80fc2e8..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/internal/flatten/sortref/keys.go
+++ /dev/null
@@ -1,201 +0,0 @@
-package sortref
-
-import (
- "net/http"
- "path"
- "strconv"
- "strings"
-
- "github.com/go-openapi/jsonpointer"
- "github.com/go-openapi/spec"
-)
-
-const (
- paths = "paths"
- responses = "responses"
- parameters = "parameters"
- definitions = "definitions"
-)
-
-var (
- ignoredKeys map[string]struct{}
- validMethods map[string]struct{}
-)
-
-func init() {
- ignoredKeys = map[string]struct{}{
- "schema": {},
- "properties": {},
- "not": {},
- "anyOf": {},
- "oneOf": {},
- }
-
- validMethods = map[string]struct{}{
- "GET": {},
- "HEAD": {},
- "OPTIONS": {},
- "PATCH": {},
- "POST": {},
- "PUT": {},
- "DELETE": {},
- }
-}
-
-// Key represent a key item constructed from /-separated segments
-type Key struct {
- Segments int
- Key string
-}
-
-// Keys is a sortable collable collection of Keys
-type Keys []Key
-
-func (k Keys) Len() int { return len(k) }
-func (k Keys) Swap(i, j int) { k[i], k[j] = k[j], k[i] }
-func (k Keys) Less(i, j int) bool {
- return k[i].Segments > k[j].Segments || (k[i].Segments == k[j].Segments && k[i].Key < k[j].Key)
-}
-
-// KeyParts construct a SplitKey with all its /-separated segments decomposed. It is sortable.
-func KeyParts(key string) SplitKey {
- var res []string
- for _, part := range strings.Split(key[1:], "/") {
- if part != "" {
- res = append(res, jsonpointer.Unescape(part))
- }
- }
-
- return res
-}
-
-// SplitKey holds of the parts of a /-separated key, so that their location may be determined.
-type SplitKey []string
-
-// IsDefinition is true when the split key is in the #/definitions section of a spec
-func (s SplitKey) IsDefinition() bool {
- return len(s) > 1 && s[0] == definitions
-}
-
-// DefinitionName yields the name of the definition
-func (s SplitKey) DefinitionName() string {
- if !s.IsDefinition() {
- return ""
- }
-
- return s[1]
-}
-
-func (s SplitKey) isKeyName(i int) bool {
- if i <= 0 {
- return false
- }
-
- count := 0
- for idx := i - 1; idx > 0; idx-- {
- if s[idx] != "properties" {
- break
- }
- count++
- }
-
- return count%2 != 0
-}
-
-// PartAdder know how to construct the components of a new name
-type PartAdder func(string) []string
-
-// BuildName builds a name from segments
-func (s SplitKey) BuildName(segments []string, startIndex int, adder PartAdder) string {
- for i, part := range s[startIndex:] {
- if _, ignored := ignoredKeys[part]; !ignored || s.isKeyName(startIndex+i) {
- segments = append(segments, adder(part)...)
- }
- }
-
- return strings.Join(segments, " ")
-}
-
-// IsOperation is true when the split key is in the operations section
-func (s SplitKey) IsOperation() bool {
- return len(s) > 1 && s[0] == paths
-}
-
-// IsSharedOperationParam is true when the split key is in the parameters section of a path
-func (s SplitKey) IsSharedOperationParam() bool {
- return len(s) > 2 && s[0] == paths && s[2] == parameters
-}
-
-// IsSharedParam is true when the split key is in the #/parameters section of a spec
-func (s SplitKey) IsSharedParam() bool {
- return len(s) > 1 && s[0] == parameters
-}
-
-// IsOperationParam is true when the split key is in the parameters section of an operation
-func (s SplitKey) IsOperationParam() bool {
- return len(s) > 3 && s[0] == paths && s[3] == parameters
-}
-
-// IsOperationResponse is true when the split key is in the responses section of an operation
-func (s SplitKey) IsOperationResponse() bool {
- return len(s) > 3 && s[0] == paths && s[3] == responses
-}
-
-// IsSharedResponse is true when the split key is in the #/responses section of a spec
-func (s SplitKey) IsSharedResponse() bool {
- return len(s) > 1 && s[0] == responses
-}
-
-// IsDefaultResponse is true when the split key is the default response for an operation
-func (s SplitKey) IsDefaultResponse() bool {
- return len(s) > 4 && s[0] == paths && s[3] == responses && s[4] == "default"
-}
-
-// IsStatusCodeResponse is true when the split key is an operation response with a status code
-func (s SplitKey) IsStatusCodeResponse() bool {
- isInt := func() bool {
- _, err := strconv.Atoi(s[4])
-
- return err == nil
- }
-
- return len(s) > 4 && s[0] == paths && s[3] == responses && isInt()
-}
-
-// ResponseName yields either the status code or "Default" for a response
-func (s SplitKey) ResponseName() string {
- if s.IsStatusCodeResponse() {
- code, _ := strconv.Atoi(s[4])
-
- return http.StatusText(code)
- }
-
- if s.IsDefaultResponse() {
- return "Default"
- }
-
- return ""
-}
-
-// PathItemRef constructs a $ref object from a split key of the form /{path}/{method}
-func (s SplitKey) PathItemRef() spec.Ref {
- if len(s) < 3 {
- return spec.Ref{}
- }
-
- pth, method := s[1], s[2]
- if _, isValidMethod := validMethods[strings.ToUpper(method)]; !isValidMethod && !strings.HasPrefix(method, "x-") {
- return spec.Ref{}
- }
-
- return spec.MustCreateRef("#" + path.Join("/", paths, jsonpointer.Escape(pth), strings.ToUpper(method)))
-}
-
-// PathRef constructs a $ref object from a split key of the form /paths/{reference}
-func (s SplitKey) PathRef() spec.Ref {
- if !s.IsOperation() {
- return spec.Ref{}
- }
-
- return spec.MustCreateRef("#" + path.Join("/", paths, jsonpointer.Escape(s[1])))
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/internal/flatten/sortref/sort_ref.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/internal/flatten/sortref/sort_ref.go
deleted file mode 100644
index 73243df87..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/internal/flatten/sortref/sort_ref.go
+++ /dev/null
@@ -1,141 +0,0 @@
-package sortref
-
-import (
- "reflect"
- "sort"
- "strings"
-
- "github.com/go-openapi/analysis/internal/flatten/normalize"
- "github.com/go-openapi/spec"
-)
-
-var depthGroupOrder = []string{
- "sharedParam", "sharedResponse", "sharedOpParam", "opParam", "codeResponse", "defaultResponse", "definition",
-}
-
-type mapIterator struct {
- len int
- mapIter *reflect.MapIter
-}
-
-func (i *mapIterator) Next() bool {
- return i.mapIter.Next()
-}
-
-func (i *mapIterator) Len() int {
- return i.len
-}
-
-func (i *mapIterator) Key() string {
- return i.mapIter.Key().String()
-}
-
-func mustMapIterator(anyMap interface{}) *mapIterator {
- val := reflect.ValueOf(anyMap)
-
- return &mapIterator{mapIter: val.MapRange(), len: val.Len()}
-}
-
-// DepthFirst sorts a map of anything. It groups keys by category
-// (shared params, op param, statuscode response, default response, definitions)
-// sort groups internally by number of parts in the key and lexical names
-// flatten groups into a single list of keys
-func DepthFirst(in interface{}) []string {
- iterator := mustMapIterator(in)
- sorted := make([]string, 0, iterator.Len())
- grouped := make(map[string]Keys, iterator.Len())
-
- for iterator.Next() {
- k := iterator.Key()
- split := KeyParts(k)
- var pk string
-
- if split.IsSharedOperationParam() {
- pk = "sharedOpParam"
- }
- if split.IsOperationParam() {
- pk = "opParam"
- }
- if split.IsStatusCodeResponse() {
- pk = "codeResponse"
- }
- if split.IsDefaultResponse() {
- pk = "defaultResponse"
- }
- if split.IsDefinition() {
- pk = "definition"
- }
- if split.IsSharedParam() {
- pk = "sharedParam"
- }
- if split.IsSharedResponse() {
- pk = "sharedResponse"
- }
- grouped[pk] = append(grouped[pk], Key{Segments: len(split), Key: k})
- }
-
- for _, pk := range depthGroupOrder {
- res := grouped[pk]
- sort.Sort(res)
-
- for _, v := range res {
- sorted = append(sorted, v.Key)
- }
- }
-
- return sorted
-}
-
-// topMostRefs is able to sort refs by hierarchical then lexicographic order,
-// yielding refs ordered breadth-first.
-type topmostRefs []string
-
-func (k topmostRefs) Len() int { return len(k) }
-func (k topmostRefs) Swap(i, j int) { k[i], k[j] = k[j], k[i] }
-func (k topmostRefs) Less(i, j int) bool {
- li, lj := len(strings.Split(k[i], "/")), len(strings.Split(k[j], "/"))
- if li == lj {
- return k[i] < k[j]
- }
-
- return li < lj
-}
-
-// TopmostFirst sorts references by depth
-func TopmostFirst(refs []string) []string {
- res := topmostRefs(refs)
- sort.Sort(res)
-
- return res
-}
-
-// RefRevIdx is a reverse index for references
-type RefRevIdx struct {
- Ref spec.Ref
- Keys []string
-}
-
-// ReverseIndex builds a reverse index for references in schemas
-func ReverseIndex(schemas map[string]spec.Ref, basePath string) map[string]RefRevIdx {
- collected := make(map[string]RefRevIdx)
- for key, schRef := range schemas {
- // normalize paths before sorting,
- // so we get together keys that are from the same external file
- normalizedPath := normalize.Path(schRef, basePath)
-
- entry, ok := collected[normalizedPath]
- if ok {
- entry.Keys = append(entry.Keys, key)
- collected[normalizedPath] = entry
-
- continue
- }
-
- collected[normalizedPath] = RefRevIdx{
- Ref: schRef,
- Keys: []string{key},
- }
- }
-
- return collected
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/mixin.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/mixin.go
deleted file mode 100644
index 7785a29b2..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/mixin.go
+++ /dev/null
@@ -1,515 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package analysis
-
-import (
- "fmt"
- "reflect"
-
- "github.com/go-openapi/spec"
-)
-
-// Mixin modifies the primary swagger spec by adding the paths and
-// definitions from the mixin specs. Top level parameters and
-// responses from the mixins are also carried over. Operation id
-// collisions are avoided by appending "Mixin" but only if
-// needed.
-//
-// The following parts of primary are subject to merge, filling empty details
-// - Info
-// - BasePath
-// - Host
-// - ExternalDocs
-//
-// Consider calling FixEmptyResponseDescriptions() on the modified primary
-// if you read them from storage and they are valid to start with.
-//
-// Entries in "paths", "definitions", "parameters" and "responses" are
-// added to the primary in the order of the given mixins. If the entry
-// already exists in primary it is skipped with a warning message.
-//
-// The count of skipped entries (from collisions) is returned so any
-// deviation from the number expected can flag a warning in your build
-// scripts. Carefully review the collisions before accepting them;
-// consider renaming things if possible.
-//
-// No key normalization takes place (paths, type defs,
-// etc). Ensure they are canonical if your downstream tools do
-// key normalization of any form.
-//
-// Merging schemes (http, https), and consumers/producers do not account for
-// collisions.
-func Mixin(primary *spec.Swagger, mixins ...*spec.Swagger) []string {
- skipped := make([]string, 0, len(mixins))
- opIDs := getOpIDs(primary)
- initPrimary(primary)
-
- for i, m := range mixins {
- skipped = append(skipped, mergeSwaggerProps(primary, m)...)
-
- skipped = append(skipped, mergeConsumes(primary, m)...)
-
- skipped = append(skipped, mergeProduces(primary, m)...)
-
- skipped = append(skipped, mergeTags(primary, m)...)
-
- skipped = append(skipped, mergeSchemes(primary, m)...)
-
- skipped = append(skipped, mergeSecurityDefinitions(primary, m)...)
-
- skipped = append(skipped, mergeSecurityRequirements(primary, m)...)
-
- skipped = append(skipped, mergeDefinitions(primary, m)...)
-
- // merging paths requires a map of operationIDs to work with
- skipped = append(skipped, mergePaths(primary, m, opIDs, i)...)
-
- skipped = append(skipped, mergeParameters(primary, m)...)
-
- skipped = append(skipped, mergeResponses(primary, m)...)
- }
-
- return skipped
-}
-
-// getOpIDs extracts all the paths..operationIds from the given
-// spec and returns them as the keys in a map with 'true' values.
-func getOpIDs(s *spec.Swagger) map[string]bool {
- rv := make(map[string]bool)
- if s.Paths == nil {
- return rv
- }
-
- for _, v := range s.Paths.Paths {
- piops := pathItemOps(v)
-
- for _, op := range piops {
- rv[op.ID] = true
- }
- }
-
- return rv
-}
-
-func pathItemOps(p spec.PathItem) []*spec.Operation {
- var rv []*spec.Operation
- rv = appendOp(rv, p.Get)
- rv = appendOp(rv, p.Put)
- rv = appendOp(rv, p.Post)
- rv = appendOp(rv, p.Delete)
- rv = appendOp(rv, p.Head)
- rv = appendOp(rv, p.Patch)
-
- return rv
-}
-
-func appendOp(ops []*spec.Operation, op *spec.Operation) []*spec.Operation {
- if op == nil {
- return ops
- }
-
- return append(ops, op)
-}
-
-func mergeSecurityDefinitions(primary *spec.Swagger, m *spec.Swagger) (skipped []string) {
- for k, v := range m.SecurityDefinitions {
- if _, exists := primary.SecurityDefinitions[k]; exists {
- warn := fmt.Sprintf(
- "SecurityDefinitions entry '%v' already exists in primary or higher priority mixin, skipping\n", k)
- skipped = append(skipped, warn)
-
- continue
- }
-
- primary.SecurityDefinitions[k] = v
- }
-
- return
-}
-
-func mergeSecurityRequirements(primary *spec.Swagger, m *spec.Swagger) (skipped []string) {
- for _, v := range m.Security {
- found := false
- for _, vv := range primary.Security {
- if reflect.DeepEqual(v, vv) {
- found = true
-
- break
- }
- }
-
- if found {
- warn := fmt.Sprintf(
- "Security requirement: '%v' already exists in primary or higher priority mixin, skipping\n", v)
- skipped = append(skipped, warn)
-
- continue
- }
- primary.Security = append(primary.Security, v)
- }
-
- return
-}
-
-func mergeDefinitions(primary *spec.Swagger, m *spec.Swagger) (skipped []string) {
- for k, v := range m.Definitions {
- // assume name collisions represent IDENTICAL type. careful.
- if _, exists := primary.Definitions[k]; exists {
- warn := fmt.Sprintf(
- "definitions entry '%v' already exists in primary or higher priority mixin, skipping\n", k)
- skipped = append(skipped, warn)
-
- continue
- }
- primary.Definitions[k] = v
- }
-
- return
-}
-
-func mergePaths(primary *spec.Swagger, m *spec.Swagger, opIDs map[string]bool, mixIndex int) (skipped []string) {
- if m.Paths != nil {
- for k, v := range m.Paths.Paths {
- if _, exists := primary.Paths.Paths[k]; exists {
- warn := fmt.Sprintf(
- "paths entry '%v' already exists in primary or higher priority mixin, skipping\n", k)
- skipped = append(skipped, warn)
-
- continue
- }
-
- // Swagger requires that operationIds be
- // unique within a spec. If we find a
- // collision we append "Mixin0" to the
- // operatoinId we are adding, where 0 is mixin
- // index. We assume that operationIds with
- // all the proivded specs are already unique.
- piops := pathItemOps(v)
- for _, piop := range piops {
- if opIDs[piop.ID] {
- piop.ID = fmt.Sprintf("%v%v%v", piop.ID, "Mixin", mixIndex)
- }
- opIDs[piop.ID] = true
- }
- primary.Paths.Paths[k] = v
- }
- }
-
- return
-}
-
-func mergeParameters(primary *spec.Swagger, m *spec.Swagger) (skipped []string) {
- for k, v := range m.Parameters {
- // could try to rename on conflict but would
- // have to fix $refs in the mixin. Complain
- // for now
- if _, exists := primary.Parameters[k]; exists {
- warn := fmt.Sprintf(
- "top level parameters entry '%v' already exists in primary or higher priority mixin, skipping\n", k)
- skipped = append(skipped, warn)
-
- continue
- }
- primary.Parameters[k] = v
- }
-
- return
-}
-
-func mergeResponses(primary *spec.Swagger, m *spec.Swagger) (skipped []string) {
- for k, v := range m.Responses {
- // could try to rename on conflict but would
- // have to fix $refs in the mixin. Complain
- // for now
- if _, exists := primary.Responses[k]; exists {
- warn := fmt.Sprintf(
- "top level responses entry '%v' already exists in primary or higher priority mixin, skipping\n", k)
- skipped = append(skipped, warn)
-
- continue
- }
- primary.Responses[k] = v
- }
-
- return skipped
-}
-
-func mergeConsumes(primary *spec.Swagger, m *spec.Swagger) []string {
- for _, v := range m.Consumes {
- found := false
- for _, vv := range primary.Consumes {
- if v == vv {
- found = true
-
- break
- }
- }
-
- if found {
- // no warning here: we just skip it
- continue
- }
- primary.Consumes = append(primary.Consumes, v)
- }
-
- return []string{}
-}
-
-func mergeProduces(primary *spec.Swagger, m *spec.Swagger) []string {
- for _, v := range m.Produces {
- found := false
- for _, vv := range primary.Produces {
- if v == vv {
- found = true
-
- break
- }
- }
-
- if found {
- // no warning here: we just skip it
- continue
- }
- primary.Produces = append(primary.Produces, v)
- }
-
- return []string{}
-}
-
-func mergeTags(primary *spec.Swagger, m *spec.Swagger) (skipped []string) {
- for _, v := range m.Tags {
- found := false
- for _, vv := range primary.Tags {
- if v.Name == vv.Name {
- found = true
-
- break
- }
- }
-
- if found {
- warn := fmt.Sprintf(
- "top level tags entry with name '%v' already exists in primary or higher priority mixin, skipping\n",
- v.Name,
- )
- skipped = append(skipped, warn)
-
- continue
- }
-
- primary.Tags = append(primary.Tags, v)
- }
-
- return
-}
-
-func mergeSchemes(primary *spec.Swagger, m *spec.Swagger) []string {
- for _, v := range m.Schemes {
- found := false
- for _, vv := range primary.Schemes {
- if v == vv {
- found = true
-
- break
- }
- }
-
- if found {
- // no warning here: we just skip it
- continue
- }
- primary.Schemes = append(primary.Schemes, v)
- }
-
- return []string{}
-}
-
-func mergeSwaggerProps(primary *spec.Swagger, m *spec.Swagger) []string {
- var skipped, skippedInfo, skippedDocs []string
-
- primary.Extensions, skipped = mergeExtensions(primary.Extensions, m.Extensions)
-
- // merging details in swagger top properties
- if primary.Host == "" {
- primary.Host = m.Host
- }
-
- if primary.BasePath == "" {
- primary.BasePath = m.BasePath
- }
-
- if primary.Info == nil {
- primary.Info = m.Info
- } else if m.Info != nil {
- skippedInfo = mergeInfo(primary.Info, m.Info)
- skipped = append(skipped, skippedInfo...)
- }
-
- if primary.ExternalDocs == nil {
- primary.ExternalDocs = m.ExternalDocs
- } else if m != nil {
- skippedDocs = mergeExternalDocs(primary.ExternalDocs, m.ExternalDocs)
- skipped = append(skipped, skippedDocs...)
- }
-
- return skipped
-}
-
-//nolint:unparam
-func mergeExternalDocs(primary *spec.ExternalDocumentation, m *spec.ExternalDocumentation) []string {
- if primary.Description == "" {
- primary.Description = m.Description
- }
-
- if primary.URL == "" {
- primary.URL = m.URL
- }
-
- return nil
-}
-
-func mergeInfo(primary *spec.Info, m *spec.Info) []string {
- var sk, skipped []string
-
- primary.Extensions, sk = mergeExtensions(primary.Extensions, m.Extensions)
- skipped = append(skipped, sk...)
-
- if primary.Description == "" {
- primary.Description = m.Description
- }
-
- if primary.Title == "" {
- primary.Description = m.Description
- }
-
- if primary.TermsOfService == "" {
- primary.TermsOfService = m.TermsOfService
- }
-
- if primary.Version == "" {
- primary.Version = m.Version
- }
-
- if primary.Contact == nil {
- primary.Contact = m.Contact
- } else if m.Contact != nil {
- var csk []string
- primary.Contact.Extensions, csk = mergeExtensions(primary.Contact.Extensions, m.Contact.Extensions)
- skipped = append(skipped, csk...)
-
- if primary.Contact.Name == "" {
- primary.Contact.Name = m.Contact.Name
- }
-
- if primary.Contact.URL == "" {
- primary.Contact.URL = m.Contact.URL
- }
-
- if primary.Contact.Email == "" {
- primary.Contact.Email = m.Contact.Email
- }
- }
-
- if primary.License == nil {
- primary.License = m.License
- } else if m.License != nil {
- var lsk []string
- primary.License.Extensions, lsk = mergeExtensions(primary.License.Extensions, m.License.Extensions)
- skipped = append(skipped, lsk...)
-
- if primary.License.Name == "" {
- primary.License.Name = m.License.Name
- }
-
- if primary.License.URL == "" {
- primary.License.URL = m.License.URL
- }
- }
-
- return skipped
-}
-
-func mergeExtensions(primary spec.Extensions, m spec.Extensions) (result spec.Extensions, skipped []string) {
- if primary == nil {
- result = m
-
- return
- }
-
- if m == nil {
- result = primary
-
- return
- }
-
- result = primary
- for k, v := range m {
- if _, found := primary[k]; found {
- skipped = append(skipped, k)
-
- continue
- }
-
- primary[k] = v
- }
-
- return
-}
-
-func initPrimary(primary *spec.Swagger) {
- if primary.SecurityDefinitions == nil {
- primary.SecurityDefinitions = make(map[string]*spec.SecurityScheme)
- }
-
- if primary.Security == nil {
- primary.Security = make([]map[string][]string, 0, 10)
- }
-
- if primary.Produces == nil {
- primary.Produces = make([]string, 0, 10)
- }
-
- if primary.Consumes == nil {
- primary.Consumes = make([]string, 0, 10)
- }
-
- if primary.Tags == nil {
- primary.Tags = make([]spec.Tag, 0, 10)
- }
-
- if primary.Schemes == nil {
- primary.Schemes = make([]string, 0, 10)
- }
-
- if primary.Paths == nil {
- primary.Paths = &spec.Paths{Paths: make(map[string]spec.PathItem)}
- }
-
- if primary.Paths.Paths == nil {
- primary.Paths.Paths = make(map[string]spec.PathItem)
- }
-
- if primary.Definitions == nil {
- primary.Definitions = make(spec.Definitions)
- }
-
- if primary.Parameters == nil {
- primary.Parameters = make(map[string]spec.Parameter)
- }
-
- if primary.Responses == nil {
- primary.Responses = make(map[string]spec.Response)
- }
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/schema.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/schema.go
deleted file mode 100644
index ab190db5b..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/analysis/schema.go
+++ /dev/null
@@ -1,256 +0,0 @@
-package analysis
-
-import (
- "errors"
-
- "github.com/go-openapi/spec"
- "github.com/go-openapi/strfmt"
-)
-
-// SchemaOpts configures the schema analyzer
-type SchemaOpts struct {
- Schema *spec.Schema
- Root interface{}
- BasePath string
- _ struct{}
-}
-
-// Schema analysis, will classify the schema according to known
-// patterns.
-func Schema(opts SchemaOpts) (*AnalyzedSchema, error) {
- if opts.Schema == nil {
- return nil, errors.New("no schema to analyze")
- }
-
- a := &AnalyzedSchema{
- schema: opts.Schema,
- root: opts.Root,
- basePath: opts.BasePath,
- }
-
- a.initializeFlags()
- a.inferKnownType()
- a.inferEnum()
- a.inferBaseType()
-
- if err := a.inferMap(); err != nil {
- return nil, err
- }
- if err := a.inferArray(); err != nil {
- return nil, err
- }
-
- a.inferTuple()
-
- if err := a.inferFromRef(); err != nil {
- return nil, err
- }
-
- a.inferSimpleSchema()
-
- return a, nil
-}
-
-// AnalyzedSchema indicates what the schema represents
-type AnalyzedSchema struct {
- schema *spec.Schema
- root interface{}
- basePath string
-
- hasProps bool
- hasAllOf bool
- hasItems bool
- hasAdditionalProps bool
- hasAdditionalItems bool
- hasRef bool
-
- IsKnownType bool
- IsSimpleSchema bool
- IsArray bool
- IsSimpleArray bool
- IsMap bool
- IsSimpleMap bool
- IsExtendedObject bool
- IsTuple bool
- IsTupleWithExtra bool
- IsBaseType bool
- IsEnum bool
-}
-
-// Inherits copies value fields from other onto this schema
-func (a *AnalyzedSchema) inherits(other *AnalyzedSchema) {
- if other == nil {
- return
- }
- a.hasProps = other.hasProps
- a.hasAllOf = other.hasAllOf
- a.hasItems = other.hasItems
- a.hasAdditionalItems = other.hasAdditionalItems
- a.hasAdditionalProps = other.hasAdditionalProps
- a.hasRef = other.hasRef
-
- a.IsKnownType = other.IsKnownType
- a.IsSimpleSchema = other.IsSimpleSchema
- a.IsArray = other.IsArray
- a.IsSimpleArray = other.IsSimpleArray
- a.IsMap = other.IsMap
- a.IsSimpleMap = other.IsSimpleMap
- a.IsExtendedObject = other.IsExtendedObject
- a.IsTuple = other.IsTuple
- a.IsTupleWithExtra = other.IsTupleWithExtra
- a.IsBaseType = other.IsBaseType
- a.IsEnum = other.IsEnum
-}
-
-func (a *AnalyzedSchema) inferFromRef() error {
- if a.hasRef {
- sch := new(spec.Schema)
- sch.Ref = a.schema.Ref
- err := spec.ExpandSchema(sch, a.root, nil)
- if err != nil {
- return err
- }
- rsch, err := Schema(SchemaOpts{
- Schema: sch,
- Root: a.root,
- BasePath: a.basePath,
- })
- if err != nil {
- // NOTE(fredbi): currently the only cause for errors is
- // unresolved ref. Since spec.ExpandSchema() expands the
- // schema recursively, there is no chance to get there,
- // until we add more causes for error in this schema analysis.
- return err
- }
- a.inherits(rsch)
- }
-
- return nil
-}
-
-func (a *AnalyzedSchema) inferSimpleSchema() {
- a.IsSimpleSchema = a.IsKnownType || a.IsSimpleArray || a.IsSimpleMap
-}
-
-func (a *AnalyzedSchema) inferKnownType() {
- tpe := a.schema.Type
- format := a.schema.Format
- a.IsKnownType = tpe.Contains("boolean") ||
- tpe.Contains("integer") ||
- tpe.Contains("number") ||
- tpe.Contains("string") ||
- (format != "" && strfmt.Default.ContainsName(format)) ||
- (a.isObjectType() && !a.hasProps && !a.hasAllOf && !a.hasAdditionalProps && !a.hasAdditionalItems)
-}
-
-func (a *AnalyzedSchema) inferMap() error {
- if !a.isObjectType() {
- return nil
- }
-
- hasExtra := a.hasProps || a.hasAllOf
- a.IsMap = a.hasAdditionalProps && !hasExtra
- a.IsExtendedObject = a.hasAdditionalProps && hasExtra
-
- if !a.IsMap {
- return nil
- }
-
- // maps
- if a.schema.AdditionalProperties.Schema != nil {
- msch, err := Schema(SchemaOpts{
- Schema: a.schema.AdditionalProperties.Schema,
- Root: a.root,
- BasePath: a.basePath,
- })
- if err != nil {
- return err
- }
- a.IsSimpleMap = msch.IsSimpleSchema
- } else if a.schema.AdditionalProperties.Allows {
- a.IsSimpleMap = true
- }
-
- return nil
-}
-
-func (a *AnalyzedSchema) inferArray() error {
- // an array has Items defined as an object schema, otherwise we qualify this JSON array as a tuple
- // (yes, even if the Items array contains only one element).
- // arrays in JSON schema may be unrestricted (i.e no Items specified).
- // Note that arrays in Swagger MUST have Items. Nonetheless, we analyze unrestricted arrays.
- //
- // NOTE: the spec package misses the distinction between:
- // items: [] and items: {}, so we consider both arrays here.
- a.IsArray = a.isArrayType() && (a.schema.Items == nil || a.schema.Items.Schemas == nil)
- if a.IsArray && a.hasItems {
- if a.schema.Items.Schema != nil {
- itsch, err := Schema(SchemaOpts{
- Schema: a.schema.Items.Schema,
- Root: a.root,
- BasePath: a.basePath,
- })
- if err != nil {
- return err
- }
-
- a.IsSimpleArray = itsch.IsSimpleSchema
- }
- }
-
- if a.IsArray && !a.hasItems {
- a.IsSimpleArray = true
- }
-
- return nil
-}
-
-func (a *AnalyzedSchema) inferTuple() {
- tuple := a.hasItems && a.schema.Items.Schemas != nil
- a.IsTuple = tuple && !a.hasAdditionalItems
- a.IsTupleWithExtra = tuple && a.hasAdditionalItems
-}
-
-func (a *AnalyzedSchema) inferBaseType() {
- if a.isObjectType() {
- a.IsBaseType = a.schema.Discriminator != ""
- }
-}
-
-func (a *AnalyzedSchema) inferEnum() {
- a.IsEnum = len(a.schema.Enum) > 0
-}
-
-func (a *AnalyzedSchema) initializeFlags() {
- a.hasProps = len(a.schema.Properties) > 0
- a.hasAllOf = len(a.schema.AllOf) > 0
- a.hasRef = a.schema.Ref.String() != ""
-
- a.hasItems = a.schema.Items != nil &&
- (a.schema.Items.Schema != nil || len(a.schema.Items.Schemas) > 0)
-
- a.hasAdditionalProps = a.schema.AdditionalProperties != nil &&
- (a.schema.AdditionalProperties.Schema != nil || a.schema.AdditionalProperties.Allows)
-
- a.hasAdditionalItems = a.schema.AdditionalItems != nil &&
- (a.schema.AdditionalItems.Schema != nil || a.schema.AdditionalItems.Allows)
-}
-
-func (a *AnalyzedSchema) isObjectType() bool {
- return !a.hasRef && (a.schema.Type == nil || a.schema.Type.Contains("") || a.schema.Type.Contains("object"))
-}
-
-func (a *AnalyzedSchema) isArrayType() bool {
- return !a.hasRef && (a.schema.Type != nil && a.schema.Type.Contains("array"))
-}
-
-// isAnalyzedAsComplex determines if an analyzed schema is eligible to flattening (i.e. it is "complex").
-//
-// Complex means the schema is any of:
-// - a simple type (primitive)
-// - an array of something (items are possibly complex ; if this is the case, items will generate a definition)
-// - a map of something (additionalProperties are possibly complex ; if this is the case, additionalProperties will
-// generate a definition)
-func (a *AnalyzedSchema) isAnalyzedAsComplex() bool {
- return !a.IsSimpleSchema && !a.IsArray && !a.IsMap
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/.gitattributes b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/.gitattributes
deleted file mode 100644
index a0717e4b3..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-*.go text eol=lf
\ No newline at end of file
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/.gitignore b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/.gitignore
deleted file mode 100644
index dd91ed6a0..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-secrets.yml
-coverage.out
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/.golangci.yml b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/.golangci.yml
deleted file mode 100644
index ee8b9bd1f..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/.golangci.yml
+++ /dev/null
@@ -1,55 +0,0 @@
-linters-settings:
- gocyclo:
- min-complexity: 45
- dupl:
- threshold: 200
- goconst:
- min-len: 2
- min-occurrences: 3
-
-linters:
- enable-all: true
- disable:
- - unparam
- - lll
- - gochecknoinits
- - gochecknoglobals
- - funlen
- - godox
- - gocognit
- - whitespace
- - wsl
- - wrapcheck
- - testpackage
- - nlreturn
- - errorlint
- - nestif
- - godot
- - gofumpt
- - paralleltest
- - tparallel
- - thelper
- - exhaustruct
- - varnamelen
- - gci
- - depguard
- - errchkjson
- - inamedparam
- - nonamedreturns
- - musttag
- - ireturn
- - forcetypeassert
- - cyclop
- # deprecated linters
- #- deadcode
- #- interfacer
- #- scopelint
- #- varcheck
- #- structcheck
- #- golint
- #- nosnakecase
- #- maligned
- #- goerr113
- #- ifshort
- #- gomnd
- #- exhaustivestruct
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/CODE_OF_CONDUCT.md b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/CODE_OF_CONDUCT.md
deleted file mode 100644
index 9322b065e..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/CODE_OF_CONDUCT.md
+++ /dev/null
@@ -1,74 +0,0 @@
-# Contributor Covenant Code of Conduct
-
-## Our Pledge
-
-In the interest of fostering an open and welcoming environment, we as
-contributors and maintainers pledge to making participation in our project and
-our community a harassment-free experience for everyone, regardless of age, body
-size, disability, ethnicity, gender identity and expression, level of experience,
-nationality, personal appearance, race, religion, or sexual identity and
-orientation.
-
-## Our Standards
-
-Examples of behavior that contributes to creating a positive environment
-include:
-
-* Using welcoming and inclusive language
-* Being respectful of differing viewpoints and experiences
-* Gracefully accepting constructive criticism
-* Focusing on what is best for the community
-* Showing empathy towards other community members
-
-Examples of unacceptable behavior by participants include:
-
-* The use of sexualized language or imagery and unwelcome sexual attention or
-advances
-* Trolling, insulting/derogatory comments, and personal or political attacks
-* Public or private harassment
-* Publishing others' private information, such as a physical or electronic
- address, without explicit permission
-* Other conduct which could reasonably be considered inappropriate in a
- professional setting
-
-## Our Responsibilities
-
-Project maintainers are responsible for clarifying the standards of acceptable
-behavior and are expected to take appropriate and fair corrective action in
-response to any instances of unacceptable behavior.
-
-Project maintainers have the right and responsibility to remove, edit, or
-reject comments, commits, code, wiki edits, issues, and other contributions
-that are not aligned to this Code of Conduct, or to ban temporarily or
-permanently any contributor for other behaviors that they deem inappropriate,
-threatening, offensive, or harmful.
-
-## Scope
-
-This Code of Conduct applies both within project spaces and in public spaces
-when an individual is representing the project or its community. Examples of
-representing a project or community include using an official project e-mail
-address, posting via an official social media account, or acting as an appointed
-representative at an online or offline event. Representation of a project may be
-further defined and clarified by project maintainers.
-
-## Enforcement
-
-Instances of abusive, harassing, or otherwise unacceptable behavior may be
-reported by contacting the project team at ivan+abuse@flanders.co.nz. All
-complaints will be reviewed and investigated and will result in a response that
-is deemed necessary and appropriate to the circumstances. The project team is
-obligated to maintain confidentiality with regard to the reporter of an incident.
-Further details of specific enforcement policies may be posted separately.
-
-Project maintainers who do not follow or enforce the Code of Conduct in good
-faith may face temporary or permanent repercussions as determined by other
-members of the project's leadership.
-
-## Attribution
-
-This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
-available at [http://contributor-covenant.org/version/1/4][version]
-
-[homepage]: http://contributor-covenant.org
-[version]: http://contributor-covenant.org/version/1/4/
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/LICENSE b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/LICENSE
deleted file mode 100644
index d64569567..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/README.md b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/README.md
deleted file mode 100644
index 6d57ea55c..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# OpenAPI errors [](https://github.com/go-openapi/errors/actions?query=workflow%3A"go+test") [](https://codecov.io/gh/go-openapi/errors)
-
-[](https://slackin.goswagger.io)
-[](https://raw.githubusercontent.com/go-openapi/errors/master/LICENSE)
-[](https://pkg.go.dev/github.com/go-openapi/errors)
-[](https://goreportcard.com/report/github.com/go-openapi/errors)
-
-Shared errors and error interface used throughout the various libraries found in the go-openapi toolkit.
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/api.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/api.go
deleted file mode 100644
index d6f507f42..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/api.go
+++ /dev/null
@@ -1,192 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package errors
-
-import (
- "encoding/json"
- "fmt"
- "net/http"
- "reflect"
- "strings"
-)
-
-// DefaultHTTPCode is used when the error Code cannot be used as an HTTP code.
-var DefaultHTTPCode = http.StatusUnprocessableEntity
-
-// Error represents a error interface all swagger framework errors implement
-type Error interface {
- error
- Code() int32
-}
-
-type apiError struct {
- code int32
- message string
-}
-
-func (a *apiError) Error() string {
- return a.message
-}
-
-func (a *apiError) Code() int32 {
- return a.code
-}
-
-// MarshalJSON implements the JSON encoding interface
-func (a apiError) MarshalJSON() ([]byte, error) {
- return json.Marshal(map[string]interface{}{
- "code": a.code,
- "message": a.message,
- })
-}
-
-// New creates a new API error with a code and a message
-func New(code int32, message string, args ...interface{}) Error {
- if len(args) > 0 {
- return &apiError{
- code: code,
- message: fmt.Sprintf(message, args...),
- }
- }
- return &apiError{
- code: code,
- message: message,
- }
-}
-
-// NotFound creates a new not found error
-func NotFound(message string, args ...interface{}) Error {
- if message == "" {
- message = "Not found"
- }
- return New(http.StatusNotFound, fmt.Sprintf(message, args...))
-}
-
-// NotImplemented creates a new not implemented error
-func NotImplemented(message string) Error {
- return New(http.StatusNotImplemented, message)
-}
-
-// MethodNotAllowedError represents an error for when the path matches but the method doesn't
-type MethodNotAllowedError struct {
- code int32
- Allowed []string
- message string
-}
-
-func (m *MethodNotAllowedError) Error() string {
- return m.message
-}
-
-// Code the error code
-func (m *MethodNotAllowedError) Code() int32 {
- return m.code
-}
-
-// MarshalJSON implements the JSON encoding interface
-func (m MethodNotAllowedError) MarshalJSON() ([]byte, error) {
- return json.Marshal(map[string]interface{}{
- "code": m.code,
- "message": m.message,
- "allowed": m.Allowed,
- })
-}
-
-func errorAsJSON(err Error) []byte {
- //nolint:errchkjson
- b, _ := json.Marshal(struct {
- Code int32 `json:"code"`
- Message string `json:"message"`
- }{err.Code(), err.Error()})
- return b
-}
-
-func flattenComposite(errs *CompositeError) *CompositeError {
- var res []error
- for _, er := range errs.Errors {
- switch e := er.(type) {
- case *CompositeError:
- if e != nil && len(e.Errors) > 0 {
- flat := flattenComposite(e)
- if len(flat.Errors) > 0 {
- res = append(res, flat.Errors...)
- }
- }
- default:
- if e != nil {
- res = append(res, e)
- }
- }
- }
- return CompositeValidationError(res...)
-}
-
-// MethodNotAllowed creates a new method not allowed error
-func MethodNotAllowed(requested string, allow []string) Error {
- msg := fmt.Sprintf("method %s is not allowed, but [%s] are", requested, strings.Join(allow, ","))
- return &MethodNotAllowedError{
- code: http.StatusMethodNotAllowed,
- Allowed: allow,
- message: msg,
- }
-}
-
-// ServeError implements the http error handler interface
-func ServeError(rw http.ResponseWriter, r *http.Request, err error) {
- rw.Header().Set("Content-Type", "application/json")
- switch e := err.(type) {
- case *CompositeError:
- er := flattenComposite(e)
- // strips composite errors to first element only
- if len(er.Errors) > 0 {
- ServeError(rw, r, er.Errors[0])
- } else {
- // guard against empty CompositeError (invalid construct)
- ServeError(rw, r, nil)
- }
- case *MethodNotAllowedError:
- rw.Header().Add("Allow", strings.Join(e.Allowed, ","))
- rw.WriteHeader(asHTTPCode(int(e.Code())))
- if r == nil || r.Method != http.MethodHead {
- _, _ = rw.Write(errorAsJSON(e))
- }
- case Error:
- value := reflect.ValueOf(e)
- if value.Kind() == reflect.Ptr && value.IsNil() {
- rw.WriteHeader(http.StatusInternalServerError)
- _, _ = rw.Write(errorAsJSON(New(http.StatusInternalServerError, "Unknown error")))
- return
- }
- rw.WriteHeader(asHTTPCode(int(e.Code())))
- if r == nil || r.Method != http.MethodHead {
- _, _ = rw.Write(errorAsJSON(e))
- }
- case nil:
- rw.WriteHeader(http.StatusInternalServerError)
- _, _ = rw.Write(errorAsJSON(New(http.StatusInternalServerError, "Unknown error")))
- default:
- rw.WriteHeader(http.StatusInternalServerError)
- if r == nil || r.Method != http.MethodHead {
- _, _ = rw.Write(errorAsJSON(New(http.StatusInternalServerError, err.Error())))
- }
- }
-}
-
-func asHTTPCode(input int) int {
- if input >= maximumValidHTTPCode {
- return DefaultHTTPCode
- }
- return input
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/auth.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/auth.go
deleted file mode 100644
index 0545b501b..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/auth.go
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package errors
-
-import "net/http"
-
-// Unauthenticated returns an unauthenticated error
-func Unauthenticated(scheme string) Error {
- return New(http.StatusUnauthorized, "unauthenticated for %s", scheme)
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/doc.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/doc.go
deleted file mode 100644
index af01190ce..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/doc.go
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-/*
-Package errors provides an Error interface and several concrete types
-implementing this interface to manage API errors and JSON-schema validation
-errors.
-
-A middleware handler ServeError() is provided to serve the errors types
-it defines.
-
-It is used throughout the various go-openapi toolkit libraries
-(https://github.com/go-openapi).
-*/
-package errors
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/headers.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/headers.go
deleted file mode 100644
index 6ea1151f4..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/headers.go
+++ /dev/null
@@ -1,103 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package errors
-
-import (
- "encoding/json"
- "fmt"
- "net/http"
-)
-
-// Validation represents a failure of a precondition
-type Validation struct { //nolint: errname
- code int32
- Name string
- In string
- Value interface{}
- message string
- Values []interface{}
-}
-
-func (e *Validation) Error() string {
- return e.message
-}
-
-// Code the error code
-func (e *Validation) Code() int32 {
- return e.code
-}
-
-// MarshalJSON implements the JSON encoding interface
-func (e Validation) MarshalJSON() ([]byte, error) {
- return json.Marshal(map[string]interface{}{
- "code": e.code,
- "message": e.message,
- "in": e.In,
- "name": e.Name,
- "value": e.Value,
- "values": e.Values,
- })
-}
-
-// ValidateName sets the name for a validation or updates it for a nested property
-func (e *Validation) ValidateName(name string) *Validation {
- if name != "" {
- if e.Name == "" {
- e.Name = name
- e.message = name + e.message
- } else {
- e.Name = name + "." + e.Name
- e.message = name + "." + e.message
- }
- }
- return e
-}
-
-const (
- contentTypeFail = `unsupported media type %q, only %v are allowed`
- responseFormatFail = `unsupported media type requested, only %v are available`
-)
-
-// InvalidContentType error for an invalid content type
-func InvalidContentType(value string, allowed []string) *Validation {
- values := make([]interface{}, 0, len(allowed))
- for _, v := range allowed {
- values = append(values, v)
- }
- return &Validation{
- code: http.StatusUnsupportedMediaType,
- Name: "Content-Type",
- In: "header",
- Value: value,
- Values: values,
- message: fmt.Sprintf(contentTypeFail, value, allowed),
- }
-}
-
-// InvalidResponseFormat error for an unacceptable response format request
-func InvalidResponseFormat(value string, allowed []string) *Validation {
- values := make([]interface{}, 0, len(allowed))
- for _, v := range allowed {
- values = append(values, v)
- }
- return &Validation{
- code: http.StatusNotAcceptable,
- Name: "Accept",
- In: "header",
- Value: value,
- Values: values,
- message: fmt.Sprintf(responseFormatFail, allowed),
- }
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/middleware.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/middleware.go
deleted file mode 100644
index 67f80386a..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/middleware.go
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package errors
-
-import (
- "bytes"
- "fmt"
- "strings"
-)
-
-// APIVerificationFailed is an error that contains all the missing info for a mismatched section
-// between the api registrations and the api spec
-type APIVerificationFailed struct { //nolint: errname
- Section string `json:"section,omitempty"`
- MissingSpecification []string `json:"missingSpecification,omitempty"`
- MissingRegistration []string `json:"missingRegistration,omitempty"`
-}
-
-func (v *APIVerificationFailed) Error() string {
- buf := bytes.NewBuffer(nil)
-
- hasRegMissing := len(v.MissingRegistration) > 0
- hasSpecMissing := len(v.MissingSpecification) > 0
-
- if hasRegMissing {
- buf.WriteString(fmt.Sprintf("missing [%s] %s registrations", strings.Join(v.MissingRegistration, ", "), v.Section))
- }
-
- if hasRegMissing && hasSpecMissing {
- buf.WriteString("\n")
- }
-
- if hasSpecMissing {
- buf.WriteString(fmt.Sprintf("missing from spec file [%s] %s", strings.Join(v.MissingSpecification, ", "), v.Section))
- }
-
- return buf.String()
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/parsing.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/parsing.go
deleted file mode 100644
index ce1ef9cb6..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/parsing.go
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package errors
-
-import (
- "encoding/json"
- "fmt"
- "net/http"
-)
-
-// ParseError represents a parsing error
-type ParseError struct {
- code int32
- Name string
- In string
- Value string
- Reason error
- message string
-}
-
-func (e *ParseError) Error() string {
- return e.message
-}
-
-// Code returns the http status code for this error
-func (e *ParseError) Code() int32 {
- return e.code
-}
-
-// MarshalJSON implements the JSON encoding interface
-func (e ParseError) MarshalJSON() ([]byte, error) {
- var reason string
- if e.Reason != nil {
- reason = e.Reason.Error()
- }
- return json.Marshal(map[string]interface{}{
- "code": e.code,
- "message": e.message,
- "in": e.In,
- "name": e.Name,
- "value": e.Value,
- "reason": reason,
- })
-}
-
-const (
- parseErrorTemplContent = `parsing %s %s from %q failed, because %s`
- parseErrorTemplContentNoIn = `parsing %s from %q failed, because %s`
-)
-
-// NewParseError creates a new parse error
-func NewParseError(name, in, value string, reason error) *ParseError {
- var msg string
- if in == "" {
- msg = fmt.Sprintf(parseErrorTemplContentNoIn, name, value, reason)
- } else {
- msg = fmt.Sprintf(parseErrorTemplContent, name, in, value, reason)
- }
- return &ParseError{
- code: http.StatusBadRequest,
- Name: name,
- In: in,
- Value: value,
- Reason: reason,
- message: msg,
- }
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/schema.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/schema.go
deleted file mode 100644
index 8f3239dfd..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/errors/schema.go
+++ /dev/null
@@ -1,619 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package errors
-
-import (
- "encoding/json"
- "fmt"
- "net/http"
- "strings"
-)
-
-const (
- invalidType = "%s is an invalid type name"
- typeFail = "%s in %s must be of type %s"
- typeFailWithData = "%s in %s must be of type %s: %q"
- typeFailWithError = "%s in %s must be of type %s, because: %s"
- requiredFail = "%s in %s is required"
- readOnlyFail = "%s in %s is readOnly"
- tooLongMessage = "%s in %s should be at most %d chars long"
- tooShortMessage = "%s in %s should be at least %d chars long"
- patternFail = "%s in %s should match '%s'"
- enumFail = "%s in %s should be one of %v"
- multipleOfFail = "%s in %s should be a multiple of %v"
- maximumIncFail = "%s in %s should be less than or equal to %v"
- maximumExcFail = "%s in %s should be less than %v"
- minIncFail = "%s in %s should be greater than or equal to %v"
- minExcFail = "%s in %s should be greater than %v"
- uniqueFail = "%s in %s shouldn't contain duplicates"
- maximumItemsFail = "%s in %s should have at most %d items"
- minItemsFail = "%s in %s should have at least %d items"
- typeFailNoIn = "%s must be of type %s"
- typeFailWithDataNoIn = "%s must be of type %s: %q"
- typeFailWithErrorNoIn = "%s must be of type %s, because: %s"
- requiredFailNoIn = "%s is required"
- readOnlyFailNoIn = "%s is readOnly"
- tooLongMessageNoIn = "%s should be at most %d chars long"
- tooShortMessageNoIn = "%s should be at least %d chars long"
- patternFailNoIn = "%s should match '%s'"
- enumFailNoIn = "%s should be one of %v"
- multipleOfFailNoIn = "%s should be a multiple of %v"
- maximumIncFailNoIn = "%s should be less than or equal to %v"
- maximumExcFailNoIn = "%s should be less than %v"
- minIncFailNoIn = "%s should be greater than or equal to %v"
- minExcFailNoIn = "%s should be greater than %v"
- uniqueFailNoIn = "%s shouldn't contain duplicates"
- maximumItemsFailNoIn = "%s should have at most %d items"
- minItemsFailNoIn = "%s should have at least %d items"
- noAdditionalItems = "%s in %s can't have additional items"
- noAdditionalItemsNoIn = "%s can't have additional items"
- tooFewProperties = "%s in %s should have at least %d properties"
- tooFewPropertiesNoIn = "%s should have at least %d properties"
- tooManyProperties = "%s in %s should have at most %d properties"
- tooManyPropertiesNoIn = "%s should have at most %d properties"
- unallowedProperty = "%s.%s in %s is a forbidden property"
- unallowedPropertyNoIn = "%s.%s is a forbidden property"
- failedAllPatternProps = "%s.%s in %s failed all pattern properties"
- failedAllPatternPropsNoIn = "%s.%s failed all pattern properties"
- multipleOfMustBePositive = "factor MultipleOf declared for %s must be positive: %v"
-)
-
-const maximumValidHTTPCode = 600
-
-// All code responses can be used to differentiate errors for different handling
-// by the consuming program
-const (
- // CompositeErrorCode remains 422 for backwards-compatibility
- // and to separate it from validation errors with cause
- CompositeErrorCode = http.StatusUnprocessableEntity
-
- // InvalidTypeCode is used for any subclass of invalid types
- InvalidTypeCode = maximumValidHTTPCode + iota
- RequiredFailCode
- TooLongFailCode
- TooShortFailCode
- PatternFailCode
- EnumFailCode
- MultipleOfFailCode
- MaxFailCode
- MinFailCode
- UniqueFailCode
- MaxItemsFailCode
- MinItemsFailCode
- NoAdditionalItemsCode
- TooFewPropertiesCode
- TooManyPropertiesCode
- UnallowedPropertyCode
- FailedAllPatternPropsCode
- MultipleOfMustBePositiveCode
- ReadOnlyFailCode
-)
-
-// CompositeError is an error that groups several errors together
-type CompositeError struct {
- Errors []error
- code int32
- message string
-}
-
-// Code for this error
-func (c *CompositeError) Code() int32 {
- return c.code
-}
-
-func (c *CompositeError) Error() string {
- if len(c.Errors) > 0 {
- msgs := []string{c.message + ":"}
- for _, e := range c.Errors {
- msgs = append(msgs, e.Error())
- }
- return strings.Join(msgs, "\n")
- }
- return c.message
-}
-
-func (c *CompositeError) Unwrap() []error {
- return c.Errors
-}
-
-// MarshalJSON implements the JSON encoding interface
-func (c CompositeError) MarshalJSON() ([]byte, error) {
- return json.Marshal(map[string]interface{}{
- "code": c.code,
- "message": c.message,
- "errors": c.Errors,
- })
-}
-
-// CompositeValidationError an error to wrap a bunch of other errors
-func CompositeValidationError(errors ...error) *CompositeError {
- return &CompositeError{
- code: CompositeErrorCode,
- Errors: append(make([]error, 0, len(errors)), errors...),
- message: "validation failure list",
- }
-}
-
-// ValidateName recursively sets the name for all validations or updates them for nested properties
-func (c *CompositeError) ValidateName(name string) *CompositeError {
- for i, e := range c.Errors {
- if ve, ok := e.(*Validation); ok {
- c.Errors[i] = ve.ValidateName(name)
- } else if ce, ok := e.(*CompositeError); ok {
- c.Errors[i] = ce.ValidateName(name)
- }
- }
-
- return c
-}
-
-// FailedAllPatternProperties an error for when the property doesn't match a pattern
-func FailedAllPatternProperties(name, in, key string) *Validation {
- msg := fmt.Sprintf(failedAllPatternProps, name, key, in)
- if in == "" {
- msg = fmt.Sprintf(failedAllPatternPropsNoIn, name, key)
- }
- return &Validation{
- code: FailedAllPatternPropsCode,
- Name: name,
- In: in,
- Value: key,
- message: msg,
- }
-}
-
-// PropertyNotAllowed an error for when the property doesn't match a pattern
-func PropertyNotAllowed(name, in, key string) *Validation {
- msg := fmt.Sprintf(unallowedProperty, name, key, in)
- if in == "" {
- msg = fmt.Sprintf(unallowedPropertyNoIn, name, key)
- }
- return &Validation{
- code: UnallowedPropertyCode,
- Name: name,
- In: in,
- Value: key,
- message: msg,
- }
-}
-
-// TooFewProperties an error for an object with too few properties
-func TooFewProperties(name, in string, n int64) *Validation {
- msg := fmt.Sprintf(tooFewProperties, name, in, n)
- if in == "" {
- msg = fmt.Sprintf(tooFewPropertiesNoIn, name, n)
- }
- return &Validation{
- code: TooFewPropertiesCode,
- Name: name,
- In: in,
- Value: n,
- message: msg,
- }
-}
-
-// TooManyProperties an error for an object with too many properties
-func TooManyProperties(name, in string, n int64) *Validation {
- msg := fmt.Sprintf(tooManyProperties, name, in, n)
- if in == "" {
- msg = fmt.Sprintf(tooManyPropertiesNoIn, name, n)
- }
- return &Validation{
- code: TooManyPropertiesCode,
- Name: name,
- In: in,
- Value: n,
- message: msg,
- }
-}
-
-// AdditionalItemsNotAllowed an error for invalid additional items
-func AdditionalItemsNotAllowed(name, in string) *Validation {
- msg := fmt.Sprintf(noAdditionalItems, name, in)
- if in == "" {
- msg = fmt.Sprintf(noAdditionalItemsNoIn, name)
- }
- return &Validation{
- code: NoAdditionalItemsCode,
- Name: name,
- In: in,
- message: msg,
- }
-}
-
-// InvalidCollectionFormat another flavor of invalid type error
-func InvalidCollectionFormat(name, in, format string) *Validation {
- return &Validation{
- code: InvalidTypeCode,
- Name: name,
- In: in,
- Value: format,
- message: fmt.Sprintf("the collection format %q is not supported for the %s param %q", format, in, name),
- }
-}
-
-// InvalidTypeName an error for when the type is invalid
-func InvalidTypeName(typeName string) *Validation {
- return &Validation{
- code: InvalidTypeCode,
- Value: typeName,
- message: fmt.Sprintf(invalidType, typeName),
- }
-}
-
-// InvalidType creates an error for when the type is invalid
-func InvalidType(name, in, typeName string, value interface{}) *Validation {
- var message string
-
- if in != "" {
- switch value.(type) {
- case string:
- message = fmt.Sprintf(typeFailWithData, name, in, typeName, value)
- case error:
- message = fmt.Sprintf(typeFailWithError, name, in, typeName, value)
- default:
- message = fmt.Sprintf(typeFail, name, in, typeName)
- }
- } else {
- switch value.(type) {
- case string:
- message = fmt.Sprintf(typeFailWithDataNoIn, name, typeName, value)
- case error:
- message = fmt.Sprintf(typeFailWithErrorNoIn, name, typeName, value)
- default:
- message = fmt.Sprintf(typeFailNoIn, name, typeName)
- }
- }
-
- return &Validation{
- code: InvalidTypeCode,
- Name: name,
- In: in,
- Value: value,
- message: message,
- }
-
-}
-
-// DuplicateItems error for when an array contains duplicates
-func DuplicateItems(name, in string) *Validation {
- msg := fmt.Sprintf(uniqueFail, name, in)
- if in == "" {
- msg = fmt.Sprintf(uniqueFailNoIn, name)
- }
- return &Validation{
- code: UniqueFailCode,
- Name: name,
- In: in,
- message: msg,
- }
-}
-
-// TooManyItems error for when an array contains too many items
-func TooManyItems(name, in string, maximum int64, value interface{}) *Validation {
- msg := fmt.Sprintf(maximumItemsFail, name, in, maximum)
- if in == "" {
- msg = fmt.Sprintf(maximumItemsFailNoIn, name, maximum)
- }
-
- return &Validation{
- code: MaxItemsFailCode,
- Name: name,
- In: in,
- Value: value,
- message: msg,
- }
-}
-
-// TooFewItems error for when an array contains too few items
-func TooFewItems(name, in string, minimum int64, value interface{}) *Validation {
- msg := fmt.Sprintf(minItemsFail, name, in, minimum)
- if in == "" {
- msg = fmt.Sprintf(minItemsFailNoIn, name, minimum)
- }
- return &Validation{
- code: MinItemsFailCode,
- Name: name,
- In: in,
- Value: value,
- message: msg,
- }
-}
-
-// ExceedsMaximumInt error for when maximumimum validation fails
-func ExceedsMaximumInt(name, in string, maximum int64, exclusive bool, value interface{}) *Validation {
- var message string
- if in == "" {
- m := maximumIncFailNoIn
- if exclusive {
- m = maximumExcFailNoIn
- }
- message = fmt.Sprintf(m, name, maximum)
- } else {
- m := maximumIncFail
- if exclusive {
- m = maximumExcFail
- }
- message = fmt.Sprintf(m, name, in, maximum)
- }
- return &Validation{
- code: MaxFailCode,
- Name: name,
- In: in,
- Value: value,
- message: message,
- }
-}
-
-// ExceedsMaximumUint error for when maximumimum validation fails
-func ExceedsMaximumUint(name, in string, maximum uint64, exclusive bool, value interface{}) *Validation {
- var message string
- if in == "" {
- m := maximumIncFailNoIn
- if exclusive {
- m = maximumExcFailNoIn
- }
- message = fmt.Sprintf(m, name, maximum)
- } else {
- m := maximumIncFail
- if exclusive {
- m = maximumExcFail
- }
- message = fmt.Sprintf(m, name, in, maximum)
- }
- return &Validation{
- code: MaxFailCode,
- Name: name,
- In: in,
- Value: value,
- message: message,
- }
-}
-
-// ExceedsMaximum error for when maximumimum validation fails
-func ExceedsMaximum(name, in string, maximum float64, exclusive bool, value interface{}) *Validation {
- var message string
- if in == "" {
- m := maximumIncFailNoIn
- if exclusive {
- m = maximumExcFailNoIn
- }
- message = fmt.Sprintf(m, name, maximum)
- } else {
- m := maximumIncFail
- if exclusive {
- m = maximumExcFail
- }
- message = fmt.Sprintf(m, name, in, maximum)
- }
- return &Validation{
- code: MaxFailCode,
- Name: name,
- In: in,
- Value: value,
- message: message,
- }
-}
-
-// ExceedsMinimumInt error for when minimum validation fails
-func ExceedsMinimumInt(name, in string, minimum int64, exclusive bool, value interface{}) *Validation {
- var message string
- if in == "" {
- m := minIncFailNoIn
- if exclusive {
- m = minExcFailNoIn
- }
- message = fmt.Sprintf(m, name, minimum)
- } else {
- m := minIncFail
- if exclusive {
- m = minExcFail
- }
- message = fmt.Sprintf(m, name, in, minimum)
- }
- return &Validation{
- code: MinFailCode,
- Name: name,
- In: in,
- Value: value,
- message: message,
- }
-}
-
-// ExceedsMinimumUint error for when minimum validation fails
-func ExceedsMinimumUint(name, in string, minimum uint64, exclusive bool, value interface{}) *Validation {
- var message string
- if in == "" {
- m := minIncFailNoIn
- if exclusive {
- m = minExcFailNoIn
- }
- message = fmt.Sprintf(m, name, minimum)
- } else {
- m := minIncFail
- if exclusive {
- m = minExcFail
- }
- message = fmt.Sprintf(m, name, in, minimum)
- }
- return &Validation{
- code: MinFailCode,
- Name: name,
- In: in,
- Value: value,
- message: message,
- }
-}
-
-// ExceedsMinimum error for when minimum validation fails
-func ExceedsMinimum(name, in string, minimum float64, exclusive bool, value interface{}) *Validation {
- var message string
- if in == "" {
- m := minIncFailNoIn
- if exclusive {
- m = minExcFailNoIn
- }
- message = fmt.Sprintf(m, name, minimum)
- } else {
- m := minIncFail
- if exclusive {
- m = minExcFail
- }
- message = fmt.Sprintf(m, name, in, minimum)
- }
- return &Validation{
- code: MinFailCode,
- Name: name,
- In: in,
- Value: value,
- message: message,
- }
-}
-
-// NotMultipleOf error for when multiple of validation fails
-func NotMultipleOf(name, in string, multiple, value interface{}) *Validation {
- var msg string
- if in == "" {
- msg = fmt.Sprintf(multipleOfFailNoIn, name, multiple)
- } else {
- msg = fmt.Sprintf(multipleOfFail, name, in, multiple)
- }
- return &Validation{
- code: MultipleOfFailCode,
- Name: name,
- In: in,
- Value: value,
- message: msg,
- }
-}
-
-// EnumFail error for when an enum validation fails
-func EnumFail(name, in string, value interface{}, values []interface{}) *Validation {
- var msg string
- if in == "" {
- msg = fmt.Sprintf(enumFailNoIn, name, values)
- } else {
- msg = fmt.Sprintf(enumFail, name, in, values)
- }
-
- return &Validation{
- code: EnumFailCode,
- Name: name,
- In: in,
- Value: value,
- Values: values,
- message: msg,
- }
-}
-
-// Required error for when a value is missing
-func Required(name, in string, value interface{}) *Validation {
- var msg string
- if in == "" {
- msg = fmt.Sprintf(requiredFailNoIn, name)
- } else {
- msg = fmt.Sprintf(requiredFail, name, in)
- }
- return &Validation{
- code: RequiredFailCode,
- Name: name,
- In: in,
- Value: value,
- message: msg,
- }
-}
-
-// ReadOnly error for when a value is present in request
-func ReadOnly(name, in string, value interface{}) *Validation {
- var msg string
- if in == "" {
- msg = fmt.Sprintf(readOnlyFailNoIn, name)
- } else {
- msg = fmt.Sprintf(readOnlyFail, name, in)
- }
- return &Validation{
- code: ReadOnlyFailCode,
- Name: name,
- In: in,
- Value: value,
- message: msg,
- }
-}
-
-// TooLong error for when a string is too long
-func TooLong(name, in string, maximum int64, value interface{}) *Validation {
- var msg string
- if in == "" {
- msg = fmt.Sprintf(tooLongMessageNoIn, name, maximum)
- } else {
- msg = fmt.Sprintf(tooLongMessage, name, in, maximum)
- }
- return &Validation{
- code: TooLongFailCode,
- Name: name,
- In: in,
- Value: value,
- message: msg,
- }
-}
-
-// TooShort error for when a string is too short
-func TooShort(name, in string, minimum int64, value interface{}) *Validation {
- var msg string
- if in == "" {
- msg = fmt.Sprintf(tooShortMessageNoIn, name, minimum)
- } else {
- msg = fmt.Sprintf(tooShortMessage, name, in, minimum)
- }
-
- return &Validation{
- code: TooShortFailCode,
- Name: name,
- In: in,
- Value: value,
- message: msg,
- }
-}
-
-// FailedPattern error for when a string fails a regex pattern match
-// the pattern that is returned is the ECMA syntax version of the pattern not the golang version.
-func FailedPattern(name, in, pattern string, value interface{}) *Validation {
- var msg string
- if in == "" {
- msg = fmt.Sprintf(patternFailNoIn, name, pattern)
- } else {
- msg = fmt.Sprintf(patternFail, name, in, pattern)
- }
-
- return &Validation{
- code: PatternFailCode,
- Name: name,
- In: in,
- Value: value,
- message: msg,
- }
-}
-
-// MultipleOfMustBePositive error for when a
-// multipleOf factor is negative
-func MultipleOfMustBePositive(name, in string, factor interface{}) *Validation {
- return &Validation{
- code: MultipleOfMustBePositiveCode,
- Name: name,
- In: in,
- Value: factor,
- message: fmt.Sprintf(multipleOfMustBePositive, name, factor),
- }
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/.editorconfig b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/.editorconfig
deleted file mode 100644
index 3152da69a..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/.editorconfig
+++ /dev/null
@@ -1,26 +0,0 @@
-# top-most EditorConfig file
-root = true
-
-# Unix-style newlines with a newline ending every file
-[*]
-end_of_line = lf
-insert_final_newline = true
-indent_style = space
-indent_size = 2
-trim_trailing_whitespace = true
-
-# Set default charset
-[*.{js,py,go,scala,rb,java,html,css,less,sass,md}]
-charset = utf-8
-
-# Tab indentation (no size specified)
-[*.go]
-indent_style = tab
-
-[*.md]
-trim_trailing_whitespace = false
-
-# Matches the exact files either package.json or .travis.yml
-[{package.json,.travis.yml}]
-indent_style = space
-indent_size = 2
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/.gitignore b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/.gitignore
deleted file mode 100644
index e4f15f17b..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-secrets.yml
-coverage.out
-profile.cov
-profile.out
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/.golangci.yml b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/.golangci.yml
deleted file mode 100644
index 22f8d21cc..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/.golangci.yml
+++ /dev/null
@@ -1,61 +0,0 @@
-linters-settings:
- govet:
- check-shadowing: true
- golint:
- min-confidence: 0
- gocyclo:
- min-complexity: 45
- maligned:
- suggest-new: true
- dupl:
- threshold: 200
- goconst:
- min-len: 2
- min-occurrences: 3
-
-linters:
- enable-all: true
- disable:
- - maligned
- - unparam
- - lll
- - gochecknoinits
- - gochecknoglobals
- - funlen
- - godox
- - gocognit
- - whitespace
- - wsl
- - wrapcheck
- - testpackage
- - nlreturn
- - gomnd
- - exhaustivestruct
- - goerr113
- - errorlint
- - nestif
- - godot
- - gofumpt
- - paralleltest
- - tparallel
- - thelper
- - ifshort
- - exhaustruct
- - varnamelen
- - gci
- - depguard
- - errchkjson
- - inamedparam
- - nonamedreturns
- - musttag
- - ireturn
- - forcetypeassert
- - cyclop
- # deprecated linters
- - deadcode
- - interfacer
- - scopelint
- - varcheck
- - structcheck
- - golint
- - nosnakecase
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/.travis.yml b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/.travis.yml
deleted file mode 100644
index cd4a7c331..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/.travis.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-after_success:
-- bash <(curl -s https://codecov.io/bash)
-go:
-- 1.16.x
-- 1.x
-install:
-- go get gotest.tools/gotestsum
-language: go
-arch:
-- amd64
-- ppc64le
-jobs:
- include:
- # include linting job, but only for latest go version and amd64 arch
- - go: 1.x
- arch: amd64
- install:
- go get github.com/golangci/golangci-lint/cmd/golangci-lint
- script:
- - golangci-lint run --new-from-rev master
-notifications:
- slack:
- secure: OxkPwVp35qBTUilgWC8xykSj+sGMcj0h8IIOKD+Rflx2schZVlFfdYdyVBM+s9OqeOfvtuvnR9v1Ye2rPKAvcjWdC4LpRGUsgmItZaI6Um8Aj6+K9udCw5qrtZVfOVmRu8LieH//XznWWKdOultUuniW0MLqw5+II87Gd00RWbCGi0hk0PykHe7uK+PDA2BEbqyZ2WKKYCvfB3j+0nrFOHScXqnh0V05l2E83J4+Sgy1fsPy+1WdX58ZlNBG333ibaC1FS79XvKSmTgKRkx3+YBo97u6ZtUmJa5WZjf2OdLG3KIckGWAv6R5xgxeU31N0Ng8L332w/Edpp2O/M2bZwdnKJ8hJQikXIAQbICbr+lTDzsoNzMdEIYcHpJ5hjPbiUl3Bmd+Jnsjf5McgAZDiWIfpCKZ29tPCEkVwRsOCqkyPRMNMzHHmoja495P5jR+ODS7+J8RFg5xgcnOgpP9D4Wlhztlf5WyZMpkLxTUD+bZq2SRf50HfHFXTkfq22zPl3d1eq0yrLwh/Z/fWKkfb6SyysROL8y6s8u3dpFX1YHSg0BR6i913h4aoZw9B2BG27cafLLTwKYsp2dFo1PWl4O6u9giFJIeqwloZHLKKrwh0cBFhB7RH0I58asxkZpCH6uWjJierahmHe7iS+E6i+9oCHkOZ59hmCYNimIs3hM=
-script:
-- gotestsum -f short-verbose -- -race -timeout=20m -coverprofile=coverage.txt -covermode=atomic ./...
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/CODE_OF_CONDUCT.md b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/CODE_OF_CONDUCT.md
deleted file mode 100644
index 9322b065e..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/CODE_OF_CONDUCT.md
+++ /dev/null
@@ -1,74 +0,0 @@
-# Contributor Covenant Code of Conduct
-
-## Our Pledge
-
-In the interest of fostering an open and welcoming environment, we as
-contributors and maintainers pledge to making participation in our project and
-our community a harassment-free experience for everyone, regardless of age, body
-size, disability, ethnicity, gender identity and expression, level of experience,
-nationality, personal appearance, race, religion, or sexual identity and
-orientation.
-
-## Our Standards
-
-Examples of behavior that contributes to creating a positive environment
-include:
-
-* Using welcoming and inclusive language
-* Being respectful of differing viewpoints and experiences
-* Gracefully accepting constructive criticism
-* Focusing on what is best for the community
-* Showing empathy towards other community members
-
-Examples of unacceptable behavior by participants include:
-
-* The use of sexualized language or imagery and unwelcome sexual attention or
-advances
-* Trolling, insulting/derogatory comments, and personal or political attacks
-* Public or private harassment
-* Publishing others' private information, such as a physical or electronic
- address, without explicit permission
-* Other conduct which could reasonably be considered inappropriate in a
- professional setting
-
-## Our Responsibilities
-
-Project maintainers are responsible for clarifying the standards of acceptable
-behavior and are expected to take appropriate and fair corrective action in
-response to any instances of unacceptable behavior.
-
-Project maintainers have the right and responsibility to remove, edit, or
-reject comments, commits, code, wiki edits, issues, and other contributions
-that are not aligned to this Code of Conduct, or to ban temporarily or
-permanently any contributor for other behaviors that they deem inappropriate,
-threatening, offensive, or harmful.
-
-## Scope
-
-This Code of Conduct applies both within project spaces and in public spaces
-when an individual is representing the project or its community. Examples of
-representing a project or community include using an official project e-mail
-address, posting via an official social media account, or acting as an appointed
-representative at an online or offline event. Representation of a project may be
-further defined and clarified by project maintainers.
-
-## Enforcement
-
-Instances of abusive, harassing, or otherwise unacceptable behavior may be
-reported by contacting the project team at ivan+abuse@flanders.co.nz. All
-complaints will be reviewed and investigated and will result in a response that
-is deemed necessary and appropriate to the circumstances. The project team is
-obligated to maintain confidentiality with regard to the reporter of an incident.
-Further details of specific enforcement policies may be posted separately.
-
-Project maintainers who do not follow or enforce the Code of Conduct in good
-faith may face temporary or permanent repercussions as determined by other
-members of the project's leadership.
-
-## Attribution
-
-This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
-available at [http://contributor-covenant.org/version/1/4][version]
-
-[homepage]: http://contributor-covenant.org
-[version]: http://contributor-covenant.org/version/1/4/
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/LICENSE b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/LICENSE
deleted file mode 100644
index d64569567..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/README.md b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/README.md
deleted file mode 100644
index f8bd440df..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/README.md
+++ /dev/null
@@ -1,6 +0,0 @@
-# Loads OAI specs [](https://github.com/go-openapi/loads/actions?query=workflow%3A"go+test") [](https://codecov.io/gh/go-openapi/loads)
-
-[](https://raw.githubusercontent.com/go-openapi/loads/master/LICENSE) [](http://godoc.org/github.com/go-openapi/loads)
-[](https://goreportcard.com/report/github.com/go-openapi/loads)
-
-Loading of OAI specification documents from local or remote locations. Supports JSON and YAML documents.
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/doc.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/doc.go
deleted file mode 100644
index 5bcaef5db..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Package loads provides document loading methods for swagger (OAI) specifications.
-//
-// It is used by other go-openapi packages to load and run analysis on local or remote spec documents.
-package loads
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/loaders.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/loaders.go
deleted file mode 100644
index b2d1e034c..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/loaders.go
+++ /dev/null
@@ -1,133 +0,0 @@
-package loads
-
-import (
- "encoding/json"
- "errors"
- "net/url"
-
- "github.com/go-openapi/spec"
- "github.com/go-openapi/swag"
-)
-
-var (
- // Default chain of loaders, defined at the package level.
- //
- // By default this matches json and yaml documents.
- //
- // May be altered with AddLoader().
- loaders *loader
-)
-
-func init() {
- jsonLoader := &loader{
- DocLoaderWithMatch: DocLoaderWithMatch{
- Match: func(_ string) bool {
- return true
- },
- Fn: JSONDoc,
- },
- }
-
- loaders = jsonLoader.WithHead(&loader{
- DocLoaderWithMatch: DocLoaderWithMatch{
- Match: swag.YAMLMatcher,
- Fn: swag.YAMLDoc,
- },
- })
-
- // sets the global default loader for go-openapi/spec
- spec.PathLoader = loaders.Load
-}
-
-// DocLoader represents a doc loader type
-type DocLoader func(string) (json.RawMessage, error)
-
-// DocMatcher represents a predicate to check if a loader matches
-type DocMatcher func(string) bool
-
-// DocLoaderWithMatch describes a loading function for a given extension match.
-type DocLoaderWithMatch struct {
- Fn DocLoader
- Match DocMatcher
-}
-
-// NewDocLoaderWithMatch builds a DocLoaderWithMatch to be used in load options
-func NewDocLoaderWithMatch(fn DocLoader, matcher DocMatcher) DocLoaderWithMatch {
- return DocLoaderWithMatch{
- Fn: fn,
- Match: matcher,
- }
-}
-
-type loader struct {
- DocLoaderWithMatch
- Next *loader
-}
-
-// WithHead adds a loader at the head of the current stack
-func (l *loader) WithHead(head *loader) *loader {
- if head == nil {
- return l
- }
- head.Next = l
- return head
-}
-
-// WithNext adds a loader at the trail of the current stack
-func (l *loader) WithNext(next *loader) *loader {
- l.Next = next
- return next
-}
-
-// Load the raw document from path
-func (l *loader) Load(path string) (json.RawMessage, error) {
- _, erp := url.Parse(path)
- if erp != nil {
- return nil, erp
- }
-
- lastErr := errors.New("no loader matched") // default error if no match was found
- for ldr := l; ldr != nil; ldr = ldr.Next {
- if ldr.Match != nil && !ldr.Match(path) {
- continue
- }
-
- // try then move to next one if there is an error
- b, err := ldr.Fn(path)
- if err == nil {
- return b, nil
- }
-
- lastErr = err
- }
-
- return nil, lastErr
-}
-
-// JSONDoc loads a json document from either a file or a remote url
-func JSONDoc(path string) (json.RawMessage, error) {
- data, err := swag.LoadFromFileOrHTTP(path)
- if err != nil {
- return nil, err
- }
- return json.RawMessage(data), nil
-}
-
-// AddLoader for a document, executed before other previously set loaders.
-//
-// This sets the configuration at the package level.
-//
-// NOTE:
-// - this updates the default loader used by github.com/go-openapi/spec
-// - since this sets package level globals, you shouln't call this concurrently
-func AddLoader(predicate DocMatcher, load DocLoader) {
- loaders = loaders.WithHead(&loader{
- DocLoaderWithMatch: DocLoaderWithMatch{
- Match: predicate,
- Fn: load,
- },
- })
-
- // sets the global default loader for go-openapi/spec
- spec.PathLoader = loaders.Load
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/options.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/options.go
deleted file mode 100644
index f8305d560..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/options.go
+++ /dev/null
@@ -1,61 +0,0 @@
-package loads
-
-type options struct {
- loader *loader
-}
-
-func defaultOptions() *options {
- return &options{
- loader: loaders,
- }
-}
-
-func loaderFromOptions(options []LoaderOption) *loader {
- opts := defaultOptions()
- for _, apply := range options {
- apply(opts)
- }
-
- return opts.loader
-}
-
-// LoaderOption allows to fine-tune the spec loader behavior
-type LoaderOption func(*options)
-
-// WithDocLoader sets a custom loader for loading specs
-func WithDocLoader(l DocLoader) LoaderOption {
- return func(opt *options) {
- if l == nil {
- return
- }
- opt.loader = &loader{
- DocLoaderWithMatch: DocLoaderWithMatch{
- Fn: l,
- },
- }
- }
-}
-
-// WithDocLoaderMatches sets a chain of custom loaders for loading specs
-// for different extension matches.
-//
-// Loaders are executed in the order of provided DocLoaderWithMatch'es.
-func WithDocLoaderMatches(l ...DocLoaderWithMatch) LoaderOption {
- return func(opt *options) {
- var final, prev *loader
- for _, ldr := range l {
- if ldr.Fn == nil {
- continue
- }
-
- if prev == nil {
- final = &loader{DocLoaderWithMatch: ldr}
- prev = final
- continue
- }
-
- prev = prev.WithNext(&loader{DocLoaderWithMatch: ldr})
- }
- opt.loader = final
- }
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/spec.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/spec.go
deleted file mode 100644
index c9039cd5d..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/loads/spec.go
+++ /dev/null
@@ -1,275 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package loads
-
-import (
- "bytes"
- "encoding/gob"
- "encoding/json"
- "fmt"
-
- "github.com/go-openapi/analysis"
- "github.com/go-openapi/spec"
- "github.com/go-openapi/swag"
-)
-
-func init() {
- gob.Register(map[string]interface{}{})
- gob.Register([]interface{}{})
-}
-
-// Document represents a swagger spec document
-type Document struct {
- // specAnalyzer
- Analyzer *analysis.Spec
- spec *spec.Swagger
- specFilePath string
- origSpec *spec.Swagger
- schema *spec.Schema
- pathLoader *loader
- raw json.RawMessage
-}
-
-// JSONSpec loads a spec from a json document
-func JSONSpec(path string, options ...LoaderOption) (*Document, error) {
- data, err := JSONDoc(path)
- if err != nil {
- return nil, err
- }
- // convert to json
- doc, err := Analyzed(data, "", options...)
- if err != nil {
- return nil, err
- }
-
- doc.specFilePath = path
-
- return doc, nil
-}
-
-// Embedded returns a Document based on embedded specs. No analysis is required
-func Embedded(orig, flat json.RawMessage, options ...LoaderOption) (*Document, error) {
- var origSpec, flatSpec spec.Swagger
- if err := json.Unmarshal(orig, &origSpec); err != nil {
- return nil, err
- }
- if err := json.Unmarshal(flat, &flatSpec); err != nil {
- return nil, err
- }
- return &Document{
- raw: orig,
- origSpec: &origSpec,
- spec: &flatSpec,
- pathLoader: loaderFromOptions(options),
- }, nil
-}
-
-// Spec loads a new spec document from a local or remote path
-func Spec(path string, options ...LoaderOption) (*Document, error) {
- ldr := loaderFromOptions(options)
-
- b, err := ldr.Load(path)
- if err != nil {
- return nil, err
- }
-
- document, err := Analyzed(b, "", options...)
- if err != nil {
- return nil, err
- }
-
- document.specFilePath = path
- document.pathLoader = ldr
-
- return document, nil
-}
-
-// Analyzed creates a new analyzed spec document for a root json.RawMessage.
-func Analyzed(data json.RawMessage, version string, options ...LoaderOption) (*Document, error) {
- if version == "" {
- version = "2.0"
- }
- if version != "2.0" {
- return nil, fmt.Errorf("spec version %q is not supported", version)
- }
-
- raw, err := trimData(data) // trim blanks, then convert yaml docs into json
- if err != nil {
- return nil, err
- }
-
- swspec := new(spec.Swagger)
- if err = json.Unmarshal(raw, swspec); err != nil {
- return nil, err
- }
-
- origsqspec, err := cloneSpec(swspec)
- if err != nil {
- return nil, err
- }
-
- d := &Document{
- Analyzer: analysis.New(swspec), // NOTE: at this moment, analysis does not follow $refs to documents outside the root doc
- schema: spec.MustLoadSwagger20Schema(),
- spec: swspec,
- raw: raw,
- origSpec: origsqspec,
- pathLoader: loaderFromOptions(options),
- }
-
- return d, nil
-}
-
-func trimData(in json.RawMessage) (json.RawMessage, error) {
- trimmed := bytes.TrimSpace(in)
- if len(trimmed) == 0 {
- return in, nil
- }
-
- if trimmed[0] == '{' || trimmed[0] == '[' {
- return trimmed, nil
- }
-
- // assume yaml doc: convert it to json
- yml, err := swag.BytesToYAMLDoc(trimmed)
- if err != nil {
- return nil, fmt.Errorf("analyzed: %v", err)
- }
-
- d, err := swag.YAMLToJSON(yml)
- if err != nil {
- return nil, fmt.Errorf("analyzed: %v", err)
- }
-
- return d, nil
-}
-
-// Expanded expands the $ref fields in the spec document and returns a new spec document
-func (d *Document) Expanded(options ...*spec.ExpandOptions) (*Document, error) {
- swspec := new(spec.Swagger)
- if err := json.Unmarshal(d.raw, swspec); err != nil {
- return nil, err
- }
-
- var expandOptions *spec.ExpandOptions
- if len(options) > 0 {
- expandOptions = options[0]
- if expandOptions.RelativeBase == "" {
- expandOptions.RelativeBase = d.specFilePath
- }
- } else {
- expandOptions = &spec.ExpandOptions{
- RelativeBase: d.specFilePath,
- }
- }
-
- if expandOptions.PathLoader == nil {
- if d.pathLoader != nil {
- // use loader from Document options
- expandOptions.PathLoader = d.pathLoader.Load
- } else {
- // use package level loader
- expandOptions.PathLoader = loaders.Load
- }
- }
-
- if err := spec.ExpandSpec(swspec, expandOptions); err != nil {
- return nil, err
- }
-
- dd := &Document{
- Analyzer: analysis.New(swspec),
- spec: swspec,
- specFilePath: d.specFilePath,
- schema: spec.MustLoadSwagger20Schema(),
- raw: d.raw,
- origSpec: d.origSpec,
- }
- return dd, nil
-}
-
-// BasePath the base path for the API specified by this spec
-func (d *Document) BasePath() string {
- return d.spec.BasePath
-}
-
-// Version returns the version of this spec
-func (d *Document) Version() string {
- return d.spec.Swagger
-}
-
-// Schema returns the swagger 2.0 schema
-func (d *Document) Schema() *spec.Schema {
- return d.schema
-}
-
-// Spec returns the swagger spec object model
-func (d *Document) Spec() *spec.Swagger {
- return d.spec
-}
-
-// Host returns the host for the API
-func (d *Document) Host() string {
- return d.spec.Host
-}
-
-// Raw returns the raw swagger spec as json bytes
-func (d *Document) Raw() json.RawMessage {
- return d.raw
-}
-
-// OrigSpec yields the original spec
-func (d *Document) OrigSpec() *spec.Swagger {
- return d.origSpec
-}
-
-// ResetDefinitions gives a shallow copy with the models reset to the original spec
-func (d *Document) ResetDefinitions() *Document {
- defs := make(map[string]spec.Schema, len(d.origSpec.Definitions))
- for k, v := range d.origSpec.Definitions {
- defs[k] = v
- }
-
- d.spec.Definitions = defs
- return d
-}
-
-// Pristine creates a new pristine document instance based on the input data
-func (d *Document) Pristine() *Document {
- raw, _ := json.Marshal(d.Spec())
- dd, _ := Analyzed(raw, d.Version())
- dd.pathLoader = d.pathLoader
- dd.specFilePath = d.specFilePath
-
- return dd
-}
-
-// SpecFilePath returns the file path of the spec if one is defined
-func (d *Document) SpecFilePath() string {
- return d.specFilePath
-}
-
-func cloneSpec(src *spec.Swagger) (*spec.Swagger, error) {
- var b bytes.Buffer
- if err := gob.NewEncoder(&b).Encode(src); err != nil {
- return nil, err
- }
-
- var dst spec.Swagger
- if err := gob.NewDecoder(&b).Decode(&dst); err != nil {
- return nil, err
- }
- return &dst, nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/.editorconfig b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/.editorconfig
deleted file mode 100644
index 3152da69a..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/.editorconfig
+++ /dev/null
@@ -1,26 +0,0 @@
-# top-most EditorConfig file
-root = true
-
-# Unix-style newlines with a newline ending every file
-[*]
-end_of_line = lf
-insert_final_newline = true
-indent_style = space
-indent_size = 2
-trim_trailing_whitespace = true
-
-# Set default charset
-[*.{js,py,go,scala,rb,java,html,css,less,sass,md}]
-charset = utf-8
-
-# Tab indentation (no size specified)
-[*.go]
-indent_style = tab
-
-[*.md]
-trim_trailing_whitespace = false
-
-# Matches the exact files either package.json or .travis.yml
-[{package.json,.travis.yml}]
-indent_style = space
-indent_size = 2
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/.gitattributes b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/.gitattributes
deleted file mode 100644
index d207b1802..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-*.go text eol=lf
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/.gitignore b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/.gitignore
deleted file mode 100644
index fea8b84ec..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-secrets.yml
-coverage.out
-*.cov
-*.out
-playground
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/.golangci.yml b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/.golangci.yml
deleted file mode 100644
index 1c75557ba..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/.golangci.yml
+++ /dev/null
@@ -1,62 +0,0 @@
-linters-settings:
- govet:
- check-shadowing: true
- golint:
- min-confidence: 0
- gocyclo:
- min-complexity: 45
- maligned:
- suggest-new: true
- dupl:
- threshold: 200
- goconst:
- min-len: 2
- min-occurrences: 3
-
-linters:
- enable-all: true
- disable:
- - nilerr # nilerr crashes on this repo
- - maligned
- - unparam
- - lll
- - gochecknoinits
- - gochecknoglobals
- - funlen
- - godox
- - gocognit
- - whitespace
- - wsl
- - wrapcheck
- - testpackage
- - nlreturn
- - gomnd
- - exhaustivestruct
- - goerr113
- - errorlint
- - nestif
- - godot
- - gofumpt
- - paralleltest
- - tparallel
- - thelper
- - ifshort
- - exhaustruct
- - varnamelen
- - gci
- - depguard
- - errchkjson
- - inamedparam
- - nonamedreturns
- - musttag
- - ireturn
- - forcetypeassert
- - cyclop
- # deprecated linters
- - deadcode
- - interfacer
- - scopelint
- - varcheck
- - structcheck
- - golint
- - nosnakecase
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/CODE_OF_CONDUCT.md b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/CODE_OF_CONDUCT.md
deleted file mode 100644
index 9322b065e..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/CODE_OF_CONDUCT.md
+++ /dev/null
@@ -1,74 +0,0 @@
-# Contributor Covenant Code of Conduct
-
-## Our Pledge
-
-In the interest of fostering an open and welcoming environment, we as
-contributors and maintainers pledge to making participation in our project and
-our community a harassment-free experience for everyone, regardless of age, body
-size, disability, ethnicity, gender identity and expression, level of experience,
-nationality, personal appearance, race, religion, or sexual identity and
-orientation.
-
-## Our Standards
-
-Examples of behavior that contributes to creating a positive environment
-include:
-
-* Using welcoming and inclusive language
-* Being respectful of differing viewpoints and experiences
-* Gracefully accepting constructive criticism
-* Focusing on what is best for the community
-* Showing empathy towards other community members
-
-Examples of unacceptable behavior by participants include:
-
-* The use of sexualized language or imagery and unwelcome sexual attention or
-advances
-* Trolling, insulting/derogatory comments, and personal or political attacks
-* Public or private harassment
-* Publishing others' private information, such as a physical or electronic
- address, without explicit permission
-* Other conduct which could reasonably be considered inappropriate in a
- professional setting
-
-## Our Responsibilities
-
-Project maintainers are responsible for clarifying the standards of acceptable
-behavior and are expected to take appropriate and fair corrective action in
-response to any instances of unacceptable behavior.
-
-Project maintainers have the right and responsibility to remove, edit, or
-reject comments, commits, code, wiki edits, issues, and other contributions
-that are not aligned to this Code of Conduct, or to ban temporarily or
-permanently any contributor for other behaviors that they deem inappropriate,
-threatening, offensive, or harmful.
-
-## Scope
-
-This Code of Conduct applies both within project spaces and in public spaces
-when an individual is representing the project or its community. Examples of
-representing a project or community include using an official project e-mail
-address, posting via an official social media account, or acting as an appointed
-representative at an online or offline event. Representation of a project may be
-further defined and clarified by project maintainers.
-
-## Enforcement
-
-Instances of abusive, harassing, or otherwise unacceptable behavior may be
-reported by contacting the project team at ivan+abuse@flanders.co.nz. All
-complaints will be reviewed and investigated and will result in a response that
-is deemed necessary and appropriate to the circumstances. The project team is
-obligated to maintain confidentiality with regard to the reporter of an incident.
-Further details of specific enforcement policies may be posted separately.
-
-Project maintainers who do not follow or enforce the Code of Conduct in good
-faith may face temporary or permanent repercussions as determined by other
-members of the project's leadership.
-
-## Attribution
-
-This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
-available at [http://contributor-covenant.org/version/1/4][version]
-
-[homepage]: http://contributor-covenant.org
-[version]: http://contributor-covenant.org/version/1/4/
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/LICENSE b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/LICENSE
deleted file mode 100644
index d64569567..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/README.md b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/README.md
deleted file mode 100644
index b07e0ad9d..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/README.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# runtime [](https://github.com/go-openapi/runtime/actions?query=workflow%3A"go+test") [](https://codecov.io/gh/go-openapi/runtime)
-
-[](https://slackin.goswagger.io)
-[](https://raw.githubusercontent.com/go-openapi/runtime/master/LICENSE)
-[](https://pkg.go.dev/github.com/go-openapi/runtime)
-[](https://goreportcard.com/report/github.com/go-openapi/runtime)
-
-# go OpenAPI toolkit runtime
-
-The runtime component for use in code generation or as untyped usage.
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/bytestream.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/bytestream.go
deleted file mode 100644
index f8fb48223..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/bytestream.go
+++ /dev/null
@@ -1,222 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package runtime
-
-import (
- "bytes"
- "encoding"
- "errors"
- "fmt"
- "io"
- "reflect"
-
- "github.com/go-openapi/swag"
-)
-
-func defaultCloser() error { return nil }
-
-type byteStreamOpt func(opts *byteStreamOpts)
-
-// ClosesStream when the bytestream consumer or producer is finished
-func ClosesStream(opts *byteStreamOpts) {
- opts.Close = true
-}
-
-type byteStreamOpts struct {
- Close bool
-}
-
-// ByteStreamConsumer creates a consumer for byte streams.
-//
-// The consumer consumes from a provided reader into the data passed by reference.
-//
-// Supported output underlying types and interfaces, prioritized in this order:
-// - io.ReaderFrom (for maximum control)
-// - io.Writer (performs io.Copy)
-// - encoding.BinaryUnmarshaler
-// - *string
-// - *[]byte
-func ByteStreamConsumer(opts ...byteStreamOpt) Consumer {
- var vals byteStreamOpts
- for _, opt := range opts {
- opt(&vals)
- }
-
- return ConsumerFunc(func(reader io.Reader, data interface{}) error {
- if reader == nil {
- return errors.New("ByteStreamConsumer requires a reader") // early exit
- }
- if data == nil {
- return errors.New("nil destination for ByteStreamConsumer")
- }
-
- closer := defaultCloser
- if vals.Close {
- if cl, isReaderCloser := reader.(io.Closer); isReaderCloser {
- closer = cl.Close
- }
- }
- defer func() {
- _ = closer()
- }()
-
- if readerFrom, isReaderFrom := data.(io.ReaderFrom); isReaderFrom {
- _, err := readerFrom.ReadFrom(reader)
- return err
- }
-
- if writer, isDataWriter := data.(io.Writer); isDataWriter {
- _, err := io.Copy(writer, reader)
- return err
- }
-
- // buffers input before writing to data
- var buf bytes.Buffer
- _, err := buf.ReadFrom(reader)
- if err != nil {
- return err
- }
- b := buf.Bytes()
-
- switch destinationPointer := data.(type) {
- case encoding.BinaryUnmarshaler:
- return destinationPointer.UnmarshalBinary(b)
- case *any:
- switch (*destinationPointer).(type) {
- case string:
- *destinationPointer = string(b)
-
- return nil
-
- case []byte:
- *destinationPointer = b
-
- return nil
- }
- default:
- // check for the underlying type to be pointer to []byte or string,
- if ptr := reflect.TypeOf(data); ptr.Kind() != reflect.Ptr {
- return errors.New("destination must be a pointer")
- }
-
- v := reflect.Indirect(reflect.ValueOf(data))
- t := v.Type()
-
- switch {
- case t.Kind() == reflect.Slice && t.Elem().Kind() == reflect.Uint8:
- v.SetBytes(b)
- return nil
-
- case t.Kind() == reflect.String:
- v.SetString(string(b))
- return nil
- }
- }
-
- return fmt.Errorf("%v (%T) is not supported by the ByteStreamConsumer, %s",
- data, data, "can be resolved by supporting Writer/BinaryUnmarshaler interface")
- })
-}
-
-// ByteStreamProducer creates a producer for byte streams.
-//
-// The producer takes input data then writes to an output writer (essentially as a pipe).
-//
-// Supported input underlying types and interfaces, prioritized in this order:
-// - io.WriterTo (for maximum control)
-// - io.Reader (performs io.Copy). A ReadCloser is closed before exiting.
-// - encoding.BinaryMarshaler
-// - error (writes as a string)
-// - []byte
-// - string
-// - struct, other slices: writes as JSON
-func ByteStreamProducer(opts ...byteStreamOpt) Producer {
- var vals byteStreamOpts
- for _, opt := range opts {
- opt(&vals)
- }
-
- return ProducerFunc(func(writer io.Writer, data interface{}) error {
- if writer == nil {
- return errors.New("ByteStreamProducer requires a writer") // early exit
- }
- if data == nil {
- return errors.New("nil data for ByteStreamProducer")
- }
-
- closer := defaultCloser
- if vals.Close {
- if cl, isWriterCloser := writer.(io.Closer); isWriterCloser {
- closer = cl.Close
- }
- }
- defer func() {
- _ = closer()
- }()
-
- if rc, isDataCloser := data.(io.ReadCloser); isDataCloser {
- defer rc.Close()
- }
-
- switch origin := data.(type) {
- case io.WriterTo:
- _, err := origin.WriteTo(writer)
- return err
-
- case io.Reader:
- _, err := io.Copy(writer, origin)
- return err
-
- case encoding.BinaryMarshaler:
- bytes, err := origin.MarshalBinary()
- if err != nil {
- return err
- }
-
- _, err = writer.Write(bytes)
- return err
-
- case error:
- _, err := writer.Write([]byte(origin.Error()))
- return err
-
- default:
- v := reflect.Indirect(reflect.ValueOf(data))
- t := v.Type()
-
- switch {
- case t.Kind() == reflect.Slice && t.Elem().Kind() == reflect.Uint8:
- _, err := writer.Write(v.Bytes())
- return err
-
- case t.Kind() == reflect.String:
- _, err := writer.Write([]byte(v.String()))
- return err
-
- case t.Kind() == reflect.Struct || t.Kind() == reflect.Slice:
- b, err := swag.WriteJSON(data)
- if err != nil {
- return err
- }
-
- _, err = writer.Write(b)
- return err
- }
- }
-
- return fmt.Errorf("%v (%T) is not supported by the ByteStreamProducer, %s",
- data, data, "can be resolved by supporting Reader/BinaryMarshaler interface")
- })
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/client_auth_info.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/client_auth_info.go
deleted file mode 100644
index c6c97d9a7..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/client_auth_info.go
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package runtime
-
-import "github.com/go-openapi/strfmt"
-
-// A ClientAuthInfoWriterFunc converts a function to a request writer interface
-type ClientAuthInfoWriterFunc func(ClientRequest, strfmt.Registry) error
-
-// AuthenticateRequest adds authentication data to the request
-func (fn ClientAuthInfoWriterFunc) AuthenticateRequest(req ClientRequest, reg strfmt.Registry) error {
- return fn(req, reg)
-}
-
-// A ClientAuthInfoWriter implementor knows how to write authentication info to a request
-type ClientAuthInfoWriter interface {
- AuthenticateRequest(ClientRequest, strfmt.Registry) error
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/client_operation.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/client_operation.go
deleted file mode 100644
index 5a5d63563..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/client_operation.go
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package runtime
-
-import (
- "context"
- "net/http"
-)
-
-// ClientOperation represents the context for a swagger operation to be submitted to the transport
-type ClientOperation struct {
- ID string
- Method string
- PathPattern string
- ProducesMediaTypes []string
- ConsumesMediaTypes []string
- Schemes []string
- AuthInfo ClientAuthInfoWriter
- Params ClientRequestWriter
- Reader ClientResponseReader
- Context context.Context //nolint:containedctx // we precisely want this type to contain the request context
- Client *http.Client
-}
-
-// A ClientTransport implementor knows how to submit Request objects to some destination
-type ClientTransport interface {
- // Submit(string, RequestWriter, ResponseReader, AuthInfoWriter) (interface{}, error)
- Submit(*ClientOperation) (interface{}, error)
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/client_request.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/client_request.go
deleted file mode 100644
index 4ebb2deab..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/client_request.go
+++ /dev/null
@@ -1,152 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package runtime
-
-import (
- "io"
- "net/http"
- "net/url"
- "time"
-
- "github.com/go-openapi/strfmt"
-)
-
-// ClientRequestWriterFunc converts a function to a request writer interface
-type ClientRequestWriterFunc func(ClientRequest, strfmt.Registry) error
-
-// WriteToRequest adds data to the request
-func (fn ClientRequestWriterFunc) WriteToRequest(req ClientRequest, reg strfmt.Registry) error {
- return fn(req, reg)
-}
-
-// ClientRequestWriter is an interface for things that know how to write to a request
-type ClientRequestWriter interface {
- WriteToRequest(ClientRequest, strfmt.Registry) error
-}
-
-// ClientRequest is an interface for things that know how to
-// add information to a swagger client request.
-type ClientRequest interface { //nolint:interfacebloat // a swagger-capable request is quite rich, hence the many getter/setters
- SetHeaderParam(string, ...string) error
-
- GetHeaderParams() http.Header
-
- SetQueryParam(string, ...string) error
-
- SetFormParam(string, ...string) error
-
- SetPathParam(string, string) error
-
- GetQueryParams() url.Values
-
- SetFileParam(string, ...NamedReadCloser) error
-
- SetBodyParam(interface{}) error
-
- SetTimeout(time.Duration) error
-
- GetMethod() string
-
- GetPath() string
-
- GetBody() []byte
-
- GetBodyParam() interface{}
-
- GetFileParam() map[string][]NamedReadCloser
-}
-
-// NamedReadCloser represents a named ReadCloser interface
-type NamedReadCloser interface {
- io.ReadCloser
- Name() string
-}
-
-// NamedReader creates a NamedReadCloser for use as file upload
-func NamedReader(name string, rdr io.Reader) NamedReadCloser {
- rc, ok := rdr.(io.ReadCloser)
- if !ok {
- rc = io.NopCloser(rdr)
- }
- return &namedReadCloser{
- name: name,
- cr: rc,
- }
-}
-
-type namedReadCloser struct {
- name string
- cr io.ReadCloser
-}
-
-func (n *namedReadCloser) Close() error {
- return n.cr.Close()
-}
-func (n *namedReadCloser) Read(p []byte) (int, error) {
- return n.cr.Read(p)
-}
-func (n *namedReadCloser) Name() string {
- return n.name
-}
-
-type TestClientRequest struct {
- Headers http.Header
- Body interface{}
-}
-
-func (t *TestClientRequest) SetHeaderParam(name string, values ...string) error {
- if t.Headers == nil {
- t.Headers = make(http.Header)
- }
- t.Headers.Set(name, values[0])
- return nil
-}
-
-func (t *TestClientRequest) SetQueryParam(_ string, _ ...string) error { return nil }
-
-func (t *TestClientRequest) SetFormParam(_ string, _ ...string) error { return nil }
-
-func (t *TestClientRequest) SetPathParam(_ string, _ string) error { return nil }
-
-func (t *TestClientRequest) SetFileParam(_ string, _ ...NamedReadCloser) error { return nil }
-
-func (t *TestClientRequest) SetBodyParam(body interface{}) error {
- t.Body = body
- return nil
-}
-
-func (t *TestClientRequest) SetTimeout(time.Duration) error {
- return nil
-}
-
-func (t *TestClientRequest) GetQueryParams() url.Values { return nil }
-
-func (t *TestClientRequest) GetMethod() string { return "" }
-
-func (t *TestClientRequest) GetPath() string { return "" }
-
-func (t *TestClientRequest) GetBody() []byte { return nil }
-
-func (t *TestClientRequest) GetBodyParam() interface{} {
- return t.Body
-}
-
-func (t *TestClientRequest) GetFileParam() map[string][]NamedReadCloser {
- return nil
-}
-
-func (t *TestClientRequest) GetHeaderParams() http.Header {
- return t.Headers
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/client_response.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/client_response.go
deleted file mode 100644
index 0d1691149..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/client_response.go
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package runtime
-
-import (
- "encoding/json"
- "fmt"
- "io"
-)
-
-// A ClientResponse represents a client response
-// This bridges between responses obtained from different transports
-type ClientResponse interface {
- Code() int
- Message() string
- GetHeader(string) string
- GetHeaders(string) []string
- Body() io.ReadCloser
-}
-
-// A ClientResponseReaderFunc turns a function into a ClientResponseReader interface implementation
-type ClientResponseReaderFunc func(ClientResponse, Consumer) (interface{}, error)
-
-// ReadResponse reads the response
-func (read ClientResponseReaderFunc) ReadResponse(resp ClientResponse, consumer Consumer) (interface{}, error) {
- return read(resp, consumer)
-}
-
-// A ClientResponseReader is an interface for things want to read a response.
-// An application of this is to create structs from response values
-type ClientResponseReader interface {
- ReadResponse(ClientResponse, Consumer) (interface{}, error)
-}
-
-// NewAPIError creates a new API error
-func NewAPIError(opName string, payload interface{}, code int) *APIError {
- return &APIError{
- OperationName: opName,
- Response: payload,
- Code: code,
- }
-}
-
-// APIError wraps an error model and captures the status code
-type APIError struct {
- OperationName string
- Response interface{}
- Code int
-}
-
-func (o *APIError) Error() string {
- var resp []byte
- if err, ok := o.Response.(error); ok {
- resp = []byte("'" + err.Error() + "'")
- } else {
- resp, _ = json.Marshal(o.Response)
- }
- return fmt.Sprintf("%s (status %d): %s", o.OperationName, o.Code, resp)
-}
-
-func (o *APIError) String() string {
- return o.Error()
-}
-
-// IsSuccess returns true when this elapse o k response returns a 2xx status code
-func (o *APIError) IsSuccess() bool {
- return o.Code/100 == 2
-}
-
-// IsRedirect returns true when this elapse o k response returns a 3xx status code
-func (o *APIError) IsRedirect() bool {
- return o.Code/100 == 3
-}
-
-// IsClientError returns true when this elapse o k response returns a 4xx status code
-func (o *APIError) IsClientError() bool {
- return o.Code/100 == 4
-}
-
-// IsServerError returns true when this elapse o k response returns a 5xx status code
-func (o *APIError) IsServerError() bool {
- return o.Code/100 == 5
-}
-
-// IsCode returns true when this elapse o k response returns a 4xx status code
-func (o *APIError) IsCode(code int) bool {
- return o.Code == code
-}
-
-// A ClientResponseStatus is a common interface implemented by all responses on the generated code
-// You can use this to treat any client response based on status code
-type ClientResponseStatus interface {
- IsSuccess() bool
- IsRedirect() bool
- IsClientError() bool
- IsServerError() bool
- IsCode(int) bool
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/constants.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/constants.go
deleted file mode 100644
index 515969242..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/constants.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package runtime
-
-const (
- // HeaderContentType represents a http content-type header, it's value is supposed to be a mime type
- HeaderContentType = "Content-Type"
-
- // HeaderTransferEncoding represents a http transfer-encoding header.
- HeaderTransferEncoding = "Transfer-Encoding"
-
- // HeaderAccept the Accept header
- HeaderAccept = "Accept"
- // HeaderAuthorization the Authorization header
- HeaderAuthorization = "Authorization"
-
- charsetKey = "charset"
-
- // DefaultMime the default fallback mime type
- DefaultMime = "application/octet-stream"
- // JSONMime the json mime type
- JSONMime = "application/json"
- // YAMLMime the yaml mime type
- YAMLMime = "application/x-yaml"
- // XMLMime the xml mime type
- XMLMime = "application/xml"
- // TextMime the text mime type
- TextMime = "text/plain"
- // HTMLMime the html mime type
- HTMLMime = "text/html"
- // CSVMime the csv mime type
- CSVMime = "text/csv"
- // MultipartFormMime the multipart form mime type
- MultipartFormMime = "multipart/form-data"
- // URLencodedFormMime the url encoded form mime type
- URLencodedFormMime = "application/x-www-form-urlencoded"
-)
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/csv.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/csv.go
deleted file mode 100644
index c9597bcd6..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/csv.go
+++ /dev/null
@@ -1,350 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package runtime
-
-import (
- "bytes"
- "context"
- "encoding"
- "encoding/csv"
- "errors"
- "fmt"
- "io"
- "reflect"
-
- "golang.org/x/sync/errgroup"
-)
-
-// CSVConsumer creates a new CSV consumer.
-//
-// The consumer consumes CSV records from a provided reader into the data passed by reference.
-//
-// CSVOpts options may be specified to alter the default CSV behavior on the reader and the writer side (e.g. separator, skip header, ...).
-// The defaults are those of the standard library's csv.Reader and csv.Writer.
-//
-// Supported output underlying types and interfaces, prioritized in this order:
-// - *csv.Writer
-// - CSVWriter (writer options are ignored)
-// - io.Writer (as raw bytes)
-// - io.ReaderFrom (as raw bytes)
-// - encoding.BinaryUnmarshaler (as raw bytes)
-// - *[][]string (as a collection of records)
-// - *[]byte (as raw bytes)
-// - *string (a raw bytes)
-//
-// The consumer prioritizes situations where buffering the input is not required.
-func CSVConsumer(opts ...CSVOpt) Consumer {
- o := csvOptsWithDefaults(opts)
-
- return ConsumerFunc(func(reader io.Reader, data interface{}) error {
- if reader == nil {
- return errors.New("CSVConsumer requires a reader")
- }
- if data == nil {
- return errors.New("nil destination for CSVConsumer")
- }
-
- csvReader := csv.NewReader(reader)
- o.applyToReader(csvReader)
- closer := defaultCloser
- if o.closeStream {
- if cl, isReaderCloser := reader.(io.Closer); isReaderCloser {
- closer = cl.Close
- }
- }
- defer func() {
- _ = closer()
- }()
-
- switch destination := data.(type) {
- case *csv.Writer:
- csvWriter := destination
- o.applyToWriter(csvWriter)
-
- return pipeCSV(csvWriter, csvReader, o)
-
- case CSVWriter:
- csvWriter := destination
- // no writer options available
-
- return pipeCSV(csvWriter, csvReader, o)
-
- case io.Writer:
- csvWriter := csv.NewWriter(destination)
- o.applyToWriter(csvWriter)
-
- return pipeCSV(csvWriter, csvReader, o)
-
- case io.ReaderFrom:
- var buf bytes.Buffer
- csvWriter := csv.NewWriter(&buf)
- o.applyToWriter(csvWriter)
- if err := bufferedCSV(csvWriter, csvReader, o); err != nil {
- return err
- }
- _, err := destination.ReadFrom(&buf)
-
- return err
-
- case encoding.BinaryUnmarshaler:
- var buf bytes.Buffer
- csvWriter := csv.NewWriter(&buf)
- o.applyToWriter(csvWriter)
- if err := bufferedCSV(csvWriter, csvReader, o); err != nil {
- return err
- }
-
- return destination.UnmarshalBinary(buf.Bytes())
-
- default:
- // support *[][]string, *[]byte, *string
- if ptr := reflect.TypeOf(data); ptr.Kind() != reflect.Ptr {
- return errors.New("destination must be a pointer")
- }
-
- v := reflect.Indirect(reflect.ValueOf(data))
- t := v.Type()
-
- switch {
- case t.Kind() == reflect.Slice && t.Elem().Kind() == reflect.Slice && t.Elem().Elem().Kind() == reflect.String:
- csvWriter := &csvRecordsWriter{}
- // writer options are ignored
- if err := pipeCSV(csvWriter, csvReader, o); err != nil {
- return err
- }
-
- v.Grow(len(csvWriter.records))
- v.SetCap(len(csvWriter.records)) // in case Grow was unnessary, trim down the capacity
- v.SetLen(len(csvWriter.records))
- reflect.Copy(v, reflect.ValueOf(csvWriter.records))
-
- return nil
-
- case t.Kind() == reflect.Slice && t.Elem().Kind() == reflect.Uint8:
- var buf bytes.Buffer
- csvWriter := csv.NewWriter(&buf)
- o.applyToWriter(csvWriter)
- if err := bufferedCSV(csvWriter, csvReader, o); err != nil {
- return err
- }
- v.SetBytes(buf.Bytes())
-
- return nil
-
- case t.Kind() == reflect.String:
- var buf bytes.Buffer
- csvWriter := csv.NewWriter(&buf)
- o.applyToWriter(csvWriter)
- if err := bufferedCSV(csvWriter, csvReader, o); err != nil {
- return err
- }
- v.SetString(buf.String())
-
- return nil
-
- default:
- return fmt.Errorf("%v (%T) is not supported by the CSVConsumer, %s",
- data, data, "can be resolved by supporting CSVWriter/Writer/BinaryUnmarshaler interface",
- )
- }
- }
- })
-}
-
-// CSVProducer creates a new CSV producer.
-//
-// The producer takes input data then writes as CSV to an output writer (essentially as a pipe).
-//
-// Supported input underlying types and interfaces, prioritized in this order:
-// - *csv.Reader
-// - CSVReader (reader options are ignored)
-// - io.Reader
-// - io.WriterTo
-// - encoding.BinaryMarshaler
-// - [][]string
-// - []byte
-// - string
-//
-// The producer prioritizes situations where buffering the input is not required.
-func CSVProducer(opts ...CSVOpt) Producer {
- o := csvOptsWithDefaults(opts)
-
- return ProducerFunc(func(writer io.Writer, data interface{}) error {
- if writer == nil {
- return errors.New("CSVProducer requires a writer")
- }
- if data == nil {
- return errors.New("nil data for CSVProducer")
- }
-
- csvWriter := csv.NewWriter(writer)
- o.applyToWriter(csvWriter)
- closer := defaultCloser
- if o.closeStream {
- if cl, isWriterCloser := writer.(io.Closer); isWriterCloser {
- closer = cl.Close
- }
- }
- defer func() {
- _ = closer()
- }()
-
- if rc, isDataCloser := data.(io.ReadCloser); isDataCloser {
- defer rc.Close()
- }
-
- switch origin := data.(type) {
- case *csv.Reader:
- csvReader := origin
- o.applyToReader(csvReader)
-
- return pipeCSV(csvWriter, csvReader, o)
-
- case CSVReader:
- csvReader := origin
- // no reader options available
-
- return pipeCSV(csvWriter, csvReader, o)
-
- case io.Reader:
- csvReader := csv.NewReader(origin)
- o.applyToReader(csvReader)
-
- return pipeCSV(csvWriter, csvReader, o)
-
- case io.WriterTo:
- // async piping of the writes performed by WriteTo
- r, w := io.Pipe()
- csvReader := csv.NewReader(r)
- o.applyToReader(csvReader)
-
- pipe, _ := errgroup.WithContext(context.Background())
- pipe.Go(func() error {
- _, err := origin.WriteTo(w)
- _ = w.Close()
- return err
- })
-
- pipe.Go(func() error {
- defer func() {
- _ = r.Close()
- }()
-
- return pipeCSV(csvWriter, csvReader, o)
- })
-
- return pipe.Wait()
-
- case encoding.BinaryMarshaler:
- buf, err := origin.MarshalBinary()
- if err != nil {
- return err
- }
- rdr := bytes.NewBuffer(buf)
- csvReader := csv.NewReader(rdr)
-
- return bufferedCSV(csvWriter, csvReader, o)
-
- default:
- // support [][]string, []byte, string (or pointers to those)
- v := reflect.Indirect(reflect.ValueOf(data))
- t := v.Type()
-
- switch {
- case t.Kind() == reflect.Slice && t.Elem().Kind() == reflect.Slice && t.Elem().Elem().Kind() == reflect.String:
- csvReader := &csvRecordsWriter{
- records: make([][]string, v.Len()),
- }
- reflect.Copy(reflect.ValueOf(csvReader.records), v)
-
- return pipeCSV(csvWriter, csvReader, o)
-
- case t.Kind() == reflect.Slice && t.Elem().Kind() == reflect.Uint8:
- buf := bytes.NewBuffer(v.Bytes())
- csvReader := csv.NewReader(buf)
- o.applyToReader(csvReader)
-
- return bufferedCSV(csvWriter, csvReader, o)
-
- case t.Kind() == reflect.String:
- buf := bytes.NewBufferString(v.String())
- csvReader := csv.NewReader(buf)
- o.applyToReader(csvReader)
-
- return bufferedCSV(csvWriter, csvReader, o)
-
- default:
- return fmt.Errorf("%v (%T) is not supported by the CSVProducer, %s",
- data, data, "can be resolved by supporting CSVReader/Reader/BinaryMarshaler interface",
- )
- }
- }
- })
-}
-
-// pipeCSV copies CSV records from a CSV reader to a CSV writer
-func pipeCSV(csvWriter CSVWriter, csvReader CSVReader, opts csvOpts) error {
- for ; opts.skippedLines > 0; opts.skippedLines-- {
- _, err := csvReader.Read()
- if err != nil {
- if errors.Is(err, io.EOF) {
- return nil
- }
-
- return err
- }
- }
-
- for {
- record, err := csvReader.Read()
- if err != nil {
- if errors.Is(err, io.EOF) {
- break
- }
-
- return err
- }
-
- if err := csvWriter.Write(record); err != nil {
- return err
- }
- }
-
- csvWriter.Flush()
-
- return csvWriter.Error()
-}
-
-// bufferedCSV copies CSV records from a CSV reader to a CSV writer,
-// by first reading all records then writing them at once.
-func bufferedCSV(csvWriter *csv.Writer, csvReader *csv.Reader, opts csvOpts) error {
- for ; opts.skippedLines > 0; opts.skippedLines-- {
- _, err := csvReader.Read()
- if err != nil {
- if errors.Is(err, io.EOF) {
- return nil
- }
-
- return err
- }
- }
-
- records, err := csvReader.ReadAll()
- if err != nil {
- return err
- }
-
- return csvWriter.WriteAll(records)
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/csv_options.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/csv_options.go
deleted file mode 100644
index c16464c57..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/csv_options.go
+++ /dev/null
@@ -1,121 +0,0 @@
-package runtime
-
-import (
- "encoding/csv"
- "io"
-)
-
-// CSVOpts alter the behavior of the CSV consumer or producer.
-type CSVOpt func(*csvOpts)
-
-type csvOpts struct {
- csvReader csv.Reader
- csvWriter csv.Writer
- skippedLines int
- closeStream bool
-}
-
-// WithCSVReaderOpts specifies the options to csv.Reader
-// when reading CSV.
-func WithCSVReaderOpts(reader csv.Reader) CSVOpt {
- return func(o *csvOpts) {
- o.csvReader = reader
- }
-}
-
-// WithCSVWriterOpts specifies the options to csv.Writer
-// when writing CSV.
-func WithCSVWriterOpts(writer csv.Writer) CSVOpt {
- return func(o *csvOpts) {
- o.csvWriter = writer
- }
-}
-
-// WithCSVSkipLines will skip header lines.
-func WithCSVSkipLines(skipped int) CSVOpt {
- return func(o *csvOpts) {
- o.skippedLines = skipped
- }
-}
-
-func WithCSVClosesStream() CSVOpt {
- return func(o *csvOpts) {
- o.closeStream = true
- }
-}
-
-func (o csvOpts) applyToReader(in *csv.Reader) {
- if o.csvReader.Comma != 0 {
- in.Comma = o.csvReader.Comma
- }
- if o.csvReader.Comment != 0 {
- in.Comment = o.csvReader.Comment
- }
- if o.csvReader.FieldsPerRecord != 0 {
- in.FieldsPerRecord = o.csvReader.FieldsPerRecord
- }
-
- in.LazyQuotes = o.csvReader.LazyQuotes
- in.TrimLeadingSpace = o.csvReader.TrimLeadingSpace
- in.ReuseRecord = o.csvReader.ReuseRecord
-}
-
-func (o csvOpts) applyToWriter(in *csv.Writer) {
- if o.csvWriter.Comma != 0 {
- in.Comma = o.csvWriter.Comma
- }
- in.UseCRLF = o.csvWriter.UseCRLF
-}
-
-func csvOptsWithDefaults(opts []CSVOpt) csvOpts {
- var o csvOpts
- for _, apply := range opts {
- apply(&o)
- }
-
- return o
-}
-
-type CSVWriter interface {
- Write([]string) error
- Flush()
- Error() error
-}
-
-type CSVReader interface {
- Read() ([]string, error)
-}
-
-var (
- _ CSVWriter = &csvRecordsWriter{}
- _ CSVReader = &csvRecordsWriter{}
-)
-
-// csvRecordsWriter is an internal container to move CSV records back and forth
-type csvRecordsWriter struct {
- i int
- records [][]string
-}
-
-func (w *csvRecordsWriter) Write(record []string) error {
- w.records = append(w.records, record)
-
- return nil
-}
-
-func (w *csvRecordsWriter) Read() ([]string, error) {
- if w.i >= len(w.records) {
- return nil, io.EOF
- }
- defer func() {
- w.i++
- }()
-
- return w.records[w.i], nil
-}
-
-func (w *csvRecordsWriter) Flush() {}
-
-func (w *csvRecordsWriter) Error() error {
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/discard.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/discard.go
deleted file mode 100644
index 0d390cfd6..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/discard.go
+++ /dev/null
@@ -1,9 +0,0 @@
-package runtime
-
-import "io"
-
-// DiscardConsumer does absolutely nothing, it's a black hole.
-var DiscardConsumer = ConsumerFunc(func(_ io.Reader, _ interface{}) error { return nil })
-
-// DiscardProducer does absolutely nothing, it's a black hole.
-var DiscardProducer = ProducerFunc(func(_ io.Writer, _ interface{}) error { return nil })
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/file.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/file.go
deleted file mode 100644
index 397d8a459..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/file.go
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package runtime
-
-import "github.com/go-openapi/swag"
-
-type File = swag.File
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/headers.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/headers.go
deleted file mode 100644
index 4d111db4f..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/headers.go
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package runtime
-
-import (
- "mime"
- "net/http"
-
- "github.com/go-openapi/errors"
-)
-
-// ContentType parses a content type header
-func ContentType(headers http.Header) (string, string, error) {
- ct := headers.Get(HeaderContentType)
- orig := ct
- if ct == "" {
- ct = DefaultMime
- }
- if ct == "" {
- return "", "", nil
- }
-
- mt, opts, err := mime.ParseMediaType(ct)
- if err != nil {
- return "", "", errors.NewParseError(HeaderContentType, "header", orig, err)
- }
-
- if cs, ok := opts[charsetKey]; ok {
- return mt, cs, nil
- }
-
- return mt, "", nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/interfaces.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/interfaces.go
deleted file mode 100644
index e33412868..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/interfaces.go
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package runtime
-
-import (
- "context"
- "io"
- "net/http"
-
- "github.com/go-openapi/strfmt"
-)
-
-// OperationHandlerFunc an adapter for a function to the OperationHandler interface
-type OperationHandlerFunc func(interface{}) (interface{}, error)
-
-// Handle implements the operation handler interface
-func (s OperationHandlerFunc) Handle(data interface{}) (interface{}, error) {
- return s(data)
-}
-
-// OperationHandler a handler for a swagger operation
-type OperationHandler interface {
- Handle(interface{}) (interface{}, error)
-}
-
-// ConsumerFunc represents a function that can be used as a consumer
-type ConsumerFunc func(io.Reader, interface{}) error
-
-// Consume consumes the reader into the data parameter
-func (fn ConsumerFunc) Consume(reader io.Reader, data interface{}) error {
- return fn(reader, data)
-}
-
-// Consumer implementations know how to bind the values on the provided interface to
-// data provided by the request body
-type Consumer interface {
- // Consume performs the binding of request values
- Consume(io.Reader, interface{}) error
-}
-
-// ProducerFunc represents a function that can be used as a producer
-type ProducerFunc func(io.Writer, interface{}) error
-
-// Produce produces the response for the provided data
-func (f ProducerFunc) Produce(writer io.Writer, data interface{}) error {
- return f(writer, data)
-}
-
-// Producer implementations know how to turn the provided interface into a valid
-// HTTP response
-type Producer interface {
- // Produce writes to the http response
- Produce(io.Writer, interface{}) error
-}
-
-// AuthenticatorFunc turns a function into an authenticator
-type AuthenticatorFunc func(interface{}) (bool, interface{}, error)
-
-// Authenticate authenticates the request with the provided data
-func (f AuthenticatorFunc) Authenticate(params interface{}) (bool, interface{}, error) {
- return f(params)
-}
-
-// Authenticator represents an authentication strategy
-// implementations of Authenticator know how to authenticate the
-// request data and translate that into a valid principal object or an error
-type Authenticator interface {
- Authenticate(interface{}) (bool, interface{}, error)
-}
-
-// AuthorizerFunc turns a function into an authorizer
-type AuthorizerFunc func(*http.Request, interface{}) error
-
-// Authorize authorizes the processing of the request for the principal
-func (f AuthorizerFunc) Authorize(r *http.Request, principal interface{}) error {
- return f(r, principal)
-}
-
-// Authorizer represents an authorization strategy
-// implementations of Authorizer know how to authorize the principal object
-// using the request data and returns error if unauthorized
-type Authorizer interface {
- Authorize(*http.Request, interface{}) error
-}
-
-// Validatable types implementing this interface allow customizing their validation
-// this will be used instead of the reflective validation based on the spec document.
-// the implementations are assumed to have been generated by the swagger tool so they should
-// contain all the validations obtained from the spec
-type Validatable interface {
- Validate(strfmt.Registry) error
-}
-
-// ContextValidatable types implementing this interface allow customizing their validation
-// this will be used instead of the reflective validation based on the spec document.
-// the implementations are assumed to have been generated by the swagger tool so they should
-// contain all the context validations obtained from the spec
-type ContextValidatable interface {
- ContextValidate(context.Context, strfmt.Registry) error
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/json.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/json.go
deleted file mode 100644
index 5a690559c..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/json.go
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package runtime
-
-import (
- "encoding/json"
- "io"
-)
-
-// JSONConsumer creates a new JSON consumer
-func JSONConsumer() Consumer {
- return ConsumerFunc(func(reader io.Reader, data interface{}) error {
- dec := json.NewDecoder(reader)
- dec.UseNumber() // preserve number formats
- return dec.Decode(data)
- })
-}
-
-// JSONProducer creates a new JSON producer
-func JSONProducer() Producer {
- return ProducerFunc(func(writer io.Writer, data interface{}) error {
- enc := json.NewEncoder(writer)
- enc.SetEscapeHTML(false)
- return enc.Encode(data)
- })
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/request.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/request.go
deleted file mode 100644
index 9e3e1ecb1..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/request.go
+++ /dev/null
@@ -1,149 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package runtime
-
-import (
- "bufio"
- "context"
- "errors"
- "io"
- "net/http"
- "strings"
-
- "github.com/go-openapi/swag"
-)
-
-// CanHaveBody returns true if this method can have a body
-func CanHaveBody(method string) bool {
- mn := strings.ToUpper(method)
- return mn == "POST" || mn == "PUT" || mn == "PATCH" || mn == "DELETE"
-}
-
-// IsSafe returns true if this is a request with a safe method
-func IsSafe(r *http.Request) bool {
- mn := strings.ToUpper(r.Method)
- return mn == "GET" || mn == "HEAD"
-}
-
-// AllowsBody returns true if the request allows for a body
-func AllowsBody(r *http.Request) bool {
- mn := strings.ToUpper(r.Method)
- return mn != "HEAD"
-}
-
-// HasBody returns true if this method needs a content-type
-func HasBody(r *http.Request) bool {
- // happy case: we have a content length set
- if r.ContentLength > 0 {
- return true
- }
-
- if r.Header.Get("content-length") != "" {
- // in this case, no Transfer-Encoding should be present
- // we have a header set but it was explicitly set to 0, so we assume no body
- return false
- }
-
- rdr := newPeekingReader(r.Body)
- r.Body = rdr
- return rdr.HasContent()
-}
-
-func newPeekingReader(r io.ReadCloser) *peekingReader {
- if r == nil {
- return nil
- }
- return &peekingReader{
- underlying: bufio.NewReader(r),
- orig: r,
- }
-}
-
-type peekingReader struct {
- underlying interface {
- Buffered() int
- Peek(int) ([]byte, error)
- Read([]byte) (int, error)
- }
- orig io.ReadCloser
-}
-
-func (p *peekingReader) HasContent() bool {
- if p == nil {
- return false
- }
- if p.underlying.Buffered() > 0 {
- return true
- }
- b, err := p.underlying.Peek(1)
- if err != nil {
- return false
- }
- return len(b) > 0
-}
-
-func (p *peekingReader) Read(d []byte) (int, error) {
- if p == nil {
- return 0, io.EOF
- }
- if p.underlying == nil {
- return 0, io.ErrUnexpectedEOF
- }
- return p.underlying.Read(d)
-}
-
-func (p *peekingReader) Close() error {
- if p.underlying == nil {
- return errors.New("reader already closed")
- }
- p.underlying = nil
- if p.orig != nil {
- return p.orig.Close()
- }
- return nil
-}
-
-// JSONRequest creates a new http request with json headers set.
-//
-// It uses context.Background.
-func JSONRequest(method, urlStr string, body io.Reader) (*http.Request, error) {
- req, err := http.NewRequestWithContext(context.Background(), method, urlStr, body)
- if err != nil {
- return nil, err
- }
- req.Header.Add(HeaderContentType, JSONMime)
- req.Header.Add(HeaderAccept, JSONMime)
- return req, nil
-}
-
-// Gettable for things with a method GetOK(string) (data string, hasKey bool, hasValue bool)
-type Gettable interface {
- GetOK(string) ([]string, bool, bool)
-}
-
-// ReadSingleValue reads a single value from the source
-func ReadSingleValue(values Gettable, name string) string {
- vv, _, hv := values.GetOK(name)
- if hv {
- return vv[len(vv)-1]
- }
- return ""
-}
-
-// ReadCollectionValue reads a collection value from a string data source
-func ReadCollectionValue(values Gettable, name, collectionFormat string) []string {
- v := ReadSingleValue(values, name)
- return swag.SplitByFormat(v, collectionFormat)
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/statuses.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/statuses.go
deleted file mode 100644
index 3b011a0bf..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/statuses.go
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package runtime
-
-// Statuses lists the most common HTTP status codes to default message
-// taken from https://httpstatuses.com/
-var Statuses = map[int]string{
- 100: "Continue",
- 101: "Switching Protocols",
- 102: "Processing",
- 103: "Checkpoint",
- 122: "URI too long",
- 200: "OK",
- 201: "Created",
- 202: "Accepted",
- 203: "Request Processed",
- 204: "No Content",
- 205: "Reset Content",
- 206: "Partial Content",
- 207: "Multi-Status",
- 208: "Already Reported",
- 226: "IM Used",
- 300: "Multiple Choices",
- 301: "Moved Permanently",
- 302: "Found",
- 303: "See Other",
- 304: "Not Modified",
- 305: "Use Proxy",
- 306: "Switch Proxy",
- 307: "Temporary Redirect",
- 308: "Permanent Redirect",
- 400: "Bad Request",
- 401: "Unauthorized",
- 402: "Payment Required",
- 403: "Forbidden",
- 404: "Not Found",
- 405: "Method Not Allowed",
- 406: "Not Acceptable",
- 407: "Proxy Authentication Required",
- 408: "Request Timeout",
- 409: "Conflict",
- 410: "Gone",
- 411: "Length Required",
- 412: "Precondition Failed",
- 413: "Request Entity Too Large",
- 414: "Request-URI Too Long",
- 415: "Unsupported Media Type",
- 416: "Request Range Not Satisfiable",
- 417: "Expectation Failed",
- 418: "I'm a teapot",
- 420: "Enhance Your Calm",
- 422: "Unprocessable Entity",
- 423: "Locked",
- 424: "Failed Dependency",
- 426: "Upgrade Required",
- 428: "Precondition Required",
- 429: "Too Many Requests",
- 431: "Request Header Fields Too Large",
- 444: "No Response",
- 449: "Retry With",
- 450: "Blocked by Windows Parental Controls",
- 451: "Wrong Exchange Server",
- 499: "Client Closed Request",
- 500: "Internal Server Error",
- 501: "Not Implemented",
- 502: "Bad Gateway",
- 503: "Service Unavailable",
- 504: "Gateway Timeout",
- 505: "HTTP Version Not Supported",
- 506: "Variant Also Negotiates",
- 507: "Insufficient Storage",
- 508: "Loop Detected",
- 509: "Bandwidth Limit Exceeded",
- 510: "Not Extended",
- 511: "Network Authentication Required",
- 598: "Network read timeout error",
- 599: "Network connect timeout error",
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/text.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/text.go
deleted file mode 100644
index f33320b7d..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/text.go
+++ /dev/null
@@ -1,116 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package runtime
-
-import (
- "bytes"
- "encoding"
- "errors"
- "fmt"
- "io"
- "reflect"
-
- "github.com/go-openapi/swag"
-)
-
-// TextConsumer creates a new text consumer
-func TextConsumer() Consumer {
- return ConsumerFunc(func(reader io.Reader, data interface{}) error {
- if reader == nil {
- return errors.New("TextConsumer requires a reader") // early exit
- }
-
- buf := new(bytes.Buffer)
- _, err := buf.ReadFrom(reader)
- if err != nil {
- return err
- }
- b := buf.Bytes()
-
- // If the buffer is empty, no need to unmarshal it, which causes a panic.
- if len(b) == 0 {
- return nil
- }
-
- if tu, ok := data.(encoding.TextUnmarshaler); ok {
- err := tu.UnmarshalText(b)
- if err != nil {
- return fmt.Errorf("text consumer: %v", err)
- }
-
- return nil
- }
-
- t := reflect.TypeOf(data)
- if data != nil && t.Kind() == reflect.Ptr {
- v := reflect.Indirect(reflect.ValueOf(data))
- if t.Elem().Kind() == reflect.String {
- v.SetString(string(b))
- return nil
- }
- }
-
- return fmt.Errorf("%v (%T) is not supported by the TextConsumer, %s",
- data, data, "can be resolved by supporting TextUnmarshaler interface")
- })
-}
-
-// TextProducer creates a new text producer
-func TextProducer() Producer {
- return ProducerFunc(func(writer io.Writer, data interface{}) error {
- if writer == nil {
- return errors.New("TextProducer requires a writer") // early exit
- }
-
- if data == nil {
- return errors.New("no data given to produce text from")
- }
-
- if tm, ok := data.(encoding.TextMarshaler); ok {
- txt, err := tm.MarshalText()
- if err != nil {
- return fmt.Errorf("text producer: %v", err)
- }
- _, err = writer.Write(txt)
- return err
- }
-
- if str, ok := data.(error); ok {
- _, err := writer.Write([]byte(str.Error()))
- return err
- }
-
- if str, ok := data.(fmt.Stringer); ok {
- _, err := writer.Write([]byte(str.String()))
- return err
- }
-
- v := reflect.Indirect(reflect.ValueOf(data))
- if t := v.Type(); t.Kind() == reflect.Struct || t.Kind() == reflect.Slice {
- b, err := swag.WriteJSON(data)
- if err != nil {
- return err
- }
- _, err = writer.Write(b)
- return err
- }
- if v.Kind() != reflect.String {
- return fmt.Errorf("%T is not a supported type by the TextProducer", data)
- }
-
- _, err := writer.Write([]byte(v.String()))
- return err
- })
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/values.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/values.go
deleted file mode 100644
index 11f5732af..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/values.go
+++ /dev/null
@@ -1,19 +0,0 @@
-package runtime
-
-// Values typically represent parameters on a http request.
-type Values map[string][]string
-
-// GetOK returns the values collection for the given key.
-// When the key is present in the map it will return true for hasKey.
-// When the value is not empty it will return true for hasValue.
-func (v Values) GetOK(key string) (value []string, hasKey bool, hasValue bool) {
- value, hasKey = v[key]
- if !hasKey {
- return
- }
- if len(value) == 0 {
- return
- }
- hasValue = true
- return
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/xml.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/xml.go
deleted file mode 100644
index 821c7393d..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/runtime/xml.go
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package runtime
-
-import (
- "encoding/xml"
- "io"
-)
-
-// XMLConsumer creates a new XML consumer
-func XMLConsumer() Consumer {
- return ConsumerFunc(func(reader io.Reader, data interface{}) error {
- dec := xml.NewDecoder(reader)
- return dec.Decode(data)
- })
-}
-
-// XMLProducer creates a new XML producer
-func XMLProducer() Producer {
- return ProducerFunc(func(writer io.Writer, data interface{}) error {
- enc := xml.NewEncoder(writer)
- return enc.Encode(data)
- })
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/.editorconfig b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/.editorconfig
deleted file mode 100644
index 3152da69a..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/.editorconfig
+++ /dev/null
@@ -1,26 +0,0 @@
-# top-most EditorConfig file
-root = true
-
-# Unix-style newlines with a newline ending every file
-[*]
-end_of_line = lf
-insert_final_newline = true
-indent_style = space
-indent_size = 2
-trim_trailing_whitespace = true
-
-# Set default charset
-[*.{js,py,go,scala,rb,java,html,css,less,sass,md}]
-charset = utf-8
-
-# Tab indentation (no size specified)
-[*.go]
-indent_style = tab
-
-[*.md]
-trim_trailing_whitespace = false
-
-# Matches the exact files either package.json or .travis.yml
-[{package.json,.travis.yml}]
-indent_style = space
-indent_size = 2
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/.gitignore b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/.gitignore
deleted file mode 100644
index f47cb2045..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-*.out
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/.golangci.yml b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/.golangci.yml
deleted file mode 100644
index 22f8d21cc..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/.golangci.yml
+++ /dev/null
@@ -1,61 +0,0 @@
-linters-settings:
- govet:
- check-shadowing: true
- golint:
- min-confidence: 0
- gocyclo:
- min-complexity: 45
- maligned:
- suggest-new: true
- dupl:
- threshold: 200
- goconst:
- min-len: 2
- min-occurrences: 3
-
-linters:
- enable-all: true
- disable:
- - maligned
- - unparam
- - lll
- - gochecknoinits
- - gochecknoglobals
- - funlen
- - godox
- - gocognit
- - whitespace
- - wsl
- - wrapcheck
- - testpackage
- - nlreturn
- - gomnd
- - exhaustivestruct
- - goerr113
- - errorlint
- - nestif
- - godot
- - gofumpt
- - paralleltest
- - tparallel
- - thelper
- - ifshort
- - exhaustruct
- - varnamelen
- - gci
- - depguard
- - errchkjson
- - inamedparam
- - nonamedreturns
- - musttag
- - ireturn
- - forcetypeassert
- - cyclop
- # deprecated linters
- - deadcode
- - interfacer
- - scopelint
- - varcheck
- - structcheck
- - golint
- - nosnakecase
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md
deleted file mode 100644
index 9322b065e..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md
+++ /dev/null
@@ -1,74 +0,0 @@
-# Contributor Covenant Code of Conduct
-
-## Our Pledge
-
-In the interest of fostering an open and welcoming environment, we as
-contributors and maintainers pledge to making participation in our project and
-our community a harassment-free experience for everyone, regardless of age, body
-size, disability, ethnicity, gender identity and expression, level of experience,
-nationality, personal appearance, race, religion, or sexual identity and
-orientation.
-
-## Our Standards
-
-Examples of behavior that contributes to creating a positive environment
-include:
-
-* Using welcoming and inclusive language
-* Being respectful of differing viewpoints and experiences
-* Gracefully accepting constructive criticism
-* Focusing on what is best for the community
-* Showing empathy towards other community members
-
-Examples of unacceptable behavior by participants include:
-
-* The use of sexualized language or imagery and unwelcome sexual attention or
-advances
-* Trolling, insulting/derogatory comments, and personal or political attacks
-* Public or private harassment
-* Publishing others' private information, such as a physical or electronic
- address, without explicit permission
-* Other conduct which could reasonably be considered inappropriate in a
- professional setting
-
-## Our Responsibilities
-
-Project maintainers are responsible for clarifying the standards of acceptable
-behavior and are expected to take appropriate and fair corrective action in
-response to any instances of unacceptable behavior.
-
-Project maintainers have the right and responsibility to remove, edit, or
-reject comments, commits, code, wiki edits, issues, and other contributions
-that are not aligned to this Code of Conduct, or to ban temporarily or
-permanently any contributor for other behaviors that they deem inappropriate,
-threatening, offensive, or harmful.
-
-## Scope
-
-This Code of Conduct applies both within project spaces and in public spaces
-when an individual is representing the project or its community. Examples of
-representing a project or community include using an official project e-mail
-address, posting via an official social media account, or acting as an appointed
-representative at an online or offline event. Representation of a project may be
-further defined and clarified by project maintainers.
-
-## Enforcement
-
-Instances of abusive, harassing, or otherwise unacceptable behavior may be
-reported by contacting the project team at ivan+abuse@flanders.co.nz. All
-complaints will be reviewed and investigated and will result in a response that
-is deemed necessary and appropriate to the circumstances. The project team is
-obligated to maintain confidentiality with regard to the reporter of an incident.
-Further details of specific enforcement policies may be posted separately.
-
-Project maintainers who do not follow or enforce the Code of Conduct in good
-faith may face temporary or permanent repercussions as determined by other
-members of the project's leadership.
-
-## Attribution
-
-This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
-available at [http://contributor-covenant.org/version/1/4][version]
-
-[homepage]: http://contributor-covenant.org
-[version]: http://contributor-covenant.org/version/1/4/
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/LICENSE b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/LICENSE
deleted file mode 100644
index d64569567..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/README.md b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/README.md
deleted file mode 100644
index 7fd2810c6..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-# OpenAPI v2 object model [](https://github.com/go-openapi/spec/actions?query=workflow%3A"go+test") [](https://codecov.io/gh/go-openapi/spec)
-
-[](https://slackin.goswagger.io)
-[](https://raw.githubusercontent.com/go-openapi/spec/master/LICENSE)
-[](https://pkg.go.dev/github.com/go-openapi/spec)
-[](https://goreportcard.com/report/github.com/go-openapi/spec)
-
-The object model for OpenAPI specification documents.
-
-### FAQ
-
-* What does this do?
-
-> 1. This package knows how to marshal and unmarshal Swagger API specifications into a golang object model
-> 2. It knows how to resolve $ref and expand them to make a single root document
-
-* How does it play with the rest of the go-openapi packages ?
-
-> 1. This package is at the core of the go-openapi suite of packages and [code generator](https://github.com/go-swagger/go-swagger)
-> 2. There is a [spec loading package](https://github.com/go-openapi/loads) to fetch specs as JSON or YAML from local or remote locations
-> 3. There is a [spec validation package](https://github.com/go-openapi/validate) built on top of it
-> 4. There is a [spec analysis package](https://github.com/go-openapi/analysis) built on top of it, to analyze, flatten, fix and merge spec documents
-
-* Does this library support OpenAPI 3?
-
-> No.
-> This package currently only supports OpenAPI 2.0 (aka Swagger 2.0).
-> There is no plan to make it evolve toward supporting OpenAPI 3.x.
-> This [discussion thread](https://github.com/go-openapi/spec/issues/21) relates the full story.
->
-> An early attempt to support Swagger 3 may be found at: https://github.com/go-openapi/spec3
-
-* Does the unmarshaling support YAML?
-
-> Not directly. The exposed types know only how to unmarshal from JSON.
->
-> In order to load a YAML document as a Swagger spec, you need to use the loaders provided by
-> github.com/go-openapi/loads
->
-> Take a look at the example there: https://pkg.go.dev/github.com/go-openapi/loads#example-Spec
->
-> See also https://github.com/go-openapi/spec/issues/164
-
-* How can I validate a spec?
-
-> Validation is provided by [the validate package](http://github.com/go-openapi/validate)
-
-* Why do we have an `ID` field for `Schema` which is not part of the swagger spec?
-
-> We found jsonschema compatibility more important: since `id` in jsonschema influences
-> how `$ref` are resolved.
-> This `id` does not conflict with any property named `id`.
->
-> See also https://github.com/go-openapi/spec/issues/23
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/cache.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/cache.go
deleted file mode 100644
index 122993b44..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/cache.go
+++ /dev/null
@@ -1,98 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package spec
-
-import (
- "sync"
-)
-
-// ResolutionCache a cache for resolving urls
-type ResolutionCache interface {
- Get(string) (interface{}, bool)
- Set(string, interface{})
-}
-
-type simpleCache struct {
- lock sync.RWMutex
- store map[string]interface{}
-}
-
-func (s *simpleCache) ShallowClone() ResolutionCache {
- store := make(map[string]interface{}, len(s.store))
- s.lock.RLock()
- for k, v := range s.store {
- store[k] = v
- }
- s.lock.RUnlock()
-
- return &simpleCache{
- store: store,
- }
-}
-
-// Get retrieves a cached URI
-func (s *simpleCache) Get(uri string) (interface{}, bool) {
- s.lock.RLock()
- v, ok := s.store[uri]
-
- s.lock.RUnlock()
- return v, ok
-}
-
-// Set caches a URI
-func (s *simpleCache) Set(uri string, data interface{}) {
- s.lock.Lock()
- s.store[uri] = data
- s.lock.Unlock()
-}
-
-var (
- // resCache is a package level cache for $ref resolution and expansion.
- // It is initialized lazily by methods that have the need for it: no
- // memory is allocated unless some expander methods are called.
- //
- // It is initialized with JSON schema and swagger schema,
- // which do not mutate during normal operations.
- //
- // All subsequent utilizations of this cache are produced from a shallow
- // clone of this initial version.
- resCache *simpleCache
- onceCache sync.Once
-
- _ ResolutionCache = &simpleCache{}
-)
-
-// initResolutionCache initializes the URI resolution cache. To be wrapped in a sync.Once.Do call.
-func initResolutionCache() {
- resCache = defaultResolutionCache()
-}
-
-func defaultResolutionCache() *simpleCache {
- return &simpleCache{store: map[string]interface{}{
- "http://swagger.io/v2/schema.json": MustLoadSwagger20Schema(),
- "http://json-schema.org/draft-04/schema": MustLoadJSONSchemaDraft04(),
- }}
-}
-
-func cacheOrDefault(cache ResolutionCache) ResolutionCache {
- onceCache.Do(initResolutionCache)
-
- if cache != nil {
- return cache
- }
-
- // get a shallow clone of the base cache with swagger and json schema
- return resCache.ShallowClone()
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/contact_info.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/contact_info.go
deleted file mode 100644
index 2f7bb219b..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/contact_info.go
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package spec
-
-import (
- "encoding/json"
-
- "github.com/go-openapi/swag"
-)
-
-// ContactInfo contact information for the exposed API.
-//
-// For more information: http://goo.gl/8us55a#contactObject
-type ContactInfo struct {
- ContactInfoProps
- VendorExtensible
-}
-
-// ContactInfoProps hold the properties of a ContactInfo object
-type ContactInfoProps struct {
- Name string `json:"name,omitempty"`
- URL string `json:"url,omitempty"`
- Email string `json:"email,omitempty"`
-}
-
-// UnmarshalJSON hydrates ContactInfo from json
-func (c *ContactInfo) UnmarshalJSON(data []byte) error {
- if err := json.Unmarshal(data, &c.ContactInfoProps); err != nil {
- return err
- }
- return json.Unmarshal(data, &c.VendorExtensible)
-}
-
-// MarshalJSON produces ContactInfo as json
-func (c ContactInfo) MarshalJSON() ([]byte, error) {
- b1, err := json.Marshal(c.ContactInfoProps)
- if err != nil {
- return nil, err
- }
- b2, err := json.Marshal(c.VendorExtensible)
- if err != nil {
- return nil, err
- }
- return swag.ConcatJSON(b1, b2), nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/debug.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/debug.go
deleted file mode 100644
index fc889f6d0..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/debug.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package spec
-
-import (
- "fmt"
- "log"
- "os"
- "path"
- "runtime"
-)
-
-// Debug is true when the SWAGGER_DEBUG env var is not empty.
-//
-// It enables a more verbose logging of this package.
-var Debug = os.Getenv("SWAGGER_DEBUG") != ""
-
-var (
- // specLogger is a debug logger for this package
- specLogger *log.Logger
-)
-
-func init() {
- debugOptions()
-}
-
-func debugOptions() {
- specLogger = log.New(os.Stdout, "spec:", log.LstdFlags)
-}
-
-func debugLog(msg string, args ...interface{}) {
- // A private, trivial trace logger, based on go-openapi/spec/expander.go:debugLog()
- if Debug {
- _, file1, pos1, _ := runtime.Caller(1)
- specLogger.Printf("%s:%d: %s", path.Base(file1), pos1, fmt.Sprintf(msg, args...))
- }
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/embed.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/embed.go
deleted file mode 100644
index 1f4284750..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/embed.go
+++ /dev/null
@@ -1,17 +0,0 @@
-package spec
-
-import (
- "embed"
- "path"
-)
-
-//go:embed schemas/*.json schemas/*/*.json
-var assets embed.FS
-
-func jsonschemaDraft04JSONBytes() ([]byte, error) {
- return assets.ReadFile(path.Join("schemas", "jsonschema-draft-04.json"))
-}
-
-func v2SchemaJSONBytes() ([]byte, error) {
- return assets.ReadFile(path.Join("schemas", "v2", "schema.json"))
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/errors.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/errors.go
deleted file mode 100644
index 6992c7ba7..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/errors.go
+++ /dev/null
@@ -1,19 +0,0 @@
-package spec
-
-import "errors"
-
-// Error codes
-var (
- // ErrUnknownTypeForReference indicates that a resolved reference was found in an unsupported container type
- ErrUnknownTypeForReference = errors.New("unknown type for the resolved reference")
-
- // ErrResolveRefNeedsAPointer indicates that a $ref target must be a valid JSON pointer
- ErrResolveRefNeedsAPointer = errors.New("resolve ref: target needs to be a pointer")
-
- // ErrDerefUnsupportedType indicates that a resolved reference was found in an unsupported container type.
- // At the moment, $ref are supported only inside: schemas, parameters, responses, path items
- ErrDerefUnsupportedType = errors.New("deref: unsupported type")
-
- // ErrExpandUnsupportedType indicates that $ref expansion is attempted on some invalid type
- ErrExpandUnsupportedType = errors.New("expand: unsupported type. Input should be of type *Parameter or *Response")
-)
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/expander.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/expander.go
deleted file mode 100644
index b81a5699a..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/expander.go
+++ /dev/null
@@ -1,607 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package spec
-
-import (
- "encoding/json"
- "fmt"
-)
-
-// ExpandOptions provides options for the spec expander.
-//
-// RelativeBase is the path to the root document. This can be a remote URL or a path to a local file.
-//
-// If left empty, the root document is assumed to be located in the current working directory:
-// all relative $ref's will be resolved from there.
-//
-// PathLoader injects a document loading method. By default, this resolves to the function provided by the SpecLoader package variable.
-type ExpandOptions struct {
- RelativeBase string // the path to the root document to expand. This is a file, not a directory
- SkipSchemas bool // do not expand schemas, just paths, parameters and responses
- ContinueOnError bool // continue expanding even after and error is found
- PathLoader func(string) (json.RawMessage, error) `json:"-"` // the document loading method that takes a path as input and yields a json document
- AbsoluteCircularRef bool // circular $ref remaining after expansion remain absolute URLs
-}
-
-func optionsOrDefault(opts *ExpandOptions) *ExpandOptions {
- if opts != nil {
- clone := *opts // shallow clone to avoid internal changes to be propagated to the caller
- if clone.RelativeBase != "" {
- clone.RelativeBase = normalizeBase(clone.RelativeBase)
- }
- // if the relative base is empty, let the schema loader choose a pseudo root document
- return &clone
- }
- return &ExpandOptions{}
-}
-
-// ExpandSpec expands the references in a swagger spec
-func ExpandSpec(spec *Swagger, options *ExpandOptions) error {
- options = optionsOrDefault(options)
- resolver := defaultSchemaLoader(spec, options, nil, nil)
-
- specBasePath := options.RelativeBase
-
- if !options.SkipSchemas {
- for key, definition := range spec.Definitions {
- parentRefs := make([]string, 0, 10)
- parentRefs = append(parentRefs, "#/definitions/"+key)
-
- def, err := expandSchema(definition, parentRefs, resolver, specBasePath)
- if resolver.shouldStopOnError(err) {
- return err
- }
- if def != nil {
- spec.Definitions[key] = *def
- }
- }
- }
-
- for key := range spec.Parameters {
- parameter := spec.Parameters[key]
- if err := expandParameterOrResponse(¶meter, resolver, specBasePath); resolver.shouldStopOnError(err) {
- return err
- }
- spec.Parameters[key] = parameter
- }
-
- for key := range spec.Responses {
- response := spec.Responses[key]
- if err := expandParameterOrResponse(&response, resolver, specBasePath); resolver.shouldStopOnError(err) {
- return err
- }
- spec.Responses[key] = response
- }
-
- if spec.Paths != nil {
- for key := range spec.Paths.Paths {
- pth := spec.Paths.Paths[key]
- if err := expandPathItem(&pth, resolver, specBasePath); resolver.shouldStopOnError(err) {
- return err
- }
- spec.Paths.Paths[key] = pth
- }
- }
-
- return nil
-}
-
-const rootBase = ".root"
-
-// baseForRoot loads in the cache the root document and produces a fake ".root" base path entry
-// for further $ref resolution
-func baseForRoot(root interface{}, cache ResolutionCache) string {
- // cache the root document to resolve $ref's
- normalizedBase := normalizeBase(rootBase)
-
- if root == nil {
- // ensure that we never leave a nil root: always cache the root base pseudo-document
- cachedRoot, found := cache.Get(normalizedBase)
- if found && cachedRoot != nil {
- // the cache is already preloaded with a root
- return normalizedBase
- }
-
- root = map[string]interface{}{}
- }
-
- cache.Set(normalizedBase, root)
-
- return normalizedBase
-}
-
-// ExpandSchema expands the refs in the schema object with reference to the root object.
-//
-// go-openapi/validate uses this function.
-//
-// Notice that it is impossible to reference a json schema in a different document other than root
-// (use ExpandSchemaWithBasePath to resolve external references).
-//
-// Setting the cache is optional and this parameter may safely be left to nil.
-func ExpandSchema(schema *Schema, root interface{}, cache ResolutionCache) error {
- cache = cacheOrDefault(cache)
- if root == nil {
- root = schema
- }
-
- opts := &ExpandOptions{
- // when a root is specified, cache the root as an in-memory document for $ref retrieval
- RelativeBase: baseForRoot(root, cache),
- SkipSchemas: false,
- ContinueOnError: false,
- }
-
- return ExpandSchemaWithBasePath(schema, cache, opts)
-}
-
-// ExpandSchemaWithBasePath expands the refs in the schema object, base path configured through expand options.
-//
-// Setting the cache is optional and this parameter may safely be left to nil.
-func ExpandSchemaWithBasePath(schema *Schema, cache ResolutionCache, opts *ExpandOptions) error {
- if schema == nil {
- return nil
- }
-
- cache = cacheOrDefault(cache)
-
- opts = optionsOrDefault(opts)
-
- resolver := defaultSchemaLoader(nil, opts, cache, nil)
-
- parentRefs := make([]string, 0, 10)
- s, err := expandSchema(*schema, parentRefs, resolver, opts.RelativeBase)
- if err != nil {
- return err
- }
- if s != nil {
- // guard for when continuing on error
- *schema = *s
- }
-
- return nil
-}
-
-func expandItems(target Schema, parentRefs []string, resolver *schemaLoader, basePath string) (*Schema, error) {
- if target.Items == nil {
- return &target, nil
- }
-
- // array
- if target.Items.Schema != nil {
- t, err := expandSchema(*target.Items.Schema, parentRefs, resolver, basePath)
- if err != nil {
- return nil, err
- }
- *target.Items.Schema = *t
- }
-
- // tuple
- for i := range target.Items.Schemas {
- t, err := expandSchema(target.Items.Schemas[i], parentRefs, resolver, basePath)
- if err != nil {
- return nil, err
- }
- target.Items.Schemas[i] = *t
- }
-
- return &target, nil
-}
-
-func expandSchema(target Schema, parentRefs []string, resolver *schemaLoader, basePath string) (*Schema, error) {
- if target.Ref.String() == "" && target.Ref.IsRoot() {
- newRef := normalizeRef(&target.Ref, basePath)
- target.Ref = *newRef
- return &target, nil
- }
-
- // change the base path of resolution when an ID is encountered
- // otherwise the basePath should inherit the parent's
- if target.ID != "" {
- basePath, _ = resolver.setSchemaID(target, target.ID, basePath)
- }
-
- if target.Ref.String() != "" {
- if !resolver.options.SkipSchemas {
- return expandSchemaRef(target, parentRefs, resolver, basePath)
- }
-
- // when "expand" with SkipSchema, we just rebase the existing $ref without replacing
- // the full schema.
- rebasedRef, err := NewRef(normalizeURI(target.Ref.String(), basePath))
- if err != nil {
- return nil, err
- }
- target.Ref = denormalizeRef(&rebasedRef, resolver.context.basePath, resolver.context.rootID)
-
- return &target, nil
- }
-
- for k := range target.Definitions {
- tt, err := expandSchema(target.Definitions[k], parentRefs, resolver, basePath)
- if resolver.shouldStopOnError(err) {
- return &target, err
- }
- if tt != nil {
- target.Definitions[k] = *tt
- }
- }
-
- t, err := expandItems(target, parentRefs, resolver, basePath)
- if resolver.shouldStopOnError(err) {
- return &target, err
- }
- if t != nil {
- target = *t
- }
-
- for i := range target.AllOf {
- t, err := expandSchema(target.AllOf[i], parentRefs, resolver, basePath)
- if resolver.shouldStopOnError(err) {
- return &target, err
- }
- if t != nil {
- target.AllOf[i] = *t
- }
- }
-
- for i := range target.AnyOf {
- t, err := expandSchema(target.AnyOf[i], parentRefs, resolver, basePath)
- if resolver.shouldStopOnError(err) {
- return &target, err
- }
- if t != nil {
- target.AnyOf[i] = *t
- }
- }
-
- for i := range target.OneOf {
- t, err := expandSchema(target.OneOf[i], parentRefs, resolver, basePath)
- if resolver.shouldStopOnError(err) {
- return &target, err
- }
- if t != nil {
- target.OneOf[i] = *t
- }
- }
-
- if target.Not != nil {
- t, err := expandSchema(*target.Not, parentRefs, resolver, basePath)
- if resolver.shouldStopOnError(err) {
- return &target, err
- }
- if t != nil {
- *target.Not = *t
- }
- }
-
- for k := range target.Properties {
- t, err := expandSchema(target.Properties[k], parentRefs, resolver, basePath)
- if resolver.shouldStopOnError(err) {
- return &target, err
- }
- if t != nil {
- target.Properties[k] = *t
- }
- }
-
- if target.AdditionalProperties != nil && target.AdditionalProperties.Schema != nil {
- t, err := expandSchema(*target.AdditionalProperties.Schema, parentRefs, resolver, basePath)
- if resolver.shouldStopOnError(err) {
- return &target, err
- }
- if t != nil {
- *target.AdditionalProperties.Schema = *t
- }
- }
-
- for k := range target.PatternProperties {
- t, err := expandSchema(target.PatternProperties[k], parentRefs, resolver, basePath)
- if resolver.shouldStopOnError(err) {
- return &target, err
- }
- if t != nil {
- target.PatternProperties[k] = *t
- }
- }
-
- for k := range target.Dependencies {
- if target.Dependencies[k].Schema != nil {
- t, err := expandSchema(*target.Dependencies[k].Schema, parentRefs, resolver, basePath)
- if resolver.shouldStopOnError(err) {
- return &target, err
- }
- if t != nil {
- *target.Dependencies[k].Schema = *t
- }
- }
- }
-
- if target.AdditionalItems != nil && target.AdditionalItems.Schema != nil {
- t, err := expandSchema(*target.AdditionalItems.Schema, parentRefs, resolver, basePath)
- if resolver.shouldStopOnError(err) {
- return &target, err
- }
- if t != nil {
- *target.AdditionalItems.Schema = *t
- }
- }
- return &target, nil
-}
-
-func expandSchemaRef(target Schema, parentRefs []string, resolver *schemaLoader, basePath string) (*Schema, error) {
- // if a Ref is found, all sibling fields are skipped
- // Ref also changes the resolution scope of children expandSchema
-
- // here the resolution scope is changed because a $ref was encountered
- normalizedRef := normalizeRef(&target.Ref, basePath)
- normalizedBasePath := normalizedRef.RemoteURI()
-
- if resolver.isCircular(normalizedRef, basePath, parentRefs...) {
- // this means there is a cycle in the recursion tree: return the Ref
- // - circular refs cannot be expanded. We leave them as ref.
- // - denormalization means that a new local file ref is set relative to the original basePath
- debugLog("short circuit circular ref: basePath: %s, normalizedPath: %s, normalized ref: %s",
- basePath, normalizedBasePath, normalizedRef.String())
- if !resolver.options.AbsoluteCircularRef {
- target.Ref = denormalizeRef(normalizedRef, resolver.context.basePath, resolver.context.rootID)
- } else {
- target.Ref = *normalizedRef
- }
- return &target, nil
- }
-
- var t *Schema
- err := resolver.Resolve(&target.Ref, &t, basePath)
- if resolver.shouldStopOnError(err) {
- return nil, err
- }
-
- if t == nil {
- // guard for when continuing on error
- return &target, nil
- }
-
- parentRefs = append(parentRefs, normalizedRef.String())
- transitiveResolver := resolver.transitiveResolver(basePath, target.Ref)
-
- basePath = resolver.updateBasePath(transitiveResolver, normalizedBasePath)
-
- return expandSchema(*t, parentRefs, transitiveResolver, basePath)
-}
-
-func expandPathItem(pathItem *PathItem, resolver *schemaLoader, basePath string) error {
- if pathItem == nil {
- return nil
- }
-
- parentRefs := make([]string, 0, 10)
- if err := resolver.deref(pathItem, parentRefs, basePath); resolver.shouldStopOnError(err) {
- return err
- }
-
- if pathItem.Ref.String() != "" {
- transitiveResolver := resolver.transitiveResolver(basePath, pathItem.Ref)
- basePath = transitiveResolver.updateBasePath(resolver, basePath)
- resolver = transitiveResolver
- }
-
- pathItem.Ref = Ref{}
- for i := range pathItem.Parameters {
- if err := expandParameterOrResponse(&(pathItem.Parameters[i]), resolver, basePath); resolver.shouldStopOnError(err) {
- return err
- }
- }
-
- ops := []*Operation{
- pathItem.Get,
- pathItem.Head,
- pathItem.Options,
- pathItem.Put,
- pathItem.Post,
- pathItem.Patch,
- pathItem.Delete,
- }
- for _, op := range ops {
- if err := expandOperation(op, resolver, basePath); resolver.shouldStopOnError(err) {
- return err
- }
- }
-
- return nil
-}
-
-func expandOperation(op *Operation, resolver *schemaLoader, basePath string) error {
- if op == nil {
- return nil
- }
-
- for i := range op.Parameters {
- param := op.Parameters[i]
- if err := expandParameterOrResponse(¶m, resolver, basePath); resolver.shouldStopOnError(err) {
- return err
- }
- op.Parameters[i] = param
- }
-
- if op.Responses == nil {
- return nil
- }
-
- responses := op.Responses
- if err := expandParameterOrResponse(responses.Default, resolver, basePath); resolver.shouldStopOnError(err) {
- return err
- }
-
- for code := range responses.StatusCodeResponses {
- response := responses.StatusCodeResponses[code]
- if err := expandParameterOrResponse(&response, resolver, basePath); resolver.shouldStopOnError(err) {
- return err
- }
- responses.StatusCodeResponses[code] = response
- }
-
- return nil
-}
-
-// ExpandResponseWithRoot expands a response based on a root document, not a fetchable document
-//
-// Notice that it is impossible to reference a json schema in a different document other than root
-// (use ExpandResponse to resolve external references).
-//
-// Setting the cache is optional and this parameter may safely be left to nil.
-func ExpandResponseWithRoot(response *Response, root interface{}, cache ResolutionCache) error {
- cache = cacheOrDefault(cache)
- opts := &ExpandOptions{
- RelativeBase: baseForRoot(root, cache),
- }
- resolver := defaultSchemaLoader(root, opts, cache, nil)
-
- return expandParameterOrResponse(response, resolver, opts.RelativeBase)
-}
-
-// ExpandResponse expands a response based on a basepath
-//
-// All refs inside response will be resolved relative to basePath
-func ExpandResponse(response *Response, basePath string) error {
- opts := optionsOrDefault(&ExpandOptions{
- RelativeBase: basePath,
- })
- resolver := defaultSchemaLoader(nil, opts, nil, nil)
-
- return expandParameterOrResponse(response, resolver, opts.RelativeBase)
-}
-
-// ExpandParameterWithRoot expands a parameter based on a root document, not a fetchable document.
-//
-// Notice that it is impossible to reference a json schema in a different document other than root
-// (use ExpandParameter to resolve external references).
-func ExpandParameterWithRoot(parameter *Parameter, root interface{}, cache ResolutionCache) error {
- cache = cacheOrDefault(cache)
-
- opts := &ExpandOptions{
- RelativeBase: baseForRoot(root, cache),
- }
- resolver := defaultSchemaLoader(root, opts, cache, nil)
-
- return expandParameterOrResponse(parameter, resolver, opts.RelativeBase)
-}
-
-// ExpandParameter expands a parameter based on a basepath.
-// This is the exported version of expandParameter
-// all refs inside parameter will be resolved relative to basePath
-func ExpandParameter(parameter *Parameter, basePath string) error {
- opts := optionsOrDefault(&ExpandOptions{
- RelativeBase: basePath,
- })
- resolver := defaultSchemaLoader(nil, opts, nil, nil)
-
- return expandParameterOrResponse(parameter, resolver, opts.RelativeBase)
-}
-
-func getRefAndSchema(input interface{}) (*Ref, *Schema, error) {
- var (
- ref *Ref
- sch *Schema
- )
-
- switch refable := input.(type) {
- case *Parameter:
- if refable == nil {
- return nil, nil, nil
- }
- ref = &refable.Ref
- sch = refable.Schema
- case *Response:
- if refable == nil {
- return nil, nil, nil
- }
- ref = &refable.Ref
- sch = refable.Schema
- default:
- return nil, nil, fmt.Errorf("unsupported type: %T: %w", input, ErrExpandUnsupportedType)
- }
-
- return ref, sch, nil
-}
-
-func expandParameterOrResponse(input interface{}, resolver *schemaLoader, basePath string) error {
- ref, sch, err := getRefAndSchema(input)
- if err != nil {
- return err
- }
-
- if ref == nil && sch == nil { // nothing to do
- return nil
- }
-
- parentRefs := make([]string, 0, 10)
- if ref != nil {
- // dereference this $ref
- if err = resolver.deref(input, parentRefs, basePath); resolver.shouldStopOnError(err) {
- return err
- }
-
- ref, sch, _ = getRefAndSchema(input)
- }
-
- if ref.String() != "" {
- transitiveResolver := resolver.transitiveResolver(basePath, *ref)
- basePath = resolver.updateBasePath(transitiveResolver, basePath)
- resolver = transitiveResolver
- }
-
- if sch == nil {
- // nothing to be expanded
- if ref != nil {
- *ref = Ref{}
- }
-
- return nil
- }
-
- if sch.Ref.String() != "" {
- rebasedRef, ern := NewRef(normalizeURI(sch.Ref.String(), basePath))
- if ern != nil {
- return ern
- }
-
- if resolver.isCircular(&rebasedRef, basePath, parentRefs...) {
- // this is a circular $ref: stop expansion
- if !resolver.options.AbsoluteCircularRef {
- sch.Ref = denormalizeRef(&rebasedRef, resolver.context.basePath, resolver.context.rootID)
- } else {
- sch.Ref = rebasedRef
- }
- }
- }
-
- // $ref expansion or rebasing is performed by expandSchema below
- if ref != nil {
- *ref = Ref{}
- }
-
- // expand schema
- // yes, we do it even if options.SkipSchema is true: we have to go down that rabbit hole and rebase nested $ref)
- s, err := expandSchema(*sch, parentRefs, resolver, basePath)
- if resolver.shouldStopOnError(err) {
- return err
- }
-
- if s != nil { // guard for when continuing on error
- *sch = *s
- }
-
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/external_docs.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/external_docs.go
deleted file mode 100644
index 88add91b2..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/external_docs.go
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package spec
-
-// ExternalDocumentation allows referencing an external resource for
-// extended documentation.
-//
-// For more information: http://goo.gl/8us55a#externalDocumentationObject
-type ExternalDocumentation struct {
- Description string `json:"description,omitempty"`
- URL string `json:"url,omitempty"`
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/header.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/header.go
deleted file mode 100644
index 9dfd17b18..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/header.go
+++ /dev/null
@@ -1,203 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package spec
-
-import (
- "encoding/json"
- "strings"
-
- "github.com/go-openapi/jsonpointer"
- "github.com/go-openapi/swag"
-)
-
-const (
- jsonArray = "array"
-)
-
-// HeaderProps describes a response header
-type HeaderProps struct {
- Description string `json:"description,omitempty"`
-}
-
-// Header describes a header for a response of the API
-//
-// For more information: http://goo.gl/8us55a#headerObject
-type Header struct {
- CommonValidations
- SimpleSchema
- VendorExtensible
- HeaderProps
-}
-
-// ResponseHeader creates a new header instance for use in a response
-func ResponseHeader() *Header {
- return new(Header)
-}
-
-// WithDescription sets the description on this response, allows for chaining
-func (h *Header) WithDescription(description string) *Header {
- h.Description = description
- return h
-}
-
-// Typed a fluent builder method for the type of parameter
-func (h *Header) Typed(tpe, format string) *Header {
- h.Type = tpe
- h.Format = format
- return h
-}
-
-// CollectionOf a fluent builder method for an array item
-func (h *Header) CollectionOf(items *Items, format string) *Header {
- h.Type = jsonArray
- h.Items = items
- h.CollectionFormat = format
- return h
-}
-
-// WithDefault sets the default value on this item
-func (h *Header) WithDefault(defaultValue interface{}) *Header {
- h.Default = defaultValue
- return h
-}
-
-// WithMaxLength sets a max length value
-func (h *Header) WithMaxLength(max int64) *Header {
- h.MaxLength = &max
- return h
-}
-
-// WithMinLength sets a min length value
-func (h *Header) WithMinLength(min int64) *Header {
- h.MinLength = &min
- return h
-}
-
-// WithPattern sets a pattern value
-func (h *Header) WithPattern(pattern string) *Header {
- h.Pattern = pattern
- return h
-}
-
-// WithMultipleOf sets a multiple of value
-func (h *Header) WithMultipleOf(number float64) *Header {
- h.MultipleOf = &number
- return h
-}
-
-// WithMaximum sets a maximum number value
-func (h *Header) WithMaximum(max float64, exclusive bool) *Header {
- h.Maximum = &max
- h.ExclusiveMaximum = exclusive
- return h
-}
-
-// WithMinimum sets a minimum number value
-func (h *Header) WithMinimum(min float64, exclusive bool) *Header {
- h.Minimum = &min
- h.ExclusiveMinimum = exclusive
- return h
-}
-
-// WithEnum sets a the enum values (replace)
-func (h *Header) WithEnum(values ...interface{}) *Header {
- h.Enum = append([]interface{}{}, values...)
- return h
-}
-
-// WithMaxItems sets the max items
-func (h *Header) WithMaxItems(size int64) *Header {
- h.MaxItems = &size
- return h
-}
-
-// WithMinItems sets the min items
-func (h *Header) WithMinItems(size int64) *Header {
- h.MinItems = &size
- return h
-}
-
-// UniqueValues dictates that this array can only have unique items
-func (h *Header) UniqueValues() *Header {
- h.UniqueItems = true
- return h
-}
-
-// AllowDuplicates this array can have duplicates
-func (h *Header) AllowDuplicates() *Header {
- h.UniqueItems = false
- return h
-}
-
-// WithValidations is a fluent method to set header validations
-func (h *Header) WithValidations(val CommonValidations) *Header {
- h.SetValidations(SchemaValidations{CommonValidations: val})
- return h
-}
-
-// MarshalJSON marshal this to JSON
-func (h Header) MarshalJSON() ([]byte, error) {
- b1, err := json.Marshal(h.CommonValidations)
- if err != nil {
- return nil, err
- }
- b2, err := json.Marshal(h.SimpleSchema)
- if err != nil {
- return nil, err
- }
- b3, err := json.Marshal(h.HeaderProps)
- if err != nil {
- return nil, err
- }
- return swag.ConcatJSON(b1, b2, b3), nil
-}
-
-// UnmarshalJSON unmarshals this header from JSON
-func (h *Header) UnmarshalJSON(data []byte) error {
- if err := json.Unmarshal(data, &h.CommonValidations); err != nil {
- return err
- }
- if err := json.Unmarshal(data, &h.SimpleSchema); err != nil {
- return err
- }
- if err := json.Unmarshal(data, &h.VendorExtensible); err != nil {
- return err
- }
- return json.Unmarshal(data, &h.HeaderProps)
-}
-
-// JSONLookup look up a value by the json property name
-func (h Header) JSONLookup(token string) (interface{}, error) {
- if ex, ok := h.Extensions[token]; ok {
- return &ex, nil
- }
-
- r, _, err := jsonpointer.GetForToken(h.CommonValidations, token)
- if err != nil && !strings.HasPrefix(err.Error(), "object has no field") {
- return nil, err
- }
- if r != nil {
- return r, nil
- }
- r, _, err = jsonpointer.GetForToken(h.SimpleSchema, token)
- if err != nil && !strings.HasPrefix(err.Error(), "object has no field") {
- return nil, err
- }
- if r != nil {
- return r, nil
- }
- r, _, err = jsonpointer.GetForToken(h.HeaderProps, token)
- return r, err
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/info.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/info.go
deleted file mode 100644
index 582f0fd4c..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/info.go
+++ /dev/null
@@ -1,184 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package spec
-
-import (
- "encoding/json"
- "strconv"
- "strings"
-
- "github.com/go-openapi/jsonpointer"
- "github.com/go-openapi/swag"
-)
-
-// Extensions vendor specific extensions
-type Extensions map[string]interface{}
-
-// Add adds a value to these extensions
-func (e Extensions) Add(key string, value interface{}) {
- realKey := strings.ToLower(key)
- e[realKey] = value
-}
-
-// GetString gets a string value from the extensions
-func (e Extensions) GetString(key string) (string, bool) {
- if v, ok := e[strings.ToLower(key)]; ok {
- str, ok := v.(string)
- return str, ok
- }
- return "", false
-}
-
-// GetInt gets a int value from the extensions
-func (e Extensions) GetInt(key string) (int, bool) {
- realKey := strings.ToLower(key)
-
- if v, ok := e.GetString(realKey); ok {
- if r, err := strconv.Atoi(v); err == nil {
- return r, true
- }
- }
-
- if v, ok := e[realKey]; ok {
- if r, rOk := v.(float64); rOk {
- return int(r), true
- }
- }
- return -1, false
-}
-
-// GetBool gets a string value from the extensions
-func (e Extensions) GetBool(key string) (bool, bool) {
- if v, ok := e[strings.ToLower(key)]; ok {
- str, ok := v.(bool)
- return str, ok
- }
- return false, false
-}
-
-// GetStringSlice gets a string value from the extensions
-func (e Extensions) GetStringSlice(key string) ([]string, bool) {
- if v, ok := e[strings.ToLower(key)]; ok {
- arr, isSlice := v.([]interface{})
- if !isSlice {
- return nil, false
- }
- var strs []string
- for _, iface := range arr {
- str, isString := iface.(string)
- if !isString {
- return nil, false
- }
- strs = append(strs, str)
- }
- return strs, ok
- }
- return nil, false
-}
-
-// VendorExtensible composition block.
-type VendorExtensible struct {
- Extensions Extensions
-}
-
-// AddExtension adds an extension to this extensible object
-func (v *VendorExtensible) AddExtension(key string, value interface{}) {
- if value == nil {
- return
- }
- if v.Extensions == nil {
- v.Extensions = make(map[string]interface{})
- }
- v.Extensions.Add(key, value)
-}
-
-// MarshalJSON marshals the extensions to json
-func (v VendorExtensible) MarshalJSON() ([]byte, error) {
- toser := make(map[string]interface{})
- for k, v := range v.Extensions {
- lk := strings.ToLower(k)
- if strings.HasPrefix(lk, "x-") {
- toser[k] = v
- }
- }
- return json.Marshal(toser)
-}
-
-// UnmarshalJSON for this extensible object
-func (v *VendorExtensible) UnmarshalJSON(data []byte) error {
- var d map[string]interface{}
- if err := json.Unmarshal(data, &d); err != nil {
- return err
- }
- for k, vv := range d {
- lk := strings.ToLower(k)
- if strings.HasPrefix(lk, "x-") {
- if v.Extensions == nil {
- v.Extensions = map[string]interface{}{}
- }
- v.Extensions[k] = vv
- }
- }
- return nil
-}
-
-// InfoProps the properties for an info definition
-type InfoProps struct {
- Description string `json:"description,omitempty"`
- Title string `json:"title,omitempty"`
- TermsOfService string `json:"termsOfService,omitempty"`
- Contact *ContactInfo `json:"contact,omitempty"`
- License *License `json:"license,omitempty"`
- Version string `json:"version,omitempty"`
-}
-
-// Info object provides metadata about the API.
-// The metadata can be used by the clients if needed, and can be presented in the Swagger-UI for convenience.
-//
-// For more information: http://goo.gl/8us55a#infoObject
-type Info struct {
- VendorExtensible
- InfoProps
-}
-
-// JSONLookup look up a value by the json property name
-func (i Info) JSONLookup(token string) (interface{}, error) {
- if ex, ok := i.Extensions[token]; ok {
- return &ex, nil
- }
- r, _, err := jsonpointer.GetForToken(i.InfoProps, token)
- return r, err
-}
-
-// MarshalJSON marshal this to JSON
-func (i Info) MarshalJSON() ([]byte, error) {
- b1, err := json.Marshal(i.InfoProps)
- if err != nil {
- return nil, err
- }
- b2, err := json.Marshal(i.VendorExtensible)
- if err != nil {
- return nil, err
- }
- return swag.ConcatJSON(b1, b2), nil
-}
-
-// UnmarshalJSON marshal this from JSON
-func (i *Info) UnmarshalJSON(data []byte) error {
- if err := json.Unmarshal(data, &i.InfoProps); err != nil {
- return err
- }
- return json.Unmarshal(data, &i.VendorExtensible)
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/items.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/items.go
deleted file mode 100644
index e2afb2133..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/items.go
+++ /dev/null
@@ -1,234 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package spec
-
-import (
- "encoding/json"
- "strings"
-
- "github.com/go-openapi/jsonpointer"
- "github.com/go-openapi/swag"
-)
-
-const (
- jsonRef = "$ref"
-)
-
-// SimpleSchema describe swagger simple schemas for parameters and headers
-type SimpleSchema struct {
- Type string `json:"type,omitempty"`
- Nullable bool `json:"nullable,omitempty"`
- Format string `json:"format,omitempty"`
- Items *Items `json:"items,omitempty"`
- CollectionFormat string `json:"collectionFormat,omitempty"`
- Default interface{} `json:"default,omitempty"`
- Example interface{} `json:"example,omitempty"`
-}
-
-// TypeName return the type (or format) of a simple schema
-func (s *SimpleSchema) TypeName() string {
- if s.Format != "" {
- return s.Format
- }
- return s.Type
-}
-
-// ItemsTypeName yields the type of items in a simple schema array
-func (s *SimpleSchema) ItemsTypeName() string {
- if s.Items == nil {
- return ""
- }
- return s.Items.TypeName()
-}
-
-// Items a limited subset of JSON-Schema's items object.
-// It is used by parameter definitions that are not located in "body".
-//
-// For more information: http://goo.gl/8us55a#items-object
-type Items struct {
- Refable
- CommonValidations
- SimpleSchema
- VendorExtensible
-}
-
-// NewItems creates a new instance of items
-func NewItems() *Items {
- return &Items{}
-}
-
-// Typed a fluent builder method for the type of item
-func (i *Items) Typed(tpe, format string) *Items {
- i.Type = tpe
- i.Format = format
- return i
-}
-
-// AsNullable flags this schema as nullable.
-func (i *Items) AsNullable() *Items {
- i.Nullable = true
- return i
-}
-
-// CollectionOf a fluent builder method for an array item
-func (i *Items) CollectionOf(items *Items, format string) *Items {
- i.Type = jsonArray
- i.Items = items
- i.CollectionFormat = format
- return i
-}
-
-// WithDefault sets the default value on this item
-func (i *Items) WithDefault(defaultValue interface{}) *Items {
- i.Default = defaultValue
- return i
-}
-
-// WithMaxLength sets a max length value
-func (i *Items) WithMaxLength(max int64) *Items {
- i.MaxLength = &max
- return i
-}
-
-// WithMinLength sets a min length value
-func (i *Items) WithMinLength(min int64) *Items {
- i.MinLength = &min
- return i
-}
-
-// WithPattern sets a pattern value
-func (i *Items) WithPattern(pattern string) *Items {
- i.Pattern = pattern
- return i
-}
-
-// WithMultipleOf sets a multiple of value
-func (i *Items) WithMultipleOf(number float64) *Items {
- i.MultipleOf = &number
- return i
-}
-
-// WithMaximum sets a maximum number value
-func (i *Items) WithMaximum(max float64, exclusive bool) *Items {
- i.Maximum = &max
- i.ExclusiveMaximum = exclusive
- return i
-}
-
-// WithMinimum sets a minimum number value
-func (i *Items) WithMinimum(min float64, exclusive bool) *Items {
- i.Minimum = &min
- i.ExclusiveMinimum = exclusive
- return i
-}
-
-// WithEnum sets a the enum values (replace)
-func (i *Items) WithEnum(values ...interface{}) *Items {
- i.Enum = append([]interface{}{}, values...)
- return i
-}
-
-// WithMaxItems sets the max items
-func (i *Items) WithMaxItems(size int64) *Items {
- i.MaxItems = &size
- return i
-}
-
-// WithMinItems sets the min items
-func (i *Items) WithMinItems(size int64) *Items {
- i.MinItems = &size
- return i
-}
-
-// UniqueValues dictates that this array can only have unique items
-func (i *Items) UniqueValues() *Items {
- i.UniqueItems = true
- return i
-}
-
-// AllowDuplicates this array can have duplicates
-func (i *Items) AllowDuplicates() *Items {
- i.UniqueItems = false
- return i
-}
-
-// WithValidations is a fluent method to set Items validations
-func (i *Items) WithValidations(val CommonValidations) *Items {
- i.SetValidations(SchemaValidations{CommonValidations: val})
- return i
-}
-
-// UnmarshalJSON hydrates this items instance with the data from JSON
-func (i *Items) UnmarshalJSON(data []byte) error {
- var validations CommonValidations
- if err := json.Unmarshal(data, &validations); err != nil {
- return err
- }
- var ref Refable
- if err := json.Unmarshal(data, &ref); err != nil {
- return err
- }
- var simpleSchema SimpleSchema
- if err := json.Unmarshal(data, &simpleSchema); err != nil {
- return err
- }
- var vendorExtensible VendorExtensible
- if err := json.Unmarshal(data, &vendorExtensible); err != nil {
- return err
- }
- i.Refable = ref
- i.CommonValidations = validations
- i.SimpleSchema = simpleSchema
- i.VendorExtensible = vendorExtensible
- return nil
-}
-
-// MarshalJSON converts this items object to JSON
-func (i Items) MarshalJSON() ([]byte, error) {
- b1, err := json.Marshal(i.CommonValidations)
- if err != nil {
- return nil, err
- }
- b2, err := json.Marshal(i.SimpleSchema)
- if err != nil {
- return nil, err
- }
- b3, err := json.Marshal(i.Refable)
- if err != nil {
- return nil, err
- }
- b4, err := json.Marshal(i.VendorExtensible)
- if err != nil {
- return nil, err
- }
- return swag.ConcatJSON(b4, b3, b1, b2), nil
-}
-
-// JSONLookup look up a value by the json property name
-func (i Items) JSONLookup(token string) (interface{}, error) {
- if token == jsonRef {
- return &i.Ref, nil
- }
-
- r, _, err := jsonpointer.GetForToken(i.CommonValidations, token)
- if err != nil && !strings.HasPrefix(err.Error(), "object has no field") {
- return nil, err
- }
- if r != nil {
- return r, nil
- }
- r, _, err = jsonpointer.GetForToken(i.SimpleSchema, token)
- return r, err
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/license.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/license.go
deleted file mode 100644
index b42f80368..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/license.go
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package spec
-
-import (
- "encoding/json"
-
- "github.com/go-openapi/swag"
-)
-
-// License information for the exposed API.
-//
-// For more information: http://goo.gl/8us55a#licenseObject
-type License struct {
- LicenseProps
- VendorExtensible
-}
-
-// LicenseProps holds the properties of a License object
-type LicenseProps struct {
- Name string `json:"name,omitempty"`
- URL string `json:"url,omitempty"`
-}
-
-// UnmarshalJSON hydrates License from json
-func (l *License) UnmarshalJSON(data []byte) error {
- if err := json.Unmarshal(data, &l.LicenseProps); err != nil {
- return err
- }
- return json.Unmarshal(data, &l.VendorExtensible)
-}
-
-// MarshalJSON produces License as json
-func (l License) MarshalJSON() ([]byte, error) {
- b1, err := json.Marshal(l.LicenseProps)
- if err != nil {
- return nil, err
- }
- b2, err := json.Marshal(l.VendorExtensible)
- if err != nil {
- return nil, err
- }
- return swag.ConcatJSON(b1, b2), nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/normalizer.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/normalizer.go
deleted file mode 100644
index e8b600994..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/normalizer.go
+++ /dev/null
@@ -1,202 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package spec
-
-import (
- "net/url"
- "path"
- "strings"
-)
-
-const fileScheme = "file"
-
-// normalizeURI ensures that all $ref paths used internally by the expander are canonicalized.
-//
-// NOTE(windows): there is a tolerance over the strict URI format on windows.
-//
-// The normalizer accepts relative file URLs like 'Path\File.JSON' as well as absolute file URLs like
-// 'C:\Path\file.Yaml'.
-//
-// Both are canonicalized with a "file://" scheme, slashes and a lower-cased path:
-// 'file:///c:/path/file.yaml'
-//
-// URLs can be specified with a file scheme, like in 'file:///folder/file.json' or
-// 'file:///c:\folder\File.json'.
-//
-// URLs like file://C:\folder are considered invalid (i.e. there is no host 'c:\folder') and a "repair"
-// is attempted.
-//
-// The base path argument is assumed to be canonicalized (e.g. using normalizeBase()).
-func normalizeURI(refPath, base string) string {
- refURL, err := parseURL(refPath)
- if err != nil {
- specLogger.Printf("warning: invalid URI in $ref %q: %v", refPath, err)
- refURL, refPath = repairURI(refPath)
- }
-
- fixWindowsURI(refURL, refPath) // noop on non-windows OS
-
- refURL.Path = path.Clean(refURL.Path)
- if refURL.Path == "." {
- refURL.Path = ""
- }
-
- r := MustCreateRef(refURL.String())
- if r.IsCanonical() {
- return refURL.String()
- }
-
- baseURL, _ := parseURL(base)
- if path.IsAbs(refURL.Path) {
- baseURL.Path = refURL.Path
- } else if refURL.Path != "" {
- baseURL.Path = path.Join(path.Dir(baseURL.Path), refURL.Path)
- }
- // copying fragment from ref to base
- baseURL.Fragment = refURL.Fragment
-
- return baseURL.String()
-}
-
-// denormalizeRef returns the simplest notation for a normalized $ref, given the path of the original root document.
-//
-// When calling this, we assume that:
-// * $ref is a canonical URI
-// * originalRelativeBase is a canonical URI
-//
-// denormalizeRef is currently used when we rewrite a $ref after a circular $ref has been detected.
-// In this case, expansion stops and normally renders the internal canonical $ref.
-//
-// This internal $ref is eventually rebased to the original RelativeBase used for the expansion.
-//
-// There is a special case for schemas that are anchored with an "id":
-// in that case, the rebasing is performed // against the id only if this is an anchor for the initial root document.
-// All other intermediate "id"'s found along the way are ignored for the purpose of rebasing.
-func denormalizeRef(ref *Ref, originalRelativeBase, id string) Ref {
- debugLog("denormalizeRef called:\n$ref: %q\noriginal: %s\nroot ID:%s", ref.String(), originalRelativeBase, id)
-
- if ref.String() == "" || ref.IsRoot() || ref.HasFragmentOnly {
- // short circuit: $ref to current doc
- return *ref
- }
-
- if id != "" {
- idBaseURL, err := parseURL(id)
- if err == nil { // if the schema id is not usable as a URI, ignore it
- if ref, ok := rebase(ref, idBaseURL, true); ok { // rebase, but keep references to root unchaged (do not want $ref: "")
- // $ref relative to the ID of the schema in the root document
- return ref
- }
- }
- }
-
- originalRelativeBaseURL, _ := parseURL(originalRelativeBase)
-
- r, _ := rebase(ref, originalRelativeBaseURL, false)
-
- return r
-}
-
-func rebase(ref *Ref, v *url.URL, notEqual bool) (Ref, bool) {
- var newBase url.URL
-
- u := ref.GetURL()
-
- if u.Scheme != v.Scheme || u.Host != v.Host {
- return *ref, false
- }
-
- docPath := v.Path
- v.Path = path.Dir(v.Path)
-
- if v.Path == "." {
- v.Path = ""
- } else if !strings.HasSuffix(v.Path, "/") {
- v.Path += "/"
- }
-
- newBase.Fragment = u.Fragment
-
- if strings.HasPrefix(u.Path, docPath) {
- newBase.Path = strings.TrimPrefix(u.Path, docPath)
- } else {
- newBase.Path = strings.TrimPrefix(u.Path, v.Path)
- }
-
- if notEqual && newBase.Path == "" && newBase.Fragment == "" {
- // do not want rebasing to end up in an empty $ref
- return *ref, false
- }
-
- if path.IsAbs(newBase.Path) {
- // whenever we end up with an absolute path, specify the scheme and host
- newBase.Scheme = v.Scheme
- newBase.Host = v.Host
- }
-
- return MustCreateRef(newBase.String()), true
-}
-
-// normalizeRef canonicalize a Ref, using a canonical relativeBase as its absolute anchor
-func normalizeRef(ref *Ref, relativeBase string) *Ref {
- r := MustCreateRef(normalizeURI(ref.String(), relativeBase))
- return &r
-}
-
-// normalizeBase performs a normalization of the input base path.
-//
-// This always yields a canonical URI (absolute), usable for the document cache.
-//
-// It ensures that all further internal work on basePath may safely assume
-// a non-empty, cross-platform, canonical URI (i.e. absolute).
-//
-// This normalization tolerates windows paths (e.g. C:\x\y\File.dat) and transform this
-// in a file:// URL with lower cased drive letter and path.
-//
-// See also: https://en.wikipedia.org/wiki/File_URI_scheme
-func normalizeBase(in string) string {
- u, err := parseURL(in)
- if err != nil {
- specLogger.Printf("warning: invalid URI in RelativeBase %q: %v", in, err)
- u, in = repairURI(in)
- }
-
- u.Fragment = "" // any fragment in the base is irrelevant
-
- fixWindowsURI(u, in) // noop on non-windows OS
-
- u.Path = path.Clean(u.Path)
- if u.Path == "." { // empty after Clean()
- u.Path = ""
- }
-
- if u.Scheme != "" {
- if path.IsAbs(u.Path) || u.Scheme != fileScheme {
- // this is absolute or explicitly not a local file: we're good
- return u.String()
- }
- }
-
- // no scheme or file scheme with relative path: assume file and make it absolute
- // enforce scheme file://... with absolute path.
- //
- // If the input path is relative, we anchor the path to the current working directory.
- // NOTE: we may end up with a host component. Leave it unchanged: e.g. file://host/folder/file.json
-
- u.Scheme = fileScheme
- u.Path = absPath(u.Path) // platform-dependent
- u.RawQuery = "" // any query component is irrelevant for a base
- return u.String()
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/normalizer_nonwindows.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/normalizer_nonwindows.go
deleted file mode 100644
index f19f1a8fb..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/normalizer_nonwindows.go
+++ /dev/null
@@ -1,44 +0,0 @@
-//go:build !windows
-// +build !windows
-
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package spec
-
-import (
- "net/url"
- "path/filepath"
-)
-
-// absPath makes a file path absolute and compatible with a URI path component.
-//
-// The parameter must be a path, not an URI.
-func absPath(in string) string {
- anchored, err := filepath.Abs(in)
- if err != nil {
- specLogger.Printf("warning: could not resolve current working directory: %v", err)
- return in
- }
- return anchored
-}
-
-func repairURI(in string) (*url.URL, string) {
- u, _ := parseURL("")
- debugLog("repaired URI: original: %q, repaired: %q", in, "")
- return u, ""
-}
-
-func fixWindowsURI(_ *url.URL, _ string) {
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/normalizer_windows.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/normalizer_windows.go
deleted file mode 100644
index a66c532db..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/normalizer_windows.go
+++ /dev/null
@@ -1,154 +0,0 @@
-// -build windows
-
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package spec
-
-import (
- "net/url"
- "os"
- "path"
- "path/filepath"
- "strings"
-)
-
-// absPath makes a file path absolute and compatible with a URI path component
-//
-// The parameter must be a path, not an URI.
-func absPath(in string) string {
- // NOTE(windows): filepath.Abs exhibits a special behavior on windows for empty paths.
- // See https://github.com/golang/go/issues/24441
- if in == "" {
- in = "."
- }
-
- anchored, err := filepath.Abs(in)
- if err != nil {
- specLogger.Printf("warning: could not resolve current working directory: %v", err)
- return in
- }
-
- pth := strings.ReplaceAll(strings.ToLower(anchored), `\`, `/`)
- if !strings.HasPrefix(pth, "/") {
- pth = "/" + pth
- }
-
- return path.Clean(pth)
-}
-
-// repairURI tolerates invalid file URIs with common typos
-// such as 'file://E:\folder\file', that break the regular URL parser.
-//
-// Adopting the same defaults as for unixes (e.g. return an empty path) would
-// result into a counter-intuitive result for that case (e.g. E:\folder\file is
-// eventually resolved as the current directory). The repair will detect the missing "/".
-//
-// Note that this only works for the file scheme.
-func repairURI(in string) (*url.URL, string) {
- const prefix = fileScheme + "://"
- if !strings.HasPrefix(in, prefix) {
- // giving up: resolve to empty path
- u, _ := parseURL("")
-
- return u, ""
- }
-
- // attempt the repair, stripping the scheme should be sufficient
- u, _ := parseURL(strings.TrimPrefix(in, prefix))
- debugLog("repaired URI: original: %q, repaired: %q", in, u.String())
-
- return u, u.String()
-}
-
-// fixWindowsURI tolerates an absolute file path on windows such as C:\Base\File.yaml or \\host\share\Base\File.yaml
-// and makes it a canonical URI: file:///c:/base/file.yaml
-//
-// Catch 22 notes for Windows:
-//
-// * There may be a drive letter on windows (it is lower-cased)
-// * There may be a share UNC, e.g. \\server\folder\data.xml
-// * Paths are case insensitive
-// * Paths may already contain slashes
-// * Paths must be slashed
-//
-// NOTE: there is no escaping. "/" may be valid separators just like "\".
-// We don't use ToSlash() (which escapes everything) because windows now also
-// tolerates the use of "/". Hence, both C:\File.yaml and C:/File.yaml will work.
-func fixWindowsURI(u *url.URL, in string) {
- drive := filepath.VolumeName(in)
-
- if len(drive) > 0 {
- if len(u.Scheme) == 1 && strings.EqualFold(u.Scheme, drive[:1]) { // a path with a drive letter
- u.Scheme = fileScheme
- u.Host = ""
- u.Path = strings.Join([]string{drive, u.Opaque, u.Path}, `/`) // reconstruct the full path component (no fragment, no query)
- } else if u.Host == "" && strings.HasPrefix(u.Path, drive) { // a path with a \\host volume
- // NOTE: the special host@port syntax for UNC is not supported (yet)
- u.Scheme = fileScheme
-
- // this is a modified version of filepath.Dir() to apply on the VolumeName itself
- i := len(drive) - 1
- for i >= 0 && !os.IsPathSeparator(drive[i]) {
- i--
- }
- host := drive[:i] // \\host\share => host
-
- u.Path = strings.TrimPrefix(u.Path, host)
- u.Host = strings.TrimPrefix(host, `\\`)
- }
-
- u.Opaque = ""
- u.Path = strings.ReplaceAll(strings.ToLower(u.Path), `\`, `/`)
-
- // ensure we form an absolute path
- if !strings.HasPrefix(u.Path, "/") {
- u.Path = "/" + u.Path
- }
-
- u.Path = path.Clean(u.Path)
-
- return
- }
-
- if u.Scheme == fileScheme {
- // Handle dodgy cases for file://{...} URIs on windows.
- // A canonical URI should always be followed by an absolute path.
- //
- // Examples:
- // * file:///folder/file => valid, unchanged
- // * file:///c:\folder\file => slashed
- // * file:///./folder/file => valid, cleaned to remove the dot
- // * file:///.\folder\file => remapped to cwd
- // * file:///. => dodgy, remapped to / (consistent with the behavior on unix)
- // * file:///.. => dodgy, remapped to / (consistent with the behavior on unix)
- if (!path.IsAbs(u.Path) && !filepath.IsAbs(u.Path)) || (strings.HasPrefix(u.Path, `/.`) && strings.Contains(u.Path, `\`)) {
- // ensure we form an absolute path
- u.Path, _ = filepath.Abs(strings.TrimLeft(u.Path, `/`))
- if !strings.HasPrefix(u.Path, "/") {
- u.Path = "/" + u.Path
- }
- }
- u.Path = strings.ToLower(u.Path)
- }
-
- // NOTE: lower case normalization does not propagate to inner resources,
- // generated when rebasing: when joining a relative URI with a file to an absolute base,
- // only the base is currently lower-cased.
- //
- // For now, we assume this is good enough for most use cases
- // and try not to generate too many differences
- // between the output produced on different platforms.
- u.Path = path.Clean(strings.ReplaceAll(u.Path, `\`, `/`))
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/operation.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/operation.go
deleted file mode 100644
index a69cca881..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/operation.go
+++ /dev/null
@@ -1,400 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package spec
-
-import (
- "bytes"
- "encoding/gob"
- "encoding/json"
- "sort"
-
- "github.com/go-openapi/jsonpointer"
- "github.com/go-openapi/swag"
-)
-
-func init() {
- gob.Register(map[string]interface{}{})
- gob.Register([]interface{}{})
-}
-
-// OperationProps describes an operation
-//
-// NOTES:
-// - schemes, when present must be from [http, https, ws, wss]: see validate
-// - Security is handled as a special case: see MarshalJSON function
-type OperationProps struct {
- Description string `json:"description,omitempty"`
- Consumes []string `json:"consumes,omitempty"`
- Produces []string `json:"produces,omitempty"`
- Schemes []string `json:"schemes,omitempty"`
- Tags []string `json:"tags,omitempty"`
- Summary string `json:"summary,omitempty"`
- ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"`
- ID string `json:"operationId,omitempty"`
- Deprecated bool `json:"deprecated,omitempty"`
- Security []map[string][]string `json:"security,omitempty"`
- Parameters []Parameter `json:"parameters,omitempty"`
- Responses *Responses `json:"responses,omitempty"`
-}
-
-// MarshalJSON takes care of serializing operation properties to JSON
-//
-// We use a custom marhaller here to handle a special cases related to
-// the Security field. We need to preserve zero length slice
-// while omitting the field when the value is nil/unset.
-func (op OperationProps) MarshalJSON() ([]byte, error) {
- type Alias OperationProps
- if op.Security == nil {
- return json.Marshal(&struct {
- Security []map[string][]string `json:"security,omitempty"`
- *Alias
- }{
- Security: op.Security,
- Alias: (*Alias)(&op),
- })
- }
- return json.Marshal(&struct {
- Security []map[string][]string `json:"security"`
- *Alias
- }{
- Security: op.Security,
- Alias: (*Alias)(&op),
- })
-}
-
-// Operation describes a single API operation on a path.
-//
-// For more information: http://goo.gl/8us55a#operationObject
-type Operation struct {
- VendorExtensible
- OperationProps
-}
-
-// SuccessResponse gets a success response model
-func (o *Operation) SuccessResponse() (*Response, int, bool) {
- if o.Responses == nil {
- return nil, 0, false
- }
-
- responseCodes := make([]int, 0, len(o.Responses.StatusCodeResponses))
- for k := range o.Responses.StatusCodeResponses {
- if k >= 200 && k < 300 {
- responseCodes = append(responseCodes, k)
- }
- }
- if len(responseCodes) > 0 {
- sort.Ints(responseCodes)
- v := o.Responses.StatusCodeResponses[responseCodes[0]]
- return &v, responseCodes[0], true
- }
-
- return o.Responses.Default, 0, false
-}
-
-// JSONLookup look up a value by the json property name
-func (o Operation) JSONLookup(token string) (interface{}, error) {
- if ex, ok := o.Extensions[token]; ok {
- return &ex, nil
- }
- r, _, err := jsonpointer.GetForToken(o.OperationProps, token)
- return r, err
-}
-
-// UnmarshalJSON hydrates this items instance with the data from JSON
-func (o *Operation) UnmarshalJSON(data []byte) error {
- if err := json.Unmarshal(data, &o.OperationProps); err != nil {
- return err
- }
- return json.Unmarshal(data, &o.VendorExtensible)
-}
-
-// MarshalJSON converts this items object to JSON
-func (o Operation) MarshalJSON() ([]byte, error) {
- b1, err := json.Marshal(o.OperationProps)
- if err != nil {
- return nil, err
- }
- b2, err := json.Marshal(o.VendorExtensible)
- if err != nil {
- return nil, err
- }
- concated := swag.ConcatJSON(b1, b2)
- return concated, nil
-}
-
-// NewOperation creates a new operation instance.
-// It expects an ID as parameter but not passing an ID is also valid.
-func NewOperation(id string) *Operation {
- op := new(Operation)
- op.ID = id
- return op
-}
-
-// WithID sets the ID property on this operation, allows for chaining.
-func (o *Operation) WithID(id string) *Operation {
- o.ID = id
- return o
-}
-
-// WithDescription sets the description on this operation, allows for chaining
-func (o *Operation) WithDescription(description string) *Operation {
- o.Description = description
- return o
-}
-
-// WithSummary sets the summary on this operation, allows for chaining
-func (o *Operation) WithSummary(summary string) *Operation {
- o.Summary = summary
- return o
-}
-
-// WithExternalDocs sets/removes the external docs for/from this operation.
-// When you pass empty strings as params the external documents will be removed.
-// When you pass non-empty string as one value then those values will be used on the external docs object.
-// So when you pass a non-empty description, you should also pass the url and vice versa.
-func (o *Operation) WithExternalDocs(description, url string) *Operation {
- if description == "" && url == "" {
- o.ExternalDocs = nil
- return o
- }
-
- if o.ExternalDocs == nil {
- o.ExternalDocs = &ExternalDocumentation{}
- }
- o.ExternalDocs.Description = description
- o.ExternalDocs.URL = url
- return o
-}
-
-// Deprecate marks the operation as deprecated
-func (o *Operation) Deprecate() *Operation {
- o.Deprecated = true
- return o
-}
-
-// Undeprecate marks the operation as not deprected
-func (o *Operation) Undeprecate() *Operation {
- o.Deprecated = false
- return o
-}
-
-// WithConsumes adds media types for incoming body values
-func (o *Operation) WithConsumes(mediaTypes ...string) *Operation {
- o.Consumes = append(o.Consumes, mediaTypes...)
- return o
-}
-
-// WithProduces adds media types for outgoing body values
-func (o *Operation) WithProduces(mediaTypes ...string) *Operation {
- o.Produces = append(o.Produces, mediaTypes...)
- return o
-}
-
-// WithTags adds tags for this operation
-func (o *Operation) WithTags(tags ...string) *Operation {
- o.Tags = append(o.Tags, tags...)
- return o
-}
-
-// AddParam adds a parameter to this operation, when a parameter for that location
-// and with that name already exists it will be replaced
-func (o *Operation) AddParam(param *Parameter) *Operation {
- if param == nil {
- return o
- }
-
- for i, p := range o.Parameters {
- if p.Name == param.Name && p.In == param.In {
- params := make([]Parameter, 0, len(o.Parameters)+1)
- params = append(params, o.Parameters[:i]...)
- params = append(params, *param)
- params = append(params, o.Parameters[i+1:]...)
- o.Parameters = params
-
- return o
- }
- }
-
- o.Parameters = append(o.Parameters, *param)
- return o
-}
-
-// RemoveParam removes a parameter from the operation
-func (o *Operation) RemoveParam(name, in string) *Operation {
- for i, p := range o.Parameters {
- if p.Name == name && p.In == in {
- o.Parameters = append(o.Parameters[:i], o.Parameters[i+1:]...)
- return o
- }
- }
- return o
-}
-
-// SecuredWith adds a security scope to this operation.
-func (o *Operation) SecuredWith(name string, scopes ...string) *Operation {
- o.Security = append(o.Security, map[string][]string{name: scopes})
- return o
-}
-
-// WithDefaultResponse adds a default response to the operation.
-// Passing a nil value will remove the response
-func (o *Operation) WithDefaultResponse(response *Response) *Operation {
- return o.RespondsWith(0, response)
-}
-
-// RespondsWith adds a status code response to the operation.
-// When the code is 0 the value of the response will be used as default response value.
-// When the value of the response is nil it will be removed from the operation
-func (o *Operation) RespondsWith(code int, response *Response) *Operation {
- if o.Responses == nil {
- o.Responses = new(Responses)
- }
- if code == 0 {
- o.Responses.Default = response
- return o
- }
- if response == nil {
- delete(o.Responses.StatusCodeResponses, code)
- return o
- }
- if o.Responses.StatusCodeResponses == nil {
- o.Responses.StatusCodeResponses = make(map[int]Response)
- }
- o.Responses.StatusCodeResponses[code] = *response
- return o
-}
-
-type opsAlias OperationProps
-
-type gobAlias struct {
- Security []map[string]struct {
- List []string
- Pad bool
- }
- Alias *opsAlias
- SecurityIsEmpty bool
-}
-
-// GobEncode provides a safe gob encoder for Operation, including empty security requirements
-func (o Operation) GobEncode() ([]byte, error) {
- raw := struct {
- Ext VendorExtensible
- Props OperationProps
- }{
- Ext: o.VendorExtensible,
- Props: o.OperationProps,
- }
- var b bytes.Buffer
- err := gob.NewEncoder(&b).Encode(raw)
- return b.Bytes(), err
-}
-
-// GobDecode provides a safe gob decoder for Operation, including empty security requirements
-func (o *Operation) GobDecode(b []byte) error {
- var raw struct {
- Ext VendorExtensible
- Props OperationProps
- }
-
- buf := bytes.NewBuffer(b)
- err := gob.NewDecoder(buf).Decode(&raw)
- if err != nil {
- return err
- }
- o.VendorExtensible = raw.Ext
- o.OperationProps = raw.Props
- return nil
-}
-
-// GobEncode provides a safe gob encoder for Operation, including empty security requirements
-func (op OperationProps) GobEncode() ([]byte, error) {
- raw := gobAlias{
- Alias: (*opsAlias)(&op),
- }
-
- var b bytes.Buffer
- if op.Security == nil {
- // nil security requirement
- err := gob.NewEncoder(&b).Encode(raw)
- return b.Bytes(), err
- }
-
- if len(op.Security) == 0 {
- // empty, but non-nil security requirement
- raw.SecurityIsEmpty = true
- raw.Alias.Security = nil
- err := gob.NewEncoder(&b).Encode(raw)
- return b.Bytes(), err
- }
-
- raw.Security = make([]map[string]struct {
- List []string
- Pad bool
- }, 0, len(op.Security))
- for _, req := range op.Security {
- v := make(map[string]struct {
- List []string
- Pad bool
- }, len(req))
- for k, val := range req {
- v[k] = struct {
- List []string
- Pad bool
- }{
- List: val,
- }
- }
- raw.Security = append(raw.Security, v)
- }
-
- err := gob.NewEncoder(&b).Encode(raw)
- return b.Bytes(), err
-}
-
-// GobDecode provides a safe gob decoder for Operation, including empty security requirements
-func (op *OperationProps) GobDecode(b []byte) error {
- var raw gobAlias
-
- buf := bytes.NewBuffer(b)
- err := gob.NewDecoder(buf).Decode(&raw)
- if err != nil {
- return err
- }
- if raw.Alias == nil {
- return nil
- }
-
- switch {
- case raw.SecurityIsEmpty:
- // empty, but non-nil security requirement
- raw.Alias.Security = []map[string][]string{}
- case len(raw.Alias.Security) == 0:
- // nil security requirement
- raw.Alias.Security = nil
- default:
- raw.Alias.Security = make([]map[string][]string, 0, len(raw.Security))
- for _, req := range raw.Security {
- v := make(map[string][]string, len(req))
- for k, val := range req {
- v[k] = make([]string, 0, len(val.List))
- v[k] = append(v[k], val.List...)
- }
- raw.Alias.Security = append(raw.Alias.Security, v)
- }
- }
-
- *op = *(*OperationProps)(raw.Alias)
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/parameter.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/parameter.go
deleted file mode 100644
index bd4f1cdb0..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/parameter.go
+++ /dev/null
@@ -1,326 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package spec
-
-import (
- "encoding/json"
- "strings"
-
- "github.com/go-openapi/jsonpointer"
- "github.com/go-openapi/swag"
-)
-
-// QueryParam creates a query parameter
-func QueryParam(name string) *Parameter {
- return &Parameter{ParamProps: ParamProps{Name: name, In: "query"}}
-}
-
-// HeaderParam creates a header parameter, this is always required by default
-func HeaderParam(name string) *Parameter {
- return &Parameter{ParamProps: ParamProps{Name: name, In: "header", Required: true}}
-}
-
-// PathParam creates a path parameter, this is always required
-func PathParam(name string) *Parameter {
- return &Parameter{ParamProps: ParamProps{Name: name, In: "path", Required: true}}
-}
-
-// BodyParam creates a body parameter
-func BodyParam(name string, schema *Schema) *Parameter {
- return &Parameter{ParamProps: ParamProps{Name: name, In: "body", Schema: schema}}
-}
-
-// FormDataParam creates a body parameter
-func FormDataParam(name string) *Parameter {
- return &Parameter{ParamProps: ParamProps{Name: name, In: "formData"}}
-}
-
-// FileParam creates a body parameter
-func FileParam(name string) *Parameter {
- return &Parameter{ParamProps: ParamProps{Name: name, In: "formData"},
- SimpleSchema: SimpleSchema{Type: "file"}}
-}
-
-// SimpleArrayParam creates a param for a simple array (string, int, date etc)
-func SimpleArrayParam(name, tpe, fmt string) *Parameter {
- return &Parameter{ParamProps: ParamProps{Name: name},
- SimpleSchema: SimpleSchema{Type: jsonArray, CollectionFormat: "csv",
- Items: &Items{SimpleSchema: SimpleSchema{Type: tpe, Format: fmt}}}}
-}
-
-// ParamRef creates a parameter that's a json reference
-func ParamRef(uri string) *Parameter {
- p := new(Parameter)
- p.Ref = MustCreateRef(uri)
- return p
-}
-
-// ParamProps describes the specific attributes of an operation parameter
-//
-// NOTE:
-// - Schema is defined when "in" == "body": see validate
-// - AllowEmptyValue is allowed where "in" == "query" || "formData"
-type ParamProps struct {
- Description string `json:"description,omitempty"`
- Name string `json:"name,omitempty"`
- In string `json:"in,omitempty"`
- Required bool `json:"required,omitempty"`
- Schema *Schema `json:"schema,omitempty"`
- AllowEmptyValue bool `json:"allowEmptyValue,omitempty"`
-}
-
-// Parameter a unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn).
-//
-// There are five possible parameter types.
-// - Path - Used together with [Path Templating](#pathTemplating), where the parameter value is actually part
-// of the operation's URL. This does not include the host or base path of the API. For example, in `/items/{itemId}`,
-// the path parameter is `itemId`.
-// - Query - Parameters that are appended to the URL. For example, in `/items?id=###`, the query parameter is `id`.
-// - Header - Custom headers that are expected as part of the request.
-// - Body - The payload that's appended to the HTTP request. Since there can only be one payload, there can only be
-// _one_ body parameter. The name of the body parameter has no effect on the parameter itself and is used for
-// documentation purposes only. Since Form parameters are also in the payload, body and form parameters cannot exist
-// together for the same operation.
-// - Form - Used to describe the payload of an HTTP request when either `application/x-www-form-urlencoded` or
-// `multipart/form-data` are used as the content type of the request (in Swagger's definition,
-// the [`consumes`](#operationConsumes) property of an operation). This is the only parameter type that can be used
-// to send files, thus supporting the `file` type. Since form parameters are sent in the payload, they cannot be
-// declared together with a body parameter for the same operation. Form parameters have a different format based on
-// the content-type used (for further details, consult http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4).
-// - `application/x-www-form-urlencoded` - Similar to the format of Query parameters but as a payload.
-// For example, `foo=1&bar=swagger` - both `foo` and `bar` are form parameters. This is normally used for simple
-// parameters that are being transferred.
-// - `multipart/form-data` - each parameter takes a section in the payload with an internal header.
-// For example, for the header `Content-Disposition: form-data; name="submit-name"` the name of the parameter is
-// `submit-name`. This type of form parameters is more commonly used for file transfers.
-//
-// For more information: http://goo.gl/8us55a#parameterObject
-type Parameter struct {
- Refable
- CommonValidations
- SimpleSchema
- VendorExtensible
- ParamProps
-}
-
-// JSONLookup look up a value by the json property name
-func (p Parameter) JSONLookup(token string) (interface{}, error) {
- if ex, ok := p.Extensions[token]; ok {
- return &ex, nil
- }
- if token == jsonRef {
- return &p.Ref, nil
- }
-
- r, _, err := jsonpointer.GetForToken(p.CommonValidations, token)
- if err != nil && !strings.HasPrefix(err.Error(), "object has no field") {
- return nil, err
- }
- if r != nil {
- return r, nil
- }
- r, _, err = jsonpointer.GetForToken(p.SimpleSchema, token)
- if err != nil && !strings.HasPrefix(err.Error(), "object has no field") {
- return nil, err
- }
- if r != nil {
- return r, nil
- }
- r, _, err = jsonpointer.GetForToken(p.ParamProps, token)
- return r, err
-}
-
-// WithDescription a fluent builder method for the description of the parameter
-func (p *Parameter) WithDescription(description string) *Parameter {
- p.Description = description
- return p
-}
-
-// Named a fluent builder method to override the name of the parameter
-func (p *Parameter) Named(name string) *Parameter {
- p.Name = name
- return p
-}
-
-// WithLocation a fluent builder method to override the location of the parameter
-func (p *Parameter) WithLocation(in string) *Parameter {
- p.In = in
- return p
-}
-
-// Typed a fluent builder method for the type of the parameter value
-func (p *Parameter) Typed(tpe, format string) *Parameter {
- p.Type = tpe
- p.Format = format
- return p
-}
-
-// CollectionOf a fluent builder method for an array parameter
-func (p *Parameter) CollectionOf(items *Items, format string) *Parameter {
- p.Type = jsonArray
- p.Items = items
- p.CollectionFormat = format
- return p
-}
-
-// WithDefault sets the default value on this parameter
-func (p *Parameter) WithDefault(defaultValue interface{}) *Parameter {
- p.AsOptional() // with default implies optional
- p.Default = defaultValue
- return p
-}
-
-// AllowsEmptyValues flags this parameter as being ok with empty values
-func (p *Parameter) AllowsEmptyValues() *Parameter {
- p.AllowEmptyValue = true
- return p
-}
-
-// NoEmptyValues flags this parameter as not liking empty values
-func (p *Parameter) NoEmptyValues() *Parameter {
- p.AllowEmptyValue = false
- return p
-}
-
-// AsOptional flags this parameter as optional
-func (p *Parameter) AsOptional() *Parameter {
- p.Required = false
- return p
-}
-
-// AsRequired flags this parameter as required
-func (p *Parameter) AsRequired() *Parameter {
- if p.Default != nil { // with a default required makes no sense
- return p
- }
- p.Required = true
- return p
-}
-
-// WithMaxLength sets a max length value
-func (p *Parameter) WithMaxLength(max int64) *Parameter {
- p.MaxLength = &max
- return p
-}
-
-// WithMinLength sets a min length value
-func (p *Parameter) WithMinLength(min int64) *Parameter {
- p.MinLength = &min
- return p
-}
-
-// WithPattern sets a pattern value
-func (p *Parameter) WithPattern(pattern string) *Parameter {
- p.Pattern = pattern
- return p
-}
-
-// WithMultipleOf sets a multiple of value
-func (p *Parameter) WithMultipleOf(number float64) *Parameter {
- p.MultipleOf = &number
- return p
-}
-
-// WithMaximum sets a maximum number value
-func (p *Parameter) WithMaximum(max float64, exclusive bool) *Parameter {
- p.Maximum = &max
- p.ExclusiveMaximum = exclusive
- return p
-}
-
-// WithMinimum sets a minimum number value
-func (p *Parameter) WithMinimum(min float64, exclusive bool) *Parameter {
- p.Minimum = &min
- p.ExclusiveMinimum = exclusive
- return p
-}
-
-// WithEnum sets a the enum values (replace)
-func (p *Parameter) WithEnum(values ...interface{}) *Parameter {
- p.Enum = append([]interface{}{}, values...)
- return p
-}
-
-// WithMaxItems sets the max items
-func (p *Parameter) WithMaxItems(size int64) *Parameter {
- p.MaxItems = &size
- return p
-}
-
-// WithMinItems sets the min items
-func (p *Parameter) WithMinItems(size int64) *Parameter {
- p.MinItems = &size
- return p
-}
-
-// UniqueValues dictates that this array can only have unique items
-func (p *Parameter) UniqueValues() *Parameter {
- p.UniqueItems = true
- return p
-}
-
-// AllowDuplicates this array can have duplicates
-func (p *Parameter) AllowDuplicates() *Parameter {
- p.UniqueItems = false
- return p
-}
-
-// WithValidations is a fluent method to set parameter validations
-func (p *Parameter) WithValidations(val CommonValidations) *Parameter {
- p.SetValidations(SchemaValidations{CommonValidations: val})
- return p
-}
-
-// UnmarshalJSON hydrates this items instance with the data from JSON
-func (p *Parameter) UnmarshalJSON(data []byte) error {
- if err := json.Unmarshal(data, &p.CommonValidations); err != nil {
- return err
- }
- if err := json.Unmarshal(data, &p.Refable); err != nil {
- return err
- }
- if err := json.Unmarshal(data, &p.SimpleSchema); err != nil {
- return err
- }
- if err := json.Unmarshal(data, &p.VendorExtensible); err != nil {
- return err
- }
- return json.Unmarshal(data, &p.ParamProps)
-}
-
-// MarshalJSON converts this items object to JSON
-func (p Parameter) MarshalJSON() ([]byte, error) {
- b1, err := json.Marshal(p.CommonValidations)
- if err != nil {
- return nil, err
- }
- b2, err := json.Marshal(p.SimpleSchema)
- if err != nil {
- return nil, err
- }
- b3, err := json.Marshal(p.Refable)
- if err != nil {
- return nil, err
- }
- b4, err := json.Marshal(p.VendorExtensible)
- if err != nil {
- return nil, err
- }
- b5, err := json.Marshal(p.ParamProps)
- if err != nil {
- return nil, err
- }
- return swag.ConcatJSON(b3, b1, b2, b4, b5), nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/path_item.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/path_item.go
deleted file mode 100644
index 68fc8e901..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/path_item.go
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package spec
-
-import (
- "encoding/json"
-
- "github.com/go-openapi/jsonpointer"
- "github.com/go-openapi/swag"
-)
-
-// PathItemProps the path item specific properties
-type PathItemProps struct {
- Get *Operation `json:"get,omitempty"`
- Put *Operation `json:"put,omitempty"`
- Post *Operation `json:"post,omitempty"`
- Delete *Operation `json:"delete,omitempty"`
- Options *Operation `json:"options,omitempty"`
- Head *Operation `json:"head,omitempty"`
- Patch *Operation `json:"patch,omitempty"`
- Parameters []Parameter `json:"parameters,omitempty"`
-}
-
-// PathItem describes the operations available on a single path.
-// A Path Item may be empty, due to [ACL constraints](http://goo.gl/8us55a#securityFiltering).
-// The path itself is still exposed to the documentation viewer but they will
-// not know which operations and parameters are available.
-//
-// For more information: http://goo.gl/8us55a#pathItemObject
-type PathItem struct {
- Refable
- VendorExtensible
- PathItemProps
-}
-
-// JSONLookup look up a value by the json property name
-func (p PathItem) JSONLookup(token string) (interface{}, error) {
- if ex, ok := p.Extensions[token]; ok {
- return &ex, nil
- }
- if token == jsonRef {
- return &p.Ref, nil
- }
- r, _, err := jsonpointer.GetForToken(p.PathItemProps, token)
- return r, err
-}
-
-// UnmarshalJSON hydrates this items instance with the data from JSON
-func (p *PathItem) UnmarshalJSON(data []byte) error {
- if err := json.Unmarshal(data, &p.Refable); err != nil {
- return err
- }
- if err := json.Unmarshal(data, &p.VendorExtensible); err != nil {
- return err
- }
- return json.Unmarshal(data, &p.PathItemProps)
-}
-
-// MarshalJSON converts this items object to JSON
-func (p PathItem) MarshalJSON() ([]byte, error) {
- b3, err := json.Marshal(p.Refable)
- if err != nil {
- return nil, err
- }
- b4, err := json.Marshal(p.VendorExtensible)
- if err != nil {
- return nil, err
- }
- b5, err := json.Marshal(p.PathItemProps)
- if err != nil {
- return nil, err
- }
- concated := swag.ConcatJSON(b3, b4, b5)
- return concated, nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/paths.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/paths.go
deleted file mode 100644
index 9dc82a290..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/paths.go
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package spec
-
-import (
- "encoding/json"
- "fmt"
- "strings"
-
- "github.com/go-openapi/swag"
-)
-
-// Paths holds the relative paths to the individual endpoints.
-// The path is appended to the [`basePath`](http://goo.gl/8us55a#swaggerBasePath) in order
-// to construct the full URL.
-// The Paths may be empty, due to [ACL constraints](http://goo.gl/8us55a#securityFiltering).
-//
-// For more information: http://goo.gl/8us55a#pathsObject
-type Paths struct {
- VendorExtensible
- Paths map[string]PathItem `json:"-"` // custom serializer to flatten this, each entry must start with "/"
-}
-
-// JSONLookup look up a value by the json property name
-func (p Paths) JSONLookup(token string) (interface{}, error) {
- if pi, ok := p.Paths[token]; ok {
- return &pi, nil
- }
- if ex, ok := p.Extensions[token]; ok {
- return &ex, nil
- }
- return nil, fmt.Errorf("object has no field %q", token)
-}
-
-// UnmarshalJSON hydrates this items instance with the data from JSON
-func (p *Paths) UnmarshalJSON(data []byte) error {
- var res map[string]json.RawMessage
- if err := json.Unmarshal(data, &res); err != nil {
- return err
- }
- for k, v := range res {
- if strings.HasPrefix(strings.ToLower(k), "x-") {
- if p.Extensions == nil {
- p.Extensions = make(map[string]interface{})
- }
- var d interface{}
- if err := json.Unmarshal(v, &d); err != nil {
- return err
- }
- p.Extensions[k] = d
- }
- if strings.HasPrefix(k, "/") {
- if p.Paths == nil {
- p.Paths = make(map[string]PathItem)
- }
- var pi PathItem
- if err := json.Unmarshal(v, &pi); err != nil {
- return err
- }
- p.Paths[k] = pi
- }
- }
- return nil
-}
-
-// MarshalJSON converts this items object to JSON
-func (p Paths) MarshalJSON() ([]byte, error) {
- b1, err := json.Marshal(p.VendorExtensible)
- if err != nil {
- return nil, err
- }
-
- pths := make(map[string]PathItem)
- for k, v := range p.Paths {
- if strings.HasPrefix(k, "/") {
- pths[k] = v
- }
- }
- b2, err := json.Marshal(pths)
- if err != nil {
- return nil, err
- }
- concated := swag.ConcatJSON(b1, b2)
- return concated, nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/properties.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/properties.go
deleted file mode 100644
index 91d2435f0..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/properties.go
+++ /dev/null
@@ -1,91 +0,0 @@
-package spec
-
-import (
- "bytes"
- "encoding/json"
- "reflect"
- "sort"
-)
-
-// OrderSchemaItem holds a named schema (e.g. from a property of an object)
-type OrderSchemaItem struct {
- Name string
- Schema
-}
-
-// OrderSchemaItems is a sortable slice of named schemas.
-// The ordering is defined by the x-order schema extension.
-type OrderSchemaItems []OrderSchemaItem
-
-// MarshalJSON produces a json object with keys defined by the name schemas
-// of the OrderSchemaItems slice, keeping the original order of the slice.
-func (items OrderSchemaItems) MarshalJSON() ([]byte, error) {
- buf := bytes.NewBuffer(nil)
- buf.WriteString("{")
- for i := range items {
- if i > 0 {
- buf.WriteString(",")
- }
- buf.WriteString("\"")
- buf.WriteString(items[i].Name)
- buf.WriteString("\":")
- bs, err := json.Marshal(&items[i].Schema)
- if err != nil {
- return nil, err
- }
- buf.Write(bs)
- }
- buf.WriteString("}")
- return buf.Bytes(), nil
-}
-
-func (items OrderSchemaItems) Len() int { return len(items) }
-func (items OrderSchemaItems) Swap(i, j int) { items[i], items[j] = items[j], items[i] }
-func (items OrderSchemaItems) Less(i, j int) (ret bool) {
- ii, oki := items[i].Extensions.GetInt("x-order")
- ij, okj := items[j].Extensions.GetInt("x-order")
- if oki {
- if okj {
- defer func() {
- if err := recover(); err != nil {
- defer func() {
- if err = recover(); err != nil {
- ret = items[i].Name < items[j].Name
- }
- }()
- ret = reflect.ValueOf(ii).String() < reflect.ValueOf(ij).String()
- }
- }()
- return ii < ij
- }
- return true
- } else if okj {
- return false
- }
- return items[i].Name < items[j].Name
-}
-
-// SchemaProperties is a map representing the properties of a Schema object.
-// It knows how to transform its keys into an ordered slice.
-type SchemaProperties map[string]Schema
-
-// ToOrderedSchemaItems transforms the map of properties into a sortable slice
-func (properties SchemaProperties) ToOrderedSchemaItems() OrderSchemaItems {
- items := make(OrderSchemaItems, 0, len(properties))
- for k, v := range properties {
- items = append(items, OrderSchemaItem{
- Name: k,
- Schema: v,
- })
- }
- sort.Sort(items)
- return items
-}
-
-// MarshalJSON produces properties as json, keeping their order.
-func (properties SchemaProperties) MarshalJSON() ([]byte, error) {
- if properties == nil {
- return []byte("null"), nil
- }
- return json.Marshal(properties.ToOrderedSchemaItems())
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/ref.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/ref.go
deleted file mode 100644
index b0ef9bd9c..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/ref.go
+++ /dev/null
@@ -1,193 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package spec
-
-import (
- "bytes"
- "encoding/gob"
- "encoding/json"
- "net/http"
- "os"
- "path/filepath"
-
- "github.com/go-openapi/jsonreference"
-)
-
-// Refable is a struct for things that accept a $ref property
-type Refable struct {
- Ref Ref
-}
-
-// MarshalJSON marshals the ref to json
-func (r Refable) MarshalJSON() ([]byte, error) {
- return r.Ref.MarshalJSON()
-}
-
-// UnmarshalJSON unmarshalss the ref from json
-func (r *Refable) UnmarshalJSON(d []byte) error {
- return json.Unmarshal(d, &r.Ref)
-}
-
-// Ref represents a json reference that is potentially resolved
-type Ref struct {
- jsonreference.Ref
-}
-
-// RemoteURI gets the remote uri part of the ref
-func (r *Ref) RemoteURI() string {
- if r.String() == "" {
- return ""
- }
-
- u := *r.GetURL()
- u.Fragment = ""
- return u.String()
-}
-
-// IsValidURI returns true when the url the ref points to can be found
-func (r *Ref) IsValidURI(basepaths ...string) bool {
- if r.String() == "" {
- return true
- }
-
- v := r.RemoteURI()
- if v == "" {
- return true
- }
-
- if r.HasFullURL {
- //nolint:noctx,gosec
- rr, err := http.Get(v)
- if err != nil {
- return false
- }
- defer rr.Body.Close()
-
- return rr.StatusCode/100 == 2
- }
-
- if !(r.HasFileScheme || r.HasFullFilePath || r.HasURLPathOnly) {
- return false
- }
-
- // check for local file
- pth := v
- if r.HasURLPathOnly {
- base := "."
- if len(basepaths) > 0 {
- base = filepath.Dir(filepath.Join(basepaths...))
- }
- p, e := filepath.Abs(filepath.ToSlash(filepath.Join(base, pth)))
- if e != nil {
- return false
- }
- pth = p
- }
-
- fi, err := os.Stat(filepath.ToSlash(pth))
- if err != nil {
- return false
- }
-
- return !fi.IsDir()
-}
-
-// Inherits creates a new reference from a parent and a child
-// If the child cannot inherit from the parent, an error is returned
-func (r *Ref) Inherits(child Ref) (*Ref, error) {
- ref, err := r.Ref.Inherits(child.Ref)
- if err != nil {
- return nil, err
- }
- return &Ref{Ref: *ref}, nil
-}
-
-// NewRef creates a new instance of a ref object
-// returns an error when the reference uri is an invalid uri
-func NewRef(refURI string) (Ref, error) {
- ref, err := jsonreference.New(refURI)
- if err != nil {
- return Ref{}, err
- }
- return Ref{Ref: ref}, nil
-}
-
-// MustCreateRef creates a ref object but panics when refURI is invalid.
-// Use the NewRef method for a version that returns an error.
-func MustCreateRef(refURI string) Ref {
- return Ref{Ref: jsonreference.MustCreateRef(refURI)}
-}
-
-// MarshalJSON marshals this ref into a JSON object
-func (r Ref) MarshalJSON() ([]byte, error) {
- str := r.String()
- if str == "" {
- if r.IsRoot() {
- return []byte(`{"$ref":""}`), nil
- }
- return []byte("{}"), nil
- }
- v := map[string]interface{}{"$ref": str}
- return json.Marshal(v)
-}
-
-// UnmarshalJSON unmarshals this ref from a JSON object
-func (r *Ref) UnmarshalJSON(d []byte) error {
- var v map[string]interface{}
- if err := json.Unmarshal(d, &v); err != nil {
- return err
- }
- return r.fromMap(v)
-}
-
-// GobEncode provides a safe gob encoder for Ref
-func (r Ref) GobEncode() ([]byte, error) {
- var b bytes.Buffer
- raw, err := r.MarshalJSON()
- if err != nil {
- return nil, err
- }
- err = gob.NewEncoder(&b).Encode(raw)
- return b.Bytes(), err
-}
-
-// GobDecode provides a safe gob decoder for Ref
-func (r *Ref) GobDecode(b []byte) error {
- var raw []byte
- buf := bytes.NewBuffer(b)
- err := gob.NewDecoder(buf).Decode(&raw)
- if err != nil {
- return err
- }
- return json.Unmarshal(raw, r)
-}
-
-func (r *Ref) fromMap(v map[string]interface{}) error {
- if v == nil {
- return nil
- }
-
- if vv, ok := v["$ref"]; ok {
- if str, ok := vv.(string); ok {
- ref, err := jsonreference.New(str)
- if err != nil {
- return err
- }
- *r = Ref{Ref: ref}
- }
- }
-
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/resolver.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/resolver.go
deleted file mode 100644
index 47d1ee13f..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/resolver.go
+++ /dev/null
@@ -1,127 +0,0 @@
-package spec
-
-import (
- "fmt"
-
- "github.com/go-openapi/swag"
-)
-
-func resolveAnyWithBase(root interface{}, ref *Ref, result interface{}, options *ExpandOptions) error {
- options = optionsOrDefault(options)
- resolver := defaultSchemaLoader(root, options, nil, nil)
-
- if err := resolver.Resolve(ref, result, options.RelativeBase); err != nil {
- return err
- }
-
- return nil
-}
-
-// ResolveRefWithBase resolves a reference against a context root with preservation of base path
-func ResolveRefWithBase(root interface{}, ref *Ref, options *ExpandOptions) (*Schema, error) {
- result := new(Schema)
-
- if err := resolveAnyWithBase(root, ref, result, options); err != nil {
- return nil, err
- }
-
- return result, nil
-}
-
-// ResolveRef resolves a reference for a schema against a context root
-// ref is guaranteed to be in root (no need to go to external files)
-//
-// ResolveRef is ONLY called from the code generation module
-func ResolveRef(root interface{}, ref *Ref) (*Schema, error) {
- res, _, err := ref.GetPointer().Get(root)
- if err != nil {
- return nil, err
- }
-
- switch sch := res.(type) {
- case Schema:
- return &sch, nil
- case *Schema:
- return sch, nil
- case map[string]interface{}:
- newSch := new(Schema)
- if err = swag.DynamicJSONToStruct(sch, newSch); err != nil {
- return nil, err
- }
- return newSch, nil
- default:
- return nil, fmt.Errorf("type: %T: %w", sch, ErrUnknownTypeForReference)
- }
-}
-
-// ResolveParameterWithBase resolves a parameter reference against a context root and base path
-func ResolveParameterWithBase(root interface{}, ref Ref, options *ExpandOptions) (*Parameter, error) {
- result := new(Parameter)
-
- if err := resolveAnyWithBase(root, &ref, result, options); err != nil {
- return nil, err
- }
-
- return result, nil
-}
-
-// ResolveParameter resolves a parameter reference against a context root
-func ResolveParameter(root interface{}, ref Ref) (*Parameter, error) {
- return ResolveParameterWithBase(root, ref, nil)
-}
-
-// ResolveResponseWithBase resolves response a reference against a context root and base path
-func ResolveResponseWithBase(root interface{}, ref Ref, options *ExpandOptions) (*Response, error) {
- result := new(Response)
-
- err := resolveAnyWithBase(root, &ref, result, options)
- if err != nil {
- return nil, err
- }
-
- return result, nil
-}
-
-// ResolveResponse resolves response a reference against a context root
-func ResolveResponse(root interface{}, ref Ref) (*Response, error) {
- return ResolveResponseWithBase(root, ref, nil)
-}
-
-// ResolvePathItemWithBase resolves response a path item against a context root and base path
-func ResolvePathItemWithBase(root interface{}, ref Ref, options *ExpandOptions) (*PathItem, error) {
- result := new(PathItem)
-
- if err := resolveAnyWithBase(root, &ref, result, options); err != nil {
- return nil, err
- }
-
- return result, nil
-}
-
-// ResolvePathItem resolves response a path item against a context root and base path
-//
-// Deprecated: use ResolvePathItemWithBase instead
-func ResolvePathItem(root interface{}, ref Ref, options *ExpandOptions) (*PathItem, error) {
- return ResolvePathItemWithBase(root, ref, options)
-}
-
-// ResolveItemsWithBase resolves parameter items reference against a context root and base path.
-//
-// NOTE: stricly speaking, this construct is not supported by Swagger 2.0.
-// Similarly, $ref are forbidden in response headers.
-func ResolveItemsWithBase(root interface{}, ref Ref, options *ExpandOptions) (*Items, error) {
- result := new(Items)
-
- if err := resolveAnyWithBase(root, &ref, result, options); err != nil {
- return nil, err
- }
-
- return result, nil
-}
-
-// ResolveItems resolves parameter items reference against a context root and base path.
-//
-// Deprecated: use ResolveItemsWithBase instead
-func ResolveItems(root interface{}, ref Ref, options *ExpandOptions) (*Items, error) {
- return ResolveItemsWithBase(root, ref, options)
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/response.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/response.go
deleted file mode 100644
index 0340b60d8..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/response.go
+++ /dev/null
@@ -1,152 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package spec
-
-import (
- "encoding/json"
-
- "github.com/go-openapi/jsonpointer"
- "github.com/go-openapi/swag"
-)
-
-// ResponseProps properties specific to a response
-type ResponseProps struct {
- Description string `json:"description"`
- Schema *Schema `json:"schema,omitempty"`
- Headers map[string]Header `json:"headers,omitempty"`
- Examples map[string]interface{} `json:"examples,omitempty"`
-}
-
-// Response describes a single response from an API Operation.
-//
-// For more information: http://goo.gl/8us55a#responseObject
-type Response struct {
- Refable
- ResponseProps
- VendorExtensible
-}
-
-// JSONLookup look up a value by the json property name
-func (r Response) JSONLookup(token string) (interface{}, error) {
- if ex, ok := r.Extensions[token]; ok {
- return &ex, nil
- }
- if token == "$ref" {
- return &r.Ref, nil
- }
- ptr, _, err := jsonpointer.GetForToken(r.ResponseProps, token)
- return ptr, err
-}
-
-// UnmarshalJSON hydrates this items instance with the data from JSON
-func (r *Response) UnmarshalJSON(data []byte) error {
- if err := json.Unmarshal(data, &r.ResponseProps); err != nil {
- return err
- }
- if err := json.Unmarshal(data, &r.Refable); err != nil {
- return err
- }
- return json.Unmarshal(data, &r.VendorExtensible)
-}
-
-// MarshalJSON converts this items object to JSON
-func (r Response) MarshalJSON() ([]byte, error) {
- var (
- b1 []byte
- err error
- )
-
- if r.Ref.String() == "" {
- // when there is no $ref, empty description is rendered as an empty string
- b1, err = json.Marshal(r.ResponseProps)
- } else {
- // when there is $ref inside the schema, description should be omitempty-ied
- b1, err = json.Marshal(struct {
- Description string `json:"description,omitempty"`
- Schema *Schema `json:"schema,omitempty"`
- Headers map[string]Header `json:"headers,omitempty"`
- Examples map[string]interface{} `json:"examples,omitempty"`
- }{
- Description: r.ResponseProps.Description,
- Schema: r.ResponseProps.Schema,
- Examples: r.ResponseProps.Examples,
- })
- }
- if err != nil {
- return nil, err
- }
-
- b2, err := json.Marshal(r.Refable)
- if err != nil {
- return nil, err
- }
- b3, err := json.Marshal(r.VendorExtensible)
- if err != nil {
- return nil, err
- }
- return swag.ConcatJSON(b1, b2, b3), nil
-}
-
-// NewResponse creates a new response instance
-func NewResponse() *Response {
- return new(Response)
-}
-
-// ResponseRef creates a response as a json reference
-func ResponseRef(url string) *Response {
- resp := NewResponse()
- resp.Ref = MustCreateRef(url)
- return resp
-}
-
-// WithDescription sets the description on this response, allows for chaining
-func (r *Response) WithDescription(description string) *Response {
- r.Description = description
- return r
-}
-
-// WithSchema sets the schema on this response, allows for chaining.
-// Passing a nil argument removes the schema from this response
-func (r *Response) WithSchema(schema *Schema) *Response {
- r.Schema = schema
- return r
-}
-
-// AddHeader adds a header to this response
-func (r *Response) AddHeader(name string, header *Header) *Response {
- if header == nil {
- return r.RemoveHeader(name)
- }
- if r.Headers == nil {
- r.Headers = make(map[string]Header)
- }
- r.Headers[name] = *header
- return r
-}
-
-// RemoveHeader removes a header from this response
-func (r *Response) RemoveHeader(name string) *Response {
- delete(r.Headers, name)
- return r
-}
-
-// AddExample adds an example to this response
-func (r *Response) AddExample(mediaType string, example interface{}) *Response {
- if r.Examples == nil {
- r.Examples = make(map[string]interface{})
- }
- r.Examples[mediaType] = example
- return r
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/responses.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/responses.go
deleted file mode 100644
index 16c3076fe..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/responses.go
+++ /dev/null
@@ -1,140 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package spec
-
-import (
- "encoding/json"
- "fmt"
- "reflect"
- "strconv"
- "strings"
-
- "github.com/go-openapi/swag"
-)
-
-// Responses is a container for the expected responses of an operation.
-// The container maps a HTTP response code to the expected response.
-// It is not expected from the documentation to necessarily cover all possible HTTP response codes,
-// since they may not be known in advance. However, it is expected from the documentation to cover
-// a successful operation response and any known errors.
-//
-// The `default` can be used a default response object for all HTTP codes that are not covered
-// individually by the specification.
-//
-// The `Responses Object` MUST contain at least one response code, and it SHOULD be the response
-// for a successful operation call.
-//
-// For more information: http://goo.gl/8us55a#responsesObject
-type Responses struct {
- VendorExtensible
- ResponsesProps
-}
-
-// JSONLookup implements an interface to customize json pointer lookup
-func (r Responses) JSONLookup(token string) (interface{}, error) {
- if token == "default" {
- return r.Default, nil
- }
- if ex, ok := r.Extensions[token]; ok {
- return &ex, nil
- }
- if i, err := strconv.Atoi(token); err == nil {
- if scr, ok := r.StatusCodeResponses[i]; ok {
- return scr, nil
- }
- }
- return nil, fmt.Errorf("object has no field %q", token)
-}
-
-// UnmarshalJSON hydrates this items instance with the data from JSON
-func (r *Responses) UnmarshalJSON(data []byte) error {
- if err := json.Unmarshal(data, &r.ResponsesProps); err != nil {
- return err
- }
-
- if err := json.Unmarshal(data, &r.VendorExtensible); err != nil {
- return err
- }
- if reflect.DeepEqual(ResponsesProps{}, r.ResponsesProps) {
- r.ResponsesProps = ResponsesProps{}
- }
- return nil
-}
-
-// MarshalJSON converts this items object to JSON
-func (r Responses) MarshalJSON() ([]byte, error) {
- b1, err := json.Marshal(r.ResponsesProps)
- if err != nil {
- return nil, err
- }
- b2, err := json.Marshal(r.VendorExtensible)
- if err != nil {
- return nil, err
- }
- concated := swag.ConcatJSON(b1, b2)
- return concated, nil
-}
-
-// ResponsesProps describes all responses for an operation.
-// It tells what is the default response and maps all responses with a
-// HTTP status code.
-type ResponsesProps struct {
- Default *Response
- StatusCodeResponses map[int]Response
-}
-
-// MarshalJSON marshals responses as JSON
-func (r ResponsesProps) MarshalJSON() ([]byte, error) {
- toser := map[string]Response{}
- if r.Default != nil {
- toser["default"] = *r.Default
- }
- for k, v := range r.StatusCodeResponses {
- toser[strconv.Itoa(k)] = v
- }
- return json.Marshal(toser)
-}
-
-// UnmarshalJSON unmarshals responses from JSON
-func (r *ResponsesProps) UnmarshalJSON(data []byte) error {
- var res map[string]json.RawMessage
- if err := json.Unmarshal(data, &res); err != nil {
- return err
- }
-
- if v, ok := res["default"]; ok {
- var defaultRes Response
- if err := json.Unmarshal(v, &defaultRes); err != nil {
- return err
- }
- r.Default = &defaultRes
- delete(res, "default")
- }
- for k, v := range res {
- if !strings.HasPrefix(k, "x-") {
- var statusCodeResp Response
- if err := json.Unmarshal(v, &statusCodeResp); err != nil {
- return err
- }
- if nk, err := strconv.Atoi(k); err == nil {
- if r.StatusCodeResponses == nil {
- r.StatusCodeResponses = map[int]Response{}
- }
- r.StatusCodeResponses[nk] = statusCodeResp
- }
- }
- }
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/schema.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/schema.go
deleted file mode 100644
index 4e9be8576..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/schema.go
+++ /dev/null
@@ -1,645 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package spec
-
-import (
- "encoding/json"
- "fmt"
- "strings"
-
- "github.com/go-openapi/jsonpointer"
- "github.com/go-openapi/swag"
-)
-
-// BooleanProperty creates a boolean property
-func BooleanProperty() *Schema {
- return &Schema{SchemaProps: SchemaProps{Type: []string{"boolean"}}}
-}
-
-// BoolProperty creates a boolean property
-func BoolProperty() *Schema { return BooleanProperty() }
-
-// StringProperty creates a string property
-func StringProperty() *Schema {
- return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}}}
-}
-
-// CharProperty creates a string property
-func CharProperty() *Schema {
- return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}}}
-}
-
-// Float64Property creates a float64/double property
-func Float64Property() *Schema {
- return &Schema{SchemaProps: SchemaProps{Type: []string{"number"}, Format: "double"}}
-}
-
-// Float32Property creates a float32/float property
-func Float32Property() *Schema {
- return &Schema{SchemaProps: SchemaProps{Type: []string{"number"}, Format: "float"}}
-}
-
-// Int8Property creates an int8 property
-func Int8Property() *Schema {
- return &Schema{SchemaProps: SchemaProps{Type: []string{"integer"}, Format: "int8"}}
-}
-
-// Int16Property creates an int16 property
-func Int16Property() *Schema {
- return &Schema{SchemaProps: SchemaProps{Type: []string{"integer"}, Format: "int16"}}
-}
-
-// Int32Property creates an int32 property
-func Int32Property() *Schema {
- return &Schema{SchemaProps: SchemaProps{Type: []string{"integer"}, Format: "int32"}}
-}
-
-// Int64Property creates an int64 property
-func Int64Property() *Schema {
- return &Schema{SchemaProps: SchemaProps{Type: []string{"integer"}, Format: "int64"}}
-}
-
-// StrFmtProperty creates a property for the named string format
-func StrFmtProperty(format string) *Schema {
- return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}, Format: format}}
-}
-
-// DateProperty creates a date property
-func DateProperty() *Schema {
- return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}, Format: "date"}}
-}
-
-// DateTimeProperty creates a date time property
-func DateTimeProperty() *Schema {
- return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}, Format: "date-time"}}
-}
-
-// MapProperty creates a map property
-func MapProperty(property *Schema) *Schema {
- return &Schema{SchemaProps: SchemaProps{Type: []string{"object"},
- AdditionalProperties: &SchemaOrBool{Allows: true, Schema: property}}}
-}
-
-// RefProperty creates a ref property
-func RefProperty(name string) *Schema {
- return &Schema{SchemaProps: SchemaProps{Ref: MustCreateRef(name)}}
-}
-
-// RefSchema creates a ref property
-func RefSchema(name string) *Schema {
- return &Schema{SchemaProps: SchemaProps{Ref: MustCreateRef(name)}}
-}
-
-// ArrayProperty creates an array property
-func ArrayProperty(items *Schema) *Schema {
- if items == nil {
- return &Schema{SchemaProps: SchemaProps{Type: []string{"array"}}}
- }
- return &Schema{SchemaProps: SchemaProps{Items: &SchemaOrArray{Schema: items}, Type: []string{"array"}}}
-}
-
-// ComposedSchema creates a schema with allOf
-func ComposedSchema(schemas ...Schema) *Schema {
- s := new(Schema)
- s.AllOf = schemas
- return s
-}
-
-// SchemaURL represents a schema url
-type SchemaURL string
-
-// MarshalJSON marshal this to JSON
-func (r SchemaURL) MarshalJSON() ([]byte, error) {
- if r == "" {
- return []byte("{}"), nil
- }
- v := map[string]interface{}{"$schema": string(r)}
- return json.Marshal(v)
-}
-
-// UnmarshalJSON unmarshal this from JSON
-func (r *SchemaURL) UnmarshalJSON(data []byte) error {
- var v map[string]interface{}
- if err := json.Unmarshal(data, &v); err != nil {
- return err
- }
- return r.fromMap(v)
-}
-
-func (r *SchemaURL) fromMap(v map[string]interface{}) error {
- if v == nil {
- return nil
- }
- if vv, ok := v["$schema"]; ok {
- if str, ok := vv.(string); ok {
- u, err := parseURL(str)
- if err != nil {
- return err
- }
-
- *r = SchemaURL(u.String())
- }
- }
- return nil
-}
-
-// SchemaProps describes a JSON schema (draft 4)
-type SchemaProps struct {
- ID string `json:"id,omitempty"`
- Ref Ref `json:"-"`
- Schema SchemaURL `json:"-"`
- Description string `json:"description,omitempty"`
- Type StringOrArray `json:"type,omitempty"`
- Nullable bool `json:"nullable,omitempty"`
- Format string `json:"format,omitempty"`
- Title string `json:"title,omitempty"`
- Default interface{} `json:"default,omitempty"`
- Maximum *float64 `json:"maximum,omitempty"`
- ExclusiveMaximum bool `json:"exclusiveMaximum,omitempty"`
- Minimum *float64 `json:"minimum,omitempty"`
- ExclusiveMinimum bool `json:"exclusiveMinimum,omitempty"`
- MaxLength *int64 `json:"maxLength,omitempty"`
- MinLength *int64 `json:"minLength,omitempty"`
- Pattern string `json:"pattern,omitempty"`
- MaxItems *int64 `json:"maxItems,omitempty"`
- MinItems *int64 `json:"minItems,omitempty"`
- UniqueItems bool `json:"uniqueItems,omitempty"`
- MultipleOf *float64 `json:"multipleOf,omitempty"`
- Enum []interface{} `json:"enum,omitempty"`
- MaxProperties *int64 `json:"maxProperties,omitempty"`
- MinProperties *int64 `json:"minProperties,omitempty"`
- Required []string `json:"required,omitempty"`
- Items *SchemaOrArray `json:"items,omitempty"`
- AllOf []Schema `json:"allOf,omitempty"`
- OneOf []Schema `json:"oneOf,omitempty"`
- AnyOf []Schema `json:"anyOf,omitempty"`
- Not *Schema `json:"not,omitempty"`
- Properties SchemaProperties `json:"properties,omitempty"`
- AdditionalProperties *SchemaOrBool `json:"additionalProperties,omitempty"`
- PatternProperties SchemaProperties `json:"patternProperties,omitempty"`
- Dependencies Dependencies `json:"dependencies,omitempty"`
- AdditionalItems *SchemaOrBool `json:"additionalItems,omitempty"`
- Definitions Definitions `json:"definitions,omitempty"`
-}
-
-// SwaggerSchemaProps are additional properties supported by swagger schemas, but not JSON-schema (draft 4)
-type SwaggerSchemaProps struct {
- Discriminator string `json:"discriminator,omitempty"`
- ReadOnly bool `json:"readOnly,omitempty"`
- XML *XMLObject `json:"xml,omitempty"`
- ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"`
- Example interface{} `json:"example,omitempty"`
-}
-
-// Schema the schema object allows the definition of input and output data types.
-// These types can be objects, but also primitives and arrays.
-// This object is based on the [JSON Schema Specification Draft 4](http://json-schema.org/)
-// and uses a predefined subset of it.
-// On top of this subset, there are extensions provided by this specification to allow for more complete documentation.
-//
-// For more information: http://goo.gl/8us55a#schemaObject
-type Schema struct {
- VendorExtensible
- SchemaProps
- SwaggerSchemaProps
- ExtraProps map[string]interface{} `json:"-"`
-}
-
-// JSONLookup implements an interface to customize json pointer lookup
-func (s Schema) JSONLookup(token string) (interface{}, error) {
- if ex, ok := s.Extensions[token]; ok {
- return &ex, nil
- }
-
- if ex, ok := s.ExtraProps[token]; ok {
- return &ex, nil
- }
-
- r, _, err := jsonpointer.GetForToken(s.SchemaProps, token)
- if r != nil || (err != nil && !strings.HasPrefix(err.Error(), "object has no field")) {
- return r, err
- }
- r, _, err = jsonpointer.GetForToken(s.SwaggerSchemaProps, token)
- return r, err
-}
-
-// WithID sets the id for this schema, allows for chaining
-func (s *Schema) WithID(id string) *Schema {
- s.ID = id
- return s
-}
-
-// WithTitle sets the title for this schema, allows for chaining
-func (s *Schema) WithTitle(title string) *Schema {
- s.Title = title
- return s
-}
-
-// WithDescription sets the description for this schema, allows for chaining
-func (s *Schema) WithDescription(description string) *Schema {
- s.Description = description
- return s
-}
-
-// WithProperties sets the properties for this schema
-func (s *Schema) WithProperties(schemas map[string]Schema) *Schema {
- s.Properties = schemas
- return s
-}
-
-// SetProperty sets a property on this schema
-func (s *Schema) SetProperty(name string, schema Schema) *Schema {
- if s.Properties == nil {
- s.Properties = make(map[string]Schema)
- }
- s.Properties[name] = schema
- return s
-}
-
-// WithAllOf sets the all of property
-func (s *Schema) WithAllOf(schemas ...Schema) *Schema {
- s.AllOf = schemas
- return s
-}
-
-// WithMaxProperties sets the max number of properties an object can have
-func (s *Schema) WithMaxProperties(max int64) *Schema {
- s.MaxProperties = &max
- return s
-}
-
-// WithMinProperties sets the min number of properties an object must have
-func (s *Schema) WithMinProperties(min int64) *Schema {
- s.MinProperties = &min
- return s
-}
-
-// Typed sets the type of this schema for a single value item
-func (s *Schema) Typed(tpe, format string) *Schema {
- s.Type = []string{tpe}
- s.Format = format
- return s
-}
-
-// AddType adds a type with potential format to the types for this schema
-func (s *Schema) AddType(tpe, format string) *Schema {
- s.Type = append(s.Type, tpe)
- if format != "" {
- s.Format = format
- }
- return s
-}
-
-// AsNullable flags this schema as nullable.
-func (s *Schema) AsNullable() *Schema {
- s.Nullable = true
- return s
-}
-
-// CollectionOf a fluent builder method for an array parameter
-func (s *Schema) CollectionOf(items Schema) *Schema {
- s.Type = []string{jsonArray}
- s.Items = &SchemaOrArray{Schema: &items}
- return s
-}
-
-// WithDefault sets the default value on this parameter
-func (s *Schema) WithDefault(defaultValue interface{}) *Schema {
- s.Default = defaultValue
- return s
-}
-
-// WithRequired flags this parameter as required
-func (s *Schema) WithRequired(items ...string) *Schema {
- s.Required = items
- return s
-}
-
-// AddRequired adds field names to the required properties array
-func (s *Schema) AddRequired(items ...string) *Schema {
- s.Required = append(s.Required, items...)
- return s
-}
-
-// WithMaxLength sets a max length value
-func (s *Schema) WithMaxLength(max int64) *Schema {
- s.MaxLength = &max
- return s
-}
-
-// WithMinLength sets a min length value
-func (s *Schema) WithMinLength(min int64) *Schema {
- s.MinLength = &min
- return s
-}
-
-// WithPattern sets a pattern value
-func (s *Schema) WithPattern(pattern string) *Schema {
- s.Pattern = pattern
- return s
-}
-
-// WithMultipleOf sets a multiple of value
-func (s *Schema) WithMultipleOf(number float64) *Schema {
- s.MultipleOf = &number
- return s
-}
-
-// WithMaximum sets a maximum number value
-func (s *Schema) WithMaximum(max float64, exclusive bool) *Schema {
- s.Maximum = &max
- s.ExclusiveMaximum = exclusive
- return s
-}
-
-// WithMinimum sets a minimum number value
-func (s *Schema) WithMinimum(min float64, exclusive bool) *Schema {
- s.Minimum = &min
- s.ExclusiveMinimum = exclusive
- return s
-}
-
-// WithEnum sets a the enum values (replace)
-func (s *Schema) WithEnum(values ...interface{}) *Schema {
- s.Enum = append([]interface{}{}, values...)
- return s
-}
-
-// WithMaxItems sets the max items
-func (s *Schema) WithMaxItems(size int64) *Schema {
- s.MaxItems = &size
- return s
-}
-
-// WithMinItems sets the min items
-func (s *Schema) WithMinItems(size int64) *Schema {
- s.MinItems = &size
- return s
-}
-
-// UniqueValues dictates that this array can only have unique items
-func (s *Schema) UniqueValues() *Schema {
- s.UniqueItems = true
- return s
-}
-
-// AllowDuplicates this array can have duplicates
-func (s *Schema) AllowDuplicates() *Schema {
- s.UniqueItems = false
- return s
-}
-
-// AddToAllOf adds a schema to the allOf property
-func (s *Schema) AddToAllOf(schemas ...Schema) *Schema {
- s.AllOf = append(s.AllOf, schemas...)
- return s
-}
-
-// WithDiscriminator sets the name of the discriminator field
-func (s *Schema) WithDiscriminator(discriminator string) *Schema {
- s.Discriminator = discriminator
- return s
-}
-
-// AsReadOnly flags this schema as readonly
-func (s *Schema) AsReadOnly() *Schema {
- s.ReadOnly = true
- return s
-}
-
-// AsWritable flags this schema as writeable (not read-only)
-func (s *Schema) AsWritable() *Schema {
- s.ReadOnly = false
- return s
-}
-
-// WithExample sets the example for this schema
-func (s *Schema) WithExample(example interface{}) *Schema {
- s.Example = example
- return s
-}
-
-// WithExternalDocs sets/removes the external docs for/from this schema.
-// When you pass empty strings as params the external documents will be removed.
-// When you pass non-empty string as one value then those values will be used on the external docs object.
-// So when you pass a non-empty description, you should also pass the url and vice versa.
-func (s *Schema) WithExternalDocs(description, url string) *Schema {
- if description == "" && url == "" {
- s.ExternalDocs = nil
- return s
- }
-
- if s.ExternalDocs == nil {
- s.ExternalDocs = &ExternalDocumentation{}
- }
- s.ExternalDocs.Description = description
- s.ExternalDocs.URL = url
- return s
-}
-
-// WithXMLName sets the xml name for the object
-func (s *Schema) WithXMLName(name string) *Schema {
- if s.XML == nil {
- s.XML = new(XMLObject)
- }
- s.XML.Name = name
- return s
-}
-
-// WithXMLNamespace sets the xml namespace for the object
-func (s *Schema) WithXMLNamespace(namespace string) *Schema {
- if s.XML == nil {
- s.XML = new(XMLObject)
- }
- s.XML.Namespace = namespace
- return s
-}
-
-// WithXMLPrefix sets the xml prefix for the object
-func (s *Schema) WithXMLPrefix(prefix string) *Schema {
- if s.XML == nil {
- s.XML = new(XMLObject)
- }
- s.XML.Prefix = prefix
- return s
-}
-
-// AsXMLAttribute flags this object as xml attribute
-func (s *Schema) AsXMLAttribute() *Schema {
- if s.XML == nil {
- s.XML = new(XMLObject)
- }
- s.XML.Attribute = true
- return s
-}
-
-// AsXMLElement flags this object as an xml node
-func (s *Schema) AsXMLElement() *Schema {
- if s.XML == nil {
- s.XML = new(XMLObject)
- }
- s.XML.Attribute = false
- return s
-}
-
-// AsWrappedXML flags this object as wrapped, this is mostly useful for array types
-func (s *Schema) AsWrappedXML() *Schema {
- if s.XML == nil {
- s.XML = new(XMLObject)
- }
- s.XML.Wrapped = true
- return s
-}
-
-// AsUnwrappedXML flags this object as an xml node
-func (s *Schema) AsUnwrappedXML() *Schema {
- if s.XML == nil {
- s.XML = new(XMLObject)
- }
- s.XML.Wrapped = false
- return s
-}
-
-// SetValidations defines all schema validations.
-//
-// NOTE: Required, ReadOnly, AllOf, AnyOf, OneOf and Not are not considered.
-func (s *Schema) SetValidations(val SchemaValidations) {
- s.Maximum = val.Maximum
- s.ExclusiveMaximum = val.ExclusiveMaximum
- s.Minimum = val.Minimum
- s.ExclusiveMinimum = val.ExclusiveMinimum
- s.MaxLength = val.MaxLength
- s.MinLength = val.MinLength
- s.Pattern = val.Pattern
- s.MaxItems = val.MaxItems
- s.MinItems = val.MinItems
- s.UniqueItems = val.UniqueItems
- s.MultipleOf = val.MultipleOf
- s.Enum = val.Enum
- s.MinProperties = val.MinProperties
- s.MaxProperties = val.MaxProperties
- s.PatternProperties = val.PatternProperties
-}
-
-// WithValidations is a fluent method to set schema validations
-func (s *Schema) WithValidations(val SchemaValidations) *Schema {
- s.SetValidations(val)
- return s
-}
-
-// Validations returns a clone of the validations for this schema
-func (s Schema) Validations() SchemaValidations {
- return SchemaValidations{
- CommonValidations: CommonValidations{
- Maximum: s.Maximum,
- ExclusiveMaximum: s.ExclusiveMaximum,
- Minimum: s.Minimum,
- ExclusiveMinimum: s.ExclusiveMinimum,
- MaxLength: s.MaxLength,
- MinLength: s.MinLength,
- Pattern: s.Pattern,
- MaxItems: s.MaxItems,
- MinItems: s.MinItems,
- UniqueItems: s.UniqueItems,
- MultipleOf: s.MultipleOf,
- Enum: s.Enum,
- },
- MinProperties: s.MinProperties,
- MaxProperties: s.MaxProperties,
- PatternProperties: s.PatternProperties,
- }
-}
-
-// MarshalJSON marshal this to JSON
-func (s Schema) MarshalJSON() ([]byte, error) {
- b1, err := json.Marshal(s.SchemaProps)
- if err != nil {
- return nil, fmt.Errorf("schema props %v", err)
- }
- b2, err := json.Marshal(s.VendorExtensible)
- if err != nil {
- return nil, fmt.Errorf("vendor props %v", err)
- }
- b3, err := s.Ref.MarshalJSON()
- if err != nil {
- return nil, fmt.Errorf("ref prop %v", err)
- }
- b4, err := s.Schema.MarshalJSON()
- if err != nil {
- return nil, fmt.Errorf("schema prop %v", err)
- }
- b5, err := json.Marshal(s.SwaggerSchemaProps)
- if err != nil {
- return nil, fmt.Errorf("common validations %v", err)
- }
- var b6 []byte
- if s.ExtraProps != nil {
- jj, err := json.Marshal(s.ExtraProps)
- if err != nil {
- return nil, fmt.Errorf("extra props %v", err)
- }
- b6 = jj
- }
- return swag.ConcatJSON(b1, b2, b3, b4, b5, b6), nil
-}
-
-// UnmarshalJSON marshal this from JSON
-func (s *Schema) UnmarshalJSON(data []byte) error {
- props := struct {
- SchemaProps
- SwaggerSchemaProps
- }{}
- if err := json.Unmarshal(data, &props); err != nil {
- return err
- }
-
- sch := Schema{
- SchemaProps: props.SchemaProps,
- SwaggerSchemaProps: props.SwaggerSchemaProps,
- }
-
- var d map[string]interface{}
- if err := json.Unmarshal(data, &d); err != nil {
- return err
- }
-
- _ = sch.Ref.fromMap(d)
- _ = sch.Schema.fromMap(d)
-
- delete(d, "$ref")
- delete(d, "$schema")
- for _, pn := range swag.DefaultJSONNameProvider.GetJSONNames(s) {
- delete(d, pn)
- }
-
- for k, vv := range d {
- lk := strings.ToLower(k)
- if strings.HasPrefix(lk, "x-") {
- if sch.Extensions == nil {
- sch.Extensions = map[string]interface{}{}
- }
- sch.Extensions[k] = vv
- continue
- }
- if sch.ExtraProps == nil {
- sch.ExtraProps = map[string]interface{}{}
- }
- sch.ExtraProps[k] = vv
- }
-
- *s = sch
-
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/schema_loader.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/schema_loader.go
deleted file mode 100644
index 0059b99ae..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/schema_loader.go
+++ /dev/null
@@ -1,331 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package spec
-
-import (
- "encoding/json"
- "fmt"
- "log"
- "net/url"
- "reflect"
- "strings"
-
- "github.com/go-openapi/swag"
-)
-
-// PathLoader is a function to use when loading remote refs.
-//
-// This is a package level default. It may be overridden or bypassed by
-// specifying the loader in ExpandOptions.
-//
-// NOTE: if you are using the go-openapi/loads package, it will override
-// this value with its own default (a loader to retrieve YAML documents as
-// well as JSON ones).
-var PathLoader = func(pth string) (json.RawMessage, error) {
- data, err := swag.LoadFromFileOrHTTP(pth)
- if err != nil {
- return nil, err
- }
- return json.RawMessage(data), nil
-}
-
-// resolverContext allows to share a context during spec processing.
-// At the moment, it just holds the index of circular references found.
-type resolverContext struct {
- // circulars holds all visited circular references, to shortcircuit $ref resolution.
- //
- // This structure is privately instantiated and needs not be locked against
- // concurrent access, unless we chose to implement a parallel spec walking.
- circulars map[string]bool
- basePath string
- loadDoc func(string) (json.RawMessage, error)
- rootID string
-}
-
-func newResolverContext(options *ExpandOptions) *resolverContext {
- expandOptions := optionsOrDefault(options)
-
- // path loader may be overridden by options
- var loader func(string) (json.RawMessage, error)
- if expandOptions.PathLoader == nil {
- loader = PathLoader
- } else {
- loader = expandOptions.PathLoader
- }
-
- return &resolverContext{
- circulars: make(map[string]bool),
- basePath: expandOptions.RelativeBase, // keep the root base path in context
- loadDoc: loader,
- }
-}
-
-type schemaLoader struct {
- root interface{}
- options *ExpandOptions
- cache ResolutionCache
- context *resolverContext
-}
-
-func (r *schemaLoader) transitiveResolver(basePath string, ref Ref) *schemaLoader {
- if ref.IsRoot() || ref.HasFragmentOnly {
- return r
- }
-
- baseRef := MustCreateRef(basePath)
- currentRef := normalizeRef(&ref, basePath)
- if strings.HasPrefix(currentRef.String(), baseRef.String()) {
- return r
- }
-
- // set a new root against which to resolve
- rootURL := currentRef.GetURL()
- rootURL.Fragment = ""
- root, _ := r.cache.Get(rootURL.String())
-
- // shallow copy of resolver options to set a new RelativeBase when
- // traversing multiple documents
- newOptions := r.options
- newOptions.RelativeBase = rootURL.String()
-
- return defaultSchemaLoader(root, newOptions, r.cache, r.context)
-}
-
-func (r *schemaLoader) updateBasePath(transitive *schemaLoader, basePath string) string {
- if transitive != r {
- if transitive.options != nil && transitive.options.RelativeBase != "" {
- return normalizeBase(transitive.options.RelativeBase)
- }
- }
-
- return basePath
-}
-
-func (r *schemaLoader) resolveRef(ref *Ref, target interface{}, basePath string) error {
- tgt := reflect.ValueOf(target)
- if tgt.Kind() != reflect.Ptr {
- return ErrResolveRefNeedsAPointer
- }
-
- if ref.GetURL() == nil {
- return nil
- }
-
- var (
- res interface{}
- data interface{}
- err error
- )
-
- // Resolve against the root if it isn't nil, and if ref is pointing at the root, or has a fragment only which means
- // it is pointing somewhere in the root.
- root := r.root
- if (ref.IsRoot() || ref.HasFragmentOnly) && root == nil && basePath != "" {
- if baseRef, erb := NewRef(basePath); erb == nil {
- root, _, _, _ = r.load(baseRef.GetURL())
- }
- }
-
- if (ref.IsRoot() || ref.HasFragmentOnly) && root != nil {
- data = root
- } else {
- baseRef := normalizeRef(ref, basePath)
- data, _, _, err = r.load(baseRef.GetURL())
- if err != nil {
- return err
- }
- }
-
- res = data
- if ref.String() != "" {
- res, _, err = ref.GetPointer().Get(data)
- if err != nil {
- return err
- }
- }
- return swag.DynamicJSONToStruct(res, target)
-}
-
-func (r *schemaLoader) load(refURL *url.URL) (interface{}, url.URL, bool, error) {
- debugLog("loading schema from url: %s", refURL)
- toFetch := *refURL
- toFetch.Fragment = ""
-
- var err error
- pth := toFetch.String()
- normalized := normalizeBase(pth)
- debugLog("loading doc from: %s", normalized)
-
- data, fromCache := r.cache.Get(normalized)
- if fromCache {
- return data, toFetch, fromCache, nil
- }
-
- b, err := r.context.loadDoc(normalized)
- if err != nil {
- return nil, url.URL{}, false, err
- }
-
- var doc interface{}
- if err := json.Unmarshal(b, &doc); err != nil {
- return nil, url.URL{}, false, err
- }
- r.cache.Set(normalized, doc)
-
- return doc, toFetch, fromCache, nil
-}
-
-// isCircular detects cycles in sequences of $ref.
-//
-// It relies on a private context (which needs not be locked).
-func (r *schemaLoader) isCircular(ref *Ref, basePath string, parentRefs ...string) (foundCycle bool) {
- normalizedRef := normalizeURI(ref.String(), basePath)
- if _, ok := r.context.circulars[normalizedRef]; ok {
- // circular $ref has been already detected in another explored cycle
- foundCycle = true
- return
- }
- foundCycle = swag.ContainsStrings(parentRefs, normalizedRef) // normalized windows url's are lower cased
- if foundCycle {
- r.context.circulars[normalizedRef] = true
- }
- return
-}
-
-// Resolve resolves a reference against basePath and stores the result in target.
-//
-// Resolve is not in charge of following references: it only resolves ref by following its URL.
-//
-// If the schema the ref is referring to holds nested refs, Resolve doesn't resolve them.
-//
-// If basePath is an empty string, ref is resolved against the root schema stored in the schemaLoader struct
-func (r *schemaLoader) Resolve(ref *Ref, target interface{}, basePath string) error {
- return r.resolveRef(ref, target, basePath)
-}
-
-func (r *schemaLoader) deref(input interface{}, parentRefs []string, basePath string) error {
- var ref *Ref
- switch refable := input.(type) {
- case *Schema:
- ref = &refable.Ref
- case *Parameter:
- ref = &refable.Ref
- case *Response:
- ref = &refable.Ref
- case *PathItem:
- ref = &refable.Ref
- default:
- return fmt.Errorf("unsupported type: %T: %w", input, ErrDerefUnsupportedType)
- }
-
- curRef := ref.String()
- if curRef == "" {
- return nil
- }
-
- normalizedRef := normalizeRef(ref, basePath)
- normalizedBasePath := normalizedRef.RemoteURI()
-
- if r.isCircular(normalizedRef, basePath, parentRefs...) {
- return nil
- }
-
- if err := r.resolveRef(ref, input, basePath); r.shouldStopOnError(err) {
- return err
- }
-
- if ref.String() == "" || ref.String() == curRef {
- // done with rereferencing
- return nil
- }
-
- parentRefs = append(parentRefs, normalizedRef.String())
- return r.deref(input, parentRefs, normalizedBasePath)
-}
-
-func (r *schemaLoader) shouldStopOnError(err error) bool {
- if err != nil && !r.options.ContinueOnError {
- return true
- }
-
- if err != nil {
- log.Println(err)
- }
-
- return false
-}
-
-func (r *schemaLoader) setSchemaID(target interface{}, id, basePath string) (string, string) {
- debugLog("schema has ID: %s", id)
-
- // handling the case when id is a folder
- // remember that basePath has to point to a file
- var refPath string
- if strings.HasSuffix(id, "/") {
- // ensure this is detected as a file, not a folder
- refPath = fmt.Sprintf("%s%s", id, "placeholder.json")
- } else {
- refPath = id
- }
-
- // updates the current base path
- // * important: ID can be a relative path
- // * registers target to be fetchable from the new base proposed by this id
- newBasePath := normalizeURI(refPath, basePath)
-
- // store found IDs for possible future reuse in $ref
- r.cache.Set(newBasePath, target)
-
- // the root document has an ID: all $ref relative to that ID may
- // be rebased relative to the root document
- if basePath == r.context.basePath {
- debugLog("root document is a schema with ID: %s (normalized as:%s)", id, newBasePath)
- r.context.rootID = newBasePath
- }
-
- return newBasePath, refPath
-}
-
-func defaultSchemaLoader(
- root interface{},
- expandOptions *ExpandOptions,
- cache ResolutionCache,
- context *resolverContext) *schemaLoader {
-
- if expandOptions == nil {
- expandOptions = &ExpandOptions{}
- }
-
- cache = cacheOrDefault(cache)
-
- if expandOptions.RelativeBase == "" {
- // if no relative base is provided, assume the root document
- // contains all $ref, or at least, that the relative documents
- // may be resolved from the current working directory.
- expandOptions.RelativeBase = baseForRoot(root, cache)
- }
- debugLog("effective expander options: %#v", expandOptions)
-
- if context == nil {
- context = newResolverContext(expandOptions)
- }
-
- return &schemaLoader{
- root: root,
- options: expandOptions,
- cache: cache,
- context: context,
- }
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/schemas/jsonschema-draft-04.json b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/schemas/jsonschema-draft-04.json
deleted file mode 100644
index bcbb84743..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/schemas/jsonschema-draft-04.json
+++ /dev/null
@@ -1,149 +0,0 @@
-{
- "id": "http://json-schema.org/draft-04/schema#",
- "$schema": "http://json-schema.org/draft-04/schema#",
- "description": "Core schema meta-schema",
- "definitions": {
- "schemaArray": {
- "type": "array",
- "minItems": 1,
- "items": { "$ref": "#" }
- },
- "positiveInteger": {
- "type": "integer",
- "minimum": 0
- },
- "positiveIntegerDefault0": {
- "allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]
- },
- "simpleTypes": {
- "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]
- },
- "stringArray": {
- "type": "array",
- "items": { "type": "string" },
- "minItems": 1,
- "uniqueItems": true
- }
- },
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "$schema": {
- "type": "string"
- },
- "title": {
- "type": "string"
- },
- "description": {
- "type": "string"
- },
- "default": {},
- "multipleOf": {
- "type": "number",
- "minimum": 0,
- "exclusiveMinimum": true
- },
- "maximum": {
- "type": "number"
- },
- "exclusiveMaximum": {
- "type": "boolean",
- "default": false
- },
- "minimum": {
- "type": "number"
- },
- "exclusiveMinimum": {
- "type": "boolean",
- "default": false
- },
- "maxLength": { "$ref": "#/definitions/positiveInteger" },
- "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
- "pattern": {
- "type": "string",
- "format": "regex"
- },
- "additionalItems": {
- "anyOf": [
- { "type": "boolean" },
- { "$ref": "#" }
- ],
- "default": {}
- },
- "items": {
- "anyOf": [
- { "$ref": "#" },
- { "$ref": "#/definitions/schemaArray" }
- ],
- "default": {}
- },
- "maxItems": { "$ref": "#/definitions/positiveInteger" },
- "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },
- "uniqueItems": {
- "type": "boolean",
- "default": false
- },
- "maxProperties": { "$ref": "#/definitions/positiveInteger" },
- "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
- "required": { "$ref": "#/definitions/stringArray" },
- "additionalProperties": {
- "anyOf": [
- { "type": "boolean" },
- { "$ref": "#" }
- ],
- "default": {}
- },
- "definitions": {
- "type": "object",
- "additionalProperties": { "$ref": "#" },
- "default": {}
- },
- "properties": {
- "type": "object",
- "additionalProperties": { "$ref": "#" },
- "default": {}
- },
- "patternProperties": {
- "type": "object",
- "additionalProperties": { "$ref": "#" },
- "default": {}
- },
- "dependencies": {
- "type": "object",
- "additionalProperties": {
- "anyOf": [
- { "$ref": "#" },
- { "$ref": "#/definitions/stringArray" }
- ]
- }
- },
- "enum": {
- "type": "array",
- "minItems": 1,
- "uniqueItems": true
- },
- "type": {
- "anyOf": [
- { "$ref": "#/definitions/simpleTypes" },
- {
- "type": "array",
- "items": { "$ref": "#/definitions/simpleTypes" },
- "minItems": 1,
- "uniqueItems": true
- }
- ]
- },
- "format": { "type": "string" },
- "allOf": { "$ref": "#/definitions/schemaArray" },
- "anyOf": { "$ref": "#/definitions/schemaArray" },
- "oneOf": { "$ref": "#/definitions/schemaArray" },
- "not": { "$ref": "#" }
- },
- "dependencies": {
- "exclusiveMaximum": [ "maximum" ],
- "exclusiveMinimum": [ "minimum" ]
- },
- "default": {}
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/schemas/v2/schema.json b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/schemas/v2/schema.json
deleted file mode 100644
index ebe10ed32..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/schemas/v2/schema.json
+++ /dev/null
@@ -1,1607 +0,0 @@
-{
- "title": "A JSON Schema for Swagger 2.0 API.",
- "id": "http://swagger.io/v2/schema.json#",
- "$schema": "http://json-schema.org/draft-04/schema#",
- "type": "object",
- "required": [
- "swagger",
- "info",
- "paths"
- ],
- "additionalProperties": false,
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- },
- "properties": {
- "swagger": {
- "type": "string",
- "enum": [
- "2.0"
- ],
- "description": "The Swagger version of this document."
- },
- "info": {
- "$ref": "#/definitions/info"
- },
- "host": {
- "type": "string",
- "pattern": "^[^{}/ :\\\\]+(?::\\d+)?$",
- "description": "The host (name or ip) of the API. Example: 'swagger.io'"
- },
- "basePath": {
- "type": "string",
- "pattern": "^/",
- "description": "The base path to the API. Example: '/api'."
- },
- "schemes": {
- "$ref": "#/definitions/schemesList"
- },
- "consumes": {
- "description": "A list of MIME types accepted by the API.",
- "allOf": [
- {
- "$ref": "#/definitions/mediaTypeList"
- }
- ]
- },
- "produces": {
- "description": "A list of MIME types the API can produce.",
- "allOf": [
- {
- "$ref": "#/definitions/mediaTypeList"
- }
- ]
- },
- "paths": {
- "$ref": "#/definitions/paths"
- },
- "definitions": {
- "$ref": "#/definitions/definitions"
- },
- "parameters": {
- "$ref": "#/definitions/parameterDefinitions"
- },
- "responses": {
- "$ref": "#/definitions/responseDefinitions"
- },
- "security": {
- "$ref": "#/definitions/security"
- },
- "securityDefinitions": {
- "$ref": "#/definitions/securityDefinitions"
- },
- "tags": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/tag"
- },
- "uniqueItems": true
- },
- "externalDocs": {
- "$ref": "#/definitions/externalDocs"
- }
- },
- "definitions": {
- "info": {
- "type": "object",
- "description": "General information about the API.",
- "required": [
- "version",
- "title"
- ],
- "additionalProperties": false,
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- },
- "properties": {
- "title": {
- "type": "string",
- "description": "A unique and precise title of the API."
- },
- "version": {
- "type": "string",
- "description": "A semantic version number of the API."
- },
- "description": {
- "type": "string",
- "description": "A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed."
- },
- "termsOfService": {
- "type": "string",
- "description": "The terms of service for the API."
- },
- "contact": {
- "$ref": "#/definitions/contact"
- },
- "license": {
- "$ref": "#/definitions/license"
- }
- }
- },
- "contact": {
- "type": "object",
- "description": "Contact information for the owners of the API.",
- "additionalProperties": false,
- "properties": {
- "name": {
- "type": "string",
- "description": "The identifying name of the contact person/organization."
- },
- "url": {
- "type": "string",
- "description": "The URL pointing to the contact information.",
- "format": "uri"
- },
- "email": {
- "type": "string",
- "description": "The email address of the contact person/organization.",
- "format": "email"
- }
- },
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "license": {
- "type": "object",
- "required": [
- "name"
- ],
- "additionalProperties": false,
- "properties": {
- "name": {
- "type": "string",
- "description": "The name of the license type. It's encouraged to use an OSI compatible license."
- },
- "url": {
- "type": "string",
- "description": "The URL pointing to the license.",
- "format": "uri"
- }
- },
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "paths": {
- "type": "object",
- "description": "Relative paths to the individual endpoints. They must be relative to the 'basePath'.",
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- },
- "^/": {
- "$ref": "#/definitions/pathItem"
- }
- },
- "additionalProperties": false
- },
- "definitions": {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/definitions/schema"
- },
- "description": "One or more JSON objects describing the schemas being consumed and produced by the API."
- },
- "parameterDefinitions": {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/definitions/parameter"
- },
- "description": "One or more JSON representations for parameters"
- },
- "responseDefinitions": {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/definitions/response"
- },
- "description": "One or more JSON representations for responses"
- },
- "externalDocs": {
- "type": "object",
- "additionalProperties": false,
- "description": "information about external documentation",
- "required": [
- "url"
- ],
- "properties": {
- "description": {
- "type": "string"
- },
- "url": {
- "type": "string",
- "format": "uri"
- }
- },
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "examples": {
- "type": "object",
- "additionalProperties": true
- },
- "mimeType": {
- "type": "string",
- "description": "The MIME type of the HTTP message."
- },
- "operation": {
- "type": "object",
- "required": [
- "responses"
- ],
- "additionalProperties": false,
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- },
- "properties": {
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "uniqueItems": true
- },
- "summary": {
- "type": "string",
- "description": "A brief summary of the operation."
- },
- "description": {
- "type": "string",
- "description": "A longer description of the operation, GitHub Flavored Markdown is allowed."
- },
- "externalDocs": {
- "$ref": "#/definitions/externalDocs"
- },
- "operationId": {
- "type": "string",
- "description": "A unique identifier of the operation."
- },
- "produces": {
- "description": "A list of MIME types the API can produce.",
- "allOf": [
- {
- "$ref": "#/definitions/mediaTypeList"
- }
- ]
- },
- "consumes": {
- "description": "A list of MIME types the API can consume.",
- "allOf": [
- {
- "$ref": "#/definitions/mediaTypeList"
- }
- ]
- },
- "parameters": {
- "$ref": "#/definitions/parametersList"
- },
- "responses": {
- "$ref": "#/definitions/responses"
- },
- "schemes": {
- "$ref": "#/definitions/schemesList"
- },
- "deprecated": {
- "type": "boolean",
- "default": false
- },
- "security": {
- "$ref": "#/definitions/security"
- }
- }
- },
- "pathItem": {
- "type": "object",
- "additionalProperties": false,
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- },
- "properties": {
- "$ref": {
- "type": "string"
- },
- "get": {
- "$ref": "#/definitions/operation"
- },
- "put": {
- "$ref": "#/definitions/operation"
- },
- "post": {
- "$ref": "#/definitions/operation"
- },
- "delete": {
- "$ref": "#/definitions/operation"
- },
- "options": {
- "$ref": "#/definitions/operation"
- },
- "head": {
- "$ref": "#/definitions/operation"
- },
- "patch": {
- "$ref": "#/definitions/operation"
- },
- "parameters": {
- "$ref": "#/definitions/parametersList"
- }
- }
- },
- "responses": {
- "type": "object",
- "description": "Response objects names can either be any valid HTTP status code or 'default'.",
- "minProperties": 1,
- "additionalProperties": false,
- "patternProperties": {
- "^([0-9]{3})$|^(default)$": {
- "$ref": "#/definitions/responseValue"
- },
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- },
- "not": {
- "type": "object",
- "additionalProperties": false,
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- }
- },
- "responseValue": {
- "oneOf": [
- {
- "$ref": "#/definitions/response"
- },
- {
- "$ref": "#/definitions/jsonReference"
- }
- ]
- },
- "response": {
- "type": "object",
- "required": [
- "description"
- ],
- "properties": {
- "description": {
- "type": "string"
- },
- "schema": {
- "oneOf": [
- {
- "$ref": "#/definitions/schema"
- },
- {
- "$ref": "#/definitions/fileSchema"
- }
- ]
- },
- "headers": {
- "$ref": "#/definitions/headers"
- },
- "examples": {
- "$ref": "#/definitions/examples"
- }
- },
- "additionalProperties": false,
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "headers": {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/definitions/header"
- }
- },
- "header": {
- "type": "object",
- "additionalProperties": false,
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "string",
- "number",
- "integer",
- "boolean",
- "array"
- ]
- },
- "format": {
- "type": "string"
- },
- "items": {
- "$ref": "#/definitions/primitivesItems"
- },
- "collectionFormat": {
- "$ref": "#/definitions/collectionFormat"
- },
- "default": {
- "$ref": "#/definitions/default"
- },
- "maximum": {
- "$ref": "#/definitions/maximum"
- },
- "exclusiveMaximum": {
- "$ref": "#/definitions/exclusiveMaximum"
- },
- "minimum": {
- "$ref": "#/definitions/minimum"
- },
- "exclusiveMinimum": {
- "$ref": "#/definitions/exclusiveMinimum"
- },
- "maxLength": {
- "$ref": "#/definitions/maxLength"
- },
- "minLength": {
- "$ref": "#/definitions/minLength"
- },
- "pattern": {
- "$ref": "#/definitions/pattern"
- },
- "maxItems": {
- "$ref": "#/definitions/maxItems"
- },
- "minItems": {
- "$ref": "#/definitions/minItems"
- },
- "uniqueItems": {
- "$ref": "#/definitions/uniqueItems"
- },
- "enum": {
- "$ref": "#/definitions/enum"
- },
- "multipleOf": {
- "$ref": "#/definitions/multipleOf"
- },
- "description": {
- "type": "string"
- }
- },
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "vendorExtension": {
- "description": "Any property starting with x- is valid.",
- "additionalProperties": true,
- "additionalItems": true
- },
- "bodyParameter": {
- "type": "object",
- "required": [
- "name",
- "in",
- "schema"
- ],
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- },
- "properties": {
- "description": {
- "type": "string",
- "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
- },
- "name": {
- "type": "string",
- "description": "The name of the parameter."
- },
- "in": {
- "type": "string",
- "description": "Determines the location of the parameter.",
- "enum": [
- "body"
- ]
- },
- "required": {
- "type": "boolean",
- "description": "Determines whether or not this parameter is required or optional.",
- "default": false
- },
- "schema": {
- "$ref": "#/definitions/schema"
- }
- },
- "additionalProperties": false
- },
- "headerParameterSubSchema": {
- "additionalProperties": false,
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- },
- "properties": {
- "required": {
- "type": "boolean",
- "description": "Determines whether or not this parameter is required or optional.",
- "default": false
- },
- "in": {
- "type": "string",
- "description": "Determines the location of the parameter.",
- "enum": [
- "header"
- ]
- },
- "description": {
- "type": "string",
- "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
- },
- "name": {
- "type": "string",
- "description": "The name of the parameter."
- },
- "type": {
- "type": "string",
- "enum": [
- "string",
- "number",
- "boolean",
- "integer",
- "array"
- ]
- },
- "format": {
- "type": "string"
- },
- "items": {
- "$ref": "#/definitions/primitivesItems"
- },
- "collectionFormat": {
- "$ref": "#/definitions/collectionFormat"
- },
- "default": {
- "$ref": "#/definitions/default"
- },
- "maximum": {
- "$ref": "#/definitions/maximum"
- },
- "exclusiveMaximum": {
- "$ref": "#/definitions/exclusiveMaximum"
- },
- "minimum": {
- "$ref": "#/definitions/minimum"
- },
- "exclusiveMinimum": {
- "$ref": "#/definitions/exclusiveMinimum"
- },
- "maxLength": {
- "$ref": "#/definitions/maxLength"
- },
- "minLength": {
- "$ref": "#/definitions/minLength"
- },
- "pattern": {
- "$ref": "#/definitions/pattern"
- },
- "maxItems": {
- "$ref": "#/definitions/maxItems"
- },
- "minItems": {
- "$ref": "#/definitions/minItems"
- },
- "uniqueItems": {
- "$ref": "#/definitions/uniqueItems"
- },
- "enum": {
- "$ref": "#/definitions/enum"
- },
- "multipleOf": {
- "$ref": "#/definitions/multipleOf"
- }
- }
- },
- "queryParameterSubSchema": {
- "additionalProperties": false,
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- },
- "properties": {
- "required": {
- "type": "boolean",
- "description": "Determines whether or not this parameter is required or optional.",
- "default": false
- },
- "in": {
- "type": "string",
- "description": "Determines the location of the parameter.",
- "enum": [
- "query"
- ]
- },
- "description": {
- "type": "string",
- "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
- },
- "name": {
- "type": "string",
- "description": "The name of the parameter."
- },
- "allowEmptyValue": {
- "type": "boolean",
- "default": false,
- "description": "allows sending a parameter by name only or with an empty value."
- },
- "type": {
- "type": "string",
- "enum": [
- "string",
- "number",
- "boolean",
- "integer",
- "array"
- ]
- },
- "format": {
- "type": "string"
- },
- "items": {
- "$ref": "#/definitions/primitivesItems"
- },
- "collectionFormat": {
- "$ref": "#/definitions/collectionFormatWithMulti"
- },
- "default": {
- "$ref": "#/definitions/default"
- },
- "maximum": {
- "$ref": "#/definitions/maximum"
- },
- "exclusiveMaximum": {
- "$ref": "#/definitions/exclusiveMaximum"
- },
- "minimum": {
- "$ref": "#/definitions/minimum"
- },
- "exclusiveMinimum": {
- "$ref": "#/definitions/exclusiveMinimum"
- },
- "maxLength": {
- "$ref": "#/definitions/maxLength"
- },
- "minLength": {
- "$ref": "#/definitions/minLength"
- },
- "pattern": {
- "$ref": "#/definitions/pattern"
- },
- "maxItems": {
- "$ref": "#/definitions/maxItems"
- },
- "minItems": {
- "$ref": "#/definitions/minItems"
- },
- "uniqueItems": {
- "$ref": "#/definitions/uniqueItems"
- },
- "enum": {
- "$ref": "#/definitions/enum"
- },
- "multipleOf": {
- "$ref": "#/definitions/multipleOf"
- }
- }
- },
- "formDataParameterSubSchema": {
- "additionalProperties": false,
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- },
- "properties": {
- "required": {
- "type": "boolean",
- "description": "Determines whether or not this parameter is required or optional.",
- "default": false
- },
- "in": {
- "type": "string",
- "description": "Determines the location of the parameter.",
- "enum": [
- "formData"
- ]
- },
- "description": {
- "type": "string",
- "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
- },
- "name": {
- "type": "string",
- "description": "The name of the parameter."
- },
- "allowEmptyValue": {
- "type": "boolean",
- "default": false,
- "description": "allows sending a parameter by name only or with an empty value."
- },
- "type": {
- "type": "string",
- "enum": [
- "string",
- "number",
- "boolean",
- "integer",
- "array",
- "file"
- ]
- },
- "format": {
- "type": "string"
- },
- "items": {
- "$ref": "#/definitions/primitivesItems"
- },
- "collectionFormat": {
- "$ref": "#/definitions/collectionFormatWithMulti"
- },
- "default": {
- "$ref": "#/definitions/default"
- },
- "maximum": {
- "$ref": "#/definitions/maximum"
- },
- "exclusiveMaximum": {
- "$ref": "#/definitions/exclusiveMaximum"
- },
- "minimum": {
- "$ref": "#/definitions/minimum"
- },
- "exclusiveMinimum": {
- "$ref": "#/definitions/exclusiveMinimum"
- },
- "maxLength": {
- "$ref": "#/definitions/maxLength"
- },
- "minLength": {
- "$ref": "#/definitions/minLength"
- },
- "pattern": {
- "$ref": "#/definitions/pattern"
- },
- "maxItems": {
- "$ref": "#/definitions/maxItems"
- },
- "minItems": {
- "$ref": "#/definitions/minItems"
- },
- "uniqueItems": {
- "$ref": "#/definitions/uniqueItems"
- },
- "enum": {
- "$ref": "#/definitions/enum"
- },
- "multipleOf": {
- "$ref": "#/definitions/multipleOf"
- }
- }
- },
- "pathParameterSubSchema": {
- "additionalProperties": false,
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- },
- "required": [
- "required"
- ],
- "properties": {
- "required": {
- "type": "boolean",
- "enum": [
- true
- ],
- "description": "Determines whether or not this parameter is required or optional."
- },
- "in": {
- "type": "string",
- "description": "Determines the location of the parameter.",
- "enum": [
- "path"
- ]
- },
- "description": {
- "type": "string",
- "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
- },
- "name": {
- "type": "string",
- "description": "The name of the parameter."
- },
- "type": {
- "type": "string",
- "enum": [
- "string",
- "number",
- "boolean",
- "integer",
- "array"
- ]
- },
- "format": {
- "type": "string"
- },
- "items": {
- "$ref": "#/definitions/primitivesItems"
- },
- "collectionFormat": {
- "$ref": "#/definitions/collectionFormat"
- },
- "default": {
- "$ref": "#/definitions/default"
- },
- "maximum": {
- "$ref": "#/definitions/maximum"
- },
- "exclusiveMaximum": {
- "$ref": "#/definitions/exclusiveMaximum"
- },
- "minimum": {
- "$ref": "#/definitions/minimum"
- },
- "exclusiveMinimum": {
- "$ref": "#/definitions/exclusiveMinimum"
- },
- "maxLength": {
- "$ref": "#/definitions/maxLength"
- },
- "minLength": {
- "$ref": "#/definitions/minLength"
- },
- "pattern": {
- "$ref": "#/definitions/pattern"
- },
- "maxItems": {
- "$ref": "#/definitions/maxItems"
- },
- "minItems": {
- "$ref": "#/definitions/minItems"
- },
- "uniqueItems": {
- "$ref": "#/definitions/uniqueItems"
- },
- "enum": {
- "$ref": "#/definitions/enum"
- },
- "multipleOf": {
- "$ref": "#/definitions/multipleOf"
- }
- }
- },
- "nonBodyParameter": {
- "type": "object",
- "required": [
- "name",
- "in",
- "type"
- ],
- "oneOf": [
- {
- "$ref": "#/definitions/headerParameterSubSchema"
- },
- {
- "$ref": "#/definitions/formDataParameterSubSchema"
- },
- {
- "$ref": "#/definitions/queryParameterSubSchema"
- },
- {
- "$ref": "#/definitions/pathParameterSubSchema"
- }
- ]
- },
- "parameter": {
- "oneOf": [
- {
- "$ref": "#/definitions/bodyParameter"
- },
- {
- "$ref": "#/definitions/nonBodyParameter"
- }
- ]
- },
- "schema": {
- "type": "object",
- "description": "A deterministic version of a JSON Schema object.",
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- },
- "properties": {
- "$ref": {
- "type": "string"
- },
- "format": {
- "type": "string"
- },
- "title": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/title"
- },
- "description": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/description"
- },
- "default": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/default"
- },
- "multipleOf": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/multipleOf"
- },
- "maximum": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/maximum"
- },
- "exclusiveMaximum": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"
- },
- "minimum": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/minimum"
- },
- "exclusiveMinimum": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"
- },
- "maxLength": {
- "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
- },
- "minLength": {
- "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
- },
- "pattern": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/pattern"
- },
- "maxItems": {
- "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
- },
- "minItems": {
- "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
- },
- "uniqueItems": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/uniqueItems"
- },
- "maxProperties": {
- "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
- },
- "minProperties": {
- "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
- },
- "required": {
- "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray"
- },
- "enum": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/enum"
- },
- "additionalProperties": {
- "anyOf": [
- {
- "$ref": "#/definitions/schema"
- },
- {
- "type": "boolean"
- }
- ],
- "default": {}
- },
- "type": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/type"
- },
- "items": {
- "anyOf": [
- {
- "$ref": "#/definitions/schema"
- },
- {
- "type": "array",
- "minItems": 1,
- "items": {
- "$ref": "#/definitions/schema"
- }
- }
- ],
- "default": {}
- },
- "allOf": {
- "type": "array",
- "minItems": 1,
- "items": {
- "$ref": "#/definitions/schema"
- }
- },
- "properties": {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/definitions/schema"
- },
- "default": {}
- },
- "discriminator": {
- "type": "string"
- },
- "readOnly": {
- "type": "boolean",
- "default": false
- },
- "xml": {
- "$ref": "#/definitions/xml"
- },
- "externalDocs": {
- "$ref": "#/definitions/externalDocs"
- },
- "example": {}
- },
- "additionalProperties": false
- },
- "fileSchema": {
- "type": "object",
- "description": "A deterministic version of a JSON Schema object.",
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- },
- "required": [
- "type"
- ],
- "properties": {
- "format": {
- "type": "string"
- },
- "title": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/title"
- },
- "description": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/description"
- },
- "default": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/default"
- },
- "required": {
- "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray"
- },
- "type": {
- "type": "string",
- "enum": [
- "file"
- ]
- },
- "readOnly": {
- "type": "boolean",
- "default": false
- },
- "externalDocs": {
- "$ref": "#/definitions/externalDocs"
- },
- "example": {}
- },
- "additionalProperties": false
- },
- "primitivesItems": {
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "string",
- "number",
- "integer",
- "boolean",
- "array"
- ]
- },
- "format": {
- "type": "string"
- },
- "items": {
- "$ref": "#/definitions/primitivesItems"
- },
- "collectionFormat": {
- "$ref": "#/definitions/collectionFormat"
- },
- "default": {
- "$ref": "#/definitions/default"
- },
- "maximum": {
- "$ref": "#/definitions/maximum"
- },
- "exclusiveMaximum": {
- "$ref": "#/definitions/exclusiveMaximum"
- },
- "minimum": {
- "$ref": "#/definitions/minimum"
- },
- "exclusiveMinimum": {
- "$ref": "#/definitions/exclusiveMinimum"
- },
- "maxLength": {
- "$ref": "#/definitions/maxLength"
- },
- "minLength": {
- "$ref": "#/definitions/minLength"
- },
- "pattern": {
- "$ref": "#/definitions/pattern"
- },
- "maxItems": {
- "$ref": "#/definitions/maxItems"
- },
- "minItems": {
- "$ref": "#/definitions/minItems"
- },
- "uniqueItems": {
- "$ref": "#/definitions/uniqueItems"
- },
- "enum": {
- "$ref": "#/definitions/enum"
- },
- "multipleOf": {
- "$ref": "#/definitions/multipleOf"
- }
- },
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "security": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/securityRequirement"
- },
- "uniqueItems": true
- },
- "securityRequirement": {
- "type": "object",
- "additionalProperties": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "uniqueItems": true
- }
- },
- "xml": {
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "name": {
- "type": "string"
- },
- "namespace": {
- "type": "string"
- },
- "prefix": {
- "type": "string"
- },
- "attribute": {
- "type": "boolean",
- "default": false
- },
- "wrapped": {
- "type": "boolean",
- "default": false
- }
- },
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "tag": {
- "type": "object",
- "additionalProperties": false,
- "required": [
- "name"
- ],
- "properties": {
- "name": {
- "type": "string"
- },
- "description": {
- "type": "string"
- },
- "externalDocs": {
- "$ref": "#/definitions/externalDocs"
- }
- },
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "securityDefinitions": {
- "type": "object",
- "additionalProperties": {
- "oneOf": [
- {
- "$ref": "#/definitions/basicAuthenticationSecurity"
- },
- {
- "$ref": "#/definitions/apiKeySecurity"
- },
- {
- "$ref": "#/definitions/oauth2ImplicitSecurity"
- },
- {
- "$ref": "#/definitions/oauth2PasswordSecurity"
- },
- {
- "$ref": "#/definitions/oauth2ApplicationSecurity"
- },
- {
- "$ref": "#/definitions/oauth2AccessCodeSecurity"
- }
- ]
- }
- },
- "basicAuthenticationSecurity": {
- "type": "object",
- "additionalProperties": false,
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "basic"
- ]
- },
- "description": {
- "type": "string"
- }
- },
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "apiKeySecurity": {
- "type": "object",
- "additionalProperties": false,
- "required": [
- "type",
- "name",
- "in"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "apiKey"
- ]
- },
- "name": {
- "type": "string"
- },
- "in": {
- "type": "string",
- "enum": [
- "header",
- "query"
- ]
- },
- "description": {
- "type": "string"
- }
- },
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "oauth2ImplicitSecurity": {
- "type": "object",
- "additionalProperties": false,
- "required": [
- "type",
- "flow",
- "authorizationUrl"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "oauth2"
- ]
- },
- "flow": {
- "type": "string",
- "enum": [
- "implicit"
- ]
- },
- "scopes": {
- "$ref": "#/definitions/oauth2Scopes"
- },
- "authorizationUrl": {
- "type": "string",
- "format": "uri"
- },
- "description": {
- "type": "string"
- }
- },
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "oauth2PasswordSecurity": {
- "type": "object",
- "additionalProperties": false,
- "required": [
- "type",
- "flow",
- "tokenUrl"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "oauth2"
- ]
- },
- "flow": {
- "type": "string",
- "enum": [
- "password"
- ]
- },
- "scopes": {
- "$ref": "#/definitions/oauth2Scopes"
- },
- "tokenUrl": {
- "type": "string",
- "format": "uri"
- },
- "description": {
- "type": "string"
- }
- },
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "oauth2ApplicationSecurity": {
- "type": "object",
- "additionalProperties": false,
- "required": [
- "type",
- "flow",
- "tokenUrl"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "oauth2"
- ]
- },
- "flow": {
- "type": "string",
- "enum": [
- "application"
- ]
- },
- "scopes": {
- "$ref": "#/definitions/oauth2Scopes"
- },
- "tokenUrl": {
- "type": "string",
- "format": "uri"
- },
- "description": {
- "type": "string"
- }
- },
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "oauth2AccessCodeSecurity": {
- "type": "object",
- "additionalProperties": false,
- "required": [
- "type",
- "flow",
- "authorizationUrl",
- "tokenUrl"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "oauth2"
- ]
- },
- "flow": {
- "type": "string",
- "enum": [
- "accessCode"
- ]
- },
- "scopes": {
- "$ref": "#/definitions/oauth2Scopes"
- },
- "authorizationUrl": {
- "type": "string",
- "format": "uri"
- },
- "tokenUrl": {
- "type": "string",
- "format": "uri"
- },
- "description": {
- "type": "string"
- }
- },
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "oauth2Scopes": {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
- },
- "mediaTypeList": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/mimeType"
- },
- "uniqueItems": true
- },
- "parametersList": {
- "type": "array",
- "description": "The parameters needed to send a valid API call.",
- "additionalItems": false,
- "items": {
- "oneOf": [
- {
- "$ref": "#/definitions/parameter"
- },
- {
- "$ref": "#/definitions/jsonReference"
- }
- ]
- },
- "uniqueItems": true
- },
- "schemesList": {
- "type": "array",
- "description": "The transfer protocol of the API.",
- "items": {
- "type": "string",
- "enum": [
- "http",
- "https",
- "ws",
- "wss"
- ]
- },
- "uniqueItems": true
- },
- "collectionFormat": {
- "type": "string",
- "enum": [
- "csv",
- "ssv",
- "tsv",
- "pipes"
- ],
- "default": "csv"
- },
- "collectionFormatWithMulti": {
- "type": "string",
- "enum": [
- "csv",
- "ssv",
- "tsv",
- "pipes",
- "multi"
- ],
- "default": "csv"
- },
- "title": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/title"
- },
- "description": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/description"
- },
- "default": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/default"
- },
- "multipleOf": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/multipleOf"
- },
- "maximum": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/maximum"
- },
- "exclusiveMaximum": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"
- },
- "minimum": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/minimum"
- },
- "exclusiveMinimum": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"
- },
- "maxLength": {
- "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
- },
- "minLength": {
- "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
- },
- "pattern": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/pattern"
- },
- "maxItems": {
- "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
- },
- "minItems": {
- "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
- },
- "uniqueItems": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/uniqueItems"
- },
- "enum": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/enum"
- },
- "jsonReference": {
- "type": "object",
- "required": [
- "$ref"
- ],
- "additionalProperties": false,
- "properties": {
- "$ref": {
- "type": "string"
- }
- }
- }
- }
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/security_scheme.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/security_scheme.go
deleted file mode 100644
index 9d0bdae90..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/security_scheme.go
+++ /dev/null
@@ -1,170 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package spec
-
-import (
- "encoding/json"
-
- "github.com/go-openapi/jsonpointer"
- "github.com/go-openapi/swag"
-)
-
-const (
- basic = "basic"
- apiKey = "apiKey"
- oauth2 = "oauth2"
- implicit = "implicit"
- password = "password"
- application = "application"
- accessCode = "accessCode"
-)
-
-// BasicAuth creates a basic auth security scheme
-func BasicAuth() *SecurityScheme {
- return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{Type: basic}}
-}
-
-// APIKeyAuth creates an api key auth security scheme
-func APIKeyAuth(fieldName, valueSource string) *SecurityScheme {
- return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{Type: apiKey, Name: fieldName, In: valueSource}}
-}
-
-// OAuth2Implicit creates an implicit flow oauth2 security scheme
-func OAuth2Implicit(authorizationURL string) *SecurityScheme {
- return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{
- Type: oauth2,
- Flow: implicit,
- AuthorizationURL: authorizationURL,
- }}
-}
-
-// OAuth2Password creates a password flow oauth2 security scheme
-func OAuth2Password(tokenURL string) *SecurityScheme {
- return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{
- Type: oauth2,
- Flow: password,
- TokenURL: tokenURL,
- }}
-}
-
-// OAuth2Application creates an application flow oauth2 security scheme
-func OAuth2Application(tokenURL string) *SecurityScheme {
- return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{
- Type: oauth2,
- Flow: application,
- TokenURL: tokenURL,
- }}
-}
-
-// OAuth2AccessToken creates an access token flow oauth2 security scheme
-func OAuth2AccessToken(authorizationURL, tokenURL string) *SecurityScheme {
- return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{
- Type: oauth2,
- Flow: accessCode,
- AuthorizationURL: authorizationURL,
- TokenURL: tokenURL,
- }}
-}
-
-// SecuritySchemeProps describes a swagger security scheme in the securityDefinitions section
-type SecuritySchemeProps struct {
- Description string `json:"description,omitempty"`
- Type string `json:"type"`
- Name string `json:"name,omitempty"` // api key
- In string `json:"in,omitempty"` // api key
- Flow string `json:"flow,omitempty"` // oauth2
- AuthorizationURL string `json:"authorizationUrl"` // oauth2
- TokenURL string `json:"tokenUrl,omitempty"` // oauth2
- Scopes map[string]string `json:"scopes,omitempty"` // oauth2
-}
-
-// AddScope adds a scope to this security scheme
-func (s *SecuritySchemeProps) AddScope(scope, description string) {
- if s.Scopes == nil {
- s.Scopes = make(map[string]string)
- }
- s.Scopes[scope] = description
-}
-
-// SecurityScheme allows the definition of a security scheme that can be used by the operations.
-// Supported schemes are basic authentication, an API key (either as a header or as a query parameter)
-// and OAuth2's common flows (implicit, password, application and access code).
-//
-// For more information: http://goo.gl/8us55a#securitySchemeObject
-type SecurityScheme struct {
- VendorExtensible
- SecuritySchemeProps
-}
-
-// JSONLookup implements an interface to customize json pointer lookup
-func (s SecurityScheme) JSONLookup(token string) (interface{}, error) {
- if ex, ok := s.Extensions[token]; ok {
- return &ex, nil
- }
-
- r, _, err := jsonpointer.GetForToken(s.SecuritySchemeProps, token)
- return r, err
-}
-
-// MarshalJSON marshal this to JSON
-func (s SecurityScheme) MarshalJSON() ([]byte, error) {
- var (
- b1 []byte
- err error
- )
-
- if s.Type == oauth2 && (s.Flow == "implicit" || s.Flow == "accessCode") {
- // when oauth2 for implicit or accessCode flows, empty AuthorizationURL is added as empty string
- b1, err = json.Marshal(s.SecuritySchemeProps)
- } else {
- // when not oauth2, empty AuthorizationURL should be omitted
- b1, err = json.Marshal(struct {
- Description string `json:"description,omitempty"`
- Type string `json:"type"`
- Name string `json:"name,omitempty"` // api key
- In string `json:"in,omitempty"` // api key
- Flow string `json:"flow,omitempty"` // oauth2
- AuthorizationURL string `json:"authorizationUrl,omitempty"` // oauth2
- TokenURL string `json:"tokenUrl,omitempty"` // oauth2
- Scopes map[string]string `json:"scopes,omitempty"` // oauth2
- }{
- Description: s.Description,
- Type: s.Type,
- Name: s.Name,
- In: s.In,
- Flow: s.Flow,
- AuthorizationURL: s.AuthorizationURL,
- TokenURL: s.TokenURL,
- Scopes: s.Scopes,
- })
- }
- if err != nil {
- return nil, err
- }
-
- b2, err := json.Marshal(s.VendorExtensible)
- if err != nil {
- return nil, err
- }
- return swag.ConcatJSON(b1, b2), nil
-}
-
-// UnmarshalJSON marshal this from JSON
-func (s *SecurityScheme) UnmarshalJSON(data []byte) error {
- if err := json.Unmarshal(data, &s.SecuritySchemeProps); err != nil {
- return err
- }
- return json.Unmarshal(data, &s.VendorExtensible)
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/spec.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/spec.go
deleted file mode 100644
index 876aa1275..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/spec.go
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package spec
-
-import (
- "encoding/json"
-)
-
-//go:generate curl -L --progress -o ./schemas/v2/schema.json http://swagger.io/v2/schema.json
-//go:generate curl -L --progress -o ./schemas/jsonschema-draft-04.json http://json-schema.org/draft-04/schema
-//go:generate go-bindata -pkg=spec -prefix=./schemas -ignore=.*\.md ./schemas/...
-//go:generate perl -pi -e s,Json,JSON,g bindata.go
-
-const (
- // SwaggerSchemaURL the url for the swagger 2.0 schema to validate specs
- SwaggerSchemaURL = "http://swagger.io/v2/schema.json#"
- // JSONSchemaURL the url for the json schema
- JSONSchemaURL = "http://json-schema.org/draft-04/schema#"
-)
-
-// MustLoadJSONSchemaDraft04 panics when Swagger20Schema returns an error
-func MustLoadJSONSchemaDraft04() *Schema {
- d, e := JSONSchemaDraft04()
- if e != nil {
- panic(e)
- }
- return d
-}
-
-// JSONSchemaDraft04 loads the json schema document for json shema draft04
-func JSONSchemaDraft04() (*Schema, error) {
- b, err := jsonschemaDraft04JSONBytes()
- if err != nil {
- return nil, err
- }
-
- schema := new(Schema)
- if err := json.Unmarshal(b, schema); err != nil {
- return nil, err
- }
- return schema, nil
-}
-
-// MustLoadSwagger20Schema panics when Swagger20Schema returns an error
-func MustLoadSwagger20Schema() *Schema {
- d, e := Swagger20Schema()
- if e != nil {
- panic(e)
- }
- return d
-}
-
-// Swagger20Schema loads the swagger 2.0 schema from the embedded assets
-func Swagger20Schema() (*Schema, error) {
-
- b, err := v2SchemaJSONBytes()
- if err != nil {
- return nil, err
- }
-
- schema := new(Schema)
- if err := json.Unmarshal(b, schema); err != nil {
- return nil, err
- }
- return schema, nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/swagger.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/swagger.go
deleted file mode 100644
index 1590fd175..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/swagger.go
+++ /dev/null
@@ -1,448 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package spec
-
-import (
- "bytes"
- "encoding/gob"
- "encoding/json"
- "fmt"
- "strconv"
-
- "github.com/go-openapi/jsonpointer"
- "github.com/go-openapi/swag"
-)
-
-// Swagger this is the root document object for the API specification.
-// It combines what previously was the Resource Listing and API Declaration (version 1.2 and earlier)
-// together into one document.
-//
-// For more information: http://goo.gl/8us55a#swagger-object-
-type Swagger struct {
- VendorExtensible
- SwaggerProps
-}
-
-// JSONLookup look up a value by the json property name
-func (s Swagger) JSONLookup(token string) (interface{}, error) {
- if ex, ok := s.Extensions[token]; ok {
- return &ex, nil
- }
- r, _, err := jsonpointer.GetForToken(s.SwaggerProps, token)
- return r, err
-}
-
-// MarshalJSON marshals this swagger structure to json
-func (s Swagger) MarshalJSON() ([]byte, error) {
- b1, err := json.Marshal(s.SwaggerProps)
- if err != nil {
- return nil, err
- }
- b2, err := json.Marshal(s.VendorExtensible)
- if err != nil {
- return nil, err
- }
- return swag.ConcatJSON(b1, b2), nil
-}
-
-// UnmarshalJSON unmarshals a swagger spec from json
-func (s *Swagger) UnmarshalJSON(data []byte) error {
- var sw Swagger
- if err := json.Unmarshal(data, &sw.SwaggerProps); err != nil {
- return err
- }
- if err := json.Unmarshal(data, &sw.VendorExtensible); err != nil {
- return err
- }
- *s = sw
- return nil
-}
-
-// GobEncode provides a safe gob encoder for Swagger, including extensions
-func (s Swagger) GobEncode() ([]byte, error) {
- var b bytes.Buffer
- raw := struct {
- Props SwaggerProps
- Ext VendorExtensible
- }{
- Props: s.SwaggerProps,
- Ext: s.VendorExtensible,
- }
- err := gob.NewEncoder(&b).Encode(raw)
- return b.Bytes(), err
-}
-
-// GobDecode provides a safe gob decoder for Swagger, including extensions
-func (s *Swagger) GobDecode(b []byte) error {
- var raw struct {
- Props SwaggerProps
- Ext VendorExtensible
- }
- buf := bytes.NewBuffer(b)
- err := gob.NewDecoder(buf).Decode(&raw)
- if err != nil {
- return err
- }
- s.SwaggerProps = raw.Props
- s.VendorExtensible = raw.Ext
- return nil
-}
-
-// SwaggerProps captures the top-level properties of an Api specification
-//
-// NOTE: validation rules
-// - the scheme, when present must be from [http, https, ws, wss]
-// - BasePath must start with a leading "/"
-// - Paths is required
-type SwaggerProps struct {
- ID string `json:"id,omitempty"`
- Consumes []string `json:"consumes,omitempty"`
- Produces []string `json:"produces,omitempty"`
- Schemes []string `json:"schemes,omitempty"`
- Swagger string `json:"swagger,omitempty"`
- Info *Info `json:"info,omitempty"`
- Host string `json:"host,omitempty"`
- BasePath string `json:"basePath,omitempty"`
- Paths *Paths `json:"paths"`
- Definitions Definitions `json:"definitions,omitempty"`
- Parameters map[string]Parameter `json:"parameters,omitempty"`
- Responses map[string]Response `json:"responses,omitempty"`
- SecurityDefinitions SecurityDefinitions `json:"securityDefinitions,omitempty"`
- Security []map[string][]string `json:"security,omitempty"`
- Tags []Tag `json:"tags,omitempty"`
- ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"`
-}
-
-type swaggerPropsAlias SwaggerProps
-
-type gobSwaggerPropsAlias struct {
- Security []map[string]struct {
- List []string
- Pad bool
- }
- Alias *swaggerPropsAlias
- SecurityIsEmpty bool
-}
-
-// GobEncode provides a safe gob encoder for SwaggerProps, including empty security requirements
-func (o SwaggerProps) GobEncode() ([]byte, error) {
- raw := gobSwaggerPropsAlias{
- Alias: (*swaggerPropsAlias)(&o),
- }
-
- var b bytes.Buffer
- if o.Security == nil {
- // nil security requirement
- err := gob.NewEncoder(&b).Encode(raw)
- return b.Bytes(), err
- }
-
- if len(o.Security) == 0 {
- // empty, but non-nil security requirement
- raw.SecurityIsEmpty = true
- raw.Alias.Security = nil
- err := gob.NewEncoder(&b).Encode(raw)
- return b.Bytes(), err
- }
-
- raw.Security = make([]map[string]struct {
- List []string
- Pad bool
- }, 0, len(o.Security))
- for _, req := range o.Security {
- v := make(map[string]struct {
- List []string
- Pad bool
- }, len(req))
- for k, val := range req {
- v[k] = struct {
- List []string
- Pad bool
- }{
- List: val,
- }
- }
- raw.Security = append(raw.Security, v)
- }
-
- err := gob.NewEncoder(&b).Encode(raw)
- return b.Bytes(), err
-}
-
-// GobDecode provides a safe gob decoder for SwaggerProps, including empty security requirements
-func (o *SwaggerProps) GobDecode(b []byte) error {
- var raw gobSwaggerPropsAlias
-
- buf := bytes.NewBuffer(b)
- err := gob.NewDecoder(buf).Decode(&raw)
- if err != nil {
- return err
- }
- if raw.Alias == nil {
- return nil
- }
-
- switch {
- case raw.SecurityIsEmpty:
- // empty, but non-nil security requirement
- raw.Alias.Security = []map[string][]string{}
- case len(raw.Alias.Security) == 0:
- // nil security requirement
- raw.Alias.Security = nil
- default:
- raw.Alias.Security = make([]map[string][]string, 0, len(raw.Security))
- for _, req := range raw.Security {
- v := make(map[string][]string, len(req))
- for k, val := range req {
- v[k] = make([]string, 0, len(val.List))
- v[k] = append(v[k], val.List...)
- }
- raw.Alias.Security = append(raw.Alias.Security, v)
- }
- }
-
- *o = *(*SwaggerProps)(raw.Alias)
- return nil
-}
-
-// Dependencies represent a dependencies property
-type Dependencies map[string]SchemaOrStringArray
-
-// SchemaOrBool represents a schema or boolean value, is biased towards true for the boolean property
-type SchemaOrBool struct {
- Allows bool
- Schema *Schema
-}
-
-// JSONLookup implements an interface to customize json pointer lookup
-func (s SchemaOrBool) JSONLookup(token string) (interface{}, error) {
- if token == "allows" {
- return s.Allows, nil
- }
- r, _, err := jsonpointer.GetForToken(s.Schema, token)
- return r, err
-}
-
-var jsTrue = []byte("true")
-var jsFalse = []byte("false")
-
-// MarshalJSON convert this object to JSON
-func (s SchemaOrBool) MarshalJSON() ([]byte, error) {
- if s.Schema != nil {
- return json.Marshal(s.Schema)
- }
-
- if s.Schema == nil && !s.Allows {
- return jsFalse, nil
- }
- return jsTrue, nil
-}
-
-// UnmarshalJSON converts this bool or schema object from a JSON structure
-func (s *SchemaOrBool) UnmarshalJSON(data []byte) error {
- var nw SchemaOrBool
- if len(data) > 0 {
- if data[0] == '{' {
- var sch Schema
- if err := json.Unmarshal(data, &sch); err != nil {
- return err
- }
- nw.Schema = &sch
- }
- nw.Allows = !bytes.Equal(data, []byte("false"))
- }
- *s = nw
- return nil
-}
-
-// SchemaOrStringArray represents a schema or a string array
-type SchemaOrStringArray struct {
- Schema *Schema
- Property []string
-}
-
-// JSONLookup implements an interface to customize json pointer lookup
-func (s SchemaOrStringArray) JSONLookup(token string) (interface{}, error) {
- r, _, err := jsonpointer.GetForToken(s.Schema, token)
- return r, err
-}
-
-// MarshalJSON converts this schema object or array into JSON structure
-func (s SchemaOrStringArray) MarshalJSON() ([]byte, error) {
- if len(s.Property) > 0 {
- return json.Marshal(s.Property)
- }
- if s.Schema != nil {
- return json.Marshal(s.Schema)
- }
- return []byte("null"), nil
-}
-
-// UnmarshalJSON converts this schema object or array from a JSON structure
-func (s *SchemaOrStringArray) UnmarshalJSON(data []byte) error {
- var first byte
- if len(data) > 1 {
- first = data[0]
- }
- var nw SchemaOrStringArray
- if first == '{' {
- var sch Schema
- if err := json.Unmarshal(data, &sch); err != nil {
- return err
- }
- nw.Schema = &sch
- }
- if first == '[' {
- if err := json.Unmarshal(data, &nw.Property); err != nil {
- return err
- }
- }
- *s = nw
- return nil
-}
-
-// Definitions contains the models explicitly defined in this spec
-// An object to hold data types that can be consumed and produced by operations.
-// These data types can be primitives, arrays or models.
-//
-// For more information: http://goo.gl/8us55a#definitionsObject
-type Definitions map[string]Schema
-
-// SecurityDefinitions a declaration of the security schemes available to be used in the specification.
-// This does not enforce the security schemes on the operations and only serves to provide
-// the relevant details for each scheme.
-//
-// For more information: http://goo.gl/8us55a#securityDefinitionsObject
-type SecurityDefinitions map[string]*SecurityScheme
-
-// StringOrArray represents a value that can either be a string
-// or an array of strings. Mainly here for serialization purposes
-type StringOrArray []string
-
-// Contains returns true when the value is contained in the slice
-func (s StringOrArray) Contains(value string) bool {
- for _, str := range s {
- if str == value {
- return true
- }
- }
- return false
-}
-
-// JSONLookup implements an interface to customize json pointer lookup
-func (s SchemaOrArray) JSONLookup(token string) (interface{}, error) {
- if _, err := strconv.Atoi(token); err == nil {
- r, _, err := jsonpointer.GetForToken(s.Schemas, token)
- return r, err
- }
- r, _, err := jsonpointer.GetForToken(s.Schema, token)
- return r, err
-}
-
-// UnmarshalJSON unmarshals this string or array object from a JSON array or JSON string
-func (s *StringOrArray) UnmarshalJSON(data []byte) error {
- var first byte
- if len(data) > 1 {
- first = data[0]
- }
-
- if first == '[' {
- var parsed []string
- if err := json.Unmarshal(data, &parsed); err != nil {
- return err
- }
- *s = StringOrArray(parsed)
- return nil
- }
-
- var single interface{}
- if err := json.Unmarshal(data, &single); err != nil {
- return err
- }
- if single == nil {
- return nil
- }
- switch v := single.(type) {
- case string:
- *s = StringOrArray([]string{v})
- return nil
- default:
- return fmt.Errorf("only string or array is allowed, not %T", single)
- }
-}
-
-// MarshalJSON converts this string or array to a JSON array or JSON string
-func (s StringOrArray) MarshalJSON() ([]byte, error) {
- if len(s) == 1 {
- return json.Marshal([]string(s)[0])
- }
- return json.Marshal([]string(s))
-}
-
-// SchemaOrArray represents a value that can either be a Schema
-// or an array of Schema. Mainly here for serialization purposes
-type SchemaOrArray struct {
- Schema *Schema
- Schemas []Schema
-}
-
-// Len returns the number of schemas in this property
-func (s SchemaOrArray) Len() int {
- if s.Schema != nil {
- return 1
- }
- return len(s.Schemas)
-}
-
-// ContainsType returns true when one of the schemas is of the specified type
-func (s *SchemaOrArray) ContainsType(name string) bool {
- if s.Schema != nil {
- return s.Schema.Type != nil && s.Schema.Type.Contains(name)
- }
- return false
-}
-
-// MarshalJSON converts this schema object or array into JSON structure
-func (s SchemaOrArray) MarshalJSON() ([]byte, error) {
- if len(s.Schemas) > 0 {
- return json.Marshal(s.Schemas)
- }
- return json.Marshal(s.Schema)
-}
-
-// UnmarshalJSON converts this schema object or array from a JSON structure
-func (s *SchemaOrArray) UnmarshalJSON(data []byte) error {
- var nw SchemaOrArray
- var first byte
- if len(data) > 1 {
- first = data[0]
- }
- if first == '{' {
- var sch Schema
- if err := json.Unmarshal(data, &sch); err != nil {
- return err
- }
- nw.Schema = &sch
- }
- if first == '[' {
- if err := json.Unmarshal(data, &nw.Schemas); err != nil {
- return err
- }
- }
- *s = nw
- return nil
-}
-
-// vim:set ft=go noet sts=2 sw=2 ts=2:
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/tag.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/tag.go
deleted file mode 100644
index faa3d3de1..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/tag.go
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package spec
-
-import (
- "encoding/json"
-
- "github.com/go-openapi/jsonpointer"
- "github.com/go-openapi/swag"
-)
-
-// TagProps describe a tag entry in the top level tags section of a swagger spec
-type TagProps struct {
- Description string `json:"description,omitempty"`
- Name string `json:"name,omitempty"`
- ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"`
-}
-
-// NewTag creates a new tag
-func NewTag(name, description string, externalDocs *ExternalDocumentation) Tag {
- return Tag{TagProps: TagProps{Description: description, Name: name, ExternalDocs: externalDocs}}
-}
-
-// Tag allows adding meta data to a single tag that is used by the
-// [Operation Object](http://goo.gl/8us55a#operationObject).
-// It is not mandatory to have a Tag Object per tag used there.
-//
-// For more information: http://goo.gl/8us55a#tagObject
-type Tag struct {
- VendorExtensible
- TagProps
-}
-
-// JSONLookup implements an interface to customize json pointer lookup
-func (t Tag) JSONLookup(token string) (interface{}, error) {
- if ex, ok := t.Extensions[token]; ok {
- return &ex, nil
- }
-
- r, _, err := jsonpointer.GetForToken(t.TagProps, token)
- return r, err
-}
-
-// MarshalJSON marshal this to JSON
-func (t Tag) MarshalJSON() ([]byte, error) {
- b1, err := json.Marshal(t.TagProps)
- if err != nil {
- return nil, err
- }
- b2, err := json.Marshal(t.VendorExtensible)
- if err != nil {
- return nil, err
- }
- return swag.ConcatJSON(b1, b2), nil
-}
-
-// UnmarshalJSON marshal this from JSON
-func (t *Tag) UnmarshalJSON(data []byte) error {
- if err := json.Unmarshal(data, &t.TagProps); err != nil {
- return err
- }
- return json.Unmarshal(data, &t.VendorExtensible)
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/url_go19.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/url_go19.go
deleted file mode 100644
index 5bdfe40bc..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/url_go19.go
+++ /dev/null
@@ -1,11 +0,0 @@
-package spec
-
-import "net/url"
-
-func parseURL(s string) (*url.URL, error) {
- u, err := url.Parse(s)
- if err == nil {
- u.OmitHost = false
- }
- return u, err
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/validations.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/validations.go
deleted file mode 100644
index 6360a8ea7..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/validations.go
+++ /dev/null
@@ -1,215 +0,0 @@
-package spec
-
-// CommonValidations describe common JSON-schema validations
-type CommonValidations struct {
- Maximum *float64 `json:"maximum,omitempty"`
- ExclusiveMaximum bool `json:"exclusiveMaximum,omitempty"`
- Minimum *float64 `json:"minimum,omitempty"`
- ExclusiveMinimum bool `json:"exclusiveMinimum,omitempty"`
- MaxLength *int64 `json:"maxLength,omitempty"`
- MinLength *int64 `json:"minLength,omitempty"`
- Pattern string `json:"pattern,omitempty"`
- MaxItems *int64 `json:"maxItems,omitempty"`
- MinItems *int64 `json:"minItems,omitempty"`
- UniqueItems bool `json:"uniqueItems,omitempty"`
- MultipleOf *float64 `json:"multipleOf,omitempty"`
- Enum []interface{} `json:"enum,omitempty"`
-}
-
-// SetValidations defines all validations for a simple schema.
-//
-// NOTE: the input is the larger set of validations available for schemas.
-// For simple schemas, MinProperties and MaxProperties are ignored.
-func (v *CommonValidations) SetValidations(val SchemaValidations) {
- v.Maximum = val.Maximum
- v.ExclusiveMaximum = val.ExclusiveMaximum
- v.Minimum = val.Minimum
- v.ExclusiveMinimum = val.ExclusiveMinimum
- v.MaxLength = val.MaxLength
- v.MinLength = val.MinLength
- v.Pattern = val.Pattern
- v.MaxItems = val.MaxItems
- v.MinItems = val.MinItems
- v.UniqueItems = val.UniqueItems
- v.MultipleOf = val.MultipleOf
- v.Enum = val.Enum
-}
-
-type clearedValidation struct {
- Validation string
- Value interface{}
-}
-
-type clearedValidations []clearedValidation
-
-func (c clearedValidations) apply(cbs []func(string, interface{})) {
- for _, cb := range cbs {
- for _, cleared := range c {
- cb(cleared.Validation, cleared.Value)
- }
- }
-}
-
-// ClearNumberValidations clears all number validations.
-//
-// Some callbacks may be set by the caller to capture changed values.
-func (v *CommonValidations) ClearNumberValidations(cbs ...func(string, interface{})) {
- done := make(clearedValidations, 0, 5)
- defer func() {
- done.apply(cbs)
- }()
-
- if v.Minimum != nil {
- done = append(done, clearedValidation{Validation: "minimum", Value: v.Minimum})
- v.Minimum = nil
- }
- if v.Maximum != nil {
- done = append(done, clearedValidation{Validation: "maximum", Value: v.Maximum})
- v.Maximum = nil
- }
- if v.ExclusiveMaximum {
- done = append(done, clearedValidation{Validation: "exclusiveMaximum", Value: v.ExclusiveMaximum})
- v.ExclusiveMaximum = false
- }
- if v.ExclusiveMinimum {
- done = append(done, clearedValidation{Validation: "exclusiveMinimum", Value: v.ExclusiveMinimum})
- v.ExclusiveMinimum = false
- }
- if v.MultipleOf != nil {
- done = append(done, clearedValidation{Validation: "multipleOf", Value: v.MultipleOf})
- v.MultipleOf = nil
- }
-}
-
-// ClearStringValidations clears all string validations.
-//
-// Some callbacks may be set by the caller to capture changed values.
-func (v *CommonValidations) ClearStringValidations(cbs ...func(string, interface{})) {
- done := make(clearedValidations, 0, 3)
- defer func() {
- done.apply(cbs)
- }()
-
- if v.Pattern != "" {
- done = append(done, clearedValidation{Validation: "pattern", Value: v.Pattern})
- v.Pattern = ""
- }
- if v.MinLength != nil {
- done = append(done, clearedValidation{Validation: "minLength", Value: v.MinLength})
- v.MinLength = nil
- }
- if v.MaxLength != nil {
- done = append(done, clearedValidation{Validation: "maxLength", Value: v.MaxLength})
- v.MaxLength = nil
- }
-}
-
-// ClearArrayValidations clears all array validations.
-//
-// Some callbacks may be set by the caller to capture changed values.
-func (v *CommonValidations) ClearArrayValidations(cbs ...func(string, interface{})) {
- done := make(clearedValidations, 0, 3)
- defer func() {
- done.apply(cbs)
- }()
-
- if v.MaxItems != nil {
- done = append(done, clearedValidation{Validation: "maxItems", Value: v.MaxItems})
- v.MaxItems = nil
- }
- if v.MinItems != nil {
- done = append(done, clearedValidation{Validation: "minItems", Value: v.MinItems})
- v.MinItems = nil
- }
- if v.UniqueItems {
- done = append(done, clearedValidation{Validation: "uniqueItems", Value: v.UniqueItems})
- v.UniqueItems = false
- }
-}
-
-// Validations returns a clone of the validations for a simple schema.
-//
-// NOTE: in the context of simple schema objects, MinProperties, MaxProperties
-// and PatternProperties remain unset.
-func (v CommonValidations) Validations() SchemaValidations {
- return SchemaValidations{
- CommonValidations: v,
- }
-}
-
-// HasNumberValidations indicates if the validations are for numbers or integers
-func (v CommonValidations) HasNumberValidations() bool {
- return v.Maximum != nil || v.Minimum != nil || v.MultipleOf != nil
-}
-
-// HasStringValidations indicates if the validations are for strings
-func (v CommonValidations) HasStringValidations() bool {
- return v.MaxLength != nil || v.MinLength != nil || v.Pattern != ""
-}
-
-// HasArrayValidations indicates if the validations are for arrays
-func (v CommonValidations) HasArrayValidations() bool {
- return v.MaxItems != nil || v.MinItems != nil || v.UniqueItems
-}
-
-// HasEnum indicates if the validation includes some enum constraint
-func (v CommonValidations) HasEnum() bool {
- return len(v.Enum) > 0
-}
-
-// SchemaValidations describes the validation properties of a schema
-//
-// NOTE: at this moment, this is not embedded in SchemaProps because this would induce a breaking change
-// in the exported members: all initializers using litterals would fail.
-type SchemaValidations struct {
- CommonValidations
-
- PatternProperties SchemaProperties `json:"patternProperties,omitempty"`
- MaxProperties *int64 `json:"maxProperties,omitempty"`
- MinProperties *int64 `json:"minProperties,omitempty"`
-}
-
-// HasObjectValidations indicates if the validations are for objects
-func (v SchemaValidations) HasObjectValidations() bool {
- return v.MaxProperties != nil || v.MinProperties != nil || v.PatternProperties != nil
-}
-
-// SetValidations for schema validations
-func (v *SchemaValidations) SetValidations(val SchemaValidations) {
- v.CommonValidations.SetValidations(val)
- v.PatternProperties = val.PatternProperties
- v.MaxProperties = val.MaxProperties
- v.MinProperties = val.MinProperties
-}
-
-// Validations for a schema
-func (v SchemaValidations) Validations() SchemaValidations {
- val := v.CommonValidations.Validations()
- val.PatternProperties = v.PatternProperties
- val.MinProperties = v.MinProperties
- val.MaxProperties = v.MaxProperties
- return val
-}
-
-// ClearObjectValidations returns a clone of the validations with all object validations cleared.
-//
-// Some callbacks may be set by the caller to capture changed values.
-func (v *SchemaValidations) ClearObjectValidations(cbs ...func(string, interface{})) {
- done := make(clearedValidations, 0, 3)
- defer func() {
- done.apply(cbs)
- }()
-
- if v.MaxProperties != nil {
- done = append(done, clearedValidation{Validation: "maxProperties", Value: v.MaxProperties})
- v.MaxProperties = nil
- }
- if v.MinProperties != nil {
- done = append(done, clearedValidation{Validation: "minProperties", Value: v.MinProperties})
- v.MinProperties = nil
- }
- if v.PatternProperties != nil {
- done = append(done, clearedValidation{Validation: "patternProperties", Value: v.PatternProperties})
- v.PatternProperties = nil
- }
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/xml_object.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/xml_object.go
deleted file mode 100644
index 945a46703..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/spec/xml_object.go
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package spec
-
-// XMLObject a metadata object that allows for more fine-tuned XML model definitions.
-//
-// For more information: http://goo.gl/8us55a#xmlObject
-type XMLObject struct {
- Name string `json:"name,omitempty"`
- Namespace string `json:"namespace,omitempty"`
- Prefix string `json:"prefix,omitempty"`
- Attribute bool `json:"attribute,omitempty"`
- Wrapped bool `json:"wrapped,omitempty"`
-}
-
-// WithName sets the xml name for the object
-func (x *XMLObject) WithName(name string) *XMLObject {
- x.Name = name
- return x
-}
-
-// WithNamespace sets the xml namespace for the object
-func (x *XMLObject) WithNamespace(namespace string) *XMLObject {
- x.Namespace = namespace
- return x
-}
-
-// WithPrefix sets the xml prefix for the object
-func (x *XMLObject) WithPrefix(prefix string) *XMLObject {
- x.Prefix = prefix
- return x
-}
-
-// AsAttribute flags this object as xml attribute
-func (x *XMLObject) AsAttribute() *XMLObject {
- x.Attribute = true
- return x
-}
-
-// AsElement flags this object as an xml node
-func (x *XMLObject) AsElement() *XMLObject {
- x.Attribute = false
- return x
-}
-
-// AsWrapped flags this object as wrapped, this is mostly useful for array types
-func (x *XMLObject) AsWrapped() *XMLObject {
- x.Wrapped = true
- return x
-}
-
-// AsUnwrapped flags this object as an xml node
-func (x *XMLObject) AsUnwrapped() *XMLObject {
- x.Wrapped = false
- return x
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/.editorconfig b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/.editorconfig
deleted file mode 100644
index 3152da69a..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/.editorconfig
+++ /dev/null
@@ -1,26 +0,0 @@
-# top-most EditorConfig file
-root = true
-
-# Unix-style newlines with a newline ending every file
-[*]
-end_of_line = lf
-insert_final_newline = true
-indent_style = space
-indent_size = 2
-trim_trailing_whitespace = true
-
-# Set default charset
-[*.{js,py,go,scala,rb,java,html,css,less,sass,md}]
-charset = utf-8
-
-# Tab indentation (no size specified)
-[*.go]
-indent_style = tab
-
-[*.md]
-trim_trailing_whitespace = false
-
-# Matches the exact files either package.json or .travis.yml
-[{package.json,.travis.yml}]
-indent_style = space
-indent_size = 2
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/.gitattributes b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/.gitattributes
deleted file mode 100644
index d020be8ea..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/.gitattributes
+++ /dev/null
@@ -1,2 +0,0 @@
-*.go text eol=lf
-
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/.gitignore b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/.gitignore
deleted file mode 100644
index dd91ed6a0..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-secrets.yml
-coverage.out
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/.golangci.yml b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/.golangci.yml
deleted file mode 100644
index 22f8d21cc..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/.golangci.yml
+++ /dev/null
@@ -1,61 +0,0 @@
-linters-settings:
- govet:
- check-shadowing: true
- golint:
- min-confidence: 0
- gocyclo:
- min-complexity: 45
- maligned:
- suggest-new: true
- dupl:
- threshold: 200
- goconst:
- min-len: 2
- min-occurrences: 3
-
-linters:
- enable-all: true
- disable:
- - maligned
- - unparam
- - lll
- - gochecknoinits
- - gochecknoglobals
- - funlen
- - godox
- - gocognit
- - whitespace
- - wsl
- - wrapcheck
- - testpackage
- - nlreturn
- - gomnd
- - exhaustivestruct
- - goerr113
- - errorlint
- - nestif
- - godot
- - gofumpt
- - paralleltest
- - tparallel
- - thelper
- - ifshort
- - exhaustruct
- - varnamelen
- - gci
- - depguard
- - errchkjson
- - inamedparam
- - nonamedreturns
- - musttag
- - ireturn
- - forcetypeassert
- - cyclop
- # deprecated linters
- - deadcode
- - interfacer
- - scopelint
- - varcheck
- - structcheck
- - golint
- - nosnakecase
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/CODE_OF_CONDUCT.md b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/CODE_OF_CONDUCT.md
deleted file mode 100644
index 9322b065e..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/CODE_OF_CONDUCT.md
+++ /dev/null
@@ -1,74 +0,0 @@
-# Contributor Covenant Code of Conduct
-
-## Our Pledge
-
-In the interest of fostering an open and welcoming environment, we as
-contributors and maintainers pledge to making participation in our project and
-our community a harassment-free experience for everyone, regardless of age, body
-size, disability, ethnicity, gender identity and expression, level of experience,
-nationality, personal appearance, race, religion, or sexual identity and
-orientation.
-
-## Our Standards
-
-Examples of behavior that contributes to creating a positive environment
-include:
-
-* Using welcoming and inclusive language
-* Being respectful of differing viewpoints and experiences
-* Gracefully accepting constructive criticism
-* Focusing on what is best for the community
-* Showing empathy towards other community members
-
-Examples of unacceptable behavior by participants include:
-
-* The use of sexualized language or imagery and unwelcome sexual attention or
-advances
-* Trolling, insulting/derogatory comments, and personal or political attacks
-* Public or private harassment
-* Publishing others' private information, such as a physical or electronic
- address, without explicit permission
-* Other conduct which could reasonably be considered inappropriate in a
- professional setting
-
-## Our Responsibilities
-
-Project maintainers are responsible for clarifying the standards of acceptable
-behavior and are expected to take appropriate and fair corrective action in
-response to any instances of unacceptable behavior.
-
-Project maintainers have the right and responsibility to remove, edit, or
-reject comments, commits, code, wiki edits, issues, and other contributions
-that are not aligned to this Code of Conduct, or to ban temporarily or
-permanently any contributor for other behaviors that they deem inappropriate,
-threatening, offensive, or harmful.
-
-## Scope
-
-This Code of Conduct applies both within project spaces and in public spaces
-when an individual is representing the project or its community. Examples of
-representing a project or community include using an official project e-mail
-address, posting via an official social media account, or acting as an appointed
-representative at an online or offline event. Representation of a project may be
-further defined and clarified by project maintainers.
-
-## Enforcement
-
-Instances of abusive, harassing, or otherwise unacceptable behavior may be
-reported by contacting the project team at ivan+abuse@flanders.co.nz. All
-complaints will be reviewed and investigated and will result in a response that
-is deemed necessary and appropriate to the circumstances. The project team is
-obligated to maintain confidentiality with regard to the reporter of an incident.
-Further details of specific enforcement policies may be posted separately.
-
-Project maintainers who do not follow or enforce the Code of Conduct in good
-faith may face temporary or permanent repercussions as determined by other
-members of the project's leadership.
-
-## Attribution
-
-This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
-available at [http://contributor-covenant.org/version/1/4][version]
-
-[homepage]: http://contributor-covenant.org
-[version]: http://contributor-covenant.org/version/1/4/
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/LICENSE b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/LICENSE
deleted file mode 100644
index d64569567..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/README.md b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/README.md
deleted file mode 100644
index f6b39c6c5..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-# Strfmt [](https://github.com/go-openapi/strfmt/actions?query=workflow%3A"go+test") [](https://codecov.io/gh/go-openapi/strfmt)
-[](https://slackin.goswagger.io)
-[](https://raw.githubusercontent.com/go-openapi/strfmt/master/LICENSE)
-[](http://godoc.org/github.com/go-openapi/strfmt)
-[](https://goreportcard.com/report/github.com/go-openapi/strfmt)
-
-This package exposes a registry of data types to support string formats in the go-openapi toolkit.
-
-strfmt represents a well known string format such as credit card or email. The go toolkit for OpenAPI specifications knows how to deal with those.
-
-## Supported data formats
-go-openapi/strfmt follows the swagger 2.0 specification with the following formats
-defined [here](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types).
-
-It also provides convenient extensions to go-openapi users.
-
-- [x] JSON-schema draft 4 formats
- - date-time
- - email
- - hostname
- - ipv4
- - ipv6
- - uri
-- [x] swagger 2.0 format extensions
- - binary
- - byte (e.g. base64 encoded string)
- - date (e.g. "1970-01-01")
- - password
-- [x] go-openapi custom format extensions
- - bsonobjectid (BSON objectID)
- - creditcard
- - duration (e.g. "3 weeks", "1ms")
- - hexcolor (e.g. "#FFFFFF")
- - isbn, isbn10, isbn13
- - mac (e.g "01:02:03:04:05:06")
- - rgbcolor (e.g. "rgb(100,100,100)")
- - ssn
- - uuid, uuid3, uuid4, uuid5
- - cidr (e.g. "192.0.2.1/24", "2001:db8:a0b:12f0::1/32")
- - ulid (e.g. "00000PP9HGSBSSDZ1JTEXBJ0PW", [spec](https://github.com/ulid/spec))
-
-> NOTE: as the name stands for, this package is intended to support string formatting only.
-> It does not provide validation for numerical values with swagger format extension for JSON types "number" or
-> "integer" (e.g. float, double, int32...).
-
-## Type conversion
-
-All types defined here are stringers and may be converted to strings with `.String()`.
-Note that most types defined by this package may be converted directly to string like `string(Email{})`.
-
-`Date` and `DateTime` may be converted directly to `time.Time` like `time.Time(Time{})`.
-Similarly, you can convert `Duration` to `time.Duration` as in `time.Duration(Duration{})`
-
-## Using pointers
-
-The `conv` subpackage provides helpers to convert the types to and from pointers, just like `go-openapi/swag` does
-with primitive types.
-
-## Format types
-Types defined in strfmt expose marshaling and validation capabilities.
-
-List of defined types:
-- Base64
-- CreditCard
-- Date
-- DateTime
-- Duration
-- Email
-- HexColor
-- Hostname
-- IPv4
-- IPv6
-- CIDR
-- ISBN
-- ISBN10
-- ISBN13
-- MAC
-- ObjectId
-- Password
-- RGBColor
-- SSN
-- URI
-- UUID
-- UUID3
-- UUID4
-- UUID5
-- [ULID](https://github.com/ulid/spec)
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/bson.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/bson.go
deleted file mode 100644
index cfa9a526f..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/bson.go
+++ /dev/null
@@ -1,165 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package strfmt
-
-import (
- "database/sql/driver"
- "fmt"
-
- "go.mongodb.org/mongo-driver/bson"
-
- "go.mongodb.org/mongo-driver/bson/bsontype"
- bsonprim "go.mongodb.org/mongo-driver/bson/primitive"
-)
-
-func init() {
- var id ObjectId
- // register this format in the default registry
- Default.Add("bsonobjectid", &id, IsBSONObjectID)
-}
-
-// IsBSONObjectID returns true when the string is a valid BSON.ObjectId
-func IsBSONObjectID(str string) bool {
- _, err := bsonprim.ObjectIDFromHex(str)
- return err == nil
-}
-
-// ObjectId represents a BSON object ID (alias to go.mongodb.org/mongo-driver/bson/primitive.ObjectID)
-//
-// swagger:strfmt bsonobjectid
-type ObjectId bsonprim.ObjectID //nolint:revive,stylecheck
-
-// NewObjectId creates a ObjectId from a Hex String
-func NewObjectId(hex string) ObjectId { //nolint:revive,stylecheck
- oid, err := bsonprim.ObjectIDFromHex(hex)
- if err != nil {
- panic(err)
- }
- return ObjectId(oid)
-}
-
-// MarshalText turns this instance into text
-func (id ObjectId) MarshalText() ([]byte, error) {
- oid := bsonprim.ObjectID(id)
- if oid == bsonprim.NilObjectID {
- return nil, nil
- }
- return []byte(oid.Hex()), nil
-}
-
-// UnmarshalText hydrates this instance from text
-func (id *ObjectId) UnmarshalText(data []byte) error { // validation is performed later on
- if len(data) == 0 {
- *id = ObjectId(bsonprim.NilObjectID)
- return nil
- }
- oidstr := string(data)
- oid, err := bsonprim.ObjectIDFromHex(oidstr)
- if err != nil {
- return err
- }
- *id = ObjectId(oid)
- return nil
-}
-
-// Scan read a value from a database driver
-func (id *ObjectId) Scan(raw interface{}) error {
- var data []byte
- switch v := raw.(type) {
- case []byte:
- data = v
- case string:
- data = []byte(v)
- default:
- return fmt.Errorf("cannot sql.Scan() strfmt.URI from: %#v", v)
- }
-
- return id.UnmarshalText(data)
-}
-
-// Value converts a value to a database driver value
-func (id ObjectId) Value() (driver.Value, error) {
- return driver.Value(bsonprim.ObjectID(id).Hex()), nil
-}
-
-func (id ObjectId) String() string {
- return bsonprim.ObjectID(id).Hex()
-}
-
-// MarshalJSON returns the ObjectId as JSON
-func (id ObjectId) MarshalJSON() ([]byte, error) {
- return bsonprim.ObjectID(id).MarshalJSON()
-}
-
-// UnmarshalJSON sets the ObjectId from JSON
-func (id *ObjectId) UnmarshalJSON(data []byte) error {
- var obj bsonprim.ObjectID
- if err := obj.UnmarshalJSON(data); err != nil {
- return err
- }
- *id = ObjectId(obj)
- return nil
-}
-
-// MarshalBSON renders the object id as a BSON document
-func (id ObjectId) MarshalBSON() ([]byte, error) {
- return bson.Marshal(bson.M{"data": bsonprim.ObjectID(id)})
-}
-
-// UnmarshalBSON reads the objectId from a BSON document
-func (id *ObjectId) UnmarshalBSON(data []byte) error {
- var obj struct {
- Data bsonprim.ObjectID
- }
- if err := bson.Unmarshal(data, &obj); err != nil {
- return err
- }
- *id = ObjectId(obj.Data)
- return nil
-}
-
-// MarshalBSONValue is an interface implemented by types that can marshal themselves
-// into a BSON document represented as bytes. The bytes returned must be a valid
-// BSON document if the error is nil.
-func (id ObjectId) MarshalBSONValue() (bsontype.Type, []byte, error) {
- oid := bsonprim.ObjectID(id)
- return bson.TypeObjectID, oid[:], nil
-}
-
-// UnmarshalBSONValue is an interface implemented by types that can unmarshal a
-// BSON value representation of themselves. The BSON bytes and type can be
-// assumed to be valid. UnmarshalBSONValue must copy the BSON value bytes if it
-// wishes to retain the data after returning.
-func (id *ObjectId) UnmarshalBSONValue(_ bsontype.Type, data []byte) error {
- var oid bsonprim.ObjectID
- copy(oid[:], data)
- *id = ObjectId(oid)
- return nil
-}
-
-// DeepCopyInto copies the receiver and writes its value into out.
-func (id *ObjectId) DeepCopyInto(out *ObjectId) {
- *out = *id
-}
-
-// DeepCopy copies the receiver into a new ObjectId.
-func (id *ObjectId) DeepCopy() *ObjectId {
- if id == nil {
- return nil
- }
- out := new(ObjectId)
- id.DeepCopyInto(out)
- return out
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/date.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/date.go
deleted file mode 100644
index 3c93381c7..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/date.go
+++ /dev/null
@@ -1,187 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package strfmt
-
-import (
- "database/sql/driver"
- "encoding/json"
- "errors"
- "fmt"
- "time"
-
- "go.mongodb.org/mongo-driver/bson"
-)
-
-func init() {
- d := Date{}
- // register this format in the default registry
- Default.Add("date", &d, IsDate)
-}
-
-// IsDate returns true when the string is a valid date
-func IsDate(str string) bool {
- _, err := time.Parse(RFC3339FullDate, str)
- return err == nil
-}
-
-const (
- // RFC3339FullDate represents a full-date as specified by RFC3339
- // See: http://goo.gl/xXOvVd
- RFC3339FullDate = "2006-01-02"
-)
-
-// Date represents a date from the API
-//
-// swagger:strfmt date
-type Date time.Time
-
-// String converts this date into a string
-func (d Date) String() string {
- return time.Time(d).Format(RFC3339FullDate)
-}
-
-// UnmarshalText parses a text representation into a date type
-func (d *Date) UnmarshalText(text []byte) error {
- if len(text) == 0 {
- return nil
- }
- dd, err := time.ParseInLocation(RFC3339FullDate, string(text), DefaultTimeLocation)
- if err != nil {
- return err
- }
- *d = Date(dd)
- return nil
-}
-
-// MarshalText serializes this date type to string
-func (d Date) MarshalText() ([]byte, error) {
- return []byte(d.String()), nil
-}
-
-// Scan scans a Date value from database driver type.
-func (d *Date) Scan(raw interface{}) error {
- switch v := raw.(type) {
- case []byte:
- return d.UnmarshalText(v)
- case string:
- return d.UnmarshalText([]byte(v))
- case time.Time:
- *d = Date(v)
- return nil
- case nil:
- *d = Date{}
- return nil
- default:
- return fmt.Errorf("cannot sql.Scan() strfmt.Date from: %#v", v)
- }
-}
-
-// Value converts Date to a primitive value ready to written to a database.
-func (d Date) Value() (driver.Value, error) {
- return driver.Value(d.String()), nil
-}
-
-// MarshalJSON returns the Date as JSON
-func (d Date) MarshalJSON() ([]byte, error) {
- return json.Marshal(time.Time(d).Format(RFC3339FullDate))
-}
-
-// UnmarshalJSON sets the Date from JSON
-func (d *Date) UnmarshalJSON(data []byte) error {
- if string(data) == jsonNull {
- return nil
- }
- var strdate string
- if err := json.Unmarshal(data, &strdate); err != nil {
- return err
- }
- tt, err := time.ParseInLocation(RFC3339FullDate, strdate, DefaultTimeLocation)
- if err != nil {
- return err
- }
- *d = Date(tt)
- return nil
-}
-
-func (d Date) MarshalBSON() ([]byte, error) {
- return bson.Marshal(bson.M{"data": d.String()})
-}
-
-func (d *Date) UnmarshalBSON(data []byte) error {
- var m bson.M
- if err := bson.Unmarshal(data, &m); err != nil {
- return err
- }
-
- if data, ok := m["data"].(string); ok {
- rd, err := time.ParseInLocation(RFC3339FullDate, data, DefaultTimeLocation)
- if err != nil {
- return err
- }
- *d = Date(rd)
- return nil
- }
-
- return errors.New("couldn't unmarshal bson bytes value as Date")
-}
-
-// DeepCopyInto copies the receiver and writes its value into out.
-func (d *Date) DeepCopyInto(out *Date) {
- *out = *d
-}
-
-// DeepCopy copies the receiver into a new Date.
-func (d *Date) DeepCopy() *Date {
- if d == nil {
- return nil
- }
- out := new(Date)
- d.DeepCopyInto(out)
- return out
-}
-
-// GobEncode implements the gob.GobEncoder interface.
-func (d Date) GobEncode() ([]byte, error) {
- return d.MarshalBinary()
-}
-
-// GobDecode implements the gob.GobDecoder interface.
-func (d *Date) GobDecode(data []byte) error {
- return d.UnmarshalBinary(data)
-}
-
-// MarshalBinary implements the encoding.BinaryMarshaler interface.
-func (d Date) MarshalBinary() ([]byte, error) {
- return time.Time(d).MarshalBinary()
-}
-
-// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
-func (d *Date) UnmarshalBinary(data []byte) error {
- var original time.Time
-
- err := original.UnmarshalBinary(data)
- if err != nil {
- return err
- }
-
- *d = Date(original)
-
- return nil
-}
-
-// Equal checks if two Date instances are equal
-func (d Date) Equal(d2 Date) bool {
- return time.Time(d).Equal(time.Time(d2))
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/default.go b/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/default.go
deleted file mode 100644
index 281371406..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/go-openapi/strfmt/default.go
+++ /dev/null
@@ -1,2051 +0,0 @@
-// Copyright 2015 go-swagger maintainers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package strfmt
-
-import (
- "database/sql/driver"
- "encoding/base64"
- "encoding/json"
- "errors"
- "fmt"
- "net/mail"
- "regexp"
- "strings"
-
- "github.com/asaskevich/govalidator"
- "github.com/google/uuid"
- "go.mongodb.org/mongo-driver/bson"
-)
-
-const (
- // HostnamePattern http://json-schema.org/latest/json-schema-validation.html#anchor114
- // A string instance is valid against this attribute if it is a valid
- // representation for an Internet host name, as defined by RFC 1034, section 3.1 [RFC1034].
- // http://tools.ietf.org/html/rfc1034#section-3.5
- // ::= any one of the ten digits 0 through 9
- // var digit = /[0-9]/;
- // ::= any one of the 52 alphabetic characters A through Z in upper case and a through z in lower case
- // var letter = /[a-zA-Z]/;
- // ::= |
- // var letDig = /[0-9a-zA-Z]/;
- // ::= | "-"
- // var letDigHyp = /[-0-9a-zA-Z]/;
- // ::= |
- // var ldhStr = /[-0-9a-zA-Z]+/;
- //
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/core_dsl.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/core_dsl.go
index d027bdff9..7e165e473 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/core_dsl.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/core_dsl.go
@@ -186,6 +186,20 @@ func GinkgoLabelFilter() string {
return suiteConfig.LabelFilter
}
+/*
+GinkgoSemVerFilter() returns the semantic version filter configured for this suite via `--sem-ver-filter`.
+
+You can use this to manually check if a set of semantic version constraints would satisfy the filter via:
+
+ if (SemVerConstraint("> 2.6.0", "< 2.8.0").MatchesSemVerFilter(GinkgoSemVerFilter())) {
+ //...
+ }
+*/
+func GinkgoSemVerFilter() string {
+ suiteConfig, _ := GinkgoConfiguration()
+ return suiteConfig.SemVerFilter
+}
+
/*
PauseOutputInterception() pauses Ginkgo's output interception. This is only relevant
when running in parallel and output to stdout/stderr is being intercepted. You generally
@@ -254,7 +268,7 @@ func RunSpecs(t GinkgoTestingT, description string, args ...any) bool {
}
defer global.PopClone()
- suiteLabels := extractSuiteConfiguration(args)
+ suiteLabels, suiteSemVerConstraints, suiteAroundNodes := extractSuiteConfiguration(args)
var reporter reporters.Reporter
if suiteConfig.ParallelTotal == 1 {
@@ -297,7 +311,7 @@ func RunSpecs(t GinkgoTestingT, description string, args ...any) bool {
suitePath, err = filepath.Abs(suitePath)
exitIfErr(err)
- passed, hasFocusedTests := global.Suite.Run(description, suiteLabels, suitePath, global.Failer, reporter, writer, outputInterceptor, interrupt_handler.NewInterruptHandler(client), client, internal.RegisterForProgressSignal, suiteConfig)
+ passed, hasFocusedTests := global.Suite.Run(description, suiteLabels, suiteSemVerConstraints, suiteAroundNodes, suitePath, global.Failer, reporter, writer, outputInterceptor, interrupt_handler.NewInterruptHandler(client), client, internal.RegisterForProgressSignal, suiteConfig)
outputInterceptor.Shutdown()
flagSet.ValidateDeprecations(deprecationTracker)
@@ -316,8 +330,10 @@ func RunSpecs(t GinkgoTestingT, description string, args ...any) bool {
return passed
}
-func extractSuiteConfiguration(args []any) Labels {
+func extractSuiteConfiguration(args []any) (Labels, SemVerConstraints, types.AroundNodes) {
suiteLabels := Labels{}
+ suiteSemVerConstraints := SemVerConstraints{}
+ aroundNodes := types.AroundNodes{}
configErrors := []error{}
for _, arg := range args {
switch arg := arg.(type) {
@@ -327,6 +343,10 @@ func extractSuiteConfiguration(args []any) Labels {
reporterConfig = arg
case Labels:
suiteLabels = append(suiteLabels, arg...)
+ case SemVerConstraints:
+ suiteSemVerConstraints = append(suiteSemVerConstraints, arg...)
+ case types.AroundNodeDecorator:
+ aroundNodes = append(aroundNodes, arg)
default:
configErrors = append(configErrors, types.GinkgoErrors.UnknownTypePassedToRunSpecs(arg))
}
@@ -342,7 +362,7 @@ func extractSuiteConfiguration(args []any) Labels {
os.Exit(1)
}
- return suiteLabels
+ return suiteLabels, suiteSemVerConstraints, aroundNodes
}
func getwd() (string, error) {
@@ -365,7 +385,7 @@ func PreviewSpecs(description string, args ...any) Report {
}
defer global.PopClone()
- suiteLabels := extractSuiteConfiguration(args)
+ suiteLabels, suiteSemVerConstraints, suiteAroundNodes := extractSuiteConfiguration(args)
priorDryRun, priorParallelTotal, priorParallelProcess := suiteConfig.DryRun, suiteConfig.ParallelTotal, suiteConfig.ParallelProcess
suiteConfig.DryRun, suiteConfig.ParallelTotal, suiteConfig.ParallelProcess = true, 1, 1
defer func() {
@@ -383,7 +403,7 @@ func PreviewSpecs(description string, args ...any) Report {
suitePath, err = filepath.Abs(suitePath)
exitIfErr(err)
- global.Suite.Run(description, suiteLabels, suitePath, global.Failer, reporter, writer, outputInterceptor, interrupt_handler.NewInterruptHandler(client), client, internal.RegisterForProgressSignal, suiteConfig)
+ global.Suite.Run(description, suiteLabels, suiteSemVerConstraints, suiteAroundNodes, suitePath, global.Failer, reporter, writer, outputInterceptor, interrupt_handler.NewInterruptHandler(client), client, internal.RegisterForProgressSignal, suiteConfig)
return global.Suite.GetPreviewReport()
}
@@ -481,6 +501,38 @@ func pushNode(node internal.Node, errors []error) bool {
return true
}
+// NodeArgsTransformer is a hook which is called by the test construction DSL methods
+// before creating the new node. If it returns any error, the test suite
+// prints those errors and exits. The text and arguments can be modified,
+// which includes directly changing the args slice that is passed in.
+// Arguments have been flattened already, i.e. none of the entries in args is another []any.
+// The result may be nested.
+//
+// The node type is provided for information and remains the same.
+//
+// The offset is valid for calling NewLocation directly in the
+// implementation of TransformNodeArgs to find the location where
+// the Ginkgo DSL function is called. An additional offset supplied
+// by the caller via args is already included.
+//
+// A NodeArgsTransformer can be registered with AddTreeConstructionNodeArgsTransformer.
+type NodeArgsTransformer func(nodeType types.NodeType, offset Offset, text string, args []any) (string, []any, []error)
+
+// AddTreeConstructionNodeArgsTransformer registers a NodeArgsTransformer.
+// Only nodes which get created after registering a NodeArgsTransformer
+// are transformed by it. The returned function can be called to
+// unregister the transformer.
+//
+// Both may only be called during the construction phase.
+//
+// If there is more than one registered transformer, then the most
+// recently added ones get called first.
+func AddTreeConstructionNodeArgsTransformer(transformer NodeArgsTransformer) func() {
+ // This conversion could be avoided with a type alias, but type aliases make
+ // developer documentation less useful.
+ return internal.AddTreeConstructionNodeArgsTransformer(internal.NodeArgsTransformer(transformer))
+}
+
/*
Describe nodes are Container nodes that allow you to organize your specs. A Describe node's closure can contain any number of
Setup nodes (e.g. BeforeEach, AfterEach, JustBeforeEach), and Subject nodes (i.e. It).
@@ -492,7 +544,7 @@ You can learn more at https://onsi.github.io/ginkgo/#organizing-specs-with-conta
In addition, container nodes can be decorated with a variety of decorators. You can learn more here: https://onsi.github.io/ginkgo/#decorator-reference
*/
func Describe(text string, args ...any) bool {
- return pushNode(internal.NewNode(deprecationTracker, types.NodeTypeContainer, text, args...))
+ return pushNode(internal.NewNode(internal.TransformNewNodeArgs(exitIfErrors, deprecationTracker, types.NodeTypeContainer, text, args...)))
}
/*
@@ -500,7 +552,7 @@ FDescribe focuses specs within the Describe block.
*/
func FDescribe(text string, args ...any) bool {
args = append(args, internal.Focus)
- return pushNode(internal.NewNode(deprecationTracker, types.NodeTypeContainer, text, args...))
+ return pushNode(internal.NewNode(internal.TransformNewNodeArgs(exitIfErrors, deprecationTracker, types.NodeTypeContainer, text, args...)))
}
/*
@@ -508,7 +560,7 @@ PDescribe marks specs within the Describe block as pending.
*/
func PDescribe(text string, args ...any) bool {
args = append(args, internal.Pending)
- return pushNode(internal.NewNode(deprecationTracker, types.NodeTypeContainer, text, args...))
+ return pushNode(internal.NewNode(internal.TransformNewNodeArgs(exitIfErrors, deprecationTracker, types.NodeTypeContainer, text, args...)))
}
/*
@@ -521,21 +573,21 @@ var XDescribe = PDescribe
/* Context is an alias for Describe - it generates the exact same kind of Container node */
var Context, FContext, PContext, XContext = Describe, FDescribe, PDescribe, XDescribe
-/* When is an alias for Describe - it generates the exact same kind of Container node */
+/* When is an alias for Describe - it generates the exact same kind of Container node with "when " as prefix for the text. */
func When(text string, args ...any) bool {
- return pushNode(internal.NewNode(deprecationTracker, types.NodeTypeContainer, "when "+text, args...))
+ return pushNode(internal.NewNode(internal.TransformNewNodeArgs(exitIfErrors, deprecationTracker, types.NodeTypeContainer, "when "+text, args...)))
}
-/* When is an alias for Describe - it generates the exact same kind of Container node */
+/* When is an alias for Describe - it generates the exact same kind of Container node with "when " as prefix for the text. */
func FWhen(text string, args ...any) bool {
args = append(args, internal.Focus)
- return pushNode(internal.NewNode(deprecationTracker, types.NodeTypeContainer, "when "+text, args...))
+ return pushNode(internal.NewNode(internal.TransformNewNodeArgs(exitIfErrors, deprecationTracker, types.NodeTypeContainer, "when "+text, args...)))
}
/* When is an alias for Describe - it generates the exact same kind of Container node */
func PWhen(text string, args ...any) bool {
args = append(args, internal.Pending)
- return pushNode(internal.NewNode(deprecationTracker, types.NodeTypeContainer, "when "+text, args...))
+ return pushNode(internal.NewNode(internal.TransformNewNodeArgs(exitIfErrors, deprecationTracker, types.NodeTypeContainer, "when "+text, args...)))
}
var XWhen = PWhen
@@ -551,7 +603,7 @@ You can learn more at https://onsi.github.io/ginkgo/#spec-subjects-it
In addition, subject nodes can be decorated with a variety of decorators. You can learn more here: https://onsi.github.io/ginkgo/#decorator-reference
*/
func It(text string, args ...any) bool {
- return pushNode(internal.NewNode(deprecationTracker, types.NodeTypeIt, text, args...))
+ return pushNode(internal.NewNode(internal.TransformNewNodeArgs(exitIfErrors, deprecationTracker, types.NodeTypeIt, text, args...)))
}
/*
@@ -559,7 +611,7 @@ FIt allows you to focus an individual It.
*/
func FIt(text string, args ...any) bool {
args = append(args, internal.Focus)
- return pushNode(internal.NewNode(deprecationTracker, types.NodeTypeIt, text, args...))
+ return pushNode(internal.NewNode(internal.TransformNewNodeArgs(exitIfErrors, deprecationTracker, types.NodeTypeIt, text, args...)))
}
/*
@@ -567,7 +619,7 @@ PIt allows you to mark an individual It as pending.
*/
func PIt(text string, args ...any) bool {
args = append(args, internal.Pending)
- return pushNode(internal.NewNode(deprecationTracker, types.NodeTypeIt, text, args...))
+ return pushNode(internal.NewNode(internal.TransformNewNodeArgs(exitIfErrors, deprecationTracker, types.NodeTypeIt, text, args...)))
}
/*
@@ -614,7 +666,7 @@ You can learn more here: https://onsi.github.io/ginkgo/#suite-setup-and-cleanup-
func BeforeSuite(body any, args ...any) bool {
combinedArgs := []any{body}
combinedArgs = append(combinedArgs, args...)
- return pushNode(internal.NewNode(deprecationTracker, types.NodeTypeBeforeSuite, "", combinedArgs...))
+ return pushNode(internal.NewNode(internal.TransformNewNodeArgs(exitIfErrors, deprecationTracker, types.NodeTypeBeforeSuite, "", combinedArgs...)))
}
/*
@@ -633,7 +685,7 @@ You can learn more here: https://onsi.github.io/ginkgo/#suite-setup-and-cleanup-
func AfterSuite(body any, args ...any) bool {
combinedArgs := []any{body}
combinedArgs = append(combinedArgs, args...)
- return pushNode(internal.NewNode(deprecationTracker, types.NodeTypeAfterSuite, "", combinedArgs...))
+ return pushNode(internal.NewNode(internal.TransformNewNodeArgs(exitIfErrors, deprecationTracker, types.NodeTypeAfterSuite, "", combinedArgs...)))
}
/*
@@ -671,7 +723,7 @@ func SynchronizedBeforeSuite(process1Body any, allProcessBody any, args ...any)
combinedArgs := []any{process1Body, allProcessBody}
combinedArgs = append(combinedArgs, args...)
- return pushNode(internal.NewNode(deprecationTracker, types.NodeTypeSynchronizedBeforeSuite, "", combinedArgs...))
+ return pushNode(internal.NewNode(internal.TransformNewNodeArgs(exitIfErrors, deprecationTracker, types.NodeTypeSynchronizedBeforeSuite, "", combinedArgs...)))
}
/*
@@ -691,7 +743,7 @@ func SynchronizedAfterSuite(allProcessBody any, process1Body any, args ...any) b
combinedArgs := []any{allProcessBody, process1Body}
combinedArgs = append(combinedArgs, args...)
- return pushNode(internal.NewNode(deprecationTracker, types.NodeTypeSynchronizedAfterSuite, "", combinedArgs...))
+ return pushNode(internal.NewNode(internal.TransformNewNodeArgs(exitIfErrors, deprecationTracker, types.NodeTypeSynchronizedAfterSuite, "", combinedArgs...)))
}
/*
@@ -704,7 +756,7 @@ You cannot nest any other Ginkgo nodes within a BeforeEach node's closure.
You can learn more here: https://onsi.github.io/ginkgo/#extracting-common-setup-beforeeach
*/
func BeforeEach(args ...any) bool {
- return pushNode(internal.NewNode(deprecationTracker, types.NodeTypeBeforeEach, "", args...))
+ return pushNode(internal.NewNode(internal.TransformNewNodeArgs(exitIfErrors, deprecationTracker, types.NodeTypeBeforeEach, "", args...)))
}
/*
@@ -717,7 +769,7 @@ You cannot nest any other Ginkgo nodes within a JustBeforeEach node's closure.
You can learn more and see some examples here: https://onsi.github.io/ginkgo/#separating-creation-and-configuration-justbeforeeach
*/
func JustBeforeEach(args ...any) bool {
- return pushNode(internal.NewNode(deprecationTracker, types.NodeTypeJustBeforeEach, "", args...))
+ return pushNode(internal.NewNode(internal.TransformNewNodeArgs(exitIfErrors, deprecationTracker, types.NodeTypeJustBeforeEach, "", args...)))
}
/*
@@ -732,7 +784,7 @@ You cannot nest any other Ginkgo nodes within an AfterEach node's closure.
You can learn more here: https://onsi.github.io/ginkgo/#spec-cleanup-aftereach-and-defercleanup
*/
func AfterEach(args ...any) bool {
- return pushNode(internal.NewNode(deprecationTracker, types.NodeTypeAfterEach, "", args...))
+ return pushNode(internal.NewNode(internal.TransformNewNodeArgs(exitIfErrors, deprecationTracker, types.NodeTypeAfterEach, "", args...)))
}
/*
@@ -744,7 +796,7 @@ You cannot nest any other Ginkgo nodes within a JustAfterEach node's closure.
You can learn more and see some examples here: https://onsi.github.io/ginkgo/#separating-diagnostics-collection-and-teardown-justaftereach
*/
func JustAfterEach(args ...any) bool {
- return pushNode(internal.NewNode(deprecationTracker, types.NodeTypeJustAfterEach, "", args...))
+ return pushNode(internal.NewNode(internal.TransformNewNodeArgs(exitIfErrors, deprecationTracker, types.NodeTypeJustAfterEach, "", args...)))
}
/*
@@ -759,7 +811,7 @@ You can learn more about Ordered Containers at: https://onsi.github.io/ginkgo/#o
And you can learn more about BeforeAll at: https://onsi.github.io/ginkgo/#setup-in-ordered-containers-beforeall-and-afterall
*/
func BeforeAll(args ...any) bool {
- return pushNode(internal.NewNode(deprecationTracker, types.NodeTypeBeforeAll, "", args...))
+ return pushNode(internal.NewNode(internal.TransformNewNodeArgs(exitIfErrors, deprecationTracker, types.NodeTypeBeforeAll, "", args...)))
}
/*
@@ -776,7 +828,7 @@ You can learn more about Ordered Containers at: https://onsi.github.io/ginkgo/#o
And you can learn more about AfterAll at: https://onsi.github.io/ginkgo/#setup-in-ordered-containers-beforeall-and-afterall
*/
func AfterAll(args ...any) bool {
- return pushNode(internal.NewNode(deprecationTracker, types.NodeTypeAfterAll, "", args...))
+ return pushNode(internal.NewNode(internal.TransformNewNodeArgs(exitIfErrors, deprecationTracker, types.NodeTypeAfterAll, "", args...)))
}
/*
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/decorator_dsl.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/decorator_dsl.go
index c65af4ce1..e331d7cf8 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/decorator_dsl.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/decorator_dsl.go
@@ -2,6 +2,7 @@ package ginkgo
import (
"github.com/onsi/ginkgo/v2/internal"
+ "github.com/onsi/ginkgo/v2/types"
)
/*
@@ -99,6 +100,23 @@ You can learn more here: https://onsi.github.io/ginkgo/#spec-labels
*/
type Labels = internal.Labels
+/*
+SemVerConstraint decorates specs with SemVerConstraints. Multiple semantic version constraints can be passed to SemVerConstraint and these strings must follow the semantic version constraint rules.
+SemVerConstraints can be applied to container and subject nodes, but not setup nodes. You can provide multiple SemVerConstraints to a given node and a spec's semantic version constraints is the union of all semantic version constraints in its node hierarchy.
+
+You can learn more here: https://onsi.github.io/ginkgo/#spec-semantic-version-filtering
+You can learn more about decorators here: https://onsi.github.io/ginkgo/#decorator-reference
+*/
+func SemVerConstraint(semVerConstraints ...string) SemVerConstraints {
+ return SemVerConstraints(semVerConstraints)
+}
+
+/*
+SemVerConstraints are the type for spec SemVerConstraint decorators. Use SemVerConstraint(...) to construct SemVerConstraints.
+You can learn more here: https://onsi.github.io/ginkgo/#spec-semantic-version-filtering
+*/
+type SemVerConstraints = internal.SemVerConstraints
+
/*
PollProgressAfter allows you to override the configured value for --poll-progress-after for a particular node.
@@ -136,8 +154,40 @@ Nodes that do not finish within a GracePeriod will be leaked and Ginkgo will pro
*/
type GracePeriod = internal.GracePeriod
+/*
+SpecPriority allows you to assign a priority to a spec or container.
+
+Specs with higher priority will be scheduled to run before specs with lower priority. The default priority is 0 and negative priorities are allowed.
+*/
+type SpecPriority = internal.SpecPriority
+
/*
SuppressProgressReporting is a decorator that allows you to disable progress reporting of a particular node. This is useful if `ginkgo -v -progress` is generating too much noise; particularly
if you have a `ReportAfterEach` node that is running for every skipped spec and is generating lots of progress reports.
*/
const SuppressProgressReporting = internal.SuppressProgressReporting
+
+/*
+AroundNode registers a function that runs before each individual node. This is considered a more advanced decorator.
+
+Please read the [docs](https://onsi.github.io/ginkgo/#advanced-around-node) for more information.
+
+Allowed signatures:
+
+- AroundNode(func()) - func will be called before the node is run.
+- AroundNode(func(ctx context.Context) context.Context) - func can wrap the passed in context and return a new one which will be passed on to the node.
+- AroundNode(func(ctx context.Context, body func(ctx context.Context))) - ctx is the context for the node and body is a function that must be called to run the node. This gives you complete control over what runs before and after the node.
+
+Multiple AroundNode decorators can be applied to a single node and they will run in the order they are applied.
+
+Unlike setup nodes like BeforeEach and DeferCleanup, AroundNode is guaranteed to run in the same goroutine as the decorated node. This is necessary when working with lower-level libraries that must run on a single thread (you can call runtime.LockOSThread() in the AroundNode to ensure that the node runs on a single thread).
+
+Since AroundNode allows you to modify the context you can also use AroundNode to implement shared setup that attaches values to the context. You must return a context that inherits from the passed in context.
+
+If applied to a container, AroundNode will run before every node in the container. Including setup nodes like BeforeEach and DeferCleanup.
+
+AroundNode can also be applied to RunSpecs to run before every node in the suite.
+*/
+func AroundNode[F types.AroundNodeAllowedFuncs](f F) types.AroundNodeDecorator {
+ return types.AroundNode(f, types.NewCodeLocation(1))
+}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs.go
new file mode 100644
index 000000000..ee6ac7b5f
--- /dev/null
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs.go
@@ -0,0 +1,8 @@
+//go:build !go1.25
+// +build !go1.25
+
+package main
+
+import (
+ _ "github.com/onsi/ginkgo/v2/ginkgo/automaxprocs"
+)
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/README.md b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/README.md
new file mode 100644
index 000000000..e249ebe8b
--- /dev/null
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/README.md
@@ -0,0 +1,3 @@
+This entire directory is a lightly modified clone of https://github.com/uber-go/automaxprocs
+
+It will be removed when Go 1.26 ships and we no longer need to support Go 1.24 (which does not correctly autodetect maxprocs in containers).
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/automaxprocs.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/automaxprocs.go
new file mode 100644
index 000000000..8a762b51d
--- /dev/null
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/automaxprocs.go
@@ -0,0 +1,71 @@
+// Copyright (c) 2017 Uber Technologies, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+// Package maxprocs lets Go programs easily configure runtime.GOMAXPROCS to
+// match the configured Linux CPU quota. Unlike the top-level automaxprocs
+// package, it lets the caller configure logging and handle errors.
+package automaxprocs
+
+import (
+ "os"
+ "runtime"
+)
+
+func init() {
+ Set()
+}
+
+const _maxProcsKey = "GOMAXPROCS"
+
+type config struct {
+ procs func(int, func(v float64) int) (int, CPUQuotaStatus, error)
+ minGOMAXPROCS int
+ roundQuotaFunc func(v float64) int
+}
+
+// Set GOMAXPROCS to match the Linux container CPU quota (if any), returning
+// any error encountered and an undo function.
+//
+// Set is a no-op on non-Linux systems and in Linux environments without a
+// configured CPU quota.
+func Set() error {
+ cfg := &config{
+ procs: CPUQuotaToGOMAXPROCS,
+ roundQuotaFunc: DefaultRoundFunc,
+ minGOMAXPROCS: 1,
+ }
+
+ // Honor the GOMAXPROCS environment variable if present. Otherwise, amend
+ // `runtime.GOMAXPROCS()` with the current process' CPU quota if the OS is
+ // Linux, and guarantee a minimum value of 1. The minimum guaranteed value
+ // can be overridden using `maxprocs.Min()`.
+ if _, exists := os.LookupEnv(_maxProcsKey); exists {
+ return nil
+ }
+ maxProcs, status, err := cfg.procs(cfg.minGOMAXPROCS, cfg.roundQuotaFunc)
+ if err != nil {
+ return err
+ }
+ if status == CPUQuotaUndefined {
+ return nil
+ }
+ runtime.GOMAXPROCS(maxProcs)
+ return nil
+}
diff --git a/openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/cgroups/cgroup.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/cgroup.go
similarity index 99%
rename from openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/cgroups/cgroup.go
rename to openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/cgroup.go
index fe4ecf561..a4676933e 100644
--- a/openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/cgroups/cgroup.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/cgroup.go
@@ -21,7 +21,7 @@
//go:build linux
// +build linux
-package cgroups
+package automaxprocs
import (
"bufio"
diff --git a/openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/cgroups/cgroups.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/cgroups.go
similarity index 99%
rename from openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/cgroups/cgroups.go
rename to openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/cgroups.go
index e89f54360..ed384891e 100644
--- a/openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/cgroups/cgroups.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/cgroups.go
@@ -21,7 +21,7 @@
//go:build linux
// +build linux
-package cgroups
+package automaxprocs
const (
// _cgroupFSType is the Linux CGroup file system type used in
diff --git a/openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/cgroups/cgroups2.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/cgroups2.go
similarity index 99%
rename from openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/cgroups/cgroups2.go
rename to openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/cgroups2.go
index 78556062f..69a0be6b7 100644
--- a/openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/cgroups/cgroups2.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/cgroups2.go
@@ -21,7 +21,7 @@
//go:build linux
// +build linux
-package cgroups
+package automaxprocs
import (
"bufio"
diff --git a/openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/runtime/cpu_quota_linux.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/cpu_quota_linux.go
similarity index 91%
rename from openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/runtime/cpu_quota_linux.go
rename to openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/cpu_quota_linux.go
index f9057fd27..2d83343bd 100644
--- a/openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/runtime/cpu_quota_linux.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/cpu_quota_linux.go
@@ -21,12 +21,10 @@
//go:build linux
// +build linux
-package runtime
+package automaxprocs
import (
"errors"
-
- cg "go.uber.org/automaxprocs/internal/cgroups"
)
// CPUQuotaToGOMAXPROCS converts the CPU quota applied to the calling process
@@ -58,8 +56,8 @@ type queryer interface {
}
var (
- _newCgroups2 = cg.NewCGroups2ForCurrentProcess
- _newCgroups = cg.NewCGroupsForCurrentProcess
+ _newCgroups2 = NewCGroups2ForCurrentProcess
+ _newCgroups = NewCGroupsForCurrentProcess
_newQueryer = newQueryer
)
@@ -68,7 +66,7 @@ func newQueryer() (queryer, error) {
if err == nil {
return cgroups, nil
}
- if errors.Is(err, cg.ErrNotV2) {
+ if errors.Is(err, ErrNotV2) {
return _newCgroups()
}
return nil, err
diff --git a/openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/runtime/cpu_quota_unsupported.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/cpu_quota_unsupported.go
similarity index 98%
rename from openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/runtime/cpu_quota_unsupported.go
rename to openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/cpu_quota_unsupported.go
index e74701508..d2d61e894 100644
--- a/openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/runtime/cpu_quota_unsupported.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/cpu_quota_unsupported.go
@@ -21,7 +21,7 @@
//go:build !linux
// +build !linux
-package runtime
+package automaxprocs
// CPUQuotaToGOMAXPROCS converts the CPU quota applied to the calling process
// to a valid GOMAXPROCS value. This is Linux-specific and not supported in the
diff --git a/openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/cgroups/errors.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/errors.go
similarity index 98%
rename from openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/cgroups/errors.go
rename to openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/errors.go
index 94ac75a46..2e235d7d6 100644
--- a/openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/cgroups/errors.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/errors.go
@@ -21,7 +21,7 @@
//go:build linux
// +build linux
-package cgroups
+package automaxprocs
import "fmt"
diff --git a/openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/cgroups/mountpoint.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/mountpoint.go
similarity index 99%
rename from openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/cgroups/mountpoint.go
rename to openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/mountpoint.go
index f3877f78a..7c3fa306e 100644
--- a/openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/cgroups/mountpoint.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/mountpoint.go
@@ -21,7 +21,7 @@
//go:build linux
// +build linux
-package cgroups
+package automaxprocs
import (
"bufio"
diff --git a/openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/runtime/runtime.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/runtime.go
similarity index 98%
rename from openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/runtime/runtime.go
rename to openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/runtime.go
index f8a2834ac..b8ec7e502 100644
--- a/openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/runtime/runtime.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/runtime.go
@@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-package runtime
+package automaxprocs
import "math"
diff --git a/openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/cgroups/subsys.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/subsys.go
similarity index 99%
rename from openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/cgroups/subsys.go
rename to openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/subsys.go
index cddc3eaec..881ebd590 100644
--- a/openshift/default-catalog-consistency/vendor/go.uber.org/automaxprocs/internal/cgroups/subsys.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/automaxprocs/subsys.go
@@ -21,7 +21,7 @@
//go:build linux
// +build linux
-package cgroups
+package automaxprocs
import (
"bufio"
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/build/build_command.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/build/build_command.go
index 2b36b2feb..3021dfec2 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/build/build_command.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/build/build_command.go
@@ -29,7 +29,6 @@ func BuildBuildCommand() command.Command {
var errors []error
cliConfig, goFlagsConfig, errors = types.VetAndInitializeCLIAndGoConfig(cliConfig, goFlagsConfig)
command.AbortIfErrors("Ginkgo detected configuration issues:", errors)
-
buildSpecs(args, cliConfig, goFlagsConfig)
},
}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/profiles_and_reports.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/profiles_and_reports.go
index 8e16d2bb0..f3439a3f0 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/profiles_and_reports.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/profiles_and_reports.go
@@ -90,6 +90,9 @@ func FinalizeProfilesAndReportsForSuites(suites TestSuites, cliConfig types.CLIC
if reporterConfig.JSONReport != "" {
reportFormats = append(reportFormats, reportFormat{ReportName: reporterConfig.JSONReport, GenerateFunc: reporters.GenerateJSONReport, MergeFunc: reporters.MergeAndCleanupJSONReports})
}
+ if reporterConfig.GoJSONReport != "" {
+ reportFormats = append(reportFormats, reportFormat{ReportName: reporterConfig.GoJSONReport, GenerateFunc: reporters.GenerateGoTestJSONReport, MergeFunc: reporters.MergeAndCleanupGoTestJSONReports})
+ }
if reporterConfig.JUnitReport != "" {
reportFormats = append(reportFormats, reportFormat{ReportName: reporterConfig.JUnitReport, GenerateFunc: reporters.GenerateJUnitReport, MergeFunc: reporters.MergeAndCleanupJUnitReports})
}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/run.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/run.go
index 41052ea19..30d8096cd 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/run.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/run.go
@@ -107,6 +107,9 @@ func runSerial(suite TestSuite, ginkgoConfig types.SuiteConfig, reporterConfig t
if reporterConfig.JSONReport != "" {
reporterConfig.JSONReport = AbsPathForGeneratedAsset(reporterConfig.JSONReport, suite, cliConfig, 0)
}
+ if reporterConfig.GoJSONReport != "" {
+ reporterConfig.GoJSONReport = AbsPathForGeneratedAsset(reporterConfig.GoJSONReport, suite, cliConfig, 0)
+ }
if reporterConfig.JUnitReport != "" {
reporterConfig.JUnitReport = AbsPathForGeneratedAsset(reporterConfig.JUnitReport, suite, cliConfig, 0)
}
@@ -179,6 +182,9 @@ func runParallel(suite TestSuite, ginkgoConfig types.SuiteConfig, reporterConfig
if reporterConfig.JSONReport != "" {
reporterConfig.JSONReport = AbsPathForGeneratedAsset(reporterConfig.JSONReport, suite, cliConfig, 0)
}
+ if reporterConfig.GoJSONReport != "" {
+ reporterConfig.GoJSONReport = AbsPathForGeneratedAsset(reporterConfig.GoJSONReport, suite, cliConfig, 0)
+ }
if reporterConfig.JUnitReport != "" {
reporterConfig.JUnitReport = AbsPathForGeneratedAsset(reporterConfig.JUnitReport, suite, cliConfig, 0)
}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/main.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/main.go
index bd6b8fbff..419589b48 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/main.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/main.go
@@ -3,7 +3,6 @@ package main
import (
"fmt"
"os"
- _ "go.uber.org/automaxprocs"
"github.com/onsi/ginkgo/v2/ginkgo/build"
"github.com/onsi/ginkgo/v2/ginkgo/command"
"github.com/onsi/ginkgo/v2/ginkgo/generators"
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/dependencies.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/dependencies.go
index a34d94354..75cbdb496 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/dependencies.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/dependencies.go
@@ -2,12 +2,9 @@ package watch
import (
"go/build"
- "regexp"
+ "strings"
)
-var ginkgoAndGomegaFilter = regexp.MustCompile(`github\.com/onsi/ginkgo|github\.com/onsi/gomega`)
-var ginkgoIntegrationTestFilter = regexp.MustCompile(`github\.com/onsi/ginkgo/integration`) //allow us to integration test this thing
-
type Dependencies struct {
deps map[string]int
}
@@ -78,7 +75,7 @@ func (d Dependencies) resolveAndAdd(deps []string, depth int) {
if err != nil {
continue
}
- if !pkg.Goroot && (!ginkgoAndGomegaFilter.MatchString(pkg.Dir) || ginkgoIntegrationTestFilter.MatchString(pkg.Dir)) {
+ if !pkg.Goroot && (!matchesGinkgoOrGomega(pkg.Dir) || matchesGinkgoIntegration(pkg.Dir)) {
d.addDepIfNotPresent(pkg.Dir, depth)
}
}
@@ -90,3 +87,11 @@ func (d Dependencies) addDepIfNotPresent(dep string, depth int) {
d.deps[dep] = depth
}
}
+
+func matchesGinkgoOrGomega(s string) bool {
+ return strings.Contains(s, "github.com/onsi/ginkgo") || strings.Contains(s, "github.com/onsi/gomega")
+}
+
+func matchesGinkgoIntegration(s string) bool {
+ return strings.Contains(s, "github.com/onsi/ginkgo/integration") // allow us to integration test this thing
+}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo_t_dsl.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo_t_dsl.go
index 993279de2..40d1e1ab5 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo_t_dsl.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/ginkgo_t_dsl.go
@@ -2,6 +2,7 @@ package ginkgo
import (
"context"
+ "io"
"testing"
"github.com/onsi/ginkgo/v2/internal/testingtproxy"
@@ -69,6 +70,8 @@ type GinkgoTInterface interface {
Skipf(format string, args ...any)
Skipped() bool
TempDir() string
+ Attr(key, value string)
+ Output() io.Writer
}
/*
@@ -187,3 +190,9 @@ func (g *GinkgoTBWrapper) Skipped() bool {
func (g *GinkgoTBWrapper) TempDir() string {
return g.GinkgoT.TempDir()
}
+func (g *GinkgoTBWrapper) Attr(key, value string) {
+ g.GinkgoT.Attr(key, value)
+}
+func (g *GinkgoTBWrapper) Output() io.Writer {
+ return g.GinkgoT.Output()
+}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/around_node.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/around_node.go
new file mode 100644
index 000000000..c96571020
--- /dev/null
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/around_node.go
@@ -0,0 +1,34 @@
+package internal
+
+import (
+ "github.com/onsi/ginkgo/v2/types"
+)
+
+func ComputeAroundNodes(specs Specs) Specs {
+ out := Specs{}
+ for _, spec := range specs {
+ nodes := Nodes{}
+ currentNestingLevel := 0
+ aroundNodes := types.AroundNodes{}
+ nestingLevelIndices := []int{}
+ for _, node := range spec.Nodes {
+ switch node.NodeType {
+ case types.NodeTypeContainer:
+ currentNestingLevel = node.NestingLevel + 1
+ nestingLevelIndices = append(nestingLevelIndices, len(aroundNodes))
+ aroundNodes = aroundNodes.Append(node.AroundNodes...)
+ nodes = append(nodes, node)
+ default:
+ if currentNestingLevel > node.NestingLevel {
+ currentNestingLevel = node.NestingLevel
+ aroundNodes = aroundNodes[:nestingLevelIndices[currentNestingLevel]]
+ }
+ node.AroundNodes = types.AroundNodes{}.Append(aroundNodes...).Append(node.AroundNodes...)
+ nodes = append(nodes, node)
+ }
+ }
+ spec.Nodes = nodes
+ out = append(out, spec)
+ }
+ return out
+}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/focus.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/focus.go
index e3da7d14d..a39daf5a6 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/focus.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/focus.go
@@ -56,7 +56,7 @@ This function sets the `Skip` property on specs by applying Ginkgo's focus polic
*Note:* specs with pending nodes are Skipped when created by NewSpec.
*/
-func ApplyFocusToSpecs(specs Specs, description string, suiteLabels Labels, suiteConfig types.SuiteConfig) (Specs, bool) {
+func ApplyFocusToSpecs(specs Specs, description string, suiteLabels Labels, suiteSemVerConstraints SemVerConstraints, suiteConfig types.SuiteConfig) (Specs, bool) {
focusString := strings.Join(suiteConfig.FocusStrings, "|")
skipString := strings.Join(suiteConfig.SkipStrings, "|")
@@ -84,6 +84,13 @@ func ApplyFocusToSpecs(specs Specs, description string, suiteLabels Labels, suit
})
}
+ if suiteConfig.SemVerFilter != "" {
+ semVerFilter, _ := types.ParseSemVerFilter(suiteConfig.SemVerFilter)
+ skipChecks = append(skipChecks, func(spec Spec) bool {
+ return !semVerFilter(UnionOfSemVerConstraints(suiteSemVerConstraints, spec.Nodes.UnionOfSemVerConstraints()))
+ })
+ }
+
if len(suiteConfig.FocusFiles) > 0 {
focusFilters, _ := types.ParseFileFilters(suiteConfig.FocusFiles)
skipChecks = append(skipChecks, func(spec Spec) bool { return !focusFilters.Matches(spec.Nodes.CodeLocations()) })
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/group.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/group.go
index 02c9fe4fc..cc794903e 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/group.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/group.go
@@ -110,21 +110,53 @@ func newGroup(suite *Suite) *group {
}
}
+// initialReportForSpec constructs a new SpecReport right before running the spec.
func (g *group) initialReportForSpec(spec Spec) types.SpecReport {
return types.SpecReport{
- ContainerHierarchyTexts: spec.Nodes.WithType(types.NodeTypeContainer).Texts(),
- ContainerHierarchyLocations: spec.Nodes.WithType(types.NodeTypeContainer).CodeLocations(),
- ContainerHierarchyLabels: spec.Nodes.WithType(types.NodeTypeContainer).Labels(),
- LeafNodeLocation: spec.FirstNodeWithType(types.NodeTypeIt).CodeLocation,
- LeafNodeType: types.NodeTypeIt,
- LeafNodeText: spec.FirstNodeWithType(types.NodeTypeIt).Text,
- LeafNodeLabels: []string(spec.FirstNodeWithType(types.NodeTypeIt).Labels),
- ParallelProcess: g.suite.config.ParallelProcess,
- RunningInParallel: g.suite.isRunningInParallel(),
- IsSerial: spec.Nodes.HasNodeMarkedSerial(),
- IsInOrderedContainer: !spec.Nodes.FirstNodeMarkedOrdered().IsZero(),
- MaxFlakeAttempts: spec.Nodes.GetMaxFlakeAttempts(),
- MaxMustPassRepeatedly: spec.Nodes.GetMaxMustPassRepeatedly(),
+ ContainerHierarchyTexts: spec.Nodes.WithType(types.NodeTypeContainer).Texts(),
+ ContainerHierarchyLocations: spec.Nodes.WithType(types.NodeTypeContainer).CodeLocations(),
+ ContainerHierarchyLabels: spec.Nodes.WithType(types.NodeTypeContainer).Labels(),
+ ContainerHierarchySemVerConstraints: spec.Nodes.WithType(types.NodeTypeContainer).SemVerConstraints(),
+ LeafNodeLocation: spec.FirstNodeWithType(types.NodeTypeIt).CodeLocation,
+ LeafNodeType: types.NodeTypeIt,
+ LeafNodeText: spec.FirstNodeWithType(types.NodeTypeIt).Text,
+ LeafNodeLabels: []string(spec.FirstNodeWithType(types.NodeTypeIt).Labels),
+ LeafNodeSemVerConstraints: []string(spec.FirstNodeWithType(types.NodeTypeIt).SemVerConstraints),
+ ParallelProcess: g.suite.config.ParallelProcess,
+ RunningInParallel: g.suite.isRunningInParallel(),
+ IsSerial: spec.Nodes.HasNodeMarkedSerial(),
+ IsInOrderedContainer: !spec.Nodes.FirstNodeMarkedOrdered().IsZero(),
+ MaxFlakeAttempts: spec.Nodes.GetMaxFlakeAttempts(),
+ MaxMustPassRepeatedly: spec.Nodes.GetMaxMustPassRepeatedly(),
+ SpecPriority: spec.Nodes.GetSpecPriority(),
+ }
+}
+
+// constructionNodeReportForTreeNode constructs a new SpecReport right before invoking the body
+// of a container node during construction of the full tree.
+func constructionNodeReportForTreeNode(node *TreeNode) *types.ConstructionNodeReport {
+ var report types.ConstructionNodeReport
+ // Walk up the tree and set attributes accordingly.
+ addNodeToReportForNode(&report, node)
+ return &report
+}
+
+// addNodeToReportForNode is conceptually similar to initialReportForSpec and therefore placed here
+// although it doesn't do anything with a group.
+func addNodeToReportForNode(report *types.ConstructionNodeReport, node *TreeNode) {
+ if node.Parent != nil {
+ // First add the parent node, then the current one.
+ addNodeToReportForNode(report, node.Parent)
+ }
+ report.ContainerHierarchyTexts = append(report.ContainerHierarchyTexts, node.Node.Text)
+ report.ContainerHierarchyLocations = append(report.ContainerHierarchyLocations, node.Node.CodeLocation)
+ report.ContainerHierarchyLabels = append(report.ContainerHierarchyLabels, node.Node.Labels)
+ report.ContainerHierarchySemVerConstraints = append(report.ContainerHierarchySemVerConstraints, node.Node.SemVerConstraints)
+ if node.Node.MarkedSerial {
+ report.IsSerial = true
+ }
+ if node.Node.MarkedOrdered {
+ report.IsInOrderedContainer = true
}
}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/node.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/node.go
index 8096950b6..2bccec2db 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/node.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/node.go
@@ -4,6 +4,7 @@ import (
"context"
"fmt"
"reflect"
+ "slices"
"sort"
"sync"
"time"
@@ -46,20 +47,24 @@ type Node struct {
ReportEachBody func(SpecContext, types.SpecReport)
ReportSuiteBody func(SpecContext, types.Report)
- MarkedFocus bool
- MarkedPending bool
- MarkedSerial bool
- MarkedOrdered bool
- MarkedContinueOnFailure bool
- MarkedOncePerOrdered bool
- FlakeAttempts int
- MustPassRepeatedly int
- Labels Labels
- PollProgressAfter time.Duration
- PollProgressInterval time.Duration
- NodeTimeout time.Duration
- SpecTimeout time.Duration
- GracePeriod time.Duration
+ MarkedFocus bool
+ MarkedPending bool
+ MarkedSerial bool
+ MarkedOrdered bool
+ MarkedContinueOnFailure bool
+ MarkedOncePerOrdered bool
+ FlakeAttempts int
+ MustPassRepeatedly int
+ Labels Labels
+ SemVerConstraints SemVerConstraints
+ PollProgressAfter time.Duration
+ PollProgressInterval time.Duration
+ NodeTimeout time.Duration
+ SpecTimeout time.Duration
+ GracePeriod time.Duration
+ AroundNodes types.AroundNodes
+ HasExplicitlySetSpecPriority bool
+ SpecPriority int
NodeIDWhereCleanupWasGenerated uint
}
@@ -85,31 +90,47 @@ type FlakeAttempts uint
type MustPassRepeatedly uint
type Offset uint
type Done chan<- any // Deprecated Done Channel for asynchronous testing
-type Labels []string
type PollProgressInterval time.Duration
type PollProgressAfter time.Duration
type NodeTimeout time.Duration
type SpecTimeout time.Duration
type GracePeriod time.Duration
+type SpecPriority int
+
+type Labels []string
func (l Labels) MatchesLabelFilter(query string) bool {
return types.MustParseLabelFilter(query)(l)
}
-func UnionOfLabels(labels ...Labels) Labels {
- out := Labels{}
- seen := map[string]bool{}
- for _, labelSet := range labels {
- for _, label := range labelSet {
- if !seen[label] {
- seen[label] = true
- out = append(out, label)
+type SemVerConstraints []string
+
+func (svc SemVerConstraints) MatchesSemVerFilter(version string) bool {
+ return types.MustParseSemVerFilter(version)(svc)
+}
+
+func unionOf[S ~[]E, E comparable](slices ...S) S {
+ out := S{}
+ seen := map[E]bool{}
+ for _, slice := range slices {
+ for _, item := range slice {
+ if !seen[item] {
+ seen[item] = true
+ out = append(out, item)
}
}
}
return out
}
+func UnionOfLabels(labels ...Labels) Labels {
+ return unionOf(labels...)
+}
+
+func UnionOfSemVerConstraints(semVerConstraints ...SemVerConstraints) SemVerConstraints {
+ return unionOf(semVerConstraints...)
+}
+
func PartitionDecorations(args ...any) ([]any, []any) {
decorations := []any{}
remainingArgs := []any{}
@@ -151,6 +172,8 @@ func isDecoration(arg any) bool {
return true
case t == reflect.TypeOf(Labels{}):
return true
+ case t == reflect.TypeOf(SemVerConstraints{}):
+ return true
case t == reflect.TypeOf(PollProgressInterval(0)):
return true
case t == reflect.TypeOf(PollProgressAfter(0)):
@@ -161,6 +184,10 @@ func isDecoration(arg any) bool {
return true
case t == reflect.TypeOf(GracePeriod(0)):
return true
+ case t == reflect.TypeOf(types.AroundNodeDecorator{}):
+ return true
+ case t == reflect.TypeOf(SpecPriority(0)):
+ return true
case t.Kind() == reflect.Slice && isSliceOfDecorations(arg):
return true
default:
@@ -191,6 +218,7 @@ func NewNode(deprecationTracker *types.DeprecationTracker, nodeType types.NodeTy
NodeType: nodeType,
Text: text,
Labels: Labels{},
+ SemVerConstraints: SemVerConstraints{},
CodeLocation: types.NewCodeLocation(baseOffset),
NestingLevel: -1,
PollProgressAfter: -1,
@@ -205,7 +233,7 @@ func NewNode(deprecationTracker *types.DeprecationTracker, nodeType types.NodeTy
}
}
- args = unrollInterfaceSlice(args)
+ args = UnrollInterfaceSlice(args)
remainingArgs := []any{}
// First get the CodeLocation up-to-date
@@ -221,6 +249,7 @@ func NewNode(deprecationTracker *types.DeprecationTracker, nodeType types.NodeTy
}
labelsSeen := map[string]bool{}
+ semVerConstraintsSeen := map[string]bool{}
trackedFunctionError := false
args = remainingArgs
remainingArgs = []any{}
@@ -299,6 +328,14 @@ func NewNode(deprecationTracker *types.DeprecationTracker, nodeType types.NodeTy
if nodeType.Is(types.NodeTypeContainer) {
appendError(types.GinkgoErrors.InvalidDecoratorForNodeType(node.CodeLocation, nodeType, "GracePeriod"))
}
+ case t == reflect.TypeOf(SpecPriority(0)):
+ if !nodeType.Is(types.NodeTypesForContainerAndIt) {
+ appendError(types.GinkgoErrors.InvalidDecoratorForNodeType(node.CodeLocation, nodeType, "SpecPriority"))
+ }
+ node.SpecPriority = int(arg.(SpecPriority))
+ node.HasExplicitlySetSpecPriority = true
+ case t == reflect.TypeOf(types.AroundNodeDecorator{}):
+ node.AroundNodes = append(node.AroundNodes, arg.(types.AroundNodeDecorator))
case t == reflect.TypeOf(Labels{}):
if !nodeType.Is(types.NodeTypesForContainerAndIt) {
appendError(types.GinkgoErrors.InvalidDecoratorForNodeType(node.CodeLocation, nodeType, "Label"))
@@ -311,6 +348,18 @@ func NewNode(deprecationTracker *types.DeprecationTracker, nodeType types.NodeTy
appendError(err)
}
}
+ case t == reflect.TypeOf(SemVerConstraints{}):
+ if !nodeType.Is(types.NodeTypesForContainerAndIt) {
+ appendError(types.GinkgoErrors.InvalidDecoratorForNodeType(node.CodeLocation, nodeType, "SemVerConstraint"))
+ }
+ for _, semVerConstraint := range arg.(SemVerConstraints) {
+ if !semVerConstraintsSeen[semVerConstraint] {
+ semVerConstraintsSeen[semVerConstraint] = true
+ semVerConstraint, err := types.ValidateAndCleanupSemVerConstraint(semVerConstraint, node.CodeLocation)
+ node.SemVerConstraints = append(node.SemVerConstraints, semVerConstraint)
+ appendError(err)
+ }
+ }
case t.Kind() == reflect.Func:
if nodeType.Is(types.NodeTypeContainer) {
if node.Body != nil {
@@ -599,7 +648,7 @@ func NewCleanupNode(deprecationTracker *types.DeprecationTracker, fail func(stri
})
}
- return NewNode(deprecationTracker, types.NodeTypeCleanupInvalid, "", finalArgs...)
+ return NewNode(deprecationTracker, types.NodeTypeCleanupInvalid, "", finalArgs)
}
func (n Node) IsZero() bool {
@@ -824,6 +873,32 @@ func (n Nodes) UnionOfLabels() []string {
return out
}
+func (n Nodes) SemVerConstraints() [][]string {
+ out := make([][]string, len(n))
+ for i := range n {
+ if n[i].SemVerConstraints == nil {
+ out[i] = []string{}
+ } else {
+ out[i] = []string(n[i].SemVerConstraints)
+ }
+ }
+ return out
+}
+
+func (n Nodes) UnionOfSemVerConstraints() []string {
+ out := []string{}
+ seen := map[string]bool{}
+ for i := range n {
+ for _, constraint := range n[i].SemVerConstraints {
+ if !seen[constraint] {
+ seen[constraint] = true
+ out = append(out, constraint)
+ }
+ }
+ }
+ return out
+}
+
func (n Nodes) CodeLocations() []types.CodeLocation {
out := make([]types.CodeLocation, len(n))
for i := range n {
@@ -920,7 +995,16 @@ func (n Nodes) GetMaxMustPassRepeatedly() int {
return maxMustPassRepeatedly
}
-func unrollInterfaceSlice(args any) []any {
+func (n Nodes) GetSpecPriority() int {
+ for i := len(n) - 1; i >= 0; i-- {
+ if n[i].HasExplicitlySetSpecPriority {
+ return n[i].SpecPriority
+ }
+ }
+ return 0
+}
+
+func UnrollInterfaceSlice(args any) []any {
v := reflect.ValueOf(args)
if v.Kind() != reflect.Slice {
return []any{args}
@@ -928,11 +1012,67 @@ func unrollInterfaceSlice(args any) []any {
out := []any{}
for i := 0; i < v.Len(); i++ {
el := reflect.ValueOf(v.Index(i).Interface())
- if el.Kind() == reflect.Slice && el.Type() != reflect.TypeOf(Labels{}) {
- out = append(out, unrollInterfaceSlice(el.Interface())...)
+ if el.Kind() == reflect.Slice && el.Type() != reflect.TypeOf(Labels{}) && el.Type() != reflect.TypeOf(SemVerConstraints{}) {
+ out = append(out, UnrollInterfaceSlice(el.Interface())...)
} else {
out = append(out, v.Index(i).Interface())
}
}
return out
}
+
+type NodeArgsTransformer func(nodeType types.NodeType, offset Offset, text string, args []any) (string, []any, []error)
+
+func AddTreeConstructionNodeArgsTransformer(transformer NodeArgsTransformer) func() {
+ id := nodeArgsTransformerCounter
+ nodeArgsTransformerCounter++
+ nodeArgsTransformers = append(nodeArgsTransformers, registeredNodeArgsTransformer{id, transformer})
+ return func() {
+ nodeArgsTransformers = slices.DeleteFunc(nodeArgsTransformers, func(transformer registeredNodeArgsTransformer) bool {
+ return transformer.id == id
+ })
+ }
+}
+
+var (
+ nodeArgsTransformerCounter int64
+ nodeArgsTransformers []registeredNodeArgsTransformer
+)
+
+type registeredNodeArgsTransformer struct {
+ id int64
+ transformer NodeArgsTransformer
+}
+
+// TransformNewNodeArgs is the helper for DSL functions which handles NodeArgsTransformers.
+//
+// Its return valus are intentionally the same as the internal.NewNode parameters,
+// which makes it possible to chain the invocations:
+//
+// NewNode(transformNewNodeArgs(...))
+func TransformNewNodeArgs(exitIfErrors func([]error), deprecationTracker *types.DeprecationTracker, nodeType types.NodeType, text string, args ...any) (*types.DeprecationTracker, types.NodeType, string, []any) {
+ var errs []error
+
+ // Most recent first...
+ //
+ // This intentionally doesn't use slices.Backward because
+ // using iterators influences stack unwinding.
+ for i := len(nodeArgsTransformers) - 1; i >= 0; i-- {
+ transformer := nodeArgsTransformers[i].transformer
+ args = UnrollInterfaceSlice(args)
+
+ // We do not really need to recompute this on additional loop iterations,
+ // but its fast and simpler this way.
+ var offset Offset
+ for _, arg := range args {
+ if o, ok := arg.(Offset); ok {
+ offset = o
+ }
+ }
+ offset += 3 // The DSL function, this helper, and the TransformNodeArgs implementation.
+
+ text, args, errs = transformer(nodeType, offset, text, args)
+ exitIfErrors(errs)
+ }
+ return deprecationTracker, nodeType, text, args
+}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/ordering.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/ordering.go
index 84eea0a59..da58d54f9 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/ordering.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/ordering.go
@@ -125,7 +125,7 @@ func OrderSpecs(specs Specs, suiteConfig types.SuiteConfig) (GroupedSpecIndices,
// pick out a representative spec
representativeSpec := specs[executionGroups[groupID][0]]
- // and grab the node on the spec that will represent which shufflable group this execution group belongs tu
+ // and grab the node on the spec that will represent which shufflable group this execution group belongs to
shufflableGroupingNode := representativeSpec.Nodes.FirstNodeWithType(nodeTypesToShuffle)
//add the execution group to its shufflable group
@@ -138,14 +138,35 @@ func OrderSpecs(specs Specs, suiteConfig types.SuiteConfig) (GroupedSpecIndices,
}
}
+ // now, for each shuffleable group, we compute the priority
+ shufflableGroupingIDPriorities := map[uint]int{}
+ for shufflableGroupingID, groupIDs := range shufflableGroupingIDToGroupIDs {
+ // the priority of a shufflable grouping is the max priority of any spec in any execution group in the shufflable grouping
+ maxPriority := -1 << 31 // min int
+ for _, groupID := range groupIDs {
+ for _, specIdx := range executionGroups[groupID] {
+ specPriority := specs[specIdx].Nodes.GetSpecPriority()
+ maxPriority = max(specPriority, maxPriority)
+ }
+ }
+ shufflableGroupingIDPriorities[shufflableGroupingID] = maxPriority
+ }
+
// now we permute the sorted shufflable grouping IDs and build the ordered Groups
- orderedGroups := GroupedSpecIndices{}
permutation := r.Perm(len(shufflableGroupingIDs))
- for _, j := range permutation {
- //let's get the execution group IDs for this shufflable group:
- executionGroupIDsForJ := shufflableGroupingIDToGroupIDs[shufflableGroupingIDs[j]]
- // and we'll add their associated specindices to the orderedGroups slice:
- for _, executionGroupID := range executionGroupIDsForJ {
+ shuffledGroupingIds := make([]uint, len(shufflableGroupingIDs))
+ for i, j := range permutation {
+ shuffledGroupingIds[i] = shufflableGroupingIDs[j]
+ }
+ // now, we need to stable sort the shuffledGroupingIds by priority (higher priority first)
+ sort.SliceStable(shuffledGroupingIds, func(i, j int) bool {
+ return shufflableGroupingIDPriorities[shuffledGroupingIds[i]] > shufflableGroupingIDPriorities[shuffledGroupingIds[j]]
+ })
+
+ // we can now take these prioritized, shuffled, groupings and form the final set of ordered spec groups
+ orderedGroups := GroupedSpecIndices{}
+ for _, id := range shuffledGroupingIds {
+ for _, executionGroupID := range shufflableGroupingIDToGroupIDs[id] {
orderedGroups = append(orderedGroups, executionGroups[executionGroupID])
}
}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/progress_report.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/progress_report.go
index 11269cf1f..165cbc4b6 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/progress_report.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/progress_report.go
@@ -236,7 +236,7 @@ func extractRunningGoroutines() ([]types.Goroutine, error) {
}
functionCall.Filename = line[:delimiterIdx]
line = strings.Split(line[delimiterIdx+1:], " ")[0]
- lineNumber, err := strconv.ParseInt(line, 10, 64)
+ lineNumber, err := strconv.ParseInt(line, 10, 32)
functionCall.Line = int(lineNumber)
if err != nil {
return nil, types.GinkgoErrors.FailedToParseStackTrace(fmt.Sprintf("Invalid function call line number: %s\n%s", line, err.Error()))
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/reporters/gojson.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/reporters/gojson.go
new file mode 100644
index 000000000..8b7a9ceab
--- /dev/null
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/reporters/gojson.go
@@ -0,0 +1,158 @@
+package reporters
+
+import (
+ "errors"
+ "fmt"
+ "strings"
+ "time"
+
+ "github.com/onsi/ginkgo/v2/types"
+ "golang.org/x/tools/go/packages"
+)
+
+func ptr[T any](in T) *T {
+ return &in
+}
+
+type encoder interface {
+ Encode(v any) error
+}
+
+// gojsonEvent matches the format from go internals
+// https://github.com/golang/go/blob/master/src/cmd/internal/test2json/test2json.go#L31-L41
+// https://pkg.go.dev/cmd/test2json
+type gojsonEvent struct {
+ Time *time.Time `json:",omitempty"`
+ Action GoJSONAction
+ Package string `json:",omitempty"`
+ Test string `json:",omitempty"`
+ Elapsed *float64 `json:",omitempty"`
+ Output *string `json:",omitempty"`
+ FailedBuild string `json:",omitempty"`
+}
+
+type GoJSONAction string
+
+const (
+ // start - the test binary is about to be executed
+ GoJSONStart GoJSONAction = "start"
+ // run - the test has started running
+ GoJSONRun GoJSONAction = "run"
+ // pause - the test has been paused
+ GoJSONPause GoJSONAction = "pause"
+ // cont - the test has continued running
+ GoJSONCont GoJSONAction = "cont"
+ // pass - the test passed
+ GoJSONPass GoJSONAction = "pass"
+ // bench - the benchmark printed log output but did not fail
+ GoJSONBench GoJSONAction = "bench"
+ // fail - the test or benchmark failed
+ GoJSONFail GoJSONAction = "fail"
+ // output - the test printed output
+ GoJSONOutput GoJSONAction = "output"
+ // skip - the test was skipped or the package contained no tests
+ GoJSONSkip GoJSONAction = "skip"
+)
+
+func goJSONActionFromSpecState(state types.SpecState) GoJSONAction {
+ switch state {
+ case types.SpecStateInvalid:
+ return GoJSONFail
+ case types.SpecStatePending:
+ return GoJSONSkip
+ case types.SpecStateSkipped:
+ return GoJSONSkip
+ case types.SpecStatePassed:
+ return GoJSONPass
+ case types.SpecStateFailed:
+ return GoJSONFail
+ case types.SpecStateAborted:
+ return GoJSONFail
+ case types.SpecStatePanicked:
+ return GoJSONFail
+ case types.SpecStateInterrupted:
+ return GoJSONFail
+ case types.SpecStateTimedout:
+ return GoJSONFail
+ default:
+ panic("unexpected state should not happen")
+ }
+}
+
+// gojsonReport wraps types.Report and calcualtes extra fields requires by gojson
+type gojsonReport struct {
+ o types.Report
+ // Extra calculated fields
+ goPkg string
+ elapsed float64
+}
+
+func newReport(in types.Report) *gojsonReport {
+ return &gojsonReport{
+ o: in,
+ }
+}
+
+func (r *gojsonReport) Fill() error {
+ // NOTE: could the types.Report include the go package name?
+ goPkg, err := suitePathToPkg(r.o.SuitePath)
+ if err != nil {
+ return err
+ }
+ r.goPkg = goPkg
+ r.elapsed = r.o.RunTime.Seconds()
+ return nil
+}
+
+// gojsonSpecReport wraps types.SpecReport and calculates extra fields required by gojson
+type gojsonSpecReport struct {
+ o types.SpecReport
+ // extra calculated fields
+ testName string
+ elapsed float64
+ action GoJSONAction
+}
+
+func newSpecReport(in types.SpecReport) *gojsonSpecReport {
+ return &gojsonSpecReport{
+ o: in,
+ }
+}
+
+func (sr *gojsonSpecReport) Fill() error {
+ sr.elapsed = sr.o.RunTime.Seconds()
+ sr.testName = createTestName(sr.o)
+ sr.action = goJSONActionFromSpecState(sr.o.State)
+ return nil
+}
+
+func suitePathToPkg(dir string) (string, error) {
+ cfg := &packages.Config{
+ Mode: packages.NeedFiles | packages.NeedSyntax,
+ }
+ pkgs, err := packages.Load(cfg, dir)
+ if err != nil {
+ return "", err
+ }
+ if len(pkgs) != 1 {
+ return "", errors.New("error")
+ }
+ return pkgs[0].ID, nil
+}
+
+func createTestName(spec types.SpecReport) string {
+ name := fmt.Sprintf("[%s]", spec.LeafNodeType)
+ if spec.FullText() != "" {
+ name = name + " " + spec.FullText()
+ }
+ labels := spec.Labels()
+ if len(labels) > 0 {
+ name = name + " [" + strings.Join(labels, ", ") + "]"
+ }
+ semVerConstraints := spec.SemVerConstraints()
+ if len(semVerConstraints) > 0 {
+ name = name + " [" + strings.Join(semVerConstraints, ", ") + "]"
+ }
+ name = strings.TrimSpace(name)
+ return name
+}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/reporters/gojson_event_writer.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/reporters/gojson_event_writer.go
new file mode 100644
index 000000000..ec5311d06
--- /dev/null
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/reporters/gojson_event_writer.go
@@ -0,0 +1,111 @@
+package reporters
+
+type GoJSONEventWriter struct {
+ enc encoder
+ specSystemErrFn specSystemExtractFn
+ specSystemOutFn specSystemExtractFn
+}
+
+func NewGoJSONEventWriter(enc encoder, errFn specSystemExtractFn, outFn specSystemExtractFn) *GoJSONEventWriter {
+ return &GoJSONEventWriter{
+ enc: enc,
+ specSystemErrFn: errFn,
+ specSystemOutFn: outFn,
+ }
+}
+
+func (r *GoJSONEventWriter) writeEvent(e *gojsonEvent) error {
+ return r.enc.Encode(e)
+}
+
+func (r *GoJSONEventWriter) WriteSuiteStart(report *gojsonReport) error {
+ e := &gojsonEvent{
+ Time: &report.o.StartTime,
+ Action: GoJSONStart,
+ Package: report.goPkg,
+ Output: nil,
+ FailedBuild: "",
+ }
+ return r.writeEvent(e)
+}
+
+func (r *GoJSONEventWriter) WriteSuiteResult(report *gojsonReport) error {
+ var action GoJSONAction
+ switch {
+ case report.o.PreRunStats.SpecsThatWillRun == 0:
+ action = GoJSONSkip
+ case report.o.SuiteSucceeded:
+ action = GoJSONPass
+ default:
+ action = GoJSONFail
+ }
+ e := &gojsonEvent{
+ Time: &report.o.EndTime,
+ Action: action,
+ Package: report.goPkg,
+ Output: nil,
+ FailedBuild: "",
+ Elapsed: ptr(report.elapsed),
+ }
+ return r.writeEvent(e)
+}
+
+func (r *GoJSONEventWriter) WriteSpecStart(report *gojsonReport, specReport *gojsonSpecReport) error {
+ e := &gojsonEvent{
+ Time: &specReport.o.StartTime,
+ Action: GoJSONRun,
+ Test: specReport.testName,
+ Package: report.goPkg,
+ Output: nil,
+ FailedBuild: "",
+ }
+ return r.writeEvent(e)
+}
+
+func (r *GoJSONEventWriter) WriteSpecOut(report *gojsonReport, specReport *gojsonSpecReport) error {
+ events := []*gojsonEvent{}
+
+ stdErr := r.specSystemErrFn(specReport.o)
+ if stdErr != "" {
+ events = append(events, &gojsonEvent{
+ Time: &specReport.o.EndTime,
+ Action: GoJSONOutput,
+ Test: specReport.testName,
+ Package: report.goPkg,
+ Output: ptr(stdErr),
+ FailedBuild: "",
+ })
+ }
+ stdOut := r.specSystemOutFn(specReport.o)
+ if stdOut != "" {
+ events = append(events, &gojsonEvent{
+ Time: &specReport.o.EndTime,
+ Action: GoJSONOutput,
+ Test: specReport.testName,
+ Package: report.goPkg,
+ Output: ptr(stdOut),
+ FailedBuild: "",
+ })
+ }
+
+ for _, ev := range events {
+ err := r.writeEvent(ev)
+ if err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+func (r *GoJSONEventWriter) WriteSpecResult(report *gojsonReport, specReport *gojsonSpecReport) error {
+ e := &gojsonEvent{
+ Time: &specReport.o.EndTime,
+ Action: specReport.action,
+ Test: specReport.testName,
+ Package: report.goPkg,
+ Elapsed: ptr(specReport.elapsed),
+ Output: nil,
+ FailedBuild: "",
+ }
+ return r.writeEvent(e)
+}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/reporters/gojson_reporter.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/reporters/gojson_reporter.go
new file mode 100644
index 000000000..633e49b88
--- /dev/null
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/reporters/gojson_reporter.go
@@ -0,0 +1,45 @@
+package reporters
+
+import (
+ "github.com/onsi/ginkgo/v2/types"
+)
+
+type GoJSONReporter struct {
+ ev *GoJSONEventWriter
+}
+
+type specSystemExtractFn func (spec types.SpecReport) string
+
+func NewGoJSONReporter(enc encoder, errFn specSystemExtractFn, outFn specSystemExtractFn) *GoJSONReporter {
+ return &GoJSONReporter{
+ ev: NewGoJSONEventWriter(enc, errFn, outFn),
+ }
+}
+
+func (r *GoJSONReporter) Write(originalReport types.Report) error {
+ // suite start events
+ report := newReport(originalReport)
+ err := report.Fill()
+ if err != nil {
+ return err
+ }
+ r.ev.WriteSuiteStart(report)
+ for _, originalSpecReport := range originalReport.SpecReports {
+ specReport := newSpecReport(originalSpecReport)
+ err := specReport.Fill()
+ if err != nil {
+ return err
+ }
+ if specReport.o.LeafNodeType == types.NodeTypeIt {
+ // handle any It leaf node as a spec
+ r.ev.WriteSpecStart(report, specReport)
+ r.ev.WriteSpecOut(report, specReport)
+ r.ev.WriteSpecResult(report, specReport)
+ } else {
+ // handle any other leaf node as generic output
+ r.ev.WriteSpecOut(report, specReport)
+ }
+ }
+ r.ev.WriteSuiteResult(report)
+ return nil
+}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/spec_context.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/spec_context.go
index 2d2ea2fc3..99c9c5f5b 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/spec_context.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/spec_context.go
@@ -2,6 +2,7 @@ package internal
import (
"context"
+ "reflect"
"github.com/onsi/ginkgo/v2/types"
)
@@ -11,6 +12,7 @@ type SpecContext interface {
SpecReport() types.SpecReport
AttachProgressReporter(func() string) func()
+ WrappedContext() context.Context
}
type specContext struct {
@@ -45,3 +47,28 @@ func NewSpecContext(suite *Suite) *specContext {
func (sc *specContext) SpecReport() types.SpecReport {
return sc.suite.CurrentSpecReport()
}
+
+func (sc *specContext) WrappedContext() context.Context {
+ return sc.Context
+}
+
+/*
+The user is allowed to wrap `SpecContext` in a new context.Context when using AroundNodes. But body functions expect SpecContext.
+We support this by taking their context.Context and returning a SpecContext that wraps it.
+*/
+func wrapContextChain(ctx context.Context) SpecContext {
+ if ctx == nil {
+ return nil
+ }
+ if reflect.TypeOf(ctx) == reflect.TypeOf(&specContext{}) {
+ return ctx.(*specContext)
+ } else if sc, ok := ctx.Value("GINKGO_SPEC_CONTEXT").(*specContext); ok {
+ return &specContext{
+ Context: ctx,
+ ProgressReporterManager: sc.ProgressReporterManager,
+ cancel: sc.cancel,
+ suite: sc.suite,
+ }
+ }
+ return nil
+}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/suite.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/suite.go
index 3edf50776..ef76cd099 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/suite.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/suite.go
@@ -32,6 +32,7 @@ type Suite struct {
suiteNodes Nodes
cleanupNodes Nodes
+ aroundNodes types.AroundNodes
failer *Failer
reporter reporters.Reporter
@@ -41,6 +42,8 @@ type Suite struct {
config types.SuiteConfig
deadline time.Time
+ currentConstructionNodeReport *types.ConstructionNodeReport
+
skipAll bool
report types.Report
currentSpecReport types.SpecReport
@@ -87,6 +90,7 @@ func (suite *Suite) Clone() (*Suite, error) {
ProgressReporterManager: NewProgressReporterManager(),
topLevelContainers: suite.topLevelContainers.Clone(),
suiteNodes: suite.suiteNodes.Clone(),
+ aroundNodes: suite.aroundNodes.Clone(),
selectiveLock: &sync.Mutex{},
}, nil
}
@@ -104,13 +108,14 @@ func (suite *Suite) BuildTree() error {
return nil
}
-func (suite *Suite) Run(description string, suiteLabels Labels, suitePath string, failer *Failer, reporter reporters.Reporter, writer WriterInterface, outputInterceptor OutputInterceptor, interruptHandler interrupt_handler.InterruptHandlerInterface, client parallel_support.Client, progressSignalRegistrar ProgressSignalRegistrar, suiteConfig types.SuiteConfig) (bool, bool) {
+func (suite *Suite) Run(description string, suiteLabels Labels, suiteSemVerConstraints SemVerConstraints, suiteAroundNodes types.AroundNodes, suitePath string, failer *Failer, reporter reporters.Reporter, writer WriterInterface, outputInterceptor OutputInterceptor, interruptHandler interrupt_handler.InterruptHandlerInterface, client parallel_support.Client, progressSignalRegistrar ProgressSignalRegistrar, suiteConfig types.SuiteConfig) (bool, bool) {
if suite.phase != PhaseBuildTree {
panic("cannot run before building the tree = call suite.BuildTree() first")
}
ApplyNestedFocusPolicyToTree(suite.tree)
specs := GenerateSpecsFromTreeRoot(suite.tree)
- specs, hasProgrammaticFocus := ApplyFocusToSpecs(specs, description, suiteLabels, suiteConfig)
+ specs, hasProgrammaticFocus := ApplyFocusToSpecs(specs, description, suiteLabels, suiteSemVerConstraints, suiteConfig)
+ specs = ComputeAroundNodes(specs)
suite.phase = PhaseRun
suite.client = client
@@ -120,6 +125,7 @@ func (suite *Suite) Run(description string, suiteLabels Labels, suitePath string
suite.outputInterceptor = outputInterceptor
suite.interruptHandler = interruptHandler
suite.config = suiteConfig
+ suite.aroundNodes = suiteAroundNodes
if suite.config.Timeout > 0 {
suite.deadline = time.Now().Add(suite.config.Timeout)
@@ -127,7 +133,7 @@ func (suite *Suite) Run(description string, suiteLabels Labels, suitePath string
cancelProgressHandler := progressSignalRegistrar(suite.handleProgressSignal)
- success := suite.runSpecs(description, suiteLabels, suitePath, hasProgrammaticFocus, specs)
+ success := suite.runSpecs(description, suiteLabels, suiteSemVerConstraints, suitePath, hasProgrammaticFocus, specs)
cancelProgressHandler()
@@ -199,6 +205,14 @@ func (suite *Suite) PushNode(node Node) error {
err = types.GinkgoErrors.CaughtPanicDuringABuildPhase(e, node.CodeLocation)
}
}()
+
+ // Ensure that code running in the body of the container node
+ // has access to information about the current container node(s).
+ suite.currentConstructionNodeReport = constructionNodeReportForTreeNode(suite.tree)
+ defer func() {
+ suite.currentConstructionNodeReport = nil
+ }()
+
node.Body(nil)
return err
}()
@@ -259,6 +273,7 @@ func (suite *Suite) pushCleanupNode(node Node) error {
node.NodeIDWhereCleanupWasGenerated = suite.currentNode.ID
node.NestingLevel = suite.currentNode.NestingLevel
+ node.AroundNodes = types.AroundNodes{}.Append(suite.currentNode.AroundNodes...).Append(node.AroundNodes...)
suite.selectiveLock.Lock()
suite.cleanupNodes = append(suite.cleanupNodes, node)
suite.selectiveLock.Unlock()
@@ -327,6 +342,16 @@ func (suite *Suite) By(text string, callback ...func()) error {
return nil
}
+func (suite *Suite) CurrentConstructionNodeReport() types.ConstructionNodeReport {
+ suite.selectiveLock.Lock()
+ defer suite.selectiveLock.Unlock()
+ report := suite.currentConstructionNodeReport
+ if report == nil {
+ panic("CurrentConstructionNodeReport may only be called during construction of the spec tree")
+ }
+ return *report
+}
+
/*
Spec Running methods - used during PhaseRun
*/
@@ -428,13 +453,14 @@ func (suite *Suite) processCurrentSpecReport() {
}
}
-func (suite *Suite) runSpecs(description string, suiteLabels Labels, suitePath string, hasProgrammaticFocus bool, specs Specs) bool {
+func (suite *Suite) runSpecs(description string, suiteLabels Labels, suiteSemVerConstraints SemVerConstraints, suitePath string, hasProgrammaticFocus bool, specs Specs) bool {
numSpecsThatWillBeRun := specs.CountWithoutSkip()
suite.report = types.Report{
SuitePath: suitePath,
SuiteDescription: description,
SuiteLabels: suiteLabels,
+ SuiteSemVerConstraints: suiteSemVerConstraints,
SuiteConfig: suite.config,
SuiteHasProgrammaticFocus: hasProgrammaticFocus,
PreRunStats: types.PreRunStats{
@@ -891,7 +917,30 @@ func (suite *Suite) runNode(node Node, specDeadline time.Time, text string) (typ
failureC <- failureFromRun
}()
- node.Body(sc)
+ aroundNodes := types.AroundNodes{}.Append(suite.aroundNodes...).Append(node.AroundNodes...)
+ if len(aroundNodes) > 0 {
+ i := 0
+ var f func(context.Context)
+ f = func(c context.Context) {
+ sc := wrapContextChain(c)
+ if sc == nil {
+ suite.failer.Fail("An AroundNode failed to pass a valid Ginkgo SpecContext in. You must always pass in a context derived from the context passed to you.", aroundNodes[i].CodeLocation)
+ return
+ }
+ i++
+ if i < len(aroundNodes) {
+ aroundNodes[i].Body(sc, f)
+ } else {
+ node.Body(sc)
+ }
+ }
+ aroundNodes[0].Body(sc, f)
+ if i != len(aroundNodes) {
+ suite.failer.Fail("An AroundNode failed to call the passed in function.", aroundNodes[i].CodeLocation)
+ }
+ } else {
+ node.Body(sc)
+ }
finished = true
}()
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/testingtproxy/testing_t_proxy.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/testingtproxy/testing_t_proxy.go
index b4ecc7cb8..9806e315a 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/testingtproxy/testing_t_proxy.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/internal/testingtproxy/testing_t_proxy.go
@@ -229,3 +229,9 @@ func (t *ginkgoTestingTProxy) ParallelTotal() int {
func (t *ginkgoTestingTProxy) AttachProgressReporter(f func() string) func() {
return t.attachProgressReporter(f)
}
+func (t *ginkgoTestingTProxy) Output() io.Writer {
+ return t.writer
+}
+func (t *ginkgoTestingTProxy) Attr(key, value string) {
+ t.addReportEntry(key, value, internal.Offset(1), types.ReportEntryVisibilityFailureOrVerbose)
+}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/reporters/default_reporter.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/reporters/default_reporter.go
index 74ad0768b..026d9cf9b 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/reporters/default_reporter.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/reporters/default_reporter.go
@@ -72,6 +72,9 @@ func (r *DefaultReporter) SuiteWillBegin(report types.Report) {
if len(report.SuiteLabels) > 0 {
r.emit(r.f("{{coral}}[%s]{{/}} ", strings.Join(report.SuiteLabels, ", ")))
}
+ if len(report.SuiteSemVerConstraints) > 0 {
+ r.emit(r.f("{{coral}}[%s]{{/}} ", strings.Join(report.SuiteSemVerConstraints, ", ")))
+ }
r.emit(r.f("- %d/%d specs ", report.PreRunStats.SpecsThatWillRun, report.PreRunStats.TotalSpecs))
if report.SuiteConfig.ParallelTotal > 1 {
r.emit(r.f("- %d procs ", report.SuiteConfig.ParallelTotal))
@@ -87,6 +90,13 @@ func (r *DefaultReporter) SuiteWillBegin(report types.Report) {
bannerWidth = len(labels) + 2
}
}
+ if len(report.SuiteSemVerConstraints) > 0 {
+ semVerConstraints := strings.Join(report.SuiteSemVerConstraints, ", ")
+ r.emitBlock(r.f("{{coral}}[%s]{{/}} ", semVerConstraints))
+ if len(semVerConstraints)+2 > bannerWidth {
+ bannerWidth = len(semVerConstraints) + 2
+ }
+ }
r.emitBlock(strings.Repeat("=", bannerWidth))
out := r.f("Random Seed: {{bold}}%d{{/}}", report.SuiteConfig.RandomSeed)
@@ -371,13 +381,22 @@ func (r *DefaultReporter) emitTimeline(indent uint, report types.SpecReport, tim
cursor := 0
for _, entry := range timeline {
tl := entry.GetTimelineLocation()
- if tl.Offset < len(gw) {
- r.emit(r.fi(indent, "%s", gw[cursor:tl.Offset]))
- cursor = tl.Offset
- } else if cursor < len(gw) {
+
+ end := tl.Offset
+ if end > len(gw) {
+ end = len(gw)
+ }
+ if end < cursor {
+ end = cursor
+ }
+ if cursor < end && cursor <= len(gw) && end <= len(gw) {
+ r.emit(r.fi(indent, "%s", gw[cursor:end]))
+ cursor = end
+ } else if cursor < len(gw) && end == len(gw) {
r.emit(r.fi(indent, "%s", gw[cursor:]))
cursor = len(gw)
}
+
switch x := entry.(type) {
case types.Failure:
if isVeryVerbose {
@@ -394,7 +413,7 @@ func (r *DefaultReporter) emitTimeline(indent uint, report types.SpecReport, tim
case types.ReportEntry:
r.emitReportEntry(indent, x)
case types.ProgressReport:
- r.emitProgressReport(indent, false, x)
+ r.emitProgressReport(indent, false, isVeryVerbose, x)
case types.SpecEvent:
if isVeryVerbose || !x.IsOnlyVisibleAtVeryVerbose() || r.conf.ShowNodeEvents {
r.emitSpecEvent(indent, x, isVeryVerbose)
@@ -448,7 +467,7 @@ func (r *DefaultReporter) emitFailure(indent uint, state types.SpecState, failur
if !failure.ProgressReport.IsZero() {
r.emitBlock("\n")
- r.emitProgressReport(indent, false, failure.ProgressReport)
+ r.emitProgressReport(indent, false, false, failure.ProgressReport)
}
if failure.AdditionalFailure != nil && includeAdditionalFailure {
@@ -464,11 +483,11 @@ func (r *DefaultReporter) EmitProgressReport(report types.ProgressReport) {
r.emit(r.fi(1, "{{coral}}Progress Report for Ginkgo Process #{{bold}}%d{{/}}\n", report.ParallelProcess))
}
shouldEmitGW := report.RunningInParallel || r.conf.Verbosity().LT(types.VerbosityLevelVerbose)
- r.emitProgressReport(1, shouldEmitGW, report)
+ r.emitProgressReport(1, shouldEmitGW, true, report)
r.emitDelimiter(1)
}
-func (r *DefaultReporter) emitProgressReport(indent uint, emitGinkgoWriterOutput bool, report types.ProgressReport) {
+func (r *DefaultReporter) emitProgressReport(indent uint, emitGinkgoWriterOutput, emitGroup bool, report types.ProgressReport) {
if report.Message != "" {
r.emitBlock(r.fi(indent, report.Message+"\n"))
indent += 1
@@ -504,6 +523,10 @@ func (r *DefaultReporter) emitProgressReport(indent uint, emitGinkgoWriterOutput
indent -= 1
}
+ if r.conf.GithubOutput && emitGroup {
+ r.emitBlock(r.fi(indent, "::group::Progress Report"))
+ }
+
if emitGinkgoWriterOutput && report.CapturedGinkgoWriterOutput != "" {
r.emit("\n")
r.emitBlock(r.fi(indent, "{{gray}}Begin Captured GinkgoWriter Output >>{{/}}"))
@@ -550,6 +573,10 @@ func (r *DefaultReporter) emitProgressReport(indent uint, emitGinkgoWriterOutput
r.emit(r.fi(indent, "{{gray}}{{bold}}{{underline}}Other Goroutines{{/}}\n"))
r.emitGoroutines(indent, otherGoroutines...)
}
+
+ if r.conf.GithubOutput && emitGroup {
+ r.emitBlock(r.fi(indent, "::endgroup::"))
+ }
}
func (r *DefaultReporter) EmitReportEntry(entry types.ReportEntry) {
@@ -698,8 +725,8 @@ func (r *DefaultReporter) cycleJoin(elements []string, joiner string) string {
}
func (r *DefaultReporter) codeLocationBlock(report types.SpecReport, highlightColor string, veryVerbose bool, usePreciseFailureLocation bool) string {
- texts, locations, labels := []string{}, []types.CodeLocation{}, [][]string{}
- texts, locations, labels = append(texts, report.ContainerHierarchyTexts...), append(locations, report.ContainerHierarchyLocations...), append(labels, report.ContainerHierarchyLabels...)
+ texts, locations, labels, semVerConstraints := []string{}, []types.CodeLocation{}, [][]string{}, [][]string{}
+ texts, locations, labels, semVerConstraints = append(texts, report.ContainerHierarchyTexts...), append(locations, report.ContainerHierarchyLocations...), append(labels, report.ContainerHierarchyLabels...), append(semVerConstraints, report.ContainerHierarchySemVerConstraints...)
if report.LeafNodeType.Is(types.NodeTypesForSuiteLevelNodes) {
texts = append(texts, r.f("[%s] %s", report.LeafNodeType, report.LeafNodeText))
@@ -707,6 +734,7 @@ func (r *DefaultReporter) codeLocationBlock(report types.SpecReport, highlightCo
texts = append(texts, r.f(report.LeafNodeText))
}
labels = append(labels, report.LeafNodeLabels)
+ semVerConstraints = append(semVerConstraints, report.LeafNodeSemVerConstraints)
locations = append(locations, report.LeafNodeLocation)
failureLocation := report.Failure.FailureNodeLocation
@@ -720,6 +748,7 @@ func (r *DefaultReporter) codeLocationBlock(report types.SpecReport, highlightCo
texts = append([]string{fmt.Sprintf("TOP-LEVEL [%s]", report.Failure.FailureNodeType)}, texts...)
locations = append([]types.CodeLocation{failureLocation}, locations...)
labels = append([][]string{{}}, labels...)
+ semVerConstraints = append([][]string{{}}, semVerConstraints...)
highlightIndex = 0
case types.FailureNodeInContainer:
i := report.Failure.FailureNodeContainerIndex
@@ -747,6 +776,9 @@ func (r *DefaultReporter) codeLocationBlock(report types.SpecReport, highlightCo
if len(labels[i]) > 0 {
out += r.f(" {{coral}}[%s]{{/}}", strings.Join(labels[i], ", "))
}
+ if len(semVerConstraints[i]) > 0 {
+ out += r.f(" {{coral}}[%s]{{/}}", strings.Join(semVerConstraints[i], ", "))
+ }
out += "\n"
out += r.fi(uint(i), "{{gray}}%s{{/}}\n", locations[i])
}
@@ -770,6 +802,10 @@ func (r *DefaultReporter) codeLocationBlock(report types.SpecReport, highlightCo
if len(flattenedLabels) > 0 {
out += r.f(" {{coral}}[%s]{{/}}", strings.Join(flattenedLabels, ", "))
}
+ flattenedSemVerConstraints := report.SemVerConstraints()
+ if len(flattenedSemVerConstraints) > 0 {
+ out += r.f(" {{coral}}[%s]{{/}}", strings.Join(flattenedSemVerConstraints, ", "))
+ }
out += "\n"
if usePreciseFailureLocation {
out += r.f("{{gray}}%s{{/}}", failureLocation)
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/reporters/gojson_report.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/reporters/gojson_report.go
new file mode 100644
index 000000000..d02fb7a1a
--- /dev/null
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/reporters/gojson_report.go
@@ -0,0 +1,61 @@
+package reporters
+
+import (
+ "encoding/json"
+ "fmt"
+ "os"
+ "path"
+
+ "github.com/onsi/ginkgo/v2/internal/reporters"
+ "github.com/onsi/ginkgo/v2/types"
+)
+
+// GenerateGoTestJSONReport produces a JSON-formatted in the test2json format used by `go test -json`
+func GenerateGoTestJSONReport(report types.Report, destination string) error {
+ // walk report and generate test2json-compatible objects
+ // JSON-encode the objects into filename
+ if err := os.MkdirAll(path.Dir(destination), 0770); err != nil {
+ return err
+ }
+ f, err := os.Create(destination)
+ if err != nil {
+ return err
+ }
+ defer f.Close()
+ enc := json.NewEncoder(f)
+ r := reporters.NewGoJSONReporter(
+ enc,
+ systemErrForUnstructuredReporters,
+ systemOutForUnstructuredReporters,
+ )
+ return r.Write(report)
+}
+
+// MergeJSONReports produces a single JSON-formatted report at the passed in destination by merging the JSON-formatted reports provided in sources
+// It skips over reports that fail to decode but reports on them via the returned messages []string
+func MergeAndCleanupGoTestJSONReports(sources []string, destination string) ([]string, error) {
+ messages := []string{}
+ if err := os.MkdirAll(path.Dir(destination), 0770); err != nil {
+ return messages, err
+ }
+ f, err := os.Create(destination)
+ if err != nil {
+ return messages, err
+ }
+ defer f.Close()
+
+ for _, source := range sources {
+ data, err := os.ReadFile(source)
+ if err != nil {
+ messages = append(messages, fmt.Sprintf("Could not open %s:\n%s", source, err.Error()))
+ continue
+ }
+ _, err = f.Write(data)
+ if err != nil {
+ messages = append(messages, fmt.Sprintf("Could not write to %s:\n%s", destination, err.Error()))
+ continue
+ }
+ os.Remove(source)
+ }
+ return messages, nil
+}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/reporters/junit_report.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/reporters/junit_report.go
index 562e0f62b..828f893fb 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/reporters/junit_report.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/reporters/junit_report.go
@@ -36,6 +36,9 @@ type JunitReportConfig struct {
// Enable OmitSpecLabels to prevent labels from appearing in the spec name
OmitSpecLabels bool
+ // Enable OmitSpecSemVerConstraints to prevent semantic version constraints from appearing in the spec name
+ OmitSpecSemVerConstraints bool
+
// Enable OmitLeafNodeType to prevent the spec leaf node type from appearing in the spec name
OmitLeafNodeType bool
@@ -169,9 +172,11 @@ func GenerateJUnitReportWithConfig(report types.Report, dst string, config Junit
{"SuiteHasProgrammaticFocus", fmt.Sprintf("%t", report.SuiteHasProgrammaticFocus)},
{"SpecialSuiteFailureReason", strings.Join(report.SpecialSuiteFailureReasons, ",")},
{"SuiteLabels", fmt.Sprintf("[%s]", strings.Join(report.SuiteLabels, ","))},
+ {"SuiteSemVerConstraints", fmt.Sprintf("[%s]", strings.Join(report.SuiteSemVerConstraints, ","))},
{"RandomSeed", fmt.Sprintf("%d", report.SuiteConfig.RandomSeed)},
{"RandomizeAllSpecs", fmt.Sprintf("%t", report.SuiteConfig.RandomizeAllSpecs)},
{"LabelFilter", report.SuiteConfig.LabelFilter},
+ {"SemVerFilter", report.SuiteConfig.SemVerFilter},
{"FocusStrings", strings.Join(report.SuiteConfig.FocusStrings, ",")},
{"SkipStrings", strings.Join(report.SuiteConfig.SkipStrings, ",")},
{"FocusFiles", strings.Join(report.SuiteConfig.FocusFiles, ";")},
@@ -207,6 +212,10 @@ func GenerateJUnitReportWithConfig(report types.Report, dst string, config Junit
owner = matches[1]
}
}
+ semVerConstraints := spec.SemVerConstraints()
+ if len(semVerConstraints) > 0 && !config.OmitSpecSemVerConstraints {
+ name = name + " [" + strings.Join(semVerConstraints, ", ") + "]"
+ }
name = strings.TrimSpace(name)
test := JUnitTestCase{
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/reporters/teamcity_report.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/reporters/teamcity_report.go
index e990ad82e..55e1d1f4f 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/reporters/teamcity_report.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/reporters/teamcity_report.go
@@ -38,9 +38,13 @@ func GenerateTeamcityReport(report types.Report, dst string) error {
name := report.SuiteDescription
labels := report.SuiteLabels
+ semVerConstraints := report.SuiteSemVerConstraints
if len(labels) > 0 {
name = name + " [" + strings.Join(labels, ", ") + "]"
}
+ if len(semVerConstraints) > 0 {
+ name = name + " [" + strings.Join(semVerConstraints, ", ") + "]"
+ }
fmt.Fprintf(f, "##teamcity[testSuiteStarted name='%s']\n", tcEscape(name))
for _, spec := range report.SpecReports {
name := fmt.Sprintf("[%s]", spec.LeafNodeType)
@@ -51,6 +55,10 @@ func GenerateTeamcityReport(report types.Report, dst string) error {
if len(labels) > 0 {
name = name + " [" + strings.Join(labels, ", ") + "]"
}
+ semVerConstraints := spec.SemVerConstraints()
+ if len(semVerConstraints) > 0 {
+ name = name + " [" + strings.Join(semVerConstraints, ", ") + "]"
+ }
name = tcEscape(name)
fmt.Fprintf(f, "##teamcity[testStarted name='%s']\n", name)
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/reporting_dsl.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/reporting_dsl.go
index 5bf2e62e9..4e86dba84 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/reporting_dsl.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/reporting_dsl.go
@@ -27,6 +27,8 @@ CurrentSpecReport returns information about the current running spec.
The returned object is a types.SpecReport which includes helper methods
to make extracting information about the spec easier.
+During construction of the test tree the result is empty.
+
You can learn more about SpecReport here: https://pkg.go.dev/github.com/onsi/ginkgo/types#SpecReport
You can learn more about CurrentSpecReport() here: https://onsi.github.io/ginkgo/#getting-a-report-for-the-current-spec
*/
@@ -34,6 +36,31 @@ func CurrentSpecReport() SpecReport {
return global.Suite.CurrentSpecReport()
}
+/*
+ConstructionNodeReport describes the container nodes during construction of
+the spec tree. It provides a subset of the information that is provided
+by SpecReport at runtime.
+
+It is documented here: [types.ConstructionNodeReport]
+*/
+type ConstructionNodeReport = types.ConstructionNodeReport
+
+/*
+CurrentConstructionNodeReport returns information about the current container nodes
+that are leading to the current path in the spec tree.
+The returned object is a types.ConstructionNodeReport which includes helper methods
+to make extracting information about the spec easier.
+
+May only be called during construction of the spec tree. It panics when
+called while tests are running. Use CurrentSpecReport instead in that
+phase.
+
+You can learn more about ConstructionNodeReport here: [types.ConstructionNodeReport]
+*/
+func CurrentTreeConstructionNodeReport() ConstructionNodeReport {
+ return global.Suite.CurrentConstructionNodeReport()
+}
+
/*
ReportEntryVisibility governs the visibility of ReportEntries in Ginkgo's console reporter
@@ -92,7 +119,7 @@ func ReportBeforeEach(body any, args ...any) bool {
combinedArgs := []any{body}
combinedArgs = append(combinedArgs, args...)
- return pushNode(internal.NewNode(deprecationTracker, types.NodeTypeReportBeforeEach, "", combinedArgs...))
+ return pushNode(internal.NewNode(internal.TransformNewNodeArgs(exitIfErrors, deprecationTracker, types.NodeTypeReportBeforeEach, "", combinedArgs...)))
}
/*
@@ -116,7 +143,7 @@ func ReportAfterEach(body any, args ...any) bool {
combinedArgs := []any{body}
combinedArgs = append(combinedArgs, args...)
- return pushNode(internal.NewNode(deprecationTracker, types.NodeTypeReportAfterEach, "", combinedArgs...))
+ return pushNode(internal.NewNode(internal.TransformNewNodeArgs(exitIfErrors, deprecationTracker, types.NodeTypeReportAfterEach, "", combinedArgs...)))
}
/*
@@ -145,7 +172,7 @@ You can learn about interruptible nodes here: https://onsi.github.io/ginkgo/#spe
func ReportBeforeSuite(body any, args ...any) bool {
combinedArgs := []any{body}
combinedArgs = append(combinedArgs, args...)
- return pushNode(internal.NewNode(deprecationTracker, types.NodeTypeReportBeforeSuite, "", combinedArgs...))
+ return pushNode(internal.NewNode(internal.TransformNewNodeArgs(exitIfErrors, deprecationTracker, types.NodeTypeReportBeforeSuite, "", combinedArgs...)))
}
/*
@@ -165,7 +192,7 @@ ReportAfterSuite nodes must be created at the top-level (i.e. not nested in a Co
When running in parallel, Ginkgo ensures that only one of the parallel nodes runs the ReportAfterSuite and that it is passed a report that is aggregated across
all parallel nodes
-In addition to using ReportAfterSuite to programmatically generate suite reports, you can also generate JSON, JUnit, and Teamcity formatted reports using the --json-report, --junit-report, and --teamcity-report ginkgo CLI flags.
+In addition to using ReportAfterSuite to programmatically generate suite reports, you can also generate JSON, GoJSON, JUnit, and Teamcity formatted reports using the --json-report, --gojson-report, --junit-report, and --teamcity-report ginkgo CLI flags.
You cannot nest any other Ginkgo nodes within a ReportAfterSuite node's closure.
You can learn more about ReportAfterSuite here: https://onsi.github.io/ginkgo/#generating-reports-programmatically
@@ -177,7 +204,7 @@ You can learn about interruptible nodes here: https://onsi.github.io/ginkgo/#spe
func ReportAfterSuite(text string, body any, args ...any) bool {
combinedArgs := []any{body}
combinedArgs = append(combinedArgs, args...)
- return pushNode(internal.NewNode(deprecationTracker, types.NodeTypeReportAfterSuite, text, combinedArgs...))
+ return pushNode(internal.NewNode(internal.TransformNewNodeArgs(exitIfErrors, deprecationTracker, types.NodeTypeReportAfterSuite, text, combinedArgs...)))
}
func registerReportAfterSuiteNodeForAutogeneratedReports(reporterConfig types.ReporterConfig) {
@@ -188,6 +215,12 @@ func registerReportAfterSuiteNodeForAutogeneratedReports(reporterConfig types.Re
Fail(fmt.Sprintf("Failed to generate JSON report:\n%s", err.Error()))
}
}
+ if reporterConfig.GoJSONReport != "" {
+ err := reporters.GenerateGoTestJSONReport(report, reporterConfig.GoJSONReport)
+ if err != nil {
+ Fail(fmt.Sprintf("Failed to generate Go JSON report:\n%s", err.Error()))
+ }
+ }
if reporterConfig.JUnitReport != "" {
err := reporters.GenerateJUnitReport(report, reporterConfig.JUnitReport)
if err != nil {
@@ -206,6 +239,9 @@ func registerReportAfterSuiteNodeForAutogeneratedReports(reporterConfig types.Re
if reporterConfig.JSONReport != "" {
flags = append(flags, "--json-report")
}
+ if reporterConfig.GoJSONReport != "" {
+ flags = append(flags, "--gojson-report")
+ }
if reporterConfig.JUnitReport != "" {
flags = append(flags, "--junit-report")
}
@@ -213,9 +249,11 @@ func registerReportAfterSuiteNodeForAutogeneratedReports(reporterConfig types.Re
flags = append(flags, "--teamcity-report")
}
pushNode(internal.NewNode(
- deprecationTracker, types.NodeTypeReportAfterSuite,
- fmt.Sprintf("Autogenerated ReportAfterSuite for %s", strings.Join(flags, " ")),
- body,
- types.NewCustomCodeLocation("autogenerated by Ginkgo"),
+ internal.TransformNewNodeArgs(
+ exitIfErrors, deprecationTracker, types.NodeTypeReportAfterSuite,
+ fmt.Sprintf("Autogenerated ReportAfterSuite for %s", strings.Join(flags, " ")),
+ body,
+ types.NewCustomCodeLocation("autogenerated by Ginkgo"),
+ ),
))
}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/table_dsl.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/table_dsl.go
index b9e0ca9ef..1031aa855 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/table_dsl.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/table_dsl.go
@@ -309,11 +309,11 @@ func generateTable(description string, isSubtree bool, args ...any) {
internalNodeType = types.NodeTypeContainer
}
- pushNode(internal.NewNode(deprecationTracker, internalNodeType, description, internalNodeArgs...))
+ pushNode(internal.NewNode(internal.TransformNewNodeArgs(exitIfErrors, deprecationTracker, internalNodeType, description, internalNodeArgs...)))
}
})
- pushNode(internal.NewNode(deprecationTracker, types.NodeTypeContainer, description, containerNodeArgs...))
+ pushNode(internal.NewNode(internal.TransformNewNodeArgs(exitIfErrors, deprecationTracker, types.NodeTypeContainer, description, containerNodeArgs...)))
}
func invokeFunction(function any, parameters []any) []reflect.Value {
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/types/around_node.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/types/around_node.go
new file mode 100644
index 000000000..a069e0623
--- /dev/null
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/types/around_node.go
@@ -0,0 +1,56 @@
+package types
+
+import (
+ "context"
+)
+
+type AroundNodeAllowedFuncs interface {
+ ~func(context.Context, func(context.Context)) | ~func(context.Context) context.Context | ~func()
+}
+type AroundNodeFunc func(ctx context.Context, body func(ctx context.Context))
+
+func AroundNode[F AroundNodeAllowedFuncs](f F, cl CodeLocation) AroundNodeDecorator {
+ if f == nil {
+ panic("BuildAroundNode cannot be called with a nil function.")
+ }
+ var aroundNodeFunc func(context.Context, func(context.Context))
+ switch x := any(f).(type) {
+ case func(context.Context, func(context.Context)):
+ aroundNodeFunc = x
+ case func(context.Context) context.Context:
+ aroundNodeFunc = func(ctx context.Context, body func(context.Context)) {
+ ctx = x(ctx)
+ body(ctx)
+ }
+ case func():
+ aroundNodeFunc = func(ctx context.Context, body func(context.Context)) {
+ x()
+ body(ctx)
+ }
+ }
+
+ return AroundNodeDecorator{
+ Body: aroundNodeFunc,
+ CodeLocation: cl,
+ }
+}
+
+type AroundNodeDecorator struct {
+ Body AroundNodeFunc
+ CodeLocation CodeLocation
+}
+
+type AroundNodes []AroundNodeDecorator
+
+func (an AroundNodes) Clone() AroundNodes {
+ out := make(AroundNodes, len(an))
+ copy(out, an)
+ return out
+}
+
+func (an AroundNodes) Append(other ...AroundNodeDecorator) AroundNodes {
+ out := make(AroundNodes, len(an)+len(other))
+ copy(out, an)
+ copy(out[len(an):], other)
+ return out
+}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/types/config.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/types/config.go
index 2e827efe3..f84703604 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/types/config.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/types/config.go
@@ -24,6 +24,7 @@ type SuiteConfig struct {
FocusFiles []string
SkipFiles []string
LabelFilter string
+ SemVerFilter string
FailOnPending bool
FailOnEmpty bool
FailFast bool
@@ -95,6 +96,7 @@ type ReporterConfig struct {
ForceNewlines bool
JSONReport string
+ GoJSONReport string
JUnitReport string
TeamcityReport string
}
@@ -111,7 +113,7 @@ func (rc ReporterConfig) Verbosity() VerbosityLevel {
}
func (rc ReporterConfig) WillGenerateReport() bool {
- return rc.JSONReport != "" || rc.JUnitReport != "" || rc.TeamcityReport != ""
+ return rc.JSONReport != "" || rc.GoJSONReport != "" || rc.JUnitReport != "" || rc.TeamcityReport != ""
}
func NewDefaultReporterConfig() ReporterConfig {
@@ -308,6 +310,8 @@ var SuiteConfigFlags = GinkgoFlags{
{KeyPath: "S.LabelFilter", Name: "label-filter", SectionKey: "filter", UsageArgument: "expression",
Usage: "If set, ginkgo will only run specs with labels that match the label-filter. The passed-in expression can include boolean operations (!, &&, ||, ','), groupings via '()', and regular expressions '/regexp/'. e.g. '(cat || dog) && !fruit'"},
+ {KeyPath: "S.SemVerFilter", Name: "sem-ver-filter", SectionKey: "filter", UsageArgument: "version",
+ Usage: "If set, ginkgo will only run specs with semantic version constraints that are satisfied by the provided version. e.g. '2.1.0'"},
{KeyPath: "S.FocusStrings", Name: "focus", SectionKey: "filter",
Usage: "If set, ginkgo will only run specs that match this regular expression. Can be specified multiple times, values are ORed."},
{KeyPath: "S.SkipStrings", Name: "skip", SectionKey: "filter",
@@ -356,6 +360,8 @@ var ReporterConfigFlags = GinkgoFlags{
{KeyPath: "R.JSONReport", Name: "json-report", UsageArgument: "filename.json", SectionKey: "output",
Usage: "If set, Ginkgo will generate a JSON-formatted test report at the specified location."},
+ {KeyPath: "R.GoJSONReport", Name: "gojson-report", UsageArgument: "filename.json", SectionKey: "output",
+ Usage: "If set, Ginkgo will generate a Go JSON-formatted test report at the specified location."},
{KeyPath: "R.JUnitReport", Name: "junit-report", UsageArgument: "filename.xml", SectionKey: "output", DeprecatedName: "reportFile", DeprecatedDocLink: "improved-reporting-infrastructure",
Usage: "If set, Ginkgo will generate a conformant junit test report in the specified file."},
{KeyPath: "R.TeamcityReport", Name: "teamcity-report", UsageArgument: "filename", SectionKey: "output",
@@ -443,6 +449,13 @@ func VetConfig(flagSet GinkgoFlagSet, suiteConfig SuiteConfig, reporterConfig Re
}
}
+ if suiteConfig.SemVerFilter != "" {
+ _, err := ParseSemVerFilter(suiteConfig.SemVerFilter)
+ if err != nil {
+ errors = append(errors, err)
+ }
+ }
+
switch strings.ToLower(suiteConfig.OutputInterceptorMode) {
case "", "dup", "swap", "none":
default:
@@ -573,6 +586,9 @@ var GoBuildFlags = GinkgoFlags{
Usage: "print the name of the temporary work directory and do not delete it when exiting."},
{KeyPath: "Go.X", Name: "x", SectionKey: "go-build",
Usage: "print the commands."},
+}
+
+var GoBuildOFlags = GinkgoFlags{
{KeyPath: "Go.O", Name: "o", SectionKey: "go-build",
Usage: "output binary path (including name)."},
}
@@ -673,7 +689,7 @@ func GenerateGoTestCompileArgs(goFlagsConfig GoFlagsConfig, packageToBuild strin
args := []string{"test", "-c", packageToBuild}
goArgs, err := GenerateFlagArgs(
- GoBuildFlags,
+ GoBuildFlags.CopyAppend(GoBuildOFlags...),
map[string]any{
"Go": &goFlagsConfig,
},
@@ -763,6 +779,7 @@ func BuildWatchCommandFlagSet(suiteConfig *SuiteConfig, reporterConfig *Reporter
func BuildBuildCommandFlagSet(cliConfig *CLIConfig, goFlagsConfig *GoFlagsConfig) (GinkgoFlagSet, error) {
flags := GinkgoCLISharedFlags
flags = flags.CopyAppend(GoBuildFlags...)
+ flags = flags.CopyAppend(GoBuildOFlags...)
bindings := map[string]any{
"C": cliConfig,
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/types/errors.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/types/errors.go
index c2796b549..59313238c 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/types/errors.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/types/errors.go
@@ -432,6 +432,24 @@ func (g ginkgoErrors) InvalidEmptyLabel(cl CodeLocation) error {
}
}
+func (g ginkgoErrors) InvalidSemVerConstraint(semVerConstraint, errMsg string, cl CodeLocation) error {
+ return GinkgoError{
+ Heading: "Invalid SemVerConstraint",
+ Message: fmt.Sprintf("'%s' is an invalid SemVerConstraint: %s", semVerConstraint, errMsg),
+ CodeLocation: cl,
+ DocLink: "spec-semantic-version-filtering",
+ }
+}
+
+func (g ginkgoErrors) InvalidEmptySemVerConstraint(cl CodeLocation) error {
+ return GinkgoError{
+ Heading: "Invalid Empty SemVerConstraint",
+ Message: "SemVerConstraint cannot be empty",
+ CodeLocation: cl,
+ DocLink: "spec-semantic-version-filtering",
+ }
+}
+
/* Table errors */
func (g ginkgoErrors) MultipleEntryBodyFunctionsForTable(cl CodeLocation) error {
return GinkgoError{
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/types/semver_filter.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/types/semver_filter.go
new file mode 100644
index 000000000..3fc2ed144
--- /dev/null
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/types/semver_filter.go
@@ -0,0 +1,60 @@
+package types
+
+import (
+ "fmt"
+
+ "github.com/Masterminds/semver/v3"
+)
+
+type SemVerFilter func([]string) bool
+
+func MustParseSemVerFilter(input string) SemVerFilter {
+ filter, err := ParseSemVerFilter(input)
+ if err != nil {
+ panic(err)
+ }
+ return filter
+}
+
+func ParseSemVerFilter(filterVersion string) (SemVerFilter, error) {
+ if filterVersion == "" {
+ return func(_ []string) bool { return true }, nil
+ }
+
+ targetVersion, err := semver.NewVersion(filterVersion)
+ if err != nil {
+ return nil, fmt.Errorf("invalid filter version: %w", err)
+ }
+
+ return func(constraints []string) bool {
+ // unconstrained specs always run
+ if len(constraints) == 0 {
+ return true
+ }
+
+ for _, constraintStr := range constraints {
+ constraint, err := semver.NewConstraint(constraintStr)
+ if err != nil {
+ return false
+ }
+
+ if !constraint.Check(targetVersion) {
+ return false
+ }
+ }
+
+ return true
+ }, nil
+}
+
+func ValidateAndCleanupSemVerConstraint(semVerConstraint string, cl CodeLocation) (string, error) {
+ if len(semVerConstraint) == 0 {
+ return "", GinkgoErrors.InvalidEmptySemVerConstraint(cl)
+ }
+ _, err := semver.NewConstraint(semVerConstraint)
+ if err != nil {
+ return "", GinkgoErrors.InvalidSemVerConstraint(semVerConstraint, err.Error(), cl)
+ }
+
+ return semVerConstraint, nil
+}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/types/types.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/types/types.go
index ddcbec1ba..9981a0dd6 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/types/types.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/types/types.go
@@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"os"
+ "slices"
"sort"
"strings"
"time"
@@ -19,6 +20,57 @@ func init() {
}
}
+// ConstructionNodeReport captures information about a Ginkgo spec.
+type ConstructionNodeReport struct {
+ // ContainerHierarchyTexts is a slice containing the text strings of
+ // all Describe/Context/When containers in this spec's hierarchy.
+ ContainerHierarchyTexts []string
+
+ // ContainerHierarchyLocations is a slice containing the CodeLocations of
+ // all Describe/Context/When containers in this spec's hierarchy.
+ ContainerHierarchyLocations []CodeLocation
+
+ // ContainerHierarchyLabels is a slice containing the labels of
+ // all Describe/Context/When containers in this spec's hierarchy
+ ContainerHierarchyLabels [][]string
+
+ // ContainerHierarchySemVerConstraints is a slice containing the semVerConstraints of
+ // all Describe/Context/When containers in this spec's hierarchy
+ ContainerHierarchySemVerConstraints [][]string
+
+ // IsSerial captures whether the any container has the Serial decorator
+ IsSerial bool
+
+ // IsInOrderedContainer captures whether any container is an Ordered container
+ IsInOrderedContainer bool
+}
+
+// FullText returns a concatenation of all the report.ContainerHierarchyTexts and report.LeafNodeText
+func (report ConstructionNodeReport) FullText() string {
+ texts := []string{}
+ texts = append(texts, report.ContainerHierarchyTexts...)
+ texts = slices.DeleteFunc(texts, func(t string) bool {
+ return t == ""
+ })
+ return strings.Join(texts, " ")
+}
+
+// Labels returns a deduped set of all the spec's Labels.
+func (report ConstructionNodeReport) Labels() []string {
+ out := []string{}
+ seen := map[string]bool{}
+ for _, labels := range report.ContainerHierarchyLabels {
+ for _, label := range labels {
+ if !seen[label] {
+ seen[label] = true
+ out = append(out, label)
+ }
+ }
+ }
+
+ return out
+}
+
// Report captures information about a Ginkgo test run
type Report struct {
//SuitePath captures the absolute path to the test suite
@@ -30,6 +82,9 @@ type Report struct {
//SuiteLabels captures any labels attached to the suite by the DSL's RunSpecs() function
SuiteLabels []string
+ //SuiteSemVerConstraints captures any semVerConstraints attached to the suite by the DSL's RunSpecs() function
+ SuiteSemVerConstraints []string
+
//SuiteSucceeded captures the success or failure status of the test run
//If true, the test run is considered successful.
//If false, the test run is considered unsuccessful
@@ -129,13 +184,21 @@ type SpecReport struct {
// all Describe/Context/When containers in this spec's hierarchy
ContainerHierarchyLabels [][]string
- // LeafNodeType, LeadNodeLocation, LeafNodeLabels and LeafNodeText capture the NodeType, CodeLocation, and text
+ // ContainerHierarchySemVerConstraints is a slice containing the semVerConstraints of
+ // all Describe/Context/When containers in this spec's hierarchy
+ ContainerHierarchySemVerConstraints [][]string
+
+ // LeafNodeType, LeafNodeLocation, LeafNodeLabels, LeafNodeSemVerConstraints and LeafNodeText capture the NodeType, CodeLocation, and text
// of the Ginkgo node being tested (typically an NodeTypeIt node, though this can also be
// one of the NodeTypesForSuiteLevelNodes node types)
- LeafNodeType NodeType
- LeafNodeLocation CodeLocation
- LeafNodeLabels []string
- LeafNodeText string
+ LeafNodeType NodeType
+ LeafNodeLocation CodeLocation
+ LeafNodeLabels []string
+ LeafNodeSemVerConstraints []string
+ LeafNodeText string
+
+ // Captures the Spec Priority
+ SpecPriority int
// State captures whether the spec has passed, failed, etc.
State SpecState
@@ -198,48 +261,52 @@ type SpecReport struct {
func (report SpecReport) MarshalJSON() ([]byte, error) {
//All this to avoid emitting an empty Failure struct in the JSON
out := struct {
- ContainerHierarchyTexts []string
- ContainerHierarchyLocations []CodeLocation
- ContainerHierarchyLabels [][]string
- LeafNodeType NodeType
- LeafNodeLocation CodeLocation
- LeafNodeLabels []string
- LeafNodeText string
- State SpecState
- StartTime time.Time
- EndTime time.Time
- RunTime time.Duration
- ParallelProcess int
- Failure *Failure `json:",omitempty"`
- NumAttempts int
- MaxFlakeAttempts int
- MaxMustPassRepeatedly int
- CapturedGinkgoWriterOutput string `json:",omitempty"`
- CapturedStdOutErr string `json:",omitempty"`
- ReportEntries ReportEntries `json:",omitempty"`
- ProgressReports []ProgressReport `json:",omitempty"`
- AdditionalFailures []AdditionalFailure `json:",omitempty"`
- SpecEvents SpecEvents `json:",omitempty"`
+ ContainerHierarchyTexts []string
+ ContainerHierarchyLocations []CodeLocation
+ ContainerHierarchyLabels [][]string
+ ContainerHierarchySemVerConstraints [][]string
+ LeafNodeType NodeType
+ LeafNodeLocation CodeLocation
+ LeafNodeLabels []string
+ LeafNodeSemVerConstraints []string
+ LeafNodeText string
+ State SpecState
+ StartTime time.Time
+ EndTime time.Time
+ RunTime time.Duration
+ ParallelProcess int
+ Failure *Failure `json:",omitempty"`
+ NumAttempts int
+ MaxFlakeAttempts int
+ MaxMustPassRepeatedly int
+ CapturedGinkgoWriterOutput string `json:",omitempty"`
+ CapturedStdOutErr string `json:",omitempty"`
+ ReportEntries ReportEntries `json:",omitempty"`
+ ProgressReports []ProgressReport `json:",omitempty"`
+ AdditionalFailures []AdditionalFailure `json:",omitempty"`
+ SpecEvents SpecEvents `json:",omitempty"`
}{
- ContainerHierarchyTexts: report.ContainerHierarchyTexts,
- ContainerHierarchyLocations: report.ContainerHierarchyLocations,
- ContainerHierarchyLabels: report.ContainerHierarchyLabels,
- LeafNodeType: report.LeafNodeType,
- LeafNodeLocation: report.LeafNodeLocation,
- LeafNodeLabels: report.LeafNodeLabels,
- LeafNodeText: report.LeafNodeText,
- State: report.State,
- StartTime: report.StartTime,
- EndTime: report.EndTime,
- RunTime: report.RunTime,
- ParallelProcess: report.ParallelProcess,
- Failure: nil,
- ReportEntries: nil,
- NumAttempts: report.NumAttempts,
- MaxFlakeAttempts: report.MaxFlakeAttempts,
- MaxMustPassRepeatedly: report.MaxMustPassRepeatedly,
- CapturedGinkgoWriterOutput: report.CapturedGinkgoWriterOutput,
- CapturedStdOutErr: report.CapturedStdOutErr,
+ ContainerHierarchyTexts: report.ContainerHierarchyTexts,
+ ContainerHierarchyLocations: report.ContainerHierarchyLocations,
+ ContainerHierarchyLabels: report.ContainerHierarchyLabels,
+ ContainerHierarchySemVerConstraints: report.ContainerHierarchySemVerConstraints,
+ LeafNodeType: report.LeafNodeType,
+ LeafNodeLocation: report.LeafNodeLocation,
+ LeafNodeLabels: report.LeafNodeLabels,
+ LeafNodeSemVerConstraints: report.LeafNodeSemVerConstraints,
+ LeafNodeText: report.LeafNodeText,
+ State: report.State,
+ StartTime: report.StartTime,
+ EndTime: report.EndTime,
+ RunTime: report.RunTime,
+ ParallelProcess: report.ParallelProcess,
+ Failure: nil,
+ ReportEntries: nil,
+ NumAttempts: report.NumAttempts,
+ MaxFlakeAttempts: report.MaxFlakeAttempts,
+ MaxMustPassRepeatedly: report.MaxMustPassRepeatedly,
+ CapturedGinkgoWriterOutput: report.CapturedGinkgoWriterOutput,
+ CapturedStdOutErr: report.CapturedStdOutErr,
}
if !report.Failure.IsZero() {
@@ -287,6 +354,9 @@ func (report SpecReport) FullText() string {
if report.LeafNodeText != "" {
texts = append(texts, report.LeafNodeText)
}
+ texts = slices.DeleteFunc(texts, func(t string) bool {
+ return t == ""
+ })
return strings.Join(texts, " ")
}
@@ -312,6 +382,28 @@ func (report SpecReport) Labels() []string {
return out
}
+// SemVerConstraints returns a deduped set of all the spec's SemVerConstraints.
+func (report SpecReport) SemVerConstraints() []string {
+ out := []string{}
+ seen := map[string]bool{}
+ for _, semVerConstraints := range report.ContainerHierarchySemVerConstraints {
+ for _, semVerConstraint := range semVerConstraints {
+ if !seen[semVerConstraint] {
+ seen[semVerConstraint] = true
+ out = append(out, semVerConstraint)
+ }
+ }
+ }
+ for _, semVerConstraint := range report.LeafNodeSemVerConstraints {
+ if !seen[semVerConstraint] {
+ seen[semVerConstraint] = true
+ out = append(out, semVerConstraint)
+ }
+ }
+
+ return out
+}
+
// MatchesLabelFilter returns true if the spec satisfies the passed in label filter query
func (report SpecReport) MatchesLabelFilter(query string) (bool, error) {
filter, err := ParseLabelFilter(query)
@@ -321,6 +413,15 @@ func (report SpecReport) MatchesLabelFilter(query string) (bool, error) {
return filter(report.Labels()), nil
}
+// MatchesSemVerFilter returns true if the spec satisfies the passed in label filter query
+func (report SpecReport) MatchesSemVerFilter(version string) (bool, error) {
+ filter, err := ParseSemVerFilter(version)
+ if err != nil {
+ return false, err
+ }
+ return filter(report.SemVerConstraints()), nil
+}
+
// FileName() returns the name of the file containing the spec
func (report SpecReport) FileName() string {
return report.LeafNodeLocation.FileName
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/types/version.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/types/version.go
index 158ac2fd8..b9c1ea985 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/types/version.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/ginkgo/v2/types/version.go
@@ -1,3 +1,3 @@
package types
-const VERSION = "2.23.4"
+const VERSION = "2.27.2"
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/gomega/CHANGELOG.md b/openshift/default-catalog-consistency/vendor/github.com/onsi/gomega/CHANGELOG.md
index 890d89222..b7d7309f3 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/gomega/CHANGELOG.md
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/gomega/CHANGELOG.md
@@ -1,3 +1,32 @@
+## 1.38.2
+
+- roll back to go 1.23.0 [c404969]
+
+## 1.38.1
+
+### Fixes
+
+Numerous minor fixes and dependency bumps
+
+## 1.38.0
+
+### Features
+- gstruct handles extra unexported fields [4ee7ed0]
+
+### Fixes
+- support [] in IgnoringTopFunction function signatures (#851) [36bbf72]
+
+### Maintenance
+- Bump golang.org/x/net from 0.40.0 to 0.41.0 (#846) [529d408]
+- Fix typo [acd1f55]
+- Bump google.golang.org/protobuf from 1.36.5 to 1.36.6 (#835) [bae65a0]
+- Bump nokogiri from 1.18.4 to 1.18.8 in /docs (#842) [8dda91f]
+- Bump golang.org/x/net from 0.39.0 to 0.40.0 (#843) [212d812]
+- Bump github.com/onsi/ginkgo/v2 from 2.23.3 to 2.23.4 (#839) [59bd7f9]
+- Bump nokogiri from 1.18.1 to 1.18.4 in /docs (#834) [328c729]
+- Bump uri from 1.0.2 to 1.0.3 in /docs (#826) [9a798a1]
+- Bump golang.org/x/net from 0.37.0 to 0.39.0 (#841) [04a72c6]
+
## 1.37.0
### Features
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/gomega/gomega_dsl.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/gomega/gomega_dsl.go
index a491a64be..fdba34ee9 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/gomega/gomega_dsl.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/gomega/gomega_dsl.go
@@ -22,7 +22,7 @@ import (
"github.com/onsi/gomega/types"
)
-const GOMEGA_VERSION = "1.37.0"
+const GOMEGA_VERSION = "1.38.2"
const nilGomegaPanic = `You are trying to make an assertion, but haven't registered Gomega's fail handler.
If you're using Ginkgo then you probably forgot to put your assertion in an It().
@@ -178,7 +178,7 @@ func ensureDefaultGomegaIsConfigured() {
// All subsequent arguments will be required to be nil/zero.
//
// This is convenient if you want to make an assertion on a method/function that returns
-// a value and an error - a common patter in Go.
+// a value and an error - a common pattern in Go.
//
// For example, given a function with signature:
//
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/gomega/internal/async_assertion.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/gomega/internal/async_assertion.go
index a3a646e4a..4121505b6 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/gomega/internal/async_assertion.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/gomega/internal/async_assertion.go
@@ -452,7 +452,7 @@ func (assertion *AsyncAssertion) match(matcher types.GomegaMatcher, desiredMatch
}
} else {
var fgErr formattedGomegaError
- if errors.As(actualErr, &fgErr) {
+ if errors.As(matcherErr, &fgErr) {
message += fgErr.FormattedGomegaError() + "\n"
} else {
message += renderError(fmt.Sprintf("The matcher passed to %s returned the following error:", assertion.asyncType), matcherErr)
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/gomega/matchers/be_comparable_to_matcher.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/gomega/matchers/be_comparable_to_matcher.go
index 532fc3744..ce74eee4c 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/gomega/matchers/be_comparable_to_matcher.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/gomega/matchers/be_comparable_to_matcher.go
@@ -2,6 +2,7 @@ package matchers
import (
"bytes"
+ "errors"
"fmt"
"github.com/google/go-cmp/cmp"
@@ -32,7 +33,7 @@ func (matcher *BeComparableToMatcher) Match(actual any) (success bool, matchErr
if err, ok := r.(error); ok {
matchErr = err
} else if errMsg, ok := r.(string); ok {
- matchErr = fmt.Errorf(errMsg)
+ matchErr = errors.New(errMsg)
}
}
}()
diff --git a/openshift/default-catalog-consistency/vendor/github.com/onsi/gomega/matchers/match_yaml_matcher.go b/openshift/default-catalog-consistency/vendor/github.com/onsi/gomega/matchers/match_yaml_matcher.go
index 95057c26c..c3da9bd48 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/onsi/gomega/matchers/match_yaml_matcher.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/onsi/gomega/matchers/match_yaml_matcher.go
@@ -5,7 +5,7 @@ import (
"strings"
"github.com/onsi/gomega/format"
- "gopkg.in/yaml.v3"
+ "go.yaml.in/yaml/v3"
)
type MatchYAMLMatcher struct {
diff --git a/openshift/default-catalog-consistency/vendor/github.com/operator-framework/operator-controller/api/v1/clusterextension_types.go b/openshift/default-catalog-consistency/vendor/github.com/operator-framework/operator-controller/api/v1/clusterextension_types.go
index 0141f1a7a..a2dd890c3 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/operator-framework/operator-controller/api/v1/clusterextension_types.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/operator-framework/operator-controller/api/v1/clusterextension_types.go
@@ -17,6 +17,7 @@ limitations under the License.
package v1
import (
+ apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
@@ -25,6 +26,8 @@ var ClusterExtensionKind = "ClusterExtension"
type (
UpgradeConstraintPolicy string
CRDUpgradeSafetyEnforcement string
+
+ ClusterExtensionConfigType string
)
const (
@@ -39,6 +42,8 @@ const (
// Use with caution as this can lead to unknown and potentially
// disastrous results such as data loss.
UpgradeConstraintPolicySelfCertified UpgradeConstraintPolicy = "SelfCertified"
+
+ ClusterExtensionConfigTypeInline ClusterExtensionConfigType = "Inline"
)
// ClusterExtensionSpec defines the desired state of ClusterExtension
@@ -92,6 +97,15 @@ type ClusterExtensionSpec struct {
//
// +optional
Install *ClusterExtensionInstallConfig `json:"install,omitempty"`
+
+ // config contains optional configuration values applied during rendering of the
+ // ClusterExtension's manifests. Values can be specified inline.
+ //
+ // config is optional. When not specified, the default configuration of the resolved bundle will be used.
+ //
+ //
+ // +optional
+ Config *ClusterExtensionConfig `json:"config,omitempty"`
}
const SourceTypeCatalog = "Catalog"
@@ -138,6 +152,34 @@ type ClusterExtensionInstallConfig struct {
Preflight *PreflightConfig `json:"preflight,omitempty"`
}
+// ClusterExtensionConfig is a discriminated union which selects the source configuration values to be merged into
+// the ClusterExtension's rendered manifests.
+//
+// +kubebuilder:validation:XValidation:rule="has(self.configType) && self.configType == 'Inline' ?has(self.inline) : !has(self.inline)",message="inline is required when configType is Inline, and forbidden otherwise"
+// +union
+type ClusterExtensionConfig struct {
+ // configType is a required reference to the type of configuration source.
+ //
+ // Allowed values are "Inline"
+ //
+ // When this field is set to "Inline", the cluster extension configuration is defined inline within the
+ // ClusterExtension resource.
+ //
+ // +unionDiscriminator
+ // +kubebuilder:validation:Enum:="Inline"
+ // +kubebuilder:validation:Required
+ ConfigType ClusterExtensionConfigType `json:"configType"`
+
+ // inline contains JSON or YAML values specified directly in the
+ // ClusterExtension.
+ //
+ // inline must be set if configType is 'Inline'.
+ //
+ // +kubebuilder:validation:Type=object
+ // +optional
+ Inline *apiextensionsv1.JSON `json:"inline,omitempty"`
+}
+
// CatalogFilter defines the attributes used to identify and filter content from a catalog.
type CatalogFilter struct {
// packageName is a reference to the name of the package to be installed
diff --git a/openshift/default-catalog-consistency/vendor/github.com/operator-framework/operator-controller/api/v1/zz_generated.deepcopy.go b/openshift/default-catalog-consistency/vendor/github.com/operator-framework/operator-controller/api/v1/zz_generated.deepcopy.go
index 37694f61f..01ad99562 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/operator-framework/operator-controller/api/v1/zz_generated.deepcopy.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/operator-framework/operator-controller/api/v1/zz_generated.deepcopy.go
@@ -65,8 +65,7 @@ func (in *CatalogFilter) DeepCopyInto(out *CatalogFilter) {
}
if in.Selector != nil {
in, out := &in.Selector, &out.Selector
- *out = new(metav1.LabelSelector)
- (*in).DeepCopyInto(*out)
+ *out = (*in).DeepCopy()
}
}
@@ -253,6 +252,25 @@ func (in *ClusterExtension) DeepCopyObject() runtime.Object {
return nil
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ClusterExtensionConfig) DeepCopyInto(out *ClusterExtensionConfig) {
+ *out = *in
+ if in.Inline != nil {
+ in, out := &in.Inline, &out.Inline
+ *out = (*in).DeepCopy()
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterExtensionConfig.
+func (in *ClusterExtensionConfig) DeepCopy() *ClusterExtensionConfig {
+ if in == nil {
+ return nil
+ }
+ out := new(ClusterExtensionConfig)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterExtensionInstallConfig) DeepCopyInto(out *ClusterExtensionInstallConfig) {
*out = *in
@@ -331,6 +349,11 @@ func (in *ClusterExtensionSpec) DeepCopyInto(out *ClusterExtensionSpec) {
*out = new(ClusterExtensionInstallConfig)
(*in).DeepCopyInto(*out)
}
+ if in.Config != nil {
+ in, out := &in.Config, &out.Config
+ *out = new(ClusterExtensionConfig)
+ (*in).DeepCopyInto(*out)
+ }
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterExtensionSpec.
diff --git a/openshift/default-catalog-consistency/vendor/github.com/operator-framework/operator-registry/alpha/declcfg/write.go b/openshift/default-catalog-consistency/vendor/github.com/operator-framework/operator-registry/alpha/declcfg/write.go
index 293d9363b..52b2a67f3 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/operator-framework/operator-registry/alpha/declcfg/write.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/operator-framework/operator-registry/alpha/declcfg/write.go
@@ -7,6 +7,7 @@ import (
"io"
"os"
"path/filepath"
+ "slices"
"sort"
"strings"
@@ -20,6 +21,7 @@ import (
type MermaidWriter struct {
MinEdgeName string
SpecifiedPackageName string
+ DrawV0Semantics bool
}
type MermaidOption func(*MermaidWriter)
@@ -32,6 +34,7 @@ func NewMermaidWriter(opts ...MermaidOption) *MermaidWriter {
m := &MermaidWriter{
MinEdgeName: minEdgeName,
SpecifiedPackageName: specifiedPackageName,
+ DrawV0Semantics: true,
}
for _, opt := range opts {
@@ -52,6 +55,12 @@ func WithSpecifiedPackageName(specifiedPackageName string) MermaidOption {
}
}
+func WithV0Semantics(drawV0Semantics bool) MermaidOption {
+ return func(o *MermaidWriter) {
+ o.DrawV0Semantics = drawV0Semantics
+ }
+}
+
// writes out the channel edges of the declarative config graph in a mermaid format capable of being pasted into
// mermaid renderers like github, mermaid.live, etc.
// output is sorted lexicographically by package name, and then by channel name
@@ -124,7 +133,10 @@ func (writer *MermaidWriter) WriteChannels(cfg DeclarativeConfig, out io.Writer)
}
var deprecatedPackage string
- deprecatedChannels := []string{}
+ deprecatedChannelIDs := []string{}
+ decoratedBundleIDs := map[string][]string{"deprecated": {}, "skipped": {}, "deprecatedskipped": {}}
+ linkID := 0
+ skippedLinkIDs := []string{}
for _, c := range cfg.Channels {
filteredChannel := writer.filterChannel(&c, versionMap, minVersion, minEdgePackage)
@@ -137,58 +149,102 @@ func (writer *MermaidWriter) WriteChannels(cfg DeclarativeConfig, out io.Writer)
}
channelID := fmt.Sprintf("%s-%s", filteredChannel.Package, filteredChannel.Name)
- pkgBuilder.WriteString(fmt.Sprintf(" %%%% channel %q\n", filteredChannel.Name))
- pkgBuilder.WriteString(fmt.Sprintf(" subgraph %s[%q]\n", channelID, filteredChannel.Name))
+ fmt.Fprintf(pkgBuilder, " %%%% channel %q\n", filteredChannel.Name)
+ fmt.Fprintf(pkgBuilder, " subgraph %s[%q]\n", channelID, filteredChannel.Name)
if depByPackage.Has(filteredChannel.Package) {
deprecatedPackage = filteredChannel.Package
}
if depByChannel.Has(filteredChannel.Name) {
- deprecatedChannels = append(deprecatedChannels, channelID)
+ deprecatedChannelIDs = append(deprecatedChannelIDs, channelID)
}
- for _, ce := range filteredChannel.Entries {
- if versionMap[ce.Name].GE(minVersion) {
- bundleDeprecation := ""
- if depByBundle.Has(ce.Name) {
- bundleDeprecation = ":::deprecated"
+ // sort edges by decreasing version
+ sortedEntries := make([]*ChannelEntry, 0, len(filteredChannel.Entries))
+ for i := range filteredChannel.Entries {
+ sortedEntries = append(sortedEntries, &filteredChannel.Entries[i])
+ }
+ sort.Slice(sortedEntries, func(i, j int) bool {
+ // Sort by decreasing version: greater version comes first
+ return versionMap[sortedEntries[i].Name].GT(versionMap[sortedEntries[j].Name])
+ })
+
+ skippedEntities := sets.Set[string]{}
+
+ const (
+ captureNewEntry = true
+ processExisting = false
+ )
+ handleSemantics := func(edge string, linkID int, captureNew bool) {
+ if writer.DrawV0Semantics {
+ if captureNew {
+ if skippedEntities.Has(edge) {
+ skippedLinkIDs = append(skippedLinkIDs, fmt.Sprintf("%d", linkID))
+ } else {
+ skippedEntities.Insert(edge)
+ }
+ } else {
+ if skippedEntities.Has(edge) {
+ skippedLinkIDs = append(skippedLinkIDs, fmt.Sprintf("%d", linkID))
+ }
}
+ }
+ }
- entryID := fmt.Sprintf("%s-%s", channelID, ce.Name)
- pkgBuilder.WriteString(fmt.Sprintf(" %s[%q]%s\n", entryID, ce.Name, bundleDeprecation))
+ for _, ce := range sortedEntries {
+ entryID := fmt.Sprintf("%s-%s", channelID, ce.Name)
+ fmt.Fprintf(pkgBuilder, " %s[%q]\n", entryID, ce.Name)
+
+ // mermaid allows specification of only a single decoration class, so any combinations must be independently represented
+ switch {
+ case depByBundle.Has(ce.Name) && skippedEntities.Has(ce.Name):
+ decoratedBundleIDs["deprecatedskipped"] = append(decoratedBundleIDs["deprecatedskipped"], entryID)
+ case depByBundle.Has(ce.Name):
+ decoratedBundleIDs["deprecated"] = append(decoratedBundleIDs["deprecated"], entryID)
+ case skippedEntities.Has(ce.Name):
+ decoratedBundleIDs["skipped"] = append(decoratedBundleIDs["skipped"], entryID)
+ }
- if len(ce.Replaces) > 0 {
- replacesID := fmt.Sprintf("%s-%s", channelID, ce.Replaces)
- pkgBuilder.WriteString(fmt.Sprintf(" %s[%q]-- %s --> %s[%q]\n", replacesID, ce.Replaces, "replace", entryID, ce.Name))
- }
- if len(ce.Skips) > 0 {
- for _, s := range ce.Skips {
- skipsID := fmt.Sprintf("%s-%s", channelID, s)
- pkgBuilder.WriteString(fmt.Sprintf(" %s[%q]-- %s --> %s[%q]\n", skipsID, s, "skip", entryID, ce.Name))
- }
+ if len(ce.Skips) > 0 {
+ for _, s := range ce.Skips {
+ skipsID := fmt.Sprintf("%s-%s", channelID, s)
+ fmt.Fprintf(pkgBuilder, " %s[%q]-- %s --> %s[%q]\n", skipsID, s, "skip", entryID, ce.Name)
+ handleSemantics(s, linkID, captureNewEntry)
+ linkID++
}
- if len(ce.SkipRange) > 0 {
- skipRange, err := semver.ParseRange(ce.SkipRange)
- if err == nil {
- for _, edgeName := range filteredChannel.Entries {
- if skipRange(versionMap[edgeName.Name]) {
- skipRangeID := fmt.Sprintf("%s-%s", channelID, edgeName.Name)
- pkgBuilder.WriteString(fmt.Sprintf(" %s[%q]-- \"%s(%s)\" --> %s[%q]\n", skipRangeID, edgeName.Name, "skipRange", ce.SkipRange, entryID, ce.Name))
- }
+ }
+ if len(ce.SkipRange) > 0 {
+ skipRange, err := semver.ParseRange(ce.SkipRange)
+ if err == nil {
+ for _, edgeName := range filteredChannel.Entries {
+ if skipRange(versionMap[edgeName.Name]) {
+ skipRangeID := fmt.Sprintf("%s-%s", channelID, edgeName.Name)
+ fmt.Fprintf(pkgBuilder, " %s[%q]-- \"%s(%s)\" --> %s[%q]\n", skipRangeID, edgeName.Name, "skipRange", ce.SkipRange, entryID, ce.Name)
+ handleSemantics(ce.Name, linkID, processExisting)
+ linkID++
}
- } else {
- fmt.Fprintf(os.Stderr, "warning: ignoring invalid SkipRange for package/edge %q/%q: %v\n", c.Package, ce.Name, err)
}
+ } else {
+ fmt.Fprintf(os.Stderr, "warning: ignoring invalid SkipRange for package/edge %q/%q: %v\n", c.Package, ce.Name, err)
}
}
+ // have to process replaces last, because applicablity can be impacted by skips
+ if len(ce.Replaces) > 0 {
+ replacesID := fmt.Sprintf("%s-%s", channelID, ce.Replaces)
+ fmt.Fprintf(pkgBuilder, " %s[%q]-- %s --> %s[%q]\n", replacesID, ce.Replaces, "replace", entryID, ce.Name)
+ handleSemantics(ce.Name, linkID, processExisting)
+ linkID++
+ }
}
- pkgBuilder.WriteString(" end\n")
+ fmt.Fprintf(pkgBuilder, " end\n")
}
}
_, _ = out.Write([]byte("graph LR\n"))
_, _ = out.Write([]byte(" classDef deprecated fill:#E8960F\n"))
+ _, _ = out.Write([]byte(" classDef skipped stroke:#FF0000,stroke-width:4px\n"))
+ _, _ = out.Write([]byte(" classDef deprecatedskipped fill:#E8960F,stroke:#FF0000,stroke-width:4px\n"))
pkgNames := []string{}
for pname := range pkgs {
pkgNames = append(pkgNames, pname)
@@ -197,22 +253,35 @@ func (writer *MermaidWriter) WriteChannels(cfg DeclarativeConfig, out io.Writer)
return pkgNames[i] < pkgNames[j]
})
for _, pkgName := range pkgNames {
- _, _ = out.Write([]byte(fmt.Sprintf(" %%%% package %q\n", pkgName)))
- _, _ = out.Write([]byte(fmt.Sprintf(" subgraph %q\n", pkgName)))
+ _, _ = fmt.Fprintf(out, " %%%% package %q\n", pkgName)
+ _, _ = fmt.Fprintf(out, " subgraph %q\n", pkgName)
_, _ = out.Write([]byte(pkgs[pkgName].String()))
_, _ = out.Write([]byte(" end\n"))
}
if deprecatedPackage != "" {
- _, _ = out.Write([]byte(fmt.Sprintf("style %s fill:#989695\n", deprecatedPackage)))
+ _, _ = fmt.Fprintf(out, "style %s fill:#989695\n", deprecatedPackage)
+ }
+
+ if len(deprecatedChannelIDs) > 0 {
+ for _, deprecatedChannel := range deprecatedChannelIDs {
+ _, _ = fmt.Fprintf(out, "style %s fill:#DCD0FF\n", deprecatedChannel)
+ }
}
- if len(deprecatedChannels) > 0 {
- for _, deprecatedChannel := range deprecatedChannels {
- _, _ = out.Write([]byte(fmt.Sprintf("style %s fill:#DCD0FF\n", deprecatedChannel)))
+ // express the decoration classes
+ for key := range decoratedBundleIDs {
+ if len(decoratedBundleIDs[key]) > 0 {
+ b := slices.Clone(decoratedBundleIDs[key])
+ slices.Sort(b)
+ _, _ = fmt.Fprintf(out, "class %s %s\n", strings.Join(b, ","), key)
}
}
+ if len(skippedLinkIDs) > 0 {
+ _, _ = fmt.Fprintf(out, "linkStyle %s %s\n", strings.Join(skippedLinkIDs, ","), "stroke:#FF0000,stroke-width:3px,stroke-dasharray:5;")
+ }
+
return nil
}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/CONTRIBUTORS.md b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/CONTRIBUTORS.md
deleted file mode 100644
index bdff02765..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/CONTRIBUTORS.md
+++ /dev/null
@@ -1,122 +0,0 @@
-# Contributing
-
-When contributing to this repository, please first discuss the change you wish
-to make via an [issue](https://github.com/sigstore/rekor/issues).
-
-## Pull Request Process
-
-1. Create an [issue](https://github.com/sigstore/rekor/issues)
- outlining the fix or feature.
-2. Fork the rekor repository to your own github account and clone it locally.
-3. Hack on your changes.
-4. Update the README.md with details of changes to any interface, this includes new environment
- variables, exposed ports, useful file locations, CLI parameters and
- new or changed configuration values.
-5. Correctly format your commit message see [Commit Messages](#Commit Message Guidelines)
- below.
-6. Ensure that CI passes, if it fails, fix the failures.
-7. Every pull request requires a review from the [core rekor team](https://github.com/orgs/github.com/sigstore/teams/core-team)
- before merging.
-8. If your pull request consists of more than one commit, please squash your
- commits as described in [Squash Commits](#Squash Commits)
-
-## Commit Message Guidelines
-
-We follow the commit formatting recommendations found on [Chris Beams' How to Write a Git Commit Message article]((https://chris.beams.io/posts/git-commit/).
-
-Well formed commit messages not only help reviewers understand the nature of
-the Pull Request, but also assists the release process where commit messages
-are used to generate release notes.
-
-A good example of a commit message would be as follows:
-
-```
-Summarize changes in around 50 characters or less
-
-More detailed explanatory text, if necessary. Wrap it to about 72
-characters or so. In some contexts, the first line is treated as the
-subject of the commit and the rest of the text as the body. The
-blank line separating the summary from the body is critical (unless
-you omit the body entirely); various tools like `log`, `shortlog`
-and `rebase` can get confused if you run the two together.
-
-Explain the problem that this commit is solving. Focus on why you
-are making this change as opposed to how (the code explains that).
-Are there side effects or other unintuitive consequences of this
-change? Here's the place to explain them.
-
-Further paragraphs come after blank lines.
-
- - Bullet points are okay, too
-
- - Typically a hyphen or asterisk is used for the bullet, preceded
- by a single space, with blank lines in between, but conventions
- vary here
-
-If you use an issue tracker, put references to them at the bottom,
-like this:
-
-Resolves: #123
-See also: #456, #789
-```
-
-Note the `Resolves #123` tag, this references the issue raised and allows us to
-ensure issues are associated and closed when a pull request is merged.
-
-Please refer to [the github help page on message types](https://help.github.com/articles/closing-issues-using-keywords/)
-for a complete list of issue references.
-
-## Squash Commits
-
-Should your pull request consist of more than one commit (perhaps due to
-a change being requested during the review cycle), please perform a git squash
-once a reviewer has approved your pull request.
-
-A squash can be performed as follows. Let's say you have the following commits:
-
- initial commit
- second commit
- final commit
-
-Run the command below with the number set to the total commits you wish to
-squash (in our case 3 commits):
-
- git rebase -i HEAD~3
-
-You default text editor will then open up and you will see the following::
-
- pick eb36612 initial commit
- pick 9ac8968 second commit
- pick a760569 final commit
-
- # Rebase eb1429f..a760569 onto eb1429f (3 commands)
-
-We want to rebase on top of our first commit, so we change the other two commits
-to `squash`:
-
- pick eb36612 initial commit
- squash 9ac8968 second commit
- squash a760569 final commit
-
-After this, should you wish to update your commit message to better summarise
-all of your pull request, run:
-
- git commit --amend
-
-You will then need to force push (assuming your initial commit(s) were posted
-to github):
-
- git push origin your-branch --force
-
-Alternatively, a core member can squash your commits within Github.
-
-## DCO Signoff
-
-Make sure to sign the [Developer Certificate of
-Origin](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---signoff).
-
-## Code of Conduct
-
-Rekor adheres to and enforces the [Contributor Covenant](http://contributor-covenant.org/version/1/4/) Code of Conduct.
-Please take a moment to read the [CODE_OF_CONDUCT.md](https://github.com/sigstore/rekor/blob/master/CODE_OF_CONDUCT.md) document.
-
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/LICENSE b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/LICENSE
deleted file mode 100644
index d64569567..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/alpine.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/alpine.go
deleted file mode 100644
index 5607679fd..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/alpine.go
+++ /dev/null
@@ -1,210 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "bytes"
- "context"
- "encoding/json"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// Alpine Alpine package
-//
-// swagger:model alpine
-type Alpine struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec AlpineSchema `json:"spec"`
-}
-
-// Kind gets the kind of this subtype
-func (m *Alpine) Kind() string {
- return "alpine"
-}
-
-// SetKind sets the kind of this subtype
-func (m *Alpine) SetKind(val string) {
-}
-
-// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure
-func (m *Alpine) UnmarshalJSON(raw []byte) error {
- var data struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec AlpineSchema `json:"spec"`
- }
- buf := bytes.NewBuffer(raw)
- dec := json.NewDecoder(buf)
- dec.UseNumber()
-
- if err := dec.Decode(&data); err != nil {
- return err
- }
-
- var base struct {
- /* Just the base type fields. Used for unmashalling polymorphic types.*/
-
- Kind string `json:"kind"`
- }
- buf = bytes.NewBuffer(raw)
- dec = json.NewDecoder(buf)
- dec.UseNumber()
-
- if err := dec.Decode(&base); err != nil {
- return err
- }
-
- var result Alpine
-
- if base.Kind != result.Kind() {
- /* Not the type we're looking for. */
- return errors.New(422, "invalid kind value: %q", base.Kind)
- }
-
- result.APIVersion = data.APIVersion
- result.Spec = data.Spec
-
- *m = result
-
- return nil
-}
-
-// MarshalJSON marshals this object with a polymorphic type to a JSON structure
-func (m Alpine) MarshalJSON() ([]byte, error) {
- var b1, b2, b3 []byte
- var err error
- b1, err = json.Marshal(struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec AlpineSchema `json:"spec"`
- }{
-
- APIVersion: m.APIVersion,
-
- Spec: m.Spec,
- })
- if err != nil {
- return nil, err
- }
- b2, err = json.Marshal(struct {
- Kind string `json:"kind"`
- }{
-
- Kind: m.Kind(),
- })
- if err != nil {
- return nil, err
- }
-
- return swag.ConcatJSON(b1, b2, b3), nil
-}
-
-// Validate validates this alpine
-func (m *Alpine) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateAPIVersion(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateSpec(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *Alpine) validateAPIVersion(formats strfmt.Registry) error {
-
- if err := validate.Required("apiVersion", "body", m.APIVersion); err != nil {
- return err
- }
-
- if err := validate.Pattern("apiVersion", "body", *m.APIVersion, `^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *Alpine) validateSpec(formats strfmt.Registry) error {
-
- if m.Spec == nil {
- return errors.Required("spec", "body", nil)
- }
-
- return nil
-}
-
-// ContextValidate validate this alpine based on the context it is used
-func (m *Alpine) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *Alpine) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *Alpine) UnmarshalBinary(b []byte) error {
- var res Alpine
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/alpine_schema.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/alpine_schema.go
deleted file mode 100644
index edd25408b..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/alpine_schema.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-// AlpineSchema Alpine Package Schema
-//
-// # Schema for Alpine package objects
-//
-// swagger:model alpineSchema
-type AlpineSchema interface{}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/alpine_v001_schema.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/alpine_v001_schema.go
deleted file mode 100644
index a239c84fa..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/alpine_v001_schema.go
+++ /dev/null
@@ -1,455 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "context"
- "encoding/json"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// AlpineV001Schema Alpine v0.0.1 Schema
-//
-// # Schema for Alpine Package entries
-//
-// swagger:model alpineV001Schema
-type AlpineV001Schema struct {
-
- // package
- // Required: true
- Package *AlpineV001SchemaPackage `json:"package"`
-
- // public key
- // Required: true
- PublicKey *AlpineV001SchemaPublicKey `json:"publicKey"`
-}
-
-// Validate validates this alpine v001 schema
-func (m *AlpineV001Schema) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validatePackage(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validatePublicKey(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *AlpineV001Schema) validatePackage(formats strfmt.Registry) error {
-
- if err := validate.Required("package", "body", m.Package); err != nil {
- return err
- }
-
- if m.Package != nil {
- if err := m.Package.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("package")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("package")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *AlpineV001Schema) validatePublicKey(formats strfmt.Registry) error {
-
- if err := validate.Required("publicKey", "body", m.PublicKey); err != nil {
- return err
- }
-
- if m.PublicKey != nil {
- if err := m.PublicKey.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("publicKey")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("publicKey")
- }
- return err
- }
- }
-
- return nil
-}
-
-// ContextValidate validate this alpine v001 schema based on the context it is used
-func (m *AlpineV001Schema) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidatePackage(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.contextValidatePublicKey(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *AlpineV001Schema) contextValidatePackage(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Package != nil {
-
- if err := m.Package.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("package")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("package")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *AlpineV001Schema) contextValidatePublicKey(ctx context.Context, formats strfmt.Registry) error {
-
- if m.PublicKey != nil {
-
- if err := m.PublicKey.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("publicKey")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("publicKey")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *AlpineV001Schema) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *AlpineV001Schema) UnmarshalBinary(b []byte) error {
- var res AlpineV001Schema
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// AlpineV001SchemaPackage Information about the package associated with the entry
-//
-// swagger:model AlpineV001SchemaPackage
-type AlpineV001SchemaPackage struct {
-
- // Specifies the package inline within the document
- // Format: byte
- Content strfmt.Base64 `json:"content,omitempty"`
-
- // hash
- Hash *AlpineV001SchemaPackageHash `json:"hash,omitempty"`
-
- // Values of the .PKGINFO key / value pairs
- // Read Only: true
- Pkginfo map[string]string `json:"pkginfo,omitempty"`
-}
-
-// Validate validates this alpine v001 schema package
-func (m *AlpineV001SchemaPackage) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateHash(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *AlpineV001SchemaPackage) validateHash(formats strfmt.Registry) error {
- if swag.IsZero(m.Hash) { // not required
- return nil
- }
-
- if m.Hash != nil {
- if err := m.Hash.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("package" + "." + "hash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("package" + "." + "hash")
- }
- return err
- }
- }
-
- return nil
-}
-
-// ContextValidate validate this alpine v001 schema package based on the context it is used
-func (m *AlpineV001SchemaPackage) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateHash(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.contextValidatePkginfo(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *AlpineV001SchemaPackage) contextValidateHash(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Hash != nil {
-
- if swag.IsZero(m.Hash) { // not required
- return nil
- }
-
- if err := m.Hash.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("package" + "." + "hash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("package" + "." + "hash")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *AlpineV001SchemaPackage) contextValidatePkginfo(ctx context.Context, formats strfmt.Registry) error {
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *AlpineV001SchemaPackage) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *AlpineV001SchemaPackage) UnmarshalBinary(b []byte) error {
- var res AlpineV001SchemaPackage
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// AlpineV001SchemaPackageHash Specifies the hash algorithm and value for the package
-//
-// swagger:model AlpineV001SchemaPackageHash
-type AlpineV001SchemaPackageHash struct {
-
- // The hashing function used to compute the hash value
- // Required: true
- // Enum: ["sha256"]
- Algorithm *string `json:"algorithm"`
-
- // The hash value for the package
- // Required: true
- Value *string `json:"value"`
-}
-
-// Validate validates this alpine v001 schema package hash
-func (m *AlpineV001SchemaPackageHash) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateAlgorithm(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateValue(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-var alpineV001SchemaPackageHashTypeAlgorithmPropEnum []interface{}
-
-func init() {
- var res []string
- if err := json.Unmarshal([]byte(`["sha256"]`), &res); err != nil {
- panic(err)
- }
- for _, v := range res {
- alpineV001SchemaPackageHashTypeAlgorithmPropEnum = append(alpineV001SchemaPackageHashTypeAlgorithmPropEnum, v)
- }
-}
-
-const (
-
- // AlpineV001SchemaPackageHashAlgorithmSha256 captures enum value "sha256"
- AlpineV001SchemaPackageHashAlgorithmSha256 string = "sha256"
-)
-
-// prop value enum
-func (m *AlpineV001SchemaPackageHash) validateAlgorithmEnum(path, location string, value string) error {
- if err := validate.EnumCase(path, location, value, alpineV001SchemaPackageHashTypeAlgorithmPropEnum, true); err != nil {
- return err
- }
- return nil
-}
-
-func (m *AlpineV001SchemaPackageHash) validateAlgorithm(formats strfmt.Registry) error {
-
- if err := validate.Required("package"+"."+"hash"+"."+"algorithm", "body", m.Algorithm); err != nil {
- return err
- }
-
- // value enum
- if err := m.validateAlgorithmEnum("package"+"."+"hash"+"."+"algorithm", "body", *m.Algorithm); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *AlpineV001SchemaPackageHash) validateValue(formats strfmt.Registry) error {
-
- if err := validate.Required("package"+"."+"hash"+"."+"value", "body", m.Value); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validate this alpine v001 schema package hash based on the context it is used
-func (m *AlpineV001SchemaPackageHash) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *AlpineV001SchemaPackageHash) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *AlpineV001SchemaPackageHash) UnmarshalBinary(b []byte) error {
- var res AlpineV001SchemaPackageHash
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// AlpineV001SchemaPublicKey The public key that can verify the package signature
-//
-// swagger:model AlpineV001SchemaPublicKey
-type AlpineV001SchemaPublicKey struct {
-
- // Specifies the content of the public key inline within the document
- // Required: true
- // Format: byte
- Content *strfmt.Base64 `json:"content"`
-}
-
-// Validate validates this alpine v001 schema public key
-func (m *AlpineV001SchemaPublicKey) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateContent(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *AlpineV001SchemaPublicKey) validateContent(formats strfmt.Registry) error {
-
- if err := validate.Required("publicKey"+"."+"content", "body", m.Content); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validates this alpine v001 schema public key based on context it is used
-func (m *AlpineV001SchemaPublicKey) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *AlpineV001SchemaPublicKey) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *AlpineV001SchemaPublicKey) UnmarshalBinary(b []byte) error {
- var res AlpineV001SchemaPublicKey
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/consistency_proof.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/consistency_proof.go
deleted file mode 100644
index 804ddd11a..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/consistency_proof.go
+++ /dev/null
@@ -1,118 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "context"
- "strconv"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// ConsistencyProof consistency proof
-//
-// swagger:model ConsistencyProof
-type ConsistencyProof struct {
-
- // hashes
- // Required: true
- Hashes []string `json:"hashes"`
-
- // The hash value stored at the root of the merkle tree at the time the proof was generated
- // Required: true
- // Pattern: ^[0-9a-fA-F]{64}$
- RootHash *string `json:"rootHash"`
-}
-
-// Validate validates this consistency proof
-func (m *ConsistencyProof) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateHashes(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateRootHash(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *ConsistencyProof) validateHashes(formats strfmt.Registry) error {
-
- if err := validate.Required("hashes", "body", m.Hashes); err != nil {
- return err
- }
-
- for i := 0; i < len(m.Hashes); i++ {
-
- if err := validate.Pattern("hashes"+"."+strconv.Itoa(i), "body", m.Hashes[i], `^[0-9a-fA-F]{64}$`); err != nil {
- return err
- }
-
- }
-
- return nil
-}
-
-func (m *ConsistencyProof) validateRootHash(formats strfmt.Registry) error {
-
- if err := validate.Required("rootHash", "body", m.RootHash); err != nil {
- return err
- }
-
- if err := validate.Pattern("rootHash", "body", *m.RootHash, `^[0-9a-fA-F]{64}$`); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validates this consistency proof based on context it is used
-func (m *ConsistencyProof) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *ConsistencyProof) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *ConsistencyProof) UnmarshalBinary(b []byte) error {
- var res ConsistencyProof
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/cose.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/cose.go
deleted file mode 100644
index 8de4083ba..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/cose.go
+++ /dev/null
@@ -1,210 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "bytes"
- "context"
- "encoding/json"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// Cose COSE object
-//
-// swagger:model cose
-type Cose struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec CoseSchema `json:"spec"`
-}
-
-// Kind gets the kind of this subtype
-func (m *Cose) Kind() string {
- return "cose"
-}
-
-// SetKind sets the kind of this subtype
-func (m *Cose) SetKind(val string) {
-}
-
-// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure
-func (m *Cose) UnmarshalJSON(raw []byte) error {
- var data struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec CoseSchema `json:"spec"`
- }
- buf := bytes.NewBuffer(raw)
- dec := json.NewDecoder(buf)
- dec.UseNumber()
-
- if err := dec.Decode(&data); err != nil {
- return err
- }
-
- var base struct {
- /* Just the base type fields. Used for unmashalling polymorphic types.*/
-
- Kind string `json:"kind"`
- }
- buf = bytes.NewBuffer(raw)
- dec = json.NewDecoder(buf)
- dec.UseNumber()
-
- if err := dec.Decode(&base); err != nil {
- return err
- }
-
- var result Cose
-
- if base.Kind != result.Kind() {
- /* Not the type we're looking for. */
- return errors.New(422, "invalid kind value: %q", base.Kind)
- }
-
- result.APIVersion = data.APIVersion
- result.Spec = data.Spec
-
- *m = result
-
- return nil
-}
-
-// MarshalJSON marshals this object with a polymorphic type to a JSON structure
-func (m Cose) MarshalJSON() ([]byte, error) {
- var b1, b2, b3 []byte
- var err error
- b1, err = json.Marshal(struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec CoseSchema `json:"spec"`
- }{
-
- APIVersion: m.APIVersion,
-
- Spec: m.Spec,
- })
- if err != nil {
- return nil, err
- }
- b2, err = json.Marshal(struct {
- Kind string `json:"kind"`
- }{
-
- Kind: m.Kind(),
- })
- if err != nil {
- return nil, err
- }
-
- return swag.ConcatJSON(b1, b2, b3), nil
-}
-
-// Validate validates this cose
-func (m *Cose) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateAPIVersion(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateSpec(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *Cose) validateAPIVersion(formats strfmt.Registry) error {
-
- if err := validate.Required("apiVersion", "body", m.APIVersion); err != nil {
- return err
- }
-
- if err := validate.Pattern("apiVersion", "body", *m.APIVersion, `^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *Cose) validateSpec(formats strfmt.Registry) error {
-
- if m.Spec == nil {
- return errors.Required("spec", "body", nil)
- }
-
- return nil
-}
-
-// ContextValidate validate this cose based on the context it is used
-func (m *Cose) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *Cose) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *Cose) UnmarshalBinary(b []byte) error {
- var res Cose
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/cose_schema.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/cose_schema.go
deleted file mode 100644
index e653f2202..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/cose_schema.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-// CoseSchema COSE Schema
-//
-// # COSE for Rekord objects
-//
-// swagger:model coseSchema
-type CoseSchema interface{}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/cose_v001_schema.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/cose_v001_schema.go
deleted file mode 100644
index 5818dca1c..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/cose_v001_schema.go
+++ /dev/null
@@ -1,521 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "context"
- "encoding/json"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// CoseV001Schema cose v0.0.1 Schema
-//
-// # Schema for cose object
-//
-// swagger:model coseV001Schema
-type CoseV001Schema struct {
-
- // data
- Data *CoseV001SchemaData `json:"data,omitempty"`
-
- // The COSE Sign1 Message
- // Format: byte
- Message strfmt.Base64 `json:"message,omitempty"`
-
- // The public key that can verify the signature
- // Required: true
- // Format: byte
- PublicKey *strfmt.Base64 `json:"publicKey"`
-}
-
-// Validate validates this cose v001 schema
-func (m *CoseV001Schema) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateData(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validatePublicKey(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *CoseV001Schema) validateData(formats strfmt.Registry) error {
- if swag.IsZero(m.Data) { // not required
- return nil
- }
-
- if m.Data != nil {
- if err := m.Data.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("data")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("data")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *CoseV001Schema) validatePublicKey(formats strfmt.Registry) error {
-
- if err := validate.Required("publicKey", "body", m.PublicKey); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validate this cose v001 schema based on the context it is used
-func (m *CoseV001Schema) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateData(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *CoseV001Schema) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Data != nil {
-
- if swag.IsZero(m.Data) { // not required
- return nil
- }
-
- if err := m.Data.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("data")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("data")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *CoseV001Schema) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *CoseV001Schema) UnmarshalBinary(b []byte) error {
- var res CoseV001Schema
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// CoseV001SchemaData Information about the content associated with the entry
-//
-// swagger:model CoseV001SchemaData
-type CoseV001SchemaData struct {
-
- // Specifies the additional authenticated data required to verify the signature
- // Format: byte
- Aad strfmt.Base64 `json:"aad,omitempty"`
-
- // envelope hash
- EnvelopeHash *CoseV001SchemaDataEnvelopeHash `json:"envelopeHash,omitempty"`
-
- // payload hash
- PayloadHash *CoseV001SchemaDataPayloadHash `json:"payloadHash,omitempty"`
-}
-
-// Validate validates this cose v001 schema data
-func (m *CoseV001SchemaData) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateEnvelopeHash(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validatePayloadHash(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *CoseV001SchemaData) validateEnvelopeHash(formats strfmt.Registry) error {
- if swag.IsZero(m.EnvelopeHash) { // not required
- return nil
- }
-
- if m.EnvelopeHash != nil {
- if err := m.EnvelopeHash.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("data" + "." + "envelopeHash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("data" + "." + "envelopeHash")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *CoseV001SchemaData) validatePayloadHash(formats strfmt.Registry) error {
- if swag.IsZero(m.PayloadHash) { // not required
- return nil
- }
-
- if m.PayloadHash != nil {
- if err := m.PayloadHash.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("data" + "." + "payloadHash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("data" + "." + "payloadHash")
- }
- return err
- }
- }
-
- return nil
-}
-
-// ContextValidate validate this cose v001 schema data based on the context it is used
-func (m *CoseV001SchemaData) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateEnvelopeHash(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.contextValidatePayloadHash(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *CoseV001SchemaData) contextValidateEnvelopeHash(ctx context.Context, formats strfmt.Registry) error {
-
- if m.EnvelopeHash != nil {
-
- if swag.IsZero(m.EnvelopeHash) { // not required
- return nil
- }
-
- if err := m.EnvelopeHash.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("data" + "." + "envelopeHash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("data" + "." + "envelopeHash")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *CoseV001SchemaData) contextValidatePayloadHash(ctx context.Context, formats strfmt.Registry) error {
-
- if m.PayloadHash != nil {
-
- if swag.IsZero(m.PayloadHash) { // not required
- return nil
- }
-
- if err := m.PayloadHash.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("data" + "." + "payloadHash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("data" + "." + "payloadHash")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *CoseV001SchemaData) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *CoseV001SchemaData) UnmarshalBinary(b []byte) error {
- var res CoseV001SchemaData
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// CoseV001SchemaDataEnvelopeHash Specifies the hash algorithm and value for the COSE envelope
-//
-// swagger:model CoseV001SchemaDataEnvelopeHash
-type CoseV001SchemaDataEnvelopeHash struct {
-
- // The hashing function used to compute the hash value
- // Required: true
- // Enum: ["sha256"]
- Algorithm *string `json:"algorithm"`
-
- // The hash value for the envelope
- // Required: true
- Value *string `json:"value"`
-}
-
-// Validate validates this cose v001 schema data envelope hash
-func (m *CoseV001SchemaDataEnvelopeHash) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateAlgorithm(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateValue(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-var coseV001SchemaDataEnvelopeHashTypeAlgorithmPropEnum []interface{}
-
-func init() {
- var res []string
- if err := json.Unmarshal([]byte(`["sha256"]`), &res); err != nil {
- panic(err)
- }
- for _, v := range res {
- coseV001SchemaDataEnvelopeHashTypeAlgorithmPropEnum = append(coseV001SchemaDataEnvelopeHashTypeAlgorithmPropEnum, v)
- }
-}
-
-const (
-
- // CoseV001SchemaDataEnvelopeHashAlgorithmSha256 captures enum value "sha256"
- CoseV001SchemaDataEnvelopeHashAlgorithmSha256 string = "sha256"
-)
-
-// prop value enum
-func (m *CoseV001SchemaDataEnvelopeHash) validateAlgorithmEnum(path, location string, value string) error {
- if err := validate.EnumCase(path, location, value, coseV001SchemaDataEnvelopeHashTypeAlgorithmPropEnum, true); err != nil {
- return err
- }
- return nil
-}
-
-func (m *CoseV001SchemaDataEnvelopeHash) validateAlgorithm(formats strfmt.Registry) error {
-
- if err := validate.Required("data"+"."+"envelopeHash"+"."+"algorithm", "body", m.Algorithm); err != nil {
- return err
- }
-
- // value enum
- if err := m.validateAlgorithmEnum("data"+"."+"envelopeHash"+"."+"algorithm", "body", *m.Algorithm); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *CoseV001SchemaDataEnvelopeHash) validateValue(formats strfmt.Registry) error {
-
- if err := validate.Required("data"+"."+"envelopeHash"+"."+"value", "body", m.Value); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validate this cose v001 schema data envelope hash based on the context it is used
-func (m *CoseV001SchemaDataEnvelopeHash) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *CoseV001SchemaDataEnvelopeHash) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *CoseV001SchemaDataEnvelopeHash) UnmarshalBinary(b []byte) error {
- var res CoseV001SchemaDataEnvelopeHash
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// CoseV001SchemaDataPayloadHash Specifies the hash algorithm and value for the content
-//
-// swagger:model CoseV001SchemaDataPayloadHash
-type CoseV001SchemaDataPayloadHash struct {
-
- // The hashing function used to compute the hash value
- // Required: true
- // Enum: ["sha256"]
- Algorithm *string `json:"algorithm"`
-
- // The hash value for the content
- // Required: true
- Value *string `json:"value"`
-}
-
-// Validate validates this cose v001 schema data payload hash
-func (m *CoseV001SchemaDataPayloadHash) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateAlgorithm(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateValue(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-var coseV001SchemaDataPayloadHashTypeAlgorithmPropEnum []interface{}
-
-func init() {
- var res []string
- if err := json.Unmarshal([]byte(`["sha256"]`), &res); err != nil {
- panic(err)
- }
- for _, v := range res {
- coseV001SchemaDataPayloadHashTypeAlgorithmPropEnum = append(coseV001SchemaDataPayloadHashTypeAlgorithmPropEnum, v)
- }
-}
-
-const (
-
- // CoseV001SchemaDataPayloadHashAlgorithmSha256 captures enum value "sha256"
- CoseV001SchemaDataPayloadHashAlgorithmSha256 string = "sha256"
-)
-
-// prop value enum
-func (m *CoseV001SchemaDataPayloadHash) validateAlgorithmEnum(path, location string, value string) error {
- if err := validate.EnumCase(path, location, value, coseV001SchemaDataPayloadHashTypeAlgorithmPropEnum, true); err != nil {
- return err
- }
- return nil
-}
-
-func (m *CoseV001SchemaDataPayloadHash) validateAlgorithm(formats strfmt.Registry) error {
-
- if err := validate.Required("data"+"."+"payloadHash"+"."+"algorithm", "body", m.Algorithm); err != nil {
- return err
- }
-
- // value enum
- if err := m.validateAlgorithmEnum("data"+"."+"payloadHash"+"."+"algorithm", "body", *m.Algorithm); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *CoseV001SchemaDataPayloadHash) validateValue(formats strfmt.Registry) error {
-
- if err := validate.Required("data"+"."+"payloadHash"+"."+"value", "body", m.Value); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validate this cose v001 schema data payload hash based on the context it is used
-func (m *CoseV001SchemaDataPayloadHash) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *CoseV001SchemaDataPayloadHash) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *CoseV001SchemaDataPayloadHash) UnmarshalBinary(b []byte) error {
- var res CoseV001SchemaDataPayloadHash
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/dsse.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/dsse.go
deleted file mode 100644
index dde562054..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/dsse.go
+++ /dev/null
@@ -1,210 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "bytes"
- "context"
- "encoding/json"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// DSSE DSSE envelope
-//
-// swagger:model dsse
-type DSSE struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec DSSESchema `json:"spec"`
-}
-
-// Kind gets the kind of this subtype
-func (m *DSSE) Kind() string {
- return "dsse"
-}
-
-// SetKind sets the kind of this subtype
-func (m *DSSE) SetKind(val string) {
-}
-
-// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure
-func (m *DSSE) UnmarshalJSON(raw []byte) error {
- var data struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec DSSESchema `json:"spec"`
- }
- buf := bytes.NewBuffer(raw)
- dec := json.NewDecoder(buf)
- dec.UseNumber()
-
- if err := dec.Decode(&data); err != nil {
- return err
- }
-
- var base struct {
- /* Just the base type fields. Used for unmashalling polymorphic types.*/
-
- Kind string `json:"kind"`
- }
- buf = bytes.NewBuffer(raw)
- dec = json.NewDecoder(buf)
- dec.UseNumber()
-
- if err := dec.Decode(&base); err != nil {
- return err
- }
-
- var result DSSE
-
- if base.Kind != result.Kind() {
- /* Not the type we're looking for. */
- return errors.New(422, "invalid kind value: %q", base.Kind)
- }
-
- result.APIVersion = data.APIVersion
- result.Spec = data.Spec
-
- *m = result
-
- return nil
-}
-
-// MarshalJSON marshals this object with a polymorphic type to a JSON structure
-func (m DSSE) MarshalJSON() ([]byte, error) {
- var b1, b2, b3 []byte
- var err error
- b1, err = json.Marshal(struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec DSSESchema `json:"spec"`
- }{
-
- APIVersion: m.APIVersion,
-
- Spec: m.Spec,
- })
- if err != nil {
- return nil, err
- }
- b2, err = json.Marshal(struct {
- Kind string `json:"kind"`
- }{
-
- Kind: m.Kind(),
- })
- if err != nil {
- return nil, err
- }
-
- return swag.ConcatJSON(b1, b2, b3), nil
-}
-
-// Validate validates this dsse
-func (m *DSSE) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateAPIVersion(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateSpec(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *DSSE) validateAPIVersion(formats strfmt.Registry) error {
-
- if err := validate.Required("apiVersion", "body", m.APIVersion); err != nil {
- return err
- }
-
- if err := validate.Pattern("apiVersion", "body", *m.APIVersion, `^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *DSSE) validateSpec(formats strfmt.Registry) error {
-
- if m.Spec == nil {
- return errors.Required("spec", "body", nil)
- }
-
- return nil
-}
-
-// ContextValidate validate this dsse based on the context it is used
-func (m *DSSE) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *DSSE) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *DSSE) UnmarshalBinary(b []byte) error {
- var res DSSE
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/dsse_schema.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/dsse_schema.go
deleted file mode 100644
index 779562643..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/dsse_schema.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-// DSSESchema DSSE Schema
-//
-// log entry schema for dsse envelopes
-//
-// swagger:model dsseSchema
-type DSSESchema interface{}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/dsse_v001_schema.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/dsse_v001_schema.go
deleted file mode 100644
index 5fde2a77e..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/dsse_v001_schema.go
+++ /dev/null
@@ -1,685 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "context"
- "encoding/json"
- "strconv"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// DSSEV001Schema DSSE v0.0.1 Schema
-//
-// # Schema for DSSE envelopes
-//
-// swagger:model dsseV001Schema
-type DSSEV001Schema struct {
-
- // envelope hash
- EnvelopeHash *DSSEV001SchemaEnvelopeHash `json:"envelopeHash,omitempty"`
-
- // payload hash
- PayloadHash *DSSEV001SchemaPayloadHash `json:"payloadHash,omitempty"`
-
- // proposed content
- ProposedContent *DSSEV001SchemaProposedContent `json:"proposedContent,omitempty"`
-
- // extracted collection of all signatures of the envelope's payload; elements will be sorted by lexicographical order of the base64 encoded signature strings
- // Read Only: true
- // Min Items: 1
- Signatures []*DSSEV001SchemaSignaturesItems0 `json:"signatures"`
-}
-
-// Validate validates this dsse v001 schema
-func (m *DSSEV001Schema) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateEnvelopeHash(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validatePayloadHash(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateProposedContent(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateSignatures(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *DSSEV001Schema) validateEnvelopeHash(formats strfmt.Registry) error {
- if swag.IsZero(m.EnvelopeHash) { // not required
- return nil
- }
-
- if m.EnvelopeHash != nil {
- if err := m.EnvelopeHash.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("envelopeHash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("envelopeHash")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *DSSEV001Schema) validatePayloadHash(formats strfmt.Registry) error {
- if swag.IsZero(m.PayloadHash) { // not required
- return nil
- }
-
- if m.PayloadHash != nil {
- if err := m.PayloadHash.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("payloadHash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("payloadHash")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *DSSEV001Schema) validateProposedContent(formats strfmt.Registry) error {
- if swag.IsZero(m.ProposedContent) { // not required
- return nil
- }
-
- if m.ProposedContent != nil {
- if err := m.ProposedContent.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("proposedContent")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("proposedContent")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *DSSEV001Schema) validateSignatures(formats strfmt.Registry) error {
- if swag.IsZero(m.Signatures) { // not required
- return nil
- }
-
- iSignaturesSize := int64(len(m.Signatures))
-
- if err := validate.MinItems("signatures", "body", iSignaturesSize, 1); err != nil {
- return err
- }
-
- for i := 0; i < len(m.Signatures); i++ {
- if swag.IsZero(m.Signatures[i]) { // not required
- continue
- }
-
- if m.Signatures[i] != nil {
- if err := m.Signatures[i].Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("signatures" + "." + strconv.Itoa(i))
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("signatures" + "." + strconv.Itoa(i))
- }
- return err
- }
- }
-
- }
-
- return nil
-}
-
-// ContextValidate validate this dsse v001 schema based on the context it is used
-func (m *DSSEV001Schema) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateEnvelopeHash(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.contextValidatePayloadHash(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.contextValidateProposedContent(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.contextValidateSignatures(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *DSSEV001Schema) contextValidateEnvelopeHash(ctx context.Context, formats strfmt.Registry) error {
-
- if m.EnvelopeHash != nil {
-
- if swag.IsZero(m.EnvelopeHash) { // not required
- return nil
- }
-
- if err := m.EnvelopeHash.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("envelopeHash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("envelopeHash")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *DSSEV001Schema) contextValidatePayloadHash(ctx context.Context, formats strfmt.Registry) error {
-
- if m.PayloadHash != nil {
-
- if swag.IsZero(m.PayloadHash) { // not required
- return nil
- }
-
- if err := m.PayloadHash.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("payloadHash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("payloadHash")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *DSSEV001Schema) contextValidateProposedContent(ctx context.Context, formats strfmt.Registry) error {
-
- if m.ProposedContent != nil {
-
- if swag.IsZero(m.ProposedContent) { // not required
- return nil
- }
-
- if err := m.ProposedContent.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("proposedContent")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("proposedContent")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *DSSEV001Schema) contextValidateSignatures(ctx context.Context, formats strfmt.Registry) error {
-
- if err := validate.ReadOnly(ctx, "signatures", "body", []*DSSEV001SchemaSignaturesItems0(m.Signatures)); err != nil {
- return err
- }
-
- for i := 0; i < len(m.Signatures); i++ {
-
- if m.Signatures[i] != nil {
-
- if swag.IsZero(m.Signatures[i]) { // not required
- return nil
- }
-
- if err := m.Signatures[i].ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("signatures" + "." + strconv.Itoa(i))
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("signatures" + "." + strconv.Itoa(i))
- }
- return err
- }
- }
-
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *DSSEV001Schema) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *DSSEV001Schema) UnmarshalBinary(b []byte) error {
- var res DSSEV001Schema
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// DSSEV001SchemaEnvelopeHash Specifies the hash algorithm and value encompassing the entire envelope sent to Rekor
-//
-// swagger:model DSSEV001SchemaEnvelopeHash
-type DSSEV001SchemaEnvelopeHash struct {
-
- // The hashing function used to compute the hash value
- // Required: true
- // Enum: ["sha256"]
- Algorithm *string `json:"algorithm"`
-
- // The value of the computed digest over the entire envelope
- // Required: true
- Value *string `json:"value"`
-}
-
-// Validate validates this DSSE v001 schema envelope hash
-func (m *DSSEV001SchemaEnvelopeHash) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateAlgorithm(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateValue(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-var dsseV001SchemaEnvelopeHashTypeAlgorithmPropEnum []interface{}
-
-func init() {
- var res []string
- if err := json.Unmarshal([]byte(`["sha256"]`), &res); err != nil {
- panic(err)
- }
- for _, v := range res {
- dsseV001SchemaEnvelopeHashTypeAlgorithmPropEnum = append(dsseV001SchemaEnvelopeHashTypeAlgorithmPropEnum, v)
- }
-}
-
-const (
-
- // DSSEV001SchemaEnvelopeHashAlgorithmSha256 captures enum value "sha256"
- DSSEV001SchemaEnvelopeHashAlgorithmSha256 string = "sha256"
-)
-
-// prop value enum
-func (m *DSSEV001SchemaEnvelopeHash) validateAlgorithmEnum(path, location string, value string) error {
- if err := validate.EnumCase(path, location, value, dsseV001SchemaEnvelopeHashTypeAlgorithmPropEnum, true); err != nil {
- return err
- }
- return nil
-}
-
-func (m *DSSEV001SchemaEnvelopeHash) validateAlgorithm(formats strfmt.Registry) error {
-
- if err := validate.Required("envelopeHash"+"."+"algorithm", "body", m.Algorithm); err != nil {
- return err
- }
-
- // value enum
- if err := m.validateAlgorithmEnum("envelopeHash"+"."+"algorithm", "body", *m.Algorithm); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *DSSEV001SchemaEnvelopeHash) validateValue(formats strfmt.Registry) error {
-
- if err := validate.Required("envelopeHash"+"."+"value", "body", m.Value); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validate this DSSE v001 schema envelope hash based on the context it is used
-func (m *DSSEV001SchemaEnvelopeHash) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *DSSEV001SchemaEnvelopeHash) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *DSSEV001SchemaEnvelopeHash) UnmarshalBinary(b []byte) error {
- var res DSSEV001SchemaEnvelopeHash
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// DSSEV001SchemaPayloadHash Specifies the hash algorithm and value covering the payload within the DSSE envelope
-//
-// swagger:model DSSEV001SchemaPayloadHash
-type DSSEV001SchemaPayloadHash struct {
-
- // The hashing function used to compute the hash value
- // Required: true
- // Enum: ["sha256"]
- Algorithm *string `json:"algorithm"`
-
- // The value of the computed digest over the payload within the envelope
- // Required: true
- Value *string `json:"value"`
-}
-
-// Validate validates this DSSE v001 schema payload hash
-func (m *DSSEV001SchemaPayloadHash) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateAlgorithm(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateValue(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-var dsseV001SchemaPayloadHashTypeAlgorithmPropEnum []interface{}
-
-func init() {
- var res []string
- if err := json.Unmarshal([]byte(`["sha256"]`), &res); err != nil {
- panic(err)
- }
- for _, v := range res {
- dsseV001SchemaPayloadHashTypeAlgorithmPropEnum = append(dsseV001SchemaPayloadHashTypeAlgorithmPropEnum, v)
- }
-}
-
-const (
-
- // DSSEV001SchemaPayloadHashAlgorithmSha256 captures enum value "sha256"
- DSSEV001SchemaPayloadHashAlgorithmSha256 string = "sha256"
-)
-
-// prop value enum
-func (m *DSSEV001SchemaPayloadHash) validateAlgorithmEnum(path, location string, value string) error {
- if err := validate.EnumCase(path, location, value, dsseV001SchemaPayloadHashTypeAlgorithmPropEnum, true); err != nil {
- return err
- }
- return nil
-}
-
-func (m *DSSEV001SchemaPayloadHash) validateAlgorithm(formats strfmt.Registry) error {
-
- if err := validate.Required("payloadHash"+"."+"algorithm", "body", m.Algorithm); err != nil {
- return err
- }
-
- // value enum
- if err := m.validateAlgorithmEnum("payloadHash"+"."+"algorithm", "body", *m.Algorithm); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *DSSEV001SchemaPayloadHash) validateValue(formats strfmt.Registry) error {
-
- if err := validate.Required("payloadHash"+"."+"value", "body", m.Value); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validate this DSSE v001 schema payload hash based on the context it is used
-func (m *DSSEV001SchemaPayloadHash) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *DSSEV001SchemaPayloadHash) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *DSSEV001SchemaPayloadHash) UnmarshalBinary(b []byte) error {
- var res DSSEV001SchemaPayloadHash
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// DSSEV001SchemaProposedContent DSSE v001 schema proposed content
-//
-// swagger:model DSSEV001SchemaProposedContent
-type DSSEV001SchemaProposedContent struct {
-
- // DSSE envelope specified as a stringified JSON object
- // Required: true
- Envelope *string `json:"envelope"`
-
- // collection of all verification material (e.g. public keys or certificates) used to verify signatures over envelope's payload, specified as base64-encoded strings
- // Required: true
- // Min Items: 1
- Verifiers []strfmt.Base64 `json:"verifiers"`
-}
-
-// Validate validates this DSSE v001 schema proposed content
-func (m *DSSEV001SchemaProposedContent) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateEnvelope(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateVerifiers(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *DSSEV001SchemaProposedContent) validateEnvelope(formats strfmt.Registry) error {
-
- if err := validate.Required("proposedContent"+"."+"envelope", "body", m.Envelope); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *DSSEV001SchemaProposedContent) validateVerifiers(formats strfmt.Registry) error {
-
- if err := validate.Required("proposedContent"+"."+"verifiers", "body", m.Verifiers); err != nil {
- return err
- }
-
- iVerifiersSize := int64(len(m.Verifiers))
-
- if err := validate.MinItems("proposedContent"+"."+"verifiers", "body", iVerifiersSize, 1); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validates this DSSE v001 schema proposed content based on context it is used
-func (m *DSSEV001SchemaProposedContent) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *DSSEV001SchemaProposedContent) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *DSSEV001SchemaProposedContent) UnmarshalBinary(b []byte) error {
- var res DSSEV001SchemaProposedContent
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// DSSEV001SchemaSignaturesItems0 a signature of the envelope's payload along with the verification material for the signature
-//
-// swagger:model DSSEV001SchemaSignaturesItems0
-type DSSEV001SchemaSignaturesItems0 struct {
-
- // base64 encoded signature of the payload
- // Required: true
- // Pattern: ^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{4})$
- Signature *string `json:"signature"`
-
- // verification material that was used to verify the corresponding signature, specified as a base64 encoded string
- // Required: true
- // Format: byte
- Verifier *strfmt.Base64 `json:"verifier"`
-}
-
-// Validate validates this DSSE v001 schema signatures items0
-func (m *DSSEV001SchemaSignaturesItems0) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateSignature(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateVerifier(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *DSSEV001SchemaSignaturesItems0) validateSignature(formats strfmt.Registry) error {
-
- if err := validate.Required("signature", "body", m.Signature); err != nil {
- return err
- }
-
- if err := validate.Pattern("signature", "body", *m.Signature, `^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{4})$`); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *DSSEV001SchemaSignaturesItems0) validateVerifier(formats strfmt.Registry) error {
-
- if err := validate.Required("verifier", "body", m.Verifier); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validates this DSSE v001 schema signatures items0 based on context it is used
-func (m *DSSEV001SchemaSignaturesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *DSSEV001SchemaSignaturesItems0) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *DSSEV001SchemaSignaturesItems0) UnmarshalBinary(b []byte) error {
- var res DSSEV001SchemaSignaturesItems0
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/error.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/error.go
deleted file mode 100644
index ac14f2026..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/error.go
+++ /dev/null
@@ -1,69 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "context"
-
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
-)
-
-// Error error
-//
-// swagger:model Error
-type Error struct {
-
- // code
- Code int64 `json:"code,omitempty"`
-
- // message
- Message string `json:"message,omitempty"`
-}
-
-// Validate validates this error
-func (m *Error) Validate(formats strfmt.Registry) error {
- return nil
-}
-
-// ContextValidate validates this error based on context it is used
-func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *Error) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *Error) UnmarshalBinary(b []byte) error {
- var res Error
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/hashedrekord.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/hashedrekord.go
deleted file mode 100644
index b3e1f8a3b..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/hashedrekord.go
+++ /dev/null
@@ -1,210 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "bytes"
- "context"
- "encoding/json"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// Hashedrekord Hashed Rekord object
-//
-// swagger:model hashedrekord
-type Hashedrekord struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec HashedrekordSchema `json:"spec"`
-}
-
-// Kind gets the kind of this subtype
-func (m *Hashedrekord) Kind() string {
- return "hashedrekord"
-}
-
-// SetKind sets the kind of this subtype
-func (m *Hashedrekord) SetKind(val string) {
-}
-
-// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure
-func (m *Hashedrekord) UnmarshalJSON(raw []byte) error {
- var data struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec HashedrekordSchema `json:"spec"`
- }
- buf := bytes.NewBuffer(raw)
- dec := json.NewDecoder(buf)
- dec.UseNumber()
-
- if err := dec.Decode(&data); err != nil {
- return err
- }
-
- var base struct {
- /* Just the base type fields. Used for unmashalling polymorphic types.*/
-
- Kind string `json:"kind"`
- }
- buf = bytes.NewBuffer(raw)
- dec = json.NewDecoder(buf)
- dec.UseNumber()
-
- if err := dec.Decode(&base); err != nil {
- return err
- }
-
- var result Hashedrekord
-
- if base.Kind != result.Kind() {
- /* Not the type we're looking for. */
- return errors.New(422, "invalid kind value: %q", base.Kind)
- }
-
- result.APIVersion = data.APIVersion
- result.Spec = data.Spec
-
- *m = result
-
- return nil
-}
-
-// MarshalJSON marshals this object with a polymorphic type to a JSON structure
-func (m Hashedrekord) MarshalJSON() ([]byte, error) {
- var b1, b2, b3 []byte
- var err error
- b1, err = json.Marshal(struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec HashedrekordSchema `json:"spec"`
- }{
-
- APIVersion: m.APIVersion,
-
- Spec: m.Spec,
- })
- if err != nil {
- return nil, err
- }
- b2, err = json.Marshal(struct {
- Kind string `json:"kind"`
- }{
-
- Kind: m.Kind(),
- })
- if err != nil {
- return nil, err
- }
-
- return swag.ConcatJSON(b1, b2, b3), nil
-}
-
-// Validate validates this hashedrekord
-func (m *Hashedrekord) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateAPIVersion(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateSpec(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *Hashedrekord) validateAPIVersion(formats strfmt.Registry) error {
-
- if err := validate.Required("apiVersion", "body", m.APIVersion); err != nil {
- return err
- }
-
- if err := validate.Pattern("apiVersion", "body", *m.APIVersion, `^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *Hashedrekord) validateSpec(formats strfmt.Registry) error {
-
- if m.Spec == nil {
- return errors.Required("spec", "body", nil)
- }
-
- return nil
-}
-
-// ContextValidate validate this hashedrekord based on the context it is used
-func (m *Hashedrekord) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *Hashedrekord) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *Hashedrekord) UnmarshalBinary(b []byte) error {
- var res Hashedrekord
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/hashedrekord_schema.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/hashedrekord_schema.go
deleted file mode 100644
index 56034a579..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/hashedrekord_schema.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-// HashedrekordSchema Hashedrekord Schema
-//
-// # Schema for Hashedrekord objects
-//
-// swagger:model hashedrekordSchema
-type HashedrekordSchema interface{}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/hashedrekord_v001_schema.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/hashedrekord_v001_schema.go
deleted file mode 100644
index 586025c5b..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/hashedrekord_v001_schema.go
+++ /dev/null
@@ -1,519 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "context"
- "encoding/json"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// HashedrekordV001Schema Hashed Rekor v0.0.1 Schema
-//
-// # Schema for Hashed Rekord object
-//
-// swagger:model hashedrekordV001Schema
-type HashedrekordV001Schema struct {
-
- // data
- // Required: true
- Data *HashedrekordV001SchemaData `json:"data"`
-
- // signature
- // Required: true
- Signature *HashedrekordV001SchemaSignature `json:"signature"`
-}
-
-// Validate validates this hashedrekord v001 schema
-func (m *HashedrekordV001Schema) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateData(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateSignature(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *HashedrekordV001Schema) validateData(formats strfmt.Registry) error {
-
- if err := validate.Required("data", "body", m.Data); err != nil {
- return err
- }
-
- if m.Data != nil {
- if err := m.Data.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("data")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("data")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *HashedrekordV001Schema) validateSignature(formats strfmt.Registry) error {
-
- if err := validate.Required("signature", "body", m.Signature); err != nil {
- return err
- }
-
- if m.Signature != nil {
- if err := m.Signature.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("signature")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("signature")
- }
- return err
- }
- }
-
- return nil
-}
-
-// ContextValidate validate this hashedrekord v001 schema based on the context it is used
-func (m *HashedrekordV001Schema) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateData(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.contextValidateSignature(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *HashedrekordV001Schema) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Data != nil {
-
- if err := m.Data.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("data")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("data")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *HashedrekordV001Schema) contextValidateSignature(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Signature != nil {
-
- if err := m.Signature.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("signature")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("signature")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *HashedrekordV001Schema) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *HashedrekordV001Schema) UnmarshalBinary(b []byte) error {
- var res HashedrekordV001Schema
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// HashedrekordV001SchemaData Information about the content associated with the entry
-//
-// swagger:model HashedrekordV001SchemaData
-type HashedrekordV001SchemaData struct {
-
- // hash
- Hash *HashedrekordV001SchemaDataHash `json:"hash,omitempty"`
-}
-
-// Validate validates this hashedrekord v001 schema data
-func (m *HashedrekordV001SchemaData) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateHash(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *HashedrekordV001SchemaData) validateHash(formats strfmt.Registry) error {
- if swag.IsZero(m.Hash) { // not required
- return nil
- }
-
- if m.Hash != nil {
- if err := m.Hash.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("data" + "." + "hash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("data" + "." + "hash")
- }
- return err
- }
- }
-
- return nil
-}
-
-// ContextValidate validate this hashedrekord v001 schema data based on the context it is used
-func (m *HashedrekordV001SchemaData) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateHash(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *HashedrekordV001SchemaData) contextValidateHash(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Hash != nil {
-
- if swag.IsZero(m.Hash) { // not required
- return nil
- }
-
- if err := m.Hash.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("data" + "." + "hash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("data" + "." + "hash")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *HashedrekordV001SchemaData) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *HashedrekordV001SchemaData) UnmarshalBinary(b []byte) error {
- var res HashedrekordV001SchemaData
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// HashedrekordV001SchemaDataHash Specifies the hash algorithm and value for the content
-//
-// swagger:model HashedrekordV001SchemaDataHash
-type HashedrekordV001SchemaDataHash struct {
-
- // The hashing function used to compute the hash value
- // Required: true
- // Enum: ["sha256","sha384","sha512"]
- Algorithm *string `json:"algorithm"`
-
- // The hash value for the content, as represented by a lower case hexadecimal string
- // Required: true
- Value *string `json:"value"`
-}
-
-// Validate validates this hashedrekord v001 schema data hash
-func (m *HashedrekordV001SchemaDataHash) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateAlgorithm(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateValue(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-var hashedrekordV001SchemaDataHashTypeAlgorithmPropEnum []interface{}
-
-func init() {
- var res []string
- if err := json.Unmarshal([]byte(`["sha256","sha384","sha512"]`), &res); err != nil {
- panic(err)
- }
- for _, v := range res {
- hashedrekordV001SchemaDataHashTypeAlgorithmPropEnum = append(hashedrekordV001SchemaDataHashTypeAlgorithmPropEnum, v)
- }
-}
-
-const (
-
- // HashedrekordV001SchemaDataHashAlgorithmSha256 captures enum value "sha256"
- HashedrekordV001SchemaDataHashAlgorithmSha256 string = "sha256"
-
- // HashedrekordV001SchemaDataHashAlgorithmSha384 captures enum value "sha384"
- HashedrekordV001SchemaDataHashAlgorithmSha384 string = "sha384"
-
- // HashedrekordV001SchemaDataHashAlgorithmSha512 captures enum value "sha512"
- HashedrekordV001SchemaDataHashAlgorithmSha512 string = "sha512"
-)
-
-// prop value enum
-func (m *HashedrekordV001SchemaDataHash) validateAlgorithmEnum(path, location string, value string) error {
- if err := validate.EnumCase(path, location, value, hashedrekordV001SchemaDataHashTypeAlgorithmPropEnum, true); err != nil {
- return err
- }
- return nil
-}
-
-func (m *HashedrekordV001SchemaDataHash) validateAlgorithm(formats strfmt.Registry) error {
-
- if err := validate.Required("data"+"."+"hash"+"."+"algorithm", "body", m.Algorithm); err != nil {
- return err
- }
-
- // value enum
- if err := m.validateAlgorithmEnum("data"+"."+"hash"+"."+"algorithm", "body", *m.Algorithm); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *HashedrekordV001SchemaDataHash) validateValue(formats strfmt.Registry) error {
-
- if err := validate.Required("data"+"."+"hash"+"."+"value", "body", m.Value); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validates this hashedrekord v001 schema data hash based on context it is used
-func (m *HashedrekordV001SchemaDataHash) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *HashedrekordV001SchemaDataHash) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *HashedrekordV001SchemaDataHash) UnmarshalBinary(b []byte) error {
- var res HashedrekordV001SchemaDataHash
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// HashedrekordV001SchemaSignature Information about the detached signature associated with the entry
-//
-// swagger:model HashedrekordV001SchemaSignature
-type HashedrekordV001SchemaSignature struct {
-
- // Specifies the content of the signature inline within the document
- // Format: byte
- Content strfmt.Base64 `json:"content,omitempty"`
-
- // public key
- PublicKey *HashedrekordV001SchemaSignaturePublicKey `json:"publicKey,omitempty"`
-}
-
-// Validate validates this hashedrekord v001 schema signature
-func (m *HashedrekordV001SchemaSignature) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validatePublicKey(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *HashedrekordV001SchemaSignature) validatePublicKey(formats strfmt.Registry) error {
- if swag.IsZero(m.PublicKey) { // not required
- return nil
- }
-
- if m.PublicKey != nil {
- if err := m.PublicKey.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("signature" + "." + "publicKey")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("signature" + "." + "publicKey")
- }
- return err
- }
- }
-
- return nil
-}
-
-// ContextValidate validate this hashedrekord v001 schema signature based on the context it is used
-func (m *HashedrekordV001SchemaSignature) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidatePublicKey(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *HashedrekordV001SchemaSignature) contextValidatePublicKey(ctx context.Context, formats strfmt.Registry) error {
-
- if m.PublicKey != nil {
-
- if swag.IsZero(m.PublicKey) { // not required
- return nil
- }
-
- if err := m.PublicKey.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("signature" + "." + "publicKey")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("signature" + "." + "publicKey")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *HashedrekordV001SchemaSignature) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *HashedrekordV001SchemaSignature) UnmarshalBinary(b []byte) error {
- var res HashedrekordV001SchemaSignature
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// HashedrekordV001SchemaSignaturePublicKey The public key that can verify the signature; this can also be an X509 code signing certificate that contains the raw public key information
-//
-// swagger:model HashedrekordV001SchemaSignaturePublicKey
-type HashedrekordV001SchemaSignaturePublicKey struct {
-
- // Specifies the content of the public key or code signing certificate inline within the document
- // Format: byte
- Content strfmt.Base64 `json:"content,omitempty"`
-}
-
-// Validate validates this hashedrekord v001 schema signature public key
-func (m *HashedrekordV001SchemaSignaturePublicKey) Validate(formats strfmt.Registry) error {
- return nil
-}
-
-// ContextValidate validates this hashedrekord v001 schema signature public key based on context it is used
-func (m *HashedrekordV001SchemaSignaturePublicKey) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *HashedrekordV001SchemaSignaturePublicKey) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *HashedrekordV001SchemaSignaturePublicKey) UnmarshalBinary(b []byte) error {
- var res HashedrekordV001SchemaSignaturePublicKey
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/helm.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/helm.go
deleted file mode 100644
index d19b8bc8c..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/helm.go
+++ /dev/null
@@ -1,210 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "bytes"
- "context"
- "encoding/json"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// Helm Helm chart
-//
-// swagger:model helm
-type Helm struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec HelmSchema `json:"spec"`
-}
-
-// Kind gets the kind of this subtype
-func (m *Helm) Kind() string {
- return "helm"
-}
-
-// SetKind sets the kind of this subtype
-func (m *Helm) SetKind(val string) {
-}
-
-// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure
-func (m *Helm) UnmarshalJSON(raw []byte) error {
- var data struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec HelmSchema `json:"spec"`
- }
- buf := bytes.NewBuffer(raw)
- dec := json.NewDecoder(buf)
- dec.UseNumber()
-
- if err := dec.Decode(&data); err != nil {
- return err
- }
-
- var base struct {
- /* Just the base type fields. Used for unmashalling polymorphic types.*/
-
- Kind string `json:"kind"`
- }
- buf = bytes.NewBuffer(raw)
- dec = json.NewDecoder(buf)
- dec.UseNumber()
-
- if err := dec.Decode(&base); err != nil {
- return err
- }
-
- var result Helm
-
- if base.Kind != result.Kind() {
- /* Not the type we're looking for. */
- return errors.New(422, "invalid kind value: %q", base.Kind)
- }
-
- result.APIVersion = data.APIVersion
- result.Spec = data.Spec
-
- *m = result
-
- return nil
-}
-
-// MarshalJSON marshals this object with a polymorphic type to a JSON structure
-func (m Helm) MarshalJSON() ([]byte, error) {
- var b1, b2, b3 []byte
- var err error
- b1, err = json.Marshal(struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec HelmSchema `json:"spec"`
- }{
-
- APIVersion: m.APIVersion,
-
- Spec: m.Spec,
- })
- if err != nil {
- return nil, err
- }
- b2, err = json.Marshal(struct {
- Kind string `json:"kind"`
- }{
-
- Kind: m.Kind(),
- })
- if err != nil {
- return nil, err
- }
-
- return swag.ConcatJSON(b1, b2, b3), nil
-}
-
-// Validate validates this helm
-func (m *Helm) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateAPIVersion(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateSpec(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *Helm) validateAPIVersion(formats strfmt.Registry) error {
-
- if err := validate.Required("apiVersion", "body", m.APIVersion); err != nil {
- return err
- }
-
- if err := validate.Pattern("apiVersion", "body", *m.APIVersion, `^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *Helm) validateSpec(formats strfmt.Registry) error {
-
- if m.Spec == nil {
- return errors.Required("spec", "body", nil)
- }
-
- return nil
-}
-
-// ContextValidate validate this helm based on the context it is used
-func (m *Helm) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *Helm) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *Helm) UnmarshalBinary(b []byte) error {
- var res Helm
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/helm_schema.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/helm_schema.go
deleted file mode 100644
index 0ab87df9c..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/helm_schema.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-// HelmSchema Helm Schema
-//
-// # Schema for Helm objects
-//
-// swagger:model helmSchema
-type HelmSchema interface{}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/helm_v001_schema.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/helm_v001_schema.go
deleted file mode 100644
index 13c00597c..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/helm_v001_schema.go
+++ /dev/null
@@ -1,662 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "context"
- "encoding/json"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// HelmV001Schema Helm v0.0.1 Schema
-//
-// # Schema for Helm object
-//
-// swagger:model helmV001Schema
-type HelmV001Schema struct {
-
- // chart
- // Required: true
- Chart *HelmV001SchemaChart `json:"chart"`
-
- // public key
- // Required: true
- PublicKey *HelmV001SchemaPublicKey `json:"publicKey"`
-}
-
-// Validate validates this helm v001 schema
-func (m *HelmV001Schema) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateChart(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validatePublicKey(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *HelmV001Schema) validateChart(formats strfmt.Registry) error {
-
- if err := validate.Required("chart", "body", m.Chart); err != nil {
- return err
- }
-
- if m.Chart != nil {
- if err := m.Chart.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("chart")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("chart")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *HelmV001Schema) validatePublicKey(formats strfmt.Registry) error {
-
- if err := validate.Required("publicKey", "body", m.PublicKey); err != nil {
- return err
- }
-
- if m.PublicKey != nil {
- if err := m.PublicKey.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("publicKey")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("publicKey")
- }
- return err
- }
- }
-
- return nil
-}
-
-// ContextValidate validate this helm v001 schema based on the context it is used
-func (m *HelmV001Schema) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateChart(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.contextValidatePublicKey(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *HelmV001Schema) contextValidateChart(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Chart != nil {
-
- if err := m.Chart.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("chart")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("chart")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *HelmV001Schema) contextValidatePublicKey(ctx context.Context, formats strfmt.Registry) error {
-
- if m.PublicKey != nil {
-
- if err := m.PublicKey.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("publicKey")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("publicKey")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *HelmV001Schema) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *HelmV001Schema) UnmarshalBinary(b []byte) error {
- var res HelmV001Schema
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// HelmV001SchemaChart Information about the Helm chart associated with the entry
-//
-// swagger:model HelmV001SchemaChart
-type HelmV001SchemaChart struct {
-
- // hash
- Hash *HelmV001SchemaChartHash `json:"hash,omitempty"`
-
- // provenance
- // Required: true
- Provenance *HelmV001SchemaChartProvenance `json:"provenance"`
-}
-
-// Validate validates this helm v001 schema chart
-func (m *HelmV001SchemaChart) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateHash(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateProvenance(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *HelmV001SchemaChart) validateHash(formats strfmt.Registry) error {
- if swag.IsZero(m.Hash) { // not required
- return nil
- }
-
- if m.Hash != nil {
- if err := m.Hash.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("chart" + "." + "hash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("chart" + "." + "hash")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *HelmV001SchemaChart) validateProvenance(formats strfmt.Registry) error {
-
- if err := validate.Required("chart"+"."+"provenance", "body", m.Provenance); err != nil {
- return err
- }
-
- if m.Provenance != nil {
- if err := m.Provenance.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("chart" + "." + "provenance")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("chart" + "." + "provenance")
- }
- return err
- }
- }
-
- return nil
-}
-
-// ContextValidate validate this helm v001 schema chart based on the context it is used
-func (m *HelmV001SchemaChart) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateHash(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.contextValidateProvenance(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *HelmV001SchemaChart) contextValidateHash(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Hash != nil {
-
- if swag.IsZero(m.Hash) { // not required
- return nil
- }
-
- if err := m.Hash.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("chart" + "." + "hash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("chart" + "." + "hash")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *HelmV001SchemaChart) contextValidateProvenance(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Provenance != nil {
-
- if err := m.Provenance.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("chart" + "." + "provenance")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("chart" + "." + "provenance")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *HelmV001SchemaChart) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *HelmV001SchemaChart) UnmarshalBinary(b []byte) error {
- var res HelmV001SchemaChart
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// HelmV001SchemaChartHash Specifies the hash algorithm and value for the chart
-//
-// swagger:model HelmV001SchemaChartHash
-type HelmV001SchemaChartHash struct {
-
- // The hashing function used to compute the hash value
- // Required: true
- // Enum: ["sha256"]
- Algorithm *string `json:"algorithm"`
-
- // The hash value for the chart
- // Required: true
- Value *string `json:"value"`
-}
-
-// Validate validates this helm v001 schema chart hash
-func (m *HelmV001SchemaChartHash) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateAlgorithm(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateValue(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-var helmV001SchemaChartHashTypeAlgorithmPropEnum []interface{}
-
-func init() {
- var res []string
- if err := json.Unmarshal([]byte(`["sha256"]`), &res); err != nil {
- panic(err)
- }
- for _, v := range res {
- helmV001SchemaChartHashTypeAlgorithmPropEnum = append(helmV001SchemaChartHashTypeAlgorithmPropEnum, v)
- }
-}
-
-const (
-
- // HelmV001SchemaChartHashAlgorithmSha256 captures enum value "sha256"
- HelmV001SchemaChartHashAlgorithmSha256 string = "sha256"
-)
-
-// prop value enum
-func (m *HelmV001SchemaChartHash) validateAlgorithmEnum(path, location string, value string) error {
- if err := validate.EnumCase(path, location, value, helmV001SchemaChartHashTypeAlgorithmPropEnum, true); err != nil {
- return err
- }
- return nil
-}
-
-func (m *HelmV001SchemaChartHash) validateAlgorithm(formats strfmt.Registry) error {
-
- if err := validate.Required("chart"+"."+"hash"+"."+"algorithm", "body", m.Algorithm); err != nil {
- return err
- }
-
- // value enum
- if err := m.validateAlgorithmEnum("chart"+"."+"hash"+"."+"algorithm", "body", *m.Algorithm); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *HelmV001SchemaChartHash) validateValue(formats strfmt.Registry) error {
-
- if err := validate.Required("chart"+"."+"hash"+"."+"value", "body", m.Value); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validate this helm v001 schema chart hash based on the context it is used
-func (m *HelmV001SchemaChartHash) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *HelmV001SchemaChartHash) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *HelmV001SchemaChartHash) UnmarshalBinary(b []byte) error {
- var res HelmV001SchemaChartHash
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// HelmV001SchemaChartProvenance The provenance entry associated with the signed Helm Chart
-//
-// swagger:model HelmV001SchemaChartProvenance
-type HelmV001SchemaChartProvenance struct {
-
- // Specifies the content of the provenance file inline within the document
- // Format: byte
- Content strfmt.Base64 `json:"content,omitempty"`
-
- // signature
- Signature *HelmV001SchemaChartProvenanceSignature `json:"signature,omitempty"`
-}
-
-// Validate validates this helm v001 schema chart provenance
-func (m *HelmV001SchemaChartProvenance) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateSignature(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *HelmV001SchemaChartProvenance) validateSignature(formats strfmt.Registry) error {
- if swag.IsZero(m.Signature) { // not required
- return nil
- }
-
- if m.Signature != nil {
- if err := m.Signature.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("chart" + "." + "provenance" + "." + "signature")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("chart" + "." + "provenance" + "." + "signature")
- }
- return err
- }
- }
-
- return nil
-}
-
-// ContextValidate validate this helm v001 schema chart provenance based on the context it is used
-func (m *HelmV001SchemaChartProvenance) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateSignature(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *HelmV001SchemaChartProvenance) contextValidateSignature(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Signature != nil {
-
- if swag.IsZero(m.Signature) { // not required
- return nil
- }
-
- if err := m.Signature.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("chart" + "." + "provenance" + "." + "signature")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("chart" + "." + "provenance" + "." + "signature")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *HelmV001SchemaChartProvenance) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *HelmV001SchemaChartProvenance) UnmarshalBinary(b []byte) error {
- var res HelmV001SchemaChartProvenance
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// HelmV001SchemaChartProvenanceSignature Information about the included signature in the provenance file
-//
-// swagger:model HelmV001SchemaChartProvenanceSignature
-type HelmV001SchemaChartProvenanceSignature struct {
-
- // Specifies the signature embedded within the provenance file
- // Required: true
- // Read Only: true
- // Format: byte
- Content strfmt.Base64 `json:"content"`
-}
-
-// Validate validates this helm v001 schema chart provenance signature
-func (m *HelmV001SchemaChartProvenanceSignature) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateContent(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *HelmV001SchemaChartProvenanceSignature) validateContent(formats strfmt.Registry) error {
-
- if err := validate.Required("chart"+"."+"provenance"+"."+"signature"+"."+"content", "body", strfmt.Base64(m.Content)); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validate this helm v001 schema chart provenance signature based on the context it is used
-func (m *HelmV001SchemaChartProvenanceSignature) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateContent(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *HelmV001SchemaChartProvenanceSignature) contextValidateContent(ctx context.Context, formats strfmt.Registry) error {
-
- if err := validate.ReadOnly(ctx, "chart"+"."+"provenance"+"."+"signature"+"."+"content", "body", strfmt.Base64(m.Content)); err != nil {
- return err
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *HelmV001SchemaChartProvenanceSignature) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *HelmV001SchemaChartProvenanceSignature) UnmarshalBinary(b []byte) error {
- var res HelmV001SchemaChartProvenanceSignature
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// HelmV001SchemaPublicKey The public key that can verify the package signature
-//
-// swagger:model HelmV001SchemaPublicKey
-type HelmV001SchemaPublicKey struct {
-
- // Specifies the content of the public key inline within the document
- // Required: true
- // Format: byte
- Content *strfmt.Base64 `json:"content"`
-}
-
-// Validate validates this helm v001 schema public key
-func (m *HelmV001SchemaPublicKey) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateContent(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *HelmV001SchemaPublicKey) validateContent(formats strfmt.Registry) error {
-
- if err := validate.Required("publicKey"+"."+"content", "body", m.Content); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validates this helm v001 schema public key based on context it is used
-func (m *HelmV001SchemaPublicKey) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *HelmV001SchemaPublicKey) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *HelmV001SchemaPublicKey) UnmarshalBinary(b []byte) error {
- var res HelmV001SchemaPublicKey
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/inactive_shard_log_info.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/inactive_shard_log_info.go
deleted file mode 100644
index c555eb2da..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/inactive_shard_log_info.go
+++ /dev/null
@@ -1,153 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "context"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// InactiveShardLogInfo inactive shard log info
-//
-// swagger:model InactiveShardLogInfo
-type InactiveShardLogInfo struct {
-
- // The current hash value stored at the root of the merkle tree
- // Required: true
- // Pattern: ^[0-9a-fA-F]{64}$
- RootHash *string `json:"rootHash"`
-
- // The current signed tree head
- // Required: true
- SignedTreeHead *string `json:"signedTreeHead"`
-
- // The current treeID
- // Required: true
- // Pattern: ^[0-9]+$
- TreeID *string `json:"treeID"`
-
- // The current number of nodes in the merkle tree
- // Required: true
- // Minimum: 1
- TreeSize *int64 `json:"treeSize"`
-}
-
-// Validate validates this inactive shard log info
-func (m *InactiveShardLogInfo) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateRootHash(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateSignedTreeHead(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateTreeID(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateTreeSize(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *InactiveShardLogInfo) validateRootHash(formats strfmt.Registry) error {
-
- if err := validate.Required("rootHash", "body", m.RootHash); err != nil {
- return err
- }
-
- if err := validate.Pattern("rootHash", "body", *m.RootHash, `^[0-9a-fA-F]{64}$`); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *InactiveShardLogInfo) validateSignedTreeHead(formats strfmt.Registry) error {
-
- if err := validate.Required("signedTreeHead", "body", m.SignedTreeHead); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *InactiveShardLogInfo) validateTreeID(formats strfmt.Registry) error {
-
- if err := validate.Required("treeID", "body", m.TreeID); err != nil {
- return err
- }
-
- if err := validate.Pattern("treeID", "body", *m.TreeID, `^[0-9]+$`); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *InactiveShardLogInfo) validateTreeSize(formats strfmt.Registry) error {
-
- if err := validate.Required("treeSize", "body", m.TreeSize); err != nil {
- return err
- }
-
- if err := validate.MinimumInt("treeSize", "body", *m.TreeSize, 1, false); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validates this inactive shard log info based on context it is used
-func (m *InactiveShardLogInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *InactiveShardLogInfo) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *InactiveShardLogInfo) UnmarshalBinary(b []byte) error {
- var res InactiveShardLogInfo
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/inclusion_proof.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/inclusion_proof.go
deleted file mode 100644
index 86f0d7b94..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/inclusion_proof.go
+++ /dev/null
@@ -1,179 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "context"
- "strconv"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// InclusionProof inclusion proof
-//
-// swagger:model InclusionProof
-type InclusionProof struct {
-
- // The checkpoint (signed tree head) that the inclusion proof is based on
- // Required: true
- Checkpoint *string `json:"checkpoint"`
-
- // A list of hashes required to compute the inclusion proof, sorted in order from leaf to root
- // Required: true
- Hashes []string `json:"hashes"`
-
- // The index of the entry in the transparency log
- // Required: true
- // Minimum: 0
- LogIndex *int64 `json:"logIndex"`
-
- // The hash value stored at the root of the merkle tree at the time the proof was generated
- // Required: true
- // Pattern: ^[0-9a-fA-F]{64}$
- RootHash *string `json:"rootHash"`
-
- // The size of the merkle tree at the time the inclusion proof was generated
- // Required: true
- // Minimum: 1
- TreeSize *int64 `json:"treeSize"`
-}
-
-// Validate validates this inclusion proof
-func (m *InclusionProof) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateCheckpoint(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateHashes(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateLogIndex(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateRootHash(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateTreeSize(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *InclusionProof) validateCheckpoint(formats strfmt.Registry) error {
-
- if err := validate.Required("checkpoint", "body", m.Checkpoint); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *InclusionProof) validateHashes(formats strfmt.Registry) error {
-
- if err := validate.Required("hashes", "body", m.Hashes); err != nil {
- return err
- }
-
- for i := 0; i < len(m.Hashes); i++ {
-
- if err := validate.Pattern("hashes"+"."+strconv.Itoa(i), "body", m.Hashes[i], `^[0-9a-fA-F]{64}$`); err != nil {
- return err
- }
-
- }
-
- return nil
-}
-
-func (m *InclusionProof) validateLogIndex(formats strfmt.Registry) error {
-
- if err := validate.Required("logIndex", "body", m.LogIndex); err != nil {
- return err
- }
-
- if err := validate.MinimumInt("logIndex", "body", *m.LogIndex, 0, false); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *InclusionProof) validateRootHash(formats strfmt.Registry) error {
-
- if err := validate.Required("rootHash", "body", m.RootHash); err != nil {
- return err
- }
-
- if err := validate.Pattern("rootHash", "body", *m.RootHash, `^[0-9a-fA-F]{64}$`); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *InclusionProof) validateTreeSize(formats strfmt.Registry) error {
-
- if err := validate.Required("treeSize", "body", m.TreeSize); err != nil {
- return err
- }
-
- if err := validate.MinimumInt("treeSize", "body", *m.TreeSize, 1, false); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validates this inclusion proof based on context it is used
-func (m *InclusionProof) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *InclusionProof) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *InclusionProof) UnmarshalBinary(b []byte) error {
- var res InclusionProof
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/intoto.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/intoto.go
deleted file mode 100644
index 4f208de1d..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/intoto.go
+++ /dev/null
@@ -1,210 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "bytes"
- "context"
- "encoding/json"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// Intoto Intoto object
-//
-// swagger:model intoto
-type Intoto struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec IntotoSchema `json:"spec"`
-}
-
-// Kind gets the kind of this subtype
-func (m *Intoto) Kind() string {
- return "intoto"
-}
-
-// SetKind sets the kind of this subtype
-func (m *Intoto) SetKind(val string) {
-}
-
-// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure
-func (m *Intoto) UnmarshalJSON(raw []byte) error {
- var data struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec IntotoSchema `json:"spec"`
- }
- buf := bytes.NewBuffer(raw)
- dec := json.NewDecoder(buf)
- dec.UseNumber()
-
- if err := dec.Decode(&data); err != nil {
- return err
- }
-
- var base struct {
- /* Just the base type fields. Used for unmashalling polymorphic types.*/
-
- Kind string `json:"kind"`
- }
- buf = bytes.NewBuffer(raw)
- dec = json.NewDecoder(buf)
- dec.UseNumber()
-
- if err := dec.Decode(&base); err != nil {
- return err
- }
-
- var result Intoto
-
- if base.Kind != result.Kind() {
- /* Not the type we're looking for. */
- return errors.New(422, "invalid kind value: %q", base.Kind)
- }
-
- result.APIVersion = data.APIVersion
- result.Spec = data.Spec
-
- *m = result
-
- return nil
-}
-
-// MarshalJSON marshals this object with a polymorphic type to a JSON structure
-func (m Intoto) MarshalJSON() ([]byte, error) {
- var b1, b2, b3 []byte
- var err error
- b1, err = json.Marshal(struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec IntotoSchema `json:"spec"`
- }{
-
- APIVersion: m.APIVersion,
-
- Spec: m.Spec,
- })
- if err != nil {
- return nil, err
- }
- b2, err = json.Marshal(struct {
- Kind string `json:"kind"`
- }{
-
- Kind: m.Kind(),
- })
- if err != nil {
- return nil, err
- }
-
- return swag.ConcatJSON(b1, b2, b3), nil
-}
-
-// Validate validates this intoto
-func (m *Intoto) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateAPIVersion(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateSpec(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *Intoto) validateAPIVersion(formats strfmt.Registry) error {
-
- if err := validate.Required("apiVersion", "body", m.APIVersion); err != nil {
- return err
- }
-
- if err := validate.Pattern("apiVersion", "body", *m.APIVersion, `^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *Intoto) validateSpec(formats strfmt.Registry) error {
-
- if m.Spec == nil {
- return errors.Required("spec", "body", nil)
- }
-
- return nil
-}
-
-// ContextValidate validate this intoto based on the context it is used
-func (m *Intoto) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *Intoto) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *Intoto) UnmarshalBinary(b []byte) error {
- var res Intoto
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/intoto_schema.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/intoto_schema.go
deleted file mode 100644
index a7fdaa6a6..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/intoto_schema.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-// IntotoSchema Intoto Schema
-//
-// # Intoto for Rekord objects
-//
-// swagger:model intotoSchema
-type IntotoSchema interface{}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/intoto_v001_schema.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/intoto_v001_schema.go
deleted file mode 100644
index 6973c7299..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/intoto_v001_schema.go
+++ /dev/null
@@ -1,514 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "context"
- "encoding/json"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// IntotoV001Schema intoto v0.0.1 Schema
-//
-// # Schema for intoto object
-//
-// swagger:model intotoV001Schema
-type IntotoV001Schema struct {
-
- // content
- // Required: true
- Content *IntotoV001SchemaContent `json:"content"`
-
- // The public key that can verify the signature
- // Required: true
- // Format: byte
- PublicKey *strfmt.Base64 `json:"publicKey"`
-}
-
-// Validate validates this intoto v001 schema
-func (m *IntotoV001Schema) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateContent(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validatePublicKey(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *IntotoV001Schema) validateContent(formats strfmt.Registry) error {
-
- if err := validate.Required("content", "body", m.Content); err != nil {
- return err
- }
-
- if m.Content != nil {
- if err := m.Content.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("content")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("content")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *IntotoV001Schema) validatePublicKey(formats strfmt.Registry) error {
-
- if err := validate.Required("publicKey", "body", m.PublicKey); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validate this intoto v001 schema based on the context it is used
-func (m *IntotoV001Schema) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateContent(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *IntotoV001Schema) contextValidateContent(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Content != nil {
-
- if err := m.Content.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("content")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("content")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *IntotoV001Schema) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *IntotoV001Schema) UnmarshalBinary(b []byte) error {
- var res IntotoV001Schema
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// IntotoV001SchemaContent intoto v001 schema content
-//
-// swagger:model IntotoV001SchemaContent
-type IntotoV001SchemaContent struct {
-
- // envelope
- Envelope string `json:"envelope,omitempty"`
-
- // hash
- Hash *IntotoV001SchemaContentHash `json:"hash,omitempty"`
-
- // payload hash
- PayloadHash *IntotoV001SchemaContentPayloadHash `json:"payloadHash,omitempty"`
-}
-
-// Validate validates this intoto v001 schema content
-func (m *IntotoV001SchemaContent) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateHash(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validatePayloadHash(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *IntotoV001SchemaContent) validateHash(formats strfmt.Registry) error {
- if swag.IsZero(m.Hash) { // not required
- return nil
- }
-
- if m.Hash != nil {
- if err := m.Hash.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("content" + "." + "hash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("content" + "." + "hash")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *IntotoV001SchemaContent) validatePayloadHash(formats strfmt.Registry) error {
- if swag.IsZero(m.PayloadHash) { // not required
- return nil
- }
-
- if m.PayloadHash != nil {
- if err := m.PayloadHash.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("content" + "." + "payloadHash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("content" + "." + "payloadHash")
- }
- return err
- }
- }
-
- return nil
-}
-
-// ContextValidate validate this intoto v001 schema content based on the context it is used
-func (m *IntotoV001SchemaContent) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateHash(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.contextValidatePayloadHash(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *IntotoV001SchemaContent) contextValidateHash(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Hash != nil {
-
- if swag.IsZero(m.Hash) { // not required
- return nil
- }
-
- if err := m.Hash.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("content" + "." + "hash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("content" + "." + "hash")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *IntotoV001SchemaContent) contextValidatePayloadHash(ctx context.Context, formats strfmt.Registry) error {
-
- if m.PayloadHash != nil {
-
- if swag.IsZero(m.PayloadHash) { // not required
- return nil
- }
-
- if err := m.PayloadHash.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("content" + "." + "payloadHash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("content" + "." + "payloadHash")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *IntotoV001SchemaContent) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *IntotoV001SchemaContent) UnmarshalBinary(b []byte) error {
- var res IntotoV001SchemaContent
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// IntotoV001SchemaContentHash Specifies the hash algorithm and value encompassing the entire signed envelope; this is computed by the rekor server, client-provided values are ignored
-//
-// swagger:model IntotoV001SchemaContentHash
-type IntotoV001SchemaContentHash struct {
-
- // The hashing function used to compute the hash value
- // Required: true
- // Enum: ["sha256"]
- Algorithm *string `json:"algorithm"`
-
- // The hash value for the archive
- // Required: true
- Value *string `json:"value"`
-}
-
-// Validate validates this intoto v001 schema content hash
-func (m *IntotoV001SchemaContentHash) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateAlgorithm(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateValue(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-var intotoV001SchemaContentHashTypeAlgorithmPropEnum []interface{}
-
-func init() {
- var res []string
- if err := json.Unmarshal([]byte(`["sha256"]`), &res); err != nil {
- panic(err)
- }
- for _, v := range res {
- intotoV001SchemaContentHashTypeAlgorithmPropEnum = append(intotoV001SchemaContentHashTypeAlgorithmPropEnum, v)
- }
-}
-
-const (
-
- // IntotoV001SchemaContentHashAlgorithmSha256 captures enum value "sha256"
- IntotoV001SchemaContentHashAlgorithmSha256 string = "sha256"
-)
-
-// prop value enum
-func (m *IntotoV001SchemaContentHash) validateAlgorithmEnum(path, location string, value string) error {
- if err := validate.EnumCase(path, location, value, intotoV001SchemaContentHashTypeAlgorithmPropEnum, true); err != nil {
- return err
- }
- return nil
-}
-
-func (m *IntotoV001SchemaContentHash) validateAlgorithm(formats strfmt.Registry) error {
-
- if err := validate.Required("content"+"."+"hash"+"."+"algorithm", "body", m.Algorithm); err != nil {
- return err
- }
-
- // value enum
- if err := m.validateAlgorithmEnum("content"+"."+"hash"+"."+"algorithm", "body", *m.Algorithm); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *IntotoV001SchemaContentHash) validateValue(formats strfmt.Registry) error {
-
- if err := validate.Required("content"+"."+"hash"+"."+"value", "body", m.Value); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validate this intoto v001 schema content hash based on the context it is used
-func (m *IntotoV001SchemaContentHash) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *IntotoV001SchemaContentHash) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *IntotoV001SchemaContentHash) UnmarshalBinary(b []byte) error {
- var res IntotoV001SchemaContentHash
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// IntotoV001SchemaContentPayloadHash Specifies the hash algorithm and value covering the payload within the DSSE envelope; this is computed by the rekor server, client-provided values are ignored
-//
-// swagger:model IntotoV001SchemaContentPayloadHash
-type IntotoV001SchemaContentPayloadHash struct {
-
- // The hashing function used to compute the hash value
- // Required: true
- // Enum: ["sha256"]
- Algorithm *string `json:"algorithm"`
-
- // The hash value for the envelope's payload
- // Required: true
- Value *string `json:"value"`
-}
-
-// Validate validates this intoto v001 schema content payload hash
-func (m *IntotoV001SchemaContentPayloadHash) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateAlgorithm(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateValue(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-var intotoV001SchemaContentPayloadHashTypeAlgorithmPropEnum []interface{}
-
-func init() {
- var res []string
- if err := json.Unmarshal([]byte(`["sha256"]`), &res); err != nil {
- panic(err)
- }
- for _, v := range res {
- intotoV001SchemaContentPayloadHashTypeAlgorithmPropEnum = append(intotoV001SchemaContentPayloadHashTypeAlgorithmPropEnum, v)
- }
-}
-
-const (
-
- // IntotoV001SchemaContentPayloadHashAlgorithmSha256 captures enum value "sha256"
- IntotoV001SchemaContentPayloadHashAlgorithmSha256 string = "sha256"
-)
-
-// prop value enum
-func (m *IntotoV001SchemaContentPayloadHash) validateAlgorithmEnum(path, location string, value string) error {
- if err := validate.EnumCase(path, location, value, intotoV001SchemaContentPayloadHashTypeAlgorithmPropEnum, true); err != nil {
- return err
- }
- return nil
-}
-
-func (m *IntotoV001SchemaContentPayloadHash) validateAlgorithm(formats strfmt.Registry) error {
-
- if err := validate.Required("content"+"."+"payloadHash"+"."+"algorithm", "body", m.Algorithm); err != nil {
- return err
- }
-
- // value enum
- if err := m.validateAlgorithmEnum("content"+"."+"payloadHash"+"."+"algorithm", "body", *m.Algorithm); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *IntotoV001SchemaContentPayloadHash) validateValue(formats strfmt.Registry) error {
-
- if err := validate.Required("content"+"."+"payloadHash"+"."+"value", "body", m.Value); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validate this intoto v001 schema content payload hash based on the context it is used
-func (m *IntotoV001SchemaContentPayloadHash) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *IntotoV001SchemaContentPayloadHash) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *IntotoV001SchemaContentPayloadHash) UnmarshalBinary(b []byte) error {
- var res IntotoV001SchemaContentPayloadHash
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/intoto_v002_schema.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/intoto_v002_schema.go
deleted file mode 100644
index 309073a1c..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/intoto_v002_schema.go
+++ /dev/null
@@ -1,757 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "context"
- "encoding/json"
- "strconv"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// IntotoV002Schema intoto v0.0.2 Schema
-//
-// # Schema for intoto object
-//
-// swagger:model intotoV002Schema
-type IntotoV002Schema struct {
-
- // content
- // Required: true
- Content *IntotoV002SchemaContent `json:"content"`
-}
-
-// Validate validates this intoto v002 schema
-func (m *IntotoV002Schema) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateContent(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *IntotoV002Schema) validateContent(formats strfmt.Registry) error {
-
- if err := validate.Required("content", "body", m.Content); err != nil {
- return err
- }
-
- if m.Content != nil {
- if err := m.Content.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("content")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("content")
- }
- return err
- }
- }
-
- return nil
-}
-
-// ContextValidate validate this intoto v002 schema based on the context it is used
-func (m *IntotoV002Schema) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateContent(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *IntotoV002Schema) contextValidateContent(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Content != nil {
-
- if err := m.Content.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("content")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("content")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *IntotoV002Schema) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *IntotoV002Schema) UnmarshalBinary(b []byte) error {
- var res IntotoV002Schema
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// IntotoV002SchemaContent intoto v002 schema content
-//
-// swagger:model IntotoV002SchemaContent
-type IntotoV002SchemaContent struct {
-
- // envelope
- // Required: true
- Envelope *IntotoV002SchemaContentEnvelope `json:"envelope"`
-
- // hash
- Hash *IntotoV002SchemaContentHash `json:"hash,omitempty"`
-
- // payload hash
- PayloadHash *IntotoV002SchemaContentPayloadHash `json:"payloadHash,omitempty"`
-}
-
-// Validate validates this intoto v002 schema content
-func (m *IntotoV002SchemaContent) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateEnvelope(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateHash(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validatePayloadHash(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *IntotoV002SchemaContent) validateEnvelope(formats strfmt.Registry) error {
-
- if err := validate.Required("content"+"."+"envelope", "body", m.Envelope); err != nil {
- return err
- }
-
- if m.Envelope != nil {
- if err := m.Envelope.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("content" + "." + "envelope")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("content" + "." + "envelope")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *IntotoV002SchemaContent) validateHash(formats strfmt.Registry) error {
- if swag.IsZero(m.Hash) { // not required
- return nil
- }
-
- if m.Hash != nil {
- if err := m.Hash.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("content" + "." + "hash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("content" + "." + "hash")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *IntotoV002SchemaContent) validatePayloadHash(formats strfmt.Registry) error {
- if swag.IsZero(m.PayloadHash) { // not required
- return nil
- }
-
- if m.PayloadHash != nil {
- if err := m.PayloadHash.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("content" + "." + "payloadHash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("content" + "." + "payloadHash")
- }
- return err
- }
- }
-
- return nil
-}
-
-// ContextValidate validate this intoto v002 schema content based on the context it is used
-func (m *IntotoV002SchemaContent) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateEnvelope(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.contextValidateHash(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.contextValidatePayloadHash(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *IntotoV002SchemaContent) contextValidateEnvelope(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Envelope != nil {
-
- if err := m.Envelope.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("content" + "." + "envelope")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("content" + "." + "envelope")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *IntotoV002SchemaContent) contextValidateHash(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Hash != nil {
-
- if swag.IsZero(m.Hash) { // not required
- return nil
- }
-
- if err := m.Hash.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("content" + "." + "hash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("content" + "." + "hash")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *IntotoV002SchemaContent) contextValidatePayloadHash(ctx context.Context, formats strfmt.Registry) error {
-
- if m.PayloadHash != nil {
-
- if swag.IsZero(m.PayloadHash) { // not required
- return nil
- }
-
- if err := m.PayloadHash.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("content" + "." + "payloadHash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("content" + "." + "payloadHash")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *IntotoV002SchemaContent) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *IntotoV002SchemaContent) UnmarshalBinary(b []byte) error {
- var res IntotoV002SchemaContent
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// IntotoV002SchemaContentEnvelope dsse envelope
-//
-// swagger:model IntotoV002SchemaContentEnvelope
-type IntotoV002SchemaContentEnvelope struct {
-
- // payload of the envelope
- // Format: byte
- Payload strfmt.Base64 `json:"payload,omitempty"`
-
- // type describing the payload
- // Required: true
- PayloadType *string `json:"payloadType"`
-
- // collection of all signatures of the envelope's payload
- // Required: true
- // Min Items: 1
- Signatures []*IntotoV002SchemaContentEnvelopeSignaturesItems0 `json:"signatures"`
-}
-
-// Validate validates this intoto v002 schema content envelope
-func (m *IntotoV002SchemaContentEnvelope) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validatePayloadType(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateSignatures(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *IntotoV002SchemaContentEnvelope) validatePayloadType(formats strfmt.Registry) error {
-
- if err := validate.Required("content"+"."+"envelope"+"."+"payloadType", "body", m.PayloadType); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *IntotoV002SchemaContentEnvelope) validateSignatures(formats strfmt.Registry) error {
-
- if err := validate.Required("content"+"."+"envelope"+"."+"signatures", "body", m.Signatures); err != nil {
- return err
- }
-
- iSignaturesSize := int64(len(m.Signatures))
-
- if err := validate.MinItems("content"+"."+"envelope"+"."+"signatures", "body", iSignaturesSize, 1); err != nil {
- return err
- }
-
- for i := 0; i < len(m.Signatures); i++ {
- if swag.IsZero(m.Signatures[i]) { // not required
- continue
- }
-
- if m.Signatures[i] != nil {
- if err := m.Signatures[i].Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("content" + "." + "envelope" + "." + "signatures" + "." + strconv.Itoa(i))
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("content" + "." + "envelope" + "." + "signatures" + "." + strconv.Itoa(i))
- }
- return err
- }
- }
-
- }
-
- return nil
-}
-
-// ContextValidate validate this intoto v002 schema content envelope based on the context it is used
-func (m *IntotoV002SchemaContentEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateSignatures(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *IntotoV002SchemaContentEnvelope) contextValidateSignatures(ctx context.Context, formats strfmt.Registry) error {
-
- for i := 0; i < len(m.Signatures); i++ {
-
- if m.Signatures[i] != nil {
-
- if swag.IsZero(m.Signatures[i]) { // not required
- return nil
- }
-
- if err := m.Signatures[i].ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("content" + "." + "envelope" + "." + "signatures" + "." + strconv.Itoa(i))
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("content" + "." + "envelope" + "." + "signatures" + "." + strconv.Itoa(i))
- }
- return err
- }
- }
-
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *IntotoV002SchemaContentEnvelope) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *IntotoV002SchemaContentEnvelope) UnmarshalBinary(b []byte) error {
- var res IntotoV002SchemaContentEnvelope
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// IntotoV002SchemaContentEnvelopeSignaturesItems0 a signature of the envelope's payload along with the public key for the signature
-//
-// swagger:model IntotoV002SchemaContentEnvelopeSignaturesItems0
-type IntotoV002SchemaContentEnvelopeSignaturesItems0 struct {
-
- // optional id of the key used to create the signature
- Keyid string `json:"keyid,omitempty"`
-
- // public key that corresponds to this signature
- // Required: true
- // Format: byte
- PublicKey *strfmt.Base64 `json:"publicKey"`
-
- // signature of the payload
- // Required: true
- // Format: byte
- Sig *strfmt.Base64 `json:"sig"`
-}
-
-// Validate validates this intoto v002 schema content envelope signatures items0
-func (m *IntotoV002SchemaContentEnvelopeSignaturesItems0) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validatePublicKey(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateSig(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *IntotoV002SchemaContentEnvelopeSignaturesItems0) validatePublicKey(formats strfmt.Registry) error {
-
- if err := validate.Required("publicKey", "body", m.PublicKey); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *IntotoV002SchemaContentEnvelopeSignaturesItems0) validateSig(formats strfmt.Registry) error {
-
- if err := validate.Required("sig", "body", m.Sig); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validates this intoto v002 schema content envelope signatures items0 based on context it is used
-func (m *IntotoV002SchemaContentEnvelopeSignaturesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *IntotoV002SchemaContentEnvelopeSignaturesItems0) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *IntotoV002SchemaContentEnvelopeSignaturesItems0) UnmarshalBinary(b []byte) error {
- var res IntotoV002SchemaContentEnvelopeSignaturesItems0
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// IntotoV002SchemaContentHash Specifies the hash algorithm and value encompassing the entire signed envelope
-//
-// swagger:model IntotoV002SchemaContentHash
-type IntotoV002SchemaContentHash struct {
-
- // The hashing function used to compute the hash value
- // Required: true
- // Enum: ["sha256"]
- Algorithm *string `json:"algorithm"`
-
- // The hash value for the archive
- // Required: true
- Value *string `json:"value"`
-}
-
-// Validate validates this intoto v002 schema content hash
-func (m *IntotoV002SchemaContentHash) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateAlgorithm(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateValue(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-var intotoV002SchemaContentHashTypeAlgorithmPropEnum []interface{}
-
-func init() {
- var res []string
- if err := json.Unmarshal([]byte(`["sha256"]`), &res); err != nil {
- panic(err)
- }
- for _, v := range res {
- intotoV002SchemaContentHashTypeAlgorithmPropEnum = append(intotoV002SchemaContentHashTypeAlgorithmPropEnum, v)
- }
-}
-
-const (
-
- // IntotoV002SchemaContentHashAlgorithmSha256 captures enum value "sha256"
- IntotoV002SchemaContentHashAlgorithmSha256 string = "sha256"
-)
-
-// prop value enum
-func (m *IntotoV002SchemaContentHash) validateAlgorithmEnum(path, location string, value string) error {
- if err := validate.EnumCase(path, location, value, intotoV002SchemaContentHashTypeAlgorithmPropEnum, true); err != nil {
- return err
- }
- return nil
-}
-
-func (m *IntotoV002SchemaContentHash) validateAlgorithm(formats strfmt.Registry) error {
-
- if err := validate.Required("content"+"."+"hash"+"."+"algorithm", "body", m.Algorithm); err != nil {
- return err
- }
-
- // value enum
- if err := m.validateAlgorithmEnum("content"+"."+"hash"+"."+"algorithm", "body", *m.Algorithm); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *IntotoV002SchemaContentHash) validateValue(formats strfmt.Registry) error {
-
- if err := validate.Required("content"+"."+"hash"+"."+"value", "body", m.Value); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validate this intoto v002 schema content hash based on the context it is used
-func (m *IntotoV002SchemaContentHash) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *IntotoV002SchemaContentHash) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *IntotoV002SchemaContentHash) UnmarshalBinary(b []byte) error {
- var res IntotoV002SchemaContentHash
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// IntotoV002SchemaContentPayloadHash Specifies the hash algorithm and value covering the payload within the DSSE envelope
-//
-// swagger:model IntotoV002SchemaContentPayloadHash
-type IntotoV002SchemaContentPayloadHash struct {
-
- // The hashing function used to compute the hash value
- // Required: true
- // Enum: ["sha256"]
- Algorithm *string `json:"algorithm"`
-
- // The hash value of the payload
- // Required: true
- Value *string `json:"value"`
-}
-
-// Validate validates this intoto v002 schema content payload hash
-func (m *IntotoV002SchemaContentPayloadHash) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateAlgorithm(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateValue(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-var intotoV002SchemaContentPayloadHashTypeAlgorithmPropEnum []interface{}
-
-func init() {
- var res []string
- if err := json.Unmarshal([]byte(`["sha256"]`), &res); err != nil {
- panic(err)
- }
- for _, v := range res {
- intotoV002SchemaContentPayloadHashTypeAlgorithmPropEnum = append(intotoV002SchemaContentPayloadHashTypeAlgorithmPropEnum, v)
- }
-}
-
-const (
-
- // IntotoV002SchemaContentPayloadHashAlgorithmSha256 captures enum value "sha256"
- IntotoV002SchemaContentPayloadHashAlgorithmSha256 string = "sha256"
-)
-
-// prop value enum
-func (m *IntotoV002SchemaContentPayloadHash) validateAlgorithmEnum(path, location string, value string) error {
- if err := validate.EnumCase(path, location, value, intotoV002SchemaContentPayloadHashTypeAlgorithmPropEnum, true); err != nil {
- return err
- }
- return nil
-}
-
-func (m *IntotoV002SchemaContentPayloadHash) validateAlgorithm(formats strfmt.Registry) error {
-
- if err := validate.Required("content"+"."+"payloadHash"+"."+"algorithm", "body", m.Algorithm); err != nil {
- return err
- }
-
- // value enum
- if err := m.validateAlgorithmEnum("content"+"."+"payloadHash"+"."+"algorithm", "body", *m.Algorithm); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *IntotoV002SchemaContentPayloadHash) validateValue(formats strfmt.Registry) error {
-
- if err := validate.Required("content"+"."+"payloadHash"+"."+"value", "body", m.Value); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validate this intoto v002 schema content payload hash based on the context it is used
-func (m *IntotoV002SchemaContentPayloadHash) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *IntotoV002SchemaContentPayloadHash) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *IntotoV002SchemaContentPayloadHash) UnmarshalBinary(b []byte) error {
- var res IntotoV002SchemaContentPayloadHash
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/jar.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/jar.go
deleted file mode 100644
index 3df3d21b8..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/jar.go
+++ /dev/null
@@ -1,210 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "bytes"
- "context"
- "encoding/json"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// Jar Java Archive (JAR)
-//
-// swagger:model jar
-type Jar struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec JarSchema `json:"spec"`
-}
-
-// Kind gets the kind of this subtype
-func (m *Jar) Kind() string {
- return "jar"
-}
-
-// SetKind sets the kind of this subtype
-func (m *Jar) SetKind(val string) {
-}
-
-// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure
-func (m *Jar) UnmarshalJSON(raw []byte) error {
- var data struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec JarSchema `json:"spec"`
- }
- buf := bytes.NewBuffer(raw)
- dec := json.NewDecoder(buf)
- dec.UseNumber()
-
- if err := dec.Decode(&data); err != nil {
- return err
- }
-
- var base struct {
- /* Just the base type fields. Used for unmashalling polymorphic types.*/
-
- Kind string `json:"kind"`
- }
- buf = bytes.NewBuffer(raw)
- dec = json.NewDecoder(buf)
- dec.UseNumber()
-
- if err := dec.Decode(&base); err != nil {
- return err
- }
-
- var result Jar
-
- if base.Kind != result.Kind() {
- /* Not the type we're looking for. */
- return errors.New(422, "invalid kind value: %q", base.Kind)
- }
-
- result.APIVersion = data.APIVersion
- result.Spec = data.Spec
-
- *m = result
-
- return nil
-}
-
-// MarshalJSON marshals this object with a polymorphic type to a JSON structure
-func (m Jar) MarshalJSON() ([]byte, error) {
- var b1, b2, b3 []byte
- var err error
- b1, err = json.Marshal(struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec JarSchema `json:"spec"`
- }{
-
- APIVersion: m.APIVersion,
-
- Spec: m.Spec,
- })
- if err != nil {
- return nil, err
- }
- b2, err = json.Marshal(struct {
- Kind string `json:"kind"`
- }{
-
- Kind: m.Kind(),
- })
- if err != nil {
- return nil, err
- }
-
- return swag.ConcatJSON(b1, b2, b3), nil
-}
-
-// Validate validates this jar
-func (m *Jar) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateAPIVersion(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateSpec(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *Jar) validateAPIVersion(formats strfmt.Registry) error {
-
- if err := validate.Required("apiVersion", "body", m.APIVersion); err != nil {
- return err
- }
-
- if err := validate.Pattern("apiVersion", "body", *m.APIVersion, `^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *Jar) validateSpec(formats strfmt.Registry) error {
-
- if m.Spec == nil {
- return errors.Required("spec", "body", nil)
- }
-
- return nil
-}
-
-// ContextValidate validate this jar based on the context it is used
-func (m *Jar) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *Jar) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *Jar) UnmarshalBinary(b []byte) error {
- var res Jar
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/jar_schema.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/jar_schema.go
deleted file mode 100644
index e7b9a590e..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/jar_schema.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-// JarSchema JAR Schema
-//
-// # Schema for JAR objects
-//
-// swagger:model jarSchema
-type JarSchema interface{}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/jar_v001_schema.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/jar_v001_schema.go
deleted file mode 100644
index 2d741f3c5..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/jar_v001_schema.go
+++ /dev/null
@@ -1,569 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "context"
- "encoding/json"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// JarV001Schema JAR v0.0.1 Schema
-//
-// # Schema for JAR entries
-//
-// swagger:model jarV001Schema
-type JarV001Schema struct {
-
- // archive
- // Required: true
- Archive *JarV001SchemaArchive `json:"archive"`
-
- // signature
- Signature *JarV001SchemaSignature `json:"signature,omitempty"`
-}
-
-// Validate validates this jar v001 schema
-func (m *JarV001Schema) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateArchive(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateSignature(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *JarV001Schema) validateArchive(formats strfmt.Registry) error {
-
- if err := validate.Required("archive", "body", m.Archive); err != nil {
- return err
- }
-
- if m.Archive != nil {
- if err := m.Archive.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("archive")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("archive")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *JarV001Schema) validateSignature(formats strfmt.Registry) error {
- if swag.IsZero(m.Signature) { // not required
- return nil
- }
-
- if m.Signature != nil {
- if err := m.Signature.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("signature")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("signature")
- }
- return err
- }
- }
-
- return nil
-}
-
-// ContextValidate validate this jar v001 schema based on the context it is used
-func (m *JarV001Schema) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateArchive(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.contextValidateSignature(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *JarV001Schema) contextValidateArchive(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Archive != nil {
-
- if err := m.Archive.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("archive")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("archive")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *JarV001Schema) contextValidateSignature(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Signature != nil {
-
- if swag.IsZero(m.Signature) { // not required
- return nil
- }
-
- if err := m.Signature.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("signature")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("signature")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *JarV001Schema) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *JarV001Schema) UnmarshalBinary(b []byte) error {
- var res JarV001Schema
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// JarV001SchemaArchive Information about the archive associated with the entry
-//
-// swagger:model JarV001SchemaArchive
-type JarV001SchemaArchive struct {
-
- // Specifies the archive inline within the document
- // Format: byte
- Content strfmt.Base64 `json:"content,omitempty"`
-
- // hash
- Hash *JarV001SchemaArchiveHash `json:"hash,omitempty"`
-}
-
-// Validate validates this jar v001 schema archive
-func (m *JarV001SchemaArchive) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateHash(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *JarV001SchemaArchive) validateHash(formats strfmt.Registry) error {
- if swag.IsZero(m.Hash) { // not required
- return nil
- }
-
- if m.Hash != nil {
- if err := m.Hash.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("archive" + "." + "hash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("archive" + "." + "hash")
- }
- return err
- }
- }
-
- return nil
-}
-
-// ContextValidate validate this jar v001 schema archive based on the context it is used
-func (m *JarV001SchemaArchive) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateHash(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *JarV001SchemaArchive) contextValidateHash(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Hash != nil {
-
- if swag.IsZero(m.Hash) { // not required
- return nil
- }
-
- if err := m.Hash.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("archive" + "." + "hash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("archive" + "." + "hash")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *JarV001SchemaArchive) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *JarV001SchemaArchive) UnmarshalBinary(b []byte) error {
- var res JarV001SchemaArchive
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// JarV001SchemaArchiveHash Specifies the hash algorithm and value encompassing the entire signed archive
-//
-// swagger:model JarV001SchemaArchiveHash
-type JarV001SchemaArchiveHash struct {
-
- // The hashing function used to compute the hash value
- // Required: true
- // Enum: ["sha256"]
- Algorithm *string `json:"algorithm"`
-
- // The hash value for the archive
- // Required: true
- Value *string `json:"value"`
-}
-
-// Validate validates this jar v001 schema archive hash
-func (m *JarV001SchemaArchiveHash) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateAlgorithm(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateValue(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-var jarV001SchemaArchiveHashTypeAlgorithmPropEnum []interface{}
-
-func init() {
- var res []string
- if err := json.Unmarshal([]byte(`["sha256"]`), &res); err != nil {
- panic(err)
- }
- for _, v := range res {
- jarV001SchemaArchiveHashTypeAlgorithmPropEnum = append(jarV001SchemaArchiveHashTypeAlgorithmPropEnum, v)
- }
-}
-
-const (
-
- // JarV001SchemaArchiveHashAlgorithmSha256 captures enum value "sha256"
- JarV001SchemaArchiveHashAlgorithmSha256 string = "sha256"
-)
-
-// prop value enum
-func (m *JarV001SchemaArchiveHash) validateAlgorithmEnum(path, location string, value string) error {
- if err := validate.EnumCase(path, location, value, jarV001SchemaArchiveHashTypeAlgorithmPropEnum, true); err != nil {
- return err
- }
- return nil
-}
-
-func (m *JarV001SchemaArchiveHash) validateAlgorithm(formats strfmt.Registry) error {
-
- if err := validate.Required("archive"+"."+"hash"+"."+"algorithm", "body", m.Algorithm); err != nil {
- return err
- }
-
- // value enum
- if err := m.validateAlgorithmEnum("archive"+"."+"hash"+"."+"algorithm", "body", *m.Algorithm); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *JarV001SchemaArchiveHash) validateValue(formats strfmt.Registry) error {
-
- if err := validate.Required("archive"+"."+"hash"+"."+"value", "body", m.Value); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validates this jar v001 schema archive hash based on context it is used
-func (m *JarV001SchemaArchiveHash) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *JarV001SchemaArchiveHash) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *JarV001SchemaArchiveHash) UnmarshalBinary(b []byte) error {
- var res JarV001SchemaArchiveHash
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// JarV001SchemaSignature Information about the included signature in the JAR file
-//
-// swagger:model JarV001SchemaSignature
-type JarV001SchemaSignature struct {
-
- // Specifies the PKCS7 signature embedded within the JAR file
- // Required: true
- // Read Only: true
- // Format: byte
- Content strfmt.Base64 `json:"content"`
-
- // public key
- // Required: true
- PublicKey *JarV001SchemaSignaturePublicKey `json:"publicKey"`
-}
-
-// Validate validates this jar v001 schema signature
-func (m *JarV001SchemaSignature) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateContent(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validatePublicKey(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *JarV001SchemaSignature) validateContent(formats strfmt.Registry) error {
-
- if err := validate.Required("signature"+"."+"content", "body", strfmt.Base64(m.Content)); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *JarV001SchemaSignature) validatePublicKey(formats strfmt.Registry) error {
-
- if err := validate.Required("signature"+"."+"publicKey", "body", m.PublicKey); err != nil {
- return err
- }
-
- if m.PublicKey != nil {
- if err := m.PublicKey.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("signature" + "." + "publicKey")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("signature" + "." + "publicKey")
- }
- return err
- }
- }
-
- return nil
-}
-
-// ContextValidate validate this jar v001 schema signature based on the context it is used
-func (m *JarV001SchemaSignature) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateContent(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.contextValidatePublicKey(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *JarV001SchemaSignature) contextValidateContent(ctx context.Context, formats strfmt.Registry) error {
-
- if err := validate.ReadOnly(ctx, "signature"+"."+"content", "body", strfmt.Base64(m.Content)); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *JarV001SchemaSignature) contextValidatePublicKey(ctx context.Context, formats strfmt.Registry) error {
-
- if m.PublicKey != nil {
-
- if err := m.PublicKey.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("signature" + "." + "publicKey")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("signature" + "." + "publicKey")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *JarV001SchemaSignature) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *JarV001SchemaSignature) UnmarshalBinary(b []byte) error {
- var res JarV001SchemaSignature
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// JarV001SchemaSignaturePublicKey The X509 certificate containing the public key JAR which verifies the signature of the JAR
-//
-// swagger:model JarV001SchemaSignaturePublicKey
-type JarV001SchemaSignaturePublicKey struct {
-
- // Specifies the content of the X509 certificate containing the public key used to verify the signature
- // Required: true
- // Format: byte
- Content *strfmt.Base64 `json:"content"`
-}
-
-// Validate validates this jar v001 schema signature public key
-func (m *JarV001SchemaSignaturePublicKey) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateContent(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *JarV001SchemaSignaturePublicKey) validateContent(formats strfmt.Registry) error {
-
- if err := validate.Required("signature"+"."+"publicKey"+"."+"content", "body", m.Content); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validate this jar v001 schema signature public key based on the context it is used
-func (m *JarV001SchemaSignaturePublicKey) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *JarV001SchemaSignaturePublicKey) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *JarV001SchemaSignaturePublicKey) UnmarshalBinary(b []byte) error {
- var res JarV001SchemaSignaturePublicKey
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/log_entry.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/log_entry.go
deleted file mode 100644
index ee32ded41..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/log_entry.go
+++ /dev/null
@@ -1,445 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "context"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// LogEntry log entry
-//
-// swagger:model LogEntry
-type LogEntry map[string]LogEntryAnon
-
-// Validate validates this log entry
-func (m LogEntry) Validate(formats strfmt.Registry) error {
- var res []error
-
- for k := range m {
-
- if swag.IsZero(m[k]) { // not required
- continue
- }
- if val, ok := m[k]; ok {
- if err := val.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName(k)
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName(k)
- }
- return err
- }
- }
-
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-// ContextValidate validate this log entry based on the context it is used
-func (m LogEntry) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- for k := range m {
-
- if val, ok := m[k]; ok {
- if err := val.ContextValidate(ctx, formats); err != nil {
- return err
- }
- }
-
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-// LogEntryAnon log entry anon
-//
-// swagger:model LogEntryAnon
-type LogEntryAnon struct {
-
- // attestation
- Attestation *LogEntryAnonAttestation `json:"attestation,omitempty"`
-
- // body
- // Required: true
- Body interface{} `json:"body"`
-
- // The time the entry was added to the log as a Unix timestamp in seconds
- // Required: true
- IntegratedTime *int64 `json:"integratedTime"`
-
- // This is the SHA256 hash of the DER-encoded public key for the log at the time the entry was included in the log
- // Required: true
- // Pattern: ^[0-9a-fA-F]{64}$
- LogID *string `json:"logID"`
-
- // log index
- // Required: true
- // Minimum: 0
- LogIndex *int64 `json:"logIndex"`
-
- // verification
- Verification *LogEntryAnonVerification `json:"verification,omitempty"`
-}
-
-// Validate validates this log entry anon
-func (m *LogEntryAnon) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateAttestation(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateBody(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateIntegratedTime(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateLogID(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateLogIndex(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateVerification(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *LogEntryAnon) validateAttestation(formats strfmt.Registry) error {
- if swag.IsZero(m.Attestation) { // not required
- return nil
- }
-
- if m.Attestation != nil {
- if err := m.Attestation.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("attestation")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("attestation")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *LogEntryAnon) validateBody(formats strfmt.Registry) error {
-
- if m.Body == nil {
- return errors.Required("body", "body", nil)
- }
-
- return nil
-}
-
-func (m *LogEntryAnon) validateIntegratedTime(formats strfmt.Registry) error {
-
- if err := validate.Required("integratedTime", "body", m.IntegratedTime); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *LogEntryAnon) validateLogID(formats strfmt.Registry) error {
-
- if err := validate.Required("logID", "body", m.LogID); err != nil {
- return err
- }
-
- if err := validate.Pattern("logID", "body", *m.LogID, `^[0-9a-fA-F]{64}$`); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *LogEntryAnon) validateLogIndex(formats strfmt.Registry) error {
-
- if err := validate.Required("logIndex", "body", m.LogIndex); err != nil {
- return err
- }
-
- if err := validate.MinimumInt("logIndex", "body", *m.LogIndex, 0, false); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *LogEntryAnon) validateVerification(formats strfmt.Registry) error {
- if swag.IsZero(m.Verification) { // not required
- return nil
- }
-
- if m.Verification != nil {
- if err := m.Verification.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("verification")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("verification")
- }
- return err
- }
- }
-
- return nil
-}
-
-// ContextValidate validate this log entry anon based on the context it is used
-func (m *LogEntryAnon) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateAttestation(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.contextValidateVerification(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *LogEntryAnon) contextValidateAttestation(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Attestation != nil {
-
- if swag.IsZero(m.Attestation) { // not required
- return nil
- }
-
- if err := m.Attestation.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("attestation")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("attestation")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *LogEntryAnon) contextValidateVerification(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Verification != nil {
-
- if swag.IsZero(m.Verification) { // not required
- return nil
- }
-
- if err := m.Verification.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("verification")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("verification")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *LogEntryAnon) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *LogEntryAnon) UnmarshalBinary(b []byte) error {
- var res LogEntryAnon
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// LogEntryAnonAttestation log entry anon attestation
-//
-// swagger:model LogEntryAnonAttestation
-type LogEntryAnonAttestation struct {
-
- // data
- // Format: byte
- Data strfmt.Base64 `json:"data,omitempty"`
-}
-
-// Validate validates this log entry anon attestation
-func (m *LogEntryAnonAttestation) Validate(formats strfmt.Registry) error {
- return nil
-}
-
-// ContextValidate validates this log entry anon attestation based on context it is used
-func (m *LogEntryAnonAttestation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *LogEntryAnonAttestation) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *LogEntryAnonAttestation) UnmarshalBinary(b []byte) error {
- var res LogEntryAnonAttestation
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// LogEntryAnonVerification log entry anon verification
-//
-// swagger:model LogEntryAnonVerification
-type LogEntryAnonVerification struct {
-
- // inclusion proof
- InclusionProof *InclusionProof `json:"inclusionProof,omitempty"`
-
- // Signature over the logID, logIndex, body and integratedTime.
- // Format: byte
- SignedEntryTimestamp strfmt.Base64 `json:"signedEntryTimestamp,omitempty"`
-}
-
-// Validate validates this log entry anon verification
-func (m *LogEntryAnonVerification) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateInclusionProof(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *LogEntryAnonVerification) validateInclusionProof(formats strfmt.Registry) error {
- if swag.IsZero(m.InclusionProof) { // not required
- return nil
- }
-
- if m.InclusionProof != nil {
- if err := m.InclusionProof.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("verification" + "." + "inclusionProof")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("verification" + "." + "inclusionProof")
- }
- return err
- }
- }
-
- return nil
-}
-
-// ContextValidate validate this log entry anon verification based on the context it is used
-func (m *LogEntryAnonVerification) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateInclusionProof(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *LogEntryAnonVerification) contextValidateInclusionProof(ctx context.Context, formats strfmt.Registry) error {
-
- if m.InclusionProof != nil {
-
- if swag.IsZero(m.InclusionProof) { // not required
- return nil
- }
-
- if err := m.InclusionProof.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("verification" + "." + "inclusionProof")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("verification" + "." + "inclusionProof")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *LogEntryAnonVerification) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *LogEntryAnonVerification) UnmarshalBinary(b []byte) error {
- var res LogEntryAnonVerification
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/log_info.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/log_info.go
deleted file mode 100644
index cb57b27f5..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/log_info.go
+++ /dev/null
@@ -1,221 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "context"
- "strconv"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// LogInfo log info
-//
-// swagger:model LogInfo
-type LogInfo struct {
-
- // inactive shards
- InactiveShards []*InactiveShardLogInfo `json:"inactiveShards"`
-
- // The current hash value stored at the root of the merkle tree
- // Required: true
- // Pattern: ^[0-9a-fA-F]{64}$
- RootHash *string `json:"rootHash"`
-
- // The current signed tree head
- // Required: true
- SignedTreeHead *string `json:"signedTreeHead"`
-
- // The current treeID
- // Required: true
- // Pattern: ^[0-9]+$
- TreeID *string `json:"treeID"`
-
- // The current number of nodes in the merkle tree
- // Required: true
- // Minimum: 1
- TreeSize *int64 `json:"treeSize"`
-}
-
-// Validate validates this log info
-func (m *LogInfo) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateInactiveShards(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateRootHash(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateSignedTreeHead(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateTreeID(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateTreeSize(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *LogInfo) validateInactiveShards(formats strfmt.Registry) error {
- if swag.IsZero(m.InactiveShards) { // not required
- return nil
- }
-
- for i := 0; i < len(m.InactiveShards); i++ {
- if swag.IsZero(m.InactiveShards[i]) { // not required
- continue
- }
-
- if m.InactiveShards[i] != nil {
- if err := m.InactiveShards[i].Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("inactiveShards" + "." + strconv.Itoa(i))
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("inactiveShards" + "." + strconv.Itoa(i))
- }
- return err
- }
- }
-
- }
-
- return nil
-}
-
-func (m *LogInfo) validateRootHash(formats strfmt.Registry) error {
-
- if err := validate.Required("rootHash", "body", m.RootHash); err != nil {
- return err
- }
-
- if err := validate.Pattern("rootHash", "body", *m.RootHash, `^[0-9a-fA-F]{64}$`); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *LogInfo) validateSignedTreeHead(formats strfmt.Registry) error {
-
- if err := validate.Required("signedTreeHead", "body", m.SignedTreeHead); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *LogInfo) validateTreeID(formats strfmt.Registry) error {
-
- if err := validate.Required("treeID", "body", m.TreeID); err != nil {
- return err
- }
-
- if err := validate.Pattern("treeID", "body", *m.TreeID, `^[0-9]+$`); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *LogInfo) validateTreeSize(formats strfmt.Registry) error {
-
- if err := validate.Required("treeSize", "body", m.TreeSize); err != nil {
- return err
- }
-
- if err := validate.MinimumInt("treeSize", "body", *m.TreeSize, 1, false); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validate this log info based on the context it is used
-func (m *LogInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateInactiveShards(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *LogInfo) contextValidateInactiveShards(ctx context.Context, formats strfmt.Registry) error {
-
- for i := 0; i < len(m.InactiveShards); i++ {
-
- if m.InactiveShards[i] != nil {
-
- if swag.IsZero(m.InactiveShards[i]) { // not required
- return nil
- }
-
- if err := m.InactiveShards[i].ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("inactiveShards" + "." + strconv.Itoa(i))
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("inactiveShards" + "." + strconv.Itoa(i))
- }
- return err
- }
- }
-
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *LogInfo) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *LogInfo) UnmarshalBinary(b []byte) error {
- var res LogInfo
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/proposed_entry.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/proposed_entry.go
deleted file mode 100644
index 5b734a5ff..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/proposed_entry.go
+++ /dev/null
@@ -1,195 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "bytes"
- "context"
- "encoding/json"
- "io"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/runtime"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/validate"
-)
-
-// ProposedEntry proposed entry
-//
-// swagger:discriminator ProposedEntry kind
-type ProposedEntry interface {
- runtime.Validatable
- runtime.ContextValidatable
-
- // kind
- // Required: true
- Kind() string
- SetKind(string)
-
- // AdditionalProperties in base type shoud be handled just like regular properties
- // At this moment, the base type property is pushed down to the subtype
-}
-
-type proposedEntry struct {
- kindField string
-}
-
-// Kind gets the kind of this polymorphic type
-func (m *proposedEntry) Kind() string {
- return "ProposedEntry"
-}
-
-// SetKind sets the kind of this polymorphic type
-func (m *proposedEntry) SetKind(val string) {
-}
-
-// UnmarshalProposedEntrySlice unmarshals polymorphic slices of ProposedEntry
-func UnmarshalProposedEntrySlice(reader io.Reader, consumer runtime.Consumer) ([]ProposedEntry, error) {
- var elements []json.RawMessage
- if err := consumer.Consume(reader, &elements); err != nil {
- return nil, err
- }
-
- var result []ProposedEntry
- for _, element := range elements {
- obj, err := unmarshalProposedEntry(element, consumer)
- if err != nil {
- return nil, err
- }
- result = append(result, obj)
- }
- return result, nil
-}
-
-// UnmarshalProposedEntry unmarshals polymorphic ProposedEntry
-func UnmarshalProposedEntry(reader io.Reader, consumer runtime.Consumer) (ProposedEntry, error) {
- // we need to read this twice, so first into a buffer
- data, err := io.ReadAll(reader)
- if err != nil {
- return nil, err
- }
- return unmarshalProposedEntry(data, consumer)
-}
-
-func unmarshalProposedEntry(data []byte, consumer runtime.Consumer) (ProposedEntry, error) {
- buf := bytes.NewBuffer(data)
- buf2 := bytes.NewBuffer(data)
-
- // the first time this is read is to fetch the value of the kind property.
- var getType struct {
- Kind string `json:"kind"`
- }
- if err := consumer.Consume(buf, &getType); err != nil {
- return nil, err
- }
-
- if err := validate.RequiredString("kind", "body", getType.Kind); err != nil {
- return nil, err
- }
-
- // The value of kind is used to determine which type to create and unmarshal the data into
- switch getType.Kind {
- case "ProposedEntry":
- var result proposedEntry
- if err := consumer.Consume(buf2, &result); err != nil {
- return nil, err
- }
- return &result, nil
- case "alpine":
- var result Alpine
- if err := consumer.Consume(buf2, &result); err != nil {
- return nil, err
- }
- return &result, nil
- case "cose":
- var result Cose
- if err := consumer.Consume(buf2, &result); err != nil {
- return nil, err
- }
- return &result, nil
- case "dsse":
- var result DSSE
- if err := consumer.Consume(buf2, &result); err != nil {
- return nil, err
- }
- return &result, nil
- case "hashedrekord":
- var result Hashedrekord
- if err := consumer.Consume(buf2, &result); err != nil {
- return nil, err
- }
- return &result, nil
- case "helm":
- var result Helm
- if err := consumer.Consume(buf2, &result); err != nil {
- return nil, err
- }
- return &result, nil
- case "intoto":
- var result Intoto
- if err := consumer.Consume(buf2, &result); err != nil {
- return nil, err
- }
- return &result, nil
- case "jar":
- var result Jar
- if err := consumer.Consume(buf2, &result); err != nil {
- return nil, err
- }
- return &result, nil
- case "rekord":
- var result Rekord
- if err := consumer.Consume(buf2, &result); err != nil {
- return nil, err
- }
- return &result, nil
- case "rfc3161":
- var result Rfc3161
- if err := consumer.Consume(buf2, &result); err != nil {
- return nil, err
- }
- return &result, nil
- case "rpm":
- var result Rpm
- if err := consumer.Consume(buf2, &result); err != nil {
- return nil, err
- }
- return &result, nil
- case "tuf":
- var result TUF
- if err := consumer.Consume(buf2, &result); err != nil {
- return nil, err
- }
- return &result, nil
- }
- return nil, errors.New(422, "invalid kind value: %q", getType.Kind)
-}
-
-// Validate validates this proposed entry
-func (m *proposedEntry) Validate(formats strfmt.Registry) error {
- return nil
-}
-
-// ContextValidate validates this proposed entry based on context it is used
-func (m *proposedEntry) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rekord.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rekord.go
deleted file mode 100644
index 81c8ff054..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rekord.go
+++ /dev/null
@@ -1,210 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "bytes"
- "context"
- "encoding/json"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// Rekord Rekord object
-//
-// swagger:model rekord
-type Rekord struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec RekordSchema `json:"spec"`
-}
-
-// Kind gets the kind of this subtype
-func (m *Rekord) Kind() string {
- return "rekord"
-}
-
-// SetKind sets the kind of this subtype
-func (m *Rekord) SetKind(val string) {
-}
-
-// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure
-func (m *Rekord) UnmarshalJSON(raw []byte) error {
- var data struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec RekordSchema `json:"spec"`
- }
- buf := bytes.NewBuffer(raw)
- dec := json.NewDecoder(buf)
- dec.UseNumber()
-
- if err := dec.Decode(&data); err != nil {
- return err
- }
-
- var base struct {
- /* Just the base type fields. Used for unmashalling polymorphic types.*/
-
- Kind string `json:"kind"`
- }
- buf = bytes.NewBuffer(raw)
- dec = json.NewDecoder(buf)
- dec.UseNumber()
-
- if err := dec.Decode(&base); err != nil {
- return err
- }
-
- var result Rekord
-
- if base.Kind != result.Kind() {
- /* Not the type we're looking for. */
- return errors.New(422, "invalid kind value: %q", base.Kind)
- }
-
- result.APIVersion = data.APIVersion
- result.Spec = data.Spec
-
- *m = result
-
- return nil
-}
-
-// MarshalJSON marshals this object with a polymorphic type to a JSON structure
-func (m Rekord) MarshalJSON() ([]byte, error) {
- var b1, b2, b3 []byte
- var err error
- b1, err = json.Marshal(struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec RekordSchema `json:"spec"`
- }{
-
- APIVersion: m.APIVersion,
-
- Spec: m.Spec,
- })
- if err != nil {
- return nil, err
- }
- b2, err = json.Marshal(struct {
- Kind string `json:"kind"`
- }{
-
- Kind: m.Kind(),
- })
- if err != nil {
- return nil, err
- }
-
- return swag.ConcatJSON(b1, b2, b3), nil
-}
-
-// Validate validates this rekord
-func (m *Rekord) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateAPIVersion(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateSpec(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *Rekord) validateAPIVersion(formats strfmt.Registry) error {
-
- if err := validate.Required("apiVersion", "body", m.APIVersion); err != nil {
- return err
- }
-
- if err := validate.Pattern("apiVersion", "body", *m.APIVersion, `^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *Rekord) validateSpec(formats strfmt.Registry) error {
-
- if m.Spec == nil {
- return errors.Required("spec", "body", nil)
- }
-
- return nil
-}
-
-// ContextValidate validate this rekord based on the context it is used
-func (m *Rekord) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *Rekord) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *Rekord) UnmarshalBinary(b []byte) error {
- var res Rekord
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rekord_schema.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rekord_schema.go
deleted file mode 100644
index e85442ae9..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rekord_schema.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-// RekordSchema Rekor Schema
-//
-// # Schema for Rekord objects
-//
-// swagger:model rekordSchema
-type RekordSchema interface{}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rekord_v001_schema.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rekord_v001_schema.go
deleted file mode 100644
index aaaad9d7b..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rekord_v001_schema.go
+++ /dev/null
@@ -1,611 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "context"
- "encoding/json"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// RekordV001Schema Rekor v0.0.1 Schema
-//
-// # Schema for Rekord object
-//
-// swagger:model rekordV001Schema
-type RekordV001Schema struct {
-
- // data
- // Required: true
- Data *RekordV001SchemaData `json:"data"`
-
- // signature
- // Required: true
- Signature *RekordV001SchemaSignature `json:"signature"`
-}
-
-// Validate validates this rekord v001 schema
-func (m *RekordV001Schema) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateData(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateSignature(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *RekordV001Schema) validateData(formats strfmt.Registry) error {
-
- if err := validate.Required("data", "body", m.Data); err != nil {
- return err
- }
-
- if m.Data != nil {
- if err := m.Data.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("data")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("data")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *RekordV001Schema) validateSignature(formats strfmt.Registry) error {
-
- if err := validate.Required("signature", "body", m.Signature); err != nil {
- return err
- }
-
- if m.Signature != nil {
- if err := m.Signature.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("signature")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("signature")
- }
- return err
- }
- }
-
- return nil
-}
-
-// ContextValidate validate this rekord v001 schema based on the context it is used
-func (m *RekordV001Schema) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateData(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.contextValidateSignature(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *RekordV001Schema) contextValidateData(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Data != nil {
-
- if err := m.Data.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("data")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("data")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *RekordV001Schema) contextValidateSignature(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Signature != nil {
-
- if err := m.Signature.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("signature")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("signature")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *RekordV001Schema) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *RekordV001Schema) UnmarshalBinary(b []byte) error {
- var res RekordV001Schema
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// RekordV001SchemaData Information about the content associated with the entry
-//
-// swagger:model RekordV001SchemaData
-type RekordV001SchemaData struct {
-
- // Specifies the content inline within the document
- // Format: byte
- Content strfmt.Base64 `json:"content,omitempty"`
-
- // hash
- Hash *RekordV001SchemaDataHash `json:"hash,omitempty"`
-}
-
-// Validate validates this rekord v001 schema data
-func (m *RekordV001SchemaData) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateHash(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *RekordV001SchemaData) validateHash(formats strfmt.Registry) error {
- if swag.IsZero(m.Hash) { // not required
- return nil
- }
-
- if m.Hash != nil {
- if err := m.Hash.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("data" + "." + "hash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("data" + "." + "hash")
- }
- return err
- }
- }
-
- return nil
-}
-
-// ContextValidate validate this rekord v001 schema data based on the context it is used
-func (m *RekordV001SchemaData) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateHash(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *RekordV001SchemaData) contextValidateHash(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Hash != nil {
-
- if swag.IsZero(m.Hash) { // not required
- return nil
- }
-
- if err := m.Hash.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("data" + "." + "hash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("data" + "." + "hash")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *RekordV001SchemaData) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *RekordV001SchemaData) UnmarshalBinary(b []byte) error {
- var res RekordV001SchemaData
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// RekordV001SchemaDataHash Specifies the hash algorithm and value for the content
-//
-// swagger:model RekordV001SchemaDataHash
-type RekordV001SchemaDataHash struct {
-
- // The hashing function used to compute the hash value
- // Required: true
- // Enum: ["sha256"]
- Algorithm *string `json:"algorithm"`
-
- // The hash value for the content
- // Required: true
- Value *string `json:"value"`
-}
-
-// Validate validates this rekord v001 schema data hash
-func (m *RekordV001SchemaDataHash) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateAlgorithm(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateValue(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-var rekordV001SchemaDataHashTypeAlgorithmPropEnum []interface{}
-
-func init() {
- var res []string
- if err := json.Unmarshal([]byte(`["sha256"]`), &res); err != nil {
- panic(err)
- }
- for _, v := range res {
- rekordV001SchemaDataHashTypeAlgorithmPropEnum = append(rekordV001SchemaDataHashTypeAlgorithmPropEnum, v)
- }
-}
-
-const (
-
- // RekordV001SchemaDataHashAlgorithmSha256 captures enum value "sha256"
- RekordV001SchemaDataHashAlgorithmSha256 string = "sha256"
-)
-
-// prop value enum
-func (m *RekordV001SchemaDataHash) validateAlgorithmEnum(path, location string, value string) error {
- if err := validate.EnumCase(path, location, value, rekordV001SchemaDataHashTypeAlgorithmPropEnum, true); err != nil {
- return err
- }
- return nil
-}
-
-func (m *RekordV001SchemaDataHash) validateAlgorithm(formats strfmt.Registry) error {
-
- if err := validate.Required("data"+"."+"hash"+"."+"algorithm", "body", m.Algorithm); err != nil {
- return err
- }
-
- // value enum
- if err := m.validateAlgorithmEnum("data"+"."+"hash"+"."+"algorithm", "body", *m.Algorithm); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *RekordV001SchemaDataHash) validateValue(formats strfmt.Registry) error {
-
- if err := validate.Required("data"+"."+"hash"+"."+"value", "body", m.Value); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validate this rekord v001 schema data hash based on the context it is used
-func (m *RekordV001SchemaDataHash) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *RekordV001SchemaDataHash) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *RekordV001SchemaDataHash) UnmarshalBinary(b []byte) error {
- var res RekordV001SchemaDataHash
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// RekordV001SchemaSignature Information about the detached signature associated with the entry
-//
-// swagger:model RekordV001SchemaSignature
-type RekordV001SchemaSignature struct {
-
- // Specifies the content of the signature inline within the document
- // Required: true
- // Format: byte
- Content *strfmt.Base64 `json:"content"`
-
- // Specifies the format of the signature
- // Required: true
- // Enum: ["pgp","minisign","x509","ssh"]
- Format *string `json:"format"`
-
- // public key
- // Required: true
- PublicKey *RekordV001SchemaSignaturePublicKey `json:"publicKey"`
-}
-
-// Validate validates this rekord v001 schema signature
-func (m *RekordV001SchemaSignature) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateContent(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateFormat(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validatePublicKey(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *RekordV001SchemaSignature) validateContent(formats strfmt.Registry) error {
-
- if err := validate.Required("signature"+"."+"content", "body", m.Content); err != nil {
- return err
- }
-
- return nil
-}
-
-var rekordV001SchemaSignatureTypeFormatPropEnum []interface{}
-
-func init() {
- var res []string
- if err := json.Unmarshal([]byte(`["pgp","minisign","x509","ssh"]`), &res); err != nil {
- panic(err)
- }
- for _, v := range res {
- rekordV001SchemaSignatureTypeFormatPropEnum = append(rekordV001SchemaSignatureTypeFormatPropEnum, v)
- }
-}
-
-const (
-
- // RekordV001SchemaSignatureFormatPgp captures enum value "pgp"
- RekordV001SchemaSignatureFormatPgp string = "pgp"
-
- // RekordV001SchemaSignatureFormatMinisign captures enum value "minisign"
- RekordV001SchemaSignatureFormatMinisign string = "minisign"
-
- // RekordV001SchemaSignatureFormatX509 captures enum value "x509"
- RekordV001SchemaSignatureFormatX509 string = "x509"
-
- // RekordV001SchemaSignatureFormatSSH captures enum value "ssh"
- RekordV001SchemaSignatureFormatSSH string = "ssh"
-)
-
-// prop value enum
-func (m *RekordV001SchemaSignature) validateFormatEnum(path, location string, value string) error {
- if err := validate.EnumCase(path, location, value, rekordV001SchemaSignatureTypeFormatPropEnum, true); err != nil {
- return err
- }
- return nil
-}
-
-func (m *RekordV001SchemaSignature) validateFormat(formats strfmt.Registry) error {
-
- if err := validate.Required("signature"+"."+"format", "body", m.Format); err != nil {
- return err
- }
-
- // value enum
- if err := m.validateFormatEnum("signature"+"."+"format", "body", *m.Format); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *RekordV001SchemaSignature) validatePublicKey(formats strfmt.Registry) error {
-
- if err := validate.Required("signature"+"."+"publicKey", "body", m.PublicKey); err != nil {
- return err
- }
-
- if m.PublicKey != nil {
- if err := m.PublicKey.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("signature" + "." + "publicKey")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("signature" + "." + "publicKey")
- }
- return err
- }
- }
-
- return nil
-}
-
-// ContextValidate validate this rekord v001 schema signature based on the context it is used
-func (m *RekordV001SchemaSignature) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidatePublicKey(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *RekordV001SchemaSignature) contextValidatePublicKey(ctx context.Context, formats strfmt.Registry) error {
-
- if m.PublicKey != nil {
-
- if err := m.PublicKey.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("signature" + "." + "publicKey")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("signature" + "." + "publicKey")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *RekordV001SchemaSignature) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *RekordV001SchemaSignature) UnmarshalBinary(b []byte) error {
- var res RekordV001SchemaSignature
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// RekordV001SchemaSignaturePublicKey The public key that can verify the signature
-//
-// swagger:model RekordV001SchemaSignaturePublicKey
-type RekordV001SchemaSignaturePublicKey struct {
-
- // Specifies the content of the public key inline within the document
- // Required: true
- // Format: byte
- Content *strfmt.Base64 `json:"content"`
-}
-
-// Validate validates this rekord v001 schema signature public key
-func (m *RekordV001SchemaSignaturePublicKey) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateContent(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *RekordV001SchemaSignaturePublicKey) validateContent(formats strfmt.Registry) error {
-
- if err := validate.Required("signature"+"."+"publicKey"+"."+"content", "body", m.Content); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validates this rekord v001 schema signature public key based on context it is used
-func (m *RekordV001SchemaSignaturePublicKey) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *RekordV001SchemaSignaturePublicKey) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *RekordV001SchemaSignaturePublicKey) UnmarshalBinary(b []byte) error {
- var res RekordV001SchemaSignaturePublicKey
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rfc3161.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rfc3161.go
deleted file mode 100644
index ef8d42e7a..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rfc3161.go
+++ /dev/null
@@ -1,210 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "bytes"
- "context"
- "encoding/json"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// Rfc3161 RFC3161 Timestamp
-//
-// swagger:model rfc3161
-type Rfc3161 struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec Rfc3161Schema `json:"spec"`
-}
-
-// Kind gets the kind of this subtype
-func (m *Rfc3161) Kind() string {
- return "rfc3161"
-}
-
-// SetKind sets the kind of this subtype
-func (m *Rfc3161) SetKind(val string) {
-}
-
-// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure
-func (m *Rfc3161) UnmarshalJSON(raw []byte) error {
- var data struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec Rfc3161Schema `json:"spec"`
- }
- buf := bytes.NewBuffer(raw)
- dec := json.NewDecoder(buf)
- dec.UseNumber()
-
- if err := dec.Decode(&data); err != nil {
- return err
- }
-
- var base struct {
- /* Just the base type fields. Used for unmashalling polymorphic types.*/
-
- Kind string `json:"kind"`
- }
- buf = bytes.NewBuffer(raw)
- dec = json.NewDecoder(buf)
- dec.UseNumber()
-
- if err := dec.Decode(&base); err != nil {
- return err
- }
-
- var result Rfc3161
-
- if base.Kind != result.Kind() {
- /* Not the type we're looking for. */
- return errors.New(422, "invalid kind value: %q", base.Kind)
- }
-
- result.APIVersion = data.APIVersion
- result.Spec = data.Spec
-
- *m = result
-
- return nil
-}
-
-// MarshalJSON marshals this object with a polymorphic type to a JSON structure
-func (m Rfc3161) MarshalJSON() ([]byte, error) {
- var b1, b2, b3 []byte
- var err error
- b1, err = json.Marshal(struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec Rfc3161Schema `json:"spec"`
- }{
-
- APIVersion: m.APIVersion,
-
- Spec: m.Spec,
- })
- if err != nil {
- return nil, err
- }
- b2, err = json.Marshal(struct {
- Kind string `json:"kind"`
- }{
-
- Kind: m.Kind(),
- })
- if err != nil {
- return nil, err
- }
-
- return swag.ConcatJSON(b1, b2, b3), nil
-}
-
-// Validate validates this rfc3161
-func (m *Rfc3161) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateAPIVersion(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateSpec(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *Rfc3161) validateAPIVersion(formats strfmt.Registry) error {
-
- if err := validate.Required("apiVersion", "body", m.APIVersion); err != nil {
- return err
- }
-
- if err := validate.Pattern("apiVersion", "body", *m.APIVersion, `^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *Rfc3161) validateSpec(formats strfmt.Registry) error {
-
- if m.Spec == nil {
- return errors.Required("spec", "body", nil)
- }
-
- return nil
-}
-
-// ContextValidate validate this rfc3161 based on the context it is used
-func (m *Rfc3161) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *Rfc3161) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *Rfc3161) UnmarshalBinary(b []byte) error {
- var res Rfc3161
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rfc3161_schema.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rfc3161_schema.go
deleted file mode 100644
index 826013a28..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rfc3161_schema.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-// Rfc3161Schema Timestamp Schema
-//
-// # Schema for RFC 3161 timestamp objects
-//
-// swagger:model rfc3161Schema
-type Rfc3161Schema interface{}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rfc3161_v001_schema.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rfc3161_v001_schema.go
deleted file mode 100644
index c3a50c849..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rfc3161_v001_schema.go
+++ /dev/null
@@ -1,183 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "context"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// Rfc3161V001Schema Timestamp v0.0.1 Schema
-//
-// # Schema for RFC3161 entries
-//
-// swagger:model rfc3161V001Schema
-type Rfc3161V001Schema struct {
-
- // tsr
- // Required: true
- Tsr *Rfc3161V001SchemaTsr `json:"tsr"`
-}
-
-// Validate validates this rfc3161 v001 schema
-func (m *Rfc3161V001Schema) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateTsr(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *Rfc3161V001Schema) validateTsr(formats strfmt.Registry) error {
-
- if err := validate.Required("tsr", "body", m.Tsr); err != nil {
- return err
- }
-
- if m.Tsr != nil {
- if err := m.Tsr.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("tsr")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("tsr")
- }
- return err
- }
- }
-
- return nil
-}
-
-// ContextValidate validate this rfc3161 v001 schema based on the context it is used
-func (m *Rfc3161V001Schema) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateTsr(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *Rfc3161V001Schema) contextValidateTsr(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Tsr != nil {
-
- if err := m.Tsr.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("tsr")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("tsr")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *Rfc3161V001Schema) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *Rfc3161V001Schema) UnmarshalBinary(b []byte) error {
- var res Rfc3161V001Schema
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// Rfc3161V001SchemaTsr Information about the tsr file associated with the entry
-//
-// swagger:model Rfc3161V001SchemaTsr
-type Rfc3161V001SchemaTsr struct {
-
- // Specifies the tsr file content inline within the document
- // Required: true
- // Format: byte
- Content *strfmt.Base64 `json:"content"`
-}
-
-// Validate validates this rfc3161 v001 schema tsr
-func (m *Rfc3161V001SchemaTsr) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateContent(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *Rfc3161V001SchemaTsr) validateContent(formats strfmt.Registry) error {
-
- if err := validate.Required("tsr"+"."+"content", "body", m.Content); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validates this rfc3161 v001 schema tsr based on context it is used
-func (m *Rfc3161V001SchemaTsr) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *Rfc3161V001SchemaTsr) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *Rfc3161V001SchemaTsr) UnmarshalBinary(b []byte) error {
- var res Rfc3161V001SchemaTsr
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rpm.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rpm.go
deleted file mode 100644
index 8b1f10c77..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rpm.go
+++ /dev/null
@@ -1,210 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "bytes"
- "context"
- "encoding/json"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// Rpm RPM package
-//
-// swagger:model rpm
-type Rpm struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec RpmSchema `json:"spec"`
-}
-
-// Kind gets the kind of this subtype
-func (m *Rpm) Kind() string {
- return "rpm"
-}
-
-// SetKind sets the kind of this subtype
-func (m *Rpm) SetKind(val string) {
-}
-
-// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure
-func (m *Rpm) UnmarshalJSON(raw []byte) error {
- var data struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec RpmSchema `json:"spec"`
- }
- buf := bytes.NewBuffer(raw)
- dec := json.NewDecoder(buf)
- dec.UseNumber()
-
- if err := dec.Decode(&data); err != nil {
- return err
- }
-
- var base struct {
- /* Just the base type fields. Used for unmashalling polymorphic types.*/
-
- Kind string `json:"kind"`
- }
- buf = bytes.NewBuffer(raw)
- dec = json.NewDecoder(buf)
- dec.UseNumber()
-
- if err := dec.Decode(&base); err != nil {
- return err
- }
-
- var result Rpm
-
- if base.Kind != result.Kind() {
- /* Not the type we're looking for. */
- return errors.New(422, "invalid kind value: %q", base.Kind)
- }
-
- result.APIVersion = data.APIVersion
- result.Spec = data.Spec
-
- *m = result
-
- return nil
-}
-
-// MarshalJSON marshals this object with a polymorphic type to a JSON structure
-func (m Rpm) MarshalJSON() ([]byte, error) {
- var b1, b2, b3 []byte
- var err error
- b1, err = json.Marshal(struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec RpmSchema `json:"spec"`
- }{
-
- APIVersion: m.APIVersion,
-
- Spec: m.Spec,
- })
- if err != nil {
- return nil, err
- }
- b2, err = json.Marshal(struct {
- Kind string `json:"kind"`
- }{
-
- Kind: m.Kind(),
- })
- if err != nil {
- return nil, err
- }
-
- return swag.ConcatJSON(b1, b2, b3), nil
-}
-
-// Validate validates this rpm
-func (m *Rpm) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateAPIVersion(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateSpec(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *Rpm) validateAPIVersion(formats strfmt.Registry) error {
-
- if err := validate.Required("apiVersion", "body", m.APIVersion); err != nil {
- return err
- }
-
- if err := validate.Pattern("apiVersion", "body", *m.APIVersion, `^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *Rpm) validateSpec(formats strfmt.Registry) error {
-
- if m.Spec == nil {
- return errors.Required("spec", "body", nil)
- }
-
- return nil
-}
-
-// ContextValidate validate this rpm based on the context it is used
-func (m *Rpm) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *Rpm) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *Rpm) UnmarshalBinary(b []byte) error {
- var res Rpm
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rpm_schema.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rpm_schema.go
deleted file mode 100644
index 5cb378366..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rpm_schema.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-// RpmSchema RPM Schema
-//
-// # Schema for RPM objects
-//
-// swagger:model rpmSchema
-type RpmSchema interface{}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rpm_v001_schema.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rpm_v001_schema.go
deleted file mode 100644
index 394eece41..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/rpm_v001_schema.go
+++ /dev/null
@@ -1,450 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "context"
- "encoding/json"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// RpmV001Schema RPM v0.0.1 Schema
-//
-// # Schema for RPM entries
-//
-// swagger:model rpmV001Schema
-type RpmV001Schema struct {
-
- // package
- // Required: true
- Package *RpmV001SchemaPackage `json:"package"`
-
- // public key
- // Required: true
- PublicKey *RpmV001SchemaPublicKey `json:"publicKey"`
-}
-
-// Validate validates this rpm v001 schema
-func (m *RpmV001Schema) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validatePackage(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validatePublicKey(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *RpmV001Schema) validatePackage(formats strfmt.Registry) error {
-
- if err := validate.Required("package", "body", m.Package); err != nil {
- return err
- }
-
- if m.Package != nil {
- if err := m.Package.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("package")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("package")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *RpmV001Schema) validatePublicKey(formats strfmt.Registry) error {
-
- if err := validate.Required("publicKey", "body", m.PublicKey); err != nil {
- return err
- }
-
- if m.PublicKey != nil {
- if err := m.PublicKey.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("publicKey")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("publicKey")
- }
- return err
- }
- }
-
- return nil
-}
-
-// ContextValidate validate this rpm v001 schema based on the context it is used
-func (m *RpmV001Schema) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidatePackage(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.contextValidatePublicKey(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *RpmV001Schema) contextValidatePackage(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Package != nil {
-
- if err := m.Package.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("package")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("package")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *RpmV001Schema) contextValidatePublicKey(ctx context.Context, formats strfmt.Registry) error {
-
- if m.PublicKey != nil {
-
- if err := m.PublicKey.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("publicKey")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("publicKey")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *RpmV001Schema) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *RpmV001Schema) UnmarshalBinary(b []byte) error {
- var res RpmV001Schema
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// RpmV001SchemaPackage Information about the package associated with the entry
-//
-// swagger:model RpmV001SchemaPackage
-type RpmV001SchemaPackage struct {
-
- // Specifies the package inline within the document
- // Format: byte
- Content strfmt.Base64 `json:"content,omitempty"`
-
- // hash
- Hash *RpmV001SchemaPackageHash `json:"hash,omitempty"`
-
- // Values of the RPM headers
- // Read Only: true
- Headers map[string]string `json:"headers,omitempty"`
-}
-
-// Validate validates this rpm v001 schema package
-func (m *RpmV001SchemaPackage) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateHash(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *RpmV001SchemaPackage) validateHash(formats strfmt.Registry) error {
- if swag.IsZero(m.Hash) { // not required
- return nil
- }
-
- if m.Hash != nil {
- if err := m.Hash.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("package" + "." + "hash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("package" + "." + "hash")
- }
- return err
- }
- }
-
- return nil
-}
-
-// ContextValidate validate this rpm v001 schema package based on the context it is used
-func (m *RpmV001SchemaPackage) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateHash(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.contextValidateHeaders(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *RpmV001SchemaPackage) contextValidateHash(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Hash != nil {
-
- if swag.IsZero(m.Hash) { // not required
- return nil
- }
-
- if err := m.Hash.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("package" + "." + "hash")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("package" + "." + "hash")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *RpmV001SchemaPackage) contextValidateHeaders(ctx context.Context, formats strfmt.Registry) error {
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *RpmV001SchemaPackage) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *RpmV001SchemaPackage) UnmarshalBinary(b []byte) error {
- var res RpmV001SchemaPackage
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// RpmV001SchemaPackageHash Specifies the hash algorithm and value for the package
-//
-// swagger:model RpmV001SchemaPackageHash
-type RpmV001SchemaPackageHash struct {
-
- // The hashing function used to compute the hash value
- // Required: true
- // Enum: ["sha256"]
- Algorithm *string `json:"algorithm"`
-
- // The hash value for the package
- // Required: true
- Value *string `json:"value"`
-}
-
-// Validate validates this rpm v001 schema package hash
-func (m *RpmV001SchemaPackageHash) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateAlgorithm(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateValue(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-var rpmV001SchemaPackageHashTypeAlgorithmPropEnum []interface{}
-
-func init() {
- var res []string
- if err := json.Unmarshal([]byte(`["sha256"]`), &res); err != nil {
- panic(err)
- }
- for _, v := range res {
- rpmV001SchemaPackageHashTypeAlgorithmPropEnum = append(rpmV001SchemaPackageHashTypeAlgorithmPropEnum, v)
- }
-}
-
-const (
-
- // RpmV001SchemaPackageHashAlgorithmSha256 captures enum value "sha256"
- RpmV001SchemaPackageHashAlgorithmSha256 string = "sha256"
-)
-
-// prop value enum
-func (m *RpmV001SchemaPackageHash) validateAlgorithmEnum(path, location string, value string) error {
- if err := validate.EnumCase(path, location, value, rpmV001SchemaPackageHashTypeAlgorithmPropEnum, true); err != nil {
- return err
- }
- return nil
-}
-
-func (m *RpmV001SchemaPackageHash) validateAlgorithm(formats strfmt.Registry) error {
-
- if err := validate.Required("package"+"."+"hash"+"."+"algorithm", "body", m.Algorithm); err != nil {
- return err
- }
-
- // value enum
- if err := m.validateAlgorithmEnum("package"+"."+"hash"+"."+"algorithm", "body", *m.Algorithm); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *RpmV001SchemaPackageHash) validateValue(formats strfmt.Registry) error {
-
- if err := validate.Required("package"+"."+"hash"+"."+"value", "body", m.Value); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validates this rpm v001 schema package hash based on context it is used
-func (m *RpmV001SchemaPackageHash) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *RpmV001SchemaPackageHash) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *RpmV001SchemaPackageHash) UnmarshalBinary(b []byte) error {
- var res RpmV001SchemaPackageHash
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// RpmV001SchemaPublicKey The PGP public key that can verify the RPM signature
-//
-// swagger:model RpmV001SchemaPublicKey
-type RpmV001SchemaPublicKey struct {
-
- // Specifies the content of the public key inline within the document
- // Required: true
- // Format: byte
- Content *strfmt.Base64 `json:"content"`
-}
-
-// Validate validates this rpm v001 schema public key
-func (m *RpmV001SchemaPublicKey) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateContent(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *RpmV001SchemaPublicKey) validateContent(formats strfmt.Registry) error {
-
- if err := validate.Required("publicKey"+"."+"content", "body", m.Content); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validates this rpm v001 schema public key based on context it is used
-func (m *RpmV001SchemaPublicKey) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *RpmV001SchemaPublicKey) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *RpmV001SchemaPublicKey) UnmarshalBinary(b []byte) error {
- var res RpmV001SchemaPublicKey
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/search_index.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/search_index.go
deleted file mode 100644
index 0f66abb5b..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/search_index.go
+++ /dev/null
@@ -1,341 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "context"
- "encoding/json"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// SearchIndex search index
-//
-// swagger:model SearchIndex
-type SearchIndex struct {
-
- // email
- // Format: email
- Email strfmt.Email `json:"email,omitempty"`
-
- // hash
- // Pattern: ^(sha512:)?[0-9a-fA-F]{128}$|^(sha256:)?[0-9a-fA-F]{64}$|^(sha1:)?[0-9a-fA-F]{40}$
- Hash string `json:"hash,omitempty"`
-
- // operator
- // Enum: ["and","or"]
- Operator string `json:"operator,omitempty"`
-
- // public key
- PublicKey *SearchIndexPublicKey `json:"publicKey,omitempty"`
-}
-
-// Validate validates this search index
-func (m *SearchIndex) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateEmail(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateHash(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateOperator(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validatePublicKey(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *SearchIndex) validateEmail(formats strfmt.Registry) error {
- if swag.IsZero(m.Email) { // not required
- return nil
- }
-
- if err := validate.FormatOf("email", "body", "email", m.Email.String(), formats); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *SearchIndex) validateHash(formats strfmt.Registry) error {
- if swag.IsZero(m.Hash) { // not required
- return nil
- }
-
- if err := validate.Pattern("hash", "body", m.Hash, `^(sha512:)?[0-9a-fA-F]{128}$|^(sha256:)?[0-9a-fA-F]{64}$|^(sha1:)?[0-9a-fA-F]{40}$`); err != nil {
- return err
- }
-
- return nil
-}
-
-var searchIndexTypeOperatorPropEnum []interface{}
-
-func init() {
- var res []string
- if err := json.Unmarshal([]byte(`["and","or"]`), &res); err != nil {
- panic(err)
- }
- for _, v := range res {
- searchIndexTypeOperatorPropEnum = append(searchIndexTypeOperatorPropEnum, v)
- }
-}
-
-const (
-
- // SearchIndexOperatorAnd captures enum value "and"
- SearchIndexOperatorAnd string = "and"
-
- // SearchIndexOperatorOr captures enum value "or"
- SearchIndexOperatorOr string = "or"
-)
-
-// prop value enum
-func (m *SearchIndex) validateOperatorEnum(path, location string, value string) error {
- if err := validate.EnumCase(path, location, value, searchIndexTypeOperatorPropEnum, true); err != nil {
- return err
- }
- return nil
-}
-
-func (m *SearchIndex) validateOperator(formats strfmt.Registry) error {
- if swag.IsZero(m.Operator) { // not required
- return nil
- }
-
- // value enum
- if err := m.validateOperatorEnum("operator", "body", m.Operator); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *SearchIndex) validatePublicKey(formats strfmt.Registry) error {
- if swag.IsZero(m.PublicKey) { // not required
- return nil
- }
-
- if m.PublicKey != nil {
- if err := m.PublicKey.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("publicKey")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("publicKey")
- }
- return err
- }
- }
-
- return nil
-}
-
-// ContextValidate validate this search index based on the context it is used
-func (m *SearchIndex) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidatePublicKey(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *SearchIndex) contextValidatePublicKey(ctx context.Context, formats strfmt.Registry) error {
-
- if m.PublicKey != nil {
-
- if swag.IsZero(m.PublicKey) { // not required
- return nil
- }
-
- if err := m.PublicKey.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("publicKey")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("publicKey")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *SearchIndex) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *SearchIndex) UnmarshalBinary(b []byte) error {
- var res SearchIndex
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// SearchIndexPublicKey search index public key
-//
-// swagger:model SearchIndexPublicKey
-type SearchIndexPublicKey struct {
-
- // content
- // Format: byte
- Content strfmt.Base64 `json:"content,omitempty"`
-
- // format
- // Required: true
- // Enum: ["pgp","x509","minisign","ssh","tuf"]
- Format *string `json:"format"`
-
- // url
- // Format: uri
- URL strfmt.URI `json:"url,omitempty"`
-}
-
-// Validate validates this search index public key
-func (m *SearchIndexPublicKey) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateFormat(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateURL(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-var searchIndexPublicKeyTypeFormatPropEnum []interface{}
-
-func init() {
- var res []string
- if err := json.Unmarshal([]byte(`["pgp","x509","minisign","ssh","tuf"]`), &res); err != nil {
- panic(err)
- }
- for _, v := range res {
- searchIndexPublicKeyTypeFormatPropEnum = append(searchIndexPublicKeyTypeFormatPropEnum, v)
- }
-}
-
-const (
-
- // SearchIndexPublicKeyFormatPgp captures enum value "pgp"
- SearchIndexPublicKeyFormatPgp string = "pgp"
-
- // SearchIndexPublicKeyFormatX509 captures enum value "x509"
- SearchIndexPublicKeyFormatX509 string = "x509"
-
- // SearchIndexPublicKeyFormatMinisign captures enum value "minisign"
- SearchIndexPublicKeyFormatMinisign string = "minisign"
-
- // SearchIndexPublicKeyFormatSSH captures enum value "ssh"
- SearchIndexPublicKeyFormatSSH string = "ssh"
-
- // SearchIndexPublicKeyFormatTUF captures enum value "tuf"
- SearchIndexPublicKeyFormatTUF string = "tuf"
-)
-
-// prop value enum
-func (m *SearchIndexPublicKey) validateFormatEnum(path, location string, value string) error {
- if err := validate.EnumCase(path, location, value, searchIndexPublicKeyTypeFormatPropEnum, true); err != nil {
- return err
- }
- return nil
-}
-
-func (m *SearchIndexPublicKey) validateFormat(formats strfmt.Registry) error {
-
- if err := validate.Required("publicKey"+"."+"format", "body", m.Format); err != nil {
- return err
- }
-
- // value enum
- if err := m.validateFormatEnum("publicKey"+"."+"format", "body", *m.Format); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *SearchIndexPublicKey) validateURL(formats strfmt.Registry) error {
- if swag.IsZero(m.URL) { // not required
- return nil
- }
-
- if err := validate.FormatOf("publicKey"+"."+"url", "body", "uri", m.URL.String(), formats); err != nil {
- return err
- }
-
- return nil
-}
-
-// ContextValidate validates this search index public key based on context it is used
-func (m *SearchIndexPublicKey) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *SearchIndexPublicKey) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *SearchIndexPublicKey) UnmarshalBinary(b []byte) error {
- var res SearchIndexPublicKey
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/search_log_query.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/search_log_query.go
deleted file mode 100644
index 425ec8b34..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/search_log_query.go
+++ /dev/null
@@ -1,297 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "bytes"
- "context"
- "encoding/json"
- "io"
- "strconv"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/runtime"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// SearchLogQuery search log query
-//
-// swagger:model SearchLogQuery
-type SearchLogQuery struct {
- entriesField []ProposedEntry
-
- // entry u UI ds
- // Max Items: 10
- // Min Items: 1
- EntryUUIDs []string `json:"entryUUIDs"`
-
- // log indexes
- // Max Items: 10
- // Min Items: 1
- LogIndexes []*int64 `json:"logIndexes"`
-}
-
-// Entries gets the entries of this base type
-func (m *SearchLogQuery) Entries() []ProposedEntry {
- return m.entriesField
-}
-
-// SetEntries sets the entries of this base type
-func (m *SearchLogQuery) SetEntries(val []ProposedEntry) {
- m.entriesField = val
-}
-
-// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure
-func (m *SearchLogQuery) UnmarshalJSON(raw []byte) error {
- var data struct {
- Entries json.RawMessage `json:"entries"`
-
- EntryUUIDs []string `json:"entryUUIDs"`
-
- LogIndexes []*int64 `json:"logIndexes"`
- }
- buf := bytes.NewBuffer(raw)
- dec := json.NewDecoder(buf)
- dec.UseNumber()
-
- if err := dec.Decode(&data); err != nil {
- return err
- }
-
- var propEntries []ProposedEntry
- if string(data.Entries) != "null" {
- entries, err := UnmarshalProposedEntrySlice(bytes.NewBuffer(data.Entries), runtime.JSONConsumer())
- if err != nil && err != io.EOF {
- return err
- }
- propEntries = entries
- }
-
- var result SearchLogQuery
-
- // entries
- result.entriesField = propEntries
-
- // entryUUIDs
- result.EntryUUIDs = data.EntryUUIDs
-
- // logIndexes
- result.LogIndexes = data.LogIndexes
-
- *m = result
-
- return nil
-}
-
-// MarshalJSON marshals this object with a polymorphic type to a JSON structure
-func (m SearchLogQuery) MarshalJSON() ([]byte, error) {
- var b1, b2, b3 []byte
- var err error
- b1, err = json.Marshal(struct {
- EntryUUIDs []string `json:"entryUUIDs"`
-
- LogIndexes []*int64 `json:"logIndexes"`
- }{
-
- EntryUUIDs: m.EntryUUIDs,
-
- LogIndexes: m.LogIndexes,
- })
- if err != nil {
- return nil, err
- }
- b2, err = json.Marshal(struct {
- Entries []ProposedEntry `json:"entries"`
- }{
-
- Entries: m.entriesField,
- })
- if err != nil {
- return nil, err
- }
-
- return swag.ConcatJSON(b1, b2, b3), nil
-}
-
-// Validate validates this search log query
-func (m *SearchLogQuery) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateEntries(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateEntryUUIDs(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateLogIndexes(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *SearchLogQuery) validateEntries(formats strfmt.Registry) error {
- if swag.IsZero(m.Entries()) { // not required
- return nil
- }
-
- iEntriesSize := int64(len(m.Entries()))
-
- if err := validate.MinItems("entries", "body", iEntriesSize, 1); err != nil {
- return err
- }
-
- if err := validate.MaxItems("entries", "body", iEntriesSize, 10); err != nil {
- return err
- }
-
- for i := 0; i < len(m.Entries()); i++ {
-
- if err := m.entriesField[i].Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("entries" + "." + strconv.Itoa(i))
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("entries" + "." + strconv.Itoa(i))
- }
- return err
- }
-
- }
-
- return nil
-}
-
-func (m *SearchLogQuery) validateEntryUUIDs(formats strfmt.Registry) error {
- if swag.IsZero(m.EntryUUIDs) { // not required
- return nil
- }
-
- iEntryUUIDsSize := int64(len(m.EntryUUIDs))
-
- if err := validate.MinItems("entryUUIDs", "body", iEntryUUIDsSize, 1); err != nil {
- return err
- }
-
- if err := validate.MaxItems("entryUUIDs", "body", iEntryUUIDsSize, 10); err != nil {
- return err
- }
-
- for i := 0; i < len(m.EntryUUIDs); i++ {
-
- if err := validate.Pattern("entryUUIDs"+"."+strconv.Itoa(i), "body", m.EntryUUIDs[i], `^([0-9a-fA-F]{64}|[0-9a-fA-F]{80})$`); err != nil {
- return err
- }
-
- }
-
- return nil
-}
-
-func (m *SearchLogQuery) validateLogIndexes(formats strfmt.Registry) error {
- if swag.IsZero(m.LogIndexes) { // not required
- return nil
- }
-
- iLogIndexesSize := int64(len(m.LogIndexes))
-
- if err := validate.MinItems("logIndexes", "body", iLogIndexesSize, 1); err != nil {
- return err
- }
-
- if err := validate.MaxItems("logIndexes", "body", iLogIndexesSize, 10); err != nil {
- return err
- }
-
- for i := 0; i < len(m.LogIndexes); i++ {
- if swag.IsZero(m.LogIndexes[i]) { // not required
- continue
- }
-
- if err := validate.MinimumInt("logIndexes"+"."+strconv.Itoa(i), "body", *m.LogIndexes[i], 0, false); err != nil {
- return err
- }
-
- }
-
- return nil
-}
-
-// ContextValidate validate this search log query based on the context it is used
-func (m *SearchLogQuery) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateEntries(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *SearchLogQuery) contextValidateEntries(ctx context.Context, formats strfmt.Registry) error {
-
- for i := 0; i < len(m.Entries()); i++ {
-
- if swag.IsZero(m.entriesField[i]) { // not required
- return nil
- }
-
- if err := m.entriesField[i].ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("entries" + "." + strconv.Itoa(i))
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("entries" + "." + strconv.Itoa(i))
- }
- return err
- }
-
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *SearchLogQuery) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *SearchLogQuery) UnmarshalBinary(b []byte) error {
- var res SearchLogQuery
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/tuf.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/tuf.go
deleted file mode 100644
index a5f6eff0f..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/tuf.go
+++ /dev/null
@@ -1,210 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "bytes"
- "context"
- "encoding/json"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// TUF TUF metadata
-//
-// swagger:model tuf
-type TUF struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec TUFSchema `json:"spec"`
-}
-
-// Kind gets the kind of this subtype
-func (m *TUF) Kind() string {
- return "tuf"
-}
-
-// SetKind sets the kind of this subtype
-func (m *TUF) SetKind(val string) {
-}
-
-// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure
-func (m *TUF) UnmarshalJSON(raw []byte) error {
- var data struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec TUFSchema `json:"spec"`
- }
- buf := bytes.NewBuffer(raw)
- dec := json.NewDecoder(buf)
- dec.UseNumber()
-
- if err := dec.Decode(&data); err != nil {
- return err
- }
-
- var base struct {
- /* Just the base type fields. Used for unmashalling polymorphic types.*/
-
- Kind string `json:"kind"`
- }
- buf = bytes.NewBuffer(raw)
- dec = json.NewDecoder(buf)
- dec.UseNumber()
-
- if err := dec.Decode(&base); err != nil {
- return err
- }
-
- var result TUF
-
- if base.Kind != result.Kind() {
- /* Not the type we're looking for. */
- return errors.New(422, "invalid kind value: %q", base.Kind)
- }
-
- result.APIVersion = data.APIVersion
- result.Spec = data.Spec
-
- *m = result
-
- return nil
-}
-
-// MarshalJSON marshals this object with a polymorphic type to a JSON structure
-func (m TUF) MarshalJSON() ([]byte, error) {
- var b1, b2, b3 []byte
- var err error
- b1, err = json.Marshal(struct {
-
- // api version
- // Required: true
- // Pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
- APIVersion *string `json:"apiVersion"`
-
- // spec
- // Required: true
- Spec TUFSchema `json:"spec"`
- }{
-
- APIVersion: m.APIVersion,
-
- Spec: m.Spec,
- })
- if err != nil {
- return nil, err
- }
- b2, err = json.Marshal(struct {
- Kind string `json:"kind"`
- }{
-
- Kind: m.Kind(),
- })
- if err != nil {
- return nil, err
- }
-
- return swag.ConcatJSON(b1, b2, b3), nil
-}
-
-// Validate validates this tuf
-func (m *TUF) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateAPIVersion(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateSpec(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *TUF) validateAPIVersion(formats strfmt.Registry) error {
-
- if err := validate.Required("apiVersion", "body", m.APIVersion); err != nil {
- return err
- }
-
- if err := validate.Pattern("apiVersion", "body", *m.APIVersion, `^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *TUF) validateSpec(formats strfmt.Registry) error {
-
- if m.Spec == nil {
- return errors.Required("spec", "body", nil)
- }
-
- return nil
-}
-
-// ContextValidate validate this tuf based on the context it is used
-func (m *TUF) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *TUF) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *TUF) UnmarshalBinary(b []byte) error {
- var res TUF
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/tuf_schema.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/tuf_schema.go
deleted file mode 100644
index 37dca8b68..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/tuf_schema.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-// TUFSchema TUF Schema
-//
-// # Schema for TUF metadata objects
-//
-// swagger:model tufSchema
-type TUFSchema interface{}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/tuf_v001_schema.go b/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/tuf_v001_schema.go
deleted file mode 100644
index 021e0ce7d..000000000
--- a/openshift/default-catalog-consistency/vendor/github.com/sigstore/rekor/pkg/generated/models/tuf_v001_schema.go
+++ /dev/null
@@ -1,304 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-//
-// Copyright 2021 The Sigstore Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "context"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/strfmt"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// TUFV001Schema TUF v0.0.1 Schema
-//
-// # Schema for TUF metadata entries
-//
-// swagger:model tufV001Schema
-type TUFV001Schema struct {
-
- // metadata
- // Required: true
- Metadata *TUFV001SchemaMetadata `json:"metadata"`
-
- // root
- // Required: true
- Root *TUFV001SchemaRoot `json:"root"`
-
- // TUF specification version
- // Read Only: true
- SpecVersion string `json:"spec_version,omitempty"`
-}
-
-// Validate validates this tuf v001 schema
-func (m *TUFV001Schema) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateMetadata(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateRoot(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *TUFV001Schema) validateMetadata(formats strfmt.Registry) error {
-
- if err := validate.Required("metadata", "body", m.Metadata); err != nil {
- return err
- }
-
- if m.Metadata != nil {
- if err := m.Metadata.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("metadata")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("metadata")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *TUFV001Schema) validateRoot(formats strfmt.Registry) error {
-
- if err := validate.Required("root", "body", m.Root); err != nil {
- return err
- }
-
- if m.Root != nil {
- if err := m.Root.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("root")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("root")
- }
- return err
- }
- }
-
- return nil
-}
-
-// ContextValidate validate this tuf v001 schema based on the context it is used
-func (m *TUFV001Schema) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- var res []error
-
- if err := m.contextValidateMetadata(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.contextValidateRoot(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.contextValidateSpecVersion(ctx, formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *TUFV001Schema) contextValidateMetadata(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Metadata != nil {
-
- if err := m.Metadata.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("metadata")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("metadata")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *TUFV001Schema) contextValidateRoot(ctx context.Context, formats strfmt.Registry) error {
-
- if m.Root != nil {
-
- if err := m.Root.ContextValidate(ctx, formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("root")
- } else if ce, ok := err.(*errors.CompositeError); ok {
- return ce.ValidateName("root")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *TUFV001Schema) contextValidateSpecVersion(ctx context.Context, formats strfmt.Registry) error {
-
- if err := validate.ReadOnly(ctx, "spec_version", "body", string(m.SpecVersion)); err != nil {
- return err
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *TUFV001Schema) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *TUFV001Schema) UnmarshalBinary(b []byte) error {
- var res TUFV001Schema
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// TUFV001SchemaMetadata TUF metadata
-//
-// swagger:model TUFV001SchemaMetadata
-type TUFV001SchemaMetadata struct {
-
- // Specifies the metadata inline within the document
- // Required: true
- Content interface{} `json:"content"`
-}
-
-// Validate validates this TUF v001 schema metadata
-func (m *TUFV001SchemaMetadata) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateContent(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *TUFV001SchemaMetadata) validateContent(formats strfmt.Registry) error {
-
- if m.Content == nil {
- return errors.Required("metadata"+"."+"content", "body", nil)
- }
-
- return nil
-}
-
-// ContextValidate validates this TUF v001 schema metadata based on context it is used
-func (m *TUFV001SchemaMetadata) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *TUFV001SchemaMetadata) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *TUFV001SchemaMetadata) UnmarshalBinary(b []byte) error {
- var res TUFV001SchemaMetadata
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
-
-// TUFV001SchemaRoot root metadata containing about the public keys used to sign the manifest
-//
-// swagger:model TUFV001SchemaRoot
-type TUFV001SchemaRoot struct {
-
- // Specifies the metadata inline within the document
- // Required: true
- Content interface{} `json:"content"`
-}
-
-// Validate validates this TUF v001 schema root
-func (m *TUFV001SchemaRoot) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateContent(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *TUFV001SchemaRoot) validateContent(formats strfmt.Registry) error {
-
- if m.Content == nil {
- return errors.Required("root"+"."+"content", "body", nil)
- }
-
- return nil
-}
-
-// ContextValidate validates this TUF v001 schema root based on context it is used
-func (m *TUFV001SchemaRoot) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *TUFV001SchemaRoot) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *TUFV001SchemaRoot) UnmarshalBinary(b []byte) error {
- var res TUFV001SchemaRoot
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/ulikunitz/xz/TODO.md b/openshift/default-catalog-consistency/vendor/github.com/ulikunitz/xz/TODO.md
index c466ffeda..8f9650c13 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/ulikunitz/xz/TODO.md
+++ b/openshift/default-catalog-consistency/vendor/github.com/ulikunitz/xz/TODO.md
@@ -1,9 +1,5 @@
# TODO list
-## Release v0.5.x
-
-1. Support check flag in gxz command.
-
## Release v0.6
1. Review encoder and check for lzma improvements under xz.
@@ -86,6 +82,19 @@
## Log
+## 2025-08-28
+
+Release v0.5.14 addresses the security vulnerability CVE-2025-58058. If you put
+bytes in from of a LZMA stream, the header might not be read correctly and
+memory for the dictionary buffer allocated. I have implemented mitigations for
+the problem.
+
+### 2025-08-20
+
+Release v0.5.13 addressed issue #61 regarding handling of multiple WriteClosers
+together. So I added a new package xio with a WriteCloserStack to address the
+issue.
+
### 2024-04-03
Release v0.5.12 updates README.md and SECURITY.md to address the supply chain
diff --git a/openshift/default-catalog-consistency/vendor/github.com/ulikunitz/xz/lzma/header.go b/openshift/default-catalog-consistency/vendor/github.com/ulikunitz/xz/lzma/header.go
index 1ae7d80ca..34aa097e1 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/ulikunitz/xz/lzma/header.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/ulikunitz/xz/lzma/header.go
@@ -60,36 +60,36 @@ const noHeaderSize uint64 = 1<<64 - 1
// HeaderLen provides the length of the LZMA file header.
const HeaderLen = 13
-// header represents the header of an LZMA file.
-type header struct {
- properties Properties
- dictCap int
- // uncompressed size; negative value if no size is given
- size int64
+// Header represents the Header of an LZMA file.
+type Header struct {
+ Properties Properties
+ DictSize uint32
+ // uncompressed Size; negative value if no Size is given
+ Size int64
}
// marshalBinary marshals the header.
-func (h *header) marshalBinary() (data []byte, err error) {
- if err = h.properties.verify(); err != nil {
+func (h *Header) marshalBinary() (data []byte, err error) {
+ if err = h.Properties.verify(); err != nil {
return nil, err
}
- if !(0 <= h.dictCap && int64(h.dictCap) <= MaxDictCap) {
+ if !(h.DictSize <= MaxDictCap) {
return nil, fmt.Errorf("lzma: DictCap %d out of range",
- h.dictCap)
+ h.DictSize)
}
data = make([]byte, 13)
// property byte
- data[0] = h.properties.Code()
+ data[0] = h.Properties.Code()
// dictionary capacity
- putUint32LE(data[1:5], uint32(h.dictCap))
+ putUint32LE(data[1:5], uint32(h.DictSize))
// uncompressed size
var s uint64
- if h.size > 0 {
- s = uint64(h.size)
+ if h.Size > 0 {
+ s = uint64(h.Size)
} else {
s = noHeaderSize
}
@@ -99,20 +99,20 @@ func (h *header) marshalBinary() (data []byte, err error) {
}
// unmarshalBinary unmarshals the header.
-func (h *header) unmarshalBinary(data []byte) error {
+func (h *Header) unmarshalBinary(data []byte) error {
if len(data) != HeaderLen {
return errors.New("lzma.unmarshalBinary: data has wrong length")
}
// properties
var err error
- if h.properties, err = PropertiesForCode(data[0]); err != nil {
+ if h.Properties, err = PropertiesForCode(data[0]); err != nil {
return err
}
// dictionary capacity
- h.dictCap = int(uint32LE(data[1:]))
- if h.dictCap < 0 {
+ h.DictSize = uint32LE(data[1:])
+ if int(h.DictSize) < 0 {
return errors.New(
"LZMA header: dictionary capacity exceeds maximum " +
"integer")
@@ -121,10 +121,10 @@ func (h *header) unmarshalBinary(data []byte) error {
// uncompressed size
s := uint64LE(data[5:])
if s == noHeaderSize {
- h.size = -1
+ h.Size = -1
} else {
- h.size = int64(s)
- if h.size < 0 {
+ h.Size = int64(s)
+ if h.Size < 0 {
return errors.New(
"LZMA header: uncompressed size " +
"out of int64 range")
@@ -134,9 +134,9 @@ func (h *header) unmarshalBinary(data []byte) error {
return nil
}
-// validDictCap checks whether the dictionary capacity is correct. This
+// validDictSize checks whether the dictionary capacity is correct. This
// is used to weed out wrong file headers.
-func validDictCap(dictcap int) bool {
+func validDictSize(dictcap int) bool {
if int64(dictcap) == MaxDictCap {
return true
}
@@ -155,13 +155,16 @@ func validDictCap(dictcap int) bool {
// dictionary sizes of 2^n or 2^n+2^(n-1) with n >= 10 or 2^32-1. If
// there is an explicit size it must not exceed 256 GiB. The length of
// the data argument must be HeaderLen.
+//
+// This function should be disregarded because there is no guarantee that LZMA
+// files follow the constraints.
func ValidHeader(data []byte) bool {
- var h header
+ var h Header
if err := h.unmarshalBinary(data); err != nil {
return false
}
- if !validDictCap(h.dictCap) {
+ if !validDictSize(int(h.DictSize)) {
return false
}
- return h.size < 0 || h.size <= 1<<38
+ return h.Size < 0 || h.Size <= 1<<38
}
diff --git a/openshift/default-catalog-consistency/vendor/github.com/ulikunitz/xz/lzma/reader.go b/openshift/default-catalog-consistency/vendor/github.com/ulikunitz/xz/lzma/reader.go
index ae911c389..b656c2618 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/ulikunitz/xz/lzma/reader.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/ulikunitz/xz/lzma/reader.go
@@ -6,25 +6,32 @@
// Reader and Writer support the classic LZMA format. Reader2 and
// Writer2 support the decoding and encoding of LZMA2 streams.
//
-// The package is written completely in Go and doesn't rely on any external
+// The package is written completely in Go and does not rely on any external
// library.
package lzma
import (
"errors"
+ "fmt"
"io"
)
// ReaderConfig stores the parameters for the reader of the classic LZMA
// format.
type ReaderConfig struct {
+ // Since v0.5.14 this parameter sets an upper limit for a .lzma file's
+ // dictionary size. This helps to mitigate problems with mangled
+ // headers.
DictCap int
}
// fill converts the zero values of the configuration to the default values.
func (c *ReaderConfig) fill() {
if c.DictCap == 0 {
- c.DictCap = 8 * 1024 * 1024
+ // set an upper limit of 2 GB for dictionary capacity to address
+ // the zero prefix security issue.
+ c.DictCap = 1 << 31
+ // original: c.DictCap = 8 * 1024 * 1024
}
}
@@ -39,10 +46,33 @@ func (c *ReaderConfig) Verify() error {
}
// Reader provides a reader for LZMA files or streams.
+//
+// # Security concerns
+//
+// Note that LZMA format doesn't support a magic marker in the header. So
+// [NewReader] cannot determine whether it reads the actual header. For instance
+// the LZMA stream might have a zero byte in front of the reader, leading to
+// larger dictionary sizes and file sizes. The code will detect later that there
+// are problems with the stream, but the dictionary has already been allocated
+// and this might consume a lot of memory.
+//
+// Version 0.5.14 introduces built-in mitigations:
+//
+// - The [ReaderConfig] DictCap field is now interpreted as a limit for the
+// dictionary size.
+// - The default is 2 Gigabytes (2^31 bytes).
+// - Users can check with the [Reader.Header] method what the actual values are in
+// their LZMA files and set a smaller limit using [ReaderConfig].
+// - The dictionary size doesn't exceed the larger of the file size and
+// the minimum dictionary size. This is another measure to prevent huge
+// memory allocations for the dictionary.
+// - The code supports stream sizes only up to a pebibyte (1024^5).
type Reader struct {
- lzma io.Reader
- h header
- d *decoder
+ lzma io.Reader
+ header Header
+ // headerOrig stores the original header read from the stream.
+ headerOrig Header
+ d *decoder
}
// NewReader creates a new reader for an LZMA stream using the classic
@@ -51,8 +81,37 @@ func NewReader(lzma io.Reader) (r *Reader, err error) {
return ReaderConfig{}.NewReader(lzma)
}
+// ErrDictSize reports about an error of the dictionary size.
+type ErrDictSize struct {
+ ConfigDictCap int
+ HeaderDictSize uint32
+ Message string
+}
+
+// Error returns the error message.
+func (e *ErrDictSize) Error() string {
+ return e.Message
+}
+
+func newErrDictSize(messageformat string,
+ configDictCap int, headerDictSize uint32,
+ args ...interface{}) *ErrDictSize {
+ newArgs := make([]interface{}, len(args)+2)
+ newArgs[0] = configDictCap
+ newArgs[1] = headerDictSize
+ copy(newArgs[2:], args)
+ return &ErrDictSize{
+ ConfigDictCap: configDictCap,
+ HeaderDictSize: headerDictSize,
+ Message: fmt.Sprintf(messageformat, newArgs...),
+ }
+}
+
+// We support only files not larger than 1 << 50 bytes (a pebibyte, 1024^5).
+const maxStreamSize = 1 << 50
+
// NewReader creates a new reader for an LZMA stream in the classic
-// format. The function reads and verifies the the header of the LZMA
+// format. The function reads and verifies the header of the LZMA
// stream.
func (c ReaderConfig) NewReader(lzma io.Reader) (r *Reader, err error) {
if err = c.Verify(); err != nil {
@@ -66,29 +125,63 @@ func (c ReaderConfig) NewReader(lzma io.Reader) (r *Reader, err error) {
return nil, err
}
r = &Reader{lzma: lzma}
- if err = r.h.unmarshalBinary(data); err != nil {
+ if err = r.header.unmarshalBinary(data); err != nil {
return nil, err
}
- if r.h.dictCap < MinDictCap {
- r.h.dictCap = MinDictCap
+ r.headerOrig = r.header
+ dictSize := int64(r.header.DictSize)
+ if int64(c.DictCap) < dictSize {
+ return nil, newErrDictSize(
+ "lzma: header dictionary size %[2]d exceeds configured dictionary capacity %[1]d",
+ c.DictCap, uint32(dictSize),
+ )
+ }
+ if dictSize < MinDictCap {
+ dictSize = MinDictCap
+ }
+ // original code: disabled this because there is no point in increasing
+ // the dictionary above what is stated in the file.
+ /*
+ if int64(c.DictCap) > int64(dictSize) {
+ dictSize = int64(c.DictCap)
+ }
+ */
+ size := r.header.Size
+ if size >= 0 && size < dictSize {
+ dictSize = size
}
- dictCap := r.h.dictCap
- if c.DictCap > dictCap {
- dictCap = c.DictCap
+ // Protect against modified or malicious headers.
+ if size > maxStreamSize {
+ return nil, fmt.Errorf(
+ "lzma: stream size %d exceeds a pebibyte (1024^5)",
+ size)
}
+ if dictSize < MinDictCap {
+ dictSize = MinDictCap
+ }
+
+ r.header.DictSize = uint32(dictSize)
- state := newState(r.h.properties)
- dict, err := newDecoderDict(dictCap)
+ state := newState(r.header.Properties)
+ dict, err := newDecoderDict(int(dictSize))
if err != nil {
return nil, err
}
- r.d, err = newDecoder(ByteReader(lzma), state, dict, r.h.size)
+ r.d, err = newDecoder(ByteReader(lzma), state, dict, r.header.Size)
if err != nil {
return nil, err
}
return r, nil
}
+// Header returns the header as read from the LZMA stream. It is intended to
+// allow the user to understand what parameters are typically provided in the
+// headers of the LZMA files and set the DictCap field in [ReaderConfig]
+// accordingly.
+func (r *Reader) Header() (h Header, ok bool) {
+ return r.headerOrig, r.d != nil
+}
+
// EOSMarker indicates that an EOS marker has been encountered.
func (r *Reader) EOSMarker() bool {
return r.d.eosMarker
diff --git a/openshift/default-catalog-consistency/vendor/github.com/ulikunitz/xz/lzma/writer.go b/openshift/default-catalog-consistency/vendor/github.com/ulikunitz/xz/lzma/writer.go
index e8f89811d..f73bb73f2 100644
--- a/openshift/default-catalog-consistency/vendor/github.com/ulikunitz/xz/lzma/writer.go
+++ b/openshift/default-catalog-consistency/vendor/github.com/ulikunitz/xz/lzma/writer.go
@@ -96,21 +96,21 @@ func (c *WriterConfig) Verify() error {
}
// header returns the header structure for this configuration.
-func (c *WriterConfig) header() header {
- h := header{
- properties: *c.Properties,
- dictCap: c.DictCap,
- size: -1,
+func (c *WriterConfig) header() Header {
+ h := Header{
+ Properties: *c.Properties,
+ DictSize: uint32(c.DictCap),
+ Size: -1,
}
if c.SizeInHeader {
- h.size = c.Size
+ h.Size = c.Size
}
return h
}
// Writer writes an LZMA stream in the classic format.
type Writer struct {
- h header
+ h Header
bw io.ByteWriter
buf *bufio.Writer
e *encoder
@@ -130,12 +130,12 @@ func (c WriterConfig) NewWriter(lzma io.Writer) (w *Writer, err error) {
w.buf = bufio.NewWriter(lzma)
w.bw = w.buf
}
- state := newState(w.h.properties)
- m, err := c.Matcher.new(w.h.dictCap)
+ state := newState(w.h.Properties)
+ m, err := c.Matcher.new(int(w.h.DictSize))
if err != nil {
return nil, err
}
- dict, err := newEncoderDict(w.h.dictCap, c.BufSize, m)
+ dict, err := newEncoderDict(int(w.h.DictSize), c.BufSize, m)
if err != nil {
return nil, err
}
@@ -171,8 +171,8 @@ func (w *Writer) writeHeader() error {
// Write puts data into the Writer.
func (w *Writer) Write(p []byte) (n int, err error) {
- if w.h.size >= 0 {
- m := w.h.size
+ if w.h.Size >= 0 {
+ m := w.h.Size
m -= w.e.Compressed() + int64(w.e.dict.Buffered())
if m < 0 {
m = 0
@@ -192,9 +192,9 @@ func (w *Writer) Write(p []byte) (n int, err error) {
// Close closes the writer stream. It ensures that all data from the
// buffer will be compressed and the LZMA stream will be finished.
func (w *Writer) Close() error {
- if w.h.size >= 0 {
+ if w.h.Size >= 0 {
n := w.e.Compressed() + int64(w.e.dict.Buffered())
- if n != w.h.size {
+ if n != w.h.Size {
return errSize
}
}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/LICENSE b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/LICENSE
deleted file mode 100644
index 261eeb9e9..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bson.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bson.go
deleted file mode 100644
index a0d818582..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bson.go
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-//
-// Based on gopkg.in/mgo.v2/bson by Gustavo Niemeyer
-// See THIRD-PARTY-NOTICES for original license terms.
-
-package bson // import "go.mongodb.org/mongo-driver/bson"
-
-import (
- "go.mongodb.org/mongo-driver/bson/primitive"
-)
-
-// Zeroer allows custom struct types to implement a report of zero
-// state. All struct types that don't implement Zeroer or where IsZero
-// returns false are considered to be not zero.
-type Zeroer interface {
- IsZero() bool
-}
-
-// D is an ordered representation of a BSON document. This type should be used when the order of the elements matters,
-// such as MongoDB command documents. If the order of the elements does not matter, an M should be used instead.
-//
-// A D should not be constructed with duplicate key names, as that can cause undefined server behavior.
-//
-// Example usage:
-//
-// bson.D{{"foo", "bar"}, {"hello", "world"}, {"pi", 3.14159}}
-type D = primitive.D
-
-// E represents a BSON element for a D. It is usually used inside a D.
-type E = primitive.E
-
-// M is an unordered representation of a BSON document. This type should be used when the order of the elements does not
-// matter. This type is handled as a regular map[string]interface{} when encoding and decoding. Elements will be
-// serialized in an undefined, random order. If the order of the elements matters, a D should be used instead.
-//
-// Example usage:
-//
-// bson.M{"foo": "bar", "hello": "world", "pi": 3.14159}
-type M = primitive.M
-
-// An A is an ordered representation of a BSON array.
-//
-// Example usage:
-//
-// bson.A{"bar", "world", 3.14159, bson.D{{"qux", 12345}}}
-type A = primitive.A
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/array_codec.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/array_codec.go
deleted file mode 100644
index 652aa48b8..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/array_codec.go
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsoncodec
-
-import (
- "reflect"
-
- "go.mongodb.org/mongo-driver/bson/bsonrw"
- "go.mongodb.org/mongo-driver/x/bsonx/bsoncore"
-)
-
-// ArrayCodec is the Codec used for bsoncore.Array values.
-//
-// Deprecated: ArrayCodec will not be directly accessible in Go Driver 2.0.
-type ArrayCodec struct{}
-
-var defaultArrayCodec = NewArrayCodec()
-
-// NewArrayCodec returns an ArrayCodec.
-//
-// Deprecated: NewArrayCodec will not be available in Go Driver 2.0. See
-// [ArrayCodec] for more details.
-func NewArrayCodec() *ArrayCodec {
- return &ArrayCodec{}
-}
-
-// EncodeValue is the ValueEncoder for bsoncore.Array values.
-func (ac *ArrayCodec) EncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Type() != tCoreArray {
- return ValueEncoderError{Name: "CoreArrayEncodeValue", Types: []reflect.Type{tCoreArray}, Received: val}
- }
-
- arr := val.Interface().(bsoncore.Array)
- return bsonrw.Copier{}.CopyArrayFromBytes(vw, arr)
-}
-
-// DecodeValue is the ValueDecoder for bsoncore.Array values.
-func (ac *ArrayCodec) DecodeValue(_ DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Type() != tCoreArray {
- return ValueDecoderError{Name: "CoreArrayDecodeValue", Types: []reflect.Type{tCoreArray}, Received: val}
- }
-
- if val.IsNil() {
- val.Set(reflect.MakeSlice(val.Type(), 0, 0))
- }
-
- val.SetLen(0)
- arr, err := bsonrw.Copier{}.AppendArrayBytes(val.Interface().(bsoncore.Array), vr)
- val.Set(reflect.ValueOf(arr))
- return err
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/bsoncodec.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/bsoncodec.go
deleted file mode 100644
index 0693bd432..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/bsoncodec.go
+++ /dev/null
@@ -1,382 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsoncodec // import "go.mongodb.org/mongo-driver/bson/bsoncodec"
-
-import (
- "fmt"
- "reflect"
- "strings"
-
- "go.mongodb.org/mongo-driver/bson/bsonrw"
- "go.mongodb.org/mongo-driver/bson/bsontype"
- "go.mongodb.org/mongo-driver/bson/primitive"
-)
-
-var (
- emptyValue = reflect.Value{}
-)
-
-// Marshaler is an interface implemented by types that can marshal themselves
-// into a BSON document represented as bytes. The bytes returned must be a valid
-// BSON document if the error is nil.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Marshaler] instead.
-type Marshaler interface {
- MarshalBSON() ([]byte, error)
-}
-
-// ValueMarshaler is an interface implemented by types that can marshal
-// themselves into a BSON value as bytes. The type must be the valid type for
-// the bytes returned. The bytes and byte type together must be valid if the
-// error is nil.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.ValueMarshaler] instead.
-type ValueMarshaler interface {
- MarshalBSONValue() (bsontype.Type, []byte, error)
-}
-
-// Unmarshaler is an interface implemented by types that can unmarshal a BSON
-// document representation of themselves. The BSON bytes can be assumed to be
-// valid. UnmarshalBSON must copy the BSON bytes if it wishes to retain the data
-// after returning.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Unmarshaler] instead.
-type Unmarshaler interface {
- UnmarshalBSON([]byte) error
-}
-
-// ValueUnmarshaler is an interface implemented by types that can unmarshal a
-// BSON value representation of themselves. The BSON bytes and type can be
-// assumed to be valid. UnmarshalBSONValue must copy the BSON value bytes if it
-// wishes to retain the data after returning.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.ValueUnmarshaler] instead.
-type ValueUnmarshaler interface {
- UnmarshalBSONValue(bsontype.Type, []byte) error
-}
-
-// ValueEncoderError is an error returned from a ValueEncoder when the provided value can't be
-// encoded by the ValueEncoder.
-type ValueEncoderError struct {
- Name string
- Types []reflect.Type
- Kinds []reflect.Kind
- Received reflect.Value
-}
-
-func (vee ValueEncoderError) Error() string {
- typeKinds := make([]string, 0, len(vee.Types)+len(vee.Kinds))
- for _, t := range vee.Types {
- typeKinds = append(typeKinds, t.String())
- }
- for _, k := range vee.Kinds {
- if k == reflect.Map {
- typeKinds = append(typeKinds, "map[string]*")
- continue
- }
- typeKinds = append(typeKinds, k.String())
- }
- received := vee.Received.Kind().String()
- if vee.Received.IsValid() {
- received = vee.Received.Type().String()
- }
- return fmt.Sprintf("%s can only encode valid %s, but got %s", vee.Name, strings.Join(typeKinds, ", "), received)
-}
-
-// ValueDecoderError is an error returned from a ValueDecoder when the provided value can't be
-// decoded by the ValueDecoder.
-type ValueDecoderError struct {
- Name string
- Types []reflect.Type
- Kinds []reflect.Kind
- Received reflect.Value
-}
-
-func (vde ValueDecoderError) Error() string {
- typeKinds := make([]string, 0, len(vde.Types)+len(vde.Kinds))
- for _, t := range vde.Types {
- typeKinds = append(typeKinds, t.String())
- }
- for _, k := range vde.Kinds {
- if k == reflect.Map {
- typeKinds = append(typeKinds, "map[string]*")
- continue
- }
- typeKinds = append(typeKinds, k.String())
- }
- received := vde.Received.Kind().String()
- if vde.Received.IsValid() {
- received = vde.Received.Type().String()
- }
- return fmt.Sprintf("%s can only decode valid and settable %s, but got %s", vde.Name, strings.Join(typeKinds, ", "), received)
-}
-
-// EncodeContext is the contextual information required for a Codec to encode a
-// value.
-type EncodeContext struct {
- *Registry
-
- // MinSize causes the Encoder to marshal Go integer values (int, int8, int16, int32, int64,
- // uint, uint8, uint16, uint32, or uint64) as the minimum BSON int size (either 32 or 64 bits)
- // that can represent the integer value.
- //
- // Deprecated: Use bson.Encoder.IntMinSize instead.
- MinSize bool
-
- errorOnInlineDuplicates bool
- stringifyMapKeysWithFmt bool
- nilMapAsEmpty bool
- nilSliceAsEmpty bool
- nilByteSliceAsEmpty bool
- omitZeroStruct bool
- useJSONStructTags bool
-}
-
-// ErrorOnInlineDuplicates causes the Encoder to return an error if there is a duplicate field in
-// the marshaled BSON when the "inline" struct tag option is set.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.ErrorOnInlineDuplicates] instead.
-func (ec *EncodeContext) ErrorOnInlineDuplicates() {
- ec.errorOnInlineDuplicates = true
-}
-
-// StringifyMapKeysWithFmt causes the Encoder to convert Go map keys to BSON document field name
-// strings using fmt.Sprintf() instead of the default string conversion logic.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.StringifyMapKeysWithFmt] instead.
-func (ec *EncodeContext) StringifyMapKeysWithFmt() {
- ec.stringifyMapKeysWithFmt = true
-}
-
-// NilMapAsEmpty causes the Encoder to marshal nil Go maps as empty BSON documents instead of BSON
-// null.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.NilMapAsEmpty] instead.
-func (ec *EncodeContext) NilMapAsEmpty() {
- ec.nilMapAsEmpty = true
-}
-
-// NilSliceAsEmpty causes the Encoder to marshal nil Go slices as empty BSON arrays instead of BSON
-// null.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.NilSliceAsEmpty] instead.
-func (ec *EncodeContext) NilSliceAsEmpty() {
- ec.nilSliceAsEmpty = true
-}
-
-// NilByteSliceAsEmpty causes the Encoder to marshal nil Go byte slices as empty BSON binary values
-// instead of BSON null.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.NilByteSliceAsEmpty] instead.
-func (ec *EncodeContext) NilByteSliceAsEmpty() {
- ec.nilByteSliceAsEmpty = true
-}
-
-// OmitZeroStruct causes the Encoder to consider the zero value for a struct (e.g. MyStruct{})
-// as empty and omit it from the marshaled BSON when the "omitempty" struct tag option is set.
-//
-// Note that the Encoder only examines exported struct fields when determining if a struct is the
-// zero value. It considers pointers to a zero struct value (e.g. &MyStruct{}) not empty.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.OmitZeroStruct] instead.
-func (ec *EncodeContext) OmitZeroStruct() {
- ec.omitZeroStruct = true
-}
-
-// UseJSONStructTags causes the Encoder to fall back to using the "json" struct tag if a "bson"
-// struct tag is not specified.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.UseJSONStructTags] instead.
-func (ec *EncodeContext) UseJSONStructTags() {
- ec.useJSONStructTags = true
-}
-
-// DecodeContext is the contextual information required for a Codec to decode a
-// value.
-type DecodeContext struct {
- *Registry
-
- // Truncate, if true, instructs decoders to to truncate the fractional part of BSON "double"
- // values when attempting to unmarshal them into a Go integer (int, int8, int16, int32, int64,
- // uint, uint8, uint16, uint32, or uint64) struct field. The truncation logic does not apply to
- // BSON "decimal128" values.
- //
- // Deprecated: Use bson.Decoder.AllowTruncatingDoubles instead.
- Truncate bool
-
- // Ancestor is the type of a containing document. This is mainly used to determine what type
- // should be used when decoding an embedded document into an empty interface. For example, if
- // Ancestor is a bson.M, BSON embedded document values being decoded into an empty interface
- // will be decoded into a bson.M.
- //
- // Deprecated: Use bson.Decoder.DefaultDocumentM or bson.Decoder.DefaultDocumentD instead.
- Ancestor reflect.Type
-
- // defaultDocumentType specifies the Go type to decode top-level and nested BSON documents into. In particular, the
- // usage for this field is restricted to data typed as "interface{}" or "map[string]interface{}". If DocumentType is
- // set to a type that a BSON document cannot be unmarshaled into (e.g. "string"), unmarshalling will result in an
- // error. DocumentType overrides the Ancestor field.
- defaultDocumentType reflect.Type
-
- binaryAsSlice bool
- useJSONStructTags bool
- useLocalTimeZone bool
- zeroMaps bool
- zeroStructs bool
-}
-
-// BinaryAsSlice causes the Decoder to unmarshal BSON binary field values that are the "Generic" or
-// "Old" BSON binary subtype as a Go byte slice instead of a primitive.Binary.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Decoder.BinaryAsSlice] instead.
-func (dc *DecodeContext) BinaryAsSlice() {
- dc.binaryAsSlice = true
-}
-
-// UseJSONStructTags causes the Decoder to fall back to using the "json" struct tag if a "bson"
-// struct tag is not specified.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Decoder.UseJSONStructTags] instead.
-func (dc *DecodeContext) UseJSONStructTags() {
- dc.useJSONStructTags = true
-}
-
-// UseLocalTimeZone causes the Decoder to unmarshal time.Time values in the local timezone instead
-// of the UTC timezone.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Decoder.UseLocalTimeZone] instead.
-func (dc *DecodeContext) UseLocalTimeZone() {
- dc.useLocalTimeZone = true
-}
-
-// ZeroMaps causes the Decoder to delete any existing values from Go maps in the destination value
-// passed to Decode before unmarshaling BSON documents into them.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Decoder.ZeroMaps] instead.
-func (dc *DecodeContext) ZeroMaps() {
- dc.zeroMaps = true
-}
-
-// ZeroStructs causes the Decoder to delete any existing values from Go structs in the destination
-// value passed to Decode before unmarshaling BSON documents into them.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Decoder.ZeroStructs] instead.
-func (dc *DecodeContext) ZeroStructs() {
- dc.zeroStructs = true
-}
-
-// DefaultDocumentM causes the Decoder to always unmarshal documents into the primitive.M type. This
-// behavior is restricted to data typed as "interface{}" or "map[string]interface{}".
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Decoder.DefaultDocumentM] instead.
-func (dc *DecodeContext) DefaultDocumentM() {
- dc.defaultDocumentType = reflect.TypeOf(primitive.M{})
-}
-
-// DefaultDocumentD causes the Decoder to always unmarshal documents into the primitive.D type. This
-// behavior is restricted to data typed as "interface{}" or "map[string]interface{}".
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Decoder.DefaultDocumentD] instead.
-func (dc *DecodeContext) DefaultDocumentD() {
- dc.defaultDocumentType = reflect.TypeOf(primitive.D{})
-}
-
-// ValueCodec is an interface for encoding and decoding a reflect.Value.
-// values.
-//
-// Deprecated: Use [ValueEncoder] and [ValueDecoder] instead.
-type ValueCodec interface {
- ValueEncoder
- ValueDecoder
-}
-
-// ValueEncoder is the interface implemented by types that can handle the encoding of a value.
-type ValueEncoder interface {
- EncodeValue(EncodeContext, bsonrw.ValueWriter, reflect.Value) error
-}
-
-// ValueEncoderFunc is an adapter function that allows a function with the correct signature to be
-// used as a ValueEncoder.
-type ValueEncoderFunc func(EncodeContext, bsonrw.ValueWriter, reflect.Value) error
-
-// EncodeValue implements the ValueEncoder interface.
-func (fn ValueEncoderFunc) EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- return fn(ec, vw, val)
-}
-
-// ValueDecoder is the interface implemented by types that can handle the decoding of a value.
-type ValueDecoder interface {
- DecodeValue(DecodeContext, bsonrw.ValueReader, reflect.Value) error
-}
-
-// ValueDecoderFunc is an adapter function that allows a function with the correct signature to be
-// used as a ValueDecoder.
-type ValueDecoderFunc func(DecodeContext, bsonrw.ValueReader, reflect.Value) error
-
-// DecodeValue implements the ValueDecoder interface.
-func (fn ValueDecoderFunc) DecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- return fn(dc, vr, val)
-}
-
-// typeDecoder is the interface implemented by types that can handle the decoding of a value given its type.
-type typeDecoder interface {
- decodeType(DecodeContext, bsonrw.ValueReader, reflect.Type) (reflect.Value, error)
-}
-
-// typeDecoderFunc is an adapter function that allows a function with the correct signature to be used as a typeDecoder.
-type typeDecoderFunc func(DecodeContext, bsonrw.ValueReader, reflect.Type) (reflect.Value, error)
-
-func (fn typeDecoderFunc) decodeType(dc DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) {
- return fn(dc, vr, t)
-}
-
-// decodeAdapter allows two functions with the correct signatures to be used as both a ValueDecoder and typeDecoder.
-type decodeAdapter struct {
- ValueDecoderFunc
- typeDecoderFunc
-}
-
-var _ ValueDecoder = decodeAdapter{}
-var _ typeDecoder = decodeAdapter{}
-
-// decodeTypeOrValue calls decoder.decodeType is decoder is a typeDecoder. Otherwise, it allocates a new element of type
-// t and calls decoder.DecodeValue on it.
-func decodeTypeOrValue(decoder ValueDecoder, dc DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) {
- td, _ := decoder.(typeDecoder)
- return decodeTypeOrValueWithInfo(decoder, td, dc, vr, t, true)
-}
-
-func decodeTypeOrValueWithInfo(vd ValueDecoder, td typeDecoder, dc DecodeContext, vr bsonrw.ValueReader, t reflect.Type, convert bool) (reflect.Value, error) {
- if td != nil {
- val, err := td.decodeType(dc, vr, t)
- if err == nil && convert && val.Type() != t {
- // This conversion step is necessary for slices and maps. If a user declares variables like:
- //
- // type myBool bool
- // var m map[string]myBool
- //
- // and tries to decode BSON bytes into the map, the decoding will fail if this conversion is not present
- // because we'll try to assign a value of type bool to one of type myBool.
- val = val.Convert(t)
- }
- return val, err
- }
-
- val := reflect.New(t).Elem()
- err := vd.DecodeValue(dc, vr, val)
- return val, err
-}
-
-// CodecZeroer is the interface implemented by Codecs that can also determine if
-// a value of the type that would be encoded is zero.
-//
-// Deprecated: Defining custom rules for the zero/empty value will not be supported in Go Driver
-// 2.0. Users who want to omit empty complex values should use a pointer field and set the value to
-// nil instead.
-type CodecZeroer interface {
- IsTypeZero(interface{}) bool
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/byte_slice_codec.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/byte_slice_codec.go
deleted file mode 100644
index 0134b5a94..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/byte_slice_codec.go
+++ /dev/null
@@ -1,138 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsoncodec
-
-import (
- "fmt"
- "reflect"
-
- "go.mongodb.org/mongo-driver/bson/bsonoptions"
- "go.mongodb.org/mongo-driver/bson/bsonrw"
- "go.mongodb.org/mongo-driver/bson/bsontype"
-)
-
-// ByteSliceCodec is the Codec used for []byte values.
-//
-// Deprecated: ByteSliceCodec will not be directly configurable in Go Driver
-// 2.0. To configure the byte slice encode and decode behavior, use the
-// configuration methods on a [go.mongodb.org/mongo-driver/bson.Encoder] or
-// [go.mongodb.org/mongo-driver/bson.Decoder]. To configure the byte slice
-// encode and decode behavior for a mongo.Client, use
-// [go.mongodb.org/mongo-driver/mongo/options.ClientOptions.SetBSONOptions].
-//
-// For example, to configure a mongo.Client to encode nil byte slices as empty
-// BSON binary values, use:
-//
-// opt := options.Client().SetBSONOptions(&options.BSONOptions{
-// NilByteSliceAsEmpty: true,
-// })
-//
-// See the deprecation notice for each field in ByteSliceCodec for the
-// corresponding settings.
-type ByteSliceCodec struct {
- // EncodeNilAsEmpty causes EncodeValue to marshal nil Go byte slices as empty BSON binary values
- // instead of BSON null.
- //
- // Deprecated: Use bson.Encoder.NilByteSliceAsEmpty or options.BSONOptions.NilByteSliceAsEmpty
- // instead.
- EncodeNilAsEmpty bool
-}
-
-var (
- defaultByteSliceCodec = NewByteSliceCodec()
-
- // Assert that defaultByteSliceCodec satisfies the typeDecoder interface, which allows it to be
- // used by collection type decoders (e.g. map, slice, etc) to set individual values in a
- // collection.
- _ typeDecoder = defaultByteSliceCodec
-)
-
-// NewByteSliceCodec returns a ByteSliceCodec with options opts.
-//
-// Deprecated: NewByteSliceCodec will not be available in Go Driver 2.0. See
-// [ByteSliceCodec] for more details.
-func NewByteSliceCodec(opts ...*bsonoptions.ByteSliceCodecOptions) *ByteSliceCodec {
- byteSliceOpt := bsonoptions.MergeByteSliceCodecOptions(opts...)
- codec := ByteSliceCodec{}
- if byteSliceOpt.EncodeNilAsEmpty != nil {
- codec.EncodeNilAsEmpty = *byteSliceOpt.EncodeNilAsEmpty
- }
- return &codec
-}
-
-// EncodeValue is the ValueEncoder for []byte.
-func (bsc *ByteSliceCodec) EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Type() != tByteSlice {
- return ValueEncoderError{Name: "ByteSliceEncodeValue", Types: []reflect.Type{tByteSlice}, Received: val}
- }
- if val.IsNil() && !bsc.EncodeNilAsEmpty && !ec.nilByteSliceAsEmpty {
- return vw.WriteNull()
- }
- return vw.WriteBinary(val.Interface().([]byte))
-}
-
-func (bsc *ByteSliceCodec) decodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) {
- if t != tByteSlice {
- return emptyValue, ValueDecoderError{
- Name: "ByteSliceDecodeValue",
- Types: []reflect.Type{tByteSlice},
- Received: reflect.Zero(t),
- }
- }
-
- var data []byte
- var err error
- switch vrType := vr.Type(); vrType {
- case bsontype.String:
- str, err := vr.ReadString()
- if err != nil {
- return emptyValue, err
- }
- data = []byte(str)
- case bsontype.Symbol:
- sym, err := vr.ReadSymbol()
- if err != nil {
- return emptyValue, err
- }
- data = []byte(sym)
- case bsontype.Binary:
- var subtype byte
- data, subtype, err = vr.ReadBinary()
- if err != nil {
- return emptyValue, err
- }
- if subtype != bsontype.BinaryGeneric && subtype != bsontype.BinaryBinaryOld {
- return emptyValue, decodeBinaryError{subtype: subtype, typeName: "[]byte"}
- }
- case bsontype.Null:
- err = vr.ReadNull()
- case bsontype.Undefined:
- err = vr.ReadUndefined()
- default:
- return emptyValue, fmt.Errorf("cannot decode %v into a []byte", vrType)
- }
- if err != nil {
- return emptyValue, err
- }
-
- return reflect.ValueOf(data), nil
-}
-
-// DecodeValue is the ValueDecoder for []byte.
-func (bsc *ByteSliceCodec) DecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Type() != tByteSlice {
- return ValueDecoderError{Name: "ByteSliceDecodeValue", Types: []reflect.Type{tByteSlice}, Received: val}
- }
-
- elem, err := bsc.decodeType(dc, vr, tByteSlice)
- if err != nil {
- return err
- }
-
- val.Set(elem)
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/codec_cache.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/codec_cache.go
deleted file mode 100644
index 844b50299..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/codec_cache.go
+++ /dev/null
@@ -1,166 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsoncodec
-
-import (
- "reflect"
- "sync"
- "sync/atomic"
-)
-
-// Runtime check that the kind encoder and decoder caches can store any valid
-// reflect.Kind constant.
-func init() {
- if s := reflect.Kind(len(kindEncoderCache{}.entries)).String(); s != "kind27" {
- panic("The capacity of kindEncoderCache is too small.\n" +
- "This is due to a new type being added to reflect.Kind.")
- }
-}
-
-// statically assert array size
-var _ = (kindEncoderCache{}).entries[reflect.UnsafePointer]
-var _ = (kindDecoderCache{}).entries[reflect.UnsafePointer]
-
-type typeEncoderCache struct {
- cache sync.Map // map[reflect.Type]ValueEncoder
-}
-
-func (c *typeEncoderCache) Store(rt reflect.Type, enc ValueEncoder) {
- c.cache.Store(rt, enc)
-}
-
-func (c *typeEncoderCache) Load(rt reflect.Type) (ValueEncoder, bool) {
- if v, _ := c.cache.Load(rt); v != nil {
- return v.(ValueEncoder), true
- }
- return nil, false
-}
-
-func (c *typeEncoderCache) LoadOrStore(rt reflect.Type, enc ValueEncoder) ValueEncoder {
- if v, loaded := c.cache.LoadOrStore(rt, enc); loaded {
- enc = v.(ValueEncoder)
- }
- return enc
-}
-
-func (c *typeEncoderCache) Clone() *typeEncoderCache {
- cc := new(typeEncoderCache)
- c.cache.Range(func(k, v interface{}) bool {
- if k != nil && v != nil {
- cc.cache.Store(k, v)
- }
- return true
- })
- return cc
-}
-
-type typeDecoderCache struct {
- cache sync.Map // map[reflect.Type]ValueDecoder
-}
-
-func (c *typeDecoderCache) Store(rt reflect.Type, dec ValueDecoder) {
- c.cache.Store(rt, dec)
-}
-
-func (c *typeDecoderCache) Load(rt reflect.Type) (ValueDecoder, bool) {
- if v, _ := c.cache.Load(rt); v != nil {
- return v.(ValueDecoder), true
- }
- return nil, false
-}
-
-func (c *typeDecoderCache) LoadOrStore(rt reflect.Type, dec ValueDecoder) ValueDecoder {
- if v, loaded := c.cache.LoadOrStore(rt, dec); loaded {
- dec = v.(ValueDecoder)
- }
- return dec
-}
-
-func (c *typeDecoderCache) Clone() *typeDecoderCache {
- cc := new(typeDecoderCache)
- c.cache.Range(func(k, v interface{}) bool {
- if k != nil && v != nil {
- cc.cache.Store(k, v)
- }
- return true
- })
- return cc
-}
-
-// atomic.Value requires that all calls to Store() have the same concrete type
-// so we wrap the ValueEncoder with a kindEncoderCacheEntry to ensure the type
-// is always the same (since different concrete types may implement the
-// ValueEncoder interface).
-type kindEncoderCacheEntry struct {
- enc ValueEncoder
-}
-
-type kindEncoderCache struct {
- entries [reflect.UnsafePointer + 1]atomic.Value // *kindEncoderCacheEntry
-}
-
-func (c *kindEncoderCache) Store(rt reflect.Kind, enc ValueEncoder) {
- if enc != nil && rt < reflect.Kind(len(c.entries)) {
- c.entries[rt].Store(&kindEncoderCacheEntry{enc: enc})
- }
-}
-
-func (c *kindEncoderCache) Load(rt reflect.Kind) (ValueEncoder, bool) {
- if rt < reflect.Kind(len(c.entries)) {
- if ent, ok := c.entries[rt].Load().(*kindEncoderCacheEntry); ok {
- return ent.enc, ent.enc != nil
- }
- }
- return nil, false
-}
-
-func (c *kindEncoderCache) Clone() *kindEncoderCache {
- cc := new(kindEncoderCache)
- for i, v := range c.entries {
- if val := v.Load(); val != nil {
- cc.entries[i].Store(val)
- }
- }
- return cc
-}
-
-// atomic.Value requires that all calls to Store() have the same concrete type
-// so we wrap the ValueDecoder with a kindDecoderCacheEntry to ensure the type
-// is always the same (since different concrete types may implement the
-// ValueDecoder interface).
-type kindDecoderCacheEntry struct {
- dec ValueDecoder
-}
-
-type kindDecoderCache struct {
- entries [reflect.UnsafePointer + 1]atomic.Value // *kindDecoderCacheEntry
-}
-
-func (c *kindDecoderCache) Store(rt reflect.Kind, dec ValueDecoder) {
- if rt < reflect.Kind(len(c.entries)) {
- c.entries[rt].Store(&kindDecoderCacheEntry{dec: dec})
- }
-}
-
-func (c *kindDecoderCache) Load(rt reflect.Kind) (ValueDecoder, bool) {
- if rt < reflect.Kind(len(c.entries)) {
- if ent, ok := c.entries[rt].Load().(*kindDecoderCacheEntry); ok {
- return ent.dec, ent.dec != nil
- }
- }
- return nil, false
-}
-
-func (c *kindDecoderCache) Clone() *kindDecoderCache {
- cc := new(kindDecoderCache)
- for i, v := range c.entries {
- if val := v.Load(); val != nil {
- cc.entries[i].Store(val)
- }
- }
- return cc
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/cond_addr_codec.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/cond_addr_codec.go
deleted file mode 100644
index cb8180f25..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/cond_addr_codec.go
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsoncodec
-
-import (
- "reflect"
-
- "go.mongodb.org/mongo-driver/bson/bsonrw"
-)
-
-// condAddrEncoder is the encoder used when a pointer to the encoding value has an encoder.
-type condAddrEncoder struct {
- canAddrEnc ValueEncoder
- elseEnc ValueEncoder
-}
-
-var _ ValueEncoder = (*condAddrEncoder)(nil)
-
-// newCondAddrEncoder returns an condAddrEncoder.
-func newCondAddrEncoder(canAddrEnc, elseEnc ValueEncoder) *condAddrEncoder {
- encoder := condAddrEncoder{canAddrEnc: canAddrEnc, elseEnc: elseEnc}
- return &encoder
-}
-
-// EncodeValue is the ValueEncoderFunc for a value that may be addressable.
-func (cae *condAddrEncoder) EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if val.CanAddr() {
- return cae.canAddrEnc.EncodeValue(ec, vw, val)
- }
- if cae.elseEnc != nil {
- return cae.elseEnc.EncodeValue(ec, vw, val)
- }
- return ErrNoEncoder{Type: val.Type()}
-}
-
-// condAddrDecoder is the decoder used when a pointer to the value has a decoder.
-type condAddrDecoder struct {
- canAddrDec ValueDecoder
- elseDec ValueDecoder
-}
-
-var _ ValueDecoder = (*condAddrDecoder)(nil)
-
-// newCondAddrDecoder returns an CondAddrDecoder.
-func newCondAddrDecoder(canAddrDec, elseDec ValueDecoder) *condAddrDecoder {
- decoder := condAddrDecoder{canAddrDec: canAddrDec, elseDec: elseDec}
- return &decoder
-}
-
-// DecodeValue is the ValueDecoderFunc for a value that may be addressable.
-func (cad *condAddrDecoder) DecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if val.CanAddr() {
- return cad.canAddrDec.DecodeValue(dc, vr, val)
- }
- if cad.elseDec != nil {
- return cad.elseDec.DecodeValue(dc, vr, val)
- }
- return ErrNoDecoder{Type: val.Type()}
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go
deleted file mode 100644
index 8702d6d39..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go
+++ /dev/null
@@ -1,1819 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsoncodec
-
-import (
- "encoding/json"
- "errors"
- "fmt"
- "math"
- "net/url"
- "reflect"
- "strconv"
- "time"
-
- "go.mongodb.org/mongo-driver/bson/bsonrw"
- "go.mongodb.org/mongo-driver/bson/bsontype"
- "go.mongodb.org/mongo-driver/bson/primitive"
- "go.mongodb.org/mongo-driver/x/bsonx/bsoncore"
-)
-
-var (
- defaultValueDecoders DefaultValueDecoders
- errCannotTruncate = errors.New("float64 can only be truncated to a lower precision type when truncation is enabled")
-)
-
-type decodeBinaryError struct {
- subtype byte
- typeName string
-}
-
-func (d decodeBinaryError) Error() string {
- return fmt.Sprintf("only binary values with subtype 0x00 or 0x02 can be decoded into %s, but got subtype %v", d.typeName, d.subtype)
-}
-
-func newDefaultStructCodec() *StructCodec {
- codec, err := NewStructCodec(DefaultStructTagParser)
- if err != nil {
- // This function is called from the codec registration path, so errors can't be propagated. If there's an error
- // constructing the StructCodec, we panic to avoid losing it.
- panic(fmt.Errorf("error creating default StructCodec: %w", err))
- }
- return codec
-}
-
-// DefaultValueDecoders is a namespace type for the default ValueDecoders used
-// when creating a registry.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value decoders registered.
-type DefaultValueDecoders struct{}
-
-// RegisterDefaultDecoders will register the decoder methods attached to DefaultValueDecoders with
-// the provided RegistryBuilder.
-//
-// There is no support for decoding map[string]interface{} because there is no decoder for
-// interface{}, so users must either register this decoder themselves or use the
-// EmptyInterfaceDecoder available in the bson package.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value decoders registered.
-func (dvd DefaultValueDecoders) RegisterDefaultDecoders(rb *RegistryBuilder) {
- if rb == nil {
- panic(errors.New("argument to RegisterDefaultDecoders must not be nil"))
- }
-
- intDecoder := decodeAdapter{dvd.IntDecodeValue, dvd.intDecodeType}
- floatDecoder := decodeAdapter{dvd.FloatDecodeValue, dvd.floatDecodeType}
-
- rb.
- RegisterTypeDecoder(tD, ValueDecoderFunc(dvd.DDecodeValue)).
- RegisterTypeDecoder(tBinary, decodeAdapter{dvd.BinaryDecodeValue, dvd.binaryDecodeType}).
- RegisterTypeDecoder(tUndefined, decodeAdapter{dvd.UndefinedDecodeValue, dvd.undefinedDecodeType}).
- RegisterTypeDecoder(tDateTime, decodeAdapter{dvd.DateTimeDecodeValue, dvd.dateTimeDecodeType}).
- RegisterTypeDecoder(tNull, decodeAdapter{dvd.NullDecodeValue, dvd.nullDecodeType}).
- RegisterTypeDecoder(tRegex, decodeAdapter{dvd.RegexDecodeValue, dvd.regexDecodeType}).
- RegisterTypeDecoder(tDBPointer, decodeAdapter{dvd.DBPointerDecodeValue, dvd.dBPointerDecodeType}).
- RegisterTypeDecoder(tTimestamp, decodeAdapter{dvd.TimestampDecodeValue, dvd.timestampDecodeType}).
- RegisterTypeDecoder(tMinKey, decodeAdapter{dvd.MinKeyDecodeValue, dvd.minKeyDecodeType}).
- RegisterTypeDecoder(tMaxKey, decodeAdapter{dvd.MaxKeyDecodeValue, dvd.maxKeyDecodeType}).
- RegisterTypeDecoder(tJavaScript, decodeAdapter{dvd.JavaScriptDecodeValue, dvd.javaScriptDecodeType}).
- RegisterTypeDecoder(tSymbol, decodeAdapter{dvd.SymbolDecodeValue, dvd.symbolDecodeType}).
- RegisterTypeDecoder(tByteSlice, defaultByteSliceCodec).
- RegisterTypeDecoder(tTime, defaultTimeCodec).
- RegisterTypeDecoder(tEmpty, defaultEmptyInterfaceCodec).
- RegisterTypeDecoder(tCoreArray, defaultArrayCodec).
- RegisterTypeDecoder(tOID, decodeAdapter{dvd.ObjectIDDecodeValue, dvd.objectIDDecodeType}).
- RegisterTypeDecoder(tDecimal, decodeAdapter{dvd.Decimal128DecodeValue, dvd.decimal128DecodeType}).
- RegisterTypeDecoder(tJSONNumber, decodeAdapter{dvd.JSONNumberDecodeValue, dvd.jsonNumberDecodeType}).
- RegisterTypeDecoder(tURL, decodeAdapter{dvd.URLDecodeValue, dvd.urlDecodeType}).
- RegisterTypeDecoder(tCoreDocument, ValueDecoderFunc(dvd.CoreDocumentDecodeValue)).
- RegisterTypeDecoder(tCodeWithScope, decodeAdapter{dvd.CodeWithScopeDecodeValue, dvd.codeWithScopeDecodeType}).
- RegisterDefaultDecoder(reflect.Bool, decodeAdapter{dvd.BooleanDecodeValue, dvd.booleanDecodeType}).
- RegisterDefaultDecoder(reflect.Int, intDecoder).
- RegisterDefaultDecoder(reflect.Int8, intDecoder).
- RegisterDefaultDecoder(reflect.Int16, intDecoder).
- RegisterDefaultDecoder(reflect.Int32, intDecoder).
- RegisterDefaultDecoder(reflect.Int64, intDecoder).
- RegisterDefaultDecoder(reflect.Uint, defaultUIntCodec).
- RegisterDefaultDecoder(reflect.Uint8, defaultUIntCodec).
- RegisterDefaultDecoder(reflect.Uint16, defaultUIntCodec).
- RegisterDefaultDecoder(reflect.Uint32, defaultUIntCodec).
- RegisterDefaultDecoder(reflect.Uint64, defaultUIntCodec).
- RegisterDefaultDecoder(reflect.Float32, floatDecoder).
- RegisterDefaultDecoder(reflect.Float64, floatDecoder).
- RegisterDefaultDecoder(reflect.Array, ValueDecoderFunc(dvd.ArrayDecodeValue)).
- RegisterDefaultDecoder(reflect.Map, defaultMapCodec).
- RegisterDefaultDecoder(reflect.Slice, defaultSliceCodec).
- RegisterDefaultDecoder(reflect.String, defaultStringCodec).
- RegisterDefaultDecoder(reflect.Struct, newDefaultStructCodec()).
- RegisterDefaultDecoder(reflect.Ptr, NewPointerCodec()).
- RegisterTypeMapEntry(bsontype.Double, tFloat64).
- RegisterTypeMapEntry(bsontype.String, tString).
- RegisterTypeMapEntry(bsontype.Array, tA).
- RegisterTypeMapEntry(bsontype.Binary, tBinary).
- RegisterTypeMapEntry(bsontype.Undefined, tUndefined).
- RegisterTypeMapEntry(bsontype.ObjectID, tOID).
- RegisterTypeMapEntry(bsontype.Boolean, tBool).
- RegisterTypeMapEntry(bsontype.DateTime, tDateTime).
- RegisterTypeMapEntry(bsontype.Regex, tRegex).
- RegisterTypeMapEntry(bsontype.DBPointer, tDBPointer).
- RegisterTypeMapEntry(bsontype.JavaScript, tJavaScript).
- RegisterTypeMapEntry(bsontype.Symbol, tSymbol).
- RegisterTypeMapEntry(bsontype.CodeWithScope, tCodeWithScope).
- RegisterTypeMapEntry(bsontype.Int32, tInt32).
- RegisterTypeMapEntry(bsontype.Int64, tInt64).
- RegisterTypeMapEntry(bsontype.Timestamp, tTimestamp).
- RegisterTypeMapEntry(bsontype.Decimal128, tDecimal).
- RegisterTypeMapEntry(bsontype.MinKey, tMinKey).
- RegisterTypeMapEntry(bsontype.MaxKey, tMaxKey).
- RegisterTypeMapEntry(bsontype.Type(0), tD).
- RegisterTypeMapEntry(bsontype.EmbeddedDocument, tD).
- RegisterHookDecoder(tValueUnmarshaler, ValueDecoderFunc(dvd.ValueUnmarshalerDecodeValue)).
- RegisterHookDecoder(tUnmarshaler, ValueDecoderFunc(dvd.UnmarshalerDecodeValue))
-}
-
-// DDecodeValue is the ValueDecoderFunc for primitive.D instances.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value decoders registered.
-func (dvd DefaultValueDecoders) DDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.IsValid() || !val.CanSet() || val.Type() != tD {
- return ValueDecoderError{Name: "DDecodeValue", Kinds: []reflect.Kind{reflect.Slice}, Received: val}
- }
-
- switch vrType := vr.Type(); vrType {
- case bsontype.Type(0), bsontype.EmbeddedDocument:
- dc.Ancestor = tD
- case bsontype.Null:
- val.Set(reflect.Zero(val.Type()))
- return vr.ReadNull()
- default:
- return fmt.Errorf("cannot decode %v into a primitive.D", vrType)
- }
-
- dr, err := vr.ReadDocument()
- if err != nil {
- return err
- }
-
- decoder, err := dc.LookupDecoder(tEmpty)
- if err != nil {
- return err
- }
- tEmptyTypeDecoder, _ := decoder.(typeDecoder)
-
- // Use the elements in the provided value if it's non nil. Otherwise, allocate a new D instance.
- var elems primitive.D
- if !val.IsNil() {
- val.SetLen(0)
- elems = val.Interface().(primitive.D)
- } else {
- elems = make(primitive.D, 0)
- }
-
- for {
- key, elemVr, err := dr.ReadElement()
- if errors.Is(err, bsonrw.ErrEOD) {
- break
- } else if err != nil {
- return err
- }
-
- // Pass false for convert because we don't need to call reflect.Value.Convert for tEmpty.
- elem, err := decodeTypeOrValueWithInfo(decoder, tEmptyTypeDecoder, dc, elemVr, tEmpty, false)
- if err != nil {
- return err
- }
-
- elems = append(elems, primitive.E{Key: key, Value: elem.Interface()})
- }
-
- val.Set(reflect.ValueOf(elems))
- return nil
-}
-
-func (dvd DefaultValueDecoders) booleanDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) {
- if t.Kind() != reflect.Bool {
- return emptyValue, ValueDecoderError{
- Name: "BooleanDecodeValue",
- Kinds: []reflect.Kind{reflect.Bool},
- Received: reflect.Zero(t),
- }
- }
-
- var b bool
- var err error
- switch vrType := vr.Type(); vrType {
- case bsontype.Int32:
- i32, err := vr.ReadInt32()
- if err != nil {
- return emptyValue, err
- }
- b = (i32 != 0)
- case bsontype.Int64:
- i64, err := vr.ReadInt64()
- if err != nil {
- return emptyValue, err
- }
- b = (i64 != 0)
- case bsontype.Double:
- f64, err := vr.ReadDouble()
- if err != nil {
- return emptyValue, err
- }
- b = (f64 != 0)
- case bsontype.Boolean:
- b, err = vr.ReadBoolean()
- case bsontype.Null:
- err = vr.ReadNull()
- case bsontype.Undefined:
- err = vr.ReadUndefined()
- default:
- return emptyValue, fmt.Errorf("cannot decode %v into a boolean", vrType)
- }
- if err != nil {
- return emptyValue, err
- }
-
- return reflect.ValueOf(b), nil
-}
-
-// BooleanDecodeValue is the ValueDecoderFunc for bool types.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value decoders registered.
-func (dvd DefaultValueDecoders) BooleanDecodeValue(dctx DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.IsValid() || !val.CanSet() || val.Kind() != reflect.Bool {
- return ValueDecoderError{Name: "BooleanDecodeValue", Kinds: []reflect.Kind{reflect.Bool}, Received: val}
- }
-
- elem, err := dvd.booleanDecodeType(dctx, vr, val.Type())
- if err != nil {
- return err
- }
-
- val.SetBool(elem.Bool())
- return nil
-}
-
-func (DefaultValueDecoders) intDecodeType(dc DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) {
- var i64 int64
- var err error
- switch vrType := vr.Type(); vrType {
- case bsontype.Int32:
- i32, err := vr.ReadInt32()
- if err != nil {
- return emptyValue, err
- }
- i64 = int64(i32)
- case bsontype.Int64:
- i64, err = vr.ReadInt64()
- if err != nil {
- return emptyValue, err
- }
- case bsontype.Double:
- f64, err := vr.ReadDouble()
- if err != nil {
- return emptyValue, err
- }
- if !dc.Truncate && math.Floor(f64) != f64 {
- return emptyValue, errCannotTruncate
- }
- if f64 > float64(math.MaxInt64) {
- return emptyValue, fmt.Errorf("%g overflows int64", f64)
- }
- i64 = int64(f64)
- case bsontype.Boolean:
- b, err := vr.ReadBoolean()
- if err != nil {
- return emptyValue, err
- }
- if b {
- i64 = 1
- }
- case bsontype.Null:
- if err = vr.ReadNull(); err != nil {
- return emptyValue, err
- }
- case bsontype.Undefined:
- if err = vr.ReadUndefined(); err != nil {
- return emptyValue, err
- }
- default:
- return emptyValue, fmt.Errorf("cannot decode %v into an integer type", vrType)
- }
-
- switch t.Kind() {
- case reflect.Int8:
- if i64 < math.MinInt8 || i64 > math.MaxInt8 {
- return emptyValue, fmt.Errorf("%d overflows int8", i64)
- }
-
- return reflect.ValueOf(int8(i64)), nil
- case reflect.Int16:
- if i64 < math.MinInt16 || i64 > math.MaxInt16 {
- return emptyValue, fmt.Errorf("%d overflows int16", i64)
- }
-
- return reflect.ValueOf(int16(i64)), nil
- case reflect.Int32:
- if i64 < math.MinInt32 || i64 > math.MaxInt32 {
- return emptyValue, fmt.Errorf("%d overflows int32", i64)
- }
-
- return reflect.ValueOf(int32(i64)), nil
- case reflect.Int64:
- return reflect.ValueOf(i64), nil
- case reflect.Int:
- if i64 > math.MaxInt { // Can we fit this inside of an int
- return emptyValue, fmt.Errorf("%d overflows int", i64)
- }
-
- return reflect.ValueOf(int(i64)), nil
- default:
- return emptyValue, ValueDecoderError{
- Name: "IntDecodeValue",
- Kinds: []reflect.Kind{reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int},
- Received: reflect.Zero(t),
- }
- }
-}
-
-// IntDecodeValue is the ValueDecoderFunc for int types.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value decoders registered.
-func (dvd DefaultValueDecoders) IntDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() {
- return ValueDecoderError{
- Name: "IntDecodeValue",
- Kinds: []reflect.Kind{reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int},
- Received: val,
- }
- }
-
- elem, err := dvd.intDecodeType(dc, vr, val.Type())
- if err != nil {
- return err
- }
-
- val.SetInt(elem.Int())
- return nil
-}
-
-// UintDecodeValue is the ValueDecoderFunc for uint types.
-//
-// Deprecated: UintDecodeValue is not registered by default. Use UintCodec.DecodeValue instead.
-func (dvd DefaultValueDecoders) UintDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- var i64 int64
- var err error
- switch vr.Type() {
- case bsontype.Int32:
- i32, err := vr.ReadInt32()
- if err != nil {
- return err
- }
- i64 = int64(i32)
- case bsontype.Int64:
- i64, err = vr.ReadInt64()
- if err != nil {
- return err
- }
- case bsontype.Double:
- f64, err := vr.ReadDouble()
- if err != nil {
- return err
- }
- if !dc.Truncate && math.Floor(f64) != f64 {
- return errors.New("UintDecodeValue can only truncate float64 to an integer type when truncation is enabled")
- }
- if f64 > float64(math.MaxInt64) {
- return fmt.Errorf("%g overflows int64", f64)
- }
- i64 = int64(f64)
- case bsontype.Boolean:
- b, err := vr.ReadBoolean()
- if err != nil {
- return err
- }
- if b {
- i64 = 1
- }
- default:
- return fmt.Errorf("cannot decode %v into an integer type", vr.Type())
- }
-
- if !val.CanSet() {
- return ValueDecoderError{
- Name: "UintDecodeValue",
- Kinds: []reflect.Kind{reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint},
- Received: val,
- }
- }
-
- switch val.Kind() {
- case reflect.Uint8:
- if i64 < 0 || i64 > math.MaxUint8 {
- return fmt.Errorf("%d overflows uint8", i64)
- }
- case reflect.Uint16:
- if i64 < 0 || i64 > math.MaxUint16 {
- return fmt.Errorf("%d overflows uint16", i64)
- }
- case reflect.Uint32:
- if i64 < 0 || i64 > math.MaxUint32 {
- return fmt.Errorf("%d overflows uint32", i64)
- }
- case reflect.Uint64:
- if i64 < 0 {
- return fmt.Errorf("%d overflows uint64", i64)
- }
- case reflect.Uint:
- if i64 < 0 || uint64(i64) > uint64(math.MaxUint) { // Can we fit this inside of an uint
- return fmt.Errorf("%d overflows uint", i64)
- }
- default:
- return ValueDecoderError{
- Name: "UintDecodeValue",
- Kinds: []reflect.Kind{reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint},
- Received: val,
- }
- }
-
- val.SetUint(uint64(i64))
- return nil
-}
-
-func (dvd DefaultValueDecoders) floatDecodeType(dc DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) {
- var f float64
- var err error
- switch vrType := vr.Type(); vrType {
- case bsontype.Int32:
- i32, err := vr.ReadInt32()
- if err != nil {
- return emptyValue, err
- }
- f = float64(i32)
- case bsontype.Int64:
- i64, err := vr.ReadInt64()
- if err != nil {
- return emptyValue, err
- }
- f = float64(i64)
- case bsontype.Double:
- f, err = vr.ReadDouble()
- if err != nil {
- return emptyValue, err
- }
- case bsontype.Boolean:
- b, err := vr.ReadBoolean()
- if err != nil {
- return emptyValue, err
- }
- if b {
- f = 1
- }
- case bsontype.Null:
- if err = vr.ReadNull(); err != nil {
- return emptyValue, err
- }
- case bsontype.Undefined:
- if err = vr.ReadUndefined(); err != nil {
- return emptyValue, err
- }
- default:
- return emptyValue, fmt.Errorf("cannot decode %v into a float32 or float64 type", vrType)
- }
-
- switch t.Kind() {
- case reflect.Float32:
- if !dc.Truncate && float64(float32(f)) != f {
- return emptyValue, errCannotTruncate
- }
-
- return reflect.ValueOf(float32(f)), nil
- case reflect.Float64:
- return reflect.ValueOf(f), nil
- default:
- return emptyValue, ValueDecoderError{
- Name: "FloatDecodeValue",
- Kinds: []reflect.Kind{reflect.Float32, reflect.Float64},
- Received: reflect.Zero(t),
- }
- }
-}
-
-// FloatDecodeValue is the ValueDecoderFunc for float types.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value decoders registered.
-func (dvd DefaultValueDecoders) FloatDecodeValue(ec DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() {
- return ValueDecoderError{
- Name: "FloatDecodeValue",
- Kinds: []reflect.Kind{reflect.Float32, reflect.Float64},
- Received: val,
- }
- }
-
- elem, err := dvd.floatDecodeType(ec, vr, val.Type())
- if err != nil {
- return err
- }
-
- val.SetFloat(elem.Float())
- return nil
-}
-
-// StringDecodeValue is the ValueDecoderFunc for string types.
-//
-// Deprecated: StringDecodeValue is not registered by default. Use StringCodec.DecodeValue instead.
-func (dvd DefaultValueDecoders) StringDecodeValue(_ DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- var str string
- var err error
- switch vr.Type() {
- // TODO(GODRIVER-577): Handle JavaScript and Symbol BSON types when allowed.
- case bsontype.String:
- str, err = vr.ReadString()
- if err != nil {
- return err
- }
- default:
- return fmt.Errorf("cannot decode %v into a string type", vr.Type())
- }
- if !val.CanSet() || val.Kind() != reflect.String {
- return ValueDecoderError{Name: "StringDecodeValue", Kinds: []reflect.Kind{reflect.String}, Received: val}
- }
-
- val.SetString(str)
- return nil
-}
-
-func (DefaultValueDecoders) javaScriptDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) {
- if t != tJavaScript {
- return emptyValue, ValueDecoderError{
- Name: "JavaScriptDecodeValue",
- Types: []reflect.Type{tJavaScript},
- Received: reflect.Zero(t),
- }
- }
-
- var js string
- var err error
- switch vrType := vr.Type(); vrType {
- case bsontype.JavaScript:
- js, err = vr.ReadJavascript()
- case bsontype.Null:
- err = vr.ReadNull()
- case bsontype.Undefined:
- err = vr.ReadUndefined()
- default:
- return emptyValue, fmt.Errorf("cannot decode %v into a primitive.JavaScript", vrType)
- }
- if err != nil {
- return emptyValue, err
- }
-
- return reflect.ValueOf(primitive.JavaScript(js)), nil
-}
-
-// JavaScriptDecodeValue is the ValueDecoderFunc for the primitive.JavaScript type.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value decoders registered.
-func (dvd DefaultValueDecoders) JavaScriptDecodeValue(dctx DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Type() != tJavaScript {
- return ValueDecoderError{Name: "JavaScriptDecodeValue", Types: []reflect.Type{tJavaScript}, Received: val}
- }
-
- elem, err := dvd.javaScriptDecodeType(dctx, vr, tJavaScript)
- if err != nil {
- return err
- }
-
- val.SetString(elem.String())
- return nil
-}
-
-func (DefaultValueDecoders) symbolDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) {
- if t != tSymbol {
- return emptyValue, ValueDecoderError{
- Name: "SymbolDecodeValue",
- Types: []reflect.Type{tSymbol},
- Received: reflect.Zero(t),
- }
- }
-
- var symbol string
- var err error
- switch vrType := vr.Type(); vrType {
- case bsontype.String:
- symbol, err = vr.ReadString()
- case bsontype.Symbol:
- symbol, err = vr.ReadSymbol()
- case bsontype.Binary:
- data, subtype, err := vr.ReadBinary()
- if err != nil {
- return emptyValue, err
- }
-
- if subtype != bsontype.BinaryGeneric && subtype != bsontype.BinaryBinaryOld {
- return emptyValue, decodeBinaryError{subtype: subtype, typeName: "primitive.Symbol"}
- }
- symbol = string(data)
- case bsontype.Null:
- err = vr.ReadNull()
- case bsontype.Undefined:
- err = vr.ReadUndefined()
- default:
- return emptyValue, fmt.Errorf("cannot decode %v into a primitive.Symbol", vrType)
- }
- if err != nil {
- return emptyValue, err
- }
-
- return reflect.ValueOf(primitive.Symbol(symbol)), nil
-}
-
-// SymbolDecodeValue is the ValueDecoderFunc for the primitive.Symbol type.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value decoders registered.
-func (dvd DefaultValueDecoders) SymbolDecodeValue(dctx DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Type() != tSymbol {
- return ValueDecoderError{Name: "SymbolDecodeValue", Types: []reflect.Type{tSymbol}, Received: val}
- }
-
- elem, err := dvd.symbolDecodeType(dctx, vr, tSymbol)
- if err != nil {
- return err
- }
-
- val.SetString(elem.String())
- return nil
-}
-
-func (DefaultValueDecoders) binaryDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) {
- if t != tBinary {
- return emptyValue, ValueDecoderError{
- Name: "BinaryDecodeValue",
- Types: []reflect.Type{tBinary},
- Received: reflect.Zero(t),
- }
- }
-
- var data []byte
- var subtype byte
- var err error
- switch vrType := vr.Type(); vrType {
- case bsontype.Binary:
- data, subtype, err = vr.ReadBinary()
- case bsontype.Null:
- err = vr.ReadNull()
- case bsontype.Undefined:
- err = vr.ReadUndefined()
- default:
- return emptyValue, fmt.Errorf("cannot decode %v into a Binary", vrType)
- }
- if err != nil {
- return emptyValue, err
- }
-
- return reflect.ValueOf(primitive.Binary{Subtype: subtype, Data: data}), nil
-}
-
-// BinaryDecodeValue is the ValueDecoderFunc for Binary.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value decoders registered.
-func (dvd DefaultValueDecoders) BinaryDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Type() != tBinary {
- return ValueDecoderError{Name: "BinaryDecodeValue", Types: []reflect.Type{tBinary}, Received: val}
- }
-
- elem, err := dvd.binaryDecodeType(dc, vr, tBinary)
- if err != nil {
- return err
- }
-
- val.Set(elem)
- return nil
-}
-
-func (DefaultValueDecoders) undefinedDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) {
- if t != tUndefined {
- return emptyValue, ValueDecoderError{
- Name: "UndefinedDecodeValue",
- Types: []reflect.Type{tUndefined},
- Received: reflect.Zero(t),
- }
- }
-
- var err error
- switch vrType := vr.Type(); vrType {
- case bsontype.Undefined:
- err = vr.ReadUndefined()
- case bsontype.Null:
- err = vr.ReadNull()
- default:
- return emptyValue, fmt.Errorf("cannot decode %v into an Undefined", vr.Type())
- }
- if err != nil {
- return emptyValue, err
- }
-
- return reflect.ValueOf(primitive.Undefined{}), nil
-}
-
-// UndefinedDecodeValue is the ValueDecoderFunc for Undefined.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value decoders registered.
-func (dvd DefaultValueDecoders) UndefinedDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Type() != tUndefined {
- return ValueDecoderError{Name: "UndefinedDecodeValue", Types: []reflect.Type{tUndefined}, Received: val}
- }
-
- elem, err := dvd.undefinedDecodeType(dc, vr, tUndefined)
- if err != nil {
- return err
- }
-
- val.Set(elem)
- return nil
-}
-
-// Accept both 12-byte string and pretty-printed 24-byte hex string formats.
-func (dvd DefaultValueDecoders) objectIDDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) {
- if t != tOID {
- return emptyValue, ValueDecoderError{
- Name: "ObjectIDDecodeValue",
- Types: []reflect.Type{tOID},
- Received: reflect.Zero(t),
- }
- }
-
- var oid primitive.ObjectID
- var err error
- switch vrType := vr.Type(); vrType {
- case bsontype.ObjectID:
- oid, err = vr.ReadObjectID()
- if err != nil {
- return emptyValue, err
- }
- case bsontype.String:
- str, err := vr.ReadString()
- if err != nil {
- return emptyValue, err
- }
- if oid, err = primitive.ObjectIDFromHex(str); err == nil {
- break
- }
- if len(str) != 12 {
- return emptyValue, fmt.Errorf("an ObjectID string must be exactly 12 bytes long (got %v)", len(str))
- }
- byteArr := []byte(str)
- copy(oid[:], byteArr)
- case bsontype.Null:
- if err = vr.ReadNull(); err != nil {
- return emptyValue, err
- }
- case bsontype.Undefined:
- if err = vr.ReadUndefined(); err != nil {
- return emptyValue, err
- }
- default:
- return emptyValue, fmt.Errorf("cannot decode %v into an ObjectID", vrType)
- }
-
- return reflect.ValueOf(oid), nil
-}
-
-// ObjectIDDecodeValue is the ValueDecoderFunc for primitive.ObjectID.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value decoders registered.
-func (dvd DefaultValueDecoders) ObjectIDDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Type() != tOID {
- return ValueDecoderError{Name: "ObjectIDDecodeValue", Types: []reflect.Type{tOID}, Received: val}
- }
-
- elem, err := dvd.objectIDDecodeType(dc, vr, tOID)
- if err != nil {
- return err
- }
-
- val.Set(elem)
- return nil
-}
-
-func (DefaultValueDecoders) dateTimeDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) {
- if t != tDateTime {
- return emptyValue, ValueDecoderError{
- Name: "DateTimeDecodeValue",
- Types: []reflect.Type{tDateTime},
- Received: reflect.Zero(t),
- }
- }
-
- var dt int64
- var err error
- switch vrType := vr.Type(); vrType {
- case bsontype.DateTime:
- dt, err = vr.ReadDateTime()
- case bsontype.Null:
- err = vr.ReadNull()
- case bsontype.Undefined:
- err = vr.ReadUndefined()
- default:
- return emptyValue, fmt.Errorf("cannot decode %v into a DateTime", vrType)
- }
- if err != nil {
- return emptyValue, err
- }
-
- return reflect.ValueOf(primitive.DateTime(dt)), nil
-}
-
-// DateTimeDecodeValue is the ValueDecoderFunc for DateTime.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value decoders registered.
-func (dvd DefaultValueDecoders) DateTimeDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Type() != tDateTime {
- return ValueDecoderError{Name: "DateTimeDecodeValue", Types: []reflect.Type{tDateTime}, Received: val}
- }
-
- elem, err := dvd.dateTimeDecodeType(dc, vr, tDateTime)
- if err != nil {
- return err
- }
-
- val.Set(elem)
- return nil
-}
-
-func (DefaultValueDecoders) nullDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) {
- if t != tNull {
- return emptyValue, ValueDecoderError{
- Name: "NullDecodeValue",
- Types: []reflect.Type{tNull},
- Received: reflect.Zero(t),
- }
- }
-
- var err error
- switch vrType := vr.Type(); vrType {
- case bsontype.Undefined:
- err = vr.ReadUndefined()
- case bsontype.Null:
- err = vr.ReadNull()
- default:
- return emptyValue, fmt.Errorf("cannot decode %v into a Null", vr.Type())
- }
- if err != nil {
- return emptyValue, err
- }
-
- return reflect.ValueOf(primitive.Null{}), nil
-}
-
-// NullDecodeValue is the ValueDecoderFunc for Null.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value decoders registered.
-func (dvd DefaultValueDecoders) NullDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Type() != tNull {
- return ValueDecoderError{Name: "NullDecodeValue", Types: []reflect.Type{tNull}, Received: val}
- }
-
- elem, err := dvd.nullDecodeType(dc, vr, tNull)
- if err != nil {
- return err
- }
-
- val.Set(elem)
- return nil
-}
-
-func (DefaultValueDecoders) regexDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) {
- if t != tRegex {
- return emptyValue, ValueDecoderError{
- Name: "RegexDecodeValue",
- Types: []reflect.Type{tRegex},
- Received: reflect.Zero(t),
- }
- }
-
- var pattern, options string
- var err error
- switch vrType := vr.Type(); vrType {
- case bsontype.Regex:
- pattern, options, err = vr.ReadRegex()
- case bsontype.Null:
- err = vr.ReadNull()
- case bsontype.Undefined:
- err = vr.ReadUndefined()
- default:
- return emptyValue, fmt.Errorf("cannot decode %v into a Regex", vrType)
- }
- if err != nil {
- return emptyValue, err
- }
-
- return reflect.ValueOf(primitive.Regex{Pattern: pattern, Options: options}), nil
-}
-
-// RegexDecodeValue is the ValueDecoderFunc for Regex.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value decoders registered.
-func (dvd DefaultValueDecoders) RegexDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Type() != tRegex {
- return ValueDecoderError{Name: "RegexDecodeValue", Types: []reflect.Type{tRegex}, Received: val}
- }
-
- elem, err := dvd.regexDecodeType(dc, vr, tRegex)
- if err != nil {
- return err
- }
-
- val.Set(elem)
- return nil
-}
-
-func (DefaultValueDecoders) dBPointerDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) {
- if t != tDBPointer {
- return emptyValue, ValueDecoderError{
- Name: "DBPointerDecodeValue",
- Types: []reflect.Type{tDBPointer},
- Received: reflect.Zero(t),
- }
- }
-
- var ns string
- var pointer primitive.ObjectID
- var err error
- switch vrType := vr.Type(); vrType {
- case bsontype.DBPointer:
- ns, pointer, err = vr.ReadDBPointer()
- case bsontype.Null:
- err = vr.ReadNull()
- case bsontype.Undefined:
- err = vr.ReadUndefined()
- default:
- return emptyValue, fmt.Errorf("cannot decode %v into a DBPointer", vrType)
- }
- if err != nil {
- return emptyValue, err
- }
-
- return reflect.ValueOf(primitive.DBPointer{DB: ns, Pointer: pointer}), nil
-}
-
-// DBPointerDecodeValue is the ValueDecoderFunc for DBPointer.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value decoders registered.
-func (dvd DefaultValueDecoders) DBPointerDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Type() != tDBPointer {
- return ValueDecoderError{Name: "DBPointerDecodeValue", Types: []reflect.Type{tDBPointer}, Received: val}
- }
-
- elem, err := dvd.dBPointerDecodeType(dc, vr, tDBPointer)
- if err != nil {
- return err
- }
-
- val.Set(elem)
- return nil
-}
-
-func (DefaultValueDecoders) timestampDecodeType(_ DecodeContext, vr bsonrw.ValueReader, reflectType reflect.Type) (reflect.Value, error) {
- if reflectType != tTimestamp {
- return emptyValue, ValueDecoderError{
- Name: "TimestampDecodeValue",
- Types: []reflect.Type{tTimestamp},
- Received: reflect.Zero(reflectType),
- }
- }
-
- var t, incr uint32
- var err error
- switch vrType := vr.Type(); vrType {
- case bsontype.Timestamp:
- t, incr, err = vr.ReadTimestamp()
- case bsontype.Null:
- err = vr.ReadNull()
- case bsontype.Undefined:
- err = vr.ReadUndefined()
- default:
- return emptyValue, fmt.Errorf("cannot decode %v into a Timestamp", vrType)
- }
- if err != nil {
- return emptyValue, err
- }
-
- return reflect.ValueOf(primitive.Timestamp{T: t, I: incr}), nil
-}
-
-// TimestampDecodeValue is the ValueDecoderFunc for Timestamp.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value decoders registered.
-func (dvd DefaultValueDecoders) TimestampDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Type() != tTimestamp {
- return ValueDecoderError{Name: "TimestampDecodeValue", Types: []reflect.Type{tTimestamp}, Received: val}
- }
-
- elem, err := dvd.timestampDecodeType(dc, vr, tTimestamp)
- if err != nil {
- return err
- }
-
- val.Set(elem)
- return nil
-}
-
-func (DefaultValueDecoders) minKeyDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) {
- if t != tMinKey {
- return emptyValue, ValueDecoderError{
- Name: "MinKeyDecodeValue",
- Types: []reflect.Type{tMinKey},
- Received: reflect.Zero(t),
- }
- }
-
- var err error
- switch vrType := vr.Type(); vrType {
- case bsontype.MinKey:
- err = vr.ReadMinKey()
- case bsontype.Null:
- err = vr.ReadNull()
- case bsontype.Undefined:
- err = vr.ReadUndefined()
- default:
- return emptyValue, fmt.Errorf("cannot decode %v into a MinKey", vr.Type())
- }
- if err != nil {
- return emptyValue, err
- }
-
- return reflect.ValueOf(primitive.MinKey{}), nil
-}
-
-// MinKeyDecodeValue is the ValueDecoderFunc for MinKey.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value decoders registered.
-func (dvd DefaultValueDecoders) MinKeyDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Type() != tMinKey {
- return ValueDecoderError{Name: "MinKeyDecodeValue", Types: []reflect.Type{tMinKey}, Received: val}
- }
-
- elem, err := dvd.minKeyDecodeType(dc, vr, tMinKey)
- if err != nil {
- return err
- }
-
- val.Set(elem)
- return nil
-}
-
-func (DefaultValueDecoders) maxKeyDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) {
- if t != tMaxKey {
- return emptyValue, ValueDecoderError{
- Name: "MaxKeyDecodeValue",
- Types: []reflect.Type{tMaxKey},
- Received: reflect.Zero(t),
- }
- }
-
- var err error
- switch vrType := vr.Type(); vrType {
- case bsontype.MaxKey:
- err = vr.ReadMaxKey()
- case bsontype.Null:
- err = vr.ReadNull()
- case bsontype.Undefined:
- err = vr.ReadUndefined()
- default:
- return emptyValue, fmt.Errorf("cannot decode %v into a MaxKey", vr.Type())
- }
- if err != nil {
- return emptyValue, err
- }
-
- return reflect.ValueOf(primitive.MaxKey{}), nil
-}
-
-// MaxKeyDecodeValue is the ValueDecoderFunc for MaxKey.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value decoders registered.
-func (dvd DefaultValueDecoders) MaxKeyDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Type() != tMaxKey {
- return ValueDecoderError{Name: "MaxKeyDecodeValue", Types: []reflect.Type{tMaxKey}, Received: val}
- }
-
- elem, err := dvd.maxKeyDecodeType(dc, vr, tMaxKey)
- if err != nil {
- return err
- }
-
- val.Set(elem)
- return nil
-}
-
-func (dvd DefaultValueDecoders) decimal128DecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) {
- if t != tDecimal {
- return emptyValue, ValueDecoderError{
- Name: "Decimal128DecodeValue",
- Types: []reflect.Type{tDecimal},
- Received: reflect.Zero(t),
- }
- }
-
- var d128 primitive.Decimal128
- var err error
- switch vrType := vr.Type(); vrType {
- case bsontype.Decimal128:
- d128, err = vr.ReadDecimal128()
- case bsontype.Null:
- err = vr.ReadNull()
- case bsontype.Undefined:
- err = vr.ReadUndefined()
- default:
- return emptyValue, fmt.Errorf("cannot decode %v into a primitive.Decimal128", vr.Type())
- }
- if err != nil {
- return emptyValue, err
- }
-
- return reflect.ValueOf(d128), nil
-}
-
-// Decimal128DecodeValue is the ValueDecoderFunc for primitive.Decimal128.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value decoders registered.
-func (dvd DefaultValueDecoders) Decimal128DecodeValue(dctx DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Type() != tDecimal {
- return ValueDecoderError{Name: "Decimal128DecodeValue", Types: []reflect.Type{tDecimal}, Received: val}
- }
-
- elem, err := dvd.decimal128DecodeType(dctx, vr, tDecimal)
- if err != nil {
- return err
- }
-
- val.Set(elem)
- return nil
-}
-
-func (dvd DefaultValueDecoders) jsonNumberDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) {
- if t != tJSONNumber {
- return emptyValue, ValueDecoderError{
- Name: "JSONNumberDecodeValue",
- Types: []reflect.Type{tJSONNumber},
- Received: reflect.Zero(t),
- }
- }
-
- var jsonNum json.Number
- var err error
- switch vrType := vr.Type(); vrType {
- case bsontype.Double:
- f64, err := vr.ReadDouble()
- if err != nil {
- return emptyValue, err
- }
- jsonNum = json.Number(strconv.FormatFloat(f64, 'f', -1, 64))
- case bsontype.Int32:
- i32, err := vr.ReadInt32()
- if err != nil {
- return emptyValue, err
- }
- jsonNum = json.Number(strconv.FormatInt(int64(i32), 10))
- case bsontype.Int64:
- i64, err := vr.ReadInt64()
- if err != nil {
- return emptyValue, err
- }
- jsonNum = json.Number(strconv.FormatInt(i64, 10))
- case bsontype.Null:
- err = vr.ReadNull()
- case bsontype.Undefined:
- err = vr.ReadUndefined()
- default:
- return emptyValue, fmt.Errorf("cannot decode %v into a json.Number", vrType)
- }
- if err != nil {
- return emptyValue, err
- }
-
- return reflect.ValueOf(jsonNum), nil
-}
-
-// JSONNumberDecodeValue is the ValueDecoderFunc for json.Number.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value decoders registered.
-func (dvd DefaultValueDecoders) JSONNumberDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Type() != tJSONNumber {
- return ValueDecoderError{Name: "JSONNumberDecodeValue", Types: []reflect.Type{tJSONNumber}, Received: val}
- }
-
- elem, err := dvd.jsonNumberDecodeType(dc, vr, tJSONNumber)
- if err != nil {
- return err
- }
-
- val.Set(elem)
- return nil
-}
-
-func (dvd DefaultValueDecoders) urlDecodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) {
- if t != tURL {
- return emptyValue, ValueDecoderError{
- Name: "URLDecodeValue",
- Types: []reflect.Type{tURL},
- Received: reflect.Zero(t),
- }
- }
-
- urlPtr := &url.URL{}
- var err error
- switch vrType := vr.Type(); vrType {
- case bsontype.String:
- var str string // Declare str here to avoid shadowing err during the ReadString call.
- str, err = vr.ReadString()
- if err != nil {
- return emptyValue, err
- }
-
- urlPtr, err = url.Parse(str)
- case bsontype.Null:
- err = vr.ReadNull()
- case bsontype.Undefined:
- err = vr.ReadUndefined()
- default:
- return emptyValue, fmt.Errorf("cannot decode %v into a *url.URL", vrType)
- }
- if err != nil {
- return emptyValue, err
- }
-
- return reflect.ValueOf(urlPtr).Elem(), nil
-}
-
-// URLDecodeValue is the ValueDecoderFunc for url.URL.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value decoders registered.
-func (dvd DefaultValueDecoders) URLDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Type() != tURL {
- return ValueDecoderError{Name: "URLDecodeValue", Types: []reflect.Type{tURL}, Received: val}
- }
-
- elem, err := dvd.urlDecodeType(dc, vr, tURL)
- if err != nil {
- return err
- }
-
- val.Set(elem)
- return nil
-}
-
-// TimeDecodeValue is the ValueDecoderFunc for time.Time.
-//
-// Deprecated: TimeDecodeValue is not registered by default. Use TimeCodec.DecodeValue instead.
-func (dvd DefaultValueDecoders) TimeDecodeValue(_ DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if vr.Type() != bsontype.DateTime {
- return fmt.Errorf("cannot decode %v into a time.Time", vr.Type())
- }
-
- dt, err := vr.ReadDateTime()
- if err != nil {
- return err
- }
-
- if !val.CanSet() || val.Type() != tTime {
- return ValueDecoderError{Name: "TimeDecodeValue", Types: []reflect.Type{tTime}, Received: val}
- }
-
- val.Set(reflect.ValueOf(time.Unix(dt/1000, dt%1000*1000000).UTC()))
- return nil
-}
-
-// ByteSliceDecodeValue is the ValueDecoderFunc for []byte.
-//
-// Deprecated: ByteSliceDecodeValue is not registered by default. Use ByteSliceCodec.DecodeValue instead.
-func (dvd DefaultValueDecoders) ByteSliceDecodeValue(_ DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if vr.Type() != bsontype.Binary && vr.Type() != bsontype.Null {
- return fmt.Errorf("cannot decode %v into a []byte", vr.Type())
- }
-
- if !val.CanSet() || val.Type() != tByteSlice {
- return ValueDecoderError{Name: "ByteSliceDecodeValue", Types: []reflect.Type{tByteSlice}, Received: val}
- }
-
- if vr.Type() == bsontype.Null {
- val.Set(reflect.Zero(val.Type()))
- return vr.ReadNull()
- }
-
- data, subtype, err := vr.ReadBinary()
- if err != nil {
- return err
- }
- if subtype != 0x00 {
- return fmt.Errorf("ByteSliceDecodeValue can only be used to decode subtype 0x00 for %s, got %v", bsontype.Binary, subtype)
- }
-
- val.Set(reflect.ValueOf(data))
- return nil
-}
-
-// MapDecodeValue is the ValueDecoderFunc for map[string]* types.
-//
-// Deprecated: MapDecodeValue is not registered by default. Use MapCodec.DecodeValue instead.
-func (dvd DefaultValueDecoders) MapDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Kind() != reflect.Map || val.Type().Key().Kind() != reflect.String {
- return ValueDecoderError{Name: "MapDecodeValue", Kinds: []reflect.Kind{reflect.Map}, Received: val}
- }
-
- switch vr.Type() {
- case bsontype.Type(0), bsontype.EmbeddedDocument:
- case bsontype.Null:
- val.Set(reflect.Zero(val.Type()))
- return vr.ReadNull()
- default:
- return fmt.Errorf("cannot decode %v into a %s", vr.Type(), val.Type())
- }
-
- dr, err := vr.ReadDocument()
- if err != nil {
- return err
- }
-
- if val.IsNil() {
- val.Set(reflect.MakeMap(val.Type()))
- }
-
- eType := val.Type().Elem()
- decoder, err := dc.LookupDecoder(eType)
- if err != nil {
- return err
- }
-
- if eType == tEmpty {
- dc.Ancestor = val.Type()
- }
-
- keyType := val.Type().Key()
- for {
- key, vr, err := dr.ReadElement()
- if errors.Is(err, bsonrw.ErrEOD) {
- break
- }
- if err != nil {
- return err
- }
-
- elem := reflect.New(eType).Elem()
-
- err = decoder.DecodeValue(dc, vr, elem)
- if err != nil {
- return err
- }
-
- val.SetMapIndex(reflect.ValueOf(key).Convert(keyType), elem)
- }
- return nil
-}
-
-// ArrayDecodeValue is the ValueDecoderFunc for array types.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value decoders registered.
-func (dvd DefaultValueDecoders) ArrayDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.IsValid() || val.Kind() != reflect.Array {
- return ValueDecoderError{Name: "ArrayDecodeValue", Kinds: []reflect.Kind{reflect.Array}, Received: val}
- }
-
- switch vrType := vr.Type(); vrType {
- case bsontype.Array:
- case bsontype.Type(0), bsontype.EmbeddedDocument:
- if val.Type().Elem() != tE {
- return fmt.Errorf("cannot decode document into %s", val.Type())
- }
- case bsontype.Binary:
- if val.Type().Elem() != tByte {
- return fmt.Errorf("ArrayDecodeValue can only be used to decode binary into a byte array, got %v", vrType)
- }
- data, subtype, err := vr.ReadBinary()
- if err != nil {
- return err
- }
- if subtype != bsontype.BinaryGeneric && subtype != bsontype.BinaryBinaryOld {
- return fmt.Errorf("ArrayDecodeValue can only be used to decode subtype 0x00 or 0x02 for %s, got %v", bsontype.Binary, subtype)
- }
-
- if len(data) > val.Len() {
- return fmt.Errorf("more elements returned in array than can fit inside %s", val.Type())
- }
-
- for idx, elem := range data {
- val.Index(idx).Set(reflect.ValueOf(elem))
- }
- return nil
- case bsontype.Null:
- val.Set(reflect.Zero(val.Type()))
- return vr.ReadNull()
- case bsontype.Undefined:
- val.Set(reflect.Zero(val.Type()))
- return vr.ReadUndefined()
- default:
- return fmt.Errorf("cannot decode %v into an array", vrType)
- }
-
- var elemsFunc func(DecodeContext, bsonrw.ValueReader, reflect.Value) ([]reflect.Value, error)
- switch val.Type().Elem() {
- case tE:
- elemsFunc = dvd.decodeD
- default:
- elemsFunc = dvd.decodeDefault
- }
-
- elems, err := elemsFunc(dc, vr, val)
- if err != nil {
- return err
- }
-
- if len(elems) > val.Len() {
- return fmt.Errorf("more elements returned in array than can fit inside %s, got %v elements", val.Type(), len(elems))
- }
-
- for idx, elem := range elems {
- val.Index(idx).Set(elem)
- }
-
- return nil
-}
-
-// SliceDecodeValue is the ValueDecoderFunc for slice types.
-//
-// Deprecated: SliceDecodeValue is not registered by default. Use SliceCodec.DecodeValue instead.
-func (dvd DefaultValueDecoders) SliceDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Kind() != reflect.Slice {
- return ValueDecoderError{Name: "SliceDecodeValue", Kinds: []reflect.Kind{reflect.Slice}, Received: val}
- }
-
- switch vr.Type() {
- case bsontype.Array:
- case bsontype.Null:
- val.Set(reflect.Zero(val.Type()))
- return vr.ReadNull()
- case bsontype.Type(0), bsontype.EmbeddedDocument:
- if val.Type().Elem() != tE {
- return fmt.Errorf("cannot decode document into %s", val.Type())
- }
- default:
- return fmt.Errorf("cannot decode %v into a slice", vr.Type())
- }
-
- var elemsFunc func(DecodeContext, bsonrw.ValueReader, reflect.Value) ([]reflect.Value, error)
- switch val.Type().Elem() {
- case tE:
- dc.Ancestor = val.Type()
- elemsFunc = dvd.decodeD
- default:
- elemsFunc = dvd.decodeDefault
- }
-
- elems, err := elemsFunc(dc, vr, val)
- if err != nil {
- return err
- }
-
- if val.IsNil() {
- val.Set(reflect.MakeSlice(val.Type(), 0, len(elems)))
- }
-
- val.SetLen(0)
- val.Set(reflect.Append(val, elems...))
-
- return nil
-}
-
-// ValueUnmarshalerDecodeValue is the ValueDecoderFunc for ValueUnmarshaler implementations.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value decoders registered.
-func (dvd DefaultValueDecoders) ValueUnmarshalerDecodeValue(_ DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.IsValid() || (!val.Type().Implements(tValueUnmarshaler) && !reflect.PtrTo(val.Type()).Implements(tValueUnmarshaler)) {
- return ValueDecoderError{Name: "ValueUnmarshalerDecodeValue", Types: []reflect.Type{tValueUnmarshaler}, Received: val}
- }
-
- // If BSON value is null and the go value is a pointer, then don't call
- // UnmarshalBSONValue. Even if the Go pointer is already initialized (i.e.,
- // non-nil), encountering null in BSON will result in the pointer being
- // directly set to nil here. Since the pointer is being replaced with nil,
- // there is no opportunity (or reason) for the custom UnmarshalBSONValue logic
- // to be called.
- if vr.Type() == bsontype.Null && val.Kind() == reflect.Ptr {
- val.Set(reflect.Zero(val.Type()))
-
- return vr.ReadNull()
- }
-
- if val.Kind() == reflect.Ptr && val.IsNil() {
- if !val.CanSet() {
- return ValueDecoderError{Name: "ValueUnmarshalerDecodeValue", Types: []reflect.Type{tValueUnmarshaler}, Received: val}
- }
- val.Set(reflect.New(val.Type().Elem()))
- }
-
- if !val.Type().Implements(tValueUnmarshaler) {
- if !val.CanAddr() {
- return ValueDecoderError{Name: "ValueUnmarshalerDecodeValue", Types: []reflect.Type{tValueUnmarshaler}, Received: val}
- }
- val = val.Addr() // If the type doesn't implement the interface, a pointer to it must.
- }
-
- t, src, err := bsonrw.Copier{}.CopyValueToBytes(vr)
- if err != nil {
- return err
- }
-
- m, ok := val.Interface().(ValueUnmarshaler)
- if !ok {
- // NB: this error should be unreachable due to the above checks
- return ValueDecoderError{Name: "ValueUnmarshalerDecodeValue", Types: []reflect.Type{tValueUnmarshaler}, Received: val}
- }
- return m.UnmarshalBSONValue(t, src)
-}
-
-// UnmarshalerDecodeValue is the ValueDecoderFunc for Unmarshaler implementations.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value decoders registered.
-func (dvd DefaultValueDecoders) UnmarshalerDecodeValue(_ DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.IsValid() || (!val.Type().Implements(tUnmarshaler) && !reflect.PtrTo(val.Type()).Implements(tUnmarshaler)) {
- return ValueDecoderError{Name: "UnmarshalerDecodeValue", Types: []reflect.Type{tUnmarshaler}, Received: val}
- }
-
- if val.Kind() == reflect.Ptr && val.IsNil() {
- if !val.CanSet() {
- return ValueDecoderError{Name: "UnmarshalerDecodeValue", Types: []reflect.Type{tUnmarshaler}, Received: val}
- }
- val.Set(reflect.New(val.Type().Elem()))
- }
-
- _, src, err := bsonrw.Copier{}.CopyValueToBytes(vr)
- if err != nil {
- return err
- }
-
- // If the target Go value is a pointer and the BSON field value is empty, set the value to the
- // zero value of the pointer (nil) and don't call UnmarshalBSON. UnmarshalBSON has no way to
- // change the pointer value from within the function (only the value at the pointer address),
- // so it can't set the pointer to "nil" itself. Since the most common Go value for an empty BSON
- // field value is "nil", we set "nil" here and don't call UnmarshalBSON. This behavior matches
- // the behavior of the Go "encoding/json" unmarshaler when the target Go value is a pointer and
- // the JSON field value is "null".
- if val.Kind() == reflect.Ptr && len(src) == 0 {
- val.Set(reflect.Zero(val.Type()))
- return nil
- }
-
- if !val.Type().Implements(tUnmarshaler) {
- if !val.CanAddr() {
- return ValueDecoderError{Name: "UnmarshalerDecodeValue", Types: []reflect.Type{tUnmarshaler}, Received: val}
- }
- val = val.Addr() // If the type doesn't implement the interface, a pointer to it must.
- }
-
- m, ok := val.Interface().(Unmarshaler)
- if !ok {
- // NB: this error should be unreachable due to the above checks
- return ValueDecoderError{Name: "UnmarshalerDecodeValue", Types: []reflect.Type{tUnmarshaler}, Received: val}
- }
- return m.UnmarshalBSON(src)
-}
-
-// EmptyInterfaceDecodeValue is the ValueDecoderFunc for interface{}.
-//
-// Deprecated: EmptyInterfaceDecodeValue is not registered by default. Use EmptyInterfaceCodec.DecodeValue instead.
-func (dvd DefaultValueDecoders) EmptyInterfaceDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Type() != tEmpty {
- return ValueDecoderError{Name: "EmptyInterfaceDecodeValue", Types: []reflect.Type{tEmpty}, Received: val}
- }
-
- rtype, err := dc.LookupTypeMapEntry(vr.Type())
- if err != nil {
- switch vr.Type() {
- case bsontype.EmbeddedDocument:
- if dc.Ancestor != nil {
- rtype = dc.Ancestor
- break
- }
- rtype = tD
- case bsontype.Null:
- val.Set(reflect.Zero(val.Type()))
- return vr.ReadNull()
- default:
- return err
- }
- }
-
- decoder, err := dc.LookupDecoder(rtype)
- if err != nil {
- return err
- }
-
- elem := reflect.New(rtype).Elem()
- err = decoder.DecodeValue(dc, vr, elem)
- if err != nil {
- return err
- }
-
- val.Set(elem)
- return nil
-}
-
-// CoreDocumentDecodeValue is the ValueDecoderFunc for bsoncore.Document.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value decoders registered.
-func (DefaultValueDecoders) CoreDocumentDecodeValue(_ DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Type() != tCoreDocument {
- return ValueDecoderError{Name: "CoreDocumentDecodeValue", Types: []reflect.Type{tCoreDocument}, Received: val}
- }
-
- if val.IsNil() {
- val.Set(reflect.MakeSlice(val.Type(), 0, 0))
- }
-
- val.SetLen(0)
-
- cdoc, err := bsonrw.Copier{}.AppendDocumentBytes(val.Interface().(bsoncore.Document), vr)
- val.Set(reflect.ValueOf(cdoc))
- return err
-}
-
-func (dvd DefaultValueDecoders) decodeDefault(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) ([]reflect.Value, error) {
- elems := make([]reflect.Value, 0)
-
- ar, err := vr.ReadArray()
- if err != nil {
- return nil, err
- }
-
- eType := val.Type().Elem()
-
- decoder, err := dc.LookupDecoder(eType)
- if err != nil {
- return nil, err
- }
- eTypeDecoder, _ := decoder.(typeDecoder)
-
- idx := 0
- for {
- vr, err := ar.ReadValue()
- if errors.Is(err, bsonrw.ErrEOA) {
- break
- }
- if err != nil {
- return nil, err
- }
-
- elem, err := decodeTypeOrValueWithInfo(decoder, eTypeDecoder, dc, vr, eType, true)
- if err != nil {
- return nil, newDecodeError(strconv.Itoa(idx), err)
- }
- elems = append(elems, elem)
- idx++
- }
-
- return elems, nil
-}
-
-func (dvd DefaultValueDecoders) readCodeWithScope(dc DecodeContext, vr bsonrw.ValueReader) (primitive.CodeWithScope, error) {
- var cws primitive.CodeWithScope
-
- code, dr, err := vr.ReadCodeWithScope()
- if err != nil {
- return cws, err
- }
-
- scope := reflect.New(tD).Elem()
- elems, err := dvd.decodeElemsFromDocumentReader(dc, dr)
- if err != nil {
- return cws, err
- }
-
- scope.Set(reflect.MakeSlice(tD, 0, len(elems)))
- scope.Set(reflect.Append(scope, elems...))
-
- cws = primitive.CodeWithScope{
- Code: primitive.JavaScript(code),
- Scope: scope.Interface().(primitive.D),
- }
- return cws, nil
-}
-
-func (dvd DefaultValueDecoders) codeWithScopeDecodeType(dc DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) {
- if t != tCodeWithScope {
- return emptyValue, ValueDecoderError{
- Name: "CodeWithScopeDecodeValue",
- Types: []reflect.Type{tCodeWithScope},
- Received: reflect.Zero(t),
- }
- }
-
- var cws primitive.CodeWithScope
- var err error
- switch vrType := vr.Type(); vrType {
- case bsontype.CodeWithScope:
- cws, err = dvd.readCodeWithScope(dc, vr)
- case bsontype.Null:
- err = vr.ReadNull()
- case bsontype.Undefined:
- err = vr.ReadUndefined()
- default:
- return emptyValue, fmt.Errorf("cannot decode %v into a primitive.CodeWithScope", vrType)
- }
- if err != nil {
- return emptyValue, err
- }
-
- return reflect.ValueOf(cws), nil
-}
-
-// CodeWithScopeDecodeValue is the ValueDecoderFunc for CodeWithScope.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value decoders registered.
-func (dvd DefaultValueDecoders) CodeWithScopeDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Type() != tCodeWithScope {
- return ValueDecoderError{Name: "CodeWithScopeDecodeValue", Types: []reflect.Type{tCodeWithScope}, Received: val}
- }
-
- elem, err := dvd.codeWithScopeDecodeType(dc, vr, tCodeWithScope)
- if err != nil {
- return err
- }
-
- val.Set(elem)
- return nil
-}
-
-func (dvd DefaultValueDecoders) decodeD(dc DecodeContext, vr bsonrw.ValueReader, _ reflect.Value) ([]reflect.Value, error) {
- switch vr.Type() {
- case bsontype.Type(0), bsontype.EmbeddedDocument:
- default:
- return nil, fmt.Errorf("cannot decode %v into a D", vr.Type())
- }
-
- dr, err := vr.ReadDocument()
- if err != nil {
- return nil, err
- }
-
- return dvd.decodeElemsFromDocumentReader(dc, dr)
-}
-
-func (DefaultValueDecoders) decodeElemsFromDocumentReader(dc DecodeContext, dr bsonrw.DocumentReader) ([]reflect.Value, error) {
- decoder, err := dc.LookupDecoder(tEmpty)
- if err != nil {
- return nil, err
- }
-
- elems := make([]reflect.Value, 0)
- for {
- key, vr, err := dr.ReadElement()
- if errors.Is(err, bsonrw.ErrEOD) {
- break
- }
- if err != nil {
- return nil, err
- }
-
- val := reflect.New(tEmpty).Elem()
- err = decoder.DecodeValue(dc, vr, val)
- if err != nil {
- return nil, newDecodeError(key, err)
- }
-
- elems = append(elems, reflect.ValueOf(primitive.E{Key: key, Value: val.Interface()}))
- }
-
- return elems, nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_encoders.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_encoders.go
deleted file mode 100644
index 4751ae995..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_encoders.go
+++ /dev/null
@@ -1,856 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsoncodec
-
-import (
- "encoding/json"
- "errors"
- "fmt"
- "math"
- "net/url"
- "reflect"
- "sync"
- "time"
-
- "go.mongodb.org/mongo-driver/bson/bsonrw"
- "go.mongodb.org/mongo-driver/bson/bsontype"
- "go.mongodb.org/mongo-driver/bson/primitive"
- "go.mongodb.org/mongo-driver/x/bsonx/bsoncore"
-)
-
-var defaultValueEncoders DefaultValueEncoders
-
-var bvwPool = bsonrw.NewBSONValueWriterPool()
-
-var errInvalidValue = errors.New("cannot encode invalid element")
-
-var sliceWriterPool = sync.Pool{
- New: func() interface{} {
- sw := make(bsonrw.SliceWriter, 0)
- return &sw
- },
-}
-
-func encodeElement(ec EncodeContext, dw bsonrw.DocumentWriter, e primitive.E) error {
- vw, err := dw.WriteDocumentElement(e.Key)
- if err != nil {
- return err
- }
-
- if e.Value == nil {
- return vw.WriteNull()
- }
- encoder, err := ec.LookupEncoder(reflect.TypeOf(e.Value))
- if err != nil {
- return err
- }
-
- err = encoder.EncodeValue(ec, vw, reflect.ValueOf(e.Value))
- if err != nil {
- return err
- }
- return nil
-}
-
-// DefaultValueEncoders is a namespace type for the default ValueEncoders used
-// when creating a registry.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value encoders registered.
-type DefaultValueEncoders struct{}
-
-// RegisterDefaultEncoders will register the encoder methods attached to DefaultValueEncoders with
-// the provided RegistryBuilder.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value encoders registered.
-func (dve DefaultValueEncoders) RegisterDefaultEncoders(rb *RegistryBuilder) {
- if rb == nil {
- panic(errors.New("argument to RegisterDefaultEncoders must not be nil"))
- }
- rb.
- RegisterTypeEncoder(tByteSlice, defaultByteSliceCodec).
- RegisterTypeEncoder(tTime, defaultTimeCodec).
- RegisterTypeEncoder(tEmpty, defaultEmptyInterfaceCodec).
- RegisterTypeEncoder(tCoreArray, defaultArrayCodec).
- RegisterTypeEncoder(tOID, ValueEncoderFunc(dve.ObjectIDEncodeValue)).
- RegisterTypeEncoder(tDecimal, ValueEncoderFunc(dve.Decimal128EncodeValue)).
- RegisterTypeEncoder(tJSONNumber, ValueEncoderFunc(dve.JSONNumberEncodeValue)).
- RegisterTypeEncoder(tURL, ValueEncoderFunc(dve.URLEncodeValue)).
- RegisterTypeEncoder(tJavaScript, ValueEncoderFunc(dve.JavaScriptEncodeValue)).
- RegisterTypeEncoder(tSymbol, ValueEncoderFunc(dve.SymbolEncodeValue)).
- RegisterTypeEncoder(tBinary, ValueEncoderFunc(dve.BinaryEncodeValue)).
- RegisterTypeEncoder(tUndefined, ValueEncoderFunc(dve.UndefinedEncodeValue)).
- RegisterTypeEncoder(tDateTime, ValueEncoderFunc(dve.DateTimeEncodeValue)).
- RegisterTypeEncoder(tNull, ValueEncoderFunc(dve.NullEncodeValue)).
- RegisterTypeEncoder(tRegex, ValueEncoderFunc(dve.RegexEncodeValue)).
- RegisterTypeEncoder(tDBPointer, ValueEncoderFunc(dve.DBPointerEncodeValue)).
- RegisterTypeEncoder(tTimestamp, ValueEncoderFunc(dve.TimestampEncodeValue)).
- RegisterTypeEncoder(tMinKey, ValueEncoderFunc(dve.MinKeyEncodeValue)).
- RegisterTypeEncoder(tMaxKey, ValueEncoderFunc(dve.MaxKeyEncodeValue)).
- RegisterTypeEncoder(tCoreDocument, ValueEncoderFunc(dve.CoreDocumentEncodeValue)).
- RegisterTypeEncoder(tCodeWithScope, ValueEncoderFunc(dve.CodeWithScopeEncodeValue)).
- RegisterDefaultEncoder(reflect.Bool, ValueEncoderFunc(dve.BooleanEncodeValue)).
- RegisterDefaultEncoder(reflect.Int, ValueEncoderFunc(dve.IntEncodeValue)).
- RegisterDefaultEncoder(reflect.Int8, ValueEncoderFunc(dve.IntEncodeValue)).
- RegisterDefaultEncoder(reflect.Int16, ValueEncoderFunc(dve.IntEncodeValue)).
- RegisterDefaultEncoder(reflect.Int32, ValueEncoderFunc(dve.IntEncodeValue)).
- RegisterDefaultEncoder(reflect.Int64, ValueEncoderFunc(dve.IntEncodeValue)).
- RegisterDefaultEncoder(reflect.Uint, defaultUIntCodec).
- RegisterDefaultEncoder(reflect.Uint8, defaultUIntCodec).
- RegisterDefaultEncoder(reflect.Uint16, defaultUIntCodec).
- RegisterDefaultEncoder(reflect.Uint32, defaultUIntCodec).
- RegisterDefaultEncoder(reflect.Uint64, defaultUIntCodec).
- RegisterDefaultEncoder(reflect.Float32, ValueEncoderFunc(dve.FloatEncodeValue)).
- RegisterDefaultEncoder(reflect.Float64, ValueEncoderFunc(dve.FloatEncodeValue)).
- RegisterDefaultEncoder(reflect.Array, ValueEncoderFunc(dve.ArrayEncodeValue)).
- RegisterDefaultEncoder(reflect.Map, defaultMapCodec).
- RegisterDefaultEncoder(reflect.Slice, defaultSliceCodec).
- RegisterDefaultEncoder(reflect.String, defaultStringCodec).
- RegisterDefaultEncoder(reflect.Struct, newDefaultStructCodec()).
- RegisterDefaultEncoder(reflect.Ptr, NewPointerCodec()).
- RegisterHookEncoder(tValueMarshaler, ValueEncoderFunc(dve.ValueMarshalerEncodeValue)).
- RegisterHookEncoder(tMarshaler, ValueEncoderFunc(dve.MarshalerEncodeValue)).
- RegisterHookEncoder(tProxy, ValueEncoderFunc(dve.ProxyEncodeValue))
-}
-
-// BooleanEncodeValue is the ValueEncoderFunc for bool types.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value encoders registered.
-func (dve DefaultValueEncoders) BooleanEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Kind() != reflect.Bool {
- return ValueEncoderError{Name: "BooleanEncodeValue", Kinds: []reflect.Kind{reflect.Bool}, Received: val}
- }
- return vw.WriteBoolean(val.Bool())
-}
-
-func fitsIn32Bits(i int64) bool {
- return math.MinInt32 <= i && i <= math.MaxInt32
-}
-
-// IntEncodeValue is the ValueEncoderFunc for int types.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value encoders registered.
-func (dve DefaultValueEncoders) IntEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- switch val.Kind() {
- case reflect.Int8, reflect.Int16, reflect.Int32:
- return vw.WriteInt32(int32(val.Int()))
- case reflect.Int:
- i64 := val.Int()
- if fitsIn32Bits(i64) {
- return vw.WriteInt32(int32(i64))
- }
- return vw.WriteInt64(i64)
- case reflect.Int64:
- i64 := val.Int()
- if ec.MinSize && fitsIn32Bits(i64) {
- return vw.WriteInt32(int32(i64))
- }
- return vw.WriteInt64(i64)
- }
-
- return ValueEncoderError{
- Name: "IntEncodeValue",
- Kinds: []reflect.Kind{reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int},
- Received: val,
- }
-}
-
-// UintEncodeValue is the ValueEncoderFunc for uint types.
-//
-// Deprecated: UintEncodeValue is not registered by default. Use UintCodec.EncodeValue instead.
-func (dve DefaultValueEncoders) UintEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- switch val.Kind() {
- case reflect.Uint8, reflect.Uint16:
- return vw.WriteInt32(int32(val.Uint()))
- case reflect.Uint, reflect.Uint32, reflect.Uint64:
- u64 := val.Uint()
- if ec.MinSize && u64 <= math.MaxInt32 {
- return vw.WriteInt32(int32(u64))
- }
- if u64 > math.MaxInt64 {
- return fmt.Errorf("%d overflows int64", u64)
- }
- return vw.WriteInt64(int64(u64))
- }
-
- return ValueEncoderError{
- Name: "UintEncodeValue",
- Kinds: []reflect.Kind{reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint},
- Received: val,
- }
-}
-
-// FloatEncodeValue is the ValueEncoderFunc for float types.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value encoders registered.
-func (dve DefaultValueEncoders) FloatEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- switch val.Kind() {
- case reflect.Float32, reflect.Float64:
- return vw.WriteDouble(val.Float())
- }
-
- return ValueEncoderError{Name: "FloatEncodeValue", Kinds: []reflect.Kind{reflect.Float32, reflect.Float64}, Received: val}
-}
-
-// StringEncodeValue is the ValueEncoderFunc for string types.
-//
-// Deprecated: StringEncodeValue is not registered by default. Use StringCodec.EncodeValue instead.
-func (dve DefaultValueEncoders) StringEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if val.Kind() != reflect.String {
- return ValueEncoderError{
- Name: "StringEncodeValue",
- Kinds: []reflect.Kind{reflect.String},
- Received: val,
- }
- }
-
- return vw.WriteString(val.String())
-}
-
-// ObjectIDEncodeValue is the ValueEncoderFunc for primitive.ObjectID.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value encoders registered.
-func (dve DefaultValueEncoders) ObjectIDEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Type() != tOID {
- return ValueEncoderError{Name: "ObjectIDEncodeValue", Types: []reflect.Type{tOID}, Received: val}
- }
- return vw.WriteObjectID(val.Interface().(primitive.ObjectID))
-}
-
-// Decimal128EncodeValue is the ValueEncoderFunc for primitive.Decimal128.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value encoders registered.
-func (dve DefaultValueEncoders) Decimal128EncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Type() != tDecimal {
- return ValueEncoderError{Name: "Decimal128EncodeValue", Types: []reflect.Type{tDecimal}, Received: val}
- }
- return vw.WriteDecimal128(val.Interface().(primitive.Decimal128))
-}
-
-// JSONNumberEncodeValue is the ValueEncoderFunc for json.Number.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value encoders registered.
-func (dve DefaultValueEncoders) JSONNumberEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Type() != tJSONNumber {
- return ValueEncoderError{Name: "JSONNumberEncodeValue", Types: []reflect.Type{tJSONNumber}, Received: val}
- }
- jsnum := val.Interface().(json.Number)
-
- // Attempt int first, then float64
- if i64, err := jsnum.Int64(); err == nil {
- return dve.IntEncodeValue(ec, vw, reflect.ValueOf(i64))
- }
-
- f64, err := jsnum.Float64()
- if err != nil {
- return err
- }
-
- return dve.FloatEncodeValue(ec, vw, reflect.ValueOf(f64))
-}
-
-// URLEncodeValue is the ValueEncoderFunc for url.URL.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value encoders registered.
-func (dve DefaultValueEncoders) URLEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Type() != tURL {
- return ValueEncoderError{Name: "URLEncodeValue", Types: []reflect.Type{tURL}, Received: val}
- }
- u := val.Interface().(url.URL)
- return vw.WriteString(u.String())
-}
-
-// TimeEncodeValue is the ValueEncoderFunc for time.TIme.
-//
-// Deprecated: TimeEncodeValue is not registered by default. Use TimeCodec.EncodeValue instead.
-func (dve DefaultValueEncoders) TimeEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Type() != tTime {
- return ValueEncoderError{Name: "TimeEncodeValue", Types: []reflect.Type{tTime}, Received: val}
- }
- tt := val.Interface().(time.Time)
- dt := primitive.NewDateTimeFromTime(tt)
- return vw.WriteDateTime(int64(dt))
-}
-
-// ByteSliceEncodeValue is the ValueEncoderFunc for []byte.
-//
-// Deprecated: ByteSliceEncodeValue is not registered by default. Use ByteSliceCodec.EncodeValue instead.
-func (dve DefaultValueEncoders) ByteSliceEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Type() != tByteSlice {
- return ValueEncoderError{Name: "ByteSliceEncodeValue", Types: []reflect.Type{tByteSlice}, Received: val}
- }
- if val.IsNil() {
- return vw.WriteNull()
- }
- return vw.WriteBinary(val.Interface().([]byte))
-}
-
-// MapEncodeValue is the ValueEncoderFunc for map[string]* types.
-//
-// Deprecated: MapEncodeValue is not registered by default. Use MapCodec.EncodeValue instead.
-func (dve DefaultValueEncoders) MapEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Kind() != reflect.Map || val.Type().Key().Kind() != reflect.String {
- return ValueEncoderError{Name: "MapEncodeValue", Kinds: []reflect.Kind{reflect.Map}, Received: val}
- }
-
- if val.IsNil() {
- // If we have a nill map but we can't WriteNull, that means we're probably trying to encode
- // to a TopLevel document. We can't currently tell if this is what actually happened, but if
- // there's a deeper underlying problem, the error will also be returned from WriteDocument,
- // so just continue. The operations on a map reflection value are valid, so we can call
- // MapKeys within mapEncodeValue without a problem.
- err := vw.WriteNull()
- if err == nil {
- return nil
- }
- }
-
- dw, err := vw.WriteDocument()
- if err != nil {
- return err
- }
-
- return dve.mapEncodeValue(ec, dw, val, nil)
-}
-
-// mapEncodeValue handles encoding of the values of a map. The collisionFn returns
-// true if the provided key exists, this is mainly used for inline maps in the
-// struct codec.
-func (dve DefaultValueEncoders) mapEncodeValue(ec EncodeContext, dw bsonrw.DocumentWriter, val reflect.Value, collisionFn func(string) bool) error {
-
- elemType := val.Type().Elem()
- encoder, err := ec.LookupEncoder(elemType)
- if err != nil && elemType.Kind() != reflect.Interface {
- return err
- }
-
- keys := val.MapKeys()
- for _, key := range keys {
- if collisionFn != nil && collisionFn(key.String()) {
- return fmt.Errorf("Key %s of inlined map conflicts with a struct field name", key)
- }
-
- currEncoder, currVal, lookupErr := dve.lookupElementEncoder(ec, encoder, val.MapIndex(key))
- if lookupErr != nil && !errors.Is(lookupErr, errInvalidValue) {
- return lookupErr
- }
-
- vw, err := dw.WriteDocumentElement(key.String())
- if err != nil {
- return err
- }
-
- if errors.Is(lookupErr, errInvalidValue) {
- err = vw.WriteNull()
- if err != nil {
- return err
- }
- continue
- }
-
- err = currEncoder.EncodeValue(ec, vw, currVal)
- if err != nil {
- return err
- }
- }
-
- return dw.WriteDocumentEnd()
-}
-
-// ArrayEncodeValue is the ValueEncoderFunc for array types.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value encoders registered.
-func (dve DefaultValueEncoders) ArrayEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Kind() != reflect.Array {
- return ValueEncoderError{Name: "ArrayEncodeValue", Kinds: []reflect.Kind{reflect.Array}, Received: val}
- }
-
- // If we have a []primitive.E we want to treat it as a document instead of as an array.
- if val.Type().Elem() == tE {
- dw, err := vw.WriteDocument()
- if err != nil {
- return err
- }
-
- for idx := 0; idx < val.Len(); idx++ {
- e := val.Index(idx).Interface().(primitive.E)
- err = encodeElement(ec, dw, e)
- if err != nil {
- return err
- }
- }
-
- return dw.WriteDocumentEnd()
- }
-
- // If we have a []byte we want to treat it as a binary instead of as an array.
- if val.Type().Elem() == tByte {
- var byteSlice []byte
- for idx := 0; idx < val.Len(); idx++ {
- byteSlice = append(byteSlice, val.Index(idx).Interface().(byte))
- }
- return vw.WriteBinary(byteSlice)
- }
-
- aw, err := vw.WriteArray()
- if err != nil {
- return err
- }
-
- elemType := val.Type().Elem()
- encoder, err := ec.LookupEncoder(elemType)
- if err != nil && elemType.Kind() != reflect.Interface {
- return err
- }
-
- for idx := 0; idx < val.Len(); idx++ {
- currEncoder, currVal, lookupErr := dve.lookupElementEncoder(ec, encoder, val.Index(idx))
- if lookupErr != nil && !errors.Is(lookupErr, errInvalidValue) {
- return lookupErr
- }
-
- vw, err := aw.WriteArrayElement()
- if err != nil {
- return err
- }
-
- if errors.Is(lookupErr, errInvalidValue) {
- err = vw.WriteNull()
- if err != nil {
- return err
- }
- continue
- }
-
- err = currEncoder.EncodeValue(ec, vw, currVal)
- if err != nil {
- return err
- }
- }
- return aw.WriteArrayEnd()
-}
-
-// SliceEncodeValue is the ValueEncoderFunc for slice types.
-//
-// Deprecated: SliceEncodeValue is not registered by default. Use SliceCodec.EncodeValue instead.
-func (dve DefaultValueEncoders) SliceEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Kind() != reflect.Slice {
- return ValueEncoderError{Name: "SliceEncodeValue", Kinds: []reflect.Kind{reflect.Slice}, Received: val}
- }
-
- if val.IsNil() {
- return vw.WriteNull()
- }
-
- // If we have a []primitive.E we want to treat it as a document instead of as an array.
- if val.Type().ConvertibleTo(tD) {
- d := val.Convert(tD).Interface().(primitive.D)
-
- dw, err := vw.WriteDocument()
- if err != nil {
- return err
- }
-
- for _, e := range d {
- err = encodeElement(ec, dw, e)
- if err != nil {
- return err
- }
- }
-
- return dw.WriteDocumentEnd()
- }
-
- aw, err := vw.WriteArray()
- if err != nil {
- return err
- }
-
- elemType := val.Type().Elem()
- encoder, err := ec.LookupEncoder(elemType)
- if err != nil && elemType.Kind() != reflect.Interface {
- return err
- }
-
- for idx := 0; idx < val.Len(); idx++ {
- currEncoder, currVal, lookupErr := dve.lookupElementEncoder(ec, encoder, val.Index(idx))
- if lookupErr != nil && !errors.Is(lookupErr, errInvalidValue) {
- return lookupErr
- }
-
- vw, err := aw.WriteArrayElement()
- if err != nil {
- return err
- }
-
- if errors.Is(lookupErr, errInvalidValue) {
- err = vw.WriteNull()
- if err != nil {
- return err
- }
- continue
- }
-
- err = currEncoder.EncodeValue(ec, vw, currVal)
- if err != nil {
- return err
- }
- }
- return aw.WriteArrayEnd()
-}
-
-func (dve DefaultValueEncoders) lookupElementEncoder(ec EncodeContext, origEncoder ValueEncoder, currVal reflect.Value) (ValueEncoder, reflect.Value, error) {
- if origEncoder != nil || (currVal.Kind() != reflect.Interface) {
- return origEncoder, currVal, nil
- }
- currVal = currVal.Elem()
- if !currVal.IsValid() {
- return nil, currVal, errInvalidValue
- }
- currEncoder, err := ec.LookupEncoder(currVal.Type())
-
- return currEncoder, currVal, err
-}
-
-// EmptyInterfaceEncodeValue is the ValueEncoderFunc for interface{}.
-//
-// Deprecated: EmptyInterfaceEncodeValue is not registered by default. Use EmptyInterfaceCodec.EncodeValue instead.
-func (dve DefaultValueEncoders) EmptyInterfaceEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Type() != tEmpty {
- return ValueEncoderError{Name: "EmptyInterfaceEncodeValue", Types: []reflect.Type{tEmpty}, Received: val}
- }
-
- if val.IsNil() {
- return vw.WriteNull()
- }
- encoder, err := ec.LookupEncoder(val.Elem().Type())
- if err != nil {
- return err
- }
-
- return encoder.EncodeValue(ec, vw, val.Elem())
-}
-
-// ValueMarshalerEncodeValue is the ValueEncoderFunc for ValueMarshaler implementations.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value encoders registered.
-func (dve DefaultValueEncoders) ValueMarshalerEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- // Either val or a pointer to val must implement ValueMarshaler
- switch {
- case !val.IsValid():
- return ValueEncoderError{Name: "ValueMarshalerEncodeValue", Types: []reflect.Type{tValueMarshaler}, Received: val}
- case val.Type().Implements(tValueMarshaler):
- // If ValueMarshaler is implemented on a concrete type, make sure that val isn't a nil pointer
- if isImplementationNil(val, tValueMarshaler) {
- return vw.WriteNull()
- }
- case reflect.PtrTo(val.Type()).Implements(tValueMarshaler) && val.CanAddr():
- val = val.Addr()
- default:
- return ValueEncoderError{Name: "ValueMarshalerEncodeValue", Types: []reflect.Type{tValueMarshaler}, Received: val}
- }
-
- m, ok := val.Interface().(ValueMarshaler)
- if !ok {
- return vw.WriteNull()
- }
- t, data, err := m.MarshalBSONValue()
- if err != nil {
- return err
- }
- return bsonrw.Copier{}.CopyValueFromBytes(vw, t, data)
-}
-
-// MarshalerEncodeValue is the ValueEncoderFunc for Marshaler implementations.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value encoders registered.
-func (dve DefaultValueEncoders) MarshalerEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- // Either val or a pointer to val must implement Marshaler
- switch {
- case !val.IsValid():
- return ValueEncoderError{Name: "MarshalerEncodeValue", Types: []reflect.Type{tMarshaler}, Received: val}
- case val.Type().Implements(tMarshaler):
- // If Marshaler is implemented on a concrete type, make sure that val isn't a nil pointer
- if isImplementationNil(val, tMarshaler) {
- return vw.WriteNull()
- }
- case reflect.PtrTo(val.Type()).Implements(tMarshaler) && val.CanAddr():
- val = val.Addr()
- default:
- return ValueEncoderError{Name: "MarshalerEncodeValue", Types: []reflect.Type{tMarshaler}, Received: val}
- }
-
- m, ok := val.Interface().(Marshaler)
- if !ok {
- return vw.WriteNull()
- }
- data, err := m.MarshalBSON()
- if err != nil {
- return err
- }
- return bsonrw.Copier{}.CopyValueFromBytes(vw, bsontype.EmbeddedDocument, data)
-}
-
-// ProxyEncodeValue is the ValueEncoderFunc for Proxy implementations.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value encoders registered.
-func (dve DefaultValueEncoders) ProxyEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- // Either val or a pointer to val must implement Proxy
- switch {
- case !val.IsValid():
- return ValueEncoderError{Name: "ProxyEncodeValue", Types: []reflect.Type{tProxy}, Received: val}
- case val.Type().Implements(tProxy):
- // If Proxy is implemented on a concrete type, make sure that val isn't a nil pointer
- if isImplementationNil(val, tProxy) {
- return vw.WriteNull()
- }
- case reflect.PtrTo(val.Type()).Implements(tProxy) && val.CanAddr():
- val = val.Addr()
- default:
- return ValueEncoderError{Name: "ProxyEncodeValue", Types: []reflect.Type{tProxy}, Received: val}
- }
-
- m, ok := val.Interface().(Proxy)
- if !ok {
- return vw.WriteNull()
- }
- v, err := m.ProxyBSON()
- if err != nil {
- return err
- }
- if v == nil {
- encoder, err := ec.LookupEncoder(nil)
- if err != nil {
- return err
- }
- return encoder.EncodeValue(ec, vw, reflect.ValueOf(nil))
- }
- vv := reflect.ValueOf(v)
- switch vv.Kind() {
- case reflect.Ptr, reflect.Interface:
- vv = vv.Elem()
- }
- encoder, err := ec.LookupEncoder(vv.Type())
- if err != nil {
- return err
- }
- return encoder.EncodeValue(ec, vw, vv)
-}
-
-// JavaScriptEncodeValue is the ValueEncoderFunc for the primitive.JavaScript type.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value encoders registered.
-func (DefaultValueEncoders) JavaScriptEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Type() != tJavaScript {
- return ValueEncoderError{Name: "JavaScriptEncodeValue", Types: []reflect.Type{tJavaScript}, Received: val}
- }
-
- return vw.WriteJavascript(val.String())
-}
-
-// SymbolEncodeValue is the ValueEncoderFunc for the primitive.Symbol type.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value encoders registered.
-func (DefaultValueEncoders) SymbolEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Type() != tSymbol {
- return ValueEncoderError{Name: "SymbolEncodeValue", Types: []reflect.Type{tSymbol}, Received: val}
- }
-
- return vw.WriteSymbol(val.String())
-}
-
-// BinaryEncodeValue is the ValueEncoderFunc for Binary.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value encoders registered.
-func (DefaultValueEncoders) BinaryEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Type() != tBinary {
- return ValueEncoderError{Name: "BinaryEncodeValue", Types: []reflect.Type{tBinary}, Received: val}
- }
- b := val.Interface().(primitive.Binary)
-
- return vw.WriteBinaryWithSubtype(b.Data, b.Subtype)
-}
-
-// UndefinedEncodeValue is the ValueEncoderFunc for Undefined.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value encoders registered.
-func (DefaultValueEncoders) UndefinedEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Type() != tUndefined {
- return ValueEncoderError{Name: "UndefinedEncodeValue", Types: []reflect.Type{tUndefined}, Received: val}
- }
-
- return vw.WriteUndefined()
-}
-
-// DateTimeEncodeValue is the ValueEncoderFunc for DateTime.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value encoders registered.
-func (DefaultValueEncoders) DateTimeEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Type() != tDateTime {
- return ValueEncoderError{Name: "DateTimeEncodeValue", Types: []reflect.Type{tDateTime}, Received: val}
- }
-
- return vw.WriteDateTime(val.Int())
-}
-
-// NullEncodeValue is the ValueEncoderFunc for Null.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value encoders registered.
-func (DefaultValueEncoders) NullEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Type() != tNull {
- return ValueEncoderError{Name: "NullEncodeValue", Types: []reflect.Type{tNull}, Received: val}
- }
-
- return vw.WriteNull()
-}
-
-// RegexEncodeValue is the ValueEncoderFunc for Regex.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value encoders registered.
-func (DefaultValueEncoders) RegexEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Type() != tRegex {
- return ValueEncoderError{Name: "RegexEncodeValue", Types: []reflect.Type{tRegex}, Received: val}
- }
-
- regex := val.Interface().(primitive.Regex)
-
- return vw.WriteRegex(regex.Pattern, regex.Options)
-}
-
-// DBPointerEncodeValue is the ValueEncoderFunc for DBPointer.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value encoders registered.
-func (DefaultValueEncoders) DBPointerEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Type() != tDBPointer {
- return ValueEncoderError{Name: "DBPointerEncodeValue", Types: []reflect.Type{tDBPointer}, Received: val}
- }
-
- dbp := val.Interface().(primitive.DBPointer)
-
- return vw.WriteDBPointer(dbp.DB, dbp.Pointer)
-}
-
-// TimestampEncodeValue is the ValueEncoderFunc for Timestamp.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value encoders registered.
-func (DefaultValueEncoders) TimestampEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Type() != tTimestamp {
- return ValueEncoderError{Name: "TimestampEncodeValue", Types: []reflect.Type{tTimestamp}, Received: val}
- }
-
- ts := val.Interface().(primitive.Timestamp)
-
- return vw.WriteTimestamp(ts.T, ts.I)
-}
-
-// MinKeyEncodeValue is the ValueEncoderFunc for MinKey.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value encoders registered.
-func (DefaultValueEncoders) MinKeyEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Type() != tMinKey {
- return ValueEncoderError{Name: "MinKeyEncodeValue", Types: []reflect.Type{tMinKey}, Received: val}
- }
-
- return vw.WriteMinKey()
-}
-
-// MaxKeyEncodeValue is the ValueEncoderFunc for MaxKey.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value encoders registered.
-func (DefaultValueEncoders) MaxKeyEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Type() != tMaxKey {
- return ValueEncoderError{Name: "MaxKeyEncodeValue", Types: []reflect.Type{tMaxKey}, Received: val}
- }
-
- return vw.WriteMaxKey()
-}
-
-// CoreDocumentEncodeValue is the ValueEncoderFunc for bsoncore.Document.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value encoders registered.
-func (DefaultValueEncoders) CoreDocumentEncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Type() != tCoreDocument {
- return ValueEncoderError{Name: "CoreDocumentEncodeValue", Types: []reflect.Type{tCoreDocument}, Received: val}
- }
-
- cdoc := val.Interface().(bsoncore.Document)
-
- return bsonrw.Copier{}.CopyDocumentFromBytes(vw, cdoc)
-}
-
-// CodeWithScopeEncodeValue is the ValueEncoderFunc for CodeWithScope.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.NewRegistry] to get a registry with all default
-// value encoders registered.
-func (dve DefaultValueEncoders) CodeWithScopeEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Type() != tCodeWithScope {
- return ValueEncoderError{Name: "CodeWithScopeEncodeValue", Types: []reflect.Type{tCodeWithScope}, Received: val}
- }
-
- cws := val.Interface().(primitive.CodeWithScope)
-
- dw, err := vw.WriteCodeWithScope(string(cws.Code))
- if err != nil {
- return err
- }
-
- sw := sliceWriterPool.Get().(*bsonrw.SliceWriter)
- defer sliceWriterPool.Put(sw)
- *sw = (*sw)[:0]
-
- scopeVW := bvwPool.Get(sw)
- defer bvwPool.Put(scopeVW)
-
- encoder, err := ec.LookupEncoder(reflect.TypeOf(cws.Scope))
- if err != nil {
- return err
- }
-
- err = encoder.EncodeValue(ec, scopeVW, reflect.ValueOf(cws.Scope))
- if err != nil {
- return err
- }
-
- err = bsonrw.Copier{}.CopyBytesToDocumentWriter(dw, *sw)
- if err != nil {
- return err
- }
- return dw.WriteDocumentEnd()
-}
-
-// isImplementationNil returns if val is a nil pointer and inter is implemented on a concrete type
-func isImplementationNil(val reflect.Value, inter reflect.Type) bool {
- vt := val.Type()
- for vt.Kind() == reflect.Ptr {
- vt = vt.Elem()
- }
- return vt.Implements(inter) && val.Kind() == reflect.Ptr && val.IsNil()
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/doc.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/doc.go
deleted file mode 100644
index 4613e5a1e..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/doc.go
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2022-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-// Package bsoncodec provides a system for encoding values to BSON representations and decoding
-// values from BSON representations. This package considers both binary BSON and ExtendedJSON as
-// BSON representations. The types in this package enable a flexible system for handling this
-// encoding and decoding.
-//
-// The codec system is composed of two parts:
-//
-// 1) ValueEncoders and ValueDecoders that handle encoding and decoding Go values to and from BSON
-// representations.
-//
-// 2) A Registry that holds these ValueEncoders and ValueDecoders and provides methods for
-// retrieving them.
-//
-// # ValueEncoders and ValueDecoders
-//
-// The ValueEncoder interface is implemented by types that can encode a provided Go type to BSON.
-// The value to encode is provided as a reflect.Value and a bsonrw.ValueWriter is used within the
-// EncodeValue method to actually create the BSON representation. For convenience, ValueEncoderFunc
-// is provided to allow use of a function with the correct signature as a ValueEncoder. An
-// EncodeContext instance is provided to allow implementations to lookup further ValueEncoders and
-// to provide configuration information.
-//
-// The ValueDecoder interface is the inverse of the ValueEncoder. Implementations should ensure that
-// the value they receive is settable. Similar to ValueEncoderFunc, ValueDecoderFunc is provided to
-// allow the use of a function with the correct signature as a ValueDecoder. A DecodeContext
-// instance is provided and serves similar functionality to the EncodeContext.
-//
-// # Registry
-//
-// A Registry is a store for ValueEncoders, ValueDecoders, and a type map. See the Registry type
-// documentation for examples of registering various custom encoders and decoders. A Registry can
-// have three main types of codecs:
-//
-// 1. Type encoders/decoders - These can be registered using the RegisterTypeEncoder and
-// RegisterTypeDecoder methods. The registered codec will be invoked when encoding/decoding a value
-// whose type matches the registered type exactly.
-// If the registered type is an interface, the codec will be invoked when encoding or decoding
-// values whose type is the interface, but not for values with concrete types that implement the
-// interface.
-//
-// 2. Hook encoders/decoders - These can be registered using the RegisterHookEncoder and
-// RegisterHookDecoder methods. These methods only accept interface types and the registered codecs
-// will be invoked when encoding or decoding values whose types implement the interface. An example
-// of a hook defined by the driver is bson.Marshaler. The driver will call the MarshalBSON method
-// for any value whose type implements bson.Marshaler, regardless of the value's concrete type.
-//
-// 3. Type map entries - This can be used to associate a BSON type with a Go type. These type
-// associations are used when decoding into a bson.D/bson.M or a struct field of type interface{}.
-// For example, by default, BSON int32 and int64 values decode as Go int32 and int64 instances,
-// respectively, when decoding into a bson.D. The following code would change the behavior so these
-// values decode as Go int instances instead:
-//
-// intType := reflect.TypeOf(int(0))
-// registry.RegisterTypeMapEntry(bsontype.Int32, intType).RegisterTypeMapEntry(bsontype.Int64, intType)
-//
-// 4. Kind encoder/decoders - These can be registered using the RegisterDefaultEncoder and
-// RegisterDefaultDecoder methods. The registered codec will be invoked when encoding or decoding
-// values whose reflect.Kind matches the registered reflect.Kind as long as the value's type doesn't
-// match a registered type or hook encoder/decoder first. These methods should be used to change the
-// behavior for all values for a specific kind.
-//
-// # Registry Lookup Procedure
-//
-// When looking up an encoder in a Registry, the precedence rules are as follows:
-//
-// 1. A type encoder registered for the exact type of the value.
-//
-// 2. A hook encoder registered for an interface that is implemented by the value or by a pointer to
-// the value. If the value matches multiple hooks (e.g. the type implements bsoncodec.Marshaler and
-// bsoncodec.ValueMarshaler), the first one registered will be selected. Note that registries
-// constructed using bson.NewRegistry have driver-defined hooks registered for the
-// bsoncodec.Marshaler, bsoncodec.ValueMarshaler, and bsoncodec.Proxy interfaces, so those will take
-// precedence over any new hooks.
-//
-// 3. A kind encoder registered for the value's kind.
-//
-// If all of these lookups fail to find an encoder, an error of type ErrNoEncoder is returned. The
-// same precedence rules apply for decoders, with the exception that an error of type ErrNoDecoder
-// will be returned if no decoder is found.
-//
-// # DefaultValueEncoders and DefaultValueDecoders
-//
-// The DefaultValueEncoders and DefaultValueDecoders types provide a full set of ValueEncoders and
-// ValueDecoders for handling a wide range of Go types, including all of the types within the
-// primitive package. To make registering these codecs easier, a helper method on each type is
-// provided. For the DefaultValueEncoders type the method is called RegisterDefaultEncoders and for
-// the DefaultValueDecoders type the method is called RegisterDefaultDecoders, this method also
-// handles registering type map entries for each BSON type.
-package bsoncodec
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/empty_interface_codec.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/empty_interface_codec.go
deleted file mode 100644
index 098368f07..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/empty_interface_codec.go
+++ /dev/null
@@ -1,173 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsoncodec
-
-import (
- "reflect"
-
- "go.mongodb.org/mongo-driver/bson/bsonoptions"
- "go.mongodb.org/mongo-driver/bson/bsonrw"
- "go.mongodb.org/mongo-driver/bson/bsontype"
- "go.mongodb.org/mongo-driver/bson/primitive"
-)
-
-// EmptyInterfaceCodec is the Codec used for interface{} values.
-//
-// Deprecated: EmptyInterfaceCodec will not be directly configurable in Go
-// Driver 2.0. To configure the empty interface encode and decode behavior, use
-// the configuration methods on a [go.mongodb.org/mongo-driver/bson.Encoder] or
-// [go.mongodb.org/mongo-driver/bson.Decoder]. To configure the empty interface
-// encode and decode behavior for a mongo.Client, use
-// [go.mongodb.org/mongo-driver/mongo/options.ClientOptions.SetBSONOptions].
-//
-// For example, to configure a mongo.Client to unmarshal BSON binary field
-// values as a Go byte slice, use:
-//
-// opt := options.Client().SetBSONOptions(&options.BSONOptions{
-// BinaryAsSlice: true,
-// })
-//
-// See the deprecation notice for each field in EmptyInterfaceCodec for the
-// corresponding settings.
-type EmptyInterfaceCodec struct {
- // DecodeBinaryAsSlice causes DecodeValue to unmarshal BSON binary field values that are the
- // "Generic" or "Old" BSON binary subtype as a Go byte slice instead of a primitive.Binary.
- //
- // Deprecated: Use bson.Decoder.BinaryAsSlice or options.BSONOptions.BinaryAsSlice instead.
- DecodeBinaryAsSlice bool
-}
-
-var (
- defaultEmptyInterfaceCodec = NewEmptyInterfaceCodec()
-
- // Assert that defaultEmptyInterfaceCodec satisfies the typeDecoder interface, which allows it
- // to be used by collection type decoders (e.g. map, slice, etc) to set individual values in a
- // collection.
- _ typeDecoder = defaultEmptyInterfaceCodec
-)
-
-// NewEmptyInterfaceCodec returns a EmptyInterfaceCodec with options opts.
-//
-// Deprecated: NewEmptyInterfaceCodec will not be available in Go Driver 2.0. See
-// [EmptyInterfaceCodec] for more details.
-func NewEmptyInterfaceCodec(opts ...*bsonoptions.EmptyInterfaceCodecOptions) *EmptyInterfaceCodec {
- interfaceOpt := bsonoptions.MergeEmptyInterfaceCodecOptions(opts...)
-
- codec := EmptyInterfaceCodec{}
- if interfaceOpt.DecodeBinaryAsSlice != nil {
- codec.DecodeBinaryAsSlice = *interfaceOpt.DecodeBinaryAsSlice
- }
- return &codec
-}
-
-// EncodeValue is the ValueEncoderFunc for interface{}.
-func (eic EmptyInterfaceCodec) EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Type() != tEmpty {
- return ValueEncoderError{Name: "EmptyInterfaceEncodeValue", Types: []reflect.Type{tEmpty}, Received: val}
- }
-
- if val.IsNil() {
- return vw.WriteNull()
- }
- encoder, err := ec.LookupEncoder(val.Elem().Type())
- if err != nil {
- return err
- }
-
- return encoder.EncodeValue(ec, vw, val.Elem())
-}
-
-func (eic EmptyInterfaceCodec) getEmptyInterfaceDecodeType(dc DecodeContext, valueType bsontype.Type) (reflect.Type, error) {
- isDocument := valueType == bsontype.Type(0) || valueType == bsontype.EmbeddedDocument
- if isDocument {
- if dc.defaultDocumentType != nil {
- // If the bsontype is an embedded document and the DocumentType is set on the DecodeContext, then return
- // that type.
- return dc.defaultDocumentType, nil
- }
- if dc.Ancestor != nil {
- // Using ancestor information rather than looking up the type map entry forces consistent decoding.
- // If we're decoding into a bson.D, subdocuments should also be decoded as bson.D, even if a type map entry
- // has been registered.
- return dc.Ancestor, nil
- }
- }
-
- rtype, err := dc.LookupTypeMapEntry(valueType)
- if err == nil {
- return rtype, nil
- }
-
- if isDocument {
- // For documents, fallback to looking up a type map entry for bsontype.Type(0) or bsontype.EmbeddedDocument,
- // depending on the original valueType.
- var lookupType bsontype.Type
- switch valueType {
- case bsontype.Type(0):
- lookupType = bsontype.EmbeddedDocument
- case bsontype.EmbeddedDocument:
- lookupType = bsontype.Type(0)
- }
-
- rtype, err = dc.LookupTypeMapEntry(lookupType)
- if err == nil {
- return rtype, nil
- }
- }
-
- return nil, err
-}
-
-func (eic EmptyInterfaceCodec) decodeType(dc DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) {
- if t != tEmpty {
- return emptyValue, ValueDecoderError{Name: "EmptyInterfaceDecodeValue", Types: []reflect.Type{tEmpty}, Received: reflect.Zero(t)}
- }
-
- rtype, err := eic.getEmptyInterfaceDecodeType(dc, vr.Type())
- if err != nil {
- switch vr.Type() {
- case bsontype.Null:
- return reflect.Zero(t), vr.ReadNull()
- default:
- return emptyValue, err
- }
- }
-
- decoder, err := dc.LookupDecoder(rtype)
- if err != nil {
- return emptyValue, err
- }
-
- elem, err := decodeTypeOrValue(decoder, dc, vr, rtype)
- if err != nil {
- return emptyValue, err
- }
-
- if (eic.DecodeBinaryAsSlice || dc.binaryAsSlice) && rtype == tBinary {
- binElem := elem.Interface().(primitive.Binary)
- if binElem.Subtype == bsontype.BinaryGeneric || binElem.Subtype == bsontype.BinaryBinaryOld {
- elem = reflect.ValueOf(binElem.Data)
- }
- }
-
- return elem, nil
-}
-
-// DecodeValue is the ValueDecoderFunc for interface{}.
-func (eic EmptyInterfaceCodec) DecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Type() != tEmpty {
- return ValueDecoderError{Name: "EmptyInterfaceDecodeValue", Types: []reflect.Type{tEmpty}, Received: val}
- }
-
- elem, err := eic.decodeType(dc, vr, val.Type())
- if err != nil {
- return err
- }
-
- val.Set(elem)
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/map_codec.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/map_codec.go
deleted file mode 100644
index d7e00ffa8..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/map_codec.go
+++ /dev/null
@@ -1,343 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsoncodec
-
-import (
- "encoding"
- "errors"
- "fmt"
- "reflect"
- "strconv"
-
- "go.mongodb.org/mongo-driver/bson/bsonoptions"
- "go.mongodb.org/mongo-driver/bson/bsonrw"
- "go.mongodb.org/mongo-driver/bson/bsontype"
-)
-
-var defaultMapCodec = NewMapCodec()
-
-// MapCodec is the Codec used for map values.
-//
-// Deprecated: MapCodec will not be directly configurable in Go Driver 2.0. To
-// configure the map encode and decode behavior, use the configuration methods
-// on a [go.mongodb.org/mongo-driver/bson.Encoder] or
-// [go.mongodb.org/mongo-driver/bson.Decoder]. To configure the map encode and
-// decode behavior for a mongo.Client, use
-// [go.mongodb.org/mongo-driver/mongo/options.ClientOptions.SetBSONOptions].
-//
-// For example, to configure a mongo.Client to marshal nil Go maps as empty BSON
-// documents, use:
-//
-// opt := options.Client().SetBSONOptions(&options.BSONOptions{
-// NilMapAsEmpty: true,
-// })
-//
-// See the deprecation notice for each field in MapCodec for the corresponding
-// settings.
-type MapCodec struct {
- // DecodeZerosMap causes DecodeValue to delete any existing values from Go maps in the destination
- // value passed to Decode before unmarshaling BSON documents into them.
- //
- // Deprecated: Use bson.Decoder.ZeroMaps or options.BSONOptions.ZeroMaps instead.
- DecodeZerosMap bool
-
- // EncodeNilAsEmpty causes EncodeValue to marshal nil Go maps as empty BSON documents instead of
- // BSON null.
- //
- // Deprecated: Use bson.Encoder.NilMapAsEmpty or options.BSONOptions.NilMapAsEmpty instead.
- EncodeNilAsEmpty bool
-
- // EncodeKeysWithStringer causes the Encoder to convert Go map keys to BSON document field name
- // strings using fmt.Sprintf() instead of the default string conversion logic.
- //
- // Deprecated: Use bson.Encoder.StringifyMapKeysWithFmt or
- // options.BSONOptions.StringifyMapKeysWithFmt instead.
- EncodeKeysWithStringer bool
-}
-
-// KeyMarshaler is the interface implemented by an object that can marshal itself into a string key.
-// This applies to types used as map keys and is similar to encoding.TextMarshaler.
-type KeyMarshaler interface {
- MarshalKey() (key string, err error)
-}
-
-// KeyUnmarshaler is the interface implemented by an object that can unmarshal a string representation
-// of itself. This applies to types used as map keys and is similar to encoding.TextUnmarshaler.
-//
-// UnmarshalKey must be able to decode the form generated by MarshalKey.
-// UnmarshalKey must copy the text if it wishes to retain the text
-// after returning.
-type KeyUnmarshaler interface {
- UnmarshalKey(key string) error
-}
-
-// NewMapCodec returns a MapCodec with options opts.
-//
-// Deprecated: NewMapCodec will not be available in Go Driver 2.0. See
-// [MapCodec] for more details.
-func NewMapCodec(opts ...*bsonoptions.MapCodecOptions) *MapCodec {
- mapOpt := bsonoptions.MergeMapCodecOptions(opts...)
-
- codec := MapCodec{}
- if mapOpt.DecodeZerosMap != nil {
- codec.DecodeZerosMap = *mapOpt.DecodeZerosMap
- }
- if mapOpt.EncodeNilAsEmpty != nil {
- codec.EncodeNilAsEmpty = *mapOpt.EncodeNilAsEmpty
- }
- if mapOpt.EncodeKeysWithStringer != nil {
- codec.EncodeKeysWithStringer = *mapOpt.EncodeKeysWithStringer
- }
- return &codec
-}
-
-// EncodeValue is the ValueEncoder for map[*]* types.
-func (mc *MapCodec) EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Kind() != reflect.Map {
- return ValueEncoderError{Name: "MapEncodeValue", Kinds: []reflect.Kind{reflect.Map}, Received: val}
- }
-
- if val.IsNil() && !mc.EncodeNilAsEmpty && !ec.nilMapAsEmpty {
- // If we have a nil map but we can't WriteNull, that means we're probably trying to encode
- // to a TopLevel document. We can't currently tell if this is what actually happened, but if
- // there's a deeper underlying problem, the error will also be returned from WriteDocument,
- // so just continue. The operations on a map reflection value are valid, so we can call
- // MapKeys within mapEncodeValue without a problem.
- err := vw.WriteNull()
- if err == nil {
- return nil
- }
- }
-
- dw, err := vw.WriteDocument()
- if err != nil {
- return err
- }
-
- return mc.mapEncodeValue(ec, dw, val, nil)
-}
-
-// mapEncodeValue handles encoding of the values of a map. The collisionFn returns
-// true if the provided key exists, this is mainly used for inline maps in the
-// struct codec.
-func (mc *MapCodec) mapEncodeValue(ec EncodeContext, dw bsonrw.DocumentWriter, val reflect.Value, collisionFn func(string) bool) error {
-
- elemType := val.Type().Elem()
- encoder, err := ec.LookupEncoder(elemType)
- if err != nil && elemType.Kind() != reflect.Interface {
- return err
- }
-
- keys := val.MapKeys()
- for _, key := range keys {
- keyStr, err := mc.encodeKey(key, ec.stringifyMapKeysWithFmt)
- if err != nil {
- return err
- }
-
- if collisionFn != nil && collisionFn(keyStr) {
- return fmt.Errorf("Key %s of inlined map conflicts with a struct field name", key)
- }
-
- currEncoder, currVal, lookupErr := defaultValueEncoders.lookupElementEncoder(ec, encoder, val.MapIndex(key))
- if lookupErr != nil && !errors.Is(lookupErr, errInvalidValue) {
- return lookupErr
- }
-
- vw, err := dw.WriteDocumentElement(keyStr)
- if err != nil {
- return err
- }
-
- if errors.Is(lookupErr, errInvalidValue) {
- err = vw.WriteNull()
- if err != nil {
- return err
- }
- continue
- }
-
- err = currEncoder.EncodeValue(ec, vw, currVal)
- if err != nil {
- return err
- }
- }
-
- return dw.WriteDocumentEnd()
-}
-
-// DecodeValue is the ValueDecoder for map[string/decimal]* types.
-func (mc *MapCodec) DecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if val.Kind() != reflect.Map || (!val.CanSet() && val.IsNil()) {
- return ValueDecoderError{Name: "MapDecodeValue", Kinds: []reflect.Kind{reflect.Map}, Received: val}
- }
-
- switch vrType := vr.Type(); vrType {
- case bsontype.Type(0), bsontype.EmbeddedDocument:
- case bsontype.Null:
- val.Set(reflect.Zero(val.Type()))
- return vr.ReadNull()
- case bsontype.Undefined:
- val.Set(reflect.Zero(val.Type()))
- return vr.ReadUndefined()
- default:
- return fmt.Errorf("cannot decode %v into a %s", vrType, val.Type())
- }
-
- dr, err := vr.ReadDocument()
- if err != nil {
- return err
- }
-
- if val.IsNil() {
- val.Set(reflect.MakeMap(val.Type()))
- }
-
- if val.Len() > 0 && (mc.DecodeZerosMap || dc.zeroMaps) {
- clearMap(val)
- }
-
- eType := val.Type().Elem()
- decoder, err := dc.LookupDecoder(eType)
- if err != nil {
- return err
- }
- eTypeDecoder, _ := decoder.(typeDecoder)
-
- if eType == tEmpty {
- dc.Ancestor = val.Type()
- }
-
- keyType := val.Type().Key()
-
- for {
- key, vr, err := dr.ReadElement()
- if errors.Is(err, bsonrw.ErrEOD) {
- break
- }
- if err != nil {
- return err
- }
-
- k, err := mc.decodeKey(key, keyType)
- if err != nil {
- return err
- }
-
- elem, err := decodeTypeOrValueWithInfo(decoder, eTypeDecoder, dc, vr, eType, true)
- if err != nil {
- return newDecodeError(key, err)
- }
-
- val.SetMapIndex(k, elem)
- }
- return nil
-}
-
-func clearMap(m reflect.Value) {
- var none reflect.Value
- for _, k := range m.MapKeys() {
- m.SetMapIndex(k, none)
- }
-}
-
-func (mc *MapCodec) encodeKey(val reflect.Value, encodeKeysWithStringer bool) (string, error) {
- if mc.EncodeKeysWithStringer || encodeKeysWithStringer {
- return fmt.Sprint(val), nil
- }
-
- // keys of any string type are used directly
- if val.Kind() == reflect.String {
- return val.String(), nil
- }
- // KeyMarshalers are marshaled
- if km, ok := val.Interface().(KeyMarshaler); ok {
- if val.Kind() == reflect.Ptr && val.IsNil() {
- return "", nil
- }
- buf, err := km.MarshalKey()
- if err == nil {
- return buf, nil
- }
- return "", err
- }
- // keys implement encoding.TextMarshaler are marshaled.
- if km, ok := val.Interface().(encoding.TextMarshaler); ok {
- if val.Kind() == reflect.Ptr && val.IsNil() {
- return "", nil
- }
-
- buf, err := km.MarshalText()
- if err != nil {
- return "", err
- }
-
- return string(buf), nil
- }
-
- switch val.Kind() {
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- return strconv.FormatInt(val.Int(), 10), nil
- case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
- return strconv.FormatUint(val.Uint(), 10), nil
- }
- return "", fmt.Errorf("unsupported key type: %v", val.Type())
-}
-
-var keyUnmarshalerType = reflect.TypeOf((*KeyUnmarshaler)(nil)).Elem()
-var textUnmarshalerType = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem()
-
-func (mc *MapCodec) decodeKey(key string, keyType reflect.Type) (reflect.Value, error) {
- keyVal := reflect.ValueOf(key)
- var err error
- switch {
- // First, if EncodeKeysWithStringer is not enabled, try to decode withKeyUnmarshaler
- case !mc.EncodeKeysWithStringer && reflect.PtrTo(keyType).Implements(keyUnmarshalerType):
- keyVal = reflect.New(keyType)
- v := keyVal.Interface().(KeyUnmarshaler)
- err = v.UnmarshalKey(key)
- keyVal = keyVal.Elem()
- // Try to decode encoding.TextUnmarshalers.
- case reflect.PtrTo(keyType).Implements(textUnmarshalerType):
- keyVal = reflect.New(keyType)
- v := keyVal.Interface().(encoding.TextUnmarshaler)
- err = v.UnmarshalText([]byte(key))
- keyVal = keyVal.Elem()
- // Otherwise, go to type specific behavior
- default:
- switch keyType.Kind() {
- case reflect.String:
- keyVal = reflect.ValueOf(key).Convert(keyType)
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- n, parseErr := strconv.ParseInt(key, 10, 64)
- if parseErr != nil || reflect.Zero(keyType).OverflowInt(n) {
- err = fmt.Errorf("failed to unmarshal number key %v", key)
- }
- keyVal = reflect.ValueOf(n).Convert(keyType)
- case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
- n, parseErr := strconv.ParseUint(key, 10, 64)
- if parseErr != nil || reflect.Zero(keyType).OverflowUint(n) {
- err = fmt.Errorf("failed to unmarshal number key %v", key)
- break
- }
- keyVal = reflect.ValueOf(n).Convert(keyType)
- case reflect.Float32, reflect.Float64:
- if mc.EncodeKeysWithStringer {
- parsed, err := strconv.ParseFloat(key, 64)
- if err != nil {
- return keyVal, fmt.Errorf("Map key is defined to be a decimal type (%v) but got error %w", keyType.Kind(), err)
- }
- keyVal = reflect.ValueOf(parsed)
- break
- }
- fallthrough
- default:
- return keyVal, fmt.Errorf("unsupported key type: %v", keyType)
- }
- }
- return keyVal, err
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/mode.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/mode.go
deleted file mode 100644
index fbd9f0a9e..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/mode.go
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsoncodec
-
-import "fmt"
-
-type mode int
-
-const (
- _ mode = iota
- mTopLevel
- mDocument
- mArray
- mValue
- mElement
- mCodeWithScope
- mSpacer
-)
-
-func (m mode) String() string {
- var str string
-
- switch m {
- case mTopLevel:
- str = "TopLevel"
- case mDocument:
- str = "DocumentMode"
- case mArray:
- str = "ArrayMode"
- case mValue:
- str = "ValueMode"
- case mElement:
- str = "ElementMode"
- case mCodeWithScope:
- str = "CodeWithScopeMode"
- case mSpacer:
- str = "CodeWithScopeSpacerFrame"
- default:
- str = "UnknownMode"
- }
-
- return str
-}
-
-// TransitionError is an error returned when an invalid progressing a
-// ValueReader or ValueWriter state machine occurs.
-type TransitionError struct {
- parent mode
- current mode
- destination mode
-}
-
-func (te TransitionError) Error() string {
- if te.destination == mode(0) {
- return fmt.Sprintf("invalid state transition: cannot read/write value while in %s", te.current)
- }
- if te.parent == mode(0) {
- return fmt.Sprintf("invalid state transition: %s -> %s", te.current, te.destination)
- }
- return fmt.Sprintf("invalid state transition: %s -> %s; parent %s", te.current, te.destination, te.parent)
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/pointer_codec.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/pointer_codec.go
deleted file mode 100644
index ddfa4a33e..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/pointer_codec.go
+++ /dev/null
@@ -1,108 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsoncodec
-
-import (
- "reflect"
-
- "go.mongodb.org/mongo-driver/bson/bsonrw"
- "go.mongodb.org/mongo-driver/bson/bsontype"
-)
-
-var _ ValueEncoder = &PointerCodec{}
-var _ ValueDecoder = &PointerCodec{}
-
-// PointerCodec is the Codec used for pointers.
-//
-// Deprecated: PointerCodec will not be directly accessible in Go Driver 2.0. To
-// override the default pointer encode and decode behavior, create a new registry
-// with [go.mongodb.org/mongo-driver/bson.NewRegistry] and register a new
-// encoder and decoder for pointers.
-//
-// For example,
-//
-// reg := bson.NewRegistry()
-// reg.RegisterKindEncoder(reflect.Ptr, myPointerEncoder)
-// reg.RegisterKindDecoder(reflect.Ptr, myPointerDecoder)
-type PointerCodec struct {
- ecache typeEncoderCache
- dcache typeDecoderCache
-}
-
-// NewPointerCodec returns a PointerCodec that has been initialized.
-//
-// Deprecated: NewPointerCodec will not be available in Go Driver 2.0. See
-// [PointerCodec] for more details.
-func NewPointerCodec() *PointerCodec {
- return &PointerCodec{}
-}
-
-// EncodeValue handles encoding a pointer by either encoding it to BSON Null if the pointer is nil
-// or looking up an encoder for the type of value the pointer points to.
-func (pc *PointerCodec) EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if val.Kind() != reflect.Ptr {
- if !val.IsValid() {
- return vw.WriteNull()
- }
- return ValueEncoderError{Name: "PointerCodec.EncodeValue", Kinds: []reflect.Kind{reflect.Ptr}, Received: val}
- }
-
- if val.IsNil() {
- return vw.WriteNull()
- }
-
- typ := val.Type()
- if v, ok := pc.ecache.Load(typ); ok {
- if v == nil {
- return ErrNoEncoder{Type: typ}
- }
- return v.EncodeValue(ec, vw, val.Elem())
- }
- // TODO(charlie): handle concurrent requests for the same type
- enc, err := ec.LookupEncoder(typ.Elem())
- enc = pc.ecache.LoadOrStore(typ, enc)
- if err != nil {
- return err
- }
- return enc.EncodeValue(ec, vw, val.Elem())
-}
-
-// DecodeValue handles decoding a pointer by looking up a decoder for the type it points to and
-// using that to decode. If the BSON value is Null, this method will set the pointer to nil.
-func (pc *PointerCodec) DecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Kind() != reflect.Ptr {
- return ValueDecoderError{Name: "PointerCodec.DecodeValue", Kinds: []reflect.Kind{reflect.Ptr}, Received: val}
- }
-
- typ := val.Type()
- if vr.Type() == bsontype.Null {
- val.Set(reflect.Zero(typ))
- return vr.ReadNull()
- }
- if vr.Type() == bsontype.Undefined {
- val.Set(reflect.Zero(typ))
- return vr.ReadUndefined()
- }
-
- if val.IsNil() {
- val.Set(reflect.New(typ.Elem()))
- }
-
- if v, ok := pc.dcache.Load(typ); ok {
- if v == nil {
- return ErrNoDecoder{Type: typ}
- }
- return v.DecodeValue(dc, vr, val.Elem())
- }
- // TODO(charlie): handle concurrent requests for the same type
- dec, err := dc.LookupDecoder(typ.Elem())
- dec = pc.dcache.LoadOrStore(typ, dec)
- if err != nil {
- return err
- }
- return dec.DecodeValue(dc, vr, val.Elem())
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/proxy.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/proxy.go
deleted file mode 100644
index 4cf2b01ab..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/proxy.go
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsoncodec
-
-// Proxy is an interface implemented by types that cannot themselves be directly encoded. Types
-// that implement this interface with have ProxyBSON called during the encoding process and that
-// value will be encoded in place for the implementer.
-type Proxy interface {
- ProxyBSON() (interface{}, error)
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/registry.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/registry.go
deleted file mode 100644
index 196c491bb..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/registry.go
+++ /dev/null
@@ -1,524 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsoncodec
-
-import (
- "errors"
- "fmt"
- "reflect"
- "sync"
-
- "go.mongodb.org/mongo-driver/bson/bsontype"
-)
-
-// ErrNilType is returned when nil is passed to either LookupEncoder or LookupDecoder.
-//
-// Deprecated: ErrNilType will not be supported in Go Driver 2.0.
-var ErrNilType = errors.New("cannot perform a decoder lookup on ")
-
-// ErrNotPointer is returned when a non-pointer type is provided to LookupDecoder.
-//
-// Deprecated: ErrNotPointer will not be supported in Go Driver 2.0.
-var ErrNotPointer = errors.New("non-pointer provided to LookupDecoder")
-
-// ErrNoEncoder is returned when there wasn't an encoder available for a type.
-//
-// Deprecated: ErrNoEncoder will not be supported in Go Driver 2.0.
-type ErrNoEncoder struct {
- Type reflect.Type
-}
-
-func (ene ErrNoEncoder) Error() string {
- if ene.Type == nil {
- return "no encoder found for "
- }
- return "no encoder found for " + ene.Type.String()
-}
-
-// ErrNoDecoder is returned when there wasn't a decoder available for a type.
-//
-// Deprecated: ErrNoDecoder will not be supported in Go Driver 2.0.
-type ErrNoDecoder struct {
- Type reflect.Type
-}
-
-func (end ErrNoDecoder) Error() string {
- return "no decoder found for " + end.Type.String()
-}
-
-// ErrNoTypeMapEntry is returned when there wasn't a type available for the provided BSON type.
-//
-// Deprecated: ErrNoTypeMapEntry will not be supported in Go Driver 2.0.
-type ErrNoTypeMapEntry struct {
- Type bsontype.Type
-}
-
-func (entme ErrNoTypeMapEntry) Error() string {
- return "no type map entry found for " + entme.Type.String()
-}
-
-// ErrNotInterface is returned when the provided type is not an interface.
-//
-// Deprecated: ErrNotInterface will not be supported in Go Driver 2.0.
-var ErrNotInterface = errors.New("The provided type is not an interface")
-
-// A RegistryBuilder is used to build a Registry. This type is not goroutine
-// safe.
-//
-// Deprecated: Use Registry instead.
-type RegistryBuilder struct {
- registry *Registry
-}
-
-// NewRegistryBuilder creates a new empty RegistryBuilder.
-//
-// Deprecated: Use NewRegistry instead.
-func NewRegistryBuilder() *RegistryBuilder {
- return &RegistryBuilder{
- registry: NewRegistry(),
- }
-}
-
-// RegisterCodec will register the provided ValueCodec for the provided type.
-//
-// Deprecated: Use Registry.RegisterTypeEncoder and Registry.RegisterTypeDecoder instead.
-func (rb *RegistryBuilder) RegisterCodec(t reflect.Type, codec ValueCodec) *RegistryBuilder {
- rb.RegisterTypeEncoder(t, codec)
- rb.RegisterTypeDecoder(t, codec)
- return rb
-}
-
-// RegisterTypeEncoder will register the provided ValueEncoder for the provided type.
-//
-// The type will be used directly, so an encoder can be registered for a type and a different encoder can be registered
-// for a pointer to that type.
-//
-// If the given type is an interface, the encoder will be called when marshaling a type that is that interface. It
-// will not be called when marshaling a non-interface type that implements the interface.
-//
-// Deprecated: Use Registry.RegisterTypeEncoder instead.
-func (rb *RegistryBuilder) RegisterTypeEncoder(t reflect.Type, enc ValueEncoder) *RegistryBuilder {
- rb.registry.RegisterTypeEncoder(t, enc)
- return rb
-}
-
-// RegisterHookEncoder will register an encoder for the provided interface type t. This encoder will be called when
-// marshaling a type if the type implements t or a pointer to the type implements t. If the provided type is not
-// an interface (i.e. t.Kind() != reflect.Interface), this method will panic.
-//
-// Deprecated: Use Registry.RegisterInterfaceEncoder instead.
-func (rb *RegistryBuilder) RegisterHookEncoder(t reflect.Type, enc ValueEncoder) *RegistryBuilder {
- rb.registry.RegisterInterfaceEncoder(t, enc)
- return rb
-}
-
-// RegisterTypeDecoder will register the provided ValueDecoder for the provided type.
-//
-// The type will be used directly, so a decoder can be registered for a type and a different decoder can be registered
-// for a pointer to that type.
-//
-// If the given type is an interface, the decoder will be called when unmarshaling into a type that is that interface.
-// It will not be called when unmarshaling into a non-interface type that implements the interface.
-//
-// Deprecated: Use Registry.RegisterTypeDecoder instead.
-func (rb *RegistryBuilder) RegisterTypeDecoder(t reflect.Type, dec ValueDecoder) *RegistryBuilder {
- rb.registry.RegisterTypeDecoder(t, dec)
- return rb
-}
-
-// RegisterHookDecoder will register an decoder for the provided interface type t. This decoder will be called when
-// unmarshaling into a type if the type implements t or a pointer to the type implements t. If the provided type is not
-// an interface (i.e. t.Kind() != reflect.Interface), this method will panic.
-//
-// Deprecated: Use Registry.RegisterInterfaceDecoder instead.
-func (rb *RegistryBuilder) RegisterHookDecoder(t reflect.Type, dec ValueDecoder) *RegistryBuilder {
- rb.registry.RegisterInterfaceDecoder(t, dec)
- return rb
-}
-
-// RegisterEncoder registers the provided type and encoder pair.
-//
-// Deprecated: Use Registry.RegisterTypeEncoder or Registry.RegisterInterfaceEncoder instead.
-func (rb *RegistryBuilder) RegisterEncoder(t reflect.Type, enc ValueEncoder) *RegistryBuilder {
- if t == tEmpty {
- rb.registry.RegisterTypeEncoder(t, enc)
- return rb
- }
- switch t.Kind() {
- case reflect.Interface:
- rb.registry.RegisterInterfaceEncoder(t, enc)
- default:
- rb.registry.RegisterTypeEncoder(t, enc)
- }
- return rb
-}
-
-// RegisterDecoder registers the provided type and decoder pair.
-//
-// Deprecated: Use Registry.RegisterTypeDecoder or Registry.RegisterInterfaceDecoder instead.
-func (rb *RegistryBuilder) RegisterDecoder(t reflect.Type, dec ValueDecoder) *RegistryBuilder {
- if t == nil {
- rb.registry.RegisterTypeDecoder(t, dec)
- return rb
- }
- if t == tEmpty {
- rb.registry.RegisterTypeDecoder(t, dec)
- return rb
- }
- switch t.Kind() {
- case reflect.Interface:
- rb.registry.RegisterInterfaceDecoder(t, dec)
- default:
- rb.registry.RegisterTypeDecoder(t, dec)
- }
- return rb
-}
-
-// RegisterDefaultEncoder will register the provided ValueEncoder to the provided
-// kind.
-//
-// Deprecated: Use Registry.RegisterKindEncoder instead.
-func (rb *RegistryBuilder) RegisterDefaultEncoder(kind reflect.Kind, enc ValueEncoder) *RegistryBuilder {
- rb.registry.RegisterKindEncoder(kind, enc)
- return rb
-}
-
-// RegisterDefaultDecoder will register the provided ValueDecoder to the
-// provided kind.
-//
-// Deprecated: Use Registry.RegisterKindDecoder instead.
-func (rb *RegistryBuilder) RegisterDefaultDecoder(kind reflect.Kind, dec ValueDecoder) *RegistryBuilder {
- rb.registry.RegisterKindDecoder(kind, dec)
- return rb
-}
-
-// RegisterTypeMapEntry will register the provided type to the BSON type. The primary usage for this
-// mapping is decoding situations where an empty interface is used and a default type needs to be
-// created and decoded into.
-//
-// By default, BSON documents will decode into interface{} values as bson.D. To change the default type for BSON
-// documents, a type map entry for bsontype.EmbeddedDocument should be registered. For example, to force BSON documents
-// to decode to bson.Raw, use the following code:
-//
-// rb.RegisterTypeMapEntry(bsontype.EmbeddedDocument, reflect.TypeOf(bson.Raw{}))
-//
-// Deprecated: Use Registry.RegisterTypeMapEntry instead.
-func (rb *RegistryBuilder) RegisterTypeMapEntry(bt bsontype.Type, rt reflect.Type) *RegistryBuilder {
- rb.registry.RegisterTypeMapEntry(bt, rt)
- return rb
-}
-
-// Build creates a Registry from the current state of this RegistryBuilder.
-//
-// Deprecated: Use NewRegistry instead.
-func (rb *RegistryBuilder) Build() *Registry {
- r := &Registry{
- interfaceEncoders: append([]interfaceValueEncoder(nil), rb.registry.interfaceEncoders...),
- interfaceDecoders: append([]interfaceValueDecoder(nil), rb.registry.interfaceDecoders...),
- typeEncoders: rb.registry.typeEncoders.Clone(),
- typeDecoders: rb.registry.typeDecoders.Clone(),
- kindEncoders: rb.registry.kindEncoders.Clone(),
- kindDecoders: rb.registry.kindDecoders.Clone(),
- }
- rb.registry.typeMap.Range(func(k, v interface{}) bool {
- if k != nil && v != nil {
- r.typeMap.Store(k, v)
- }
- return true
- })
- return r
-}
-
-// A Registry is used to store and retrieve codecs for types and interfaces. This type is the main
-// typed passed around and Encoders and Decoders are constructed from it.
-type Registry struct {
- interfaceEncoders []interfaceValueEncoder
- interfaceDecoders []interfaceValueDecoder
- typeEncoders *typeEncoderCache
- typeDecoders *typeDecoderCache
- kindEncoders *kindEncoderCache
- kindDecoders *kindDecoderCache
- typeMap sync.Map // map[bsontype.Type]reflect.Type
-}
-
-// NewRegistry creates a new empty Registry.
-func NewRegistry() *Registry {
- return &Registry{
- typeEncoders: new(typeEncoderCache),
- typeDecoders: new(typeDecoderCache),
- kindEncoders: new(kindEncoderCache),
- kindDecoders: new(kindDecoderCache),
- }
-}
-
-// RegisterTypeEncoder registers the provided ValueEncoder for the provided type.
-//
-// The type will be used as provided, so an encoder can be registered for a type and a different
-// encoder can be registered for a pointer to that type.
-//
-// If the given type is an interface, the encoder will be called when marshaling a type that is
-// that interface. It will not be called when marshaling a non-interface type that implements the
-// interface. To get the latter behavior, call RegisterHookEncoder instead.
-//
-// RegisterTypeEncoder should not be called concurrently with any other Registry method.
-func (r *Registry) RegisterTypeEncoder(valueType reflect.Type, enc ValueEncoder) {
- r.typeEncoders.Store(valueType, enc)
-}
-
-// RegisterTypeDecoder registers the provided ValueDecoder for the provided type.
-//
-// The type will be used as provided, so a decoder can be registered for a type and a different
-// decoder can be registered for a pointer to that type.
-//
-// If the given type is an interface, the decoder will be called when unmarshaling into a type that
-// is that interface. It will not be called when unmarshaling into a non-interface type that
-// implements the interface. To get the latter behavior, call RegisterHookDecoder instead.
-//
-// RegisterTypeDecoder should not be called concurrently with any other Registry method.
-func (r *Registry) RegisterTypeDecoder(valueType reflect.Type, dec ValueDecoder) {
- r.typeDecoders.Store(valueType, dec)
-}
-
-// RegisterKindEncoder registers the provided ValueEncoder for the provided kind.
-//
-// Use RegisterKindEncoder to register an encoder for any type with the same underlying kind. For
-// example, consider the type MyInt defined as
-//
-// type MyInt int32
-//
-// To define an encoder for MyInt and int32, use RegisterKindEncoder like
-//
-// reg.RegisterKindEncoder(reflect.Int32, myEncoder)
-//
-// RegisterKindEncoder should not be called concurrently with any other Registry method.
-func (r *Registry) RegisterKindEncoder(kind reflect.Kind, enc ValueEncoder) {
- r.kindEncoders.Store(kind, enc)
-}
-
-// RegisterKindDecoder registers the provided ValueDecoder for the provided kind.
-//
-// Use RegisterKindDecoder to register a decoder for any type with the same underlying kind. For
-// example, consider the type MyInt defined as
-//
-// type MyInt int32
-//
-// To define an decoder for MyInt and int32, use RegisterKindDecoder like
-//
-// reg.RegisterKindDecoder(reflect.Int32, myDecoder)
-//
-// RegisterKindDecoder should not be called concurrently with any other Registry method.
-func (r *Registry) RegisterKindDecoder(kind reflect.Kind, dec ValueDecoder) {
- r.kindDecoders.Store(kind, dec)
-}
-
-// RegisterInterfaceEncoder registers an encoder for the provided interface type iface. This encoder will
-// be called when marshaling a type if the type implements iface or a pointer to the type
-// implements iface. If the provided type is not an interface
-// (i.e. iface.Kind() != reflect.Interface), this method will panic.
-//
-// RegisterInterfaceEncoder should not be called concurrently with any other Registry method.
-func (r *Registry) RegisterInterfaceEncoder(iface reflect.Type, enc ValueEncoder) {
- if iface.Kind() != reflect.Interface {
- panicStr := fmt.Errorf("RegisterInterfaceEncoder expects a type with kind reflect.Interface, "+
- "got type %s with kind %s", iface, iface.Kind())
- panic(panicStr)
- }
-
- for idx, encoder := range r.interfaceEncoders {
- if encoder.i == iface {
- r.interfaceEncoders[idx].ve = enc
- return
- }
- }
-
- r.interfaceEncoders = append(r.interfaceEncoders, interfaceValueEncoder{i: iface, ve: enc})
-}
-
-// RegisterInterfaceDecoder registers an decoder for the provided interface type iface. This decoder will
-// be called when unmarshaling into a type if the type implements iface or a pointer to the type
-// implements iface. If the provided type is not an interface (i.e. iface.Kind() != reflect.Interface),
-// this method will panic.
-//
-// RegisterInterfaceDecoder should not be called concurrently with any other Registry method.
-func (r *Registry) RegisterInterfaceDecoder(iface reflect.Type, dec ValueDecoder) {
- if iface.Kind() != reflect.Interface {
- panicStr := fmt.Errorf("RegisterInterfaceDecoder expects a type with kind reflect.Interface, "+
- "got type %s with kind %s", iface, iface.Kind())
- panic(panicStr)
- }
-
- for idx, decoder := range r.interfaceDecoders {
- if decoder.i == iface {
- r.interfaceDecoders[idx].vd = dec
- return
- }
- }
-
- r.interfaceDecoders = append(r.interfaceDecoders, interfaceValueDecoder{i: iface, vd: dec})
-}
-
-// RegisterTypeMapEntry will register the provided type to the BSON type. The primary usage for this
-// mapping is decoding situations where an empty interface is used and a default type needs to be
-// created and decoded into.
-//
-// By default, BSON documents will decode into interface{} values as bson.D. To change the default type for BSON
-// documents, a type map entry for bsontype.EmbeddedDocument should be registered. For example, to force BSON documents
-// to decode to bson.Raw, use the following code:
-//
-// reg.RegisterTypeMapEntry(bsontype.EmbeddedDocument, reflect.TypeOf(bson.Raw{}))
-func (r *Registry) RegisterTypeMapEntry(bt bsontype.Type, rt reflect.Type) {
- r.typeMap.Store(bt, rt)
-}
-
-// LookupEncoder returns the first matching encoder in the Registry. It uses the following lookup
-// order:
-//
-// 1. An encoder registered for the exact type. If the given type is an interface, an encoder
-// registered using RegisterTypeEncoder for that interface will be selected.
-//
-// 2. An encoder registered using RegisterInterfaceEncoder for an interface implemented by the type
-// or by a pointer to the type.
-//
-// 3. An encoder registered using RegisterKindEncoder for the kind of value.
-//
-// If no encoder is found, an error of type ErrNoEncoder is returned. LookupEncoder is safe for
-// concurrent use by multiple goroutines after all codecs and encoders are registered.
-func (r *Registry) LookupEncoder(valueType reflect.Type) (ValueEncoder, error) {
- if valueType == nil {
- return nil, ErrNoEncoder{Type: valueType}
- }
- enc, found := r.lookupTypeEncoder(valueType)
- if found {
- if enc == nil {
- return nil, ErrNoEncoder{Type: valueType}
- }
- return enc, nil
- }
-
- enc, found = r.lookupInterfaceEncoder(valueType, true)
- if found {
- return r.typeEncoders.LoadOrStore(valueType, enc), nil
- }
-
- if v, ok := r.kindEncoders.Load(valueType.Kind()); ok {
- return r.storeTypeEncoder(valueType, v), nil
- }
- return nil, ErrNoEncoder{Type: valueType}
-}
-
-func (r *Registry) storeTypeEncoder(rt reflect.Type, enc ValueEncoder) ValueEncoder {
- return r.typeEncoders.LoadOrStore(rt, enc)
-}
-
-func (r *Registry) lookupTypeEncoder(rt reflect.Type) (ValueEncoder, bool) {
- return r.typeEncoders.Load(rt)
-}
-
-func (r *Registry) lookupInterfaceEncoder(valueType reflect.Type, allowAddr bool) (ValueEncoder, bool) {
- if valueType == nil {
- return nil, false
- }
- for _, ienc := range r.interfaceEncoders {
- if valueType.Implements(ienc.i) {
- return ienc.ve, true
- }
- if allowAddr && valueType.Kind() != reflect.Ptr && reflect.PtrTo(valueType).Implements(ienc.i) {
- // if *t implements an interface, this will catch if t implements an interface further
- // ahead in interfaceEncoders
- defaultEnc, found := r.lookupInterfaceEncoder(valueType, false)
- if !found {
- defaultEnc, _ = r.kindEncoders.Load(valueType.Kind())
- }
- return newCondAddrEncoder(ienc.ve, defaultEnc), true
- }
- }
- return nil, false
-}
-
-// LookupDecoder returns the first matching decoder in the Registry. It uses the following lookup
-// order:
-//
-// 1. A decoder registered for the exact type. If the given type is an interface, a decoder
-// registered using RegisterTypeDecoder for that interface will be selected.
-//
-// 2. A decoder registered using RegisterInterfaceDecoder for an interface implemented by the type or by
-// a pointer to the type.
-//
-// 3. A decoder registered using RegisterKindDecoder for the kind of value.
-//
-// If no decoder is found, an error of type ErrNoDecoder is returned. LookupDecoder is safe for
-// concurrent use by multiple goroutines after all codecs and decoders are registered.
-func (r *Registry) LookupDecoder(valueType reflect.Type) (ValueDecoder, error) {
- if valueType == nil {
- return nil, ErrNilType
- }
- dec, found := r.lookupTypeDecoder(valueType)
- if found {
- if dec == nil {
- return nil, ErrNoDecoder{Type: valueType}
- }
- return dec, nil
- }
-
- dec, found = r.lookupInterfaceDecoder(valueType, true)
- if found {
- return r.storeTypeDecoder(valueType, dec), nil
- }
-
- if v, ok := r.kindDecoders.Load(valueType.Kind()); ok {
- return r.storeTypeDecoder(valueType, v), nil
- }
- return nil, ErrNoDecoder{Type: valueType}
-}
-
-func (r *Registry) lookupTypeDecoder(valueType reflect.Type) (ValueDecoder, bool) {
- return r.typeDecoders.Load(valueType)
-}
-
-func (r *Registry) storeTypeDecoder(typ reflect.Type, dec ValueDecoder) ValueDecoder {
- return r.typeDecoders.LoadOrStore(typ, dec)
-}
-
-func (r *Registry) lookupInterfaceDecoder(valueType reflect.Type, allowAddr bool) (ValueDecoder, bool) {
- for _, idec := range r.interfaceDecoders {
- if valueType.Implements(idec.i) {
- return idec.vd, true
- }
- if allowAddr && valueType.Kind() != reflect.Ptr && reflect.PtrTo(valueType).Implements(idec.i) {
- // if *t implements an interface, this will catch if t implements an interface further
- // ahead in interfaceDecoders
- defaultDec, found := r.lookupInterfaceDecoder(valueType, false)
- if !found {
- defaultDec, _ = r.kindDecoders.Load(valueType.Kind())
- }
- return newCondAddrDecoder(idec.vd, defaultDec), true
- }
- }
- return nil, false
-}
-
-// LookupTypeMapEntry inspects the registry's type map for a Go type for the corresponding BSON
-// type. If no type is found, ErrNoTypeMapEntry is returned.
-//
-// LookupTypeMapEntry should not be called concurrently with any other Registry method.
-func (r *Registry) LookupTypeMapEntry(bt bsontype.Type) (reflect.Type, error) {
- v, ok := r.typeMap.Load(bt)
- if v == nil || !ok {
- return nil, ErrNoTypeMapEntry{Type: bt}
- }
- return v.(reflect.Type), nil
-}
-
-type interfaceValueEncoder struct {
- i reflect.Type
- ve ValueEncoder
-}
-
-type interfaceValueDecoder struct {
- i reflect.Type
- vd ValueDecoder
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/slice_codec.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/slice_codec.go
deleted file mode 100644
index 14c9fd256..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/slice_codec.go
+++ /dev/null
@@ -1,214 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsoncodec
-
-import (
- "errors"
- "fmt"
- "reflect"
-
- "go.mongodb.org/mongo-driver/bson/bsonoptions"
- "go.mongodb.org/mongo-driver/bson/bsonrw"
- "go.mongodb.org/mongo-driver/bson/bsontype"
- "go.mongodb.org/mongo-driver/bson/primitive"
-)
-
-var defaultSliceCodec = NewSliceCodec()
-
-// SliceCodec is the Codec used for slice values.
-//
-// Deprecated: SliceCodec will not be directly configurable in Go Driver 2.0. To
-// configure the slice encode and decode behavior, use the configuration methods
-// on a [go.mongodb.org/mongo-driver/bson.Encoder] or
-// [go.mongodb.org/mongo-driver/bson.Decoder]. To configure the slice encode and
-// decode behavior for a mongo.Client, use
-// [go.mongodb.org/mongo-driver/mongo/options.ClientOptions.SetBSONOptions].
-//
-// For example, to configure a mongo.Client to marshal nil Go slices as empty
-// BSON arrays, use:
-//
-// opt := options.Client().SetBSONOptions(&options.BSONOptions{
-// NilSliceAsEmpty: true,
-// })
-//
-// See the deprecation notice for each field in SliceCodec for the corresponding
-// settings.
-type SliceCodec struct {
- // EncodeNilAsEmpty causes EncodeValue to marshal nil Go slices as empty BSON arrays instead of
- // BSON null.
- //
- // Deprecated: Use bson.Encoder.NilSliceAsEmpty instead.
- EncodeNilAsEmpty bool
-}
-
-// NewSliceCodec returns a MapCodec with options opts.
-//
-// Deprecated: NewSliceCodec will not be available in Go Driver 2.0. See
-// [SliceCodec] for more details.
-func NewSliceCodec(opts ...*bsonoptions.SliceCodecOptions) *SliceCodec {
- sliceOpt := bsonoptions.MergeSliceCodecOptions(opts...)
-
- codec := SliceCodec{}
- if sliceOpt.EncodeNilAsEmpty != nil {
- codec.EncodeNilAsEmpty = *sliceOpt.EncodeNilAsEmpty
- }
- return &codec
-}
-
-// EncodeValue is the ValueEncoder for slice types.
-func (sc SliceCodec) EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Kind() != reflect.Slice {
- return ValueEncoderError{Name: "SliceEncodeValue", Kinds: []reflect.Kind{reflect.Slice}, Received: val}
- }
-
- if val.IsNil() && !sc.EncodeNilAsEmpty && !ec.nilSliceAsEmpty {
- return vw.WriteNull()
- }
-
- // If we have a []byte we want to treat it as a binary instead of as an array.
- if val.Type().Elem() == tByte {
- byteSlice := make([]byte, val.Len())
- reflect.Copy(reflect.ValueOf(byteSlice), val)
- return vw.WriteBinary(byteSlice)
- }
-
- // If we have a []primitive.E we want to treat it as a document instead of as an array.
- if val.Type() == tD || val.Type().ConvertibleTo(tD) {
- d := val.Convert(tD).Interface().(primitive.D)
-
- dw, err := vw.WriteDocument()
- if err != nil {
- return err
- }
-
- for _, e := range d {
- err = encodeElement(ec, dw, e)
- if err != nil {
- return err
- }
- }
-
- return dw.WriteDocumentEnd()
- }
-
- aw, err := vw.WriteArray()
- if err != nil {
- return err
- }
-
- elemType := val.Type().Elem()
- encoder, err := ec.LookupEncoder(elemType)
- if err != nil && elemType.Kind() != reflect.Interface {
- return err
- }
-
- for idx := 0; idx < val.Len(); idx++ {
- currEncoder, currVal, lookupErr := defaultValueEncoders.lookupElementEncoder(ec, encoder, val.Index(idx))
- if lookupErr != nil && !errors.Is(lookupErr, errInvalidValue) {
- return lookupErr
- }
-
- vw, err := aw.WriteArrayElement()
- if err != nil {
- return err
- }
-
- if errors.Is(lookupErr, errInvalidValue) {
- err = vw.WriteNull()
- if err != nil {
- return err
- }
- continue
- }
-
- err = currEncoder.EncodeValue(ec, vw, currVal)
- if err != nil {
- return err
- }
- }
- return aw.WriteArrayEnd()
-}
-
-// DecodeValue is the ValueDecoder for slice types.
-func (sc *SliceCodec) DecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Kind() != reflect.Slice {
- return ValueDecoderError{Name: "SliceDecodeValue", Kinds: []reflect.Kind{reflect.Slice}, Received: val}
- }
-
- switch vrType := vr.Type(); vrType {
- case bsontype.Array:
- case bsontype.Null:
- val.Set(reflect.Zero(val.Type()))
- return vr.ReadNull()
- case bsontype.Undefined:
- val.Set(reflect.Zero(val.Type()))
- return vr.ReadUndefined()
- case bsontype.Type(0), bsontype.EmbeddedDocument:
- if val.Type().Elem() != tE {
- return fmt.Errorf("cannot decode document into %s", val.Type())
- }
- case bsontype.Binary:
- if val.Type().Elem() != tByte {
- return fmt.Errorf("SliceDecodeValue can only decode a binary into a byte array, got %v", vrType)
- }
- data, subtype, err := vr.ReadBinary()
- if err != nil {
- return err
- }
- if subtype != bsontype.BinaryGeneric && subtype != bsontype.BinaryBinaryOld {
- return fmt.Errorf("SliceDecodeValue can only be used to decode subtype 0x00 or 0x02 for %s, got %v", bsontype.Binary, subtype)
- }
-
- if val.IsNil() {
- val.Set(reflect.MakeSlice(val.Type(), 0, len(data)))
- }
- val.SetLen(0)
- val.Set(reflect.AppendSlice(val, reflect.ValueOf(data)))
- return nil
- case bsontype.String:
- if sliceType := val.Type().Elem(); sliceType != tByte {
- return fmt.Errorf("SliceDecodeValue can only decode a string into a byte array, got %v", sliceType)
- }
- str, err := vr.ReadString()
- if err != nil {
- return err
- }
- byteStr := []byte(str)
-
- if val.IsNil() {
- val.Set(reflect.MakeSlice(val.Type(), 0, len(byteStr)))
- }
- val.SetLen(0)
- val.Set(reflect.AppendSlice(val, reflect.ValueOf(byteStr)))
- return nil
- default:
- return fmt.Errorf("cannot decode %v into a slice", vrType)
- }
-
- var elemsFunc func(DecodeContext, bsonrw.ValueReader, reflect.Value) ([]reflect.Value, error)
- switch val.Type().Elem() {
- case tE:
- dc.Ancestor = val.Type()
- elemsFunc = defaultValueDecoders.decodeD
- default:
- elemsFunc = defaultValueDecoders.decodeDefault
- }
-
- elems, err := elemsFunc(dc, vr, val)
- if err != nil {
- return err
- }
-
- if val.IsNil() {
- val.Set(reflect.MakeSlice(val.Type(), 0, len(elems)))
- }
-
- val.SetLen(0)
- val.Set(reflect.Append(val, elems...))
-
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/string_codec.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/string_codec.go
deleted file mode 100644
index a8f885a85..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/string_codec.go
+++ /dev/null
@@ -1,140 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsoncodec
-
-import (
- "fmt"
- "reflect"
-
- "go.mongodb.org/mongo-driver/bson/bsonoptions"
- "go.mongodb.org/mongo-driver/bson/bsonrw"
- "go.mongodb.org/mongo-driver/bson/bsontype"
-)
-
-// StringCodec is the Codec used for string values.
-//
-// Deprecated: StringCodec will not be directly accessible in Go Driver 2.0. To
-// override the default string encode and decode behavior, create a new registry
-// with [go.mongodb.org/mongo-driver/bson.NewRegistry] and register a new
-// encoder and decoder for strings.
-//
-// For example,
-//
-// reg := bson.NewRegistry()
-// reg.RegisterKindEncoder(reflect.String, myStringEncoder)
-// reg.RegisterKindDecoder(reflect.String, myStringDecoder)
-type StringCodec struct {
- // DecodeObjectIDAsHex specifies if object IDs should be decoded as their hex representation.
- // If false, a string made from the raw object ID bytes will be used. Defaults to true.
- //
- // Deprecated: Decoding object IDs as raw bytes will not be supported in Go Driver 2.0.
- DecodeObjectIDAsHex bool
-}
-
-var (
- defaultStringCodec = NewStringCodec()
-
- // Assert that defaultStringCodec satisfies the typeDecoder interface, which allows it to be
- // used by collection type decoders (e.g. map, slice, etc) to set individual values in a
- // collection.
- _ typeDecoder = defaultStringCodec
-)
-
-// NewStringCodec returns a StringCodec with options opts.
-//
-// Deprecated: NewStringCodec will not be available in Go Driver 2.0. See
-// [StringCodec] for more details.
-func NewStringCodec(opts ...*bsonoptions.StringCodecOptions) *StringCodec {
- stringOpt := bsonoptions.MergeStringCodecOptions(opts...)
- return &StringCodec{*stringOpt.DecodeObjectIDAsHex}
-}
-
-// EncodeValue is the ValueEncoder for string types.
-func (sc *StringCodec) EncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if val.Kind() != reflect.String {
- return ValueEncoderError{
- Name: "StringEncodeValue",
- Kinds: []reflect.Kind{reflect.String},
- Received: val,
- }
- }
-
- return vw.WriteString(val.String())
-}
-
-func (sc *StringCodec) decodeType(_ DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) {
- if t.Kind() != reflect.String {
- return emptyValue, ValueDecoderError{
- Name: "StringDecodeValue",
- Kinds: []reflect.Kind{reflect.String},
- Received: reflect.Zero(t),
- }
- }
-
- var str string
- var err error
- switch vr.Type() {
- case bsontype.String:
- str, err = vr.ReadString()
- if err != nil {
- return emptyValue, err
- }
- case bsontype.ObjectID:
- oid, err := vr.ReadObjectID()
- if err != nil {
- return emptyValue, err
- }
- if sc.DecodeObjectIDAsHex {
- str = oid.Hex()
- } else {
- // TODO(GODRIVER-2796): Return an error here instead of decoding to a garbled string.
- byteArray := [12]byte(oid)
- str = string(byteArray[:])
- }
- case bsontype.Symbol:
- str, err = vr.ReadSymbol()
- if err != nil {
- return emptyValue, err
- }
- case bsontype.Binary:
- data, subtype, err := vr.ReadBinary()
- if err != nil {
- return emptyValue, err
- }
- if subtype != bsontype.BinaryGeneric && subtype != bsontype.BinaryBinaryOld {
- return emptyValue, decodeBinaryError{subtype: subtype, typeName: "string"}
- }
- str = string(data)
- case bsontype.Null:
- if err = vr.ReadNull(); err != nil {
- return emptyValue, err
- }
- case bsontype.Undefined:
- if err = vr.ReadUndefined(); err != nil {
- return emptyValue, err
- }
- default:
- return emptyValue, fmt.Errorf("cannot decode %v into a string type", vr.Type())
- }
-
- return reflect.ValueOf(str), nil
-}
-
-// DecodeValue is the ValueDecoder for string types.
-func (sc *StringCodec) DecodeValue(dctx DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Kind() != reflect.String {
- return ValueDecoderError{Name: "StringDecodeValue", Kinds: []reflect.Kind{reflect.String}, Received: val}
- }
-
- elem, err := sc.decodeType(dctx, vr, val.Type())
- if err != nil {
- return err
- }
-
- val.SetString(elem.String())
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_codec.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_codec.go
deleted file mode 100644
index f8d9690c1..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_codec.go
+++ /dev/null
@@ -1,736 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsoncodec
-
-import (
- "errors"
- "fmt"
- "reflect"
- "sort"
- "strings"
- "sync"
- "time"
-
- "go.mongodb.org/mongo-driver/bson/bsonoptions"
- "go.mongodb.org/mongo-driver/bson/bsonrw"
- "go.mongodb.org/mongo-driver/bson/bsontype"
-)
-
-// DecodeError represents an error that occurs when unmarshalling BSON bytes into a native Go type.
-type DecodeError struct {
- keys []string
- wrapped error
-}
-
-// Unwrap returns the underlying error
-func (de *DecodeError) Unwrap() error {
- return de.wrapped
-}
-
-// Error implements the error interface.
-func (de *DecodeError) Error() string {
- // The keys are stored in reverse order because the de.keys slice is builtup while propagating the error up the
- // stack of BSON keys, so we call de.Keys(), which reverses them.
- keyPath := strings.Join(de.Keys(), ".")
- return fmt.Sprintf("error decoding key %s: %v", keyPath, de.wrapped)
-}
-
-// Keys returns the BSON key path that caused an error as a slice of strings. The keys in the slice are in top-down
-// order. For example, if the document being unmarshalled was {a: {b: {c: 1}}} and the value for c was supposed to be
-// a string, the keys slice will be ["a", "b", "c"].
-func (de *DecodeError) Keys() []string {
- reversedKeys := make([]string, 0, len(de.keys))
- for idx := len(de.keys) - 1; idx >= 0; idx-- {
- reversedKeys = append(reversedKeys, de.keys[idx])
- }
-
- return reversedKeys
-}
-
-// Zeroer allows custom struct types to implement a report of zero
-// state. All struct types that don't implement Zeroer or where IsZero
-// returns false are considered to be not zero.
-type Zeroer interface {
- IsZero() bool
-}
-
-// StructCodec is the Codec used for struct values.
-//
-// Deprecated: StructCodec will not be directly configurable in Go Driver 2.0.
-// To configure the struct encode and decode behavior, use the configuration
-// methods on a [go.mongodb.org/mongo-driver/bson.Encoder] or
-// [go.mongodb.org/mongo-driver/bson.Decoder]. To configure the struct encode
-// and decode behavior for a mongo.Client, use
-// [go.mongodb.org/mongo-driver/mongo/options.ClientOptions.SetBSONOptions].
-//
-// For example, to configure a mongo.Client to omit zero-value structs when
-// using the "omitempty" struct tag, use:
-//
-// opt := options.Client().SetBSONOptions(&options.BSONOptions{
-// OmitZeroStruct: true,
-// })
-//
-// See the deprecation notice for each field in StructCodec for the corresponding
-// settings.
-type StructCodec struct {
- cache sync.Map // map[reflect.Type]*structDescription
- parser StructTagParser
-
- // DecodeZeroStruct causes DecodeValue to delete any existing values from Go structs in the
- // destination value passed to Decode before unmarshaling BSON documents into them.
- //
- // Deprecated: Use bson.Decoder.ZeroStructs or options.BSONOptions.ZeroStructs instead.
- DecodeZeroStruct bool
-
- // DecodeDeepZeroInline causes DecodeValue to delete any existing values from Go structs in the
- // destination value passed to Decode before unmarshaling BSON documents into them.
- //
- // Deprecated: DecodeDeepZeroInline will not be supported in Go Driver 2.0.
- DecodeDeepZeroInline bool
-
- // EncodeOmitDefaultStruct causes the Encoder to consider the zero value for a struct (e.g.
- // MyStruct{}) as empty and omit it from the marshaled BSON when the "omitempty" struct tag
- // option is set.
- //
- // Deprecated: Use bson.Encoder.OmitZeroStruct or options.BSONOptions.OmitZeroStruct instead.
- EncodeOmitDefaultStruct bool
-
- // AllowUnexportedFields allows encoding and decoding values from un-exported struct fields.
- //
- // Deprecated: AllowUnexportedFields does not work on recent versions of Go and will not be
- // supported in Go Driver 2.0.
- AllowUnexportedFields bool
-
- // OverwriteDuplicatedInlinedFields, if false, causes EncodeValue to return an error if there is
- // a duplicate field in the marshaled BSON when the "inline" struct tag option is set. The
- // default value is true.
- //
- // Deprecated: Use bson.Encoder.ErrorOnInlineDuplicates or
- // options.BSONOptions.ErrorOnInlineDuplicates instead.
- OverwriteDuplicatedInlinedFields bool
-}
-
-var _ ValueEncoder = &StructCodec{}
-var _ ValueDecoder = &StructCodec{}
-
-// NewStructCodec returns a StructCodec that uses p for struct tag parsing.
-//
-// Deprecated: NewStructCodec will not be available in Go Driver 2.0. See
-// [StructCodec] for more details.
-func NewStructCodec(p StructTagParser, opts ...*bsonoptions.StructCodecOptions) (*StructCodec, error) {
- if p == nil {
- return nil, errors.New("a StructTagParser must be provided to NewStructCodec")
- }
-
- structOpt := bsonoptions.MergeStructCodecOptions(opts...)
-
- codec := &StructCodec{
- parser: p,
- }
-
- if structOpt.DecodeZeroStruct != nil {
- codec.DecodeZeroStruct = *structOpt.DecodeZeroStruct
- }
- if structOpt.DecodeDeepZeroInline != nil {
- codec.DecodeDeepZeroInline = *structOpt.DecodeDeepZeroInline
- }
- if structOpt.EncodeOmitDefaultStruct != nil {
- codec.EncodeOmitDefaultStruct = *structOpt.EncodeOmitDefaultStruct
- }
- if structOpt.OverwriteDuplicatedInlinedFields != nil {
- codec.OverwriteDuplicatedInlinedFields = *structOpt.OverwriteDuplicatedInlinedFields
- }
- if structOpt.AllowUnexportedFields != nil {
- codec.AllowUnexportedFields = *structOpt.AllowUnexportedFields
- }
-
- return codec, nil
-}
-
-// EncodeValue handles encoding generic struct types.
-func (sc *StructCodec) EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Kind() != reflect.Struct {
- return ValueEncoderError{Name: "StructCodec.EncodeValue", Kinds: []reflect.Kind{reflect.Struct}, Received: val}
- }
-
- sd, err := sc.describeStruct(ec.Registry, val.Type(), ec.useJSONStructTags, ec.errorOnInlineDuplicates)
- if err != nil {
- return err
- }
-
- dw, err := vw.WriteDocument()
- if err != nil {
- return err
- }
- var rv reflect.Value
- for _, desc := range sd.fl {
- if desc.inline == nil {
- rv = val.Field(desc.idx)
- } else {
- rv, err = fieldByIndexErr(val, desc.inline)
- if err != nil {
- continue
- }
- }
-
- desc.encoder, rv, err = defaultValueEncoders.lookupElementEncoder(ec, desc.encoder, rv)
-
- if err != nil && !errors.Is(err, errInvalidValue) {
- return err
- }
-
- if errors.Is(err, errInvalidValue) {
- if desc.omitEmpty {
- continue
- }
- vw2, err := dw.WriteDocumentElement(desc.name)
- if err != nil {
- return err
- }
- err = vw2.WriteNull()
- if err != nil {
- return err
- }
- continue
- }
-
- if desc.encoder == nil {
- return ErrNoEncoder{Type: rv.Type()}
- }
-
- encoder := desc.encoder
-
- var empty bool
- if cz, ok := encoder.(CodecZeroer); ok {
- empty = cz.IsTypeZero(rv.Interface())
- } else if rv.Kind() == reflect.Interface {
- // isEmpty will not treat an interface rv as an interface, so we need to check for the
- // nil interface separately.
- empty = rv.IsNil()
- } else {
- empty = isEmpty(rv, sc.EncodeOmitDefaultStruct || ec.omitZeroStruct)
- }
- if desc.omitEmpty && empty {
- continue
- }
-
- vw2, err := dw.WriteDocumentElement(desc.name)
- if err != nil {
- return err
- }
-
- ectx := EncodeContext{
- Registry: ec.Registry,
- MinSize: desc.minSize || ec.MinSize,
- errorOnInlineDuplicates: ec.errorOnInlineDuplicates,
- stringifyMapKeysWithFmt: ec.stringifyMapKeysWithFmt,
- nilMapAsEmpty: ec.nilMapAsEmpty,
- nilSliceAsEmpty: ec.nilSliceAsEmpty,
- nilByteSliceAsEmpty: ec.nilByteSliceAsEmpty,
- omitZeroStruct: ec.omitZeroStruct,
- useJSONStructTags: ec.useJSONStructTags,
- }
- err = encoder.EncodeValue(ectx, vw2, rv)
- if err != nil {
- return err
- }
- }
-
- if sd.inlineMap >= 0 {
- rv := val.Field(sd.inlineMap)
- collisionFn := func(key string) bool {
- _, exists := sd.fm[key]
- return exists
- }
-
- return defaultMapCodec.mapEncodeValue(ec, dw, rv, collisionFn)
- }
-
- return dw.WriteDocumentEnd()
-}
-
-func newDecodeError(key string, original error) error {
- var de *DecodeError
- if !errors.As(original, &de) {
- return &DecodeError{
- keys: []string{key},
- wrapped: original,
- }
- }
-
- de.keys = append(de.keys, key)
- return de
-}
-
-// DecodeValue implements the Codec interface.
-// By default, map types in val will not be cleared. If a map has existing key/value pairs, it will be extended with the new ones from vr.
-// For slices, the decoder will set the length of the slice to zero and append all elements. The underlying array will not be cleared.
-func (sc *StructCodec) DecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Kind() != reflect.Struct {
- return ValueDecoderError{Name: "StructCodec.DecodeValue", Kinds: []reflect.Kind{reflect.Struct}, Received: val}
- }
-
- switch vrType := vr.Type(); vrType {
- case bsontype.Type(0), bsontype.EmbeddedDocument:
- case bsontype.Null:
- if err := vr.ReadNull(); err != nil {
- return err
- }
-
- val.Set(reflect.Zero(val.Type()))
- return nil
- case bsontype.Undefined:
- if err := vr.ReadUndefined(); err != nil {
- return err
- }
-
- val.Set(reflect.Zero(val.Type()))
- return nil
- default:
- return fmt.Errorf("cannot decode %v into a %s", vrType, val.Type())
- }
-
- sd, err := sc.describeStruct(dc.Registry, val.Type(), dc.useJSONStructTags, false)
- if err != nil {
- return err
- }
-
- if sc.DecodeZeroStruct || dc.zeroStructs {
- val.Set(reflect.Zero(val.Type()))
- }
- if sc.DecodeDeepZeroInline && sd.inline {
- val.Set(deepZero(val.Type()))
- }
-
- var decoder ValueDecoder
- var inlineMap reflect.Value
- if sd.inlineMap >= 0 {
- inlineMap = val.Field(sd.inlineMap)
- decoder, err = dc.LookupDecoder(inlineMap.Type().Elem())
- if err != nil {
- return err
- }
- }
-
- dr, err := vr.ReadDocument()
- if err != nil {
- return err
- }
-
- for {
- name, vr, err := dr.ReadElement()
- if errors.Is(err, bsonrw.ErrEOD) {
- break
- }
- if err != nil {
- return err
- }
-
- fd, exists := sd.fm[name]
- if !exists {
- // if the original name isn't found in the struct description, try again with the name in lowercase
- // this could match if a BSON tag isn't specified because by default, describeStruct lowercases all field
- // names
- fd, exists = sd.fm[strings.ToLower(name)]
- }
-
- if !exists {
- if sd.inlineMap < 0 {
- // The encoding/json package requires a flag to return on error for non-existent fields.
- // This functionality seems appropriate for the struct codec.
- err = vr.Skip()
- if err != nil {
- return err
- }
- continue
- }
-
- if inlineMap.IsNil() {
- inlineMap.Set(reflect.MakeMap(inlineMap.Type()))
- }
-
- elem := reflect.New(inlineMap.Type().Elem()).Elem()
- dc.Ancestor = inlineMap.Type()
- err = decoder.DecodeValue(dc, vr, elem)
- if err != nil {
- return err
- }
- inlineMap.SetMapIndex(reflect.ValueOf(name), elem)
- continue
- }
-
- var field reflect.Value
- if fd.inline == nil {
- field = val.Field(fd.idx)
- } else {
- field, err = getInlineField(val, fd.inline)
- if err != nil {
- return err
- }
- }
-
- if !field.CanSet() { // Being settable is a super set of being addressable.
- innerErr := fmt.Errorf("field %v is not settable", field)
- return newDecodeError(fd.name, innerErr)
- }
- if field.Kind() == reflect.Ptr && field.IsNil() {
- field.Set(reflect.New(field.Type().Elem()))
- }
- field = field.Addr()
-
- dctx := DecodeContext{
- Registry: dc.Registry,
- Truncate: fd.truncate || dc.Truncate,
- defaultDocumentType: dc.defaultDocumentType,
- binaryAsSlice: dc.binaryAsSlice,
- useJSONStructTags: dc.useJSONStructTags,
- useLocalTimeZone: dc.useLocalTimeZone,
- zeroMaps: dc.zeroMaps,
- zeroStructs: dc.zeroStructs,
- }
-
- if fd.decoder == nil {
- return newDecodeError(fd.name, ErrNoDecoder{Type: field.Elem().Type()})
- }
-
- err = fd.decoder.DecodeValue(dctx, vr, field.Elem())
- if err != nil {
- return newDecodeError(fd.name, err)
- }
- }
-
- return nil
-}
-
-func isEmpty(v reflect.Value, omitZeroStruct bool) bool {
- kind := v.Kind()
- if (kind != reflect.Ptr || !v.IsNil()) && v.Type().Implements(tZeroer) {
- return v.Interface().(Zeroer).IsZero()
- }
- switch kind {
- case reflect.Array, reflect.Map, reflect.Slice, reflect.String:
- return v.Len() == 0
- case reflect.Struct:
- if !omitZeroStruct {
- return false
- }
- vt := v.Type()
- if vt == tTime {
- return v.Interface().(time.Time).IsZero()
- }
- numField := vt.NumField()
- for i := 0; i < numField; i++ {
- ff := vt.Field(i)
- if ff.PkgPath != "" && !ff.Anonymous {
- continue // Private field
- }
- if !isEmpty(v.Field(i), omitZeroStruct) {
- return false
- }
- }
- return true
- }
- return !v.IsValid() || v.IsZero()
-}
-
-type structDescription struct {
- fm map[string]fieldDescription
- fl []fieldDescription
- inlineMap int
- inline bool
-}
-
-type fieldDescription struct {
- name string // BSON key name
- fieldName string // struct field name
- idx int
- omitEmpty bool
- minSize bool
- truncate bool
- inline []int
- encoder ValueEncoder
- decoder ValueDecoder
-}
-
-type byIndex []fieldDescription
-
-func (bi byIndex) Len() int { return len(bi) }
-
-func (bi byIndex) Swap(i, j int) { bi[i], bi[j] = bi[j], bi[i] }
-
-func (bi byIndex) Less(i, j int) bool {
- // If a field is inlined, its index in the top level struct is stored at inline[0]
- iIdx, jIdx := bi[i].idx, bi[j].idx
- if len(bi[i].inline) > 0 {
- iIdx = bi[i].inline[0]
- }
- if len(bi[j].inline) > 0 {
- jIdx = bi[j].inline[0]
- }
- if iIdx != jIdx {
- return iIdx < jIdx
- }
- for k, biik := range bi[i].inline {
- if k >= len(bi[j].inline) {
- return false
- }
- if biik != bi[j].inline[k] {
- return biik < bi[j].inline[k]
- }
- }
- return len(bi[i].inline) < len(bi[j].inline)
-}
-
-func (sc *StructCodec) describeStruct(
- r *Registry,
- t reflect.Type,
- useJSONStructTags bool,
- errorOnDuplicates bool,
-) (*structDescription, error) {
- // We need to analyze the struct, including getting the tags, collecting
- // information about inlining, and create a map of the field name to the field.
- if v, ok := sc.cache.Load(t); ok {
- return v.(*structDescription), nil
- }
- // TODO(charlie): Only describe the struct once when called
- // concurrently with the same type.
- ds, err := sc.describeStructSlow(r, t, useJSONStructTags, errorOnDuplicates)
- if err != nil {
- return nil, err
- }
- if v, loaded := sc.cache.LoadOrStore(t, ds); loaded {
- ds = v.(*structDescription)
- }
- return ds, nil
-}
-
-func (sc *StructCodec) describeStructSlow(
- r *Registry,
- t reflect.Type,
- useJSONStructTags bool,
- errorOnDuplicates bool,
-) (*structDescription, error) {
- numFields := t.NumField()
- sd := &structDescription{
- fm: make(map[string]fieldDescription, numFields),
- fl: make([]fieldDescription, 0, numFields),
- inlineMap: -1,
- }
-
- var fields []fieldDescription
- for i := 0; i < numFields; i++ {
- sf := t.Field(i)
- if sf.PkgPath != "" && (!sc.AllowUnexportedFields || !sf.Anonymous) {
- // field is private or unexported fields aren't allowed, ignore
- continue
- }
-
- sfType := sf.Type
- encoder, err := r.LookupEncoder(sfType)
- if err != nil {
- encoder = nil
- }
- decoder, err := r.LookupDecoder(sfType)
- if err != nil {
- decoder = nil
- }
-
- description := fieldDescription{
- fieldName: sf.Name,
- idx: i,
- encoder: encoder,
- decoder: decoder,
- }
-
- var stags StructTags
- // If the caller requested that we use JSON struct tags, use the JSONFallbackStructTagParser
- // instead of the parser defined on the codec.
- if useJSONStructTags {
- stags, err = JSONFallbackStructTagParser.ParseStructTags(sf)
- } else {
- stags, err = sc.parser.ParseStructTags(sf)
- }
- if err != nil {
- return nil, err
- }
- if stags.Skip {
- continue
- }
- description.name = stags.Name
- description.omitEmpty = stags.OmitEmpty
- description.minSize = stags.MinSize
- description.truncate = stags.Truncate
-
- if stags.Inline {
- sd.inline = true
- switch sfType.Kind() {
- case reflect.Map:
- if sd.inlineMap >= 0 {
- return nil, errors.New("(struct " + t.String() + ") multiple inline maps")
- }
- if sfType.Key() != tString {
- return nil, errors.New("(struct " + t.String() + ") inline map must have a string keys")
- }
- sd.inlineMap = description.idx
- case reflect.Ptr:
- sfType = sfType.Elem()
- if sfType.Kind() != reflect.Struct {
- return nil, fmt.Errorf("(struct %s) inline fields must be a struct, a struct pointer, or a map", t.String())
- }
- fallthrough
- case reflect.Struct:
- inlinesf, err := sc.describeStruct(r, sfType, useJSONStructTags, errorOnDuplicates)
- if err != nil {
- return nil, err
- }
- for _, fd := range inlinesf.fl {
- if fd.inline == nil {
- fd.inline = []int{i, fd.idx}
- } else {
- fd.inline = append([]int{i}, fd.inline...)
- }
- fields = append(fields, fd)
-
- }
- default:
- return nil, fmt.Errorf("(struct %s) inline fields must be a struct, a struct pointer, or a map", t.String())
- }
- continue
- }
- fields = append(fields, description)
- }
-
- // Sort fieldDescriptions by name and use dominance rules to determine which should be added for each name
- sort.Slice(fields, func(i, j int) bool {
- x := fields
- // sort field by name, breaking ties with depth, then
- // breaking ties with index sequence.
- if x[i].name != x[j].name {
- return x[i].name < x[j].name
- }
- if len(x[i].inline) != len(x[j].inline) {
- return len(x[i].inline) < len(x[j].inline)
- }
- return byIndex(x).Less(i, j)
- })
-
- for advance, i := 0, 0; i < len(fields); i += advance {
- // One iteration per name.
- // Find the sequence of fields with the name of this first field.
- fi := fields[i]
- name := fi.name
- for advance = 1; i+advance < len(fields); advance++ {
- fj := fields[i+advance]
- if fj.name != name {
- break
- }
- }
- if advance == 1 { // Only one field with this name
- sd.fl = append(sd.fl, fi)
- sd.fm[name] = fi
- continue
- }
- dominant, ok := dominantField(fields[i : i+advance])
- if !ok || !sc.OverwriteDuplicatedInlinedFields || errorOnDuplicates {
- return nil, fmt.Errorf("struct %s has duplicated key %s", t.String(), name)
- }
- sd.fl = append(sd.fl, dominant)
- sd.fm[name] = dominant
- }
-
- sort.Sort(byIndex(sd.fl))
-
- return sd, nil
-}
-
-// dominantField looks through the fields, all of which are known to
-// have the same name, to find the single field that dominates the
-// others using Go's inlining rules. If there are multiple top-level
-// fields, the boolean will be false: This condition is an error in Go
-// and we skip all the fields.
-func dominantField(fields []fieldDescription) (fieldDescription, bool) {
- // The fields are sorted in increasing index-length order, then by presence of tag.
- // That means that the first field is the dominant one. We need only check
- // for error cases: two fields at top level.
- if len(fields) > 1 &&
- len(fields[0].inline) == len(fields[1].inline) {
- return fieldDescription{}, false
- }
- return fields[0], true
-}
-
-func fieldByIndexErr(v reflect.Value, index []int) (result reflect.Value, err error) {
- defer func() {
- if recovered := recover(); recovered != nil {
- switch r := recovered.(type) {
- case string:
- err = fmt.Errorf("%s", r)
- case error:
- err = r
- }
- }
- }()
-
- result = v.FieldByIndex(index)
- return
-}
-
-func getInlineField(val reflect.Value, index []int) (reflect.Value, error) {
- field, err := fieldByIndexErr(val, index)
- if err == nil {
- return field, nil
- }
-
- // if parent of this element doesn't exist, fix its parent
- inlineParent := index[:len(index)-1]
- var fParent reflect.Value
- if fParent, err = fieldByIndexErr(val, inlineParent); err != nil {
- fParent, err = getInlineField(val, inlineParent)
- if err != nil {
- return fParent, err
- }
- }
- fParent.Set(reflect.New(fParent.Type().Elem()))
-
- return fieldByIndexErr(val, index)
-}
-
-// DeepZero returns recursive zero object
-func deepZero(st reflect.Type) (result reflect.Value) {
- if st.Kind() == reflect.Struct {
- numField := st.NumField()
- for i := 0; i < numField; i++ {
- if result == emptyValue {
- result = reflect.Indirect(reflect.New(st))
- }
- f := result.Field(i)
- if f.CanInterface() {
- if f.Type().Kind() == reflect.Struct {
- result.Field(i).Set(recursivePointerTo(deepZero(f.Type().Elem())))
- }
- }
- }
- }
- return result
-}
-
-// recursivePointerTo calls reflect.New(v.Type) but recursively for its fields inside
-func recursivePointerTo(v reflect.Value) reflect.Value {
- v = reflect.Indirect(v)
- result := reflect.New(v.Type())
- if v.Kind() == reflect.Struct {
- for i := 0; i < v.NumField(); i++ {
- if f := v.Field(i); f.Kind() == reflect.Ptr {
- if f.Elem().Kind() == reflect.Struct {
- result.Elem().Field(i).Set(recursivePointerTo(f))
- }
- }
- }
- }
-
- return result
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_tag_parser.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_tag_parser.go
deleted file mode 100644
index 18d85bfb0..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_tag_parser.go
+++ /dev/null
@@ -1,148 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsoncodec
-
-import (
- "reflect"
- "strings"
-)
-
-// StructTagParser returns the struct tags for a given struct field.
-//
-// Deprecated: Defining custom BSON struct tag parsers will not be supported in Go Driver 2.0.
-type StructTagParser interface {
- ParseStructTags(reflect.StructField) (StructTags, error)
-}
-
-// StructTagParserFunc is an adapter that allows a generic function to be used
-// as a StructTagParser.
-//
-// Deprecated: Defining custom BSON struct tag parsers will not be supported in Go Driver 2.0.
-type StructTagParserFunc func(reflect.StructField) (StructTags, error)
-
-// ParseStructTags implements the StructTagParser interface.
-func (stpf StructTagParserFunc) ParseStructTags(sf reflect.StructField) (StructTags, error) {
- return stpf(sf)
-}
-
-// StructTags represents the struct tag fields that the StructCodec uses during
-// the encoding and decoding process.
-//
-// In the case of a struct, the lowercased field name is used as the key for each exported
-// field but this behavior may be changed using a struct tag. The tag may also contain flags to
-// adjust the marshalling behavior for the field.
-//
-// The properties are defined below:
-//
-// OmitEmpty Only include the field if it's not set to the zero value for the type or to
-// empty slices or maps.
-//
-// MinSize Marshal an integer of a type larger than 32 bits value as an int32, if that's
-// feasible while preserving the numeric value.
-//
-// Truncate When unmarshaling a BSON double, it is permitted to lose precision to fit within
-// a float32.
-//
-// Inline Inline the field, which must be a struct or a map, causing all of its fields
-// or keys to be processed as if they were part of the outer struct. For maps,
-// keys must not conflict with the bson keys of other struct fields.
-//
-// Skip This struct field should be skipped. This is usually denoted by parsing a "-"
-// for the name.
-//
-// Deprecated: Defining custom BSON struct tag parsers will not be supported in Go Driver 2.0.
-type StructTags struct {
- Name string
- OmitEmpty bool
- MinSize bool
- Truncate bool
- Inline bool
- Skip bool
-}
-
-// DefaultStructTagParser is the StructTagParser used by the StructCodec by default.
-// It will handle the bson struct tag. See the documentation for StructTags to see
-// what each of the returned fields means.
-//
-// If there is no name in the struct tag fields, the struct field name is lowercased.
-// The tag formats accepted are:
-//
-// "[][,[,]]"
-//
-// `(...) bson:"[][,[,]]" (...)`
-//
-// An example:
-//
-// type T struct {
-// A bool
-// B int "myb"
-// C string "myc,omitempty"
-// D string `bson:",omitempty" json:"jsonkey"`
-// E int64 ",minsize"
-// F int64 "myf,omitempty,minsize"
-// }
-//
-// A struct tag either consisting entirely of '-' or with a bson key with a
-// value consisting entirely of '-' will return a StructTags with Skip true and
-// the remaining fields will be their default values.
-//
-// Deprecated: DefaultStructTagParser will be removed in Go Driver 2.0.
-var DefaultStructTagParser StructTagParserFunc = func(sf reflect.StructField) (StructTags, error) {
- key := strings.ToLower(sf.Name)
- tag, ok := sf.Tag.Lookup("bson")
- if !ok && !strings.Contains(string(sf.Tag), ":") && len(sf.Tag) > 0 {
- tag = string(sf.Tag)
- }
- return parseTags(key, tag)
-}
-
-func parseTags(key string, tag string) (StructTags, error) {
- var st StructTags
- if tag == "-" {
- st.Skip = true
- return st, nil
- }
-
- for idx, str := range strings.Split(tag, ",") {
- if idx == 0 && str != "" {
- key = str
- }
- switch str {
- case "omitempty":
- st.OmitEmpty = true
- case "minsize":
- st.MinSize = true
- case "truncate":
- st.Truncate = true
- case "inline":
- st.Inline = true
- }
- }
-
- st.Name = key
-
- return st, nil
-}
-
-// JSONFallbackStructTagParser has the same behavior as DefaultStructTagParser
-// but will also fallback to parsing the json tag instead on a field where the
-// bson tag isn't available.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.UseJSONStructTags] and
-// [go.mongodb.org/mongo-driver/bson.Decoder.UseJSONStructTags] instead.
-var JSONFallbackStructTagParser StructTagParserFunc = func(sf reflect.StructField) (StructTags, error) {
- key := strings.ToLower(sf.Name)
- tag, ok := sf.Tag.Lookup("bson")
- if !ok {
- tag, ok = sf.Tag.Lookup("json")
- }
- if !ok && !strings.Contains(string(sf.Tag), ":") && len(sf.Tag) > 0 {
- tag = string(sf.Tag)
- }
-
- return parseTags(key, tag)
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/time_codec.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/time_codec.go
deleted file mode 100644
index 22fb762c4..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/time_codec.go
+++ /dev/null
@@ -1,151 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsoncodec
-
-import (
- "fmt"
- "reflect"
- "time"
-
- "go.mongodb.org/mongo-driver/bson/bsonoptions"
- "go.mongodb.org/mongo-driver/bson/bsonrw"
- "go.mongodb.org/mongo-driver/bson/bsontype"
- "go.mongodb.org/mongo-driver/bson/primitive"
-)
-
-const (
- timeFormatString = "2006-01-02T15:04:05.999Z07:00"
-)
-
-// TimeCodec is the Codec used for time.Time values.
-//
-// Deprecated: TimeCodec will not be directly configurable in Go Driver 2.0.
-// To configure the time.Time encode and decode behavior, use the configuration
-// methods on a [go.mongodb.org/mongo-driver/bson.Encoder] or
-// [go.mongodb.org/mongo-driver/bson.Decoder]. To configure the time.Time encode
-// and decode behavior for a mongo.Client, use
-// [go.mongodb.org/mongo-driver/mongo/options.ClientOptions.SetBSONOptions].
-//
-// For example, to configure a mongo.Client to ..., use:
-//
-// opt := options.Client().SetBSONOptions(&options.BSONOptions{
-// UseLocalTimeZone: true,
-// })
-//
-// See the deprecation notice for each field in TimeCodec for the corresponding
-// settings.
-type TimeCodec struct {
- // UseLocalTimeZone specifies if we should decode into the local time zone. Defaults to false.
- //
- // Deprecated: Use bson.Decoder.UseLocalTimeZone or options.BSONOptions.UseLocalTimeZone
- // instead.
- UseLocalTimeZone bool
-}
-
-var (
- defaultTimeCodec = NewTimeCodec()
-
- // Assert that defaultTimeCodec satisfies the typeDecoder interface, which allows it to be used
- // by collection type decoders (e.g. map, slice, etc) to set individual values in a collection.
- _ typeDecoder = defaultTimeCodec
-)
-
-// NewTimeCodec returns a TimeCodec with options opts.
-//
-// Deprecated: NewTimeCodec will not be available in Go Driver 2.0. See
-// [TimeCodec] for more details.
-func NewTimeCodec(opts ...*bsonoptions.TimeCodecOptions) *TimeCodec {
- timeOpt := bsonoptions.MergeTimeCodecOptions(opts...)
-
- codec := TimeCodec{}
- if timeOpt.UseLocalTimeZone != nil {
- codec.UseLocalTimeZone = *timeOpt.UseLocalTimeZone
- }
- return &codec
-}
-
-func (tc *TimeCodec) decodeType(dc DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) {
- if t != tTime {
- return emptyValue, ValueDecoderError{
- Name: "TimeDecodeValue",
- Types: []reflect.Type{tTime},
- Received: reflect.Zero(t),
- }
- }
-
- var timeVal time.Time
- switch vrType := vr.Type(); vrType {
- case bsontype.DateTime:
- dt, err := vr.ReadDateTime()
- if err != nil {
- return emptyValue, err
- }
- timeVal = time.Unix(dt/1000, dt%1000*1000000)
- case bsontype.String:
- // assume strings are in the isoTimeFormat
- timeStr, err := vr.ReadString()
- if err != nil {
- return emptyValue, err
- }
- timeVal, err = time.Parse(timeFormatString, timeStr)
- if err != nil {
- return emptyValue, err
- }
- case bsontype.Int64:
- i64, err := vr.ReadInt64()
- if err != nil {
- return emptyValue, err
- }
- timeVal = time.Unix(i64/1000, i64%1000*1000000)
- case bsontype.Timestamp:
- t, _, err := vr.ReadTimestamp()
- if err != nil {
- return emptyValue, err
- }
- timeVal = time.Unix(int64(t), 0)
- case bsontype.Null:
- if err := vr.ReadNull(); err != nil {
- return emptyValue, err
- }
- case bsontype.Undefined:
- if err := vr.ReadUndefined(); err != nil {
- return emptyValue, err
- }
- default:
- return emptyValue, fmt.Errorf("cannot decode %v into a time.Time", vrType)
- }
-
- if !tc.UseLocalTimeZone && !dc.useLocalTimeZone {
- timeVal = timeVal.UTC()
- }
- return reflect.ValueOf(timeVal), nil
-}
-
-// DecodeValue is the ValueDecoderFunc for time.Time.
-func (tc *TimeCodec) DecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() || val.Type() != tTime {
- return ValueDecoderError{Name: "TimeDecodeValue", Types: []reflect.Type{tTime}, Received: val}
- }
-
- elem, err := tc.decodeType(dc, vr, tTime)
- if err != nil {
- return err
- }
-
- val.Set(elem)
- return nil
-}
-
-// EncodeValue is the ValueEncoderFunc for time.TIme.
-func (tc *TimeCodec) EncodeValue(_ EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- if !val.IsValid() || val.Type() != tTime {
- return ValueEncoderError{Name: "TimeEncodeValue", Types: []reflect.Type{tTime}, Received: val}
- }
- tt := val.Interface().(time.Time)
- dt := primitive.NewDateTimeFromTime(tt)
- return vw.WriteDateTime(int64(dt))
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/types.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/types.go
deleted file mode 100644
index 6ade17b7d..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/types.go
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsoncodec
-
-import (
- "encoding/json"
- "net/url"
- "reflect"
- "time"
-
- "go.mongodb.org/mongo-driver/bson/primitive"
- "go.mongodb.org/mongo-driver/x/bsonx/bsoncore"
-)
-
-var tBool = reflect.TypeOf(false)
-var tFloat64 = reflect.TypeOf(float64(0))
-var tInt32 = reflect.TypeOf(int32(0))
-var tInt64 = reflect.TypeOf(int64(0))
-var tString = reflect.TypeOf("")
-var tTime = reflect.TypeOf(time.Time{})
-
-var tEmpty = reflect.TypeOf((*interface{})(nil)).Elem()
-var tByteSlice = reflect.TypeOf([]byte(nil))
-var tByte = reflect.TypeOf(byte(0x00))
-var tURL = reflect.TypeOf(url.URL{})
-var tJSONNumber = reflect.TypeOf(json.Number(""))
-
-var tValueMarshaler = reflect.TypeOf((*ValueMarshaler)(nil)).Elem()
-var tValueUnmarshaler = reflect.TypeOf((*ValueUnmarshaler)(nil)).Elem()
-var tMarshaler = reflect.TypeOf((*Marshaler)(nil)).Elem()
-var tUnmarshaler = reflect.TypeOf((*Unmarshaler)(nil)).Elem()
-var tProxy = reflect.TypeOf((*Proxy)(nil)).Elem()
-var tZeroer = reflect.TypeOf((*Zeroer)(nil)).Elem()
-
-var tBinary = reflect.TypeOf(primitive.Binary{})
-var tUndefined = reflect.TypeOf(primitive.Undefined{})
-var tOID = reflect.TypeOf(primitive.ObjectID{})
-var tDateTime = reflect.TypeOf(primitive.DateTime(0))
-var tNull = reflect.TypeOf(primitive.Null{})
-var tRegex = reflect.TypeOf(primitive.Regex{})
-var tCodeWithScope = reflect.TypeOf(primitive.CodeWithScope{})
-var tDBPointer = reflect.TypeOf(primitive.DBPointer{})
-var tJavaScript = reflect.TypeOf(primitive.JavaScript(""))
-var tSymbol = reflect.TypeOf(primitive.Symbol(""))
-var tTimestamp = reflect.TypeOf(primitive.Timestamp{})
-var tDecimal = reflect.TypeOf(primitive.Decimal128{})
-var tMinKey = reflect.TypeOf(primitive.MinKey{})
-var tMaxKey = reflect.TypeOf(primitive.MaxKey{})
-var tD = reflect.TypeOf(primitive.D{})
-var tA = reflect.TypeOf(primitive.A{})
-var tE = reflect.TypeOf(primitive.E{})
-
-var tCoreDocument = reflect.TypeOf(bsoncore.Document{})
-var tCoreArray = reflect.TypeOf(bsoncore.Array{})
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/uint_codec.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/uint_codec.go
deleted file mode 100644
index 39b07135b..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/uint_codec.go
+++ /dev/null
@@ -1,202 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsoncodec
-
-import (
- "fmt"
- "math"
- "reflect"
-
- "go.mongodb.org/mongo-driver/bson/bsonoptions"
- "go.mongodb.org/mongo-driver/bson/bsonrw"
- "go.mongodb.org/mongo-driver/bson/bsontype"
-)
-
-// UIntCodec is the Codec used for uint values.
-//
-// Deprecated: UIntCodec will not be directly configurable in Go Driver 2.0. To
-// configure the uint encode and decode behavior, use the configuration methods
-// on a [go.mongodb.org/mongo-driver/bson.Encoder] or
-// [go.mongodb.org/mongo-driver/bson.Decoder]. To configure the uint encode and
-// decode behavior for a mongo.Client, use
-// [go.mongodb.org/mongo-driver/mongo/options.ClientOptions.SetBSONOptions].
-//
-// For example, to configure a mongo.Client to marshal Go uint values as the
-// minimum BSON int size that can represent the value, use:
-//
-// opt := options.Client().SetBSONOptions(&options.BSONOptions{
-// IntMinSize: true,
-// })
-//
-// See the deprecation notice for each field in UIntCodec for the corresponding
-// settings.
-type UIntCodec struct {
- // EncodeToMinSize causes EncodeValue to marshal Go uint values (excluding uint64) as the
- // minimum BSON int size (either 32-bit or 64-bit) that can represent the integer value.
- //
- // Deprecated: Use bson.Encoder.IntMinSize or options.BSONOptions.IntMinSize instead.
- EncodeToMinSize bool
-}
-
-var (
- defaultUIntCodec = NewUIntCodec()
-
- // Assert that defaultUIntCodec satisfies the typeDecoder interface, which allows it to be used
- // by collection type decoders (e.g. map, slice, etc) to set individual values in a collection.
- _ typeDecoder = defaultUIntCodec
-)
-
-// NewUIntCodec returns a UIntCodec with options opts.
-//
-// Deprecated: NewUIntCodec will not be available in Go Driver 2.0. See
-// [UIntCodec] for more details.
-func NewUIntCodec(opts ...*bsonoptions.UIntCodecOptions) *UIntCodec {
- uintOpt := bsonoptions.MergeUIntCodecOptions(opts...)
-
- codec := UIntCodec{}
- if uintOpt.EncodeToMinSize != nil {
- codec.EncodeToMinSize = *uintOpt.EncodeToMinSize
- }
- return &codec
-}
-
-// EncodeValue is the ValueEncoder for uint types.
-func (uic *UIntCodec) EncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
- switch val.Kind() {
- case reflect.Uint8, reflect.Uint16:
- return vw.WriteInt32(int32(val.Uint()))
- case reflect.Uint, reflect.Uint32, reflect.Uint64:
- u64 := val.Uint()
-
- // If ec.MinSize or if encodeToMinSize is true for a non-uint64 value we should write val as an int32
- useMinSize := ec.MinSize || (uic.EncodeToMinSize && val.Kind() != reflect.Uint64)
-
- if u64 <= math.MaxInt32 && useMinSize {
- return vw.WriteInt32(int32(u64))
- }
- if u64 > math.MaxInt64 {
- return fmt.Errorf("%d overflows int64", u64)
- }
- return vw.WriteInt64(int64(u64))
- }
-
- return ValueEncoderError{
- Name: "UintEncodeValue",
- Kinds: []reflect.Kind{reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint},
- Received: val,
- }
-}
-
-func (uic *UIntCodec) decodeType(dc DecodeContext, vr bsonrw.ValueReader, t reflect.Type) (reflect.Value, error) {
- var i64 int64
- var err error
- switch vrType := vr.Type(); vrType {
- case bsontype.Int32:
- i32, err := vr.ReadInt32()
- if err != nil {
- return emptyValue, err
- }
- i64 = int64(i32)
- case bsontype.Int64:
- i64, err = vr.ReadInt64()
- if err != nil {
- return emptyValue, err
- }
- case bsontype.Double:
- f64, err := vr.ReadDouble()
- if err != nil {
- return emptyValue, err
- }
- if !dc.Truncate && math.Floor(f64) != f64 {
- return emptyValue, errCannotTruncate
- }
- if f64 > float64(math.MaxInt64) {
- return emptyValue, fmt.Errorf("%g overflows int64", f64)
- }
- i64 = int64(f64)
- case bsontype.Boolean:
- b, err := vr.ReadBoolean()
- if err != nil {
- return emptyValue, err
- }
- if b {
- i64 = 1
- }
- case bsontype.Null:
- if err = vr.ReadNull(); err != nil {
- return emptyValue, err
- }
- case bsontype.Undefined:
- if err = vr.ReadUndefined(); err != nil {
- return emptyValue, err
- }
- default:
- return emptyValue, fmt.Errorf("cannot decode %v into an integer type", vrType)
- }
-
- switch t.Kind() {
- case reflect.Uint8:
- if i64 < 0 || i64 > math.MaxUint8 {
- return emptyValue, fmt.Errorf("%d overflows uint8", i64)
- }
-
- return reflect.ValueOf(uint8(i64)), nil
- case reflect.Uint16:
- if i64 < 0 || i64 > math.MaxUint16 {
- return emptyValue, fmt.Errorf("%d overflows uint16", i64)
- }
-
- return reflect.ValueOf(uint16(i64)), nil
- case reflect.Uint32:
- if i64 < 0 || i64 > math.MaxUint32 {
- return emptyValue, fmt.Errorf("%d overflows uint32", i64)
- }
-
- return reflect.ValueOf(uint32(i64)), nil
- case reflect.Uint64:
- if i64 < 0 {
- return emptyValue, fmt.Errorf("%d overflows uint64", i64)
- }
-
- return reflect.ValueOf(uint64(i64)), nil
- case reflect.Uint:
- if i64 < 0 {
- return emptyValue, fmt.Errorf("%d overflows uint", i64)
- }
- v := uint64(i64)
- if v > math.MaxUint { // Can we fit this inside of an uint
- return emptyValue, fmt.Errorf("%d overflows uint", i64)
- }
-
- return reflect.ValueOf(uint(v)), nil
- default:
- return emptyValue, ValueDecoderError{
- Name: "UintDecodeValue",
- Kinds: []reflect.Kind{reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint},
- Received: reflect.Zero(t),
- }
- }
-}
-
-// DecodeValue is the ValueDecoder for uint types.
-func (uic *UIntCodec) DecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
- if !val.CanSet() {
- return ValueDecoderError{
- Name: "UintDecodeValue",
- Kinds: []reflect.Kind{reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint},
- Received: val,
- }
- }
-
- elem, err := uic.decodeType(dc, vr, val.Type())
- if err != nil {
- return err
- }
-
- val.SetUint(elem.Uint())
- return nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/byte_slice_codec_options.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/byte_slice_codec_options.go
deleted file mode 100644
index 996bd1712..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/byte_slice_codec_options.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsonoptions
-
-// ByteSliceCodecOptions represents all possible options for byte slice encoding and decoding.
-//
-// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal
-// and unmarshal behavior instead.
-type ByteSliceCodecOptions struct {
- EncodeNilAsEmpty *bool // Specifies if a nil byte slice should encode as an empty binary instead of null. Defaults to false.
-}
-
-// ByteSliceCodec creates a new *ByteSliceCodecOptions
-//
-// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal
-// and unmarshal behavior instead.
-func ByteSliceCodec() *ByteSliceCodecOptions {
- return &ByteSliceCodecOptions{}
-}
-
-// SetEncodeNilAsEmpty specifies if a nil byte slice should encode as an empty binary instead of null. Defaults to false.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.NilByteSliceAsEmpty] instead.
-func (bs *ByteSliceCodecOptions) SetEncodeNilAsEmpty(b bool) *ByteSliceCodecOptions {
- bs.EncodeNilAsEmpty = &b
- return bs
-}
-
-// MergeByteSliceCodecOptions combines the given *ByteSliceCodecOptions into a single *ByteSliceCodecOptions in a last one wins fashion.
-//
-// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a
-// single options struct instead.
-func MergeByteSliceCodecOptions(opts ...*ByteSliceCodecOptions) *ByteSliceCodecOptions {
- bs := ByteSliceCodec()
- for _, opt := range opts {
- if opt == nil {
- continue
- }
- if opt.EncodeNilAsEmpty != nil {
- bs.EncodeNilAsEmpty = opt.EncodeNilAsEmpty
- }
- }
-
- return bs
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/doc.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/doc.go
deleted file mode 100644
index c40973c8d..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/doc.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2022-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-// Package bsonoptions defines the optional configurations for the BSON codecs.
-package bsonoptions
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/empty_interface_codec_options.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/empty_interface_codec_options.go
deleted file mode 100644
index f522c7e03..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/empty_interface_codec_options.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsonoptions
-
-// EmptyInterfaceCodecOptions represents all possible options for interface{} encoding and decoding.
-//
-// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal
-// and unmarshal behavior instead.
-type EmptyInterfaceCodecOptions struct {
- DecodeBinaryAsSlice *bool // Specifies if Old and Generic type binarys should default to []slice instead of primitive.Binary. Defaults to false.
-}
-
-// EmptyInterfaceCodec creates a new *EmptyInterfaceCodecOptions
-//
-// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal
-// and unmarshal behavior instead.
-func EmptyInterfaceCodec() *EmptyInterfaceCodecOptions {
- return &EmptyInterfaceCodecOptions{}
-}
-
-// SetDecodeBinaryAsSlice specifies if Old and Generic type binarys should default to []slice instead of primitive.Binary. Defaults to false.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Decoder.BinaryAsSlice] instead.
-func (e *EmptyInterfaceCodecOptions) SetDecodeBinaryAsSlice(b bool) *EmptyInterfaceCodecOptions {
- e.DecodeBinaryAsSlice = &b
- return e
-}
-
-// MergeEmptyInterfaceCodecOptions combines the given *EmptyInterfaceCodecOptions into a single *EmptyInterfaceCodecOptions in a last one wins fashion.
-//
-// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a
-// single options struct instead.
-func MergeEmptyInterfaceCodecOptions(opts ...*EmptyInterfaceCodecOptions) *EmptyInterfaceCodecOptions {
- e := EmptyInterfaceCodec()
- for _, opt := range opts {
- if opt == nil {
- continue
- }
- if opt.DecodeBinaryAsSlice != nil {
- e.DecodeBinaryAsSlice = opt.DecodeBinaryAsSlice
- }
- }
-
- return e
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/map_codec_options.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/map_codec_options.go
deleted file mode 100644
index a7a7c1d98..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/map_codec_options.go
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsonoptions
-
-// MapCodecOptions represents all possible options for map encoding and decoding.
-//
-// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal
-// and unmarshal behavior instead.
-type MapCodecOptions struct {
- DecodeZerosMap *bool // Specifies if the map should be zeroed before decoding into it. Defaults to false.
- EncodeNilAsEmpty *bool // Specifies if a nil map should encode as an empty document instead of null. Defaults to false.
- // Specifies how keys should be handled. If false, the behavior matches encoding/json, where the encoding key type must
- // either be a string, an integer type, or implement bsoncodec.KeyMarshaler and the decoding key type must either be a
- // string, an integer type, or implement bsoncodec.KeyUnmarshaler. If true, keys are encoded with fmt.Sprint() and the
- // encoding key type must be a string, an integer type, or a float. If true, the use of Stringer will override
- // TextMarshaler/TextUnmarshaler. Defaults to false.
- EncodeKeysWithStringer *bool
-}
-
-// MapCodec creates a new *MapCodecOptions
-//
-// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal
-// and unmarshal behavior instead.
-func MapCodec() *MapCodecOptions {
- return &MapCodecOptions{}
-}
-
-// SetDecodeZerosMap specifies if the map should be zeroed before decoding into it. Defaults to false.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Decoder.ZeroMaps] instead.
-func (t *MapCodecOptions) SetDecodeZerosMap(b bool) *MapCodecOptions {
- t.DecodeZerosMap = &b
- return t
-}
-
-// SetEncodeNilAsEmpty specifies if a nil map should encode as an empty document instead of null. Defaults to false.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.NilMapAsEmpty] instead.
-func (t *MapCodecOptions) SetEncodeNilAsEmpty(b bool) *MapCodecOptions {
- t.EncodeNilAsEmpty = &b
- return t
-}
-
-// SetEncodeKeysWithStringer specifies how keys should be handled. If false, the behavior matches encoding/json, where the
-// encoding key type must either be a string, an integer type, or implement bsoncodec.KeyMarshaler and the decoding key
-// type must either be a string, an integer type, or implement bsoncodec.KeyUnmarshaler. If true, keys are encoded with
-// fmt.Sprint() and the encoding key type must be a string, an integer type, or a float. If true, the use of Stringer
-// will override TextMarshaler/TextUnmarshaler. Defaults to false.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.StringifyMapKeysWithFmt] instead.
-func (t *MapCodecOptions) SetEncodeKeysWithStringer(b bool) *MapCodecOptions {
- t.EncodeKeysWithStringer = &b
- return t
-}
-
-// MergeMapCodecOptions combines the given *MapCodecOptions into a single *MapCodecOptions in a last one wins fashion.
-//
-// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a
-// single options struct instead.
-func MergeMapCodecOptions(opts ...*MapCodecOptions) *MapCodecOptions {
- s := MapCodec()
- for _, opt := range opts {
- if opt == nil {
- continue
- }
- if opt.DecodeZerosMap != nil {
- s.DecodeZerosMap = opt.DecodeZerosMap
- }
- if opt.EncodeNilAsEmpty != nil {
- s.EncodeNilAsEmpty = opt.EncodeNilAsEmpty
- }
- if opt.EncodeKeysWithStringer != nil {
- s.EncodeKeysWithStringer = opt.EncodeKeysWithStringer
- }
- }
-
- return s
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/slice_codec_options.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/slice_codec_options.go
deleted file mode 100644
index 3c1e4f35b..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/slice_codec_options.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsonoptions
-
-// SliceCodecOptions represents all possible options for slice encoding and decoding.
-//
-// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal
-// and unmarshal behavior instead.
-type SliceCodecOptions struct {
- EncodeNilAsEmpty *bool // Specifies if a nil slice should encode as an empty array instead of null. Defaults to false.
-}
-
-// SliceCodec creates a new *SliceCodecOptions
-//
-// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal
-// and unmarshal behavior instead.
-func SliceCodec() *SliceCodecOptions {
- return &SliceCodecOptions{}
-}
-
-// SetEncodeNilAsEmpty specifies if a nil slice should encode as an empty array instead of null. Defaults to false.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.NilSliceAsEmpty] instead.
-func (s *SliceCodecOptions) SetEncodeNilAsEmpty(b bool) *SliceCodecOptions {
- s.EncodeNilAsEmpty = &b
- return s
-}
-
-// MergeSliceCodecOptions combines the given *SliceCodecOptions into a single *SliceCodecOptions in a last one wins fashion.
-//
-// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a
-// single options struct instead.
-func MergeSliceCodecOptions(opts ...*SliceCodecOptions) *SliceCodecOptions {
- s := SliceCodec()
- for _, opt := range opts {
- if opt == nil {
- continue
- }
- if opt.EncodeNilAsEmpty != nil {
- s.EncodeNilAsEmpty = opt.EncodeNilAsEmpty
- }
- }
-
- return s
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/string_codec_options.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/string_codec_options.go
deleted file mode 100644
index f8b76f996..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/string_codec_options.go
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsonoptions
-
-var defaultDecodeOIDAsHex = true
-
-// StringCodecOptions represents all possible options for string encoding and decoding.
-//
-// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal
-// and unmarshal behavior instead.
-type StringCodecOptions struct {
- DecodeObjectIDAsHex *bool // Specifies if we should decode ObjectID as the hex value. Defaults to true.
-}
-
-// StringCodec creates a new *StringCodecOptions
-//
-// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal
-// and unmarshal behavior instead.
-func StringCodec() *StringCodecOptions {
- return &StringCodecOptions{}
-}
-
-// SetDecodeObjectIDAsHex specifies if object IDs should be decoded as their hex representation. If false, a string made
-// from the raw object ID bytes will be used. Defaults to true.
-//
-// Deprecated: Decoding object IDs as raw bytes will not be supported in Go Driver 2.0.
-func (t *StringCodecOptions) SetDecodeObjectIDAsHex(b bool) *StringCodecOptions {
- t.DecodeObjectIDAsHex = &b
- return t
-}
-
-// MergeStringCodecOptions combines the given *StringCodecOptions into a single *StringCodecOptions in a last one wins fashion.
-//
-// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a
-// single options struct instead.
-func MergeStringCodecOptions(opts ...*StringCodecOptions) *StringCodecOptions {
- s := &StringCodecOptions{&defaultDecodeOIDAsHex}
- for _, opt := range opts {
- if opt == nil {
- continue
- }
- if opt.DecodeObjectIDAsHex != nil {
- s.DecodeObjectIDAsHex = opt.DecodeObjectIDAsHex
- }
- }
-
- return s
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/struct_codec_options.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/struct_codec_options.go
deleted file mode 100644
index 1cbfa32e8..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/struct_codec_options.go
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsonoptions
-
-var defaultOverwriteDuplicatedInlinedFields = true
-
-// StructCodecOptions represents all possible options for struct encoding and decoding.
-//
-// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal
-// and unmarshal behavior instead.
-type StructCodecOptions struct {
- DecodeZeroStruct *bool // Specifies if structs should be zeroed before decoding into them. Defaults to false.
- DecodeDeepZeroInline *bool // Specifies if structs should be recursively zeroed when a inline value is decoded. Defaults to false.
- EncodeOmitDefaultStruct *bool // Specifies if default structs should be considered empty by omitempty. Defaults to false.
- AllowUnexportedFields *bool // Specifies if unexported fields should be marshaled/unmarshaled. Defaults to false.
- OverwriteDuplicatedInlinedFields *bool // Specifies if fields in inlined structs can be overwritten by higher level struct fields with the same key. Defaults to true.
-}
-
-// StructCodec creates a new *StructCodecOptions
-//
-// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal
-// and unmarshal behavior instead.
-func StructCodec() *StructCodecOptions {
- return &StructCodecOptions{}
-}
-
-// SetDecodeZeroStruct specifies if structs should be zeroed before decoding into them. Defaults to false.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Decoder.ZeroStructs] instead.
-func (t *StructCodecOptions) SetDecodeZeroStruct(b bool) *StructCodecOptions {
- t.DecodeZeroStruct = &b
- return t
-}
-
-// SetDecodeDeepZeroInline specifies if structs should be zeroed before decoding into them. Defaults to false.
-//
-// Deprecated: DecodeDeepZeroInline will not be supported in Go Driver 2.0.
-func (t *StructCodecOptions) SetDecodeDeepZeroInline(b bool) *StructCodecOptions {
- t.DecodeDeepZeroInline = &b
- return t
-}
-
-// SetEncodeOmitDefaultStruct specifies if default structs should be considered empty by omitempty. A default struct has all
-// its values set to their default value. Defaults to false.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.OmitZeroStruct] instead.
-func (t *StructCodecOptions) SetEncodeOmitDefaultStruct(b bool) *StructCodecOptions {
- t.EncodeOmitDefaultStruct = &b
- return t
-}
-
-// SetOverwriteDuplicatedInlinedFields specifies if inlined struct fields can be overwritten by higher level struct fields with the
-// same bson key. When true and decoding, values will be written to the outermost struct with a matching key, and when
-// encoding, keys will have the value of the top-most matching field. When false, decoding and encoding will error if
-// there are duplicate keys after the struct is inlined. Defaults to true.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.ErrorOnInlineDuplicates] instead.
-func (t *StructCodecOptions) SetOverwriteDuplicatedInlinedFields(b bool) *StructCodecOptions {
- t.OverwriteDuplicatedInlinedFields = &b
- return t
-}
-
-// SetAllowUnexportedFields specifies if unexported fields should be marshaled/unmarshaled. Defaults to false.
-//
-// Deprecated: AllowUnexportedFields does not work on recent versions of Go and will not be
-// supported in Go Driver 2.0.
-func (t *StructCodecOptions) SetAllowUnexportedFields(b bool) *StructCodecOptions {
- t.AllowUnexportedFields = &b
- return t
-}
-
-// MergeStructCodecOptions combines the given *StructCodecOptions into a single *StructCodecOptions in a last one wins fashion.
-//
-// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a
-// single options struct instead.
-func MergeStructCodecOptions(opts ...*StructCodecOptions) *StructCodecOptions {
- s := &StructCodecOptions{
- OverwriteDuplicatedInlinedFields: &defaultOverwriteDuplicatedInlinedFields,
- }
- for _, opt := range opts {
- if opt == nil {
- continue
- }
-
- if opt.DecodeZeroStruct != nil {
- s.DecodeZeroStruct = opt.DecodeZeroStruct
- }
- if opt.DecodeDeepZeroInline != nil {
- s.DecodeDeepZeroInline = opt.DecodeDeepZeroInline
- }
- if opt.EncodeOmitDefaultStruct != nil {
- s.EncodeOmitDefaultStruct = opt.EncodeOmitDefaultStruct
- }
- if opt.OverwriteDuplicatedInlinedFields != nil {
- s.OverwriteDuplicatedInlinedFields = opt.OverwriteDuplicatedInlinedFields
- }
- if opt.AllowUnexportedFields != nil {
- s.AllowUnexportedFields = opt.AllowUnexportedFields
- }
- }
-
- return s
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/time_codec_options.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/time_codec_options.go
deleted file mode 100644
index 3f38433d2..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/time_codec_options.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsonoptions
-
-// TimeCodecOptions represents all possible options for time.Time encoding and decoding.
-//
-// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal
-// and unmarshal behavior instead.
-type TimeCodecOptions struct {
- UseLocalTimeZone *bool // Specifies if we should decode into the local time zone. Defaults to false.
-}
-
-// TimeCodec creates a new *TimeCodecOptions
-//
-// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal
-// and unmarshal behavior instead.
-func TimeCodec() *TimeCodecOptions {
- return &TimeCodecOptions{}
-}
-
-// SetUseLocalTimeZone specifies if we should decode into the local time zone. Defaults to false.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Decoder.UseLocalTimeZone] instead.
-func (t *TimeCodecOptions) SetUseLocalTimeZone(b bool) *TimeCodecOptions {
- t.UseLocalTimeZone = &b
- return t
-}
-
-// MergeTimeCodecOptions combines the given *TimeCodecOptions into a single *TimeCodecOptions in a last one wins fashion.
-//
-// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a
-// single options struct instead.
-func MergeTimeCodecOptions(opts ...*TimeCodecOptions) *TimeCodecOptions {
- t := TimeCodec()
- for _, opt := range opts {
- if opt == nil {
- continue
- }
- if opt.UseLocalTimeZone != nil {
- t.UseLocalTimeZone = opt.UseLocalTimeZone
- }
- }
-
- return t
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/uint_codec_options.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/uint_codec_options.go
deleted file mode 100644
index 5091e4d96..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/uint_codec_options.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsonoptions
-
-// UIntCodecOptions represents all possible options for uint encoding and decoding.
-//
-// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal
-// and unmarshal behavior instead.
-type UIntCodecOptions struct {
- EncodeToMinSize *bool // Specifies if all uints except uint64 should be decoded to minimum size bsontype. Defaults to false.
-}
-
-// UIntCodec creates a new *UIntCodecOptions
-//
-// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal
-// and unmarshal behavior instead.
-func UIntCodec() *UIntCodecOptions {
- return &UIntCodecOptions{}
-}
-
-// SetEncodeToMinSize specifies if all uints except uint64 should be decoded to minimum size bsontype. Defaults to false.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.Encoder.IntMinSize] instead.
-func (u *UIntCodecOptions) SetEncodeToMinSize(b bool) *UIntCodecOptions {
- u.EncodeToMinSize = &b
- return u
-}
-
-// MergeUIntCodecOptions combines the given *UIntCodecOptions into a single *UIntCodecOptions in a last one wins fashion.
-//
-// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a
-// single options struct instead.
-func MergeUIntCodecOptions(opts ...*UIntCodecOptions) *UIntCodecOptions {
- u := UIntCodec()
- for _, opt := range opts {
- if opt == nil {
- continue
- }
- if opt.EncodeToMinSize != nil {
- u.EncodeToMinSize = opt.EncodeToMinSize
- }
- }
-
- return u
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/copier.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/copier.go
deleted file mode 100644
index 1e25570b8..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/copier.go
+++ /dev/null
@@ -1,489 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsonrw
-
-import (
- "errors"
- "fmt"
- "io"
-
- "go.mongodb.org/mongo-driver/bson/bsontype"
- "go.mongodb.org/mongo-driver/bson/primitive"
- "go.mongodb.org/mongo-driver/x/bsonx/bsoncore"
-)
-
-// Copier is a type that allows copying between ValueReaders, ValueWriters, and
-// []byte values.
-//
-// Deprecated: Copying BSON documents using the ValueWriter and ValueReader interfaces will not be
-// supported in Go Driver 2.0.
-type Copier struct{}
-
-// NewCopier creates a new copier with the given registry. If a nil registry is provided
-// a default registry is used.
-//
-// Deprecated: Copying BSON documents using the ValueWriter and ValueReader interfaces will not be
-// supported in Go Driver 2.0.
-func NewCopier() Copier {
- return Copier{}
-}
-
-// CopyDocument handles copying a document from src to dst.
-//
-// Deprecated: Copying BSON documents using the ValueWriter and ValueReader interfaces will not be
-// supported in Go Driver 2.0.
-func CopyDocument(dst ValueWriter, src ValueReader) error {
- return Copier{}.CopyDocument(dst, src)
-}
-
-// CopyDocument handles copying one document from the src to the dst.
-//
-// Deprecated: Copying BSON documents using the ValueWriter and ValueReader interfaces will not be
-// supported in Go Driver 2.0.
-func (c Copier) CopyDocument(dst ValueWriter, src ValueReader) error {
- dr, err := src.ReadDocument()
- if err != nil {
- return err
- }
-
- dw, err := dst.WriteDocument()
- if err != nil {
- return err
- }
-
- return c.copyDocumentCore(dw, dr)
-}
-
-// CopyArrayFromBytes copies the values from a BSON array represented as a
-// []byte to a ValueWriter.
-//
-// Deprecated: Copying BSON arrays using the ValueWriter and ValueReader interfaces will not be
-// supported in Go Driver 2.0.
-func (c Copier) CopyArrayFromBytes(dst ValueWriter, src []byte) error {
- aw, err := dst.WriteArray()
- if err != nil {
- return err
- }
-
- err = c.CopyBytesToArrayWriter(aw, src)
- if err != nil {
- return err
- }
-
- return aw.WriteArrayEnd()
-}
-
-// CopyDocumentFromBytes copies the values from a BSON document represented as a
-// []byte to a ValueWriter.
-//
-// Deprecated: Copying BSON documents using the ValueWriter and ValueReader interfaces will not be
-// supported in Go Driver 2.0.
-func (c Copier) CopyDocumentFromBytes(dst ValueWriter, src []byte) error {
- dw, err := dst.WriteDocument()
- if err != nil {
- return err
- }
-
- err = c.CopyBytesToDocumentWriter(dw, src)
- if err != nil {
- return err
- }
-
- return dw.WriteDocumentEnd()
-}
-
-type writeElementFn func(key string) (ValueWriter, error)
-
-// CopyBytesToArrayWriter copies the values from a BSON Array represented as a []byte to an
-// ArrayWriter.
-//
-// Deprecated: Copying BSON arrays using the ArrayWriter interface will not be supported in Go
-// Driver 2.0.
-func (c Copier) CopyBytesToArrayWriter(dst ArrayWriter, src []byte) error {
- wef := func(_ string) (ValueWriter, error) {
- return dst.WriteArrayElement()
- }
-
- return c.copyBytesToValueWriter(src, wef)
-}
-
-// CopyBytesToDocumentWriter copies the values from a BSON document represented as a []byte to a
-// DocumentWriter.
-//
-// Deprecated: Copying BSON documents using the ValueWriter and ValueReader interfaces will not be
-// supported in Go Driver 2.0.
-func (c Copier) CopyBytesToDocumentWriter(dst DocumentWriter, src []byte) error {
- wef := func(key string) (ValueWriter, error) {
- return dst.WriteDocumentElement(key)
- }
-
- return c.copyBytesToValueWriter(src, wef)
-}
-
-func (c Copier) copyBytesToValueWriter(src []byte, wef writeElementFn) error {
- // TODO(skriptble): Create errors types here. Anything that is a tag should be a property.
- length, rem, ok := bsoncore.ReadLength(src)
- if !ok {
- return fmt.Errorf("couldn't read length from src, not enough bytes. length=%d", len(src))
- }
- if len(src) < int(length) {
- return fmt.Errorf("length read exceeds number of bytes available. length=%d bytes=%d", len(src), length)
- }
- rem = rem[:length-4]
-
- var t bsontype.Type
- var key string
- var val bsoncore.Value
- for {
- t, rem, ok = bsoncore.ReadType(rem)
- if !ok {
- return io.EOF
- }
- if t == bsontype.Type(0) {
- if len(rem) != 0 {
- return fmt.Errorf("document end byte found before end of document. remaining bytes=%v", rem)
- }
- break
- }
-
- key, rem, ok = bsoncore.ReadKey(rem)
- if !ok {
- return fmt.Errorf("invalid key found. remaining bytes=%v", rem)
- }
-
- // write as either array element or document element using writeElementFn
- vw, err := wef(key)
- if err != nil {
- return err
- }
-
- val, rem, ok = bsoncore.ReadValue(rem, t)
- if !ok {
- return fmt.Errorf("not enough bytes available to read type. bytes=%d type=%s", len(rem), t)
- }
- err = c.CopyValueFromBytes(vw, t, val.Data)
- if err != nil {
- return err
- }
- }
- return nil
-}
-
-// CopyDocumentToBytes copies an entire document from the ValueReader and
-// returns it as bytes.
-//
-// Deprecated: Copying BSON documents using the ValueWriter and ValueReader interfaces will not be
-// supported in Go Driver 2.0.
-func (c Copier) CopyDocumentToBytes(src ValueReader) ([]byte, error) {
- return c.AppendDocumentBytes(nil, src)
-}
-
-// AppendDocumentBytes functions the same as CopyDocumentToBytes, but will
-// append the result to dst.
-//
-// Deprecated: Copying BSON documents using the ValueWriter and ValueReader interfaces will not be
-// supported in Go Driver 2.0.
-func (c Copier) AppendDocumentBytes(dst []byte, src ValueReader) ([]byte, error) {
- if br, ok := src.(BytesReader); ok {
- _, dst, err := br.ReadValueBytes(dst)
- return dst, err
- }
-
- vw := vwPool.Get().(*valueWriter)
- defer putValueWriter(vw)
-
- vw.reset(dst)
-
- err := c.CopyDocument(vw, src)
- dst = vw.buf
- return dst, err
-}
-
-// AppendArrayBytes copies an array from the ValueReader to dst.
-//
-// Deprecated: Copying BSON arrays using the ValueWriter and ValueReader interfaces will not be
-// supported in Go Driver 2.0.
-func (c Copier) AppendArrayBytes(dst []byte, src ValueReader) ([]byte, error) {
- if br, ok := src.(BytesReader); ok {
- _, dst, err := br.ReadValueBytes(dst)
- return dst, err
- }
-
- vw := vwPool.Get().(*valueWriter)
- defer putValueWriter(vw)
-
- vw.reset(dst)
-
- err := c.copyArray(vw, src)
- dst = vw.buf
- return dst, err
-}
-
-// CopyValueFromBytes will write the value represtend by t and src to dst.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.UnmarshalValue] instead.
-func (c Copier) CopyValueFromBytes(dst ValueWriter, t bsontype.Type, src []byte) error {
- if wvb, ok := dst.(BytesWriter); ok {
- return wvb.WriteValueBytes(t, src)
- }
-
- vr := vrPool.Get().(*valueReader)
- defer vrPool.Put(vr)
-
- vr.reset(src)
- vr.pushElement(t)
-
- return c.CopyValue(dst, vr)
-}
-
-// CopyValueToBytes copies a value from src and returns it as a bsontype.Type and a
-// []byte.
-//
-// Deprecated: Use [go.mongodb.org/mongo-driver/bson.MarshalValue] instead.
-func (c Copier) CopyValueToBytes(src ValueReader) (bsontype.Type, []byte, error) {
- return c.AppendValueBytes(nil, src)
-}
-
-// AppendValueBytes functions the same as CopyValueToBytes, but will append the
-// result to dst.
-//
-// Deprecated: Appending individual BSON elements to an existing slice will not be supported in Go
-// Driver 2.0.
-func (c Copier) AppendValueBytes(dst []byte, src ValueReader) (bsontype.Type, []byte, error) {
- if br, ok := src.(BytesReader); ok {
- return br.ReadValueBytes(dst)
- }
-
- vw := vwPool.Get().(*valueWriter)
- defer putValueWriter(vw)
-
- start := len(dst)
-
- vw.reset(dst)
- vw.push(mElement)
-
- err := c.CopyValue(vw, src)
- if err != nil {
- return 0, dst, err
- }
-
- return bsontype.Type(vw.buf[start]), vw.buf[start+2:], nil
-}
-
-// CopyValue will copy a single value from src to dst.
-//
-// Deprecated: Copying BSON values using the ValueWriter and ValueReader interfaces will not be
-// supported in Go Driver 2.0.
-func (c Copier) CopyValue(dst ValueWriter, src ValueReader) error {
- var err error
- switch src.Type() {
- case bsontype.Double:
- var f64 float64
- f64, err = src.ReadDouble()
- if err != nil {
- break
- }
- err = dst.WriteDouble(f64)
- case bsontype.String:
- var str string
- str, err = src.ReadString()
- if err != nil {
- return err
- }
- err = dst.WriteString(str)
- case bsontype.EmbeddedDocument:
- err = c.CopyDocument(dst, src)
- case bsontype.Array:
- err = c.copyArray(dst, src)
- case bsontype.Binary:
- var data []byte
- var subtype byte
- data, subtype, err = src.ReadBinary()
- if err != nil {
- break
- }
- err = dst.WriteBinaryWithSubtype(data, subtype)
- case bsontype.Undefined:
- err = src.ReadUndefined()
- if err != nil {
- break
- }
- err = dst.WriteUndefined()
- case bsontype.ObjectID:
- var oid primitive.ObjectID
- oid, err = src.ReadObjectID()
- if err != nil {
- break
- }
- err = dst.WriteObjectID(oid)
- case bsontype.Boolean:
- var b bool
- b, err = src.ReadBoolean()
- if err != nil {
- break
- }
- err = dst.WriteBoolean(b)
- case bsontype.DateTime:
- var dt int64
- dt, err = src.ReadDateTime()
- if err != nil {
- break
- }
- err = dst.WriteDateTime(dt)
- case bsontype.Null:
- err = src.ReadNull()
- if err != nil {
- break
- }
- err = dst.WriteNull()
- case bsontype.Regex:
- var pattern, options string
- pattern, options, err = src.ReadRegex()
- if err != nil {
- break
- }
- err = dst.WriteRegex(pattern, options)
- case bsontype.DBPointer:
- var ns string
- var pointer primitive.ObjectID
- ns, pointer, err = src.ReadDBPointer()
- if err != nil {
- break
- }
- err = dst.WriteDBPointer(ns, pointer)
- case bsontype.JavaScript:
- var js string
- js, err = src.ReadJavascript()
- if err != nil {
- break
- }
- err = dst.WriteJavascript(js)
- case bsontype.Symbol:
- var symbol string
- symbol, err = src.ReadSymbol()
- if err != nil {
- break
- }
- err = dst.WriteSymbol(symbol)
- case bsontype.CodeWithScope:
- var code string
- var srcScope DocumentReader
- code, srcScope, err = src.ReadCodeWithScope()
- if err != nil {
- break
- }
-
- var dstScope DocumentWriter
- dstScope, err = dst.WriteCodeWithScope(code)
- if err != nil {
- break
- }
- err = c.copyDocumentCore(dstScope, srcScope)
- case bsontype.Int32:
- var i32 int32
- i32, err = src.ReadInt32()
- if err != nil {
- break
- }
- err = dst.WriteInt32(i32)
- case bsontype.Timestamp:
- var t, i uint32
- t, i, err = src.ReadTimestamp()
- if err != nil {
- break
- }
- err = dst.WriteTimestamp(t, i)
- case bsontype.Int64:
- var i64 int64
- i64, err = src.ReadInt64()
- if err != nil {
- break
- }
- err = dst.WriteInt64(i64)
- case bsontype.Decimal128:
- var d128 primitive.Decimal128
- d128, err = src.ReadDecimal128()
- if err != nil {
- break
- }
- err = dst.WriteDecimal128(d128)
- case bsontype.MinKey:
- err = src.ReadMinKey()
- if err != nil {
- break
- }
- err = dst.WriteMinKey()
- case bsontype.MaxKey:
- err = src.ReadMaxKey()
- if err != nil {
- break
- }
- err = dst.WriteMaxKey()
- default:
- err = fmt.Errorf("Cannot copy unknown BSON type %s", src.Type())
- }
-
- return err
-}
-
-func (c Copier) copyArray(dst ValueWriter, src ValueReader) error {
- ar, err := src.ReadArray()
- if err != nil {
- return err
- }
-
- aw, err := dst.WriteArray()
- if err != nil {
- return err
- }
-
- for {
- vr, err := ar.ReadValue()
- if errors.Is(err, ErrEOA) {
- break
- }
- if err != nil {
- return err
- }
-
- vw, err := aw.WriteArrayElement()
- if err != nil {
- return err
- }
-
- err = c.CopyValue(vw, vr)
- if err != nil {
- return err
- }
- }
-
- return aw.WriteArrayEnd()
-}
-
-func (c Copier) copyDocumentCore(dw DocumentWriter, dr DocumentReader) error {
- for {
- key, vr, err := dr.ReadElement()
- if errors.Is(err, ErrEOD) {
- break
- }
- if err != nil {
- return err
- }
-
- vw, err := dw.WriteDocumentElement(key)
- if err != nil {
- return err
- }
-
- err = c.CopyValue(vw, vr)
- if err != nil {
- return err
- }
- }
-
- return dw.WriteDocumentEnd()
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/doc.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/doc.go
deleted file mode 100644
index 750b0d2af..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/doc.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-// Package bsonrw contains abstractions for reading and writing
-// BSON and BSON like types from sources.
-package bsonrw // import "go.mongodb.org/mongo-driver/bson/bsonrw"
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_parser.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_parser.go
deleted file mode 100644
index f0702d9d3..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_parser.go
+++ /dev/null
@@ -1,806 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsonrw
-
-import (
- "encoding/base64"
- "encoding/hex"
- "errors"
- "fmt"
- "io"
- "strings"
-
- "go.mongodb.org/mongo-driver/bson/bsontype"
-)
-
-const maxNestingDepth = 200
-
-// ErrInvalidJSON indicates the JSON input is invalid
-var ErrInvalidJSON = errors.New("invalid JSON input")
-
-type jsonParseState byte
-
-const (
- jpsStartState jsonParseState = iota
- jpsSawBeginObject
- jpsSawEndObject
- jpsSawBeginArray
- jpsSawEndArray
- jpsSawColon
- jpsSawComma
- jpsSawKey
- jpsSawValue
- jpsDoneState
- jpsInvalidState
-)
-
-type jsonParseMode byte
-
-const (
- jpmInvalidMode jsonParseMode = iota
- jpmObjectMode
- jpmArrayMode
-)
-
-type extJSONValue struct {
- t bsontype.Type
- v interface{}
-}
-
-type extJSONObject struct {
- keys []string
- values []*extJSONValue
-}
-
-type extJSONParser struct {
- js *jsonScanner
- s jsonParseState
- m []jsonParseMode
- k string
- v *extJSONValue
-
- err error
- canonical bool
- depth int
- maxDepth int
-
- emptyObject bool
- relaxedUUID bool
-}
-
-// newExtJSONParser returns a new extended JSON parser, ready to to begin
-// parsing from the first character of the argued json input. It will not
-// perform any read-ahead and will therefore not report any errors about
-// malformed JSON at this point.
-func newExtJSONParser(r io.Reader, canonical bool) *extJSONParser {
- return &extJSONParser{
- js: &jsonScanner{r: r},
- s: jpsStartState,
- m: []jsonParseMode{},
- canonical: canonical,
- maxDepth: maxNestingDepth,
- }
-}
-
-// peekType examines the next value and returns its BSON Type
-func (ejp *extJSONParser) peekType() (bsontype.Type, error) {
- var t bsontype.Type
- var err error
- initialState := ejp.s
-
- ejp.advanceState()
- switch ejp.s {
- case jpsSawValue:
- t = ejp.v.t
- case jpsSawBeginArray:
- t = bsontype.Array
- case jpsInvalidState:
- err = ejp.err
- case jpsSawComma:
- // in array mode, seeing a comma means we need to progress again to actually observe a type
- if ejp.peekMode() == jpmArrayMode {
- return ejp.peekType()
- }
- case jpsSawEndArray:
- // this would only be a valid state if we were in array mode, so return end-of-array error
- err = ErrEOA
- case jpsSawBeginObject:
- // peek key to determine type
- ejp.advanceState()
- switch ejp.s {
- case jpsSawEndObject: // empty embedded document
- t = bsontype.EmbeddedDocument
- ejp.emptyObject = true
- case jpsInvalidState:
- err = ejp.err
- case jpsSawKey:
- if initialState == jpsStartState {
- return bsontype.EmbeddedDocument, nil
- }
- t = wrapperKeyBSONType(ejp.k)
-
- // if $uuid is encountered, parse as binary subtype 4
- if ejp.k == "$uuid" {
- ejp.relaxedUUID = true
- t = bsontype.Binary
- }
-
- switch t {
- case bsontype.JavaScript:
- // just saw $code, need to check for $scope at same level
- _, err = ejp.readValue(bsontype.JavaScript)
- if err != nil {
- break
- }
-
- switch ejp.s {
- case jpsSawEndObject: // type is TypeJavaScript
- case jpsSawComma:
- ejp.advanceState()
-
- if ejp.s == jpsSawKey && ejp.k == "$scope" {
- t = bsontype.CodeWithScope
- } else {
- err = fmt.Errorf("invalid extended JSON: unexpected key %s in CodeWithScope object", ejp.k)
- }
- case jpsInvalidState:
- err = ejp.err
- default:
- err = ErrInvalidJSON
- }
- case bsontype.CodeWithScope:
- err = errors.New("invalid extended JSON: code with $scope must contain $code before $scope")
- }
- }
- }
-
- return t, err
-}
-
-// readKey parses the next key and its type and returns them
-func (ejp *extJSONParser) readKey() (string, bsontype.Type, error) {
- if ejp.emptyObject {
- ejp.emptyObject = false
- return "", 0, ErrEOD
- }
-
- // advance to key (or return with error)
- switch ejp.s {
- case jpsStartState:
- ejp.advanceState()
- if ejp.s == jpsSawBeginObject {
- ejp.advanceState()
- }
- case jpsSawBeginObject:
- ejp.advanceState()
- case jpsSawValue, jpsSawEndObject, jpsSawEndArray:
- ejp.advanceState()
- switch ejp.s {
- case jpsSawBeginObject, jpsSawComma:
- ejp.advanceState()
- case jpsSawEndObject:
- return "", 0, ErrEOD
- case jpsDoneState:
- return "", 0, io.EOF
- case jpsInvalidState:
- return "", 0, ejp.err
- default:
- return "", 0, ErrInvalidJSON
- }
- case jpsSawKey: // do nothing (key was peeked before)
- default:
- return "", 0, invalidRequestError("key")
- }
-
- // read key
- var key string
-
- switch ejp.s {
- case jpsSawKey:
- key = ejp.k
- case jpsSawEndObject:
- return "", 0, ErrEOD
- case jpsInvalidState:
- return "", 0, ejp.err
- default:
- return "", 0, invalidRequestError("key")
- }
-
- // check for colon
- ejp.advanceState()
- if err := ensureColon(ejp.s, key); err != nil {
- return "", 0, err
- }
-
- // peek at the value to determine type
- t, err := ejp.peekType()
- if err != nil {
- return "", 0, err
- }
-
- return key, t, nil
-}
-
-// readValue returns the value corresponding to the Type returned by peekType
-func (ejp *extJSONParser) readValue(t bsontype.Type) (*extJSONValue, error) {
- if ejp.s == jpsInvalidState {
- return nil, ejp.err
- }
-
- var v *extJSONValue
-
- switch t {
- case bsontype.Null, bsontype.Boolean, bsontype.String:
- if ejp.s != jpsSawValue {
- return nil, invalidRequestError(t.String())
- }
- v = ejp.v
- case bsontype.Int32, bsontype.Int64, bsontype.Double:
- // relaxed version allows these to be literal number values
- if ejp.s == jpsSawValue {
- v = ejp.v
- break
- }
- fallthrough
- case bsontype.Decimal128, bsontype.Symbol, bsontype.ObjectID, bsontype.MinKey, bsontype.MaxKey, bsontype.Undefined:
- switch ejp.s {
- case jpsSawKey:
- // read colon
- ejp.advanceState()
- if err := ensureColon(ejp.s, ejp.k); err != nil {
- return nil, err
- }
-
- // read value
- ejp.advanceState()
- if ejp.s != jpsSawValue || !ejp.ensureExtValueType(t) {
- return nil, invalidJSONErrorForType("value", t)
- }
-
- v = ejp.v
-
- // read end object
- ejp.advanceState()
- if ejp.s != jpsSawEndObject {
- return nil, invalidJSONErrorForType("} after value", t)
- }
- default:
- return nil, invalidRequestError(t.String())
- }
- case bsontype.Binary, bsontype.Regex, bsontype.Timestamp, bsontype.DBPointer:
- if ejp.s != jpsSawKey {
- return nil, invalidRequestError(t.String())
- }
- // read colon
- ejp.advanceState()
- if err := ensureColon(ejp.s, ejp.k); err != nil {
- return nil, err
- }
-
- ejp.advanceState()
- if t == bsontype.Binary && ejp.s == jpsSawValue {
- // convert relaxed $uuid format
- if ejp.relaxedUUID {
- defer func() { ejp.relaxedUUID = false }()
- uuid, err := ejp.v.parseSymbol()
- if err != nil {
- return nil, err
- }
-
- // RFC 4122 defines the length of a UUID as 36 and the hyphens in a UUID as appearing
- // in the 8th, 13th, 18th, and 23rd characters.
- //
- // See https://tools.ietf.org/html/rfc4122#section-3
- valid := len(uuid) == 36 &&
- string(uuid[8]) == "-" &&
- string(uuid[13]) == "-" &&
- string(uuid[18]) == "-" &&
- string(uuid[23]) == "-"
- if !valid {
- return nil, fmt.Errorf("$uuid value does not follow RFC 4122 format regarding length and hyphens")
- }
-
- // remove hyphens
- uuidNoHyphens := strings.ReplaceAll(uuid, "-", "")
- if len(uuidNoHyphens) != 32 {
- return nil, fmt.Errorf("$uuid value does not follow RFC 4122 format regarding length and hyphens")
- }
-
- // convert hex to bytes
- bytes, err := hex.DecodeString(uuidNoHyphens)
- if err != nil {
- return nil, fmt.Errorf("$uuid value does not follow RFC 4122 format regarding hex bytes: %w", err)
- }
-
- ejp.advanceState()
- if ejp.s != jpsSawEndObject {
- return nil, invalidJSONErrorForType("$uuid and value and then }", bsontype.Binary)
- }
-
- base64 := &extJSONValue{
- t: bsontype.String,
- v: base64.StdEncoding.EncodeToString(bytes),
- }
- subType := &extJSONValue{
- t: bsontype.String,
- v: "04",
- }
-
- v = &extJSONValue{
- t: bsontype.EmbeddedDocument,
- v: &extJSONObject{
- keys: []string{"base64", "subType"},
- values: []*extJSONValue{base64, subType},
- },
- }
-
- break
- }
-
- // convert legacy $binary format
- base64 := ejp.v
-
- ejp.advanceState()
- if ejp.s != jpsSawComma {
- return nil, invalidJSONErrorForType(",", bsontype.Binary)
- }
-
- ejp.advanceState()
- key, t, err := ejp.readKey()
- if err != nil {
- return nil, err
- }
- if key != "$type" {
- return nil, invalidJSONErrorForType("$type", bsontype.Binary)
- }
-
- subType, err := ejp.readValue(t)
- if err != nil {
- return nil, err
- }
-
- ejp.advanceState()
- if ejp.s != jpsSawEndObject {
- return nil, invalidJSONErrorForType("2 key-value pairs and then }", bsontype.Binary)
- }
-
- v = &extJSONValue{
- t: bsontype.EmbeddedDocument,
- v: &extJSONObject{
- keys: []string{"base64", "subType"},
- values: []*extJSONValue{base64, subType},
- },
- }
- break
- }
-
- // read KV pairs
- if ejp.s != jpsSawBeginObject {
- return nil, invalidJSONErrorForType("{", t)
- }
-
- keys, vals, err := ejp.readObject(2, true)
- if err != nil {
- return nil, err
- }
-
- ejp.advanceState()
- if ejp.s != jpsSawEndObject {
- return nil, invalidJSONErrorForType("2 key-value pairs and then }", t)
- }
-
- v = &extJSONValue{t: bsontype.EmbeddedDocument, v: &extJSONObject{keys: keys, values: vals}}
-
- case bsontype.DateTime:
- switch ejp.s {
- case jpsSawValue:
- v = ejp.v
- case jpsSawKey:
- // read colon
- ejp.advanceState()
- if err := ensureColon(ejp.s, ejp.k); err != nil {
- return nil, err
- }
-
- ejp.advanceState()
- switch ejp.s {
- case jpsSawBeginObject:
- keys, vals, err := ejp.readObject(1, true)
- if err != nil {
- return nil, err
- }
- v = &extJSONValue{t: bsontype.EmbeddedDocument, v: &extJSONObject{keys: keys, values: vals}}
- case jpsSawValue:
- if ejp.canonical {
- return nil, invalidJSONError("{")
- }
- v = ejp.v
- default:
- if ejp.canonical {
- return nil, invalidJSONErrorForType("object", t)
- }
- return nil, invalidJSONErrorForType("ISO-8601 Internet Date/Time Format as described in RFC-3339", t)
- }
-
- ejp.advanceState()
- if ejp.s != jpsSawEndObject {
- return nil, invalidJSONErrorForType("value and then }", t)
- }
- default:
- return nil, invalidRequestError(t.String())
- }
- case bsontype.JavaScript:
- switch ejp.s {
- case jpsSawKey:
- // read colon
- ejp.advanceState()
- if err := ensureColon(ejp.s, ejp.k); err != nil {
- return nil, err
- }
-
- // read value
- ejp.advanceState()
- if ejp.s != jpsSawValue {
- return nil, invalidJSONErrorForType("value", t)
- }
- v = ejp.v
-
- // read end object or comma and just return
- ejp.advanceState()
- case jpsSawEndObject:
- v = ejp.v
- default:
- return nil, invalidRequestError(t.String())
- }
- case bsontype.CodeWithScope:
- if ejp.s == jpsSawKey && ejp.k == "$scope" {
- v = ejp.v // this is the $code string from earlier
-
- // read colon
- ejp.advanceState()
- if err := ensureColon(ejp.s, ejp.k); err != nil {
- return nil, err
- }
-
- // read {
- ejp.advanceState()
- if ejp.s != jpsSawBeginObject {
- return nil, invalidJSONError("$scope to be embedded document")
- }
- } else {
- return nil, invalidRequestError(t.String())
- }
- case bsontype.EmbeddedDocument, bsontype.Array:
- return nil, invalidRequestError(t.String())
- }
-
- return v, nil
-}
-
-// readObject is a utility method for reading full objects of known (or expected) size
-// it is useful for extended JSON types such as binary, datetime, regex, and timestamp
-func (ejp *extJSONParser) readObject(numKeys int, started bool) ([]string, []*extJSONValue, error) {
- keys := make([]string, numKeys)
- vals := make([]*extJSONValue, numKeys)
-
- if !started {
- ejp.advanceState()
- if ejp.s != jpsSawBeginObject {
- return nil, nil, invalidJSONError("{")
- }
- }
-
- for i := 0; i < numKeys; i++ {
- key, t, err := ejp.readKey()
- if err != nil {
- return nil, nil, err
- }
-
- switch ejp.s {
- case jpsSawKey:
- v, err := ejp.readValue(t)
- if err != nil {
- return nil, nil, err
- }
-
- keys[i] = key
- vals[i] = v
- case jpsSawValue:
- keys[i] = key
- vals[i] = ejp.v
- default:
- return nil, nil, invalidJSONError("value")
- }
- }
-
- ejp.advanceState()
- if ejp.s != jpsSawEndObject {
- return nil, nil, invalidJSONError("}")
- }
-
- return keys, vals, nil
-}
-
-// advanceState reads the next JSON token from the scanner and transitions
-// from the current state based on that token's type
-func (ejp *extJSONParser) advanceState() {
- if ejp.s == jpsDoneState || ejp.s == jpsInvalidState {
- return
- }
-
- jt, err := ejp.js.nextToken()
-
- if err != nil {
- ejp.err = err
- ejp.s = jpsInvalidState
- return
- }
-
- valid := ejp.validateToken(jt.t)
- if !valid {
- ejp.err = unexpectedTokenError(jt)
- ejp.s = jpsInvalidState
- return
- }
-
- switch jt.t {
- case jttBeginObject:
- ejp.s = jpsSawBeginObject
- ejp.pushMode(jpmObjectMode)
- ejp.depth++
-
- if ejp.depth > ejp.maxDepth {
- ejp.err = nestingDepthError(jt.p, ejp.depth)
- ejp.s = jpsInvalidState
- }
- case jttEndObject:
- ejp.s = jpsSawEndObject
- ejp.depth--
-
- if ejp.popMode() != jpmObjectMode {
- ejp.err = unexpectedTokenError(jt)
- ejp.s = jpsInvalidState
- }
- case jttBeginArray:
- ejp.s = jpsSawBeginArray
- ejp.pushMode(jpmArrayMode)
- case jttEndArray:
- ejp.s = jpsSawEndArray
-
- if ejp.popMode() != jpmArrayMode {
- ejp.err = unexpectedTokenError(jt)
- ejp.s = jpsInvalidState
- }
- case jttColon:
- ejp.s = jpsSawColon
- case jttComma:
- ejp.s = jpsSawComma
- case jttEOF:
- ejp.s = jpsDoneState
- if len(ejp.m) != 0 {
- ejp.err = unexpectedTokenError(jt)
- ejp.s = jpsInvalidState
- }
- case jttString:
- switch ejp.s {
- case jpsSawComma:
- if ejp.peekMode() == jpmArrayMode {
- ejp.s = jpsSawValue
- ejp.v = extendJSONToken(jt)
- return
- }
- fallthrough
- case jpsSawBeginObject:
- ejp.s = jpsSawKey
- ejp.k = jt.v.(string)
- return
- }
- fallthrough
- default:
- ejp.s = jpsSawValue
- ejp.v = extendJSONToken(jt)
- }
-}
-
-var jpsValidTransitionTokens = map[jsonParseState]map[jsonTokenType]bool{
- jpsStartState: {
- jttBeginObject: true,
- jttBeginArray: true,
- jttInt32: true,
- jttInt64: true,
- jttDouble: true,
- jttString: true,
- jttBool: true,
- jttNull: true,
- jttEOF: true,
- },
- jpsSawBeginObject: {
- jttEndObject: true,
- jttString: true,
- },
- jpsSawEndObject: {
- jttEndObject: true,
- jttEndArray: true,
- jttComma: true,
- jttEOF: true,
- },
- jpsSawBeginArray: {
- jttBeginObject: true,
- jttBeginArray: true,
- jttEndArray: true,
- jttInt32: true,
- jttInt64: true,
- jttDouble: true,
- jttString: true,
- jttBool: true,
- jttNull: true,
- },
- jpsSawEndArray: {
- jttEndObject: true,
- jttEndArray: true,
- jttComma: true,
- jttEOF: true,
- },
- jpsSawColon: {
- jttBeginObject: true,
- jttBeginArray: true,
- jttInt32: true,
- jttInt64: true,
- jttDouble: true,
- jttString: true,
- jttBool: true,
- jttNull: true,
- },
- jpsSawComma: {
- jttBeginObject: true,
- jttBeginArray: true,
- jttInt32: true,
- jttInt64: true,
- jttDouble: true,
- jttString: true,
- jttBool: true,
- jttNull: true,
- },
- jpsSawKey: {
- jttColon: true,
- },
- jpsSawValue: {
- jttEndObject: true,
- jttEndArray: true,
- jttComma: true,
- jttEOF: true,
- },
- jpsDoneState: {},
- jpsInvalidState: {},
-}
-
-func (ejp *extJSONParser) validateToken(jtt jsonTokenType) bool {
- switch ejp.s {
- case jpsSawEndObject:
- // if we are at depth zero and the next token is a '{',
- // we can consider it valid only if we are not in array mode.
- if jtt == jttBeginObject && ejp.depth == 0 {
- return ejp.peekMode() != jpmArrayMode
- }
- case jpsSawComma:
- switch ejp.peekMode() {
- // the only valid next token after a comma inside a document is a string (a key)
- case jpmObjectMode:
- return jtt == jttString
- case jpmInvalidMode:
- return false
- }
- }
-
- _, ok := jpsValidTransitionTokens[ejp.s][jtt]
- return ok
-}
-
-// ensureExtValueType returns true if the current value has the expected
-// value type for single-key extended JSON types. For example,
-// {"$numberInt": v} v must be TypeString
-func (ejp *extJSONParser) ensureExtValueType(t bsontype.Type) bool {
- switch t {
- case bsontype.MinKey, bsontype.MaxKey:
- return ejp.v.t == bsontype.Int32
- case bsontype.Undefined:
- return ejp.v.t == bsontype.Boolean
- case bsontype.Int32, bsontype.Int64, bsontype.Double, bsontype.Decimal128, bsontype.Symbol, bsontype.ObjectID:
- return ejp.v.t == bsontype.String
- default:
- return false
- }
-}
-
-func (ejp *extJSONParser) pushMode(m jsonParseMode) {
- ejp.m = append(ejp.m, m)
-}
-
-func (ejp *extJSONParser) popMode() jsonParseMode {
- l := len(ejp.m)
- if l == 0 {
- return jpmInvalidMode
- }
-
- m := ejp.m[l-1]
- ejp.m = ejp.m[:l-1]
-
- return m
-}
-
-func (ejp *extJSONParser) peekMode() jsonParseMode {
- l := len(ejp.m)
- if l == 0 {
- return jpmInvalidMode
- }
-
- return ejp.m[l-1]
-}
-
-func extendJSONToken(jt *jsonToken) *extJSONValue {
- var t bsontype.Type
-
- switch jt.t {
- case jttInt32:
- t = bsontype.Int32
- case jttInt64:
- t = bsontype.Int64
- case jttDouble:
- t = bsontype.Double
- case jttString:
- t = bsontype.String
- case jttBool:
- t = bsontype.Boolean
- case jttNull:
- t = bsontype.Null
- default:
- return nil
- }
-
- return &extJSONValue{t: t, v: jt.v}
-}
-
-func ensureColon(s jsonParseState, key string) error {
- if s != jpsSawColon {
- return fmt.Errorf("invalid JSON input: missing colon after key \"%s\"", key)
- }
-
- return nil
-}
-
-func invalidRequestError(s string) error {
- return fmt.Errorf("invalid request to read %s", s)
-}
-
-func invalidJSONError(expected string) error {
- return fmt.Errorf("invalid JSON input; expected %s", expected)
-}
-
-func invalidJSONErrorForType(expected string, t bsontype.Type) error {
- return fmt.Errorf("invalid JSON input; expected %s for %s", expected, t)
-}
-
-func unexpectedTokenError(jt *jsonToken) error {
- switch jt.t {
- case jttInt32, jttInt64, jttDouble:
- return fmt.Errorf("invalid JSON input; unexpected number (%v) at position %d", jt.v, jt.p)
- case jttString:
- return fmt.Errorf("invalid JSON input; unexpected string (\"%v\") at position %d", jt.v, jt.p)
- case jttBool:
- return fmt.Errorf("invalid JSON input; unexpected boolean literal (%v) at position %d", jt.v, jt.p)
- case jttNull:
- return fmt.Errorf("invalid JSON input; unexpected null literal at position %d", jt.p)
- case jttEOF:
- return fmt.Errorf("invalid JSON input; unexpected end of input at position %d", jt.p)
- default:
- return fmt.Errorf("invalid JSON input; unexpected %c at position %d", jt.v.(byte), jt.p)
- }
-}
-
-func nestingDepthError(p, depth int) error {
- return fmt.Errorf("invalid JSON input; nesting too deep (%d levels) at position %d", depth, p)
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_reader.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_reader.go
deleted file mode 100644
index 59ddfc448..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_reader.go
+++ /dev/null
@@ -1,653 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package bsonrw
-
-import (
- "errors"
- "fmt"
- "io"
- "sync"
-
- "go.mongodb.org/mongo-driver/bson/bsontype"
- "go.mongodb.org/mongo-driver/bson/primitive"
-)
-
-// ExtJSONValueReaderPool is a pool for ValueReaders that read ExtJSON.
-//
-// Deprecated: ExtJSONValueReaderPool will not be supported in Go Driver 2.0.
-type ExtJSONValueReaderPool struct {
- pool sync.Pool
-}
-
-// NewExtJSONValueReaderPool instantiates a new ExtJSONValueReaderPool.
-//
-// Deprecated: ExtJSONValueReaderPool will not be supported in Go Driver 2.0.
-func NewExtJSONValueReaderPool() *ExtJSONValueReaderPool {
- return &ExtJSONValueReaderPool{
- pool: sync.Pool{
- New: func() interface{} {
- return new(extJSONValueReader)
- },
- },
- }
-}
-
-// Get retrieves a ValueReader from the pool and uses src as the underlying ExtJSON.
-//
-// Deprecated: ExtJSONValueReaderPool will not be supported in Go Driver 2.0.
-func (bvrp *ExtJSONValueReaderPool) Get(r io.Reader, canonical bool) (ValueReader, error) {
- vr := bvrp.pool.Get().(*extJSONValueReader)
- return vr.reset(r, canonical)
-}
-
-// Put inserts a ValueReader into the pool. If the ValueReader is not a ExtJSON ValueReader nothing
-// is inserted into the pool and ok will be false.
-//
-// Deprecated: ExtJSONValueReaderPool will not be supported in Go Driver 2.0.
-func (bvrp *ExtJSONValueReaderPool) Put(vr ValueReader) (ok bool) {
- bvr, ok := vr.(*extJSONValueReader)
- if !ok {
- return false
- }
-
- bvr, _ = bvr.reset(nil, false)
- bvrp.pool.Put(bvr)
- return true
-}
-
-type ejvrState struct {
- mode mode
- vType bsontype.Type
- depth int
-}
-
-// extJSONValueReader is for reading extended JSON.
-type extJSONValueReader struct {
- p *extJSONParser
-
- stack []ejvrState
- frame int
-}
-
-// NewExtJSONValueReader creates a new ValueReader from a given io.Reader
-// It will interpret the JSON of r as canonical or relaxed according to the
-// given canonical flag
-func NewExtJSONValueReader(r io.Reader, canonical bool) (ValueReader, error) {
- return newExtJSONValueReader(r, canonical)
-}
-
-func newExtJSONValueReader(r io.Reader, canonical bool) (*extJSONValueReader, error) {
- ejvr := new(extJSONValueReader)
- return ejvr.reset(r, canonical)
-}
-
-func (ejvr *extJSONValueReader) reset(r io.Reader, canonical bool) (*extJSONValueReader, error) {
- p := newExtJSONParser(r, canonical)
- typ, err := p.peekType()
-
- if err != nil {
- return nil, ErrInvalidJSON
- }
-
- var m mode
- switch typ {
- case bsontype.EmbeddedDocument:
- m = mTopLevel
- case bsontype.Array:
- m = mArray
- default:
- m = mValue
- }
-
- stack := make([]ejvrState, 1, 5)
- stack[0] = ejvrState{
- mode: m,
- vType: typ,
- }
- return &extJSONValueReader{
- p: p,
- stack: stack,
- }, nil
-}
-
-func (ejvr *extJSONValueReader) advanceFrame() {
- if ejvr.frame+1 >= len(ejvr.stack) { // We need to grow the stack
- length := len(ejvr.stack)
- if length+1 >= cap(ejvr.stack) {
- // double it
- buf := make([]ejvrState, 2*cap(ejvr.stack)+1)
- copy(buf, ejvr.stack)
- ejvr.stack = buf
- }
- ejvr.stack = ejvr.stack[:length+1]
- }
- ejvr.frame++
-
- // Clean the stack
- ejvr.stack[ejvr.frame].mode = 0
- ejvr.stack[ejvr.frame].vType = 0
- ejvr.stack[ejvr.frame].depth = 0
-}
-
-func (ejvr *extJSONValueReader) pushDocument() {
- ejvr.advanceFrame()
-
- ejvr.stack[ejvr.frame].mode = mDocument
- ejvr.stack[ejvr.frame].depth = ejvr.p.depth
-}
-
-func (ejvr *extJSONValueReader) pushCodeWithScope() {
- ejvr.advanceFrame()
-
- ejvr.stack[ejvr.frame].mode = mCodeWithScope
-}
-
-func (ejvr *extJSONValueReader) pushArray() {
- ejvr.advanceFrame()
-
- ejvr.stack[ejvr.frame].mode = mArray
-}
-
-func (ejvr *extJSONValueReader) push(m mode, t bsontype.Type) {
- ejvr.advanceFrame()
-
- ejvr.stack[ejvr.frame].mode = m
- ejvr.stack[ejvr.frame].vType = t
-}
-
-func (ejvr *extJSONValueReader) pop() {
- switch ejvr.stack[ejvr.frame].mode {
- case mElement, mValue:
- ejvr.frame--
- case mDocument, mArray, mCodeWithScope:
- ejvr.frame -= 2 // we pop twice to jump over the vrElement: vrDocument -> vrElement -> vrDocument/TopLevel/etc...
- }
-}
-
-func (ejvr *extJSONValueReader) skipObject() {
- // read entire object until depth returns to 0 (last ending } or ] seen)
- depth := 1
- for depth > 0 {
- ejvr.p.advanceState()
-
- // If object is empty, raise depth and continue. When emptyObject is true, the
- // parser has already read both the opening and closing brackets of an empty
- // object ("{}"), so the next valid token will be part of the parent document,
- // not part of the nested document.
- //
- // If there is a comma, there are remaining fields, emptyObject must be set back
- // to false, and comma must be skipped with advanceState().
- if ejvr.p.emptyObject {
- if ejvr.p.s == jpsSawComma {
- ejvr.p.emptyObject = false
- ejvr.p.advanceState()
- }
- depth--
- continue
- }
-
- switch ejvr.p.s {
- case jpsSawBeginObject, jpsSawBeginArray:
- depth++
- case jpsSawEndObject, jpsSawEndArray:
- depth--
- }
- }
-}
-
-func (ejvr *extJSONValueReader) invalidTransitionErr(destination mode, name string, modes []mode) error {
- te := TransitionError{
- name: name,
- current: ejvr.stack[ejvr.frame].mode,
- destination: destination,
- modes: modes,
- action: "read",
- }
- if ejvr.frame != 0 {
- te.parent = ejvr.stack[ejvr.frame-1].mode
- }
- return te
-}
-
-func (ejvr *extJSONValueReader) typeError(t bsontype.Type) error {
- return fmt.Errorf("positioned on %s, but attempted to read %s", ejvr.stack[ejvr.frame].vType, t)
-}
-
-func (ejvr *extJSONValueReader) ensureElementValue(t bsontype.Type, destination mode, callerName string, addModes ...mode) error {
- switch ejvr.stack[ejvr.frame].mode {
- case mElement, mValue:
- if ejvr.stack[ejvr.frame].vType != t {
- return ejvr.typeError(t)
- }
- default:
- modes := []mode{mElement, mValue}
- if addModes != nil {
- modes = append(modes, addModes...)
- }
- return ejvr.invalidTransitionErr(destination, callerName, modes)
- }
-
- return nil
-}
-
-func (ejvr *extJSONValueReader) Type() bsontype.Type {
- return ejvr.stack[ejvr.frame].vType
-}
-
-func (ejvr *extJSONValueReader) Skip() error {
- switch ejvr.stack[ejvr.frame].mode {
- case mElement, mValue:
- default:
- return ejvr.invalidTransitionErr(0, "Skip", []mode{mElement, mValue})
- }
-
- defer ejvr.pop()
-
- t := ejvr.stack[ejvr.frame].vType
- switch t {
- case bsontype.Array, bsontype.EmbeddedDocument, bsontype.CodeWithScope:
- // read entire array, doc or CodeWithScope
- ejvr.skipObject()
- default:
- _, err := ejvr.p.readValue(t)
- if err != nil {
- return err
- }
- }
-
- return nil
-}
-
-func (ejvr *extJSONValueReader) ReadArray() (ArrayReader, error) {
- switch ejvr.stack[ejvr.frame].mode {
- case mTopLevel: // allow reading array from top level
- case mArray:
- return ejvr, nil
- default:
- if err := ejvr.ensureElementValue(bsontype.Array, mArray, "ReadArray", mTopLevel, mArray); err != nil {
- return nil, err
- }
- }
-
- ejvr.pushArray()
-
- return ejvr, nil
-}
-
-func (ejvr *extJSONValueReader) ReadBinary() (b []byte, btype byte, err error) {
- if err := ejvr.ensureElementValue(bsontype.Binary, 0, "ReadBinary"); err != nil {
- return nil, 0, err
- }
-
- v, err := ejvr.p.readValue(bsontype.Binary)
- if err != nil {
- return nil, 0, err
- }
-
- b, btype, err = v.parseBinary()
-
- ejvr.pop()
- return b, btype, err
-}
-
-func (ejvr *extJSONValueReader) ReadBoolean() (bool, error) {
- if err := ejvr.ensureElementValue(bsontype.Boolean, 0, "ReadBoolean"); err != nil {
- return false, err
- }
-
- v, err := ejvr.p.readValue(bsontype.Boolean)
- if err != nil {
- return false, err
- }
-
- if v.t != bsontype.Boolean {
- return false, fmt.Errorf("expected type bool, but got type %s", v.t)
- }
-
- ejvr.pop()
- return v.v.(bool), nil
-}
-
-func (ejvr *extJSONValueReader) ReadDocument() (DocumentReader, error) {
- switch ejvr.stack[ejvr.frame].mode {
- case mTopLevel:
- return ejvr, nil
- case mElement, mValue:
- if ejvr.stack[ejvr.frame].vType != bsontype.EmbeddedDocument {
- return nil, ejvr.typeError(bsontype.EmbeddedDocument)
- }
-
- ejvr.pushDocument()
- return ejvr, nil
- default:
- return nil, ejvr.invalidTransitionErr(mDocument, "ReadDocument", []mode{mTopLevel, mElement, mValue})
- }
-}
-
-func (ejvr *extJSONValueReader) ReadCodeWithScope() (code string, dr DocumentReader, err error) {
- if err = ejvr.ensureElementValue(bsontype.CodeWithScope, 0, "ReadCodeWithScope"); err != nil {
- return "", nil, err
- }
-
- v, err := ejvr.p.readValue(bsontype.CodeWithScope)
- if err != nil {
- return "", nil, err
- }
-
- code, err = v.parseJavascript()
-
- ejvr.pushCodeWithScope()
- return code, ejvr, err
-}
-
-func (ejvr *extJSONValueReader) ReadDBPointer() (ns string, oid primitive.ObjectID, err error) {
- if err = ejvr.ensureElementValue(bsontype.DBPointer, 0, "ReadDBPointer"); err != nil {
- return "", primitive.NilObjectID, err
- }
-
- v, err := ejvr.p.readValue(bsontype.DBPointer)
- if err != nil {
- return "", primitive.NilObjectID, err
- }
-
- ns, oid, err = v.parseDBPointer()
-
- ejvr.pop()
- return ns, oid, err
-}
-
-func (ejvr *extJSONValueReader) ReadDateTime() (int64, error) {
- if err := ejvr.ensureElementValue(bsontype.DateTime, 0, "ReadDateTime"); err != nil {
- return 0, err
- }
-
- v, err := ejvr.p.readValue(bsontype.DateTime)
- if err != nil {
- return 0, err
- }
-
- d, err := v.parseDateTime()
-
- ejvr.pop()
- return d, err
-}
-
-func (ejvr *extJSONValueReader) ReadDecimal128() (primitive.Decimal128, error) {
- if err := ejvr.ensureElementValue(bsontype.Decimal128, 0, "ReadDecimal128"); err != nil {
- return primitive.Decimal128{}, err
- }
-
- v, err := ejvr.p.readValue(bsontype.Decimal128)
- if err != nil {
- return primitive.Decimal128{}, err
- }
-
- d, err := v.parseDecimal128()
-
- ejvr.pop()
- return d, err
-}
-
-func (ejvr *extJSONValueReader) ReadDouble() (float64, error) {
- if err := ejvr.ensureElementValue(bsontype.Double, 0, "ReadDouble"); err != nil {
- return 0, err
- }
-
- v, err := ejvr.p.readValue(bsontype.Double)
- if err != nil {
- return 0, err
- }
-
- d, err := v.parseDouble()
-
- ejvr.pop()
- return d, err
-}
-
-func (ejvr *extJSONValueReader) ReadInt32() (int32, error) {
- if err := ejvr.ensureElementValue(bsontype.Int32, 0, "ReadInt32"); err != nil {
- return 0, err
- }
-
- v, err := ejvr.p.readValue(bsontype.Int32)
- if err != nil {
- return 0, err
- }
-
- i, err := v.parseInt32()
-
- ejvr.pop()
- return i, err
-}
-
-func (ejvr *extJSONValueReader) ReadInt64() (int64, error) {
- if err := ejvr.ensureElementValue(bsontype.Int64, 0, "ReadInt64"); err != nil {
- return 0, err
- }
-
- v, err := ejvr.p.readValue(bsontype.Int64)
- if err != nil {
- return 0, err
- }
-
- i, err := v.parseInt64()
-
- ejvr.pop()
- return i, err
-}
-
-func (ejvr *extJSONValueReader) ReadJavascript() (code string, err error) {
- if err = ejvr.ensureElementValue(bsontype.JavaScript, 0, "ReadJavascript"); err != nil {
- return "", err
- }
-
- v, err := ejvr.p.readValue(bsontype.JavaScript)
- if err != nil {
- return "", err
- }
-
- code, err = v.parseJavascript()
-
- ejvr.pop()
- return code, err
-}
-
-func (ejvr *extJSONValueReader) ReadMaxKey() error {
- if err := ejvr.ensureElementValue(bsontype.MaxKey, 0, "ReadMaxKey"); err != nil {
- return err
- }
-
- v, err := ejvr.p.readValue(bsontype.MaxKey)
- if err != nil {
- return err
- }
-
- err = v.parseMinMaxKey("max")
-
- ejvr.pop()
- return err
-}
-
-func (ejvr *extJSONValueReader) ReadMinKey() error {
- if err := ejvr.ensureElementValue(bsontype.MinKey, 0, "ReadMinKey"); err != nil {
- return err
- }
-
- v, err := ejvr.p.readValue(bsontype.MinKey)
- if err != nil {
- return err
- }
-
- err = v.parseMinMaxKey("min")
-
- ejvr.pop()
- return err
-}
-
-func (ejvr *extJSONValueReader) ReadNull() error {
- if err := ejvr.ensureElementValue(bsontype.Null, 0, "ReadNull"); err != nil {
- return err
- }
-
- v, err := ejvr.p.readValue(bsontype.Null)
- if err != nil {
- return err
- }
-
- if v.t != bsontype.Null {
- return fmt.Errorf("expected type null but got type %s", v.t)
- }
-
- ejvr.pop()
- return nil
-}
-
-func (ejvr *extJSONValueReader) ReadObjectID() (primitive.ObjectID, error) {
- if err := ejvr.ensureElementValue(bsontype.ObjectID, 0, "ReadObjectID"); err != nil {
- return primitive.ObjectID{}, err
- }
-
- v, err := ejvr.p.readValue(bsontype.ObjectID)
- if err != nil {
- return primitive.ObjectID{}, err
- }
-
- oid, err := v.parseObjectID()
-
- ejvr.pop()
- return oid, err
-}
-
-func (ejvr *extJSONValueReader) ReadRegex() (pattern string, options string, err error) {
- if err = ejvr.ensureElementValue(bsontype.Regex, 0, "ReadRegex"); err != nil {
- return "", "", err
- }
-
- v, err := ejvr.p.readValue(bsontype.Regex)
- if err != nil {
- return "", "", err
- }
-
- pattern, options, err = v.parseRegex()
-
- ejvr.pop()
- return pattern, options, err
-}
-
-func (ejvr *extJSONValueReader) ReadString() (string, error) {
- if err := ejvr.ensureElementValue(bsontype.String, 0, "ReadString"); err != nil {
- return "", err
- }
-
- v, err := ejvr.p.readValue(bsontype.String)
- if err != nil {
- return "", err
- }
-
- if v.t != bsontype.String {
- return "", fmt.Errorf("expected type string but got type %s", v.t)
- }
-
- ejvr.pop()
- return v.v.(string), nil
-}
-
-func (ejvr *extJSONValueReader) ReadSymbol() (symbol string, err error) {
- if err = ejvr.ensureElementValue(bsontype.Symbol, 0, "ReadSymbol"); err != nil {
- return "", err
- }
-
- v, err := ejvr.p.readValue(bsontype.Symbol)
- if err != nil {
- return "", err
- }
-
- symbol, err = v.parseSymbol()
-
- ejvr.pop()
- return symbol, err
-}
-
-func (ejvr *extJSONValueReader) ReadTimestamp() (t uint32, i uint32, err error) {
- if err = ejvr.ensureElementValue(bsontype.Timestamp, 0, "ReadTimestamp"); err != nil {
- return 0, 0, err
- }
-
- v, err := ejvr.p.readValue(bsontype.Timestamp)
- if err != nil {
- return 0, 0, err
- }
-
- t, i, err = v.parseTimestamp()
-
- ejvr.pop()
- return t, i, err
-}
-
-func (ejvr *extJSONValueReader) ReadUndefined() error {
- if err := ejvr.ensureElementValue(bsontype.Undefined, 0, "ReadUndefined"); err != nil {
- return err
- }
-
- v, err := ejvr.p.readValue(bsontype.Undefined)
- if err != nil {
- return err
- }
-
- err = v.parseUndefined()
-
- ejvr.pop()
- return err
-}
-
-func (ejvr *extJSONValueReader) ReadElement() (string, ValueReader, error) {
- switch ejvr.stack[ejvr.frame].mode {
- case mTopLevel, mDocument, mCodeWithScope:
- default:
- return "", nil, ejvr.invalidTransitionErr(mElement, "ReadElement", []mode{mTopLevel, mDocument, mCodeWithScope})
- }
-
- name, t, err := ejvr.p.readKey()
-
- if err != nil {
- if errors.Is(err, ErrEOD) {
- if ejvr.stack[ejvr.frame].mode == mCodeWithScope {
- _, err := ejvr.p.peekType()
- if err != nil {
- return "", nil, err
- }
- }
-
- ejvr.pop()
- }
-
- return "", nil, err
- }
-
- ejvr.push(mElement, t)
- return name, ejvr, nil
-}
-
-func (ejvr *extJSONValueReader) ReadValue() (ValueReader, error) {
- switch ejvr.stack[ejvr.frame].mode {
- case mArray:
- default:
- return nil, ejvr.invalidTransitionErr(mValue, "ReadValue", []mode{mArray})
- }
-
- t, err := ejvr.p.peekType()
- if err != nil {
- if errors.Is(err, ErrEOA) {
- ejvr.pop()
- }
-
- return nil, err
- }
-
- ejvr.push(mValue, t)
- return ejvr, nil
-}
diff --git a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_tables.go b/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_tables.go
deleted file mode 100644
index ba39c9601..000000000
--- a/openshift/default-catalog-consistency/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_tables.go
+++ /dev/null
@@ -1,223 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2017-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-//
-// Based on github.com/golang/go by The Go Authors
-// See THIRD-PARTY-NOTICES for original license terms.
-
-package bsonrw
-
-import "unicode/utf8"
-
-// safeSet holds the value true if the ASCII character with the given array
-// position can be represented inside a JSON string without any further
-// escaping.
-//
-// All values are true except for the ASCII control characters (0-31), the
-// double quote ("), and the backslash character ("\").
-var safeSet = [utf8.RuneSelf]bool{
- ' ': true,
- '!': true,
- '"': false,
- '#': true,
- '$': true,
- '%': true,
- '&': true,
- '\'': true,
- '(': true,
- ')': true,
- '*': true,
- '+': true,
- ',': true,
- '-': true,
- '.': true,
- '/': true,
- '0': true,
- '1': true,
- '2': true,
- '3': true,
- '4': true,
- '5': true,
- '6': true,
- '7': true,
- '8': true,
- '9': true,
- ':': true,
- ';': true,
- '<': true,
- '=': true,
- '>': true,
- '?': true,
- '@': true,
- 'A': true,
- 'B': true,
- 'C': true,
- 'D': true,
- 'E': true,
- 'F': true,
- 'G': true,
- 'H': true,
- 'I': true,
- 'J': true,
- 'K': true,
- 'L': true,
- 'M': true,
- 'N': true,
- 'O': true,
- 'P': true,
- 'Q': true,
- 'R': true,
- 'S': true,
- 'T': true,
- 'U': true,
- 'V': true,
- 'W': true,
- 'X': true,
- 'Y': true,
- 'Z': true,
- '[': true,
- '\\': false,
- ']': true,
- '^': true,
- '_': true,
- '`': true,
- 'a': true,
- 'b': true,
- 'c': true,
- 'd': true,
- 'e': true,
- 'f': true,
- 'g': true,
- 'h': true,
- 'i': true,
- 'j': true,
- 'k': true,
- 'l': true,
- 'm': true,
- 'n': true,
- 'o': true,
- 'p': true,
- 'q': true,
- 'r': true,
- 's': true,
- 't': true,
- 'u': true,
- 'v': true,
- 'w': true,
- 'x': true,
- 'y': true,
- 'z': true,
- '{': true,
- '|': true,
- '}': true,
- '~': true,
- '\u007f': true,
-}
-
-// htmlSafeSet holds the value true if the ASCII character with the given
-// array position can be safely represented inside a JSON string, embedded
-// inside of HTML