Commit c2437be5 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'dz-update-grape' into 'master'

Update grape gem

See merge request !12992
parents 1733090a 6b8ad689
...@@ -71,7 +71,7 @@ gem 'gollum-rugged_adapter', '~> 0.4.4', require: false ...@@ -71,7 +71,7 @@ gem 'gollum-rugged_adapter', '~> 0.4.4', require: false
gem 'github-linguist', '~> 4.7.0', require: 'linguist' gem 'github-linguist', '~> 4.7.0', require: 'linguist'
# API # API
gem 'grape', '~> 0.19.0' gem 'grape', '~> 0.19.2'
gem 'grape-entity', '~> 0.6.0' gem 'grape-entity', '~> 0.6.0'
gem 'rack-cors', '~> 0.4.0', require: 'rack/cors' gem 'rack-cors', '~> 0.4.0', require: 'rack/cors'
......
...@@ -332,13 +332,13 @@ GEM ...@@ -332,13 +332,13 @@ GEM
multi_json (~> 1.11) multi_json (~> 1.11)
os (~> 0.9) os (~> 0.9)
signet (~> 0.7) signet (~> 0.7)
grape (0.19.1) grape (0.19.2)
activesupport activesupport
builder builder
hashie (>= 2.1.0) hashie (>= 2.1.0)
multi_json (>= 1.3.2) multi_json (>= 1.3.2)
multi_xml (>= 0.5.2) multi_xml (>= 0.5.2)
mustermann-grape (~> 0.4.0) mustermann-grape (~> 1.0.0)
rack (>= 1.3.0) rack (>= 1.3.0)
rack-accept rack-accept
virtus (>= 1.0.0) virtus (>= 1.0.0)
...@@ -463,10 +463,9 @@ GEM ...@@ -463,10 +463,9 @@ GEM
multi_json (1.12.1) multi_json (1.12.1)
multi_xml (0.6.0) multi_xml (0.6.0)
multipart-post (2.0.0) multipart-post (2.0.0)
mustermann (0.4.0) mustermann (1.0.0)
tool (~> 0.2) mustermann-grape (1.0.0)
mustermann-grape (0.4.0) mustermann (~> 1.0.0)
mustermann (= 0.4.0)
mysql2 (0.4.5) mysql2 (0.4.5)
net-ldap (0.12.1) net-ldap (0.12.1)
netrc (0.11.0) netrc (0.11.0)
...@@ -850,7 +849,6 @@ GEM ...@@ -850,7 +849,6 @@ GEM
timfel-krb5-auth (0.8.3) timfel-krb5-auth (0.8.3)
toml-rb (0.3.15) toml-rb (0.3.15)
citrus (~> 3.0, > 3.0) citrus (~> 3.0, > 3.0)
tool (0.2.3)
truncato (0.7.8) truncato (0.7.8)
htmlentities (~> 4.3.1) htmlentities (~> 4.3.1)
nokogiri (~> 1.6.1) nokogiri (~> 1.6.1)
...@@ -981,7 +979,7 @@ DEPENDENCIES ...@@ -981,7 +979,7 @@ DEPENDENCIES
gollum-rugged_adapter (~> 0.4.4) gollum-rugged_adapter (~> 0.4.4)
gon (~> 6.1.0) gon (~> 6.1.0)
google-api-client (~> 0.8.6) google-api-client (~> 0.8.6)
grape (~> 0.19.0) grape (~> 0.19.2)
grape-entity (~> 0.6.0) grape-entity (~> 0.6.0)
haml_lint (~> 0.21.0) haml_lint (~> 0.21.0)
hamlit (~> 2.6.1) hamlit (~> 2.6.1)
......
...@@ -68,6 +68,7 @@ module API ...@@ -68,6 +68,7 @@ module API
delete ":id/access_requests/:user_id" do delete ":id/access_requests/:user_id" do
source = find_source(source_type, params[:id]) source = find_source(source_type, params[:id])
status 204
::Members::DestroyService.new(source, current_user, params) ::Members::DestroyService.new(source, current_user, params)
.execute(:requesters) .execute(:requesters)
end end
......
...@@ -88,6 +88,7 @@ module API ...@@ -88,6 +88,7 @@ module API
unauthorized! unless award.user == current_user || current_user.admin? unauthorized! unless award.user == current_user || current_user.admin?
status 204
award.destroy award.destroy
end end
end end
......
...@@ -91,6 +91,7 @@ module API ...@@ -91,6 +91,7 @@ module API
delete ':id' do delete ':id' do
message = find_message message = find_message
status 204
message.destroy message.destroy
end end
end end
......
...@@ -125,6 +125,7 @@ module API ...@@ -125,6 +125,7 @@ module API
key = user_project.deploy_keys_projects.find_by(deploy_key_id: params[:key_id]) key = user_project.deploy_keys_projects.find_by(deploy_key_id: params[:key_id])
not_found!('Deploy Key') unless key not_found!('Deploy Key') unless key
status 204
key.destroy key.destroy
end end
end end
......
...@@ -79,6 +79,7 @@ module API ...@@ -79,6 +79,7 @@ module API
environment = user_project.environments.find(params[:environment_id]) environment = user_project.environments.find(params[:environment_id])
status 204
environment.destroy environment.destroy
end end
......
...@@ -125,6 +125,8 @@ module API ...@@ -125,6 +125,8 @@ module API
delete ":id" do delete ":id" do
group = find_group!(params[:id]) group = find_group!(params[:id])
authorize! :admin_group, group authorize! :admin_group, group
status 204
::Groups::DestroyService.new(group, current_user).execute ::Groups::DestroyService.new(group, current_user).execute
end end
......
...@@ -224,6 +224,7 @@ module API ...@@ -224,6 +224,7 @@ module API
not_found!('Issue') unless issue not_found!('Issue') unless issue
authorize!(:destroy_issue, issue) authorize!(:destroy_issue, issue)
status 204
issue.destroy issue.destroy
end end
......
...@@ -56,6 +56,7 @@ module API ...@@ -56,6 +56,7 @@ module API
label = user_project.labels.find_by(title: params[:name]) label = user_project.labels.find_by(title: params[:name])
not_found!('Label') unless label not_found!('Label') unless label
status 204
label.destroy label.destroy
end end
......
...@@ -96,6 +96,7 @@ module API ...@@ -96,6 +96,7 @@ module API
# Ensure that memeber exists # Ensure that memeber exists
source.members.find_by!(user_id: params[:user_id]) source.members.find_by!(user_id: params[:user_id])
status 204
::Members::DestroyService.new(source, current_user, declared_params).execute ::Members::DestroyService.new(source, current_user, declared_params).execute
end end
end end
......
...@@ -137,6 +137,7 @@ module API ...@@ -137,6 +137,7 @@ module API
merge_request = find_project_merge_request(params[:merge_request_iid]) merge_request = find_project_merge_request(params[:merge_request_iid])
authorize!(:destroy_merge_request, merge_request) authorize!(:destroy_merge_request, merge_request)
status 204
merge_request.destroy merge_request.destroy
end end
......
...@@ -131,6 +131,7 @@ module API ...@@ -131,6 +131,7 @@ module API
note = user_project.notes.find(params[:note_id]) note = user_project.notes.find(params[:note_id])
authorize! :admin_note, note authorize! :admin_note, note
status 204
::Notes::DestroyService.new(user_project, current_user).execute(note) ::Notes::DestroyService.new(user_project, current_user).execute(note)
end end
end end
......
...@@ -96,6 +96,7 @@ module API ...@@ -96,6 +96,7 @@ module API
delete ":id/hooks/:hook_id" do delete ":id/hooks/:hook_id" do
hook = user_project.hooks.find(params.delete(:hook_id)) hook = user_project.hooks.find(params.delete(:hook_id))
status 204
hook.destroy hook.destroy
end end
end end
......
...@@ -116,6 +116,7 @@ module API ...@@ -116,6 +116,7 @@ module API
not_found!('Snippet') unless snippet not_found!('Snippet') unless snippet
authorize! :admin_project_snippet, snippet authorize! :admin_project_snippet, snippet
status 204
snippet.destroy snippet.destroy
end end
......
...@@ -361,6 +361,7 @@ module API ...@@ -361,6 +361,7 @@ module API
authorize! :remove_fork_project, user_project authorize! :remove_fork_project, user_project
if user_project.forked? if user_project.forked?
status 204
user_project.forked_project_link.destroy user_project.forked_project_link.destroy
else else
not_modified! not_modified!
...@@ -405,6 +406,7 @@ module API ...@@ -405,6 +406,7 @@ module API
link = user_project.project_group_links.find_by(group_id: params[:group_id]) link = user_project.project_group_links.find_by(group_id: params[:group_id])
not_found!('Group Link') unless link not_found!('Group Link') unless link
status 204
link.destroy link.destroy
end end
......
...@@ -45,6 +45,7 @@ module API ...@@ -45,6 +45,7 @@ module API
end end
delete '/' do delete '/' do
authenticate_runner! authenticate_runner!
status 204
Ci::Runner.find_by_token(params[:token]).destroy Ci::Runner.find_by_token(params[:token]).destroy
end end
......
...@@ -79,6 +79,7 @@ module API ...@@ -79,6 +79,7 @@ module API
runner = get_runner(params[:id]) runner = get_runner(params[:id])
authenticate_delete_runner!(runner) authenticate_delete_runner!(runner)
status 204
runner.destroy! runner.destroy!
end end
end end
...@@ -134,6 +135,7 @@ module API ...@@ -134,6 +135,7 @@ module API
runner = runner_project.runner runner = runner_project.runner
forbidden!("Only one project associated with the runner. Please remove the runner instead") if runner.projects.count == 1 forbidden!("Only one project associated with the runner. Please remove the runner instead") if runner.projects.count == 1
status 204
runner_project.destroy runner_project.destroy
end end
end end
......
...@@ -123,6 +123,7 @@ module API ...@@ -123,6 +123,7 @@ module API
authorize! :destroy_personal_snippet, snippet authorize! :destroy_personal_snippet, snippet
status 204
snippet.destroy snippet.destroy
end end
......
...@@ -66,6 +66,7 @@ module API ...@@ -66,6 +66,7 @@ module API
hook = SystemHook.find_by(id: params[:id]) hook = SystemHook.find_by(id: params[:id])
not_found!('System hook') unless hook not_found!('System hook') unless hook
status 204
hook.destroy hook.destroy
end end
end end
......
...@@ -142,6 +142,7 @@ module API ...@@ -142,6 +142,7 @@ module API
trigger = user_project.triggers.find(params.delete(:trigger_id)) trigger = user_project.triggers.find(params.delete(:trigger_id))
return not_found!('Trigger') unless trigger return not_found!('Trigger') unless trigger
status 204
trigger.destroy trigger.destroy
end end
end end
......
...@@ -235,6 +235,7 @@ module API ...@@ -235,6 +235,7 @@ module API
key = user.keys.find_by(id: params[:key_id]) key = user.keys.find_by(id: params[:key_id])
not_found!('Key') unless key not_found!('Key') unless key
status 204
key.destroy key.destroy
end end
...@@ -306,6 +307,7 @@ module API ...@@ -306,6 +307,7 @@ module API
user = User.find_by(id: params[:id]) user = User.find_by(id: params[:id])
not_found!('User') unless user not_found!('User') unless user
status 204
user.delete_async(deleted_by: current_user, params: params) user.delete_async(deleted_by: current_user, params: params)
end end
...@@ -406,6 +408,7 @@ module API ...@@ -406,6 +408,7 @@ module API
requires :impersonation_token_id, type: Integer, desc: 'The ID of the impersonation token' requires :impersonation_token_id, type: Integer, desc: 'The ID of the impersonation token'
end end
delete ':impersonation_token_id' do delete ':impersonation_token_id' do
status 204
find_impersonation_token.revoke! find_impersonation_token.revoke!
end end
end end
...@@ -483,6 +486,7 @@ module API ...@@ -483,6 +486,7 @@ module API
key = current_user.keys.find_by(id: params[:key_id]) key = current_user.keys.find_by(id: params[:key_id])
not_found!('Key') unless key not_found!('Key') unless key
status 204
key.destroy key.destroy
end end
...@@ -534,6 +538,7 @@ module API ...@@ -534,6 +538,7 @@ module API
email = current_user.emails.find_by(id: params[:email_id]) email = current_user.emails.find_by(id: params[:email_id])
not_found!('Email') unless email not_found!('Email') unless email
status 204
Emails::DestroyService.new(current_user, email: email.email).execute Emails::DestroyService.new(current_user, email: email.email).execute
end end
......
...@@ -88,6 +88,7 @@ module API ...@@ -88,6 +88,7 @@ module API
variable = user_project.variables.find_by(key: params[:key]) variable = user_project.variables.find_by(key: params[:key])
not_found!('Variable') unless variable not_found!('Variable') unless variable
status 204
variable.destroy variable.destroy
end end
end end
......
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