Skip to content

Commit b31ca14

Browse files
authored
docs: clarify OAT authentication support (#130)
1 parent be35071 commit b31ca14

22 files changed

+114
-31
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ cat ~/my_password.txt | docker login --username my-username --password-stdin
5454
```
5555

5656
If you'd like to use a different account for running the provider,
57-
you can set credentials in the environment:
57+
you can set credentials in the environment. When using an organization access
58+
token (OAT), set `DOCKER_USERNAME` to the organization name:
5859

5960
```
6061
export DOCKER_USERNAME=my-username
@@ -78,6 +79,23 @@ Unfortunately, PATs are limited to managing repositories. If you'd like to use
7879
this provider to manage organizations and teams, you will need to authenticate
7980
with a password.
8081

82+
Organization access tokens (OATs) are a separate credential type for
83+
organization-scoped automation. Authenticate with the organization name as the
84+
username and the OAT as the password.
85+
86+
OATs can be used with this provider for organization APIs when the token has
87+
the required permissions for the target API, such as `Member Read`,
88+
`Member Edit`, `Invite Read`, `Invite Edit`, `Group Read`, and `Group Edit`.
89+
90+
When the provider auto-resolves credentials from Docker's config file, it
91+
currently prefers Docker Desktop's cached access token before `docker login`
92+
pull credentials. If you want to force OAT usage, set `DOCKER_USERNAME` and
93+
`DOCKER_PASSWORD` explicitly or configure them in the provider block.
94+
95+
Organization access tokens are incompatible with Docker Desktop, Image Access
96+
Management, and Registry Access Management. Use a password or PAT for those
97+
features.
98+
8199
## Contributing
82100

83101
We welcome contributions to the Docker services Terraform provider, detailed documentation for contributing & building the provider can be found [here](https://github.com/docker/terraform-provider-docker/blob/main/CONTRIBUTING.md)

docs/data-sources/org.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ page_title: "docker_org Data Source - docker"
44
subcategory: ""
55
description: |-
66
Reads properties of a Docker Hub organization.
7-
-> Note: This data source is only available when authenticated with a username and password.
7+
-> Note: This data source requires credentials that can access organization APIs, such as a user password or an organization access token (OAT) with the required organization permissions.
88
Example Usage
99
1010
data "docker_org" "example" {
@@ -26,7 +26,7 @@ description: |-
2626

2727
Reads properties of a Docker Hub organization.
2828

29-
-> **Note**: This data source is only available when authenticated with a username and password.
29+
-> **Note**: This data source requires credentials that can access organization APIs, such as a user password or an organization access token (OAT) with the required organization permissions.
3030

3131
## Example Usage
3232

docs/data-sources/org_members.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ page_title: "docker_org_members Data Source - docker"
44
subcategory: ""
55
description: |-
66
Reads members of an organization.
7-
-> Note Only available when authenticated with a username and password.
7+
-> Note Requires credentials that can read organization members, such as a user password or an organization access token (OAT) with the Member Read scope.
88
Example Usage
99
1010
data "docker_org_members" "_" {
@@ -20,7 +20,7 @@ description: |-
2020

2121
Reads members of an organization.
2222

23-
-> **Note** Only available when authenticated with a username and password.
23+
-> **Note** Requires credentials that can read organization members, such as a user password or an organization access token (OAT) with the `Member Read` scope.
2424

2525
## Example Usage
2626

docs/data-sources/org_team.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ page_title: "docker_org_team Data Source - docker"
44
subcategory: ""
55
description: |-
66
Reads team information within a Docker Hub organization.
7-
-> Note: This data source is only available when authenticated with a username and password.
7+
-> Note: This data source requires credentials that can read organization groups, such as a user password or an organization access token (OAT) with the Group Read scope.
88
Example Usage
99
1010
data "docker_org_team" "example" {
@@ -26,7 +26,7 @@ description: |-
2626

2727
Reads team information within a Docker Hub organization.
2828

29-
-> **Note**: This data source is only available when authenticated with a username and password.
29+
-> **Note**: This data source requires credentials that can read organization groups, such as a user password or an organization access token (OAT) with the `Group Read` scope.
3030

3131
## Example Usage
3232

docs/data-sources/org_team_member.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ page_title: "docker_org_team_member Data Source - docker"
44
subcategory: ""
55
description: |-
66
Reads team members of a specified team within a Docker Hub organization.
7-
-> Note: This data source is only available when authenticated with a username and password.
7+
-> Note: This data source requires credentials that can read organization groups, such as a user password or an organization access token (OAT) with the Group Read scope.
88
Example Usage
99
1010
data "docker_org_team_member" "example" {
@@ -25,7 +25,7 @@ description: |-
2525

2626
Reads team members of a specified team within a Docker Hub organization.
2727

28-
-> **Note**: This data source is only available when authenticated with a username and password.
28+
-> **Note**: This data source requires credentials that can read organization groups, such as a user password or an organization access token (OAT) with the `Group Read` scope.
2929

3030
## Example Usage
3131

docs/index.md

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ description: |-
5858
5959
Setting credentials with environment variables
6060
If you'd like to use a different account for running the provider,
61-
you can set credentials in the environment:
61+
you can set credentials in the environment. When using an organization access
62+
token (OAT), set DOCKER_USERNAME to the organization name:
6263
6364
export DOCKER_USERNAME=my-username
6465
export DOCKER_PASSWORD=my-secret-token
@@ -91,6 +92,21 @@ description: |-
9192
passwords.
9293
Unfortunately, PATs are limited to managing repositories. If you'd like to use
9394
this provider to manage organizations and teams, you will need to authenticate
95+
with a password.
96+
Organization access tokens (OATs) are a separate credential type for
97+
organization-scoped automation. Authenticate with the organization name as the
98+
username and the OAT as the password.
99+
OATs can be used with this provider for organization APIs when the token has
100+
the required permissions for the target API, such as Member Read,
101+
Member Edit, Invite Read, Invite Edit,
102+
Group Read, and Group Edit.
103+
When the provider auto-resolves credentials from Docker's config file, it
104+
currently prefers Docker Desktop's cached access token before docker login
105+
pull credentials. If you want to force OAT usage, set DOCKER_USERNAME and
106+
DOCKER_PASSWORD explicitly or configure them in the provider block.
107+
Organization access tokens are incompatible with Docker Desktop, Image Access
108+
Management, and Registry Access Management. Use a password or PAT for those
109+
features.
94110
---
95111

96112
# docker Provider
@@ -169,7 +185,8 @@ jobs:
169185
### Setting credentials with environment variables
170186

171187
If you'd like to use a different account for running the provider,
172-
you can set credentials in the environment:
188+
you can set credentials in the environment. When using an organization access
189+
token (OAT), set `DOCKER_USERNAME` to the organization name:
173190

174191
```
175192
export DOCKER_USERNAME=my-username
@@ -219,6 +236,25 @@ passwords.
219236

220237
Unfortunately, PATs are limited to managing repositories. If you'd like to use
221238
this provider to manage organizations and teams, you will need to authenticate
239+
with a password.
240+
241+
Organization access tokens (OATs) are a separate credential type for
242+
organization-scoped automation. Authenticate with the organization name as the
243+
username and the OAT as the password.
244+
245+
OATs can be used with this provider for organization APIs when the token has
246+
the required permissions for the target API, such as `Member Read`,
247+
`Member Edit`, `Invite Read`, `Invite Edit`,
248+
`Group Read`, and `Group Edit`.
249+
250+
When the provider auto-resolves credentials from Docker's config file, it
251+
currently prefers Docker Desktop's cached access token before `docker login`
252+
pull credentials. If you want to force OAT usage, set `DOCKER_USERNAME` and
253+
`DOCKER_PASSWORD` explicitly or configure them in the provider block.
254+
255+
Organization access tokens are incompatible with Docker Desktop, Image Access
256+
Management, and Registry Access Management. Use a password or PAT for those
257+
features.
222258

223259

224260

@@ -229,5 +265,5 @@ this provider to manage organizations and teams, you will need to authenticate
229265

230266
- `host` (String) Docker Hub API Host. Default is `hub.docker.com`.
231267
- `max_page_results` (Number) Maximum number of pages to fetch when retrieving paginated data. Default is 50. Set to 0 for unlimited pages.
232-
- `password` (String, Sensitive) Password for authentication
233-
- `username` (String) Username for authentication
268+
- `password` (String, Sensitive) Password, PAT, or OAT for authentication
269+
- `username` (String) Username or organization namespace for authentication

docs/resources/org_access_token.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ description: |-
2020
]
2121
expires_at = "2027-12-31T23:59:59Z"
2222
}
23-
24-
For TYPE_REPO resources, path must point to an existing repository or a supported glob such as my-organization/*.
2523
24+
For TYPE_REPO resources, path must point to an existing repository or a supported glob such as my-organization/*.
2625
Public-Only Repositories
2726
Use the special path */*/public to scope the token to public repositories only.
2827

docs/resources/org_member.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ page_title: "docker_org_member Resource - docker"
44
subcategory: ""
55
description: |-
66
Manages members associated with an organization.
7-
-> Note Only available when authenticated with a username and password as an owner of the org.
7+
-> Note Requires credentials that can read and manage organization members and invites, such as an owner login with a user password or an organization access token (OAT) with the Member Read, Member Edit, Invite Read, and Invite Edit scopes.
88
When a member is added to an organization, they don't have access to the
99
organization's repositories until they accept the invitation. The invitation is
1010
sent to the email address associated with the user's Docker ID.
@@ -35,7 +35,7 @@ description: |-
3535

3636
Manages members associated with an organization.
3737

38-
-> **Note** Only available when authenticated with a username and password as an owner of the org.
38+
-> **Note** Requires credentials that can read and manage organization members and invites, such as an owner login with a user password or an organization access token (OAT) with the `Member Read`, `Member Edit`, `Invite Read`, and `Invite Edit` scopes.
3939

4040
When a member is added to an organization, they don't have access to the
4141
organization's repositories until they accept the invitation. The invitation is

docs/resources/org_setting_image_access_management.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ page_title: "docker_org_setting_image_access_management Resource - docker"
44
subcategory: ""
55
description: |-
66
Manages the Image Access Management settings for an organization.
7+
-> Note: Docker does not support organization access token (OAT) authentication for Image Access Management. Use a user password or PAT instead.
78
Example Usage
89
910
resource "docker_org_setting_image_access_management" "example" {
@@ -18,6 +19,8 @@ description: |-
1819

1920
Manages the Image Access Management settings for an organization.
2021

22+
-> **Note**: Docker does not support organization access token (OAT) authentication for Image Access Management. Use a user password or PAT instead.
23+
2124
## Example Usage
2225

2326
```hcl

docs/resources/org_setting_registry_access_management.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ page_title: "docker_org_setting_registry_access_management Resource - docker"
44
subcategory: ""
55
description: |-
66
Manages the Registry Access Management settings for an organization.
7+
-> Note: Docker does not support organization access token (OAT) authentication for Registry Access Management. Use a user password or PAT instead.
78
Example Usage
89
910
resource "docker_org_setting_registry_access_management" "example" {
@@ -31,6 +32,8 @@ description: |-
3132

3233
Manages the Registry Access Management settings for an organization.
3334

35+
-> **Note**: Docker does not support organization access token (OAT) authentication for Registry Access Management. Use a user password or PAT instead.
36+
3437
## Example Usage
3538

3639
```hcl

0 commit comments

Comments
 (0)