Skip to content

Add Docker output format to auth token - #6194

Draft
yolocs wants to merge 1 commit into
databricks:mainfrom
yolocs:chen-shou_data/stack/dar-configure-docker
Draft

Add Docker output format to auth token#6194
yolocs wants to merge 1 commit into
databricks:mainfrom
yolocs:chen-shou_data/stack/dar-configure-docker

Conversation

@yolocs

@yolocs yolocs commented Aug 6, 2026

Copy link
Copy Markdown

🥞 Stacked PR (generated by git ns)

Use this link to review incremental changes.


Changes

Adds the hidden databricks auth token --format=docker output mode used by the Databricks Docker credential helper.

The command accepts no positional argument and rejects --profile, --host, --account-id, and --workspace-id. It reads a Docker server address from stdin, normalizes and validates a registry host of the form <workspace-id>.container.<region>.<databricks-dns-zone>, and finds the matching workspace-scoped U2M profile. Profile selection uses both workspace_id and the workspace DNS zone so identical workspace IDs in different Databricks environments remain distinct.

On success, stdout contains Docker's get response:

{"Username":"oauthtoken","Secret":"<valid workspace OAuth token>"}

The OAuth token is returned unchanged. This mode does not implement credential-helper operation dispatch, store, or erase; the setup PR adds a shim that invokes it only for get.

Why

Docker provides a credential helper with only the registry address, while Databricks OAuth tokens are short-lived and profile-specific. Resolving the registry address back to a workspace profile lets the CLI load and refresh tokens through the existing auth token path for each Docker request without persisting a registry credential.

Tests

  • go test ./libs/dockercredentials ./cmd/auth -count=1
  • Registry parsing and validation for AWS, Azure, GCP, and environment-specific DNS zones
  • Profile selection, duplicate and cross-environment workspace IDs, unsupported auth types, invalid input, rejected selectors, and exact Docker JSON output

This PR was written by Codex.

@yolocs
yolocs force-pushed the chen-shou_data/stack/dar-configure-docker branch 2 times, most recently from 1d40c84 to 8a31a21 Compare August 17, 2026 19:47
Comment thread cmd/auth/configure_docker.go Outdated
Comment thread cmd/auth/configure_docker.go Outdated
Comment thread cmd/auth/configure_docker.go Outdated
Comment thread cmd/auth/configure_docker.go Outdated
Comment thread libs/dockercredentials/registry.go
@yolocs
yolocs force-pushed the chen-shou_data/stack/dar-configure-docker branch 2 times, most recently from d8b031a to 3131910 Compare August 18, 2026 04:36

@renaudhartert-db renaudhartert-db left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @yolocs!

It is big PR with a lot of implicit decisions and behaviors. It would help if we could get more documentation about the intended behavior and usage. Could you maybe rewrite your PR description as if it were documentation intended for the user?

For example, the PR adds a new token format but this is documented nowhere currently. The only way to understand the intended usage is to reverse-guess it from the code.

Left a first round of quick feedback.

Comment thread cmd/auth/configure_docker.go Outdated
Comment thread cmd/auth/configure_docker.go Outdated
Comment thread cmd/auth/configure_docker.go Outdated
Comment thread cmd/auth/configure_docker.go Outdated
Comment thread cmd/auth/configure_docker.go Outdated
Comment thread cmd/auth/configure_docker.go Outdated
@yolocs
yolocs force-pushed the chen-shou_data/stack/dar-configure-docker branch from 3d415da to 097fb03 Compare August 20, 2026 17:54
@yolocs yolocs changed the title Add Docker auth configuration for Artifact Registry Add Docker output format to auth token Aug 20, 2026
@yolocs
yolocs force-pushed the chen-shou_data/stack/dar-configure-docker branch from 097fb03 to cd0907f Compare August 20, 2026 19:40
@yolocs
yolocs force-pushed the chen-shou_data/stack/dar-configure-docker branch from cd0907f to 3ad7d11 Compare August 20, 2026 22:38
@github-actions

Copy link
Copy Markdown
Contributor

An authorized user can trigger integration tests manually by following the instructions below:

Trigger:
go/deco-tests-run/cli

Inputs:

  • PR number: 6194
  • Commit SHA: 3ad7d11b87bbf594d726ff5bbca38a689cd40379

Checks will be approved automatically on success.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants