global_session 3.0.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/global_session.gemspec +11 -12
- data/lib/global_session.rb +11 -1
- data/lib/global_session/session.rb +4 -6
- data/lib/global_session/session/v1.rb +1 -1
- data/lib/global_session/session/v2.rb +1 -1
- data/lib/global_session/session/v3.rb +1 -1
- metadata +41 -43
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.
|
1
|
+
3.0.2
|
data/global_session.gemspec
CHANGED
@@ -4,14 +4,14 @@
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version = "3.0.
|
7
|
+
s.name = "global_session"
|
8
|
+
s.version = "3.0.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Tony Spataro"]
|
12
|
-
s.date =
|
13
|
-
s.description =
|
14
|
-
s.email =
|
12
|
+
s.date = "2013-12-19"
|
13
|
+
s.description = "This Rack middleware allows several web apps in an authentication domain to share session state, facilitating single sign-on in a distributed web app. It only provides session sharing and does not concern itself with authentication or replication of the user database."
|
14
|
+
s.email = "support@rightscale.com"
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE",
|
17
17
|
"README.rdoc"
|
@@ -44,20 +44,19 @@ Gem::Specification.new do |s|
|
|
44
44
|
"rails_generators/global_session_authority/USAGE",
|
45
45
|
"rails_generators/global_session_authority/global_session_authority_generator.rb"
|
46
46
|
]
|
47
|
-
s.homepage =
|
47
|
+
s.homepage = "https://github.com/rightscale/global_session"
|
48
48
|
s.licenses = ["MIT"]
|
49
49
|
s.require_paths = ["lib"]
|
50
|
-
s.rubygems_version =
|
51
|
-
s.summary =
|
50
|
+
s.rubygems_version = "1.8.15"
|
51
|
+
s.summary = "Secure single-domain session sharing plugin for Rack and Rails."
|
52
52
|
|
53
53
|
if s.respond_to? :specification_version then
|
54
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
55
54
|
s.specification_version = 3
|
56
55
|
|
57
56
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
58
57
|
s.add_runtime_dependency(%q<json>, ["~> 1.4"])
|
59
58
|
s.add_runtime_dependency(%q<rack-contrib>, ["~> 1.0"])
|
60
|
-
s.add_runtime_dependency(%q<right_support>, ["
|
59
|
+
s.add_runtime_dependency(%q<right_support>, ["< 3.0", ">= 2.8.2"])
|
61
60
|
s.add_runtime_dependency(%q<simple_uuid>, [">= 0.2.0"])
|
62
61
|
s.add_development_dependency(%q<cucumber>, ["~> 1.0"])
|
63
62
|
s.add_development_dependency(%q<debugger>, ["~> 1.5"])
|
@@ -72,7 +71,7 @@ Gem::Specification.new do |s|
|
|
72
71
|
else
|
73
72
|
s.add_dependency(%q<json>, ["~> 1.4"])
|
74
73
|
s.add_dependency(%q<rack-contrib>, ["~> 1.0"])
|
75
|
-
s.add_dependency(%q<right_support>, ["
|
74
|
+
s.add_dependency(%q<right_support>, ["< 3.0", ">= 2.8.2"])
|
76
75
|
s.add_dependency(%q<simple_uuid>, [">= 0.2.0"])
|
77
76
|
s.add_dependency(%q<cucumber>, ["~> 1.0"])
|
78
77
|
s.add_dependency(%q<debugger>, ["~> 1.5"])
|
@@ -88,7 +87,7 @@ Gem::Specification.new do |s|
|
|
88
87
|
else
|
89
88
|
s.add_dependency(%q<json>, ["~> 1.4"])
|
90
89
|
s.add_dependency(%q<rack-contrib>, ["~> 1.0"])
|
91
|
-
s.add_dependency(%q<right_support>, ["
|
90
|
+
s.add_dependency(%q<right_support>, ["< 3.0", ">= 2.8.2"])
|
92
91
|
s.add_dependency(%q<simple_uuid>, [">= 0.2.0"])
|
93
92
|
s.add_dependency(%q<cucumber>, ["~> 1.0"])
|
94
93
|
s.add_dependency(%q<debugger>, ["~> 1.5"])
|
data/lib/global_session.rb
CHANGED
@@ -46,7 +46,17 @@ module GlobalSession
|
|
46
46
|
# Indicates that a client submitted a request with a session cookie that could not
|
47
47
|
# be decoded or decompressed.
|
48
48
|
#
|
49
|
-
class MalformedCookie < ClientError
|
49
|
+
class MalformedCookie < ClientError
|
50
|
+
attr_reader :cookie
|
51
|
+
|
52
|
+
def initialize(message, cookie=nil)
|
53
|
+
if cookie.nil?
|
54
|
+
super(message)
|
55
|
+
else
|
56
|
+
super("(data[0..4]: '%s') - %s" % [cookie[0..4], message])
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
50
60
|
|
51
61
|
# Indicates that application code tried to put an unserializable object into the glboal
|
52
62
|
# session hash. Because the global session is serialized as JSON and not all Ruby types
|
@@ -34,18 +34,16 @@ module GlobalSession::Session
|
|
34
34
|
guess_version(cookie).new(directory, cookie)
|
35
35
|
end
|
36
36
|
|
37
|
-
private
|
38
|
-
|
39
37
|
def self.guess_version(cookie)
|
40
38
|
case cookie
|
41
|
-
when /^WzM/
|
39
|
+
when /^WzM/ # == "[3"
|
42
40
|
V3
|
43
|
-
when /^
|
41
|
+
when /^l9/ # == binary msgpack symbol for "beginning of array"
|
44
42
|
V2
|
45
|
-
when /^
|
43
|
+
when /^eN/ # == zlib-compressed form of "{"
|
46
44
|
V1
|
47
45
|
else
|
48
|
-
|
46
|
+
V1 # due to zlib compression, there might be corner cases with the eN prefix
|
49
47
|
end
|
50
48
|
end
|
51
49
|
end
|
@@ -220,7 +220,7 @@ module GlobalSession::Session
|
|
220
220
|
json = Zlib::Inflate.inflate(zbin)
|
221
221
|
hash = GlobalSession::Encoding::JSON.load(json)
|
222
222
|
rescue Exception => e
|
223
|
-
mc = GlobalSession::MalformedCookie.new("Caused by #{e.class.name}: #{e.message}")
|
223
|
+
mc = GlobalSession::MalformedCookie.new("Caused by #{e.class.name}: #{e.message}", cookie)
|
224
224
|
mc.set_backtrace(e.backtrace)
|
225
225
|
raise mc
|
226
226
|
end
|
@@ -237,7 +237,7 @@ module GlobalSession::Session
|
|
237
237
|
array = GlobalSession::Encoding::Msgpack.load(msgpack)
|
238
238
|
hash = attribute_array_to_hash(array)
|
239
239
|
rescue Exception => e
|
240
|
-
mc = GlobalSession::MalformedCookie.new("Caused by #{e.class.name}: #{e.message}")
|
240
|
+
mc = GlobalSession::MalformedCookie.new("Caused by #{e.class.name}: #{e.message}", cookie)
|
241
241
|
mc.set_backtrace(e.backtrace)
|
242
242
|
raise mc
|
243
243
|
end
|
@@ -253,7 +253,7 @@ module GlobalSession::Session
|
|
253
253
|
array, signature = self.class.decode_cookie(cookie)
|
254
254
|
hash = attribute_array_to_hash(array)
|
255
255
|
rescue Exception => e
|
256
|
-
mc = GlobalSession::MalformedCookie.new("Caused by #{e.class.name}: #{e.message}")
|
256
|
+
mc = GlobalSession::MalformedCookie.new("Caused by #{e.class.name}: #{e.message}", cookie)
|
257
257
|
mc.set_backtrace(e.backtrace)
|
258
258
|
raise mc
|
259
259
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: global_session
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 3
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 3.0.
|
9
|
+
- 2
|
10
|
+
version: 3.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tony Spataro
|
@@ -15,8 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-
|
19
|
-
default_executable:
|
18
|
+
date: 2013-12-19 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
@@ -29,10 +28,10 @@ dependencies:
|
|
29
28
|
- 1
|
30
29
|
- 4
|
31
30
|
version: "1.4"
|
32
|
-
requirement: *id001
|
33
31
|
type: :runtime
|
34
|
-
|
32
|
+
requirement: *id001
|
35
33
|
prerelease: false
|
34
|
+
name: json
|
36
35
|
- !ruby/object:Gem::Dependency
|
37
36
|
version_requirements: &id002 !ruby/object:Gem::Requirement
|
38
37
|
none: false
|
@@ -44,14 +43,21 @@ dependencies:
|
|
44
43
|
- 1
|
45
44
|
- 0
|
46
45
|
version: "1.0"
|
47
|
-
requirement: *id002
|
48
46
|
type: :runtime
|
49
|
-
|
47
|
+
requirement: *id002
|
50
48
|
prerelease: false
|
49
|
+
name: rack-contrib
|
51
50
|
- !ruby/object:Gem::Dependency
|
52
51
|
version_requirements: &id003 !ruby/object:Gem::Requirement
|
53
52
|
none: false
|
54
53
|
requirements:
|
54
|
+
- - <
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
hash: 7
|
57
|
+
segments:
|
58
|
+
- 3
|
59
|
+
- 0
|
60
|
+
version: "3.0"
|
55
61
|
- - ">="
|
56
62
|
- !ruby/object:Gem::Version
|
57
63
|
hash: 43
|
@@ -60,17 +66,10 @@ dependencies:
|
|
60
66
|
- 8
|
61
67
|
- 2
|
62
68
|
version: 2.8.2
|
63
|
-
- - <
|
64
|
-
- !ruby/object:Gem::Version
|
65
|
-
hash: 7
|
66
|
-
segments:
|
67
|
-
- 3
|
68
|
-
- 0
|
69
|
-
version: "3.0"
|
70
|
-
requirement: *id003
|
71
69
|
type: :runtime
|
72
|
-
|
70
|
+
requirement: *id003
|
73
71
|
prerelease: false
|
72
|
+
name: right_support
|
74
73
|
- !ruby/object:Gem::Dependency
|
75
74
|
version_requirements: &id004 !ruby/object:Gem::Requirement
|
76
75
|
none: false
|
@@ -83,10 +82,10 @@ dependencies:
|
|
83
82
|
- 2
|
84
83
|
- 0
|
85
84
|
version: 0.2.0
|
86
|
-
requirement: *id004
|
87
85
|
type: :runtime
|
88
|
-
|
86
|
+
requirement: *id004
|
89
87
|
prerelease: false
|
88
|
+
name: simple_uuid
|
90
89
|
- !ruby/object:Gem::Dependency
|
91
90
|
version_requirements: &id005 !ruby/object:Gem::Requirement
|
92
91
|
none: false
|
@@ -98,10 +97,10 @@ dependencies:
|
|
98
97
|
- 1
|
99
98
|
- 0
|
100
99
|
version: "1.0"
|
101
|
-
requirement: *id005
|
102
100
|
type: :development
|
103
|
-
|
101
|
+
requirement: *id005
|
104
102
|
prerelease: false
|
103
|
+
name: cucumber
|
105
104
|
- !ruby/object:Gem::Dependency
|
106
105
|
version_requirements: &id006 !ruby/object:Gem::Requirement
|
107
106
|
none: false
|
@@ -113,10 +112,10 @@ dependencies:
|
|
113
112
|
- 1
|
114
113
|
- 5
|
115
114
|
version: "1.5"
|
116
|
-
requirement: *id006
|
117
115
|
type: :development
|
118
|
-
|
116
|
+
requirement: *id006
|
119
117
|
prerelease: false
|
118
|
+
name: debugger
|
120
119
|
- !ruby/object:Gem::Dependency
|
121
120
|
version_requirements: &id007 !ruby/object:Gem::Requirement
|
122
121
|
none: false
|
@@ -128,10 +127,10 @@ dependencies:
|
|
128
127
|
- 0
|
129
128
|
- 8
|
130
129
|
version: "0.8"
|
131
|
-
requirement: *id007
|
132
130
|
type: :development
|
133
|
-
|
131
|
+
requirement: *id007
|
134
132
|
prerelease: false
|
133
|
+
name: flexmock
|
135
134
|
- !ruby/object:Gem::Dependency
|
136
135
|
version_requirements: &id008 !ruby/object:Gem::Requirement
|
137
136
|
none: false
|
@@ -142,10 +141,10 @@ dependencies:
|
|
142
141
|
segments:
|
143
142
|
- 0
|
144
143
|
version: "0"
|
145
|
-
requirement: *id008
|
146
144
|
type: :development
|
147
|
-
|
145
|
+
requirement: *id008
|
148
146
|
prerelease: false
|
147
|
+
name: httpclient
|
149
148
|
- !ruby/object:Gem::Dependency
|
150
149
|
version_requirements: &id009 !ruby/object:Gem::Requirement
|
151
150
|
none: false
|
@@ -158,10 +157,10 @@ dependencies:
|
|
158
157
|
- 8
|
159
158
|
- 3
|
160
159
|
version: 1.8.3
|
161
|
-
requirement: *id009
|
162
160
|
type: :development
|
163
|
-
|
161
|
+
requirement: *id009
|
164
162
|
prerelease: false
|
163
|
+
name: jeweler
|
165
164
|
- !ruby/object:Gem::Dependency
|
166
165
|
version_requirements: &id010 !ruby/object:Gem::Requirement
|
167
166
|
none: false
|
@@ -173,10 +172,10 @@ dependencies:
|
|
173
172
|
- 0
|
174
173
|
- 4
|
175
174
|
version: "0.4"
|
176
|
-
requirement: *id010
|
177
175
|
type: :development
|
178
|
-
|
176
|
+
requirement: *id010
|
179
177
|
prerelease: false
|
178
|
+
name: msgpack
|
180
179
|
- !ruby/object:Gem::Dependency
|
181
180
|
version_requirements: &id011 !ruby/object:Gem::Requirement
|
182
181
|
none: false
|
@@ -188,10 +187,10 @@ dependencies:
|
|
188
187
|
- 0
|
189
188
|
- 8
|
190
189
|
version: "0.8"
|
191
|
-
requirement: *id011
|
192
190
|
type: :development
|
193
|
-
|
191
|
+
requirement: *id011
|
194
192
|
prerelease: false
|
193
|
+
name: rake
|
195
194
|
- !ruby/object:Gem::Dependency
|
196
195
|
version_requirements: &id012 !ruby/object:Gem::Requirement
|
197
196
|
none: false
|
@@ -203,10 +202,10 @@ dependencies:
|
|
203
202
|
- 1
|
204
203
|
- 2
|
205
204
|
version: "1.2"
|
206
|
-
requirement: *id012
|
207
205
|
type: :development
|
208
|
-
|
206
|
+
requirement: *id012
|
209
207
|
prerelease: false
|
208
|
+
name: right_develop
|
210
209
|
- !ruby/object:Gem::Dependency
|
211
210
|
version_requirements: &id013 !ruby/object:Gem::Requirement
|
212
211
|
none: false
|
@@ -218,10 +217,10 @@ dependencies:
|
|
218
217
|
- 1
|
219
218
|
- 3
|
220
219
|
version: "1.3"
|
221
|
-
requirement: *id013
|
222
220
|
type: :development
|
223
|
-
|
221
|
+
requirement: *id013
|
224
222
|
prerelease: false
|
223
|
+
name: rspec
|
225
224
|
- !ruby/object:Gem::Dependency
|
226
225
|
version_requirements: &id014 !ruby/object:Gem::Requirement
|
227
226
|
none: false
|
@@ -233,10 +232,10 @@ dependencies:
|
|
233
232
|
- 0
|
234
233
|
- 10
|
235
234
|
version: "0.10"
|
236
|
-
requirement: *id014
|
237
235
|
type: :development
|
238
|
-
|
236
|
+
requirement: *id014
|
239
237
|
prerelease: false
|
238
|
+
name: ruby-debug
|
240
239
|
description: This Rack middleware allows several web apps in an authentication domain to share session state, facilitating single sign-on in a distributed web app. It only provides session sharing and does not concern itself with authentication or replication of the user database.
|
241
240
|
email: support@rightscale.com
|
242
241
|
executables: []
|
@@ -273,7 +272,6 @@ files:
|
|
273
272
|
- rails_generators/global_session/templates/global_session.yml.erb
|
274
273
|
- rails_generators/global_session_authority/USAGE
|
275
274
|
- rails_generators/global_session_authority/global_session_authority_generator.rb
|
276
|
-
has_rdoc: true
|
277
275
|
homepage: https://github.com/rightscale/global_session
|
278
276
|
licenses:
|
279
277
|
- MIT
|
@@ -303,7 +301,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
303
301
|
requirements: []
|
304
302
|
|
305
303
|
rubyforge_project:
|
306
|
-
rubygems_version: 1.
|
304
|
+
rubygems_version: 1.8.15
|
307
305
|
signing_key:
|
308
306
|
specification_version: 3
|
309
307
|
summary: Secure single-domain session sharing plugin for Rack and Rails.
|