diff options
author | Valery Sizov <valery@gitlab.com> | 2014-10-27 12:08:44 +0200 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2014-10-27 12:08:44 +0200 |
commit | 21e8f43af38e20bf99c3e47d01dac9c0f7de3404 (patch) | |
tree | 785cf4806f15c6e1fa4397eebfa5d9262fececca /lib/api/helpers.rb | |
parent | 477743a154e85c411e8a533980abce460b5669fc (diff) | |
parent | 6280b53f305e45d0e6c474dbcf684f0015aee385 (diff) | |
download | gitlab-ce-21e8f43af38e20bf99c3e47d01dac9c0f7de3404.tar.gz |
Merge branch 'master' into 7-4-stable
Conflicts:
CHANGELOG
VERSION
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r-- | lib/api/helpers.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index 3262884f6d3..027fb20ec46 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -67,6 +67,10 @@ module API unauthorized! unless current_user end + def authenticate_by_gitlab_shell_token! + unauthorized! unless secret_token == params['secret_token'] + end + def authenticated_as_admin! forbidden! unless current_user.is_admin? end @@ -193,5 +197,9 @@ module API abilities end end + + def secret_token + File.read(Rails.root.join('.gitlab_shell_secret')) + end end end |