Skip to content

Place a bound on how many auth attempts will be tried#485

Merged
jklukas merged 1 commit intomainfrom
klukas/auth-fixes
Jan 29, 2025
Merged

Place a bound on how many auth attempts will be tried#485
jklukas merged 1 commit intomainfrom
klukas/auth-fixes

Conversation

@jklukas
Copy link
Copy Markdown
Member

@jklukas jklukas commented Jan 29, 2025

Problem

Currently, the authentication flow will retry indefinitely if the registry includes authentication challenges in its 403 responses and the user has proper credentials but insufficient privileges to perform the action.

Solution

Fail the request after a number of authentication attempts. We allow at least 3 auth attempts (since the code path will always initially attempt a request without auth before invoking an auth helper) but otherwise respect the configured retries parameter.

Testing

A did a release of this code on my fork of the repo, and patched the puller into a work build, and verified that a path that previously would hang when trying to do a push now fails with a reasonable error message:

Caused by:
    Auth failed: '{ realm: ...

@jklukas jklukas merged commit 351c61c into main Jan 29, 2025
@jklukas jklukas deleted the klukas/auth-fixes branch January 29, 2025 15:24
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.

2 participants