Commit 7b893669 authored by Max Woolf's avatar Max Woolf

Remove non-human created tokens from PAT list

Removes personal access tokens created by non-human
users from the list of personal access tokens
in the credentials inventory.

Project access tokens can be removed but must
be removed from the Project access tokens tab
instead as this also enqueues a job to remove
the bot user as well as the token.

EE: true
Changelog: changed
parent 34ded809
......@@ -37,7 +37,7 @@ RSpec.describe Admin::CredentialsController, type: :request do
specify do
get admin_credentials_path(filter: filter)
expect(assigns(:credentials)).to match_array([user.personal_access_tokens, project_access_token].flatten)
expect(assigns(:credentials)).to match_array([user.personal_access_tokens].flatten)
end
end
......
......@@ -37,7 +37,7 @@ RSpec.describe PersonalAccessToken do
let_it_be(:project_member) { create(:project_member, user: user) }
let_it_be(:project_access_token) { create(:personal_access_token, user: user) }
subject { described_class.not_project_access_token }
subject { described_class.owner_is_human }
it { is_expected.not_to include(project_access_token) }
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment