summaryrefslogtreecommitdiff
path: root/lib/gitlab/lfs_token.rb
diff options
context:
space:
mode:
authorPatricio Cano <suprnova32@gmail.com>2016-09-08 12:32:20 -0500
committerPatricio Cano <suprnova32@gmail.com>2016-09-15 12:21:00 -0500
commitde24075ea5960bd7c6290c05496915e8f0ca23f2 (patch)
treef01d91d100ce58ee8b5df3a566a1c26ede236fea /lib/gitlab/lfs_token.rb
parent71aff7f6a3ab63f1395bfab6ea49f0175fe08167 (diff)
downloadgitlab-ce-de24075ea5960bd7c6290c05496915e8f0ca23f2.tar.gz
Further refactoring of authentication code, and code style fixes.
Diffstat (limited to 'lib/gitlab/lfs_token.rb')
-rw-r--r--lib/gitlab/lfs_token.rb22
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