Commit bbfc570a authored by andysoiron's avatar andysoiron

Cleanup API GET services endpoint

We used to return service password for admin users.
This has been removed as part of a security fix
and this commit removes some leftover of this feature
parent 7a5656b7
......@@ -115,7 +115,7 @@ module API
end
get ":id/services/:service_slug" do
service = user_project.find_or_initialize_service(params[:service_slug].underscore)
present service, with: Entities::ProjectService, include_passwords: current_user.admin?
present service, with: Entities::ProjectService
end
end
......
......@@ -4,7 +4,6 @@ require "spec_helper"
describe API::Services do
set(:user) { create(:user) }
set(:admin) { create(:admin) }
set(:user2) { create(:user) }
set(:project) do
......@@ -88,14 +87,7 @@ describe API::Services do
expect(response).to have_gitlab_http_status(401)
end
it "returns all properties of service #{service} when authenticated as admin" do
get api("/projects/#{project.id}/services/#{dashed_service}", admin)
expect(response).to have_gitlab_http_status(200)
expect(json_response['properties'].keys).to match_array(service_instance.api_field_names)
end
it "returns properties of service #{service} other than passwords when authenticated as project owner" do
it "returns all properties of service #{service}" do
get api("/projects/#{project.id}/services/#{dashed_service}", user)
expect(response).to have_gitlab_http_status(200)
......
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