diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-12-15 00:28:55 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-12-15 00:28:55 +0800 |
commit | e485b3f6ad3c220655e4aa909d93bca7a4ae6afc (patch) | |
tree | 044bed77b311d0e23620015ad774c3627d1652ed /lib/ci/api/helpers.rb | |
parent | 278baa5b618c5595045415a55d863daf9a15d792 (diff) | |
download | gitlab-ce-e485b3f6ad3c220655e4aa909d93bca7a4ae6afc.tar.gz |
Give forbidden if project for the build was deleted
Closes #25309
Diffstat (limited to 'lib/ci/api/helpers.rb')
-rw-r--r-- | lib/ci/api/helpers.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/ci/api/helpers.rb b/lib/ci/api/helpers.rb index e608f5f6cad..0202b3cf8a3 100644 --- a/lib/ci/api/helpers.rb +++ b/lib/ci/api/helpers.rb @@ -13,8 +13,11 @@ module Ci forbidden! unless current_runner end - def authenticate_build_token!(build) - forbidden! unless build_token_valid?(build) + def authenticate_build!(build, verify_token: true) + not_found! unless build + forbidden! if verify_token && !build_token_valid?(build) + forbidden!('Project has been deleted!') unless build.project + forbidden!('Build has been erased!') if build.erased? end def runner_registration_token_valid? |