Implement model registry authorize endpoint
What does this MR do and why?
Adds first endpoints for Ml Models package endpoints. Workhorse is necessary because files uploaded are up to 10gb. Authentication should behave in the same way as generic packages, ml model specific permissions will be added later (#412734 (closed)). This is part of merging the original POC for Model Registry (!106061 (diffs))
Steps to validate
-
Enable the feature flag
echo "Feature.enable(:model_registry)" | bundle exec rails c
-
Create an access token, and choose a project. Create a simple file:
echo 'blah' > blah.txt
-
Upload a file to
ml_models
. It should return{"message":"201 Created"}
with feature flag enabled,404
if feature flag disabled.curl --header "Authorization:$GLAB_TOKEN" --upload-file blah.txt "http://localhost:3000/api/v4/projects/$PROJECT_ID/packages/ml_models/blah2/1.1.0/blah.txt"
-
Navigate to Package registry of that project and verify that the model was uploaded
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #385043 (closed)