diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-09-08 20:32:20 +0300 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-09-15 20:21:00 +0300 |
commit | de24075ea5960bd7c6290c05496915e8f0ca23f2 (patch) | |
tree | f01d91d100ce58ee8b5df3a566a1c26ede236fea /lib/gitlab/lfs_token.rb | |
parent | 71aff7f6a3ab63f1395bfab6ea49f0175fe08167 (diff) |
Further refactoring of authentication code, and code style fixes.
Diffstat (limited to 'lib/gitlab/lfs_token.rb')
-rw-r--r-- | lib/gitlab/lfs_token.rb | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/lib/gitlab/lfs_token.rb b/lib/gitlab/lfs_token.rb index edf4dffc4c0..224e4516074 100644 --- a/lib/gitlab/lfs_token.rb +++ b/lib/gitlab/lfs_token.rb @@ -6,7 +6,15 @@ module Gitlab EXPIRY_TIME = 1800 def initialize(actor) - set_actor(actor) + @actor = + case actor + when DeployKey, User + actor + when Key + actor.user + else + # + end end def generate @@ -38,17 +46,5 @@ module Gitlab def redis_key "gitlab:lfs_token:#{actor.class.name.underscore}_#{actor.id}" if actor end - - def set_actor(actor) - @actor = - case actor - when DeployKey, User - actor - when Key - actor.user - else - # - end - end end end |