diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-04 03:06:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-04 03:06:15 +0300 |
commit | e2334f3613aae1c0f5b99d908e1c51213bfd7635 (patch) | |
tree | 8fd02806b70ffe4d49633412bfa2c7b58304095c /lib/api/support/git_access_actor.rb | |
parent | 4529c19950e412f0461910585414f8633d3b1b18 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/support/git_access_actor.rb')
-rw-r--r-- | lib/api/support/git_access_actor.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/api/support/git_access_actor.rb b/lib/api/support/git_access_actor.rb index 2e0962c6295..cb9bf4472eb 100644 --- a/lib/api/support/git_access_actor.rb +++ b/lib/api/support/git_access_actor.rb @@ -3,7 +3,9 @@ module API module Support class GitAccessActor - attr_reader :user + extend ::Gitlab::Identifier + + attr_reader :user, :key def initialize(user: nil, key: nil) @user = user @@ -19,6 +21,10 @@ module API new(user: UserFinder.new(params[:user_id]).find_by_id) elsif params[:username] new(user: UserFinder.new(params[:username]).find_by_username) + elsif params[:identifier] + new(user: identify(params[:identifier])) + else + new end end @@ -33,10 +39,6 @@ module API def update_last_used_at! key&.update_last_used_at end - - private - - attr_reader :key end end end |