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

fix(follower): do not cache authentication tokens #326

Merged

Commits on Sep 21, 2023

  1. fix(follower): do not cache authentication tokens

    Avoid caching authentication tokens in the client since they can expire.
    In those cases the client cannot invalidate the expired token,
    hence it will not have permission to access the resources.
    
    Each time the client will acquire a new token based on it's configuration.
    Remember that this change does not affect the underlying credential helper's cache.
    
    Signed-off-by: Aldo Lacuku <[email protected]>
    alacuku committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    5742a7a View commit details
    Browse the repository at this point in the history
  2. fix(client): do not cache credentialFuncs for unconfigured repositories

    When we create the http client for a given repository the code checks if it is somehow configured.
    It caches a function called `credentialFunction`. This function knows how to retrieve the
    credentials for a given repository. For unconfigured repositories, or repositories that fail to
    get valid credentials using their `credentialFunction,` we cache an `emptyCredential function`.
    This causes trouble in case of transient errors causing the client to not recover.
    This commit avoids caching the `emptyCredential function` in such cases or for unconfigured repositories.
    
    Signed-off-by: Aldo Lacuku <[email protected]>
    alacuku committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    97c73ef View commit details
    Browse the repository at this point in the history