ruby-openid 2.4.0 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of ruby-openid might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9fbaf8c0eb91738a8f831057ca44c96803c50e46
4
- data.tar.gz: b8ba0a1278cb1f452734608ea079baf63e9772ac
3
+ metadata.gz: 3d186800e0c39656fbed4cbd52caa3e3f0bb9fc5
4
+ data.tar.gz: 8a971700503c5c287aa46f5c4c1804300f52a921
5
5
  SHA512:
6
- metadata.gz: dfad5f054b6b04f6d488584b2902aac70d10636ff9ba7c53140c61f7474dc6a463f771ce8a07c2cda0ae501a0a45db745b927427625407873ed35b22b2eb4572
7
- data.tar.gz: e4f5e210aceead1e8c7502304b4d45746daf600d0ac4ba2bd65133b446d6dcf0355d4f7a1a636289b4f5221beecf7ca5b7b8d3904862198fe895bcac197fd9e0
6
+ metadata.gz: aee76e05216b0b0954496c11d70b5df2c4a3cfe7c9f55aad74f1f1563f18891a6f7526859b695ace038556bb77ce33e152671547592a78591a8b4b1ff50d9fb2
7
+ data.tar.gz: 4eefe5dcdcbe9fcce8f3846c06e3e1841bd7b703bee34c2d46193eb6d32d17ef87bfe47fda605fa73090401317e5c7390de21f7206c09a288373c4ebf8f5948f
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.5.0
4
+
5
+ * Revert json serialization - 8dc60e553369df2300ebb4b83a29618aff643c2c
6
+ See https://github.com/openid/ruby-openid/pull/73
7
+
3
8
  ## 2.4.0
4
9
 
5
10
  * Allow expecting a parameter to be nil during return_to verification - 708e992ab3e6c26d478283fc11faa6a0a74bfec0
@@ -7,7 +7,6 @@ require "openid/consumer/discovery"
7
7
  require "openid/message"
8
8
  require "openid/yadis/discovery"
9
9
  require "openid/store/nonce"
10
- require "openid/serializer"
11
10
 
12
11
  module OpenID
13
12
  # OpenID support for Relying Parties (aka Consumers).
@@ -298,17 +297,11 @@ module OpenID
298
297
  protected
299
298
 
300
299
  def session_get(name)
301
- value = @session[session_key(name)]
302
-
303
- if value.is_a?(Array) # new serialized format
304
- Serializer.deserialize(*value)
305
- else # deprecated object format
306
- value
307
- end
300
+ @session[session_key(name)]
308
301
  end
309
302
 
310
303
  def session_set(name, val)
311
- @session[session_key(name)] = Serializer.serialize(val)
304
+ @session[session_key(name)] = val
312
305
  end
313
306
 
314
307
  def session_key(suffix)
@@ -58,7 +58,7 @@ module OpenID
58
58
  def display_identifier
59
59
  return @display_identifier if @display_identifier
60
60
 
61
- return @claimed_id if @claimed_id.nil?
61
+ return @claimed_id if @claimed_id.nil?
62
62
 
63
63
  begin
64
64
  parsed_identifier = URI.parse(@claimed_id)
@@ -376,7 +376,7 @@ module OpenID
376
376
  #
377
377
  # @param uri: normalized identity URL
378
378
  # @type uri: str
379
- #
379
+ #
380
380
  # @return: (claimed_id, services)
381
381
  # @rtype: (str, list(OpenIDServiceEndpoint))
382
382
  #
@@ -66,7 +66,7 @@ module OpenID
66
66
  if result.is_a? String
67
67
  return !!(result =~ /^STORED/)
68
68
  else
69
- return result == true
69
+ return !!(result)
70
70
  end
71
71
  end
72
72
 
@@ -1,3 +1,3 @@
1
1
  module OpenID
2
- VERSION = "2.4.0"
2
+ VERSION = "2.5.0"
3
3
  end
@@ -6,24 +6,14 @@ module OpenID
6
6
  class Consumer
7
7
  module TestConsumer
8
8
  class TestLastEndpoint < Test::Unit::TestCase
9
- def all_instance_variables(object)
10
- object.instance_variables.map { |v| [v.to_s, object.instance_variable_get(v)] }
11
- end
12
-
13
9
  def test_set_get
14
- stored = OpenID::OpenIDServiceEndpoint.new
15
- stored.server_url = "test"
16
10
  session = {}
17
-
18
11
  consumer = Consumer.new(session, nil)
19
- consumer.send(:last_requested_endpoint=, stored)
20
-
12
+ consumer.send(:last_requested_endpoint=, :endpoint)
21
13
  ep = consumer.send(:last_requested_endpoint)
22
- assert_equal(all_instance_variables(stored), all_instance_variables(ep))
23
-
14
+ assert_equal(:endpoint, ep)
24
15
  ep = consumer.send(:last_requested_endpoint)
25
- assert_equal(all_instance_variables(stored), all_instance_variables(ep))
26
-
16
+ assert_equal(:endpoint, ep)
27
17
  consumer.send(:cleanup_last_requested_endpoint)
28
18
  ep = consumer.send(:last_requested_endpoint)
29
19
  assert_equal(nil, ep)
@@ -120,7 +110,7 @@ module OpenID
120
110
  result = consumer.begin_without_discovery(@service, @anonymous)
121
111
  assert(result.instance_of?(CheckIDRequest))
122
112
  assert_equal(@anonymous, result.anonymous)
123
- assert_equal(@service.claimed_id, consumer.send(:last_requested_endpoint).claimed_id)
113
+ assert_equal(@service, consumer.send(:last_requested_endpoint))
124
114
  assert_equal(result.instance_variable_get(:@assoc), @assoc)
125
115
  return result
126
116
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-openid
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - JanRain, Inc
8
8
  autorequire: openid
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-27 00:00:00.000000000 Z
11
+ date: 2014-01-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: openid@janrain.com
@@ -115,7 +115,6 @@ files:
115
115
  - lib/openid/kvpost.rb
116
116
  - lib/openid/message.rb
117
117
  - lib/openid/protocolerror.rb
118
- - lib/openid/serializer.rb
119
118
  - lib/openid/server.rb
120
119
  - lib/openid/store/filesystem.rb
121
120
  - lib/openid/store/interface.rb
@@ -1,21 +0,0 @@
1
- module OpenID
2
- class Serializer
3
- SERIALIZABLE = {
4
- "OpenID::OpenIDServiceEndpoint" => [OpenID::OpenIDServiceEndpoint, 0],
5
- "OpenID::Consumer::DiscoveredServices" => [OpenID::Consumer::DiscoveredServices, 3]
6
- }
7
-
8
- def self.serialize(instance)
9
- klass = instance.class.name
10
- raise "unable to serialize #{klass}" unless SERIALIZABLE[klass]
11
- [klass, instance.instance_variables.map { |v| [v.to_s, instance.instance_variable_get(v)] }]
12
- end
13
-
14
- def self.deserialize(klass, data)
15
- klass, arguments = SERIALIZABLE[klass] || raise("unable to deserialize #{klass}")
16
- instance = klass.new(*Array.new(arguments))
17
- data.each { |k,v| instance.instance_variable_set(k,v) }
18
- instance
19
- end
20
- end
21
- end