Skip to content

Commit abfb1af

Browse files
Clarify mirroring permissions and access tokens (docker#24890)
Updated permissions information for organization access tokens. <!--Delete sections as needed --> ## Description [slack thread](https://docker.slack.com/archives/C0989V6TAK0/p1776941317779569) ## Related issues or tickets <!-- Related issues, pull requests, or Jira tickets --> ## Reviews <!-- Notes for reviewers here --> <!-- List applicable reviews (optionally @tag reviewers) --> - [ ] Technical review - [ ] Editorial review - [ ] Product review --------- Signed-off-by: Craig Osterhout <craig.osterhout@docker.com> Co-authored-by: Craig Osterhout <craig.osterhout@docker.com>
1 parent e784955 commit abfb1af

2 files changed

Lines changed: 39 additions & 11 deletions

File tree

content/manuals/dhi/how-to/customize.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,18 @@ You can create customizations using either the DHI CLI or the Docker Hub web int
157157
{{< /tab >}}
158158
{{< tab name="CLI" >}}
159159

160-
Authenticate with `docker login` using your Docker credentials or a [personal
160+
Authenticate with `docker login` using your Docker credentials, a [personal
161161
access token (PAT)](../../security/access-tokens.md) with **Read & Write**
162-
permissions. [Organization access tokens
163-
(OATs)](../../enterprise/security/access-tokens.md) are not supported.
162+
permissions, or an [organization access token
163+
(OAT)](../../enterprise/security/access-tokens.md). When using an OAT, the
164+
available operations depend on the token's permission scope:
165+
166+
- To list or get customizations, or to view build logs, the OAT must have read
167+
(pull) access to the destination repository. Results are scoped to
168+
repositories the OAT can access.
169+
- To create, update, or delete a customization, the OAT must have push access to
170+
the destination repository. Bulk operations require push access to every
171+
referenced destination repository.
164172

165173
Use the [`docker dhi customization`](/reference/cli/docker/dhi/customization/) command:
166174

content/manuals/dhi/how-to/mirror.md

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ repositories:
3434

3535
## Mirror a DHI repository to your organization
3636

37-
You must be an organization owner or editor to mirror repositories.
37+
To mirror repositories, you must be an organization owner or editor, or use a
38+
personal access token (PAT) or organization access token (OAT). See the CLI and
39+
Terraform tabs in the following sections for required permission scopes.
3840

3941
- Image repositories: Mirroring lets you customize images by adding packages,
4042
OCI artifacts (such as custom certificates or additional tools), environment
@@ -66,10 +68,22 @@ It may take a few minutes for all the tags to finish mirroring.
6668
{{< /tab >}}
6769
{{< tab name="CLI" >}}
6870

69-
Authenticate with `docker login` using your Docker credentials or a [personal
71+
Authenticate with `docker login` using your Docker credentials, a [personal
7072
access token (PAT)](../../security/access-tokens.md) with **Read & Write**
71-
permissions. [Organization access tokens
72-
(OATs)](../../enterprise/security/access-tokens.md) are not supported.
73+
permissions, or an [organization access token
74+
(OAT)](../../enterprise/security/access-tokens.md). When using an OAT, the
75+
available operations depend on the token's permission scope:
76+
77+
- To list mirrored repositories, the OAT must have read (pull) access to the
78+
relevant repositories. Results are scoped to repositories the OAT can access.
79+
- To create a mirror to an existing destination repository, the OAT must have
80+
push access to that repository. To create a mirror to a new destination
81+
repository that doesn't yet exist, the OAT must have org-wide repository
82+
access (for example, `<org>/*` with pull or push). Repository-scoped access to
83+
the future repository name is not sufficient.
84+
- To stop mirroring, the OAT must have push access to the relevant repository.
85+
- OATs with public repository read-only access cannot list or manage mirrored
86+
repositories.
7387

7488
Use the [`docker dhi mirror`](/reference/cli/docker/dhi/mirror/) command:
7589

@@ -127,7 +141,12 @@ provider "dhi" {
127141
> [!NOTE]
128142
>
129143
> Instead of specifying credentials in the provider block, you can set the
130-
> `DOCKER_USERNAME`, `DOCKER_PASSWORD`, and `DHI_ORG` environment variables.
144+
> `DOCKER_USERNAME`, `DOCKER_PASSWORD`, and `DHI_ORG` environment variables. You
145+
> can also authenticate using an organization access token (OAT) in place of a
146+
> password. Set `DOCKER_USERNAME` to your organization namespace and
147+
> `DOCKER_PASSWORD` to the OAT. When using an OAT, the same permission scopes
148+
> apply as with the CLI: read (pull) access is required to list mirrors, and
149+
> push access is required to create or delete them.
131150
132151
Then, define a `dhi_mirror` resource for each repository you want to mirror:
133152

@@ -194,10 +213,11 @@ updates. You can still use the last images or charts that were mirrored.
194213
{{< /tab >}}
195214
{{< tab name="CLI" >}}
196215

197-
Authenticate with `docker login` using your Docker credentials or a [personal
216+
Authenticate with `docker login` using your Docker credentials, a [personal
198217
access token (PAT)](../../security/access-tokens.md) with **Read & Write**
199-
permissions. [Organization access tokens
200-
(OATs)](../../enterprise/security/access-tokens.md) are not supported.
218+
permissions, or an [organization access token
219+
(OAT)](../../enterprise/security/access-tokens.md) with push access to the
220+
relevant repository.
201221

202222
Use the [`docker dhi mirror`](/reference/cli/docker/dhi/mirror/) command:
203223

0 commit comments

Comments
 (0)