Move conan check credentials to shared endpoints
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
What does this MR do and why?
This mr moves the get credentials endpoint to the shared conan registry endpoints so it becomes available for v2. The change also adds a corresponding test for the conan v2 spec file.
References
How to set up and validate locally
Make sure you have a GitLab project that you can test with on your setup. Use the project id whenever you see <project_id> in the URLs below.
-
Switch the
conan_package_revisions_supportfeature flag on.For GDK, open rails console (docs):
gdk rails consoleEnable the feature flag:
# Enable Feature.enable(:conan_package_revisions_support) # Verify Feature.enabled?(:conan_package_revisions_support) -
Get Conan Authentication Token
First, generate a base64-encoded Basic Auth token:
# Replace with your username and PAT echo -n "USERNAME:glpat-YOUR-TOKEN"|base64Then use the output to get a Conan JWT token:
curl --request GET \ --url 'http://localhost:3000/api/v4/projects/<project_id>/packages/conan/v1/users/authenticate' \ --header 'Authorization: Basic <YOUR-BASE64-TOKEN>' -
Call the
get_credentialsendpointcurl --request GET \ --url http://127.0.0.1:3000/api/v4/projects/<project_id>/packages/conan/v2/users/check_credentials \ --header 'Authorization: Bearer <YOUR-CONAN-JWT-TOKEN>'that should return status
200 OKand bodyok
/cc @oceane_scania
Edited by 🤖 GitLab Bot 🤖