summaryrefslogtreecommitdiff
path: root/lib/ci/api/helpers.rb
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2017-03-31 13:56:27 +0200
committerYorick Peterse <yorickpeterse@gmail.com>2017-03-31 13:56:53 +0200
commitd2283f4f0e98b86800ba6a222593647e4991375d (patch)
treeecdc3040ce46957b28a4a8f9343afeec0751604b /lib/ci/api/helpers.rb
parent53b21c1e8e27a284a8691a73276204a85694eeb8 (diff)
downloadgitlab-ce-d2283f4f0e98b86800ba6a222593647e4991375d.tar.gz
Backport API changes needed to fix sticking in EEbackport-sticking-api-helper-changes
These changes are ported over from https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1502 to reduce the number of merge conflicts that may occur.
Diffstat (limited to 'lib/ci/api/helpers.rb')
-rw-r--r--lib/ci/api/helpers.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/ci/api/helpers.rb b/lib/ci/api/helpers.rb
index 996990b464f..5109dc9670f 100644
--- a/lib/ci/api/helpers.rb
+++ b/lib/ci/api/helpers.rb
@@ -13,10 +13,14 @@ module Ci
forbidden! unless current_runner
end
- def authenticate_build!(build)
+ def authenticate_build!
+ build = Ci::Build.find_by_id(params[:id])
+
validate_build!(build) do
forbidden! unless build_token_valid?(build)
end
+
+ build
end
def validate_build!(build)