Commit Graph

2830 Commits

Author SHA1 Message Date
wang yan
16f3b23200 update go version
Signed-off-by: wang yan <wangyan@vmware.com>
2025-02-24 13:06:38 +08:00
wang yan
8b0374720a fix
Signed-off-by: wang yan <wangyan@vmware.com>
2025-02-21 19:57:14 +08:00
wang yan
5ad8c4a2f2 fix
Signed-off-by: wang yan <wangyan@vmware.com>
2025-02-21 19:21:33 +08:00
wang yan
3cc698155c fix
Signed-off-by: wang yan <wangyan@vmware.com>
2025-02-21 19:14:13 +08:00
wang yan
1f16a59410 fix
Signed-off-by: wang yan <wangyan@vmware.com>
2025-02-21 18:56:22 +08:00
wang yan
b72cb66843 fix
Signed-off-by: wang yan <wangyan@vmware.com>
2025-02-21 18:31:31 +08:00
wang yan
ca2ef13af9 fix python
Signed-off-by: wang yan <wangyan@vmware.com>
2025-02-21 18:25:43 +08:00
wang yan
2c31eff9ee fix ci
Signed-off-by: wang yan <wangyan@vmware.com>
2025-02-21 18:20:37 +08:00
wang yan
0a63a062e6 fix
Signed-off-by: wang yan <wangyan@vmware.com>
2025-02-21 18:14:56 +08:00
wang yan
db821d2a0f fix ci
Signed-off-by: wang yan <wangyan@vmware.com>
2025-02-21 18:08:53 +08:00
wang yan
c747ef149b add redis sentinel patch
Signed-off-by: wang yan <wangyan@vmware.com>
2025-02-21 17:54:40 +08:00
Milos Gajdos
5d5c60f77c
[release/2.8 backport] deprecate ReadSeekCloser in favor of io.ReadSeekCloser (#4244) 2024-01-11 14:12:03 +07:00
Sebastiaan van Stijn
bb33a43c74
registry/client: use struct literals
Remove some intermediate variables, and use struct literals instead.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 1d8cd5e443)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-06 12:02:12 +01:00
Sebastiaan van Stijn
1be402c953
transport.NewHTTPReadSeeker: return concrete type, deprecate ReadSeekCloser
General convention is to define interfaces on the receiver side, and
to return concrete types.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit d71ad5b3a6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-06 12:02:12 +01:00
Sebastiaan van Stijn
e22b555089
deprecate ReadSeekCloser in favor of io.ReadSeekCloser
Go's io package in stdlib now defines this interface, so we can switch
to using that instead.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 019ead86f5)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-06 12:02:11 +01:00
Sebastiaan van Stijn
86c2280e10
simplify mocks
Embed the interface that we're mocking; calling any of it's methods
that are not implemented will panic, so should give the same result
as before.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 2cd52d5c0c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-01-06 12:02:06 +01:00
Milos Gajdos
f0d4c1a67d
[release/2.8 backport] update to go1.20.10 (#4117) 2023-10-19 11:31:17 +01:00
Milos Gajdos
3c82e8a200
[release/2.8] vendor: golang.org/x/net v0.17.0 (#4118) 2023-10-19 11:30:58 +01:00
Sebastiaan van Stijn
80cc199be4
[release/2.8] vendor: golang.org/x/net v0.17.0
full diff: 4876518f9e...b225e7ca6d

This fixes the same CVE as go1.21.3 and go1.20.10;

- net/http: rapid stream resets can cause excessive work

  A malicious HTTP/2 client which rapidly creates requests and
  immediately resets them can cause excessive server resource consumption.
  While the total number of requests is bounded to the
  http2.Server.MaxConcurrentStreams setting, resetting an in-progress
  request allows the attacker to create a new request while the existing
  one is still executing.

  HTTP/2 servers now bound the number of simultaneously executing
  handler goroutines to the stream concurrency limit. New requests
  arriving when at the limit (which can only happen after the client
  has reset an existing, in-flight request) will be queued until a
  handler exits. If the request queue grows too large, the server
  will terminate the connection.

  This issue is also fixed in golang.org/x/net/http2 v0.17.0,
  for users manually configuring HTTP/2.

  The default stream concurrency limit is 250 streams (requests)
  per HTTP/2 connection. This value may be adjusted using the
  golang.org/x/net/http2 package; see the Server.MaxConcurrentStreams
  setting and the ConfigureServer function.

  This is CVE-2023-39325 and Go issue https://go.dev/issue/63417.
  This is also tracked by CVE-2023-44487.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-10-19 11:52:17 +02:00
Sebastiaan van Stijn
27cd21bb08
update to go1.20.10, test go1.21.3
go1.20.10 (released 2023-10-10) includes a security fix to the net/http package.
See the Go 1.20.10 milestone on our issue tracker for details:

https://github.com/golang/go/issues?q=milestone%3AGo1.20.10+label%3ACherryPickApproved

full diff: https://github.com/golang/go/compare/go1.20.9...go1.20.10

From the security mailing:

[security] Go 1.21.3 and Go 1.20.10 are released

Hello gophers,

We have just released Go versions 1.21.3 and 1.20.10, minor point releases.

These minor releases include 1 security fixes following the security policy:

- net/http: rapid stream resets can cause excessive work

  A malicious HTTP/2 client which rapidly creates requests and
  immediately resets them can cause excessive server resource consumption.
  While the total number of requests is bounded to the
  http2.Server.MaxConcurrentStreams setting, resetting an in-progress
  request allows the attacker to create a new request while the existing
  one is still executing.

  HTTP/2 servers now bound the number of simultaneously executing
  handler goroutines to the stream concurrency limit. New requests
  arriving when at the limit (which can only happen after the client
  has reset an existing, in-flight request) will be queued until a
  handler exits. If the request queue grows too large, the server
  will terminate the connection.

  This issue is also fixed in golang.org/x/net/http2 v0.17.0,
  for users manually configuring HTTP/2.

  The default stream concurrency limit is 250 streams (requests)
  per HTTP/2 connection. This value may be adjusted using the
  golang.org/x/net/http2 package; see the Server.MaxConcurrentStreams
  setting and the ConfigureServer function.

  This is CVE-2023-39325 and Go issue https://go.dev/issue/63417.
  This is also tracked by CVE-2023-44487.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 46d13ff75b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-10-19 10:49:51 +02:00
Sebastiaan van Stijn
79c8372551
update to go1.20.9, test go1.21.2
go1.20.9 (released 2023-10-05) includes one security fixes to the cmd/go package,
as well as bug fixes to the go command and the linker. See the Go 1.20.9
milestone on our issue tracker for details:

https://github.com/golang/go/issues?q=milestone%3AGo1.20.9+label%3ACherryPickApproved

full diff: https://github.com/golang/go/compare/go1.20.8...go1.20.9

From the security mailing:

[security] Go 1.21.2 and Go 1.20.9 are released

Hello gophers,

We have just released Go versions 1.21.2 and 1.20.9, minor point releases.

These minor releases include 1 security fixes following the security policy:

- cmd/go: line directives allows arbitrary execution during build

  "//line" directives can be used to bypass the restrictions on "//go:cgo_"
  directives, allowing blocked linker and compiler flags to be passed during
  compliation. This can result in unexpected execution of arbitrary code when
  running "go build". The line directive requires the absolute path of the file in
  which the directive lives, which makes exploting this issue significantly more
  complex.

  This is CVE-2023-39323 and Go issue https://go.dev/issue/63211.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 9cc6e5b27f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-10-19 10:49:02 +02:00
Milos Gajdos
d85b88a400
[release/2.8 backport] reference: fix broken alias for DomainRegexp (#4114) 2023-10-19 09:25:31 +01:00
Sebastiaan van Stijn
7c40b3c627
reference: fix broken alias for DomainRegexp
An incorrect alias snuck into 152af63ec5,
and DomainRegexp was aliased to the regex for digests (DigestRegexp).

This didn't affect this repository, as it didn't use the aliases and migrated
to the new module, but does affect user of the old module that depend on the
aliases.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit c8c2bc279c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-10-19 10:09:02 +02:00
Milos Gajdos
d607c6ccb9
[release/2.8 backport] docs: remove blank line (#4092) 2023-10-04 15:08:28 +01:00
David Karlsson
6b9f48f381 docs: remove blank line
This blank line confuses the markdown parser to think
that this is an indented code block.

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
(cherry picked from commit 6183f23092)
2023-10-04 15:52:08 +02:00
Milos Gajdos
4772604ae9
Merge pull request #4088 from distribution/2.8.3-release-notes
Add v2.8.3 release notes
2023-10-02 18:09:30 +01:00
Milos Gajdos
a4fa699275
Add v2.8.3 release notes
Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
2023-10-01 16:23:59 +01:00
Milos Gajdos
1eb2c30122
Merge pull request #4068 from milosgajdos/2_8-dont-close-request-body
[release/2.8] Do not close HTTP request body in HTTP handler
2023-09-23 23:08:31 +01:00
Milos Gajdos
5e6b1b5c98
Do not close HTTP request body in HTTP handler
Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
2023-09-22 16:50:30 +01:00
Milos Gajdos
2b76378843
Merge pull request #4064 from thaJeztah/2.8_backport_nodigestset
[release/2.8] digestset: deprecate package in favor of go-digest/digestset
2023-09-22 14:35:45 +01:00
Sebastiaan van Stijn
29b00e8b28
digestset: deprecate package in favor of go-digest/digestset
This package was only used for the deprecated "shortid" syntax. Now that
support for this syntax was removed, we can also remove this package.

This patch deprecates and removes the package, adding temporary aliases pointing
to the new location to ease migration from docker/distribution to the new
distribution/distribution/v3. We should remove those aliases in a future update.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 7b651a9692)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-22 15:23:11 +02:00
Sebastiaan van Stijn
d1ab2430e6
[release/2.8] vendor: github.com/opencontainers/go-digest v1.0.0
full diff: a6d0ee40d4...v1.0.0

This is similar to the same changes on main:

- bf56f348be (update to v1.0.0-rc1)
- 8a8d91529d (update to v1.0.0)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-22 15:23:08 +02:00
Milos Gajdos
11eb4194f6
Merge pull request #4063 from thaJeztah/2.8_backport_switch_reference
[release/2.8] deprecate reference package, migrate to github.com/distribution/reference
2023-09-22 14:21:53 +01:00
Sebastiaan van Stijn
3dda067747
deprecate reference package, migrate to github.com/distribution/reference
This integrates the new module, which was extracted from this repository
at commit b9b19409cf458dcb9e1253ff44ba75bd0620faa6;

    # install filter-repo (https://github.com/newren/git-filter-repo/blob/main/INSTALL.md)
    brew install git-filter-repo

    # create a temporary clone of docker
    cd ~/Projects
    git clone https://github.com/distribution/distribution.git reference
    cd reference

    # commit taken from
    git rev-parse --verify HEAD
    b9b19409cf

    # remove all code, except for general files, 'reference/', and rename to /
    git filter-repo \
      --path .github/workflows/codeql-analysis.yml \
      --path .github/workflows/fossa.yml \
      --path .golangci.yml \
      --path distribution-logo.svg \
      --path CODE-OF-CONDUCT.md \
      --path CONTRIBUTING.md \
      --path GOVERNANCE.md \
      --path README.md \
      --path LICENSE \
      --path MAINTAINERS \
      --path-glob 'reference/*.*' \
      --path-rename reference/:

    # initialize go.mod
    go mod init github.com/distribution/reference
    go mod tidy -go=1.20

This commit is based on 152af63ec5 in the main branch,
but adjusted for the 2.8 branch, with some differences:

- the Sort functions have not been kept, as they were not part of the v2 package,
  and introduced in 1052518d9f
- the ParseAnyReferenceWithSet and ShortIdentifierRegexp were kept (but deprecated)
  as removing happened in 6d4f62d7fd, which is not
  in the 2.8 branch.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-22 13:25:01 +02:00
Milos Gajdos
da05539ad3
Merge pull request #4053 from thaJeztah/2.8_backport_set-content-type-client-readfrom 2023-09-14 20:32:54 +01:00
Milos Gajdos
0fd0b73b61
Merge pull request #4056 from thaJeztah/2.8_backport_update_golang_1.20.8 2023-09-14 20:32:11 +01:00
Sebastiaan van Stijn
3c6f778842
update to go1.20.8
go1.20.8 (released 2023-09-06) includes two security fixes to the html/template
package, as well as bug fixes to the compiler, the go command, the runtime,
and the crypto/tls, go/types, net/http, and path/filepath packages. See the
Go 1.20.8 milestone on our issue tracker for details:

https://github.com/golang/go/issues?q=milestone%3AGo1.20.8+label%3ACherryPickApproved

full diff: https://github.com/golang/go/compare/go1.20.7...go1.20.8

From the security mailing:

[security] Go 1.21.1 and Go 1.20.8 are released

Hello gophers,

We have just released Go versions 1.21.1 and 1.20.8, minor point releases.

These minor releases include 4 security fixes following the security policy:

- cmd/go: go.mod toolchain directive allows arbitrary execution
  The go.mod toolchain directive, introduced in Go 1.21, could be leveraged to
  execute scripts and binaries relative to the root of the module when the "go"
  command was executed within the module. This applies to modules downloaded using
  the "go" command from the module proxy, as well as modules downloaded directly
  using VCS software.

  Thanks to Juho Nurminen of Mattermost for reporting this issue.

  This is CVE-2023-39320 and Go issue https://go.dev/issue/62198.

- html/template: improper handling of HTML-like comments within script contexts
  The html/template package did not properly handle HMTL-like "<!--" and "-->"
  comment tokens, nor hashbang "#!" comment tokens, in <script> contexts. This may
  cause the template parser to improperly interpret the contents of <script>
  contexts, causing actions to be improperly escaped. This could be leveraged to
  perform an XSS attack.

  Thanks to Takeshi Kaneko (GMO Cybersecurity by Ierae, Inc.) for reporting this
  issue.

  This is CVE-2023-39318 and Go issue https://go.dev/issue/62196.

- html/template: improper handling of special tags within script contexts
  The html/template package did not apply the proper rules for handling occurrences
  of "<script", "<!--", and "</script" within JS literals in <script> contexts.
  This may cause the template parser to improperly consider script contexts to be
  terminated early, causing actions to be improperly escaped. This could be
  leveraged to perform an XSS attack.

  Thanks to Takeshi Kaneko (GMO Cybersecurity by Ierae, Inc.) for reporting this
  issue.

  This is CVE-2023-39319 and Go issue https://go.dev/issue/62197.

- crypto/tls: panic when processing post-handshake message on QUIC connections
  Processing an incomplete post-handshake message for a QUIC connection caused a panic.

  Thanks to Marten Seemann for reporting this issue.

  This is CVE-2023-39321 and CVE-2023-39322 and Go issue https://go.dev/issue/62266.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 23115ff634)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-12 00:35:59 +02:00
James Hewitt
31f5cd4865
Handle rand deprecations in go 1.20
Signed-off-by: James Hewitt <james.hewitt@uk.ibm.com>
(cherry picked from commit 1a3e73cb84)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-12 00:35:52 +02:00
James Hewitt
29b8ba0b93
Update to go 1.20
Signed-off-by: James Hewitt <james.hewitt@uk.ibm.com>
(cherry picked from commit 0eb8fee87e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-12 00:35:05 +02:00
Ben Manuel
3316b19810
Update to golang 1.19.10
This addresses CVE-2023-29402, CVE-2023-29403, CVE-2023-29404, CVE-2023-29405
which were patched in 1.19.10.

Signed-off-by: Ben Manuel <ben.manuel@procore.com>
(cherry picked from commit 36dd5b79ca)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-12 00:35:05 +02:00
Sebastiaan van Stijn
444d053e12
update golangci-lint to v1.52
Removing the "structcheck" and "varcheck" linters as they've been deprecated.

    level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused."
    level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused."

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit dec03ea3d8)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-12 00:34:52 +02:00
Sebastiaan van Stijn
b800af4409
ignore SA1019: ac.(*accessController).rootCerts.Subjects has been deprecated
We need to look into this; can we remove it, or is there a replacement?

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit ebe9d67446)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-12 00:33:27 +02:00
Sebastiaan van Stijn
0a98a00d17
Ignore SA1019: SplitHostname is deprecated.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 84a85a4048)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-12 00:32:54 +02:00
Hayley Swimelar
2897284284
Merge pull request #4054 from thaJeztah/2.8_backport_nonjson-error-client
[release/2.8 backport] Dont parse errors as JSON unless Content-Type is set to JSON
2023-09-11 13:18:23 -07:00
Milos Gajdos
2ec0471bb5
Dont parse errors as JSON unless Content-Type is set to JSON
Client attempts to parse the body of every error it receives as JSON
regardless of the content-type. This commit rectifies by only parsing
he error body as JSON if the Content-Type header is set to
either "application/json" or "application/vnd.api+json".

Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
(cherry picked from commit 45b7b9cec3)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-08 14:54:21 +02:00
Milos Gajdos
cb121c3f20
Set Content-Type header in registry client ReadFrom
Client ReadFrom doesn't set Content-Type header leading to server
side implementor to assume it's application/octet-stream. This commit
makes this explicit on the client side.

Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
(cherry picked from commit 24de708d22)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-08 14:45:13 +02:00
Milos Gajdos
10a7e4c483
Merge pull request #4032 from thaJeztah/2.8_backport_ref_replace_deprecated
[release/2.8 backport] reference: replace deprecated function SplitHostname
2023-08-31 15:20:59 +01:00
Sebastiaan van Stijn
b57133cc21
referene: fix formatting of "deprecated" comment.
Go requires "deprecated" comments to have an empty line before them,
and to not be all-caps.

This updates to the comment so that it's correctly picked up as deprecated.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 3c71f4933d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-08-31 12:58:15 +02:00
zounengren
2c4bf1a664
replace deprecated function
Signed-off-by: Zou Nengren <zouyee1989@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 79d1901549)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-08-31 12:58:04 +02:00
Milos Gajdos
27206bcd3b
Merge pull request #4009 from thaJeztah/2.8_backport_enable_build_tags
[release/2.8 backport] Enable Go build tags
2023-08-22 15:10:59 +01:00