403 for /project variables endpoint for archived projects
Summary
/project/#/variables endpoint returns a 403 for archived projects.
https://docs.gitlab.com/ee/api/project_level_variables.html#list-project-variables
Archiving makes a project read only. Using GET on the variables endpoint on a project should return the expected values as documented in the page above. However, 403 is returned when a project is archived instead.
Steps to reproduce
- Archive a project
- Try
GET /projects/:id/variablesorGET /projects/:id/variables/:keyendpoints with the correct access token. - Return is
{"message":"403 Forbidden"}
What is the current bug behavior?
403 is returned
What is the expected correct behavior?
Return project CICD variables on archived project.
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
Gitlab saas
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)(we will only investigate if the tests are passing)
Possible fixes
Edited by 🤖 GitLab Bot 🤖