sso_client 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/sso_client/user.rb +17 -52
- data/lib/sso_client/engine.rb +1 -0
- data/lib/sso_client/version.rb +1 -1
- metadata +40 -29
@@ -1,61 +1,26 @@
|
|
1
1
|
module SsoClient
|
2
|
-
class User
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
User.new(omniauth['info']).tap do | user |
|
12
|
-
user.attributes = omniauth['extra']
|
13
|
-
user.id = omniauth['uid']
|
2
|
+
class User < ModestModel::Base
|
3
|
+
attributes :id, :name, :nickname, :email, :first_name, :last_name, :raw_info
|
4
|
+
|
5
|
+
class << self
|
6
|
+
def from_omniauth(omniauth)
|
7
|
+
User.new(omniauth['info']).tap do | user |
|
8
|
+
user.attributes = omniauth['extra']
|
9
|
+
user.id = omniauth['uid']
|
10
|
+
end
|
14
11
|
end
|
15
|
-
end
|
16
12
|
|
17
|
-
|
18
|
-
|
19
|
-
result[key] = read_attribute_for_validation(key)
|
20
|
-
result
|
13
|
+
def current
|
14
|
+
Thread.current[:user]
|
21
15
|
end
|
22
|
-
end
|
23
|
-
|
24
|
-
def attributes=(attrs)
|
25
|
-
attrs.each_pair {|k, v| send("#{k}=", v) if ATTRIBUTES.include? k.to_sym}
|
26
|
-
end
|
27
|
-
|
28
|
-
def read_attribute_for_validation(key)
|
29
|
-
send(key)
|
30
|
-
end
|
31
16
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
def self.current_id
|
37
|
-
current.id if current
|
38
|
-
end
|
39
|
-
|
40
|
-
def self.current=(user)
|
41
|
-
Thread.current[:user] = user
|
42
|
-
end
|
43
|
-
|
44
|
-
def new_record?
|
45
|
-
false
|
46
|
-
end
|
47
|
-
|
48
|
-
def destroyed?
|
49
|
-
false
|
50
|
-
end
|
51
|
-
|
52
|
-
def self.primary_key
|
53
|
-
'id'
|
54
|
-
end
|
17
|
+
def current_id
|
18
|
+
current.id if current
|
19
|
+
end
|
55
20
|
|
56
|
-
|
57
|
-
|
21
|
+
def current=(user)
|
22
|
+
Thread.current[:user] = user
|
23
|
+
end
|
58
24
|
end
|
59
|
-
|
60
25
|
end
|
61
26
|
end
|
data/lib/sso_client/engine.rb
CHANGED
data/lib/sso_client/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sso_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-12-09 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &6404820 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.1.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *6404820
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: configliere
|
27
|
-
requirement: &
|
27
|
+
requirement: &6402900 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *6402900
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: omniauth
|
38
|
-
requirement: &
|
38
|
+
requirement: &6401680 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.0.0
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *6401680
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: omniauth-oauth2
|
49
|
-
requirement: &
|
49
|
+
requirement: &6400200 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,21 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *6400200
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: openteam-modest_model
|
60
|
+
requirement: &6415020 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
type: :runtime
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *6415020
|
58
69
|
- !ruby/object:Gem::Dependency
|
59
70
|
name: fabrication
|
60
|
-
requirement: &
|
71
|
+
requirement: &6413700 !ruby/object:Gem::Requirement
|
61
72
|
none: false
|
62
73
|
requirements:
|
63
74
|
- - ! '>='
|
@@ -65,10 +76,10 @@ dependencies:
|
|
65
76
|
version: '0'
|
66
77
|
type: :development
|
67
78
|
prerelease: false
|
68
|
-
version_requirements: *
|
79
|
+
version_requirements: *6413700
|
69
80
|
- !ruby/object:Gem::Dependency
|
70
81
|
name: guard-rspec
|
71
|
-
requirement: &
|
82
|
+
requirement: &6412780 !ruby/object:Gem::Requirement
|
72
83
|
none: false
|
73
84
|
requirements:
|
74
85
|
- - ! '>='
|
@@ -76,10 +87,10 @@ dependencies:
|
|
76
87
|
version: '0'
|
77
88
|
type: :development
|
78
89
|
prerelease: false
|
79
|
-
version_requirements: *
|
90
|
+
version_requirements: *6412780
|
80
91
|
- !ruby/object:Gem::Dependency
|
81
92
|
name: guard-spork
|
82
|
-
requirement: &
|
93
|
+
requirement: &6411980 !ruby/object:Gem::Requirement
|
83
94
|
none: false
|
84
95
|
requirements:
|
85
96
|
- - ! '>='
|
@@ -87,10 +98,10 @@ dependencies:
|
|
87
98
|
version: '0'
|
88
99
|
type: :development
|
89
100
|
prerelease: false
|
90
|
-
version_requirements: *
|
101
|
+
version_requirements: *6411980
|
91
102
|
- !ruby/object:Gem::Dependency
|
92
103
|
name: libnotify
|
93
|
-
requirement: &
|
104
|
+
requirement: &6411080 !ruby/object:Gem::Requirement
|
94
105
|
none: false
|
95
106
|
requirements:
|
96
107
|
- - ! '>='
|
@@ -98,10 +109,10 @@ dependencies:
|
|
98
109
|
version: '0'
|
99
110
|
type: :development
|
100
111
|
prerelease: false
|
101
|
-
version_requirements: *
|
112
|
+
version_requirements: *6411080
|
102
113
|
- !ruby/object:Gem::Dependency
|
103
114
|
name: rb-inotify
|
104
|
-
requirement: &
|
115
|
+
requirement: &6410300 !ruby/object:Gem::Requirement
|
105
116
|
none: false
|
106
117
|
requirements:
|
107
118
|
- - ! '>='
|
@@ -109,10 +120,10 @@ dependencies:
|
|
109
120
|
version: '0'
|
110
121
|
type: :development
|
111
122
|
prerelease: false
|
112
|
-
version_requirements: *
|
123
|
+
version_requirements: *6410300
|
113
124
|
- !ruby/object:Gem::Dependency
|
114
125
|
name: rspec-rails
|
115
|
-
requirement: &
|
126
|
+
requirement: &6409040 !ruby/object:Gem::Requirement
|
116
127
|
none: false
|
117
128
|
requirements:
|
118
129
|
- - ~>
|
@@ -120,10 +131,10 @@ dependencies:
|
|
120
131
|
version: 2.6.0
|
121
132
|
type: :development
|
122
133
|
prerelease: false
|
123
|
-
version_requirements: *
|
134
|
+
version_requirements: *6409040
|
124
135
|
- !ruby/object:Gem::Dependency
|
125
136
|
name: shoulda-matchers
|
126
|
-
requirement: &
|
137
|
+
requirement: &6424460 !ruby/object:Gem::Requirement
|
127
138
|
none: false
|
128
139
|
requirements:
|
129
140
|
- - ! '>='
|
@@ -131,10 +142,10 @@ dependencies:
|
|
131
142
|
version: '0'
|
132
143
|
type: :development
|
133
144
|
prerelease: false
|
134
|
-
version_requirements: *
|
145
|
+
version_requirements: *6424460
|
135
146
|
- !ruby/object:Gem::Dependency
|
136
147
|
name: spork
|
137
|
-
requirement: &
|
148
|
+
requirement: &6423420 !ruby/object:Gem::Requirement
|
138
149
|
none: false
|
139
150
|
requirements:
|
140
151
|
- - ~>
|
@@ -142,10 +153,10 @@ dependencies:
|
|
142
153
|
version: 0.9.0.rc9
|
143
154
|
type: :development
|
144
155
|
prerelease: false
|
145
|
-
version_requirements: *
|
156
|
+
version_requirements: *6423420
|
146
157
|
- !ruby/object:Gem::Dependency
|
147
158
|
name: sqlite3
|
148
|
-
requirement: &
|
159
|
+
requirement: &6422700 !ruby/object:Gem::Requirement
|
149
160
|
none: false
|
150
161
|
requirements:
|
151
162
|
- - ! '>='
|
@@ -153,7 +164,7 @@ dependencies:
|
|
153
164
|
version: '0'
|
154
165
|
type: :development
|
155
166
|
prerelease: false
|
156
|
-
version_requirements: *
|
167
|
+
version_requirements: *6422700
|
157
168
|
description: Client gem for connecting to SSO server (http://github.com/openteam/sso_server)
|
158
169
|
email:
|
159
170
|
- lda@openteam.ru
|
@@ -192,7 +203,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
192
203
|
version: '0'
|
193
204
|
segments:
|
194
205
|
- 0
|
195
|
-
hash:
|
206
|
+
hash: -1458722114317611209
|
196
207
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
197
208
|
none: false
|
198
209
|
requirements:
|
@@ -201,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
201
212
|
version: '0'
|
202
213
|
segments:
|
203
214
|
- 0
|
204
|
-
hash:
|
215
|
+
hash: -1458722114317611209
|
205
216
|
requirements: []
|
206
217
|
rubyforge_project:
|
207
218
|
rubygems_version: 1.8.11
|