diff options
author | tduehr <tduehr@gmail.com> | 2015-11-11 22:25:31 -0600 |
---|---|---|
committer | tduehr <tduehr@gmail.com> | 2015-12-14 21:43:41 -0600 |
commit | 8e3f1fa629a61741282214b293c1bc9438aada59 (patch) | |
tree | 59b128b1297955f38e895be422c9362115fd13ef /lib | |
parent | 2b4a3bc524c0db3f6e4e3d2b2f34ec29e358b240 (diff) | |
download | gitlab-ce-8e3f1fa629a61741282214b293c1bc9438aada59.tar.gz |
add CAS authentication support
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/o_auth/session.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/gitlab/o_auth/session.rb b/lib/gitlab/o_auth/session.rb new file mode 100644 index 00000000000..f33bfd0bd0e --- /dev/null +++ b/lib/gitlab/o_auth/session.rb @@ -0,0 +1,17 @@ +module Gitlab + module OAuth + module Session + def self.create(provider, ticket) + Rails.cache.write("gitlab:#{provider}:#{ticket}", ticket, expires_in: Gitlab.config.omniauth.cas3.session_duration) + end + + def self.destroy(provider, ticket) + Rails.cache.delete("gitlab:#{provider}:#{ticket}") + end + + def self.valid?(provider, ticket) + Rails.cache.read("gitlab:#{provider}:#{ticket}").present? + end + end + end +end |