diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-09-15 14:49:11 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-09-15 14:49:11 +0300 |
commit | 9d1ccd2ad3af37139649100476b568d219343a57 (patch) | |
tree | 4475c8f777e25a3a7708ed7012f190b844fdaa7c /lib | |
parent | 50076ab974348e74514bb4f19169351f08e11636 (diff) |
Fix existing authorization specs
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/internal.rb | 18 | ||||
-rw-r--r-- | lib/gitlab/auth.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/git_access.rb | 2 |
3 files changed, 10 insertions, 12 deletions
diff --git a/lib/api/internal.rb b/lib/api/internal.rb index 2ec94570506..2610fd329d6 100644 --- a/lib/api/internal.rb +++ b/lib/api/internal.rb @@ -35,6 +35,14 @@ module API Project.find_with_namespace(project_path) end end + + def ssh_capabilities + [ + :read_project, + :download_code, + :push_code + ] + end end post "/allowed" do @@ -130,16 +138,6 @@ module API { success: true, recovery_codes: codes } end - - private - - def ssh_capabilities - [ - :read_project, - :download_code, - :push_code - ] - end end end end diff --git a/lib/gitlab/auth.rb b/lib/gitlab/auth.rb index 7af9bb9a326..666cf1b3e26 100644 --- a/lib/gitlab/auth.rb +++ b/lib/gitlab/auth.rb @@ -115,7 +115,7 @@ module Gitlab return unless login == 'gitlab-ci-token' return unless password - build = Ci::Build.running.find_by_token(password) + build = ::Ci::Build.running.find_by_token(password) return unless build if build.user diff --git a/lib/gitlab/git_access.rb b/lib/gitlab/git_access.rb index 63b707db814..21286e77dc6 100644 --- a/lib/gitlab/git_access.rb +++ b/lib/gitlab/git_access.rb @@ -7,7 +7,7 @@ module Gitlab attr_reader :actor, :project, :protocol, :user_access, :capabilities - def initialize(actor, project, protocol, capabilities: capabilities) + def initialize(actor, project, protocol, capabilities:) @actor = actor @project = project @protocol = protocol |