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

Add auth_file option to read authentication information for repositories from a file #413

Merged
merged 16 commits into from
Dec 18, 2023

Conversation

0xbe7a
Copy link
Contributor

@0xbe7a 0xbe7a commented Dec 12, 2023

This PR adds the option to disable the usage of the system keychain for storing login information but instead to rely soly on the fallback auth store, which is a simple JSON File.

Depends on conda/rattler#435

@0xbe7a 0xbe7a changed the title add option to force usage of fallback_auth Add auth_file option to read authentication information for repositories from a file Dec 15, 2023
@0xbe7a
Copy link
Contributor Author

0xbe7a commented Dec 15, 2023

@wolfv, I have changed the PR and there is now only the option to specify a path to a file containing the authentication information. Should we leave the option hidden?

@pavelzw
Copy link
Collaborator

pavelzw commented Dec 15, 2023

If you keep the information hidden, please add a section for it in the docs.

@0xbe7a
Copy link
Contributor Author

0xbe7a commented Dec 15, 2023

I would also like to add an end-to-end test for this. My idea was to use a technical user / API key for prefix.dev that has read-only access to a private channel containing a dummy package. We could then include the key in this repository. Do you already have such an account or could you create one?

@pavelzw
Copy link
Collaborator

pavelzw commented Dec 15, 2023

I also did this with setup-pixi but with my personal account.

@wolfv
Copy link
Member

wolfv commented Dec 15, 2023

great stuff! I can make such an account on prefix, of course. Any package that you think would work good?

@0xbe7a
Copy link
Contributor Author

0xbe7a commented Dec 15, 2023

Just any dummy package that we can list as a build dependency. Requires no content, e.g. we used this recipe for conda-forge conda-forge/_python_rc-feedstock@main/recipe/meta.yaml.

@wolfv
Copy link
Member

wolfv commented Dec 15, 2023

I added you two to this channel and uploaded _libgcc_mutex (linux-64 only!).

@0xbe7a
Copy link
Contributor Author

0xbe7a commented Dec 15, 2023

I want to include a read-only key for this channel within the test so that everyone can run the full integration tests. With prefix-dev I can only include one unrestricted API key for my entire account and all channels, right?

@wolfv
Copy link
Member

wolfv commented Dec 15, 2023

yeah that's true. how about I add one as a secret to the repo for now and we do what you suggest once we have implemented this kind of scoped access on prefix?

@0xbe7a
Copy link
Contributor Author

0xbe7a commented Dec 15, 2023

👍 Then just add the API key of a user who has read access to the channel as a secret and environment variable, and I'll just skip the test if the environment variable is not set.

@wolfv
Copy link
Member

wolfv commented Dec 16, 2023

Added the following secret: PREFIX_DEV_READ_ONLY_TOKEN

@0xbe7a
Copy link
Contributor Author

0xbe7a commented Dec 16, 2023

@wolfv, I added an integration test to test authentication in a private prefix.dev channel and tested it locally and it works. The CI is currently failing as the secret is not exposed to outside contributors running.

I think you need to make an empty commit to this PR for the secrets to get exposed to the workflow

baszalmstra pushed a commit to conda/rattler that referenced this pull request Dec 17, 2023
While testing the `auth-file` feature for `rattler-build`
(prefix-dev/rattler-build#413) I noticed that
the wildcard extension for domains does not work correctly:

`https://repo.prefix.dev` was matched with `repo.prefix.dev` and
`*.repo.prefix.dev`, but not with `*.prefix.dev`. On closer inspection,
it looks like the function never worked properly: See
#252

This PR fixes the wildcard handling and adds a unit test for it.
.github/workflows/end-to-end.yml Outdated Show resolved Hide resolved
test/end-to-end/test_simple.py Outdated Show resolved Hide resolved
@wolfv wolfv merged commit fa672b9 into prefix-dev:main Dec 18, 2023
11 checks passed
@0xbe7a 0xbe7a deleted the force-fallback branch December 18, 2023 08:53
@0xbe7a
Copy link
Contributor Author

0xbe7a commented Dec 18, 2023

The test currently fails on main, but works on my fork (https://github.com/0xbe7a/rattler-build/actions/runs/7246636641/job/19738988493). Can you run the test again to make sure it's not a temporary issue, @wolfv?

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.

3 participants