61 Commits

Author SHA1 Message Date
Tonis Tiigi
cdb7d70861 Update patch dependencies
Bump patch-level dependencies while leaving
packageurl-go unchanged. This updates AWS config/credentials,
smithy-go, klauspost/compress, and sigstore-go, with required
companion bumps from their module constraints.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-07-21 22:24:51 -07:00
CrazyMax
e4d0dbaf3f chore: update generated files
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-06-12 09:44:45 +02:00
Sebastiaan van Stijn
94dcaca630 update protoc to v3.14.0
Updating to the lowest release that includes [protobuf@dfab275], which
removed use of the github.com/golang/protobuf/ptypes/timestamp.Timestamp
type alias (deprecated).

[protobuf@dfab275]: dfab275eca

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-06-05 18:01:59 +02:00
Tonis Tiigi
b5d7ecc353 session: add timeout for credentialsfunc
Ensure build does not appear deadlocked for some
credentials helper issue.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-04-16 16:45:04 -07:00
CrazyMax
d6d3c4d65c session(auth): cancel blocked credential callbacks
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-04-01 15:25:31 +02:00
Tonis Tiigi
b61489948c tests: use t.Context in unit tests
Replace context.TODO/background calls in targeted unit tests with
t.Context().

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-25 16:41:54 -08:00
Tonis Tiigi
ddeb26c5e1 vendor: update outdated patch versions of dependencies
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-13 22:08:15 -08:00
Tonis Tiigi
339740431f authprovider: make it possible to provide custom AuthConfig providers
This enables client to provide their own functionality for
AuthConfig lookup, rather than just passing in dockercli.ConfigFile.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-12-10 18:22:37 -08:00
Tonis Tiigi
09426caaae vendor: update containerd to v2.2.0-rc.0
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-11-03 11:11:53 -08:00
Jonathan A. Sternberg
f4339fd00b tools: utilize the new tool functionality introduced in go 1.24
Removes the `tools/tools.go` file used as a hack to get `go.mod` to
track tools in favor of the new method introduced in go 1.24 of being
formally supported in the `go.mod` file. This will allow the tools to be
managed with the new `go get tool` and `go install tool` commands.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-09-10 10:08:03 -05:00
Alberto Garcia Hierro
d84b119daf fix: display error details on unexpected response status code errors
When receiving a remote error due to an unexpected status code, read the
body and try to decode either a docker.Error or a simpler {"details"...}
payload. If those succeed, decode and format them appropriately. Otherwise,
fallback to displaying the raw response body which might contain valuable
information to indicate why authentication failed.

Signed-off-by: Alberto Garcia Hierro <damaso.hierro@docker.com>
2025-07-14 19:37:50 +01:00
Tonis Tiigi
9a5dff09b5 vendor: update to containerd v2.1.1
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-05-21 09:09:33 -06:00
Tonis Tiigi
7e96e626e3 lint: add usestdlibvars
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-05-02 12:19:22 -07:00
Michael Korn
8dbfa439e3 fix: reduce default expire time for opaque tokens
fixes #5852

Signed-off-by: Michael Korn <michael.korn@dhl.com>
2025-03-19 22:58:32 +01:00
Brian Goff
150e7985b6 authprovider: Add support for expiring auth cache
This exposes a mechanism to expire cached auth configs.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2025-01-27 15:30:46 -08:00
Sebastiaan van Stijn
d709e4bb1c vendor: google.golang.org/protobuf v1.35.2
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-14 14:03:31 +01:00
Marat Radchenko
5be7edb69c Upgrade to containerd 2
Co-authored-by: Derek McGowan <derek@mcg.dev>
Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
2025-01-13 16:42:48 -08:00
Tonis Tiigi
c9a25c4d8a pb: regenerate protobuf
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-10-28 12:56:03 -07:00
Tonis Tiigi
c4a9c39e61 authprovider: add OTEL spans for loading credentials
Credential loading could take long depending on credentials storage.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-10-16 20:52:09 -07:00
Tonis Tiigi
a6e85c7fd0 tracing: enable OTEL on authprovider requests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-10-16 20:52:09 -07:00
Jonathan A. Sternberg
41a0a0c37d protobuf: add vtproto as a supplemental marshaler
vtproto is an extra protobuf compiler that generates special methods
suffixed with `VT` that create typed and unrolled marshal and unmarshal
functions similar to gogo that can be used for performance sensitive
code. These extensions are optional for code to use but buildkit uses
them.

A codec is also included to utilize vtproto for grpc code. If the
package `github.com/moby/buildkit/util/grpcutil/encoding/proto` is
imported then vtproto will be used if it exists and otherwise it will
use the standard marshaling and unmarshaling methods.

This codec has an important difference from the default codec. The
default codec will always reset messages before unmarshaling. In most
cases, this is unnecessary and is only relevant for `RecvMsg` on
streams. In most cases, if we are passing in an existing message to this
method, we want to reuse the buffers. This codec will always merge the
message when unmarshaling instead of resetting the input message.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2024-10-04 12:52:15 -05:00
Jonathan A. Sternberg
ffd8ff490e protobuf: normalize how protobuf files are generated
The relative paths option for protoc generators doesn't work well when
it comes to dependencies. This simplifies the code generation to avoid
using `go generate` and to use one global command for protoc generation.

This is similar to https://github.com/docker/buildx/pull/2713 since the
same problems with code generation occur here too.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2024-10-03 17:40:53 -05:00
Jonathan A. Sternberg
1a3fc0aa15 protobuf: remove gogoproto
Remove gogoproto in favor of the standard protobuf compiler. This
removes any nonstandard extensions that were part of gogoproto such as
the custom types.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2024-09-26 12:57:45 -05:00
x893675
50990100c5 buildctl: Add insecure config for registry-auth-tlscontext flag
Signed-off-by: x893675 <x893675@icloud.com>
2023-11-16 11:25:25 +08:00
Tõnis Tiigi
75896378d7 Merge pull request #4211 from njucjc/support-auth-tls
buildctl: Add configured TLS certificate to trust store when making calls to registry auth
2023-09-15 17:28:40 -07:00
njucjc
2bd8d76504 buildctl: Add configured TLS certificate to trust store when making calls to registry auth
Signed-off-by: njucjc <njucjc@gmail.com>
2023-09-14 14:28:38 +08:00
Aaron Lehmann
95e5f6b76f authprovider: Fix error return from Credentials when logger is nil
This would segfault if SetLogger had not been called, because
progresswriter.Wrap returns nil when its logger arg is nil, causing
Credentials to return nil, nil.

Signed-off-by: Aaron Lehmann <alehmann@netflix.com>
2023-09-11 11:16:18 -07:00
Justin Chadwell
c5402622bb lint: add protolint config
And tidy up the proto definitions to follow the new linting rules.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2023-08-10 13:11:18 +01:00
Nick Santos
c5012139a5 response to comments
Signed-off-by: Nick Santos <nick.santos@docker.com>
2023-05-30 08:01:57 -04:00
Nick Santos
0fa754cde0 authprovider: fix a bug where registry-1.docker.io auth was always a cache miss
Signed-off-by: Nick Santos <nick.santos@docker.com>
2023-05-26 19:21:17 -04:00
Sascha Schwarze
8e6a2c0dd6 lint: fix various gosec findings
Signed-off-by: Sascha Schwarze <schwarzs@de.ibm.com>
2022-10-26 10:16:04 +01:00
Alex Suraci
e6d91fbeaa Docker auth: inject config instead of loading it
Signed-off-by: Alex Suraci <suraci.alex@gmail.com>
2022-06-04 11:54:26 -04:00
Dan Duvall
c99cb34971 authprovider: synchronize all authConfigCache access
Signed-off-by: Dan Duvall <dduvall@wikimedia.org>
2022-05-19 09:25:28 -07:00
Dan Duvall
ed05457d7b authprovider: Cache GetAuthConfig responses which may be expensive
Signed-off-by: Dan Duvall <dduvall@wikimedia.org>
2022-05-17 15:03:54 -07:00
Dan Duvall
b99a251f20 authprovider: support registrytoken field in docker auth config
The Docker CLI supports a field called "registrytoken" within the auth
config that may contain a previously resolved bearer token. If a
value is present, it is used verbatim and OAuth token retrieval using
username/password or identity token is skipped.

Support this same functionality in the buildkit client by checking for
this field's value prior to credential based auth in `FetchToken`. If a
value is set for `AuthConfig.RegistryToken`, short circuit and return
the token value as is.

This feature helps to support registry setups that integrate with third
party auth systems such as GitLab's JWT OmniAuth provider.

Signed-off-by: Dan Duvall <dduvall@wikimedia.org>
2022-05-17 15:03:44 -07:00
Sebastiaan van Stijn
21e9e9641e Remove uses of deprecated io/ioutil
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-10 00:57:07 +01:00
Tonis Tiigi
ed0408ac52 authorizer: default token expiration to 60s
When server does not return expiration time for token
default to 60s. This replaces previous solution
in error handling that broke cross-repo push.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2022-02-13 21:51:15 -08:00
Shiwei Zhang
9ae05d8e1d refine auth logic
Signed-off-by: Shiwei Zhang <shizh@microsoft.com>
2022-01-14 10:07:37 +08:00
Tonis Tiigi
3233c5275a authprovider: handle eaccess on storing token seeds
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-07-08 21:37:03 -07:00
Yamazaki Masashi
8a4efe4de7 Remove meaningless encode
Signed-off-by: Yamazaki Masashi <masi19bw@gmail.com>
2021-07-08 00:01:42 +09:00
Tonis Tiigi
53e7116197 session: make sure all token request keep correct context
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-06-08 21:17:35 -07:00
Tonis Tiigi
6157418c76 authprovider: allow errors on seed unmarshal
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-03-29 22:14:41 -07:00
Akihiro Suda
13ea18ad08 vendor containerd (requred for rootless overlayfs on kernel 5.11)
Required for rootless overlayfs on kernel 5.11
https://github.com/containerd/containerd/pull/5076

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-03-10 13:51:27 +09:00
Tonis Tiigi
b7510f7487 authprovider: allow readonly config dir
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-10-21 22:12:51 -07:00
Tonis Tiigi
1f94445456 auth: fetch tokens from client side
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-09-15 13:40:30 -07:00
Tonis Tiigi
f1cd79bf65 resolver: add better pooling and custom authenticator
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-08-13 17:27:11 -07:00
Tonis Tiigi
2e9987ad16 session: track sessions with a group construct
Avoid hidden session passing and allow one session to drop when
multiple builds share a vertex.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-07-05 00:15:25 -07:00
Tonis Tiigi
c78e875977 remove last instances of errors cause
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-04-24 11:25:53 -07:00
Akihiro Suda
7b579cdb98 vendor: update containerd (and various packages)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-02-28 10:24:10 +09:00
Tonis Tiigi
0f1c7d0412 session: use errors cause
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-06-06 21:15:21 -07:00