Allow CI_JOB_TOKENs for Conan packages
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
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
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)