Skip to content

Commit 5abbba6

Browse files
dockerhub API change allows PATS so remove warnings
1 parent dd2a65f commit 5abbba6

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ pushrm:
107107
docker login
108108
```
109109

110+
Both password and Personal Access Token (PAT) should work. When using a PAT, make sure it has sufficient privileges (`admin` scope).
111+
110112
### Log in to Harbor v2 registry
111113

112114
```
@@ -244,12 +246,6 @@ A list of all supported env vars is [here](README-containers.md#env-vars).
244246

245247
## Limitations
246248

247-
### Conflict with Dockerhub personal access tokens and 2FA auth
248-
249-
Pushing READMEs to Dockerhub currently only works with username/password and **not** with [personal access tokens](https://docs.docker.com/docker-hub/access-tokens/). If you have [2FA auth](https://docs.docker.com/docker-hub/2fa/) (two-factor authentication) enabled for your Dockerhub account you're effectively using a personal access token. This is an unfortunate Dockerhub API limitation.
250-
251-
There are indications (in issues and forum posts) that a new API for Dockerhub might be coming up sooner or later that might fill this gap. Fingers crossed. 🤞
252-
253249
### Problem with Harbor2 OpenID connect logins
254250

255251
This tool currently doesn't work for Harbor2 users that that authenticate through a 3rd party [OpenID Connect (OIDC) provider](https://goharbor.io/docs/1.10/administration/configure-authentication/oidc-auth/) like auth0, Keycloak, okta, dex, etc).

cmd/pushrm.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ var pushrmCmd = &cobra.Command{
111111
---------
112112
run 'docker login'
113113
114-
(Note: Dockerhub login must be username/password. Personal access tokens / 2FA auth
115-
is not supported. See docs for details.)
114+
(use password or Personal Access Token (PAT) with 'admin' scope)
116115
117116
118117
quay

provider/dockerhub/dockerhub.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ func PatchDescription(jwt string, readme string, namespacename string, reponame
173173
msg = msg + ". Server responded: \"" + dat["detail"].(string) + "\""
174174
}
175175
if res.StatusCode == 403 {
176-
msg = msg + ". Try \"docker logout\" and \"docker login\". You cannot use a personal access token to log in and must use username and password. If you have 2FA auth enabled in Dockerhub you'll need to disable it for this tool to work. (This is an unfortunate Dockerhub limitation, see docs for more infos.)"
176+
msg = msg + ". Try \"docker logout\" and \"docker login\". If you use a PAT token make sure it has sufficient privileges (\"admin\" scope)."
177177

178178
}
179179
return fmt.Errorf(msg)

0 commit comments

Comments
 (0)