GoogleContainerTools / GoogleContainerTools/jib

Jib authentication logic may not determine if authentication is required correctly

Open
#4,385 2 comments 0 reactions 0 assignees View on GitHub
priority: p3 type: feature request
Dominant language
Java
Stars
14.5k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

**Environment**:

- *Jib version:* 3.4.4
- *Build tool:* Maven
- *OS:* linux/macos

**Description of the issue**:

Jib may in some circumstances incorrectly determine that a repository does not require authentication. Take for instance the case where caching is used for the manifests or other components of a base image. If the initial request succeeds then Jib assumes the repository does not require authentication. In the case of a cache miss where authentication is required, this may result in a 401 which is not handled and fails the build. Jib should use the /v2/ endpoint to initially determine if the repository requires authentication.
Additionally, better error handling for 401 related errors at other points in the pull process would help mitigate any further errors such as the case where a token refresh may be necessary.

**Expected behavior**:

Jib should correctly determine if the target repository requires authentication via the method mentioned in the description as opposed to an attempt authentication based upon pull of the base image manifest.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.