diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-08-31 02:43:24 +0300 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-09-15 20:21:00 +0300 |
commit | c25630ee2c2804e351a2c3ae4fd9224434e4698a (patch) | |
tree | 7d183ef29da41a3c3b53790a2fc48402d1f4f397 /lib/gitlab/lfs_token.rb | |
parent | 48f1a61fd5c6aac395be0ce5d59aee61bbb69fe9 (diff) |
Refactored handling of the `LfsToken` and added functionality to it to simplify external code.
Diffstat (limited to 'lib/gitlab/lfs_token.rb')
-rw-r--r-- | lib/gitlab/lfs_token.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gitlab/lfs_token.rb b/lib/gitlab/lfs_token.rb index 63656f0b4f1..8f49deb4d03 100644 --- a/lib/gitlab/lfs_token.rb +++ b/lib/gitlab/lfs_token.rb @@ -22,6 +22,14 @@ module Gitlab end end + def type + actor.is_a?(User) ? :lfs_token : :lfs_deploy_token + end + + def actor_name + actor.is_a?(User) ? actor.username : "lfs-deploy-key-#{actor.id}" + end + private def redis_key |