Commit Graph

25 Commits

Author SHA1 Message Date
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
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
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
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
6157418c76 authprovider: allow errors on seed unmarshal
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-03-29 22:14:41 -07: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
Akihiro Suda
073aa092e7 authprovider: set stderr
Fix #997

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-05-10 15:45:05 +09:00
Tibor Vass
f467c292da session: add lock to fix hang
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-05-07 21:20:04 +00:00
Tonis Tiigi
e24e194078 remove net/context references
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-04-30 18:10:54 -07:00
Tonis Tiigi
7ac9599c8f session: separate authprovider to package
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-04-17 20:36:23 -07:00