Skip to content

Admins unable to enable personal access tokens after disabling via API

Summary

As an admin, after disabling personal access tokens via the Application Settings API, there is no method to revert this change.

Steps to reproduce

As an admin:

  1. Create a personal access token
  2. Disable personal access tokens instance-wide with a PUT request:
curl --request PUT --header "PRIVATE-TOKEN: <REDACTED>" https://REDACTED/api/v4/application/settings?disable_personal_access_tokens=true

Example Project

What is the current bug behavior?

After disabling personal access tokens instance-wide, admins have no method re-enable them.

What is the expected correct behavior?

Admins should have the ability to re-enable personal access tokens via a Rake task.

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

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)

Workaround

Edited by Segolene Bouly