Commit 5660d1dd authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch '217105-remove-FF-hide_token_from_runners_api' into 'master'

Remove FF hide_token_from_runners_api

See merge request gitlab-org/gitlab!33947
parents 511c1b76 902ba374
---
title: Remove FF hide_token_from_runners_api
merge_request: 33947
author:
type: other
...@@ -11,13 +11,6 @@ module API ...@@ -11,13 +11,6 @@ module API
expose :version, :revision, :platform, :architecture expose :version, :revision, :platform, :architecture
expose :contacted_at expose :contacted_at
# Will be removed: https://gitlab.com/gitlab-org/gitlab/-/issues/217105
expose(:token, if: ->(runner, options) do
return false if ::Feature.enabled?(:hide_token_from_runners_api, default_enabled: true)
options[:current_user].admin? || !runner.instance_type?
end)
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
expose :projects, with: Entities::BasicProjectDetails do |runner, options| expose :projects, with: Entities::BasicProjectDetails do |runner, options|
if options[:current_user].admin? if options[:current_user].admin?
......
...@@ -326,32 +326,6 @@ describe API::Runners do ...@@ -326,32 +326,6 @@ describe API::Runners do
expect(response).to have_gitlab_http_status(:unauthorized) expect(response).to have_gitlab_http_status(:unauthorized)
end end
end end
context 'FF hide_token_from_runners_api is enabled' do
before do
stub_feature_flags(hide_token_from_runners_api: true)
end
it "does not return runner's token" do
get api("/runners/#{shared_runner.id}", admin)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response).not_to have_key('token')
end
end
context 'FF hide_token_from_runners_api is disabled' do
before do
stub_feature_flags(hide_token_from_runners_api: false)
end
it "returns runner's token" do
get api("/runners/#{shared_runner.id}", admin)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response).to have_key('token')
end
end
end end
describe 'PUT /runners/:id' do describe 'PUT /runners/:id' do
......
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