-
Notifications
You must be signed in to change notification settings - Fork 993
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
[bug] source_credentials.json causes remote to expect credentials #16396
Comments
Hi @ottar-ct Thanks for your report, and thanks specially for making it so detailed. I am checking this, and I am not sure this is a bug or by design. The source URL and the Conan packages URL cannot be the same. This is by design, it is impossible that the same URL can serve both Conan packages and generic source tarballs. So the "source_credentials.json" design is pretty simple, if the URL for any http requests matches the provided URL it will inject those credentials. Can you please try using distinct URLs for the Conan repo and the sources repo? Because they are different, aren't they? |
Hi @memsharded Thanks for the response, The use case is:
source_credentials.json affecting the behaviour of conan remote authentication doesn't match my expectations of what a source_credentials.json file would do |
I understand what you mean, but the issue is that this credentials injection is designed as an http interceptor. So it is basically impossible to distinguish the "type" of URL and knowing if it is a Conan remote or not. This was designed as a per-repository credential, and with the constraint that there cannot be overlap in URLs. In your case, if your URLs for sources are like {
"credentials": [
{
"url": "https://example-url.com/source",
"token": "{{ artifactory_identity_token }}"
}
]
} And that will work for every As another alternative, maybe it would also be recommended to gather all source repos in the server side in a virtual repo, so all the sources are available via a single URL? This is often a recommended good practice with Artifactory, to avoid the explosion of repo definitions in the client side (for all package managers, not only for Conan) |
Hi @memsharded , thanks for the reply To expand on our use case User A requires access to repo's 1, 2, 3 Repositories of 1, 2, 3, 4, 5 are in different security domains, and should only be accessible to those within those domains We can use the text matching pattern you suggested or merging of source credential files to work around the issue I think from a user perspective its not intuitive that these two parts of the interface interact in this way, so if it's not a bug in the current design, we would want to request that as a feature. |
Ok, understood. I am submitting #16425, to try to improve over this. I think you are right, even if the initial design didn't consider the overlap, it might be better to take this into account. It requires a bit of propagation of information down to the interceptor, but thanks to the Conan 2 architecture, it is cleaner than I expected (I still have the Conan 1 codebase challenges in mind), so I am going to propose this to the team. Thanks for the feedback! |
#16425 was merged, it will be included in next 2.5 release (end of month). Thanks again for the feedback! |
No worries, Thanks for addressing the issue. |
Describe the bug
Environment Details
Red Hat Enterprise Linux 8.9 (Ootpa)
Linux 4.18.0-477.15.1.el8_8.x86_64
cmake version 3.27.7
Python 3.11.5
Conan version 2.3.0
Description
When credentials are defined in source_credentials.json, with a URL that matches a URL defined for a Conan remote, the remote will require authentication information to be propagated even if the Conan remote repository itself is public and does not require authentication. This applies to virtual and local repositories and not remote repositories that are public.
Example Setup
Conan remote URL https://example-url.com/conan-remote
sources could exist at
https://example-url.com/source
https://example-url.com/differentsource
How to reproduce it
Commands
Behaviour without
source_credentials.json
example-remote-name
and set it up with the clientexample-remote-name
existsBehaviour with
source_credentials.json
example-remote-name
and set it up with the clientexample-remote-name
existssource_credentials.json
to the conan cache,$CONAN_HOME/source_credentials.json
:example-remote-name
Logs
When
source_credentials.json
is presentWhen
source_credentials.json
is not presentThe text was updated successfully, but these errors were encountered: