Expired deploy token shows in deploy token api call
Summary
Group deploy token API is returning expired token.
Steps to reproduce
- Create multiple Group deploy token with various expire date
- See that all the token are listed in Web UI (https://gitlab.com/groups/{namespace}/-/settings/repository) as well as API call (https://gitlab.com/api/v4/groups/{groupID}/deploy_tokens) after creation
- After a deploy token expires, see that it is no longer listed in Web UI but the token shows up in API call
Example Project
(If possible, please create an example project here on GitLab.com that exhibits the problematic behavior, and link to it here in the bug report)
(If you are using an older version of GitLab, this will also determine whether the bug is fixed in a more recent version)
What is the current bug behavior?
Web UI is showing only active deploy token while deploy token API call include the expired token in the result.
What is the expected correct behavior?
Either the API return the same thing or there should be an API for active deploy token only.
Relevant logs and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's tough to read otherwise.)
Output of checks
This bug happens on GitLab.com; GitLab Enterprise Edition 13.3.0-pre 8c050582
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
(If you can, link to the line of code that might be responsible for the problem)