Skip to content

Allow CI_JOB_TOKENs for Conan packages

Steve Abrams requested to merge 11678-conan-job-tokens into master

What does this MR do?

Allows users to work with Conan packages via CI. This means users can upload, install, and delete packages by using CI_JOB_TOKEN as their conan password.

How it works:

The addition of route_setting :authentication, job_token_allowed: true to the Conan endpoints allows find_user_from_job_token to be executed fully. This method, which lives in api_guard.rb is overwritten in conan_packages.rb in order to handle the special logic of parsing the JWT that the Conan client provides (we have no control over the fact that Conan provides a JWT, but we do control the payload). This overwritten method parses the incoming token, then finds the CI Job and it's user just as the original find_user_from_job_token method does.

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Closes #11678 (closed)

Edited by Steve Abrams

Merge request reports