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 ...@@ -115,7 +115,7 @@ module API
end end
get ":id/services/:service_slug" do get ":id/services/:service_slug" do
service = user_project.find_or_initialize_service(params[:service_slug].underscore) 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
end end
......
...@@ -4,7 +4,6 @@ require "spec_helper" ...@@ -4,7 +4,6 @@ require "spec_helper"
describe API::Services do describe API::Services do
set(:user) { create(:user) } set(:user) { create(:user) }
set(:admin) { create(:admin) }
set(:user2) { create(:user) } set(:user2) { create(:user) }
set(:project) do set(:project) do
...@@ -88,14 +87,7 @@ describe API::Services do ...@@ -88,14 +87,7 @@ describe API::Services do
expect(response).to have_gitlab_http_status(401) expect(response).to have_gitlab_http_status(401)
end end
it "returns all properties of service #{service} when authenticated as admin" do it "returns all properties of service #{service}" 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
get api("/projects/#{project.id}/services/#{dashed_service}", user) get api("/projects/#{project.id}/services/#{dashed_service}", user)
expect(response).to have_gitlab_http_status(200) 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