ruby-openid 2.8.0 → 2.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a5ee8f497521f63d02ab2ad5f69acb23e89c24dbb7209ce1a8c00f027352e75d
4
- data.tar.gz: 032d7f7ec7372a6fa8b8003e7ff7f96d635031ad2fc30a8fb6d93c48dee10a22
3
+ metadata.gz: 7465441df37cfb953da9ceb646fe4ba1cfb1958c0eb9a127d842684dff2f3c95
4
+ data.tar.gz: 7feca6b108738a3fb06a290bf601bbc522d7d78e2fe08523b6eaa7e10c6007b5
5
5
  SHA512:
6
- metadata.gz: d972e6fb2fc9195856e1e58118baa7c2e3cef606b3625eb1d857fa2ccdd39877038edfe3ddf97ecbecb7e3fcf7fb19b829bcb98e1d43909602334f596db674a9
7
- data.tar.gz: 1bc853ce02c3ff490d494fc8db60f299cefda2f02cfc2e7cd237e3e0667211ba2fe3f07f16d6a9002b0ad5d946d4c13247e31cf3ff4f88f1cb6efbaf8cc90926
6
+ metadata.gz: 3ffc84d0d6996c9ef5cda1686f80bf9c960b7c4eb3502fc0fd8c6f7a16caccae264d26fd030ffdec4e211695e962e452cecd3714c45924f8b5a678f54e97df14
7
+ data.tar.gz: d6507a131701f005f42a64816392661c9b9f73a457d1a802f217dd40922bcaf9b46f6dce73e4436b8c7cb8af5180d2e295df25e2ca1d2efc60f8ddf84ab1f1b3
@@ -1,10 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.9.1
4
+
5
+ * Updated CHANGELOG.md
6
+
7
+ ## 2.9.0
8
+
9
+ * Remove deprecated `autorequire` from gemspec.
10
+ [#123](https://github.com/openid/ruby-openid/pull/123)
11
+ * Rescue from `Yadis::XRI::XRIHTTPError` on discovery.
12
+ [#106](https://github.com/openid/ruby-openid/pull/106)
13
+ * Avoid SSRF for claimed_id request.
14
+ [#121](https://github.com/openid/ruby-openid/pull/121)
15
+ * Updated documentation.
16
+ [#115](https://github.com/openid/ruby-openid/pull/115), [#116](https://github.com/openid/ruby-openid/pull/116), [#117](https://github.com/openid/ruby-openid/pull/117), [#118](https://github.com/openid/ruby-openid/pull/118)
17
+ * Reduce warnings output in test runs.
18
+ [#119](https://github.com/openid/ruby-openid/pull/119)
19
+ * Drop deprecated option from gemspec.
20
+ [#120](https://github.com/openid/ruby-openid/pull/120)
21
+ * Remove circular require.
22
+ [#113](https://github.com/openid/ruby-openid/pull/113)
23
+ * Updated Travis CI config with Ruby 2.6
24
+ [#114](https://github.com/openid/ruby-openid/pull/114)
25
+ * Simplify Bundler require; remove need for extra `:require`.
26
+ [#112](https://github.com/openid/ruby-openid/pull/112)
27
+
3
28
  ## 2.8.0
4
29
 
5
30
  * Fix `admin/mkassoc` script.
6
31
  See https://github.com/openid/ruby-openid/pull/103
7
- * Allow spcifying timeout for `OpenID::StandardFetcher` in environment variables.
32
+ * Allow specifying timeout for `OpenID::StandardFetcher` in environment variables.
8
33
  See https://github.com/openid/ruby-openid/pull/109
9
34
  * Fixed some documentation.
10
35
  See https://github.com/openid/ruby-openid/pull/111
data/INSTALL.md CHANGED
@@ -1,21 +1,23 @@
1
1
  # Ruby OpenID Library Installation
2
2
 
3
- ## Rubygems Installation
3
+ ## Install as a gem
4
4
 
5
- Rubygems is a tool for installing ruby libraries and their
6
- dependancies. If you have rubygems installed, simply:
5
+ `ruby-openid` is distributed on [RubyGems](https://rubygems.org/).
6
+ Install it:
7
7
 
8
8
  gem install ruby-openid
9
9
 
10
+ This is probably what you need.
11
+
10
12
  ## Manual Installation
11
13
 
12
- Unpack the archive and run setup.rb to install:
14
+ Unpack the archive and run `setup.rb` to install:
13
15
 
14
16
  ruby setup.rb
15
17
 
16
- setup.rb installs the library into your system ruby. If don't want to
18
+ `setup.rb` installs the library into your system ruby. If don't want to
17
19
  add openid to you system ruby, you may instead add the `lib` directory of
18
- the extracted tarball to your RUBYLIB environment variable:
20
+ the extracted tarball to your `RUBYLIB` environment variable:
19
21
 
20
22
  $ export RUBYLIB=${RUBYLIB}:/path/to/ruby-openid/lib
21
23
 
@@ -27,21 +29,13 @@ Make sure everything installed ok:
27
29
  irb$> require "openid"
28
30
  => true
29
31
 
30
- Or, if you installed via rubygems:
31
-
32
- $> irb
33
- irb$> require "rubygems"
34
- => true
35
- irb$> require_gem "ruby-openid"
36
- => true
37
-
38
32
  ## Run the test suite
39
33
 
40
34
  Go into the test directory and execute the `runtests.rb` script.
41
35
 
42
36
  ## Next steps
43
37
 
44
- * Run `consumer.rb` in the examples directory.
45
- * Get started writing your own consumer using OpenID::Consumer
38
+ * Run `consumer.rb` in the `examples/` directory.
39
+ * Get started writing your own consumer using `OpenID::Consumer`
46
40
  * Write your own server with `OpenID::Server`
47
- * Use the `OpenIDLoginGenerator`! Read `example/README` for more info.
41
+ * Use the `OpenIDLoginGenerator`! Read `examples/README.md` for more info.
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  A Ruby library for verifying and serving OpenID identities.
4
4
 
5
- [![Build Status](https://secure.travis-ci.org/openid/ruby-openid.png)](http://travis-ci.org/openid/ruby-openid)
5
+ [![Build Status](https://secure.travis-ci.org/openid/ruby-openid.svg)](http://travis-ci.org/openid/ruby-openid)
6
6
 
7
7
  ## Features
8
8
 
@@ -55,8 +55,8 @@ the examples.
55
55
 
56
56
  ## Homepage
57
57
 
58
- * [GitHub](http://github.com/openid/ruby-openid)
59
- * [Website](http://openid.net/)
58
+ * GitHub repository: [openid/ruby-openid](http://github.com/openid/ruby-openid)
59
+ * Homepage: [OpenID.net](http://openid.net/)
60
60
 
61
61
  ## Community
62
62
 
@@ -74,7 +74,7 @@ hesitate to send it to us: [How to contribute](http://openidenabled.com/contribu
74
74
 
75
75
  Copyright 2006-2012, JanRain, Inc.
76
76
 
77
- Contact openid@janrain.com or visit the [OpenID channel on pibb.com](http://pibb.com/go/openid).
77
+ Contact openid@janrain.com.
78
78
 
79
79
  ## License
80
80
 
@@ -3,30 +3,35 @@ OpenID library. Make sure you have properly installed the library
3
3
  before running the examples. These examples are a great place to
4
4
  start in integrating OpenID into your application.
5
5
 
6
- ==Rails example
6
+ ## Rails example
7
7
 
8
- The rails_openid contains a fully functional OpenID server and relying
8
+ The `rails_openid` directory contains a fully functional OpenID server and relying
9
9
  party, and acts as a starting point for implementing your own
10
10
  production rails server. You'll need the latest version of Ruby on
11
11
  Rails installed, and then:
12
12
 
13
- cd rails_openid
14
- ./script/server
13
+ ```shell
14
+ cd rails_openid
15
+ ./script/server
16
+ ```
15
17
 
16
18
  Open a web browser to http://localhost:3000/ and follow the instructions.
17
19
 
18
20
  The relevant code to work from when writing your Rails OpenID Relying
19
21
  Party is:
22
+
20
23
  rails_openid/app/controllers/consumer_controller.rb
24
+
21
25
  If you are working on an OpenID provider, check out
26
+
22
27
  rails_openid/app/controllers/server_controller.rb
23
28
 
24
29
  Since the library and examples are Apache-licensed, don't be shy about
25
30
  copy-and-paste.
26
31
 
27
- ==Rails ActiveRecord OpenIDStore plugin
32
+ ## Rails ActiveRecord OpenIDStore plugin
28
33
 
29
34
  For various reasons you may want or need to deploy your ruby openid
30
- consumer/server using an SQL based store. The active_record_openid_store
35
+ consumer/server using an SQL based store. The `active_record_openid_store`
31
36
  is a plugin that makes using an SQL based store simple. Follow the
32
37
  README inside the plugin's dir for usage.
@@ -450,7 +450,7 @@ module OpenID
450
450
  services.each { |service_element|
451
451
  endpoints += flt.get_service_endpoints(iname, service_element)
452
452
  }
453
- rescue Yadis::XRDSError => why
453
+ rescue Yadis::XRDSError, Yadis::XRI::XRIHTTPError => why
454
454
  Util.log('xrds error on ' + iname + ': ' + why.to_s)
455
455
  end
456
456
 
@@ -72,9 +72,9 @@ module OpenID
72
72
  def id_res
73
73
  check_for_fields
74
74
  verify_return_to
75
- verify_discovery_results
76
75
  check_signature
77
76
  check_nonce
77
+ verify_discovery_results
78
78
  end
79
79
 
80
80
  def server_url
@@ -539,9 +539,8 @@ module OpenID
539
539
  end
540
540
 
541
541
  def self.from_success_response(success_response)
542
- resp = nil
543
542
  ax_args = success_response.message.get_args(NS_URI)
544
- resp = ax_args.key?('error') ? new(false, ax_args['error']) : new
543
+ ax_args.key?('error') ? new(false, ax_args['error']) : new
545
544
  end
546
545
 
547
546
  def succeeded?
@@ -1,6 +1,6 @@
1
1
  require 'net/http'
2
- require 'openid'
3
2
  require 'openid/util'
3
+ require 'openid/version'
4
4
 
5
5
  begin
6
6
  require 'net/https'
@@ -230,7 +230,7 @@ module OpenID
230
230
  # create a safe filename from a url
231
231
  def filename_escape(s)
232
232
  s = '' if s.nil?
233
- filename_chunks = s.each_char.flat_map {|c|
233
+ s.each_char.flat_map {|c|
234
234
  @@FILENAME_ALLOWED.include?(c) ? c : c.bytes.map {|b|
235
235
  "_%02X" % b
236
236
  }
@@ -1,3 +1,3 @@
1
1
  module OpenID
2
- VERSION = "2.8.0"
2
+ VERSION = "2.9.1"
3
3
  end
@@ -1,4 +1,3 @@
1
- require 'openid/yadis/xrds'
2
1
  require 'openid/fetchers'
3
2
 
4
3
  module OpenID
@@ -0,0 +1 @@
1
+ require 'openid'
@@ -304,7 +304,7 @@ module OpenID
304
304
  # server error or is otherwise undecipherable.
305
305
  def test_bad_response
306
306
  assert_log_matches('Server error when requesting an association') {
307
- assert_equal(call_negotiate([mk_message({})]), nil)
307
+ assert_nil(call_negotiate([mk_message({})]))
308
308
  }
309
309
  end
310
310
 
@@ -320,7 +320,7 @@ module OpenID
320
320
  "Server #{@server_url} responded with unsupported "\
321
321
  "association session but did not supply a fallback."
322
322
  ) {
323
- assert_equal(call_negotiate([msg]), nil)
323
+ assert_nil(call_negotiate([msg]))
324
324
  }
325
325
 
326
326
  end
@@ -337,7 +337,7 @@ module OpenID
337
337
  "Server #{@server_url} responded with unsupported "\
338
338
  "association session but did not supply a fallback."
339
339
  ) {
340
- assert_equal(call_negotiate([msg]), nil)
340
+ assert_nil(call_negotiate([msg]))
341
341
  }
342
342
  end
343
343
 
@@ -357,7 +357,7 @@ module OpenID
357
357
 
358
358
  assert_log_matches('Unsupported association type',
359
359
  'Server sent unsupported session/association type:') {
360
- assert_equal(call_negotiate([msg], negotiator), nil)
360
+ assert_nil(call_negotiate([msg], negotiator))
361
361
  }
362
362
  end
363
363
 
@@ -388,7 +388,7 @@ module OpenID
388
388
 
389
389
  assert_log_matches('Unsupported association type',
390
390
  "Server #{@server_url} refused") {
391
- assert_equal(call_negotiate([msg, msg]), nil)
391
+ assert_nil(call_negotiate([msg, msg]))
392
392
  }
393
393
  end
394
394
 
@@ -424,7 +424,7 @@ module OpenID
424
424
  def test_bad_response
425
425
  assert_log_matches('Server error when requesting an association') {
426
426
  response = call_negotiate([mk_message({})])
427
- assert_equal(nil, response)
427
+ assert_nil(response)
428
428
  }
429
429
  end
430
430
 
@@ -436,7 +436,7 @@ module OpenID
436
436
 
437
437
  assert_log_matches('Server error when requesting an association') {
438
438
  response = call_negotiate([msg])
439
- assert_equal(nil, response)
439
+ assert_nil(response)
440
440
  }
441
441
  end
442
442
 
@@ -448,7 +448,7 @@ module OpenID
448
448
 
449
449
  assert_log_matches('Server error when requesting an association') {
450
450
  response = call_negotiate([msg])
451
- assert_equal(nil, response)
451
+ assert_nil(response)
452
452
  }
453
453
  end
454
454
 
@@ -466,7 +466,7 @@ module OpenID
466
466
 
467
467
  assert_log_matches('Server error when requesting an association') {
468
468
  response = call_negotiate([msg])
469
- assert_equal(nil, response)
469
+ assert_nil(response)
470
470
  }
471
471
  end
472
472
 
@@ -482,7 +482,7 @@ module OpenID
482
482
 
483
483
  assert_log_matches('Server error when requesting an association') {
484
484
  response = call_negotiate([msg, assoc])
485
- assert_equal(nil, response)
485
+ assert_nil(response)
486
486
  }
487
487
  end
488
488
 
@@ -818,13 +818,13 @@ module OpenID
818
818
 
819
819
  def test_not_in_store_no_response
820
820
  set_negotiate_response(nil)
821
- assert_equal(nil, @assoc_manager.get_association)
821
+ assert_nil(@assoc_manager.get_association)
822
822
  end
823
823
 
824
824
  def test_not_in_store_negotiate_assoc
825
825
  # Not stored beforehand:
826
826
  stored_assoc = @store.get_association(@server_url, @assoc.handle)
827
- assert_equal(nil, stored_assoc)
827
+ assert_nil(stored_assoc)
828
828
 
829
829
  # Returned from associate call:
830
830
  set_negotiate_response(@assoc)
@@ -898,7 +898,7 @@ module OpenID
898
898
  def test_missing_fields
899
899
  @message.del_arg(OPENID_NS, 'assoc_type')
900
900
  assert_log_matches('Missing required par') {
901
- assert_equal(nil, make_request)
901
+ assert_nil(make_request)
902
902
  }
903
903
  end
904
904
 
@@ -907,7 +907,7 @@ module OpenID
907
907
  def test_protocol_error
908
908
  @message.set_arg(OPENID_NS, 'expires_in', 'goats')
909
909
  assert_log_matches('Protocol error processing') {
910
- assert_equal(nil, make_request)
910
+ assert_nil(make_request)
911
911
  }
912
912
  end
913
913
  end
@@ -47,7 +47,7 @@ module OpenID
47
47
  assert_equal(type_uri, ainfo.type_uri)
48
48
  assert_equal(1, ainfo.count)
49
49
  assert_equal(false, ainfo.required)
50
- assert_equal(nil, ainfo.ns_alias)
50
+ assert_nil(ainfo.ns_alias)
51
51
  end
52
52
  end
53
53
 
@@ -234,7 +234,7 @@ module OpenID
234
234
 
235
235
  def test_construct
236
236
  assert_equal({}, @msg.requested_attributes)
237
- assert_equal(nil, @msg.update_url)
237
+ assert_nil(@msg.update_url)
238
238
 
239
239
  msg = FetchRequest.new('hailstorm')
240
240
  assert_equal({}, msg.requested_attributes)
@@ -494,7 +494,7 @@ module OpenID
494
494
  end
495
495
 
496
496
  def test_construct
497
- assert_equal(nil, @msg.update_url)
497
+ assert_nil(@msg.update_url)
498
498
  assert_equal({}, @msg.data)
499
499
  end
500
500
 
@@ -541,7 +541,7 @@ module OpenID
541
541
  end
542
542
 
543
543
  def test_get_extension_args_single_value_response
544
- # Single values do NOT have a count, and
544
+ # Single values do NOT have a count, and
545
545
  # do not use the array extension
546
546
  eargs = {
547
547
  'mode' => 'fetch_response',
@@ -585,7 +585,7 @@ module OpenID
585
585
  end
586
586
 
587
587
  def test_get_single_none
588
- assert_equal(nil, @msg.get_single(@type_a))
588
+ assert_nil(@msg.get_single(@type_a))
589
589
  end
590
590
 
591
591
  def test_get_single_extra
@@ -16,7 +16,7 @@ module OpenID
16
16
  assert_equal(:endpoint, ep)
17
17
  consumer.send(:cleanup_last_requested_endpoint)
18
18
  ep = consumer.send(:last_requested_endpoint)
19
- assert_equal(nil, ep)
19
+ assert_nil(ep)
20
20
  end
21
21
  end
22
22
 
@@ -724,8 +724,8 @@ module OpenID
724
724
  end
725
725
 
726
726
  def test_noIdentifiers
727
- assert_equal(@endpoint.get_local_id, nil)
728
- assert_equal(@endpoint.claimed_id, nil)
727
+ assert_nil(@endpoint.get_local_id)
728
+ assert_nil(@endpoint.claimed_id)
729
729
  end
730
730
 
731
731
  def test_compatibility
@@ -733,7 +733,7 @@ module OpenID
733
733
  end
734
734
 
735
735
  def test_canonical_id
736
- assert_equal(@endpoint.canonical_id, nil)
736
+ assert_nil(@endpoint.canonical_id)
737
737
  end
738
738
 
739
739
  def test_serverURL
@@ -21,8 +21,8 @@ module OpenID
21
21
  assert_equal(@disco_services.next, @services[1])
22
22
  assert_equal(@disco_services.current, @services[1])
23
23
 
24
- assert_equal(@disco_services.next, nil)
25
- assert_equal(@disco_services.current, nil)
24
+ assert_nil(@disco_services.next)
25
+ assert_nil(@disco_services.current)
26
26
  end
27
27
 
28
28
  def test_for_url
@@ -84,7 +84,7 @@ module OpenID
84
84
  end
85
85
 
86
86
  def test_get_next_service
87
- assert_equal(@session[@key], nil)
87
+ assert_nil(@session[@key])
88
88
 
89
89
  next_service = @manager.get_next_service {
90
90
  [@yadis_url, ["one", "two", "three"]]
@@ -123,24 +123,24 @@ module OpenID
123
123
  ["unused", []]
124
124
  }
125
125
 
126
- assert_equal(result, nil)
126
+ assert_nil(result)
127
127
  end
128
128
 
129
129
  def test_cleanup
130
130
  # With no preexisting manager, cleanup() returns nil.
131
- assert_equal(@manager.cleanup, nil)
131
+ assert_nil(@manager.cleanup)
132
132
 
133
133
  # With a manager, it returns the manager's current service.
134
134
  disco = Consumer::DiscoveredServices.new(@url, @yadis_url, ["one", "two"])
135
135
 
136
136
  @session[@key] = disco
137
- assert_equal(@manager.cleanup, nil)
138
- assert_equal(@session[@key], nil)
137
+ assert_nil(@manager.cleanup)
138
+ assert_nil(@session[@key])
139
139
 
140
140
  disco.next
141
141
  @session[@key] = disco
142
142
  assert_equal(@manager.cleanup, "one")
143
- assert_equal(@session[@key], nil)
143
+ assert_nil(@session[@key])
144
144
 
145
145
  # The force parameter should be passed through to get_manager
146
146
  # and destroy_manager.
@@ -178,7 +178,7 @@ module OpenID
178
178
  disco2 = Consumer::DiscoveredServices.new("http://not.this.url.com/",
179
179
  "http://other.yadis.url/", ["one"])
180
180
  @session[@key] = disco2
181
- assert_equal(@manager.get_manager, nil)
181
+ assert_nil(@manager.get_manager)
182
182
  assert_equal(@manager.get_manager(true), disco2)
183
183
  end
184
184
 
@@ -10,12 +10,14 @@ module OpenID
10
10
  # Tests a standard set of behaviors of Message.get_arg with
11
11
  # variations on handling defaults.
12
12
  def get_arg_tests(ns, key, expected=nil)
13
- assert_equal(expected, @m.get_arg(ns, key))
14
-
15
13
  if expected.nil?
14
+ assert_nil(@m.get_arg(ns, key))
15
+
16
16
  assert_equal(@m.get_arg(ns, key, :a_default), :a_default)
17
17
  assert_raises(Message::KeyNotFound) { @m.get_arg(ns, key, NO_DEFAULT) }
18
18
  else
19
+ assert_equal(expected, @m.get_arg(ns, key))
20
+
19
21
  assert_equal(@m.get_arg(ns, key, :a_default), expected)
20
22
  assert_equal(@m.get_arg(ns, key, NO_DEFAULT), expected)
21
23
  end
@@ -73,7 +75,7 @@ module OpenID
73
75
  end
74
76
 
75
77
  def test_get_openid
76
- assert_equal(nil, @m.get_openid_namespace)
78
+ assert_nil(@m.get_openid_namespace)
77
79
  end
78
80
 
79
81
  def test_get_key_openid
@@ -87,15 +89,15 @@ module OpenID
87
89
  end
88
90
 
89
91
  def test_get_key_ns1
90
- assert_equal(nil, @m.get_key(OPENID1_NS, 'foo'))
92
+ assert_nil(@m.get_key(OPENID1_NS, 'foo'))
91
93
  end
92
94
 
93
95
  def test_get_key_ns2
94
- assert_equal(nil, @m.get_key(OPENID2_NS, 'foo'))
96
+ assert_nil(@m.get_key(OPENID2_NS, 'foo'))
95
97
  end
96
98
 
97
99
  def test_get_key_ns3
98
- assert_equal(nil, @m.get_key('urn:something-special', 'foo'))
100
+ assert_nil(@m.get_key('urn:something-special', 'foo'))
99
101
  end
100
102
 
101
103
  def test_has_key
@@ -202,7 +204,7 @@ module OpenID
202
204
  def _test_set_arg_ns(ns)
203
205
  key = 'Camper Van Beethoven'
204
206
  value = 'David Lowery'
205
- assert_equal(nil, @m.get_arg(ns, key))
207
+ assert_nil(@m.get_arg(ns, key))
206
208
  @m.set_arg(ns, key, value)
207
209
  assert_equal(value, @m.get_arg(ns, key))
208
210
  end
@@ -228,7 +230,7 @@ module OpenID
228
230
 
229
231
  def _test_del_arg_ns(ns)
230
232
  key = 'Fleeting Joys'
231
- assert_equal(nil, @m.del_arg(ns, key))
233
+ assert_nil(@m.del_arg(ns, key))
232
234
  end
233
235
 
234
236
  def test_del_arg_bare
@@ -362,11 +364,11 @@ module OpenID
362
364
  end
363
365
 
364
366
  def test_get_key_ns2
365
- assert_equal(nil, @m.get_key(OPENID2_NS, 'mode'))
367
+ assert_nil(@m.get_key(OPENID2_NS, 'mode'))
366
368
  end
367
369
 
368
370
  def test_get_key_ns3
369
- assert_equal(nil, @m.get_key('urn:xxx', 'mode'))
371
+ assert_nil(@m.get_key('urn:xxx', 'mode'))
370
372
  end
371
373
 
372
374
  def test_has_key
@@ -461,7 +463,7 @@ module OpenID
461
463
  def _test_set_arg_ns(ns)
462
464
  key = 'awesometown'
463
465
  value = 'funny'
464
- assert_equal(nil, @m.get_arg(ns,key))
466
+ assert_nil(@m.get_arg(ns,key))
465
467
  @m.set_arg(ns, key, value)
466
468
  assert_equal(value, @m.get_arg(ns,key))
467
469
  end
@@ -478,7 +480,7 @@ module OpenID
478
480
  @m.set_arg(ns, key, value)
479
481
  assert_equal(value, @m.get_arg(ns,key))
480
482
  @m.del_arg(ns,key)
481
- assert_equal(nil, @m.get_arg(ns,key))
483
+ assert_nil(@m.get_arg(ns,key))
482
484
  end
483
485
 
484
486
  def test_del_arg; _test_del_arg_ns(OPENID_NS); end
@@ -702,7 +704,7 @@ module OpenID
702
704
  end
703
705
 
704
706
  def test_get_key_ns1
705
- assert_equal(nil, @m.get_key(OPENID1_NS, 'mode'))
707
+ assert_nil(@m.get_key(OPENID1_NS, 'mode'))
706
708
  end
707
709
 
708
710
  def test_get_key_ns2
@@ -710,7 +712,7 @@ module OpenID
710
712
  end
711
713
 
712
714
  def test_get_key_ns3
713
- assert_equal(nil, @m.get_key('urn:xxx', 'mode'))
715
+ assert_nil(@m.get_key('urn:xxx', 'mode'))
714
716
  end
715
717
 
716
718
  def test_has_key_openid
@@ -739,11 +741,11 @@ module OpenID
739
741
  end
740
742
 
741
743
  def test_get_arg_bare
742
- assert_equal(nil, @m.get_arg(BARE_NS,'mode'))
744
+ assert_nil(@m.get_arg(BARE_NS,'mode'))
743
745
  end
744
746
 
745
747
  def test_get_arg_ns1
746
- assert_equal(nil, @m.get_arg(OPENID1_NS,'mode'))
748
+ assert_nil(@m.get_arg(OPENID1_NS,'mode'))
747
749
  end
748
750
 
749
751
  def test_get_arg_ns2
@@ -751,7 +753,7 @@ module OpenID
751
753
  end
752
754
 
753
755
  def test_get_arg_ns3
754
- assert_equal(nil, @m.get_arg('urn:bananastand','mode'))
756
+ assert_nil(@m.get_arg('urn:bananastand','mode'))
755
757
  end
756
758
 
757
759
  def test_get_args_openid
@@ -813,7 +815,7 @@ module OpenID
813
815
  def _test_set_arg_ns(ns)
814
816
  key = "logan's"
815
817
  value = "run"
816
- assert_equal(nil, @m.get_arg(ns,key))
818
+ assert_nil(@m.get_arg(ns,key))
817
819
  @m.set_arg(ns, key, value)
818
820
  assert_equal(value, @m.get_arg(ns,key))
819
821
  end
@@ -851,11 +853,11 @@ module OpenID
851
853
  def _test_del_arg_ns(ns)
852
854
  key = 'no'
853
855
  value = 'socks'
854
- assert_equal(nil, @m.get_arg(ns, key))
856
+ assert_nil(@m.get_arg(ns, key))
855
857
  @m.set_arg(ns, key, value)
856
858
  assert_equal(value, @m.get_arg(ns, key))
857
859
  @m.del_arg(ns, key)
858
- assert_equal(nil, @m.get_arg(ns, key))
860
+ assert_nil(@m.get_arg(ns, key))
859
861
  end
860
862
 
861
863
  def test_del_arg_openid; _test_del_arg_ns(OPENID_NS); end
@@ -143,7 +143,6 @@ module OpenID
143
143
  'mode' => 'id_res',
144
144
  'ns' => OPENID2_NS,
145
145
  'ns.oauth' => OAuth::NS_URI,
146
- 'ns.oauth' => OAuth::NS_URI,
147
146
  'oauth.request_token' => 'REQUESTTOKEN',
148
147
  'oauth.scope' => "http://sample.com/some_scope"
149
148
  })
@@ -13,7 +13,7 @@ module OpenID
13
13
 
14
14
  def test_construct
15
15
  assert_equal([], @req.preferred_auth_policies)
16
- assert_equal(nil, @req.max_auth_age)
16
+ assert_nil(@req.max_auth_age)
17
17
  assert_equal('pape', @req.ns_alias)
18
18
 
19
19
  req2 = PAPE::Request.new([PAPE::AUTH_MULTI_FACTOR], 1000)
@@ -53,7 +53,7 @@ module OpenID
53
53
 
54
54
  def test_parse_extension_args_empty
55
55
  @req.parse_extension_args({})
56
- assert_equal(nil, @req.max_auth_age)
56
+ assert_nil(@req.max_auth_age)
57
57
  assert_equal([], @req.preferred_auth_policies)
58
58
  end
59
59
 
@@ -110,9 +110,9 @@ module OpenID
110
110
 
111
111
  def test_construct
112
112
  assert_equal([], @req.auth_policies)
113
- assert_equal(nil, @req.auth_time)
113
+ assert_nil(@req.auth_time)
114
114
  assert_equal('pape', @req.ns_alias)
115
- assert_equal(nil, @req.nist_auth_level)
115
+ assert_nil(@req.nist_auth_level)
116
116
 
117
117
  req2 = PAPE::Response.new([PAPE::AUTH_MULTI_FACTOR], "1983-11-05T12:30:24Z", 3)
118
118
  assert_equal([PAPE::AUTH_MULTI_FACTOR], req2.auth_policies)
@@ -168,7 +168,7 @@ module OpenID
168
168
 
169
169
  def test_parse_extension_args_empty
170
170
  @req.parse_extension_args({})
171
- assert_equal(nil, @req.auth_time)
171
+ assert_nil(@req.auth_time)
172
172
  assert_equal([], @req.auth_policies)
173
173
  end
174
174
 
@@ -205,8 +205,8 @@ module OpenID
205
205
  'nist_auth_level' => 'some'}
206
206
  @req.parse_extension_args(args)
207
207
  assert_equal(['http://foo','http://bar'], @req.auth_policies)
208
- assert_equal(nil, @req.auth_time)
209
- assert_equal(nil, @req.nist_auth_level)
208
+ assert_nil(@req.auth_time)
209
+ assert_nil(@req.nist_auth_level)
210
210
  end
211
211
 
212
212
 
@@ -55,7 +55,7 @@ module OpenID
55
55
  # Not all args in this NS are signed, so expect nil when
56
56
  # asking for them.
57
57
  utargs = resp.extension_response('urn:unittest', true)
58
- assert_equal(nil, utargs)
58
+ assert_nil(utargs)
59
59
  end
60
60
  end
61
61
  end
@@ -142,7 +142,7 @@ module OpenID
142
142
  def test_no_message
143
143
  e = Server::ProtocolError.new(nil, "no message")
144
144
  assert(e.get_return_to.nil?)
145
- assert_equal(e.which_encoding, nil)
145
+ assert_nil(e.which_encoding)
146
146
  end
147
147
 
148
148
  def test_which_encoding_no_message
@@ -167,7 +167,7 @@ module OpenID
167
167
  def test_none
168
168
  args = {}
169
169
  r = @decode.call(args)
170
- assert_equal(r, nil)
170
+ assert_nil(r)
171
171
  end
172
172
 
173
173
  def test_irrelevant
@@ -350,7 +350,7 @@ module OpenID
350
350
  assert(r.is_a?(Server::CheckIDRequest))
351
351
  assert_equal(r.mode, "checkid_setup")
352
352
  assert_equal(r.immediate, false)
353
- assert_equal(r.identity, nil)
353
+ assert_nil(r.identity)
354
354
  assert_equal(r.trust_root, @tr_url)
355
355
  assert_equal(r.return_to, @rt_url)
356
356
  end
@@ -1896,9 +1896,9 @@ module OpenID
1896
1896
  response = @request.answer_unsupported(message)
1897
1897
  rfg = lambda { |f| response.fields.get_arg(OPENID_NS, f) }
1898
1898
  assert_equal(rfg.call('error_code'), 'unsupported-type')
1899
- assert_equal(rfg.call('assoc_type'), nil)
1899
+ assert_nil(rfg.call('assoc_type'))
1900
1900
  assert_equal(rfg.call('error'), message)
1901
- assert_equal(rfg.call('session_type'), nil)
1901
+ assert_nil(rfg.call('session_type'))
1902
1902
  end
1903
1903
 
1904
1904
  def test_openid1_unsupported_explode
@@ -2323,8 +2323,7 @@ module OpenID
2323
2323
  def test_getAssocInvalid
2324
2324
  ah = 'no-such-handle'
2325
2325
  silence_logging {
2326
- assert_equal(
2327
- @signatory.get_association(ah, false), nil)
2326
+ assert_nil(@signatory.get_association(ah, false))
2328
2327
  }
2329
2328
  # assert(!@messages, @messages)
2330
2329
  end
@@ -2333,8 +2332,7 @@ module OpenID
2333
2332
  # getAssociation(dumb=False) cannot get a dumb assoc
2334
2333
  assoc_handle = makeAssoc(true)
2335
2334
  silence_logging {
2336
- assert_equal(
2337
- @signatory.get_association(assoc_handle, false), nil)
2335
+ assert_nil(@signatory.get_association(assoc_handle, false))
2338
2336
  }
2339
2337
  # @failIf(@messages, @messages)
2340
2338
  end
@@ -2348,8 +2346,7 @@ module OpenID
2348
2346
  # MAC keys.
2349
2347
  assoc_handle = makeAssoc(false)
2350
2348
  silence_logging {
2351
- assert_equal(
2352
- @signatory.get_association(assoc_handle, true), nil)
2349
+ assert_nil(@signatory.get_association(assoc_handle, true))
2353
2350
  }
2354
2351
  # @failIf(@messages, @messages)
2355
2352
  end
@@ -154,7 +154,7 @@ module OpenID
154
154
  req = Request.new
155
155
  assert_equal([], req.optional)
156
156
  assert_equal([], req.required)
157
- assert_equal(nil, req.policy_url)
157
+ assert_nil(req.policy_url)
158
158
  assert_equal(NS_URI, req.ns_uri)
159
159
  end
160
160
 
@@ -476,4 +476,3 @@ module OpenID
476
476
  end
477
477
  end
478
478
  end
479
-
@@ -218,7 +218,7 @@ module OpenID
218
218
  include StoreTestCase
219
219
 
220
220
  def setup
221
- raise "filestoretest directory exists" if File.exists?('filestoretest')
221
+ raise "filestoretest directory exists" if File.exist?('filestoretest')
222
222
  @store = Filesystem.new('filestoretest')
223
223
  end
224
224
 
@@ -201,7 +201,7 @@ module OpenID
201
201
  def test_no_content_type
202
202
  with_fetcher(NoContentTypeFetcher.new) do
203
203
  result = Yadis.discover("http://bogus")
204
- assert_equal(nil, result.content_type)
204
+ assert_nil(result.content_type)
205
205
  end
206
206
  end
207
207
 
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-openid
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.0
4
+ version: 2.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - JanRain, Inc
8
- autorequire: openid
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2019-10-04 00:00:00.000000000 Z
@@ -40,7 +40,7 @@ files:
40
40
  - NOTICE
41
41
  - README.md
42
42
  - UPGRADE.md
43
- - examples/README
43
+ - examples/README.md
44
44
  - examples/active_record_openid_store/README
45
45
  - examples/active_record_openid_store/XXX_add_open_id_store_to_db.rb
46
46
  - examples/active_record_openid_store/XXX_upgrade_open_id_store.rb
@@ -156,6 +156,7 @@ files:
156
156
  - lib/openid/yadis/xrds.rb
157
157
  - lib/openid/yadis/xri.rb
158
158
  - lib/openid/yadis/xrires.rb
159
+ - lib/ruby-openid.rb
159
160
  - test/data/accept.txt
160
161
  - test/data/dh.txt
161
162
  - test/data/example-xrds.xml