diff options
author | Imre Farkas <ifarkas@gitlab.com> | 2019-07-05 08:12:29 +0200 |
---|---|---|
committer | Imre Farkas <ifarkas@gitlab.com> | 2019-07-05 08:12:29 +0200 |
commit | b9b3ec83540a82fc96ddd64715a51d7adeb7312c (patch) | |
tree | ff2b48ab189d74ee5519db61914915de4455f14f /lib | |
parent | f845a081e336621e991587f88ee7d8ce6d012e21 (diff) | |
download | gitlab-ce-b9b3ec83540a82fc96ddd64715a51d7adeb7312c.tar.gz |
CE port of "Require session with smartcard login for Git access"
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/namespaced_session_store.rb | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/gitlab/namespaced_session_store.rb b/lib/gitlab/namespaced_session_store.rb index 34520078bfb..f0f24c081c3 100644 --- a/lib/gitlab/namespaced_session_store.rb +++ b/lib/gitlab/namespaced_session_store.rb @@ -4,19 +4,24 @@ module Gitlab class NamespacedSessionStore delegate :[], :[]=, to: :store - def initialize(key) + def initialize(key, session = Session.current) @key = key + @session = session end def initiated? - !Session.current.nil? + !session.nil? end def store - return unless Session.current + return unless session - Session.current[@key] ||= {} - Session.current[@key] + session[@key] ||= {} + session[@key] end + + private + + attr_reader :session end end |