Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jib authentification does not respect www-authenticate specification allowing Basic auth without specifying realm #4032

Closed
Mishkun opened this issue May 30, 2023 · 1 comment · Fixed by #4035

Comments

@Mishkun
Copy link

Mishkun commented May 30, 2023

Environment:

  • Jib version: 3.3.2
  • Build tool: Gradle
  • OS: Macos Ventura 13.3.1

Description of the issue:
When trying to login to my self-hosted Docker registry, Jib fails with the following error:

Caused by: com.google.cloud.tools.jib.api.RegistryAuthenticationFailedException: Failed to authenticate with registry <my registry> because: 'Bearer' was not found in the 'WWW-Authenticate' header, tried to parse: Basic

Having a look to com.google.cloud.tools.jib.registry.RegistryAuthenticator#fromAuthenticationMethod I see that regexp used to determine authentification method has a space before the .*.

authenticationMethod.matches("^(?i)(basic) .*")

This makes jib to fail to select auth method given header WWW-Authenticate: Basic

Expected behavior:
According to https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/WWW-Authenticate#syntax it is allowed to use WWW-Authenticate: Basic without providing any realm/charset. Jib should allow that

Steps to reproduce:
Try to login to any registry responding with WWW-Authenticate: Basic header.

@chanseokoh
Copy link
Member

#4035 should fix it.

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

Successfully merging a pull request may close this issue.

3 participants