Cargo Registry MVC: Implement config.json Endpoint
-
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.
This MR contains an API skeleton for cargo registry APIs. Cargo will use these APIs internally during cargo publish
and cargo install
. Refer to this discussion for more context: #33060 (comment 2308404360)
At this stage, I think this MR is more or less ready for a review. Thanks!
AI Generated Summary
This merge request adds support for Cargo package management to the project. It introduces a new package type called "cargo" and creates API endpoints for handling Cargo-related operations. The changes include:
- Adding a new enum value for cargo packages in the Package model.
- Creating a feature flag for the Cargo package manager.
- Mounting a new API endpoint for Cargo project packages.
- Implementing API routes for Cargo-specific operations, such as getting configuration, uploading new crates, downloading crates, and accessing the crate index.
These changes lay the groundwork for integrating Cargo package management into the existing package registry system, allowing users to work with Rust projects and dependencies within the platform.
Testing
curl -s --header "Authorization: Bearer \<personal-access-token\>" "http://gdk.test:3000/api/v4/projects/\<project_id\>/packages/cargo/config.json"
This should return the corresponding config.json
for the project.