Skip to content

Move conan check credentials to shared endpoints

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.

  1. Switch the conan_package_revisions_support feature flag on.

    For GDK, open rails console (docs):

    gdk rails console

    Enable the feature flag:

    # Enable
    Feature.enable(:conan_package_revisions_support)
    
    # Verify
    Feature.enabled?(:conan_package_revisions_support)
  2. Get Conan Authentication Token

    First, generate a base64-encoded Basic Auth token:

    # Replace with your username and PAT
    echo -n "USERNAME:glpat-YOUR-TOKEN"|base64

    Then 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>'
  3. Call the get_credentials endpoint

    curl --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 OK and body ok

/cc @oceane_scania

Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading