gds-sso 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,14 @@
1
+ class AuthenticationsController < ApplicationController
2
+ before_filter :authenticate_user!, :only => :callback
3
+
4
+ def callback
5
+ redirect_to session["return_to"] || '/'
6
+ end
7
+
8
+ def sign_out
9
+ cookie_key = Rails.application.config.session_options[:key]
10
+ cookies.delete(cookie_key)
11
+ reset_session
12
+ redirect_to Plek.current.find('signonotron') + "/users/sign_out"
13
+ end
14
+ end
data/config/routes.rb ADDED
@@ -0,0 +1,4 @@
1
+ Rails.application.routes.draw do
2
+ match '/auth/gds/callback', to: 'authentications#callback', as: :gds_sign_in
3
+ match '/auth/gds/sign_out', to: 'authentications#sign_out', as: :gds_sign_out
4
+ end
@@ -21,7 +21,7 @@ module GDS
21
21
  mattr_accessor :basic_auth_password
22
22
  mattr_accessor :basic_auth_realm
23
23
  @@basic_auth_realm = "API Access"
24
-
24
+
25
25
  def self.user_klass
26
26
  user_model.to_s.constantize
27
27
  end
@@ -1,5 +1,5 @@
1
1
  module GDS
2
2
  module SSO
3
- VERSION = "0.4.0"
3
+ VERSION = "0.4.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gds-sso
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ date: 2012-01-17 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
17
- requirement: &70228864568980 !ruby/object:Gem::Requirement
17
+ requirement: &70114838714620 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 3.0.0
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70228864568980
25
+ version_requirements: *70114838714620
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: warden
28
- requirement: &70228864566860 !ruby/object:Gem::Requirement
28
+ requirement: &70114838713520 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - =
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 1.0.6
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *70228864566860
36
+ version_requirements: *70114838713520
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: oauth2
39
- requirement: &70228864564820 !ruby/object:Gem::Requirement
39
+ requirement: &70114838712840 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - =
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 0.4.1
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *70228864564820
47
+ version_requirements: *70114838712840
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: oa-oauth
50
- requirement: &70228864563740 !ruby/object:Gem::Requirement
50
+ requirement: &70114838712360 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - =
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: 0.2.6
56
56
  type: :runtime
57
57
  prerelease: false
58
- version_requirements: *70228864563740
58
+ version_requirements: *70114838712360
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: oa-core
61
- requirement: &70228864558980 !ruby/object:Gem::Requirement
61
+ requirement: &70114838708720 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - =
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: 0.2.6
67
67
  type: :runtime
68
68
  prerelease: false
69
- version_requirements: *70228864558980
69
+ version_requirements: *70114838708720
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rack-accept
72
- requirement: &70228864558480 !ruby/object:Gem::Requirement
72
+ requirement: &70114838707980 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ~>
@@ -77,10 +77,21 @@ dependencies:
77
77
  version: 0.4.4
78
78
  type: :runtime
79
79
  prerelease: false
80
- version_requirements: *70228864558480
80
+ version_requirements: *70114838707980
81
+ - !ruby/object:Gem::Dependency
82
+ name: plek
83
+ requirement: &70114838707400 !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ! '>='
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ type: :runtime
90
+ prerelease: false
91
+ version_requirements: *70114838707400
81
92
  - !ruby/object:Gem::Dependency
82
93
  name: rake
83
- requirement: &70228864558000 !ruby/object:Gem::Requirement
94
+ requirement: &70114838706180 !ruby/object:Gem::Requirement
84
95
  none: false
85
96
  requirements:
86
97
  - - ~>
@@ -88,10 +99,10 @@ dependencies:
88
99
  version: 0.9.2
89
100
  type: :development
90
101
  prerelease: false
91
- version_requirements: *70228864558000
102
+ version_requirements: *70114838706180
92
103
  - !ruby/object:Gem::Dependency
93
104
  name: mocha
94
- requirement: &70228864557420 !ruby/object:Gem::Requirement
105
+ requirement: &70114838704460 !ruby/object:Gem::Requirement
95
106
  none: false
96
107
  requirements:
97
108
  - - ~>
@@ -99,7 +110,7 @@ dependencies:
99
110
  version: 0.9.0
100
111
  type: :development
101
112
  prerelease: false
102
- version_requirements: *70228864557420
113
+ version_requirements: *70114838704460
103
114
  description: Client for GDS' OAuth 2-based SSO
104
115
  email:
105
116
  - matt@constituentparts.com
@@ -108,6 +119,8 @@ executables: []
108
119
  extensions: []
109
120
  extra_rdoc_files: []
110
121
  files:
122
+ - app/controllers/authentications_controller.rb
123
+ - config/routes.rb
111
124
  - lib/gds-sso/api_access.rb
112
125
  - lib/gds-sso/config.rb
113
126
  - lib/gds-sso/controller_methods.rb