sonatype / nexus-public

Sonatype Nexus Repository Open-source codebase mirror
https://www.sonatype.com/products/repository-oss-download
Eclipse Public License 1.0
1.94k stars 571 forks source link

Docker Bearer Token Anonymous Access Username #311

Open ls5302 opened 9 months ago

ls5302 commented 9 months ago

Should the Docker Bearer Token work with any configure user for anonymous access, or does it require the username in anonymous access to be set to anonymous (the built in user).

What I have observer:

If changing the username in anonymous access can break anonymous docker access should we be able to change it?

I had brief look at the code and 'anonymous' does appear to be hardcoded in the BearerTokenRealm class.

mrprescott commented 9 months ago

The Docker CLI has this unfortunate behavior where it always tries to log in so, despite Repository having anonymous mode turned on, the CLI pre-emptively tries and fails authentication. To get around this, there's a setting on the repository level called "Allow docker anonymous pull" that will allow any credentials to pass login.

ls5302 commented 9 months ago

Allow anonymous pull is ticked in the repo but only works with the build in Anonymous account - maybe not surprising as new user accounts cannot be created without a password.