Skip to content

Conversation

@mattkram
Copy link
Collaborator

Summary

Currently, our request callbacks that handle 401/403 server errors currently do not differentiate between repo tokens and API keys. This is a problem because the instructions are slightly different for how the user should resolve their issue.

  • If they need to get a new API key, they have to do anaconda login
  • If they have to get a new repo token, they currently have to do anaconda token install

This will remain this way until we unify on API keys for all repository access.

This PR refactors in addition to #196 such that the credential type required for the channel is available inside the __call__() method. Then, we can construct a callback hook function closure containing the value, which is retrieved if the callback is invoked.

There might be more opportunity to cache or otherwise ensure performance of this hook function.

I've extended the tests to test the error messages for the following matrix of cases:

  • Credential was or was not sent
  • Channel requires repo token or API key
  • 401 or 403 response

@mattkram mattkram changed the base branch from main to refac/tidy-token-lookup-logic December 20, 2025 02:15
@mattkram mattkram force-pushed the refac/tidy-token-lookup-logic branch from a66d62d to 86379df Compare January 21, 2026 19:10
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