这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@edigaryev
Copy link
Collaborator

@edigaryev edigaryev commented Oct 22, 2024

Problem: normally, the reason we get the HTTP 401 when working with OCI registries is the initial lack of token, in which case AuthenticationKeeper will have no Authentication set, and the authenticationKeeper.header() will return nil.

However, sometimes the cause for the HTTP 401 is that the scopes mismatch, and since the AuthenticationKeeper now already has Authentication, we'll happily add it to a request for a new token (not just for a regular OCI request):

if let (name, value) = await authenticationKeeper.header() {
request.addValue(value, forHTTPHeaderField: name)
}

This results in a token request with two values in the Authorization and causes HTTP 400 for e.g. GitLab Registry.

Solution: never consider AuthenticationKeeper when making a request for a new token.

Resolves #914.

@edigaryev edigaryev requested a review from fkorotkov as a code owner October 22, 2024 18:49
@edigaryev edigaryev merged commit accbd0c into main Oct 23, 2024
7 checks passed
@edigaryev edigaryev deleted the fix-double-authorization branch October 23, 2024 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tart Push to GitLab Registry Failing

3 participants