diff options
author | Ash McKenzie <amckenzie@gitlab.com> | 2018-07-26 18:51:29 +1000 |
---|---|---|
committer | Ash McKenzie <amckenzie@gitlab.com> | 2018-08-01 00:24:16 +1000 |
commit | 9853fe040288a8a4703cb5f53c000bafd79a2bd2 (patch) | |
tree | c9a70916783657bc31acaf068194e2407c1ce24e | |
parent | 45026fbd81d9036de4e5e557a999e45a2a8be4ac (diff) | |
download | gitlab-shell-9853fe040288a8a4703cb5f53c000bafd79a2bd2.tar.gz |
Tidy up GitlabAccess
* Rename actor to key_id
* protected to private
* Move attr_reader defintions under private
-rw-r--r-- | lib/gitlab_access.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/gitlab_access.rb b/lib/gitlab_access.rb index 37f79d4..8994789 100644 --- a/lib/gitlab_access.rb +++ b/lib/gitlab_access.rb @@ -7,25 +7,21 @@ require_relative 'gitlab_access_status' require_relative 'names_helper' require_relative 'gitlab_metrics' require_relative 'object_dirs_helper' -require 'json' class GitlabAccess include NamesHelper - attr_reader :config, :gl_repository, :repo_path, :changes, :protocol - - def initialize(gl_repository, repo_path, actor, changes, protocol) - @config = GitlabConfig.new + def initialize(gl_repository, repo_path, key_id, changes, protocol) @gl_repository = gl_repository @repo_path = repo_path.strip - @actor = actor + @key_id = key_id @changes = changes.lines @protocol = protocol end def exec status = GitlabMetrics.measure('check-access:git-receive-pack') do - api.check_access('git-receive-pack', @gl_repository, @repo_path, @actor, @changes, @protocol, env: ObjectDirsHelper.all_attributes.to_json) + api.check_access('git-receive-pack', @gl_repository, @repo_path, @key_id, @changes, @protocol, env: ObjectDirsHelper.all_attributes.to_json) end raise AccessDeniedError, status.message unless status.allowed? @@ -39,7 +35,9 @@ class GitlabAccess false end - protected + private + + attr_reader :gl_repository, :repo_path, :key_id, :changes, :protocol def api GitlabNet.new |