diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-08-30 21:38:22 +0300 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-09-15 20:21:00 +0300 |
commit | 48f1a61fd5c6aac395be0ce5d59aee61bbb69fe9 (patch) | |
tree | 1cc737a70838d527d2e089d938474057877f695f /lib/gitlab/lfs_token.rb | |
parent | cb85cf1f0a7047c485d7b29b2792b8965e270898 (diff) |
Refactored LFS auth logic when using SSH to use its own API endpoint `/lfs_authenticate` and added tests.
Diffstat (limited to 'lib/gitlab/lfs_token.rb')
-rw-r--r-- | lib/gitlab/lfs_token.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/gitlab/lfs_token.rb b/lib/gitlab/lfs_token.rb index 0685eb775ef..63656f0b4f1 100644 --- a/lib/gitlab/lfs_token.rb +++ b/lib/gitlab/lfs_token.rb @@ -6,15 +6,17 @@ module Gitlab @actor = actor end - def set_token + def generate token = Devise.friendly_token(50) + Gitlab::Redis.with do |redis| - redis.set(redis_key, token, ex: 3600) + redis.set(redis_key, token, ex: 600) end + token end - def get_value + def value Gitlab::Redis.with do |redis| redis.get(redis_key) end |