Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
902ba374
Commit
902ba374
authored
Jun 05, 2020
by
Furkan Ayhan
Committed by
Douglas Barbosa Alexandre
Jun 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove FF hide_token_from_runners_api
parent
cc9eff0e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
33 deletions
+5
-33
changelogs/unreleased/217105-remove-FF-hide_token_from_runners_api.yml
...released/217105-remove-FF-hide_token_from_runners_api.yml
+5
-0
lib/api/entities/runner_details.rb
lib/api/entities/runner_details.rb
+0
-7
spec/requests/api/runners_spec.rb
spec/requests/api/runners_spec.rb
+0
-26
No files found.
changelogs/unreleased/217105-remove-FF-hide_token_from_runners_api.yml
0 → 100644
View file @
902ba374
---
title
:
Remove FF hide_token_from_runners_api
merge_request
:
33947
author
:
type
:
other
lib/api/entities/runner_details.rb
View file @
902ba374
...
...
@@ -11,13 +11,6 @@ module API
expose
:version
,
:revision
,
:platform
,
:architecture
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
expose
:projects
,
with:
Entities
::
BasicProjectDetails
do
|
runner
,
options
|
if
options
[
:current_user
].
admin?
...
...
spec/requests/api/runners_spec.rb
View file @
902ba374
...
...
@@ -326,32 +326,6 @@ describe API::Runners do
expect
(
response
).
to
have_gitlab_http_status
(
:unauthorized
)
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
describe
'PUT /runners/:id'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment