-
Notifications
You must be signed in to change notification settings - Fork 3
feat: Extended auth handler configuration #193
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
Open
mattkram
wants to merge
3
commits into
refac/tidy-token-lookup-logic
Choose a base branch
from
feat/extended-auth-handler-config
base: refac/tidy-token-lookup-logic
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: Extended auth handler configuration #193
mattkram
wants to merge
3
commits into
refac/tidy-token-lookup-logic
from
feat/extended-auth-handler-config
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7d80bd7 to
d84fa51
Compare
1 task
d84fa51 to
8a934f4
Compare
9234381 to
b72f5dd
Compare
0acd776 to
3c1f39f
Compare
2 tasks
01d6cbb to
5f12c82
Compare
c5ed019 to
e9e4de5
Compare
c53c0e8 to
9f7f907
Compare
e9e4de5 to
5c260ef
Compare
6a2d454 to
06c9ba0
Compare
f1551be to
4742260
Compare
06c9ba0 to
a66d62d
Compare
4742260 to
5907042
Compare
a66d62d to
86379df
Compare
…ttings tmp2 fix: Remove hard-code and implement real behavior
5907042 to
c2a792f
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Currently, the conda auth handler implementation inside
anaconda-authassumes a set of rules when performing token retrieval, given a request URL. In general, we assume the channel and auth domains match (which is sufficient for most self-hosted scenarios), or leverage a set of hard-coded values for production domains. We also support two types of credential for legacy support. However, in certain scenarios, it may be necessary to decouple the request URL from the auth domain lookup URL, or to explicitly specify which type of credential to use.Here, we implement an extended token-lookup function, leveraging optional fields that can be passed in conda's
channel_settings. In doing so, user's can explicitly override default behaviors to match the channel with the token lookup behavior.We do this by adding the optional
auth_domainandcredential_typefields, for example:In this case, an API key stored under the domain
anaconda.comwould be retrieved. Valid credential types are"api-key"and"repo-token".Considerations
This solution relies on the fact that conda's
channel_settingsis a plain dictionary object. There is precedence for additional fields (such asusernamein theconda-authplugin ref). But there is also an opportunity for plugins to declare their own "extra" config schema.Retrieval of channel settings from within the auth handler is currently challenging and replicates similar functionality as conda itself. I have opened a feature request issue in conda, which can help to simplify our implementation down the line if merged.
Additional note
This PR is designed to stack on top of #196. During implementation, I found it necessary to require refactoring the token lookup logic, which ultimately makes this PR much simpler.