BigW Consortium Gitlab

Commit 553bac57 by Tomasz Maczukin

Add token to runner details output in API

parent dc32af95
...@@ -126,6 +126,7 @@ Example response: ...@@ -126,6 +126,7 @@ Example response:
"path": "gitlab-org/gitlab-ce" "path": "gitlab-org/gitlab-ce"
} }
], ],
"token": "205086a8e3b9a2b818ffac9b89d102",
"revision": null, "revision": null,
"tag_list": [ "tag_list": [
"ruby", "ruby",
......
...@@ -387,6 +387,7 @@ module API ...@@ -387,6 +387,7 @@ module API
expose :tag_list expose :tag_list
expose :version, :revision, :platform, :architecture expose :version, :revision, :platform, :architecture
expose :contacted_at, as: :last_contact expose :contacted_at, as: :last_contact
expose :token, if: lambda { |runner, options| options[:user_is_admin] || !runner.is_shared? }
expose :projects, with: Entities::RunnerProjectDetails expose :projects, with: Entities::RunnerProjectDetails
end end
......
...@@ -33,7 +33,7 @@ module API ...@@ -33,7 +33,7 @@ module API
runner = get_runner(params[:id]) runner = get_runner(params[:id])
can_show_runner?(runner) unless current_user.is_admin? can_show_runner?(runner) unless current_user.is_admin?
present runner, with: Entities::RunnerDetails present runner, with: Entities::RunnerDetails, user_is_admin: current_user.is_admin?
end end
# Update runner's details # Update runner's details
......
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