DockerCLI/cli/command
Laura Brehm fcfdd7b91f
auth: add support for oauth device-code login
This commit adds support for the oauth [device-code](https://auth0.com/docs/get-started/authentication-and-authorization-flow/device-authorization-flow)
login flow when authenticating against the official registry.

This is achieved by adding `cli/internal/oauth`, which contains code to manage
interacting with the Docker OAuth tenant (`login.docker.com`), including launching
the device-code flow, refreshing access using the refresh-token, and logging out.

The `OAuthManager` introduced here is also made available through the `command.Cli`
interface method `OAuthManager()`.

In order to maintain compatibility with any clients manually accessing
the credentials through `~/.docker/config.json` or via credential
helpers, the added `OAuthManager` uses the retrieved access token to
automatically generate a PAT with Hub, and store that in the
credentials.

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-08-14 19:48:04 +01:00
..
builder test spring-cleaning 2024-07-04 01:35:12 +02:00
checkpoint cli: improve argument validation output 2024-07-05 03:35:14 +02:00
commands remove exec, push, pull, ps, images, info from "legacy" commands 2022-04-08 16:55:39 +02:00
completion cli/command/completion: add FromList utility 2024-07-17 01:25:33 +02:00
config cli: improve argument validation output 2024-07-05 03:35:14 +02:00
container Merge pull request #5303 from laurazard/fix-flaky-runattach-test 2024-07-29 13:43:31 +01:00
context Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
formatter replace uses of deprecated API types 2024-07-04 15:22:18 +02:00
idresolver Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
image Merge pull request #5234 from thaJeztah/nicer_missing_commands 2024-07-17 01:22:03 +02:00
inspect Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
manifest cli: improve argument validation output 2024-07-05 03:35:14 +02:00
network Merge pull request #5234 from thaJeztah/nicer_missing_commands 2024-07-17 01:22:03 +02:00
node cli: improve argument validation output 2024-07-05 03:35:14 +02:00
plugin cli: improve argument validation output 2024-07-05 03:35:14 +02:00
registry auth: add support for oauth device-code login 2024-08-14 19:48:04 +01:00
secret cli: improve argument validation output 2024-07-05 03:35:14 +02:00
service Merge pull request #5145 from psaintlaurent/ENGINE-903 2024-07-19 19:09:28 +02:00
stack cli: improve argument validation output 2024-07-05 03:35:14 +02:00
swarm cli: improve argument validation output 2024-07-05 03:35:14 +02:00
system cli: make cli.StatusError slightly prettier 2024-07-04 22:08:18 +02:00
task linting: address slice-append issues found by gocritic 2023-11-20 16:02:17 +01:00
testdata Dynamically register kubernetes context store endpoint type. 2019-05-20 13:28:11 +01:00
trust cli: improve argument validation output 2024-07-05 03:35:14 +02:00
volume test spring-cleaning 2024-07-04 01:35:12 +02:00
cli.go add support for DOCKER_CUSTOM_HEADERS env-var (experimental) 2024-07-19 15:04:26 +02:00
cli_options.go add support for DOCKER_CUSTOM_HEADERS env-var (experimental) 2024-07-19 15:04:26 +02:00
cli_options_test.go golangci-lint: enable thelper linter 2023-11-20 16:02:17 +01:00
cli_test.go add support for DOCKER_CUSTOM_HEADERS env-var (experimental) 2024-07-19 15:04:26 +02:00
context.go Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
context_test.go Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
defaultcontextstore.go Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
defaultcontextstore_test.go Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
registry.go fix: ctx cancellation on login prompt 2024-07-02 12:07:16 +02:00
registry_test.go linting: fmt.Sprintf can be replaced with string concatenation (perfsprint) 2024-06-10 21:19:32 +02:00
telemetry.go OTel: implement missing MeterProvider `ForceFlush` 2024-05-15 00:05:31 +01:00
telemetry_docker.go Update go:build comments to go1.21 2024-06-18 12:17:13 +02:00
telemetry_options.go cli: make initializing the global meter- and tracing providers optional 2024-06-24 15:44:20 +02:00
telemetry_utils.go cli: Wrap Err stream 2024-06-11 17:59:48 +02:00
telemetry_utils_test.go cli: Wrap Err stream 2024-06-11 17:59:48 +02:00
trust.go Refactor content_trust cli/flags handling 2018-03-08 15:00:43 -05:00
utils.go fix: ctx cancellation on login prompt 2024-07-02 12:07:16 +02:00
utils_test.go fix: ctx cancellation on login prompt 2024-07-02 12:07:16 +02:00