From 162d6878609eefc5e8b5caa2842dcfa990e604fa Mon Sep 17 00:00:00 2001 From: mpd Date: Fri, 6 Aug 2010 19:26:09 -0700 Subject: [PATCH 01/51] make the overrides in extras.rb friendlier and not override other (e.g. ActiveSupport's) versions if they are already in-place --- lib/openid/extras.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/openid/extras.rb b/lib/openid/extras.rb index 0d9560ab..5f4f93aa 100644 --- a/lib/openid/extras.rb +++ b/lib/openid/extras.rb @@ -1,11 +1,12 @@ class String - def starts_with?(other) + define_method :starts_with? do |other| head = self[0, other.length] head == other - end + end unless new.respond_to?(:starts_with?) - def ends_with?(other) + define_method :ends_with? do |other| tail = self[-1 * other.length, other.length] tail == other - end + end unless new.respond_to?(:ends_with?) end + From b25f2a2833effc1186cae81c61e82c2a8e2e808f Mon Sep 17 00:00:00 2001 From: mpd Date: Fri, 6 Aug 2010 19:33:12 -0700 Subject: [PATCH 02/51] rename so i can link fom a gemfile --- gemspec => ruby-openid.gemspec | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename gemspec => ruby-openid.gemspec (100%) diff --git a/gemspec b/ruby-openid.gemspec similarity index 100% rename from gemspec rename to ruby-openid.gemspec From f1c7a4babb464cbf7e0027ba11c385849b5d3a48 Mon Sep 17 00:00:00 2001 From: nov matake Date: Tue, 18 Jan 2011 14:58:50 +0900 Subject: [PATCH 03/51] add UI extension support --- lib/openid/extensions/ui.rb | 53 +++++++++++++++++++++ test/test_ui.rb | 93 +++++++++++++++++++++++++++++++++++++ 2 files changed, 146 insertions(+) create mode 100644 lib/openid/extensions/ui.rb create mode 100644 test/test_ui.rb diff --git a/lib/openid/extensions/ui.rb b/lib/openid/extensions/ui.rb new file mode 100644 index 00000000..f0db5dca --- /dev/null +++ b/lib/openid/extensions/ui.rb @@ -0,0 +1,53 @@ +# An implementation of the OpenID User Interface Extension 1.0 - DRAFT 0.5 +# see: http://svn.openid.net/repos/specifications/user_interface/1.0/trunk/openid-user-interface-extension-1_0.html + +require 'openid/extension' + +module OpenID + + module UI + NS_URI = "http://specs.openid.net/extensions/ui/1.0" + + class Request < Extension + attr_accessor :lang, :icon, :mode, :ns_alias, :ns_uri + def initialize(mode = nil, icon = nil, lang = nil) + @ns_alias = 'ui' + @ns_uri = NS_URI + @lang = lang + @icon = icon + @mode = mode + end + + def get_extension_args + ns_args = {} + ns_args['lang'] = @lang if @lang + ns_args['icon'] = @icon if @icon + ns_args['mode'] = @mode if @mode + return ns_args + end + + # Instantiate a Request object from the arguments in a + # checkid_* OpenID message + # return nil if the extension was not requested. + def self.from_openid_request(oid_req) + oauth_req = new + args = oid_req.message.get_args(NS_URI) + if args == {} + return nil + end + oauth_req.parse_extension_args(args) + return oauth_req + end + + # Set UI extention parameters + def parse_extension_args(args) + @lang = args["lang"] + @icon = args["icon"] + @mode = args["mode"] + end + + end + + end + +end diff --git a/test/test_ui.rb b/test/test_ui.rb new file mode 100644 index 00000000..ad01a84e --- /dev/null +++ b/test/test_ui.rb @@ -0,0 +1,93 @@ +require 'openid/extensions/ui' +require 'openid/message' +require 'openid/server' +require 'test/unit' + +module OpenID + module UITest + class UIRequestTestCase < Test::Unit::TestCase + + def setup + @req = UI::Request.new + end + + def test_construct + assert_nil @req.mode + assert_nil @req.icon + assert_nil @req.lang + assert_equal 'ui', @req.ns_alias + + req2 = UI::Request.new("popup", "http://sample.com/favicon.png", "ja-JP") + assert_equal "popup", req2.mode + assert_equal "http://sample.com/favicon.png", req2.icon + assert_equal "ja-JP", req2.lang + end + + def test_add_mode + @req.mode = "popup" + assert_equal "popup", @req.mode + end + + def test_add_icon + @req.icon = "http://sample.com/favicon.png" + assert_equal "http://sample.com/favicon.png", @req.icon + end + + def test_add_lang + @req.lang = "ja-JP" + assert_equal "ja-JP", @req.lang + end + + def test_get_extension_args + assert_equal({}, @req.get_extension_args) + @req.mode = "popup" + assert_equal({'mode' => 'popup'}, @req.get_extension_args) + @req.icon = "http://sample.com/favicon.png" + assert_equal({'mode' => 'popup', 'icon' => 'http://sample.com/favicon.png'}, @req.get_extension_args) + @req.lang = "ja-JP" + assert_equal({'mode' => 'popup', 'icon' => 'http://sample.com/favicon.png', 'lang' => 'ja-JP'}, @req.get_extension_args) + end + + def test_parse_extension_args + args = {'mode' => 'popup', 'icon' => 'http://sample.com/favicon.png', 'lang' => 'ja-JP'} + @req.parse_extension_args args + assert_equal "popup", @req.mode + assert_equal "http://sample.com/favicon.png", @req.icon + assert_equal "ja-JP", @req.lang + end + + def test_parse_extension_args_empty + @req.parse_extension_args({}) + assert_nil @req.mode + assert_nil @req.icon + assert_nil @req.lang + end + + def test_from_openid_request + openid_req_msg = Message.from_openid_args( + 'mode' => 'checkid_setup', + 'ns' => OPENID2_NS, + 'ns.ui' => UI::NS_URI, + 'ui.mode' => 'popup', + 'ui.icon' => "http://sample.com/favicon.png", + 'ui.lang' => 'ja-JP' + ) + oid_req = Server::OpenIDRequest.new + oid_req.message = openid_req_msg + req = UI::Request.from_openid_request oid_req + assert_equal "popup", req.mode + assert_equal "http://sample.com/favicon.png", req.icon + assert_equal "ja-JP", req.lang + end + + def test_from_openid_request_no_ui_params + message = Message.new + openid_req = Server::OpenIDRequest.new + openid_req.message = message + ui_req = UI::Request.from_openid_request openid_req + assert ui_req.nil? + end + + end + end +end From 73ecfd64db0cc638f07a3d72207bc85d8e105159 Mon Sep 17 00:00:00 2001 From: nov matake Date: Tue, 18 Jan 2011 15:01:18 +0900 Subject: [PATCH 04/51] fix typo --- lib/openid/extensions/ui.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/openid/extensions/ui.rb b/lib/openid/extensions/ui.rb index f0db5dca..6c156d7f 100644 --- a/lib/openid/extensions/ui.rb +++ b/lib/openid/extensions/ui.rb @@ -39,7 +39,7 @@ def self.from_openid_request(oid_req) return oauth_req end - # Set UI extention parameters + # Set UI extension parameters def parse_extension_args(args) @lang = args["lang"] @icon = args["icon"] From 90aad76609255e9d59942c8a4402821fedf1c856 Mon Sep 17 00:00:00 2001 From: nov matake Date: Tue, 18 Jan 2011 17:15:45 +0900 Subject: [PATCH 05/51] icon spec update it should be "true" when required. --- test/test_ui.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/test/test_ui.rb b/test/test_ui.rb index ad01a84e..92e74a49 100644 --- a/test/test_ui.rb +++ b/test/test_ui.rb @@ -17,9 +17,9 @@ def test_construct assert_nil @req.lang assert_equal 'ui', @req.ns_alias - req2 = UI::Request.new("popup", "http://sample.com/favicon.png", "ja-JP") + req2 = UI::Request.new("popup", true, "ja-JP") assert_equal "popup", req2.mode - assert_equal "http://sample.com/favicon.png", req2.icon + assert_equal true, req2.icon assert_equal "ja-JP", req2.lang end @@ -29,8 +29,8 @@ def test_add_mode end def test_add_icon - @req.icon = "http://sample.com/favicon.png" - assert_equal "http://sample.com/favicon.png", @req.icon + @req.icon = true + assert_equal true, @req.icon end def test_add_lang @@ -42,17 +42,17 @@ def test_get_extension_args assert_equal({}, @req.get_extension_args) @req.mode = "popup" assert_equal({'mode' => 'popup'}, @req.get_extension_args) - @req.icon = "http://sample.com/favicon.png" - assert_equal({'mode' => 'popup', 'icon' => 'http://sample.com/favicon.png'}, @req.get_extension_args) + @req.icon = true + assert_equal({'mode' => 'popup', 'icon' => true}, @req.get_extension_args) @req.lang = "ja-JP" - assert_equal({'mode' => 'popup', 'icon' => 'http://sample.com/favicon.png', 'lang' => 'ja-JP'}, @req.get_extension_args) + assert_equal({'mode' => 'popup', 'icon' => true, 'lang' => 'ja-JP'}, @req.get_extension_args) end def test_parse_extension_args - args = {'mode' => 'popup', 'icon' => 'http://sample.com/favicon.png', 'lang' => 'ja-JP'} + args = {'mode' => 'popup', 'icon' => true, 'lang' => 'ja-JP'} @req.parse_extension_args args assert_equal "popup", @req.mode - assert_equal "http://sample.com/favicon.png", @req.icon + assert_equal true, @req.icon assert_equal "ja-JP", @req.lang end @@ -69,14 +69,14 @@ def test_from_openid_request 'ns' => OPENID2_NS, 'ns.ui' => UI::NS_URI, 'ui.mode' => 'popup', - 'ui.icon' => "http://sample.com/favicon.png", + 'ui.icon' => true, 'ui.lang' => 'ja-JP' ) oid_req = Server::OpenIDRequest.new oid_req.message = openid_req_msg req = UI::Request.from_openid_request oid_req assert_equal "popup", req.mode - assert_equal "http://sample.com/favicon.png", req.icon + assert_equal true, req.icon assert_equal "ja-JP", req.lang end From cbe4ecae0c44eae140c8e0adb6baa8a166acd7a8 Mon Sep 17 00:00:00 2001 From: nov matake Date: Tue, 18 Jan 2011 17:42:27 +0900 Subject: [PATCH 06/51] remove 1 space --- test/test_ui.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_ui.rb b/test/test_ui.rb index 92e74a49..e20227a4 100644 --- a/test/test_ui.rb +++ b/test/test_ui.rb @@ -8,7 +8,7 @@ module UITest class UIRequestTestCase < Test::Unit::TestCase def setup - @req = UI::Request.new + @req = UI::Request.new end def test_construct From 4083e495afc0cdf85d7acb063448278da93eb154 Mon Sep 17 00:00:00 2001 From: nov matake Date: Tue, 18 Jan 2011 22:22:34 +0900 Subject: [PATCH 07/51] Regenerate gemspec for version 2.1.9 --- nov-ruby-openid.gemspec | 304 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 304 insertions(+) create mode 100644 nov-ruby-openid.gemspec diff --git a/nov-ruby-openid.gemspec b/nov-ruby-openid.gemspec new file mode 100644 index 00000000..32a64f75 --- /dev/null +++ b/nov-ruby-openid.gemspec @@ -0,0 +1,304 @@ +# Generated by jeweler +# DO NOT EDIT THIS FILE DIRECTLY +# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec' +# -*- encoding: utf-8 -*- + +Gem::Specification.new do |s| + s.name = %q{nov-ruby-openid} + s.version = "2.1.9" + + s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= + s.authors = ["JanRain, Inc"] + s.date = %q{2011-01-18} + s.email = %q{openid@janrain.com} + s.extra_rdoc_files = [ + "CHANGELOG", + "CHANGES-2.1.0", + "INSTALL", + "LICENSE", + "README", + "UPGRADE" + ] + s.files = [ + "CHANGELOG", + "CHANGES-2.1.0", + "INSTALL", + "LICENSE", + "NOTICE", + "README", + "UPGRADE", + "contrib/google/ruby-openid-apps-discovery-1.0.gem", + "contrib/google/ruby-openid-apps-discovery-1.01.gem", + "examples/README", + "examples/active_record_openid_store/README", + "examples/active_record_openid_store/XXX_add_open_id_store_to_db.rb", + "examples/active_record_openid_store/XXX_upgrade_open_id_store.rb", + "examples/active_record_openid_store/init.rb", + "examples/active_record_openid_store/lib/association.rb", + "examples/active_record_openid_store/lib/nonce.rb", + "examples/active_record_openid_store/lib/open_id_setting.rb", + "examples/active_record_openid_store/lib/openid_ar_store.rb", + "examples/active_record_openid_store/test/store_test.rb", + "examples/discover", + "examples/rails_openid/README", + "examples/rails_openid/Rakefile", + "examples/rails_openid/app/controllers/application.rb", + "examples/rails_openid/app/controllers/consumer_controller.rb", + "examples/rails_openid/app/controllers/login_controller.rb", + "examples/rails_openid/app/controllers/server_controller.rb", + "examples/rails_openid/app/helpers/application_helper.rb", + "examples/rails_openid/app/helpers/login_helper.rb", + "examples/rails_openid/app/helpers/server_helper.rb", + "examples/rails_openid/app/views/consumer/index.rhtml", + "examples/rails_openid/app/views/layouts/server.rhtml", + "examples/rails_openid/app/views/login/index.rhtml", + "examples/rails_openid/app/views/server/decide.rhtml", + "examples/rails_openid/config/boot.rb", + "examples/rails_openid/config/database.yml", + "examples/rails_openid/config/environment.rb", + "examples/rails_openid/config/environments/development.rb", + "examples/rails_openid/config/environments/production.rb", + "examples/rails_openid/config/environments/test.rb", + "examples/rails_openid/config/routes.rb", + "examples/rails_openid/doc/README_FOR_APP", + "examples/rails_openid/public/.htaccess", + "examples/rails_openid/public/404.html", + "examples/rails_openid/public/500.html", + "examples/rails_openid/public/dispatch.cgi", + "examples/rails_openid/public/dispatch.fcgi", + "examples/rails_openid/public/dispatch.rb", + "examples/rails_openid/public/favicon.ico", + "examples/rails_openid/public/images/openid_login_bg.gif", + "examples/rails_openid/public/javascripts/controls.js", + "examples/rails_openid/public/javascripts/dragdrop.js", + "examples/rails_openid/public/javascripts/effects.js", + "examples/rails_openid/public/javascripts/prototype.js", + "examples/rails_openid/public/robots.txt", + "examples/rails_openid/script/about", + "examples/rails_openid/script/breakpointer", + "examples/rails_openid/script/console", + "examples/rails_openid/script/destroy", + "examples/rails_openid/script/generate", + "examples/rails_openid/script/performance/benchmarker", + "examples/rails_openid/script/performance/profiler", + "examples/rails_openid/script/plugin", + "examples/rails_openid/script/process/reaper", + "examples/rails_openid/script/process/spawner", + "examples/rails_openid/script/process/spinner", + "examples/rails_openid/script/runner", + "examples/rails_openid/script/server", + "examples/rails_openid/test/functional/login_controller_test.rb", + "examples/rails_openid/test/functional/server_controller_test.rb", + "examples/rails_openid/test/test_helper.rb", + "lib/hmac/hmac.rb", + "lib/hmac/sha1.rb", + "lib/hmac/sha2.rb", + "lib/openid.rb", + "lib/openid/association.rb", + "lib/openid/consumer.rb", + "lib/openid/consumer/associationmanager.rb", + "lib/openid/consumer/checkid_request.rb", + "lib/openid/consumer/discovery.rb", + "lib/openid/consumer/discovery_manager.rb", + "lib/openid/consumer/html_parse.rb", + "lib/openid/consumer/idres.rb", + "lib/openid/consumer/responses.rb", + "lib/openid/cryptutil.rb", + "lib/openid/dh.rb", + "lib/openid/extension.rb", + "lib/openid/extensions/ax.rb", + "lib/openid/extensions/oauth.rb", + "lib/openid/extensions/pape.rb", + "lib/openid/extensions/sreg.rb", + "lib/openid/extensions/ui.rb", + "lib/openid/extras.rb", + "lib/openid/fetchers.rb", + "lib/openid/kvform.rb", + "lib/openid/kvpost.rb", + "lib/openid/message.rb", + "lib/openid/protocolerror.rb", + "lib/openid/server.rb", + "lib/openid/store/filesystem.rb", + "lib/openid/store/interface.rb", + "lib/openid/store/memcache.rb", + "lib/openid/store/memory.rb", + "lib/openid/store/nonce.rb", + "lib/openid/trustroot.rb", + "lib/openid/urinorm.rb", + "lib/openid/util.rb", + "lib/openid/yadis/accept.rb", + "lib/openid/yadis/constants.rb", + "lib/openid/yadis/discovery.rb", + "lib/openid/yadis/filters.rb", + "lib/openid/yadis/htmltokenizer.rb", + "lib/openid/yadis/parsehtml.rb", + "lib/openid/yadis/services.rb", + "lib/openid/yadis/xrds.rb", + "lib/openid/yadis/xri.rb", + "lib/openid/yadis/xrires.rb", + "setup.rb", + "test/data/accept.txt", + "test/data/dh.txt", + "test/data/example-xrds.xml", + "test/data/linkparse.txt", + "test/data/n2b64", + "test/data/test1-discover.txt", + "test/data/test1-parsehtml.txt", + "test/data/test_discover/malformed_meta_tag.html", + "test/data/test_discover/openid.html", + "test/data/test_discover/openid2.html", + "test/data/test_discover/openid2_xrds.xml", + "test/data/test_discover/openid2_xrds_no_local_id.xml", + "test/data/test_discover/openid_1_and_2.html", + "test/data/test_discover/openid_1_and_2_xrds.xml", + "test/data/test_discover/openid_1_and_2_xrds_bad_delegate.xml", + "test/data/test_discover/openid_and_yadis.html", + "test/data/test_discover/openid_no_delegate.html", + "test/data/test_discover/openid_utf8.html", + "test/data/test_discover/yadis_0entries.xml", + "test/data/test_discover/yadis_2_bad_local_id.xml", + "test/data/test_discover/yadis_2entries_delegate.xml", + "test/data/test_discover/yadis_2entries_idp.xml", + "test/data/test_discover/yadis_another_delegate.xml", + "test/data/test_discover/yadis_idp.xml", + "test/data/test_discover/yadis_idp_delegate.xml", + "test/data/test_discover/yadis_no_delegate.xml", + "test/data/test_xrds/=j3h.2007.11.14.xrds", + "test/data/test_xrds/README", + "test/data/test_xrds/delegated-20060809-r1.xrds", + "test/data/test_xrds/delegated-20060809-r2.xrds", + "test/data/test_xrds/delegated-20060809.xrds", + "test/data/test_xrds/no-xrd.xml", + "test/data/test_xrds/not-xrds.xml", + "test/data/test_xrds/prefixsometimes.xrds", + "test/data/test_xrds/ref.xrds", + "test/data/test_xrds/sometimesprefix.xrds", + "test/data/test_xrds/spoof1.xrds", + "test/data/test_xrds/spoof2.xrds", + "test/data/test_xrds/spoof3.xrds", + "test/data/test_xrds/status222.xrds", + "test/data/test_xrds/subsegments.xrds", + "test/data/test_xrds/valid-populated-xrds.xml", + "test/data/trustroot.txt", + "test/data/urinorm.txt", + "test/discoverdata.rb", + "test/test_accept.rb", + "test/test_association.rb", + "test/test_associationmanager.rb", + "test/test_ax.rb", + "test/test_checkid_request.rb", + "test/test_consumer.rb", + "test/test_cryptutil.rb", + "test/test_dh.rb", + "test/test_discover.rb", + "test/test_discovery_manager.rb", + "test/test_extension.rb", + "test/test_extras.rb", + "test/test_fetchers.rb", + "test/test_filters.rb", + "test/test_idres.rb", + "test/test_kvform.rb", + "test/test_kvpost.rb", + "test/test_linkparse.rb", + "test/test_message.rb", + "test/test_nonce.rb", + "test/test_oauth.rb", + "test/test_openid_yadis.rb", + "test/test_pape.rb", + "test/test_parsehtml.rb", + "test/test_responses.rb", + "test/test_server.rb", + "test/test_sreg.rb", + "test/test_stores.rb", + "test/test_trustroot.rb", + "test/test_ui.rb", + "test/test_urinorm.rb", + "test/test_util.rb", + "test/test_xrds.rb", + "test/test_xri.rb", + "test/test_xrires.rb", + "test/test_yadis_discovery.rb", + "test/testutil.rb", + "test/util.rb" + ] + s.homepage = %q{http://openidenabled.com/ruby-openid/} + s.require_paths = ["lib"] + s.rubygems_version = %q{1.4.1} + s.summary = %q{A library for consuming and serving OpenID identities.} + s.test_files = [ + "examples/active_record_openid_store/XXX_add_open_id_store_to_db.rb", + "examples/active_record_openid_store/XXX_upgrade_open_id_store.rb", + "examples/active_record_openid_store/init.rb", + "examples/active_record_openid_store/lib/association.rb", + "examples/active_record_openid_store/lib/nonce.rb", + "examples/active_record_openid_store/lib/open_id_setting.rb", + "examples/active_record_openid_store/lib/openid_ar_store.rb", + "examples/active_record_openid_store/test/store_test.rb", + "examples/rails_openid/app/controllers/application.rb", + "examples/rails_openid/app/controllers/consumer_controller.rb", + "examples/rails_openid/app/controllers/login_controller.rb", + "examples/rails_openid/app/controllers/server_controller.rb", + "examples/rails_openid/app/helpers/application_helper.rb", + "examples/rails_openid/app/helpers/login_helper.rb", + "examples/rails_openid/app/helpers/server_helper.rb", + "examples/rails_openid/config/boot.rb", + "examples/rails_openid/config/environment.rb", + "examples/rails_openid/config/environments/development.rb", + "examples/rails_openid/config/environments/production.rb", + "examples/rails_openid/config/environments/test.rb", + "examples/rails_openid/config/routes.rb", + "examples/rails_openid/public/dispatch.rb", + "examples/rails_openid/test/functional/login_controller_test.rb", + "examples/rails_openid/test/functional/server_controller_test.rb", + "examples/rails_openid/test/test_helper.rb", + "test/discoverdata.rb", + "test/test_accept.rb", + "test/test_association.rb", + "test/test_associationmanager.rb", + "test/test_ax.rb", + "test/test_checkid_request.rb", + "test/test_consumer.rb", + "test/test_cryptutil.rb", + "test/test_dh.rb", + "test/test_discover.rb", + "test/test_discovery_manager.rb", + "test/test_extension.rb", + "test/test_extras.rb", + "test/test_fetchers.rb", + "test/test_filters.rb", + "test/test_idres.rb", + "test/test_kvform.rb", + "test/test_kvpost.rb", + "test/test_linkparse.rb", + "test/test_message.rb", + "test/test_nonce.rb", + "test/test_oauth.rb", + "test/test_openid_yadis.rb", + "test/test_pape.rb", + "test/test_parsehtml.rb", + "test/test_responses.rb", + "test/test_server.rb", + "test/test_sreg.rb", + "test/test_stores.rb", + "test/test_trustroot.rb", + "test/test_ui.rb", + "test/test_urinorm.rb", + "test/test_util.rb", + "test/test_xrds.rb", + "test/test_xri.rb", + "test/test_xrires.rb", + "test/test_yadis_discovery.rb", + "test/testutil.rb", + "test/util.rb" + ] + + if s.respond_to? :specification_version then + s.specification_version = 3 + + if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then + else + end + else + end +end + From a0869998162e180b294260ea021b9782ee4ec2bb Mon Sep 17 00:00:00 2001 From: Joshua Childs Date: Thu, 24 Mar 2011 13:46:10 -0400 Subject: [PATCH 08/51] updating documentation for running tests --- INSTALL | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/INSTALL b/INSTALL index 89f1b9bd..3c67d5cb 100644 --- a/INSTALL +++ b/INSTALL @@ -32,16 +32,16 @@ Or, if you installed via rubygems: $> irb irb$> require "rubygems" => true - irb$> require_gem "ruby-openid" + irb$> require_gem "ruby-openid" => true == Run the test suite -Go into the test directory and execute the *runtests.rb* script. +Go into the admin directory and execute the *runtests.rb* script. == Next steps -* Run consumer.rb in the examples directory. +* Run consumer.rb in the examples directory. * Get started writing your own consumer using OpenID::Consumer * Write your own server with OpenID::Server * Use the OpenIDLoginGenerator! Read example/README for more info. From 973eb806ab35b7affa4e4d55e333f41015274268 Mon Sep 17 00:00:00 2001 From: Joshua Childs Date: Thu, 24 Mar 2011 13:47:57 -0400 Subject: [PATCH 09/51] updating auto-submit form to hide element using CSS, moved auto-submitting javascript off body attribute and into a timeout to verify availability of form in the DOM. --- lib/openid/util.rb | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/lib/openid/util.rb b/lib/openid/util.rb index c5a6716b..63a48728 100644 --- a/lib/openid/util.rb +++ b/lib/openid/util.rb @@ -88,22 +88,23 @@ def Util.log(message) end def Util.auto_submit_html(form, title='OpenID transaction in progress') - return " - - - #{title} - - -#{form} - - - -" + return " + + #{title} + + + + + #{form} + + " end end From f943c0681efcb33c0cf188a5d91de17c75bfc1b6 Mon Sep 17 00:00:00 2001 From: Brian Alexander Date: Mon, 8 Nov 2010 12:21:28 -0500 Subject: [PATCH 10/51] Support cache clients that return boolean values like Dalli --- lib/openid/store/memcache.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/openid/store/memcache.rb b/lib/openid/store/memcache.rb index bb4b106a..9cc065c0 100644 --- a/lib/openid/store/memcache.rb +++ b/lib/openid/store/memcache.rb @@ -63,7 +63,11 @@ def use_nonce(server_url, timestamp, salt) ts = timestamp.to_s # base 10 seconds since epoch nonce_key = key_prefix + 'N' + server_url + '|' + ts + '|' + salt result = @cache_client.add(nonce_key, '', expiry(Nonce.skew + 5)) - return !!(result =~ /^STORED/) + if result.is_a? String + return !!(result =~ /^STORED/) + else + return result == true + end end def assoc_key(server_url, assoc_handle=nil) @@ -87,7 +91,11 @@ def cleanup_associations def delete(key) result = @cache_client.delete(key) - return !!(result =~ /^DELETED/) + if result.is_a? String + return !!(result =~ /^DELETED/) + else + return result == true + end end def serialize(assoc) From 77d17a25e7563bd6f66847e20b1d7873e66d2234 Mon Sep 17 00:00:00 2001 From: Chris Hanks Date: Fri, 18 Feb 2011 13:04:10 -0800 Subject: [PATCH 11/51] Rename gemspec so it can be linked from Bundler. --- gemspec => ruby-openid.gemspec | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename gemspec => ruby-openid.gemspec (100%) diff --git a/gemspec b/ruby-openid.gemspec similarity index 100% rename from gemspec rename to ruby-openid.gemspec From a91ee67ef1cec7e2d55d285a633e42b2917b23b0 Mon Sep 17 00:00:00 2001 From: Clarke Brunsdon Date: Sun, 27 Mar 2011 09:24:58 -0700 Subject: [PATCH 12/51] I was getting an error about the logger not being initialized, so I initialize it at a smarter time. --- lib/openid/util.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/openid/util.rb b/lib/openid/util.rb index c5a6716b..32f15c4c 100644 --- a/lib/openid/util.rb +++ b/lib/openid/util.rb @@ -71,20 +71,17 @@ def Util.append_args(url, args) url << Util.urlencode(args) end - @@logger = Logger.new(STDERR) - @@logger.progname = "OpenID" - def Util.logger=(logger) @@logger = logger end def Util.logger - @@logger + @@logger ||= Logger.new(STDERR, { :progname => 'OpenID' }) end # change the message below to do whatever you like for logging def Util.log(message) - logger.info(message) + Util.logger.info(message) end def Util.auto_submit_html(form, title='OpenID transaction in progress') From 2575d20bec9c07a698f7f51ec4fc571513725863 Mon Sep 17 00:00:00 2001 From: Joshua Childs Date: Thu, 24 Mar 2011 13:46:10 -0400 Subject: [PATCH 13/51] updating documentation for running tests --- INSTALL | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/INSTALL b/INSTALL index 89f1b9bd..3c67d5cb 100644 --- a/INSTALL +++ b/INSTALL @@ -32,16 +32,16 @@ Or, if you installed via rubygems: $> irb irb$> require "rubygems" => true - irb$> require_gem "ruby-openid" + irb$> require_gem "ruby-openid" => true == Run the test suite -Go into the test directory and execute the *runtests.rb* script. +Go into the admin directory and execute the *runtests.rb* script. == Next steps -* Run consumer.rb in the examples directory. +* Run consumer.rb in the examples directory. * Get started writing your own consumer using OpenID::Consumer * Write your own server with OpenID::Server * Use the OpenIDLoginGenerator! Read example/README for more info. From e4ffb4a4a9d0befc83ef7cc6fe00c6ca5510ccce Mon Sep 17 00:00:00 2001 From: Joshua Childs Date: Thu, 24 Mar 2011 13:47:57 -0400 Subject: [PATCH 14/51] updating auto-submit form to hide element using CSS, moved auto-submitting javascript off body attribute and into a timeout to verify availability of form in the DOM. --- lib/openid/util.rb | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/lib/openid/util.rb b/lib/openid/util.rb index 32f15c4c..a68c0423 100644 --- a/lib/openid/util.rb +++ b/lib/openid/util.rb @@ -85,22 +85,23 @@ def Util.log(message) end def Util.auto_submit_html(form, title='OpenID transaction in progress') - return " - - - #{title} - - -#{form} - - - -" + return " + + #{title} + + + + + #{form} + + " end end From 81d879825a744c52b5e3c6a08e525b8395c576e7 Mon Sep 17 00:00:00 2001 From: Steven Davidovitz Date: Tue, 22 Mar 2011 11:09:16 -0400 Subject: [PATCH 15/51] encode form inputs so that values with elements such as & or ' are still properly sent --- lib/openid/message.rb | 2 +- lib/openid/util.rb | 6 ++++++ test/test_message.rb | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/openid/message.rb b/lib/openid/message.rb index 8700378b..c494f469 100644 --- a/lib/openid/message.rb +++ b/lib/openid/message.rb @@ -288,7 +288,7 @@ def to_form_markup(action_url, form_tag_attrs=nil, submit_text='Continue') markup += ">\n" to_post_args.each { |k,v| - markup += "\n" + markup += "\n" } markup += "\n" markup += "\n" diff --git a/lib/openid/util.rb b/lib/openid/util.rb index a68c0423..69abb53f 100644 --- a/lib/openid/util.rb +++ b/lib/openid/util.rb @@ -103,6 +103,12 @@ def Util.auto_submit_html(form, title='OpenID transaction in progress') " end + + ESCAPE_TABLE = { '&' => '&', '<' => '<', '>' => '>', '"' => '"', "'" => ''' } + # Modified from ERb's html_encode + def Util.html_encode(s) + s.to_s.gsub(/[&<>"']/) {|s| ESCAPE_TABLE[s] } + end end end diff --git a/test/test_message.rb b/test/test_message.rb index f8ef9187..6ae1d8fd 100644 --- a/test/test_message.rb +++ b/test/test_message.rb @@ -902,6 +902,7 @@ def setup 'openid.identity' => 'http://bogus.example.invalid:port/', 'openid.assoc_handle' => 'FLUB', 'openid.return_to' => 'Neverland', + 'openid.ax.value.fullname' => "Bob&Smith'" } @action_url = 'scheme://host:port/path?query' From d2ba6c32596cbdfb0cd01cb4175ae6cffc848442 Mon Sep 17 00:00:00 2001 From: Sven Bohm Date: Fri, 4 Mar 2011 15:34:13 -0500 Subject: [PATCH 16/51] added the name to the gemspec file --- ruby-openid.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruby-openid.gemspec b/ruby-openid.gemspec index 68435249..39b72f0b 100644 --- a/ruby-openid.gemspec +++ b/ruby-openid.gemspec @@ -1,7 +1,7 @@ require 'rubygems' SPEC = Gem::Specification.new do |s| - s.name = `cat admin/library-name`.strip + s.name = 'ruby-openid' # s.version = `darcs changes --tags= | awk '$1 == "tagged" { print $2 }' | head -n 1`.strip s.version = '2.1.8' s.author = 'JanRain, Inc' From 1bef6e235aad79e5f48e3499d477874ed62b54ed Mon Sep 17 00:00:00 2001 From: Tom Quackenbush Date: Fri, 25 Feb 2011 13:02:43 -0500 Subject: [PATCH 17/51] Add attr_reader for setup_url on SetupNeededResponse. Add asserts to setup_needed tests to verify setup_url in response. --- lib/openid/consumer/responses.rb | 2 ++ test/test_consumer.rb | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/openid/consumer/responses.rb b/lib/openid/consumer/responses.rb index 4947c1ca..89a551fb 100644 --- a/lib/openid/consumer/responses.rb +++ b/lib/openid/consumer/responses.rb @@ -139,6 +139,8 @@ def initialize(endpoint) class SetupNeededResponse include Response STATUS = SETUP_NEEDED + + attr_reader :setup_url def initialize(endpoint, setup_url) @endpoint = endpoint @setup_url = setup_url diff --git a/test/test_consumer.rb b/test/test_consumer.rb index dc4a09e6..da485f4d 100644 --- a/test/test_consumer.rb +++ b/test/test_consumer.rb @@ -182,9 +182,11 @@ def test_setup_needed_openid1 end def test_setup_needed_openid2 - args = {'openid.ns' => OPENID2_NS, 'openid.mode' => 'setup_needed'} + setup_url = 'http://setup.url/' + args = {'openid.ns' => OPENID2_NS, 'openid.mode' => 'setup_needed', 'openid.user_setup_url' => setup_url} response = @consumer.complete(args, nil) assert_equal(SETUP_NEEDED, response.status) + assert_equal(setup_url, response.setup_url) end def test_idres_setup_needed_openid1 @@ -195,6 +197,7 @@ def test_idres_setup_needed_openid1 } response = @consumer.complete(args, nil) assert_equal(SETUP_NEEDED, response.status) + assert_equal(setup_url, response.setup_url) end def test_error From 8cd86653fb42d9d13fa73f5674ee4fc246f89092 Mon Sep 17 00:00:00 2001 From: Tom Quackenbush Date: Fri, 25 Feb 2011 13:13:28 -0500 Subject: [PATCH 18/51] Add missing testutil requires causing test suite to crash (at least under my install of OSX 10.6) --- test/test_accept.rb | 1 + test/test_association.rb | 1 + test/test_associationmanager.rb | 1 + 3 files changed, 3 insertions(+) diff --git a/test/test_accept.rb b/test/test_accept.rb index 06db85bf..f4096009 100644 --- a/test/test_accept.rb +++ b/test/test_accept.rb @@ -3,6 +3,7 @@ require 'openid/yadis/accept' require 'openid/extras' require 'openid/util' +require 'testutil' module OpenID diff --git a/test/test_association.rb b/test/test_association.rb index 1b273321..35c28560 100644 --- a/test/test_association.rb +++ b/test/test_association.rb @@ -1,5 +1,6 @@ require "test/unit" require "openid/association" +require 'testutil' module OpenID class AssociationTestCase < Test::Unit::TestCase diff --git a/test/test_associationmanager.rb b/test/test_associationmanager.rb index 041449ff..2f981c5a 100644 --- a/test/test_associationmanager.rb +++ b/test/test_associationmanager.rb @@ -8,6 +8,7 @@ require "test/unit" require "util" require "time" +require 'testutil' module OpenID class DHAssocSessionTest < Test::Unit::TestCase From 7ee4ab0c16b17bbdd4d29c91129ae6d8a8a63f41 Mon Sep 17 00:00:00 2001 From: Andrew Andkjar Date: Tue, 5 Apr 2011 18:44:20 -0400 Subject: [PATCH 19/51] some gemspec cleanup, fixes constant redefinition warning, removes old version computation comment --- ruby-openid.gemspec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ruby-openid.gemspec b/ruby-openid.gemspec index 39b72f0b..bff76651 100644 --- a/ruby-openid.gemspec +++ b/ruby-openid.gemspec @@ -1,8 +1,7 @@ require 'rubygems' -SPEC = Gem::Specification.new do |s| +spec = Gem::Specification.new do |s| s.name = 'ruby-openid' -# s.version = `darcs changes --tags= | awk '$1 == "tagged" { print $2 }' | head -n 1`.strip s.version = '2.1.8' s.author = 'JanRain, Inc' s.email = 'openid@janrain.com' From 5c28b1a98d93a98453ff0310e296f385a6edcd63 Mon Sep 17 00:00:00 2001 From: mpd Date: Tue, 19 Apr 2011 11:14:57 -0700 Subject: [PATCH 20/51] update gemspec to confirm to rubygems 1.7 --- ruby-openid.gemspec | 3 --- 1 file changed, 3 deletions(-) diff --git a/ruby-openid.gemspec b/ruby-openid.gemspec index 68435249..7df0184e 100644 --- a/ruby-openid.gemspec +++ b/ruby-openid.gemspec @@ -15,7 +15,4 @@ SPEC = Gem::Specification.new do |s| s.require_path = 'lib' s.autorequire = 'openid' s.test_file = 'admin/runtests.rb' - s.has_rdoc = true - s.extra_rdoc_files = ['README','INSTALL','LICENSE','UPGRADE'] - s.rdoc_options << '--main' << 'README' end From 5363931512eb6d9d0c6bfc308f8cb7d928d9ef10 Mon Sep 17 00:00:00 2001 From: John Wang Date: Sat, 3 Sep 2011 14:54:25 -1000 Subject: [PATCH 21/51] Update to deal with seg fault from Ruby 1.9.2-p290 and below running on OSX Lion. See the upstream branch's pull request #22 for more details. https://github.com/openid/ruby-openid/pull/22 --- lib/openid/dh.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/openid/dh.rb b/lib/openid/dh.rb index cbe53114..0c15b867 100644 --- a/lib/openid/dh.rb +++ b/lib/openid/dh.rb @@ -57,7 +57,7 @@ def DiffieHellman.strxor(s, t) end if String.method_defined? :bytes - s.bytes.zip(t.bytes).map{|sb,tb| sb^tb}.pack('C*') + s.bytes.to_a.zip(t.bytes.to_a).map{|sb,tb| sb^tb}.pack('C*') else indices = 0...(s.length) chrs = indices.collect {|i| (s[i]^t[i]).chr} From 871784b6fed3da998e42a25e2a59f1d670c016da Mon Sep 17 00:00:00 2001 From: Tom Quackenbush Date: Fri, 9 Sep 2011 13:15:10 -0400 Subject: [PATCH 22/51] add Util::HTML_FORM_ID constant for use in generated auto-submit openid transaction in progress form to be sure we are autosubmitting the correct form --- lib/openid/message.rb | 1 + lib/openid/util.rb | 6 ++++-- test/test_message.rb | 1 + test/test_util.rb | 10 ++++++++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/openid/message.rb b/lib/openid/message.rb index c494f469..282497bd 100644 --- a/lib/openid/message.rb +++ b/lib/openid/message.rb @@ -278,6 +278,7 @@ def to_form_markup(action_url, form_tag_attrs=nil, submit_text='Continue') form_tag_attr_map['method'] = 'post' form_tag_attr_map['accept-charset'] = 'UTF-8' form_tag_attr_map['enctype'] = 'application/x-www-form-urlencoded' + form_tag_attr_map['id'] = OpenID::Util::HTML_FORM_ID markup = "
form { visibility: hidden } diff --git a/test/test_message.rb b/test/test_message.rb index 6ae1d8fd..a04f43bf 100644 --- a/test/test_message.rb +++ b/test/test_message.rb @@ -920,6 +920,7 @@ def setup 'accept-charset' => 'UTF-8', 'enctype' => 'application/x-www-form-urlencoded', 'method' => 'post', + 'id' => Util::HTML_FORM_ID } end diff --git a/test/test_util.rb b/test/test_util.rb index ce1138ae..1a98e44d 100644 --- a/test/test_util.rb +++ b/test/test_util.rb @@ -140,6 +140,16 @@ def test_append_args() def test_parse_query assert_equal({'foo'=>'bar'}, Util.parse_query('foo=bar')) end + + def test_defines_html_form_id + assert Util::HTML_FORM_ID + end + + def test_auto_submit_html_looks_for_html_form_id_to_submit + auto_submit_html_output = Util.auto_submit_html('form_data') + assert auto_submit_html_output =~ Regexp.new(Regexp.escape("document.getElementById('#{Util::HTML_FORM_ID}')")) + assert auto_submit_html_output =~ Regexp.new(Regexp.escape("document.getElementById('#{Util::HTML_FORM_ID}').submit();")) + end end end From 0d86b565eb997cfd95e551c74a6b9dcfdfee970b Mon Sep 17 00:00:00 2001 From: Tom Quackenbush Date: Fri, 9 Sep 2011 13:17:18 -0400 Subject: [PATCH 23/51] bump sub-version to 2.1.8.1 to denote our updates --- lib/openid.rb | 2 +- ruby-openid.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/openid.rb b/lib/openid.rb index 1024de7c..94ba143a 100644 --- a/lib/openid.rb +++ b/lib/openid.rb @@ -13,7 +13,7 @@ # permissions and limitations under the License. module OpenID - VERSION = "2.1.8" + VERSION = "2.1.8.1" end require "openid/consumer" diff --git a/ruby-openid.gemspec b/ruby-openid.gemspec index bff76651..7e585138 100644 --- a/ruby-openid.gemspec +++ b/ruby-openid.gemspec @@ -2,7 +2,7 @@ require 'rubygems' spec = Gem::Specification.new do |s| s.name = 'ruby-openid' - s.version = '2.1.8' + s.version = '2.1.8.1' s.author = 'JanRain, Inc' s.email = 'openid@janrain.com' s.homepage = 'http://github.com/openid/ruby-openid' From 4b6fdd152edbc9d1f617056879eb03bd82b78eb4 Mon Sep 17 00:00:00 2001 From: Michael Bleigh Date: Wed, 19 Oct 2011 22:12:48 -0400 Subject: [PATCH 24/51] Bundler-friendly gemspec --- gemspec => ruby-openid.gemspec | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename gemspec => ruby-openid.gemspec (100%) diff --git a/gemspec b/ruby-openid.gemspec similarity index 100% rename from gemspec rename to ruby-openid.gemspec From 8250493379acbb3ed67eaef6287de0e29637df6b Mon Sep 17 00:00:00 2001 From: mcary Date: Tue, 22 Nov 2011 19:32:46 -0800 Subject: [PATCH 25/51] Fix cleanup AR associations whose expiry is past, not upcoming --- examples/active_record_openid_store/lib/openid_ar_store.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/active_record_openid_store/lib/openid_ar_store.rb b/examples/active_record_openid_store/lib/openid_ar_store.rb index 276569c5..c2436744 100644 --- a/examples/active_record_openid_store/lib/openid_ar_store.rb +++ b/examples/active_record_openid_store/lib/openid_ar_store.rb @@ -51,7 +51,7 @@ def cleanup_nonces def cleanup_associations now = Time.now.to_i - Association.delete_all(['issued + lifetime > ?',now]) + Association.delete_all(['issued + lifetime < ?',now]) end end From f2df9431a7e4ac79a7eca725ecd7fe152939d256 Mon Sep 17 00:00:00 2001 From: mcary Date: Tue, 22 Nov 2011 19:39:14 -0800 Subject: [PATCH 26/51] Fix AR store class name in gc rake task and explicitly require it --- examples/active_record_openid_store/README | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/active_record_openid_store/README b/examples/active_record_openid_store/README index 11787298..ed1f1f57 100644 --- a/examples/active_record_openid_store/README +++ b/examples/active_record_openid_store/README @@ -46,7 +46,8 @@ task in your app's Rakefile like so: desc 'GC OpenID store' task :gc_openid_store => :environment do - ActiveRecordOpenIDStore.new.cleanup + require 'openid_ar_store' + ActiveRecordStore.new.cleanup end Run it by typing: From dc26a4c57a0462e738498bfbe34a13f0a5ba447c Mon Sep 17 00:00:00 2001 From: mcary Date: Tue, 22 Nov 2011 19:42:06 -0800 Subject: [PATCH 27/51] Improve desc and user feedback in AR gc rake task --- examples/active_record_openid_store/README | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/active_record_openid_store/README b/examples/active_record_openid_store/README index ed1f1f57..9d15c62f 100644 --- a/examples/active_record_openid_store/README +++ b/examples/active_record_openid_store/README @@ -44,10 +44,11 @@ You may garbage collect unused nonces and expired associations using the gc instance method of ActiveRecordOpenIDStore. Hook it up to a task in your app's Rakefile like so: - desc 'GC OpenID store' + desc 'GC OpenID store, deleting expired nonces and associations' task :gc_openid_store => :environment do require 'openid_ar_store' - ActiveRecordStore.new.cleanup + nonces, associations = ActiveRecordStore.new.cleanup + puts "Deleted #{nonces} nonces, #{associations} associations" end Run it by typing: From 24a5efbd70272cb0651994b2a6e22bc8380bab09 Mon Sep 17 00:00:00 2001 From: Hidetoshi Yoshimoto Date: Thu, 4 Aug 2011 10:53:11 +0900 Subject: [PATCH 28/51] use OpenSSL::HMAC insted of Digest::HMAC if can do so. --- lib/openid/cryptutil.rb | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) mode change 100644 => 100755 lib/openid/cryptutil.rb diff --git a/lib/openid/cryptutil.rb b/lib/openid/cryptutil.rb old mode 100644 new mode 100755 index 2ae19e1d..c1a975d9 --- a/lib/openid/cryptutil.rb +++ b/lib/openid/cryptutil.rb @@ -1,8 +1,9 @@ require "openid/util" require "digest/sha1" require "digest/sha2" +require "openssl" begin - require "digest/hmac" + require "digest/hmac" unless OpenSSL.const_defined? :HMAC rescue LoadError begin # Try loading the ruby-hmac files if they exist @@ -37,8 +38,10 @@ def CryptUtil.sha1(text) end def CryptUtil.hmac_sha1(key, text) - if Digest.const_defined? :HMAC - Digest::HMAC.new(key,Digest::SHA1).update(text).digest + if OpenSSL.const_defined? :HMAC + OpenSSL::HMAC.new(key, OpenSSL::Digest.new('sha1')).update(text).digest + elsif Digest.const_defined? :HMAC + Digest::HMAC.new(key, Digest::SHA1).update(text).digest else return HMAC::SHA1.digest(key, text) end @@ -49,8 +52,10 @@ def CryptUtil.sha256(text) end def CryptUtil.hmac_sha256(key, text) - if Digest.const_defined? :HMAC - Digest::HMAC.new(key,Digest::SHA256).update(text).digest + if OpenSSL.const_defined? :HMAC + OpenSSL::HMAC.new(key, OpenSSL::Digest.new('sha256')).update(text).digest + elsif Digest.const_defined? :HMAC + Digest::HMAC.new(key, Digest::SHA256).update(text).digest else return HMAC::SHA256.digest(key, text) end From e4726b6ee4d5b32c51478850faf51f7133fe0e4c Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Thu, 19 Jan 2012 14:22:14 -0800 Subject: [PATCH 29/51] removing local hmac impl -> going with openssl --- lib/hmac/hmac.rb | 112 ---------------------------------------- lib/hmac/sha1.rb | 11 ---- lib/hmac/sha2.rb | 25 --------- lib/openid/cryptutil.rb | 13 ----- 4 files changed, 161 deletions(-) delete mode 100644 lib/hmac/hmac.rb delete mode 100644 lib/hmac/sha1.rb delete mode 100644 lib/hmac/sha2.rb diff --git a/lib/hmac/hmac.rb b/lib/hmac/hmac.rb deleted file mode 100644 index e8bfa42b..00000000 --- a/lib/hmac/hmac.rb +++ /dev/null @@ -1,112 +0,0 @@ -# Copyright (C) 2001 Daiki Ueno -# This library is distributed under the terms of the Ruby license. - -# This module provides common interface to HMAC engines. -# HMAC standard is documented in RFC 2104: -# -# H. Krawczyk et al., "HMAC: Keyed-Hashing for Message Authentication", -# RFC 2104, February 1997 -# -# These APIs are inspired by JCE 1.2's javax.crypto.Mac interface. -# -# - -module HMAC - class Base - def initialize(algorithm, block_size, output_length, key) - @algorithm = algorithm - @block_size = block_size - @output_length = output_length - @status = STATUS_UNDEFINED - @key_xor_ipad = '' - @key_xor_opad = '' - set_key(key) unless key.nil? - end - - private - def check_status - unless @status == STATUS_INITIALIZED - raise RuntimeError, - "The underlying hash algorithm has not yet been initialized." - end - end - - public - def set_key(key) - # If key is longer than the block size, apply hash function - # to key and use the result as a real key. - key = @algorithm.digest(key) if key.size > @block_size - key_xor_ipad = "\x36" * @block_size - key_xor_opad = "\x5C" * @block_size - for i in 0 .. key.size - 1 - key_xor_ipad[i] ^= key[i] - key_xor_opad[i] ^= key[i] - end - @key_xor_ipad = key_xor_ipad - @key_xor_opad = key_xor_opad - @md = @algorithm.new - @status = STATUS_INITIALIZED - end - - def reset_key - @key_xor_ipad.gsub!(/./, '?') - @key_xor_opad.gsub!(/./, '?') - @key_xor_ipad[0..-1] = '' - @key_xor_opad[0..-1] = '' - @status = STATUS_UNDEFINED - end - - def update(text) - check_status - # perform inner H - md = @algorithm.new - md.update(@key_xor_ipad) - md.update(text) - str = md.digest - # perform outer H - md = @algorithm.new - md.update(@key_xor_opad) - md.update(str) - @md = md - end - alias << update - - def digest - check_status - @md.digest - end - - def hexdigest - check_status - @md.hexdigest - end - alias to_s hexdigest - - # These two class methods below are safer than using above - # instance methods combinatorially because an instance will have - # held a key even if it's no longer in use. - def Base.digest(key, text) - begin - hmac = self.new(key) - hmac.update(text) - hmac.digest - ensure - hmac.reset_key - end - end - - def Base.hexdigest(key, text) - begin - hmac = self.new(key) - hmac.update(text) - hmac.hexdigest - ensure - hmac.reset_key - end - end - - private_class_method :new, :digest, :hexdigest - end - - STATUS_UNDEFINED, STATUS_INITIALIZED = 0, 1 -end diff --git a/lib/hmac/sha1.rb b/lib/hmac/sha1.rb deleted file mode 100644 index d2f0088a..00000000 --- a/lib/hmac/sha1.rb +++ /dev/null @@ -1,11 +0,0 @@ -require 'hmac/hmac' -require 'digest/sha1' - -module HMAC - class SHA1 < Base - def initialize(key = nil) - super(Digest::SHA1, 64, 20, key) - end - public_class_method :new, :digest, :hexdigest - end -end diff --git a/lib/hmac/sha2.rb b/lib/hmac/sha2.rb deleted file mode 100644 index 0412ba40..00000000 --- a/lib/hmac/sha2.rb +++ /dev/null @@ -1,25 +0,0 @@ -require 'hmac/hmac' -require 'digest/sha2' - -module HMAC - class SHA256 < Base - def initialize(key = nil) - super(Digest::SHA256, 64, 32, key) - end - public_class_method :new, :digest, :hexdigest - end - - class SHA384 < Base - def initialize(key = nil) - super(Digest::SHA384, 128, 48, key) - end - public_class_method :new, :digest, :hexdigest - end - - class SHA512 < Base - def initialize(key = nil) - super(Digest::SHA512, 128, 64, key) - end - public_class_method :new, :digest, :hexdigest - end -end diff --git a/lib/openid/cryptutil.rb b/lib/openid/cryptutil.rb index c1a975d9..7605b8c5 100755 --- a/lib/openid/cryptutil.rb +++ b/lib/openid/cryptutil.rb @@ -2,19 +2,6 @@ require "digest/sha1" require "digest/sha2" require "openssl" -begin - require "digest/hmac" unless OpenSSL.const_defined? :HMAC -rescue LoadError - begin - # Try loading the ruby-hmac files if they exist - require "hmac-sha1" - require "hmac-sha2" - rescue LoadError - # Nothing exists use included hmac files - require "hmac/sha1" - require "hmac/sha2" - end -end module OpenID # This module contains everything needed to perform low-level From ad37c06ddb33505982dd2ed15de65629aa732c44 Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Tue, 28 Feb 2012 09:43:29 -0800 Subject: [PATCH 30/51] Reverse-merged the changes to rename the gem and changes to gemspec. --- admin/library-name | 2 +- entp-ruby-openid.gemspec => ruby-openid.gemspec | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) rename entp-ruby-openid.gemspec => ruby-openid.gemspec (78%) diff --git a/admin/library-name b/admin/library-name index cd1d7040..062173a3 100644 --- a/admin/library-name +++ b/admin/library-name @@ -1 +1 @@ -entp-ruby-openid \ No newline at end of file +ruby-openid \ No newline at end of file diff --git a/entp-ruby-openid.gemspec b/ruby-openid.gemspec similarity index 78% rename from entp-ruby-openid.gemspec rename to ruby-openid.gemspec index b12b61db..68435249 100644 --- a/entp-ruby-openid.gemspec +++ b/ruby-openid.gemspec @@ -3,12 +3,12 @@ require 'rubygems' SPEC = Gem::Specification.new do |s| s.name = `cat admin/library-name`.strip # s.version = `darcs changes --tags= | awk '$1 == "tagged" { print $2 }' | head -n 1`.strip - s.version = '2.2' - s.author = 'ENTP' - s.email = 'courtenay@entp.com' - s.homepage = 'http://github.com/entp/ruby-openid' + s.version = '2.1.8' + s.author = 'JanRain, Inc' + s.email = 'openid@janrain.com' + s.homepage = 'http://github.com/openid/ruby-openid' s.platform = Gem::Platform::RUBY - s.summary = 'A library for consuming and serving OpenID identities. Forked from the unmaintained JanRain version.' + s.summary = 'A library for consuming and serving OpenID identities.' files = Dir.glob("{examples,lib,test}/**/*") files << 'NOTICE' << 'CHANGELOG' s.files = files.delete_if {|f| f.include?('_darcs') || f.include?('admin')} From feeff0998a6675bcf7bf451087d566a9de9cd097 Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Wed, 29 Feb 2012 10:11:46 -0800 Subject: [PATCH 31/51] Remove nov gemspec --- nov-ruby-openid.gemspec | 304 ---------------------------------------- 1 file changed, 304 deletions(-) delete mode 100644 nov-ruby-openid.gemspec diff --git a/nov-ruby-openid.gemspec b/nov-ruby-openid.gemspec deleted file mode 100644 index 32a64f75..00000000 --- a/nov-ruby-openid.gemspec +++ /dev/null @@ -1,304 +0,0 @@ -# Generated by jeweler -# DO NOT EDIT THIS FILE DIRECTLY -# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec' -# -*- encoding: utf-8 -*- - -Gem::Specification.new do |s| - s.name = %q{nov-ruby-openid} - s.version = "2.1.9" - - s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= - s.authors = ["JanRain, Inc"] - s.date = %q{2011-01-18} - s.email = %q{openid@janrain.com} - s.extra_rdoc_files = [ - "CHANGELOG", - "CHANGES-2.1.0", - "INSTALL", - "LICENSE", - "README", - "UPGRADE" - ] - s.files = [ - "CHANGELOG", - "CHANGES-2.1.0", - "INSTALL", - "LICENSE", - "NOTICE", - "README", - "UPGRADE", - "contrib/google/ruby-openid-apps-discovery-1.0.gem", - "contrib/google/ruby-openid-apps-discovery-1.01.gem", - "examples/README", - "examples/active_record_openid_store/README", - "examples/active_record_openid_store/XXX_add_open_id_store_to_db.rb", - "examples/active_record_openid_store/XXX_upgrade_open_id_store.rb", - "examples/active_record_openid_store/init.rb", - "examples/active_record_openid_store/lib/association.rb", - "examples/active_record_openid_store/lib/nonce.rb", - "examples/active_record_openid_store/lib/open_id_setting.rb", - "examples/active_record_openid_store/lib/openid_ar_store.rb", - "examples/active_record_openid_store/test/store_test.rb", - "examples/discover", - "examples/rails_openid/README", - "examples/rails_openid/Rakefile", - "examples/rails_openid/app/controllers/application.rb", - "examples/rails_openid/app/controllers/consumer_controller.rb", - "examples/rails_openid/app/controllers/login_controller.rb", - "examples/rails_openid/app/controllers/server_controller.rb", - "examples/rails_openid/app/helpers/application_helper.rb", - "examples/rails_openid/app/helpers/login_helper.rb", - "examples/rails_openid/app/helpers/server_helper.rb", - "examples/rails_openid/app/views/consumer/index.rhtml", - "examples/rails_openid/app/views/layouts/server.rhtml", - "examples/rails_openid/app/views/login/index.rhtml", - "examples/rails_openid/app/views/server/decide.rhtml", - "examples/rails_openid/config/boot.rb", - "examples/rails_openid/config/database.yml", - "examples/rails_openid/config/environment.rb", - "examples/rails_openid/config/environments/development.rb", - "examples/rails_openid/config/environments/production.rb", - "examples/rails_openid/config/environments/test.rb", - "examples/rails_openid/config/routes.rb", - "examples/rails_openid/doc/README_FOR_APP", - "examples/rails_openid/public/.htaccess", - "examples/rails_openid/public/404.html", - "examples/rails_openid/public/500.html", - "examples/rails_openid/public/dispatch.cgi", - "examples/rails_openid/public/dispatch.fcgi", - "examples/rails_openid/public/dispatch.rb", - "examples/rails_openid/public/favicon.ico", - "examples/rails_openid/public/images/openid_login_bg.gif", - "examples/rails_openid/public/javascripts/controls.js", - "examples/rails_openid/public/javascripts/dragdrop.js", - "examples/rails_openid/public/javascripts/effects.js", - "examples/rails_openid/public/javascripts/prototype.js", - "examples/rails_openid/public/robots.txt", - "examples/rails_openid/script/about", - "examples/rails_openid/script/breakpointer", - "examples/rails_openid/script/console", - "examples/rails_openid/script/destroy", - "examples/rails_openid/script/generate", - "examples/rails_openid/script/performance/benchmarker", - "examples/rails_openid/script/performance/profiler", - "examples/rails_openid/script/plugin", - "examples/rails_openid/script/process/reaper", - "examples/rails_openid/script/process/spawner", - "examples/rails_openid/script/process/spinner", - "examples/rails_openid/script/runner", - "examples/rails_openid/script/server", - "examples/rails_openid/test/functional/login_controller_test.rb", - "examples/rails_openid/test/functional/server_controller_test.rb", - "examples/rails_openid/test/test_helper.rb", - "lib/hmac/hmac.rb", - "lib/hmac/sha1.rb", - "lib/hmac/sha2.rb", - "lib/openid.rb", - "lib/openid/association.rb", - "lib/openid/consumer.rb", - "lib/openid/consumer/associationmanager.rb", - "lib/openid/consumer/checkid_request.rb", - "lib/openid/consumer/discovery.rb", - "lib/openid/consumer/discovery_manager.rb", - "lib/openid/consumer/html_parse.rb", - "lib/openid/consumer/idres.rb", - "lib/openid/consumer/responses.rb", - "lib/openid/cryptutil.rb", - "lib/openid/dh.rb", - "lib/openid/extension.rb", - "lib/openid/extensions/ax.rb", - "lib/openid/extensions/oauth.rb", - "lib/openid/extensions/pape.rb", - "lib/openid/extensions/sreg.rb", - "lib/openid/extensions/ui.rb", - "lib/openid/extras.rb", - "lib/openid/fetchers.rb", - "lib/openid/kvform.rb", - "lib/openid/kvpost.rb", - "lib/openid/message.rb", - "lib/openid/protocolerror.rb", - "lib/openid/server.rb", - "lib/openid/store/filesystem.rb", - "lib/openid/store/interface.rb", - "lib/openid/store/memcache.rb", - "lib/openid/store/memory.rb", - "lib/openid/store/nonce.rb", - "lib/openid/trustroot.rb", - "lib/openid/urinorm.rb", - "lib/openid/util.rb", - "lib/openid/yadis/accept.rb", - "lib/openid/yadis/constants.rb", - "lib/openid/yadis/discovery.rb", - "lib/openid/yadis/filters.rb", - "lib/openid/yadis/htmltokenizer.rb", - "lib/openid/yadis/parsehtml.rb", - "lib/openid/yadis/services.rb", - "lib/openid/yadis/xrds.rb", - "lib/openid/yadis/xri.rb", - "lib/openid/yadis/xrires.rb", - "setup.rb", - "test/data/accept.txt", - "test/data/dh.txt", - "test/data/example-xrds.xml", - "test/data/linkparse.txt", - "test/data/n2b64", - "test/data/test1-discover.txt", - "test/data/test1-parsehtml.txt", - "test/data/test_discover/malformed_meta_tag.html", - "test/data/test_discover/openid.html", - "test/data/test_discover/openid2.html", - "test/data/test_discover/openid2_xrds.xml", - "test/data/test_discover/openid2_xrds_no_local_id.xml", - "test/data/test_discover/openid_1_and_2.html", - "test/data/test_discover/openid_1_and_2_xrds.xml", - "test/data/test_discover/openid_1_and_2_xrds_bad_delegate.xml", - "test/data/test_discover/openid_and_yadis.html", - "test/data/test_discover/openid_no_delegate.html", - "test/data/test_discover/openid_utf8.html", - "test/data/test_discover/yadis_0entries.xml", - "test/data/test_discover/yadis_2_bad_local_id.xml", - "test/data/test_discover/yadis_2entries_delegate.xml", - "test/data/test_discover/yadis_2entries_idp.xml", - "test/data/test_discover/yadis_another_delegate.xml", - "test/data/test_discover/yadis_idp.xml", - "test/data/test_discover/yadis_idp_delegate.xml", - "test/data/test_discover/yadis_no_delegate.xml", - "test/data/test_xrds/=j3h.2007.11.14.xrds", - "test/data/test_xrds/README", - "test/data/test_xrds/delegated-20060809-r1.xrds", - "test/data/test_xrds/delegated-20060809-r2.xrds", - "test/data/test_xrds/delegated-20060809.xrds", - "test/data/test_xrds/no-xrd.xml", - "test/data/test_xrds/not-xrds.xml", - "test/data/test_xrds/prefixsometimes.xrds", - "test/data/test_xrds/ref.xrds", - "test/data/test_xrds/sometimesprefix.xrds", - "test/data/test_xrds/spoof1.xrds", - "test/data/test_xrds/spoof2.xrds", - "test/data/test_xrds/spoof3.xrds", - "test/data/test_xrds/status222.xrds", - "test/data/test_xrds/subsegments.xrds", - "test/data/test_xrds/valid-populated-xrds.xml", - "test/data/trustroot.txt", - "test/data/urinorm.txt", - "test/discoverdata.rb", - "test/test_accept.rb", - "test/test_association.rb", - "test/test_associationmanager.rb", - "test/test_ax.rb", - "test/test_checkid_request.rb", - "test/test_consumer.rb", - "test/test_cryptutil.rb", - "test/test_dh.rb", - "test/test_discover.rb", - "test/test_discovery_manager.rb", - "test/test_extension.rb", - "test/test_extras.rb", - "test/test_fetchers.rb", - "test/test_filters.rb", - "test/test_idres.rb", - "test/test_kvform.rb", - "test/test_kvpost.rb", - "test/test_linkparse.rb", - "test/test_message.rb", - "test/test_nonce.rb", - "test/test_oauth.rb", - "test/test_openid_yadis.rb", - "test/test_pape.rb", - "test/test_parsehtml.rb", - "test/test_responses.rb", - "test/test_server.rb", - "test/test_sreg.rb", - "test/test_stores.rb", - "test/test_trustroot.rb", - "test/test_ui.rb", - "test/test_urinorm.rb", - "test/test_util.rb", - "test/test_xrds.rb", - "test/test_xri.rb", - "test/test_xrires.rb", - "test/test_yadis_discovery.rb", - "test/testutil.rb", - "test/util.rb" - ] - s.homepage = %q{http://openidenabled.com/ruby-openid/} - s.require_paths = ["lib"] - s.rubygems_version = %q{1.4.1} - s.summary = %q{A library for consuming and serving OpenID identities.} - s.test_files = [ - "examples/active_record_openid_store/XXX_add_open_id_store_to_db.rb", - "examples/active_record_openid_store/XXX_upgrade_open_id_store.rb", - "examples/active_record_openid_store/init.rb", - "examples/active_record_openid_store/lib/association.rb", - "examples/active_record_openid_store/lib/nonce.rb", - "examples/active_record_openid_store/lib/open_id_setting.rb", - "examples/active_record_openid_store/lib/openid_ar_store.rb", - "examples/active_record_openid_store/test/store_test.rb", - "examples/rails_openid/app/controllers/application.rb", - "examples/rails_openid/app/controllers/consumer_controller.rb", - "examples/rails_openid/app/controllers/login_controller.rb", - "examples/rails_openid/app/controllers/server_controller.rb", - "examples/rails_openid/app/helpers/application_helper.rb", - "examples/rails_openid/app/helpers/login_helper.rb", - "examples/rails_openid/app/helpers/server_helper.rb", - "examples/rails_openid/config/boot.rb", - "examples/rails_openid/config/environment.rb", - "examples/rails_openid/config/environments/development.rb", - "examples/rails_openid/config/environments/production.rb", - "examples/rails_openid/config/environments/test.rb", - "examples/rails_openid/config/routes.rb", - "examples/rails_openid/public/dispatch.rb", - "examples/rails_openid/test/functional/login_controller_test.rb", - "examples/rails_openid/test/functional/server_controller_test.rb", - "examples/rails_openid/test/test_helper.rb", - "test/discoverdata.rb", - "test/test_accept.rb", - "test/test_association.rb", - "test/test_associationmanager.rb", - "test/test_ax.rb", - "test/test_checkid_request.rb", - "test/test_consumer.rb", - "test/test_cryptutil.rb", - "test/test_dh.rb", - "test/test_discover.rb", - "test/test_discovery_manager.rb", - "test/test_extension.rb", - "test/test_extras.rb", - "test/test_fetchers.rb", - "test/test_filters.rb", - "test/test_idres.rb", - "test/test_kvform.rb", - "test/test_kvpost.rb", - "test/test_linkparse.rb", - "test/test_message.rb", - "test/test_nonce.rb", - "test/test_oauth.rb", - "test/test_openid_yadis.rb", - "test/test_pape.rb", - "test/test_parsehtml.rb", - "test/test_responses.rb", - "test/test_server.rb", - "test/test_sreg.rb", - "test/test_stores.rb", - "test/test_trustroot.rb", - "test/test_ui.rb", - "test/test_urinorm.rb", - "test/test_util.rb", - "test/test_xrds.rb", - "test/test_xri.rb", - "test/test_xrires.rb", - "test/test_yadis_discovery.rb", - "test/testutil.rb", - "test/util.rb" - ] - - if s.respond_to? :specification_version then - s.specification_version = 3 - - if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then - else - end - else - end -end - From 36b33e82bd467b59931bf35a5177c2c7194355d4 Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Wed, 29 Feb 2012 10:12:26 -0800 Subject: [PATCH 32/51] Bump version in gemspec --- ruby-openid.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruby-openid.gemspec b/ruby-openid.gemspec index 68435249..fed4e438 100644 --- a/ruby-openid.gemspec +++ b/ruby-openid.gemspec @@ -3,7 +3,7 @@ require 'rubygems' SPEC = Gem::Specification.new do |s| s.name = `cat admin/library-name`.strip # s.version = `darcs changes --tags= | awk '$1 == "tagged" { print $2 }' | head -n 1`.strip - s.version = '2.1.8' + s.version = '2.1.9' s.author = 'JanRain, Inc' s.email = 'openid@janrain.com' s.homepage = 'http://github.com/openid/ruby-openid' From 9f9b6c62a70dbd18b9401efa82c4f37ede7cffbf Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Wed, 29 Feb 2012 15:57:31 -0800 Subject: [PATCH 33/51] Revert a change that causes Yahoo OpenID to fail due to Yahoo appending URL fragments for Identifier Recycling. The local_id is a canonical_id at the OP when the local_id is an iname at the RP. Matching claimed_ids instead of local_ids resolves the incompatibility. (reverse-merged from commit 4a17c08e8496362093e640716026ac332e74a23f) --- lib/openid/consumer/idres.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/openid/consumer/idres.rb b/lib/openid/consumer/idres.rb index 62d62643..8ef9e384 100644 --- a/lib/openid/consumer/idres.rb +++ b/lib/openid/consumer/idres.rb @@ -492,10 +492,10 @@ def verify_discovery_single(endpoint, to_match) "#{endpoint.claimed_id}") end - if to_match.claimed_id != endpoint.claimed_id - raise ProtocolError, ("claimed_id mismatch. Expected "\ - "#{to_match.claimed_id}, got "\ - "#{endpoint.claimed_id}") + if to_match.get_local_id != endpoint.get_local_id + raise ProtocolError, ("local_id mismatch. Expected "\ + "#{to_match.get_local_id}, got "\ + "#{endpoint.get_local_id}") end # If the server URL is nil, this must be an OpenID 1 @@ -512,7 +512,7 @@ def verify_discovery_single(endpoint, to_match) "`to_match' endpoint." end elsif to_match.server_url != endpoint.server_url - raise ProtocolError, ("OP Endpoint mismatch. Expected "\ + raise ProtocolError, ("OP Endpoint mismatch. Expected"\ "#{to_match.server_url}, got "\ "#{endpoint.server_url}") end From 452053ba4437b3d27ed5360e5a12a83aff4db4e9 Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Wed, 29 Feb 2012 15:58:12 -0800 Subject: [PATCH 34/51] Update version to 2.1.9.1 --- ruby-openid.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruby-openid.gemspec b/ruby-openid.gemspec index fed4e438..ba13e346 100644 --- a/ruby-openid.gemspec +++ b/ruby-openid.gemspec @@ -3,7 +3,7 @@ require 'rubygems' SPEC = Gem::Specification.new do |s| s.name = `cat admin/library-name`.strip # s.version = `darcs changes --tags= | awk '$1 == "tagged" { print $2 }' | head -n 1`.strip - s.version = '2.1.9' + s.version = '2.1.9.1' s.author = 'JanRain, Inc' s.email = 'openid@janrain.com' s.homepage = 'http://github.com/openid/ruby-openid' From 1c1aa19fdc2d8fb0b286028eb99b1d1e90e6f82b Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Fri, 23 Mar 2012 13:23:03 -0700 Subject: [PATCH 35/51] Bump version --- ruby-openid.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruby-openid.gemspec b/ruby-openid.gemspec index ba13e346..c3896672 100644 --- a/ruby-openid.gemspec +++ b/ruby-openid.gemspec @@ -3,7 +3,7 @@ require 'rubygems' SPEC = Gem::Specification.new do |s| s.name = `cat admin/library-name`.strip # s.version = `darcs changes --tags= | awk '$1 == "tagged" { print $2 }' | head -n 1`.strip - s.version = '2.1.9.1' + s.version = '2.1.9.2' s.author = 'JanRain, Inc' s.email = 'openid@janrain.com' s.homepage = 'http://github.com/openid/ruby-openid' From 6c9189d1ce33262f0206aa9c1c88be7c04149f1c Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Fri, 23 Mar 2012 14:42:01 -0700 Subject: [PATCH 36/51] Merge branch 'master' of git://github.com/agoragames/ruby-openid Conflicts: lib/openid.rb lib/openid/store/memcache.rb lib/openid/util.rb ruby-openid.gemspec test/test_accept.rb test/test_association.rb test/test_associationmanager.rb Reverted Mike Mell's changes to memcached store in favor of agoragames memcached Dalli changes. --- lib/openid.rb | 9 +++++---- lib/openid/message.rb | 1 + lib/openid/store/memcache.rb | 22 ++++++++++++++-------- lib/openid/util.rb | 13 ++++++------- ruby-openid.gemspec | 7 +++---- test/test_message.rb | 1 + test/test_util.rb | 10 ++++++++++ 7 files changed, 40 insertions(+), 23 deletions(-) diff --git a/lib/openid.rb b/lib/openid.rb index ccb3ad91..d3758157 100644 --- a/lib/openid.rb +++ b/lib/openid.rb @@ -12,11 +12,12 @@ # implied. See the License for the specific language governing # permissions and limitations under the License. +module OpenID + VERSION = "2.1.9.3" +end + require "openid/version" require 'openid/store' require 'openid/yadis' require "openid/consumer" -require 'openid/server' - -module OpenID -end +require 'openid/server' \ No newline at end of file diff --git a/lib/openid/message.rb b/lib/openid/message.rb index c494f469..282497bd 100644 --- a/lib/openid/message.rb +++ b/lib/openid/message.rb @@ -278,6 +278,7 @@ def to_form_markup(action_url, form_tag_attrs=nil, submit_text='Continue') form_tag_attr_map['method'] = 'post' form_tag_attr_map['accept-charset'] = 'UTF-8' form_tag_attr_map['enctype'] = 'application/x-www-form-urlencoded' + form_tag_attr_map['id'] = OpenID::Util::HTML_FORM_ID markup = " association.lifetime.seconds.to_i) + @cache_client.set(key, serialized, expiry(association.lifetime)) end end @@ -30,7 +30,7 @@ def store_association(server_url, association) # the one matching association is expired. (Is allowed to GC expired # associations when found.) def get_association(server_url, handle=nil) - serialized = @cache_client.read(assoc_key(server_url, handle)) + serialized = @cache_client.get(assoc_key(server_url, handle)) if serialized return deserialize(serialized) else @@ -62,9 +62,12 @@ def use_nonce(server_url, timestamp, salt) return false if (timestamp - Time.now.to_i).abs > Nonce.skew ts = timestamp.to_s # base 10 seconds since epoch nonce_key = key_prefix + 'N' + server_url + '|' + ts + '|' + salt - result = @cache_client.read(nonce_key) - @cache_client.write(nonce_key, nonce_key, :expires_in => (Nonce.skew() + 5)) - result.nil? + result = @cache_client.add(nonce_key, '', expiry(Nonce.skew + 5)) + if result.is_a? String + return !!(result =~ /^STORED/) + else + return result == true + end end def assoc_key(server_url, assoc_handle=nil) @@ -87,9 +90,12 @@ def cleanup_associations protected def delete(key) - # result = @cache_client.delete(key) # memcached delete seems to be broken - # return !!(result =~ /^DELETED/) - @cache_client.write(key, nil, :expires_in => 0) + result = @cache_client.delete(key) + if result.is_a? String + return !!(result =~ /^DELETED/) + else + return result == true + end end def serialize(assoc) diff --git a/lib/openid/util.rb b/lib/openid/util.rb index 8c243124..40d84c7f 100644 --- a/lib/openid/util.rb +++ b/lib/openid/util.rb @@ -29,6 +29,8 @@ module Util [#{BASE64_CHARS}]{3}=)? \\Z", Regexp::EXTENDED) + HTML_FORM_ID = 'openid_transaction_in_progress' + def Util.assert(value, message=nil) if not value raise AssertionError, message or value @@ -74,20 +76,17 @@ def Util.append_args(url, args) url << Util.urlencode(args) end - @@logger = Logger.new(STDERR) - @@logger.progname = "OpenID" - def Util.logger=(logger) @@logger = logger end def Util.logger - @@logger + @@logger ||= Logger.new(STDERR, { :progname => 'OpenID' }) end # change the message below to do whatever you like for logging def Util.log(message) - logger.info(message) + Util.logger.info(message) end def Util.auto_submit_html(form, title='OpenID transaction in progress') @@ -97,9 +96,9 @@ def Util.auto_submit_html(form, title='OpenID transaction in progress') diff --git a/ruby-openid.gemspec b/ruby-openid.gemspec index c3896672..a48cba07 100644 --- a/ruby-openid.gemspec +++ b/ruby-openid.gemspec @@ -1,9 +1,8 @@ require 'rubygems' -SPEC = Gem::Specification.new do |s| - s.name = `cat admin/library-name`.strip -# s.version = `darcs changes --tags= | awk '$1 == "tagged" { print $2 }' | head -n 1`.strip - s.version = '2.1.9.2' +spec = Gem::Specification.new do |s| + s.name = 'ruby-openid' + s.version = '2.1.9.3' s.author = 'JanRain, Inc' s.email = 'openid@janrain.com' s.homepage = 'http://github.com/openid/ruby-openid' diff --git a/test/test_message.rb b/test/test_message.rb index 412b8bf3..b84818ab 100644 --- a/test/test_message.rb +++ b/test/test_message.rb @@ -918,6 +918,7 @@ def setup 'accept-charset' => 'UTF-8', 'enctype' => 'application/x-www-form-urlencoded', 'method' => 'post', + 'id' => Util::HTML_FORM_ID } end diff --git a/test/test_util.rb b/test/test_util.rb index e19cf125..26565f75 100644 --- a/test/test_util.rb +++ b/test/test_util.rb @@ -140,6 +140,16 @@ def test_append_args() def test_parse_query assert_equal({'foo'=>'bar'}, Util.parse_query('foo=bar')) end + + def test_defines_html_form_id + assert Util::HTML_FORM_ID + end + + def test_auto_submit_html_looks_for_html_form_id_to_submit + auto_submit_html_output = Util.auto_submit_html('form_data') + assert auto_submit_html_output =~ Regexp.new(Regexp.escape("document.getElementById('#{Util::HTML_FORM_ID}')")) + assert auto_submit_html_output =~ Regexp.new(Regexp.escape("document.getElementById('#{Util::HTML_FORM_ID}').submit();")) + end end end From 5d0e279cd763bafcabb9b16ac9fc8633b252b37a Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Fri, 23 Mar 2012 17:05:08 -0700 Subject: [PATCH 37/51] Remove double declaration of VERSION due to merge. Version is now defined in lib/openid/version.rb. --- lib/openid.rb | 4 ---- lib/openid/version.rb | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/openid.rb b/lib/openid.rb index d3758157..6277044a 100644 --- a/lib/openid.rb +++ b/lib/openid.rb @@ -12,10 +12,6 @@ # implied. See the License for the specific language governing # permissions and limitations under the License. -module OpenID - VERSION = "2.1.9.3" -end - require "openid/version" require 'openid/store' require 'openid/yadis' diff --git a/lib/openid/version.rb b/lib/openid/version.rb index fc57f357..c6847f59 100644 --- a/lib/openid/version.rb +++ b/lib/openid/version.rb @@ -1,3 +1,3 @@ module OpenID - VERSION = "2.1.9" + VERSION = "2.1.9.3" end From 4c7512a2490439d5f2a23159634653dadd294fb7 Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Fri, 23 Mar 2012 17:06:30 -0700 Subject: [PATCH 38/51] Make gemspec depend on version.rb --- lib/openid/version.rb | 2 +- ruby-openid.gemspec | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/openid/version.rb b/lib/openid/version.rb index c6847f59..59c11709 100644 --- a/lib/openid/version.rb +++ b/lib/openid/version.rb @@ -1,3 +1,3 @@ module OpenID - VERSION = "2.1.9.3" + VERSION = "2.1.9.4" end diff --git a/ruby-openid.gemspec b/ruby-openid.gemspec index a48cba07..77a69c2c 100644 --- a/ruby-openid.gemspec +++ b/ruby-openid.gemspec @@ -1,8 +1,9 @@ require 'rubygems' +require 'lib/openid/version' spec = Gem::Specification.new do |s| s.name = 'ruby-openid' - s.version = '2.1.9.3' + s.version = OpenID::VERSION s.author = 'JanRain, Inc' s.email = 'openid@janrain.com' s.homepage = 'http://github.com/openid/ruby-openid' From 9393d970a8a6f3c8d5c4a5f80095fdecbead5084 Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Fri, 23 Mar 2012 17:12:11 -0700 Subject: [PATCH 39/51] More gemspec version work. --- ruby-openid.gemspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruby-openid.gemspec b/ruby-openid.gemspec index 77a69c2c..25b21142 100644 --- a/ruby-openid.gemspec +++ b/ruby-openid.gemspec @@ -1,5 +1,5 @@ -require 'rubygems' -require 'lib/openid/version' +$:.push File.expand_path("../lib", __FILE__) +require 'openid/version' spec = Gem::Specification.new do |s| s.name = 'ruby-openid' From bf4d954a5365b56b3dc73628a1e9570a94c4d4a5 Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Mon, 26 Mar 2012 11:35:14 -0700 Subject: [PATCH 40/51] Bump version --- lib/openid/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/openid/version.rb b/lib/openid/version.rb index 59c11709..0786f89a 100644 --- a/lib/openid/version.rb +++ b/lib/openid/version.rb @@ -1,3 +1,3 @@ module OpenID - VERSION = "2.1.9.4" + VERSION = "2.1.9.5" end From d1996913bddddf3b31c5401254b9c476d053f225 Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Mon, 26 Mar 2012 13:36:11 -0700 Subject: [PATCH 41/51] Add travis CI file --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..23ed7be2 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,4 @@ +language: ruby +rvm: + - 1.9.2 + - 1.9.3 From b7fd68f744e6471d87c0c01782838e3877d086ce Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Mon, 26 Mar 2012 17:26:27 -0700 Subject: [PATCH 42/51] Add test dependencies to gemspec --- ruby-openid.gemspec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ruby-openid.gemspec b/ruby-openid.gemspec index 9f40d4cf..b3222fea 100644 --- a/ruby-openid.gemspec +++ b/ruby-openid.gemspec @@ -15,4 +15,7 @@ spec = Gem::Specification.new do |s| s.require_path = 'lib' s.autorequire = 'openid' s.test_file = 'admin/runtests.rb' + + s.add_development_dependency("rake") + s.add_development_dependency("test-unit") end From d6f895ab275f02b2a811db52ea1190da8d45b488 Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Mon, 26 Mar 2012 17:29:53 -0700 Subject: [PATCH 43/51] Update readme --- README | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README b/README index 2b19a07a..0746eb55 100644 --- a/README +++ b/README @@ -1,8 +1,10 @@ =Ruby OpenID +[![Build Status](https://secure.travis-ci.org/joe1chen/ruby-openid.png)](http://travis-ci.org/joe1chen/ruby-openid) + A Ruby library for verifying and serving OpenID identities. -This is a fork by courtenay @ entp (http://entp.com) which merges in many pull requests, +This is a fork by courtenay @ entp (http://entp.com) and joe1chen which merges in many pull requests, fixes some tests and works on ruby 1.8.7 and ruby 1.9.2 (at least). This library seems otherwise abandoned by its authors. From 7f6524a7f7119b236ea6aad6295d8255f8a73bb1 Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Mon, 26 Mar 2012 17:31:46 -0700 Subject: [PATCH 44/51] Rename README to README.md --- README => README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename README => README.md (100%) diff --git a/README b/README.md similarity index 100% rename from README rename to README.md From 57ecdc821d8456442ccb93a3d4aba4b0c50cac0e Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Mon, 26 Mar 2012 17:33:49 -0700 Subject: [PATCH 45/51] Update travis config to run tests --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 23ed7be2..bbfd55fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,3 +2,4 @@ language: ruby rvm: - 1.9.2 - 1.9.3 +script: bundle exec rake test From 898963db72493671ad5bd557786774bffc0629d9 Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Mon, 26 Mar 2012 18:48:06 -0700 Subject: [PATCH 46/51] Fix bug in MockFetcherForXRIProxy that was breaking unit test. Also refactor test iname into constant. --- test/test_discover.rb | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/test/test_discover.rb b/test/test_discover.rb index 00af984b..365d21f1 100644 --- a/test/test_discover.rb +++ b/test/test_discover.rb @@ -529,7 +529,7 @@ def fetch(url, body=nil, headers=nil, limit=nil) end begin - ctype, body = @documents.fetch(xri) + ctype, body = @documents.fetch(URI::unescape(xri)) rescue IndexError status = 404 ctype = 'text/plain' @@ -548,19 +548,21 @@ class TestXRIDiscovery < BaseTestDiscovery include TestDataMixin include TestUtil + TEST_INAME = "=smoker" + def initialize(*args) super(*args) @fetcher_class = MockFetcherForXRIProxy - @documents = {'=smoker' => ['application/xrds+xml', + @documents = {TEST_INAME => ['application/xrds+xml', read_data_file('test_discover/yadis_2entries_delegate.xml', false)], - '=smoker*bad' => ['application/xrds+xml', + "#{TEST_INAME}*bad" => ['application/xrds+xml', read_data_file('test_discover/yadis_another_delegate.xml', false)]} end def test_xri - user_xri, services = OpenID.discover_xri('=smoker') + user_xri, services = OpenID.discover_xri(TEST_INAME) _checkService(services[0], "http://www.myopenid.com/server", @@ -569,7 +571,7 @@ def test_xri Yadis::XRI.make_xri("=!1000"), ['1.0'], true, - '=smoker') + TEST_INAME) _checkService(services[1], "http://www.livejournal.com/openid/server.bml", @@ -578,11 +580,11 @@ def test_xri Yadis::XRI.make_xri("=!1000"), ['1.0'], true, - '=smoker') + TEST_INAME) end def test_xri_normalize - user_xri, services = OpenID.discover_xri('xri://=smoker') + user_xri, services = OpenID.discover_xri("xri://#{TEST_INAME}") _checkService(services[0], "http://www.myopenid.com/server", @@ -591,7 +593,7 @@ def test_xri_normalize Yadis::XRI.make_xri("=!1000"), ['1.0'], true, - '=smoker') + TEST_INAME) _checkService(services[1], "http://www.livejournal.com/openid/server.bml", @@ -600,12 +602,12 @@ def test_xri_normalize Yadis::XRI.make_xri("=!1000"), ['1.0'], true, - '=smoker') + TEST_INAME) end def test_xriNoCanonicalID silence_logging { - user_xri, services = OpenID.discover_xri('=smoker*bad') + user_xri, services = OpenID.discover_xri("#{TEST_INAME}*bad") assert(services.empty?) } end @@ -623,17 +625,19 @@ def test_useCanonicalID class TestXRIDiscoveryIDP < BaseTestDiscovery include TestDataMixin + TEST_INAME = "=smoker" + def initialize(*args) super(*args) @fetcher_class = MockFetcherForXRIProxy - @documents = {'=smoker' => ['application/xrds+xml', + @documents = {TEST_INAME => ['application/xrds+xml', read_data_file('test_discover/yadis_2entries_idp.xml', false)] } end def test_xri - user_xri, services = OpenID.discover_xri('=smoker') + user_xri, services = OpenID.discover_xri(TEST_INAME) assert(!services.empty?, "Expected services, got zero") assert_equal(services[0].server_url, "http://www.livejournal.com/openid/server.bml") From 247a7cbee5bde2c41e933a8521decb6d521946b4 Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Mon, 26 Mar 2012 19:29:33 -0700 Subject: [PATCH 47/51] Fix unit test for trustroots. 2 urls that don't parse should be insane urls. --- test/support/yadis_data/trustroot.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/support/yadis_data/trustroot.txt b/test/support/yadis_data/trustroot.txt index 73681657..5947cea2 100644 --- a/test/support/yadis_data/trustroot.txt +++ b/test/support/yadis_data/trustroot.txt @@ -3,7 +3,7 @@ Trust root parsing checking ======================================== ---------------------------------------- -23: Does not parse +21: Does not parse ---------------------------------------- baz.org *.foo.com @@ -16,8 +16,6 @@ http://foo.*.com http://www.* http://*foo.com/ http://foo.com/invalid#fragment -http://..it/ -http://.it/ http://*:8081/ http://*:80 http://localhost:1900foo/ @@ -30,7 +28,7 @@ http://lambda.com/Λ 5 ---------------------------------------- -14: Insane +16: Insane ---------------------------------------- http:/// http://*/ @@ -46,6 +44,8 @@ http://*.museum/ https://*.museum/ http://www.schtuffcom/ http://it/ +http://..it/ +http://.it/ ---------------------------------------- 18: Sane From 84d1ef4847f4ae3f17e82e91151259ffb4c4a4fb Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Mon, 26 Mar 2012 21:13:10 -0700 Subject: [PATCH 48/51] Fix trustroot unit test to pass on ruby 1.9.2. --- test/test_trustroot.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_trustroot.rb b/test/test_trustroot.rb index 28e2b7b7..4b683d11 100644 --- a/test/test_trustroot.rb +++ b/test/test_trustroot.rb @@ -11,7 +11,7 @@ def _test_sanity(case_, sanity, desc) assert(tr.sane?) assert(OpenID::TrustRoot::TrustRoot.check_sanity(case_)) elsif sanity == 'insane' - assert(!tr.sane?) + assert(!tr || !tr.sane?) assert(!OpenID::TrustRoot::TrustRoot.check_sanity(case_)) else assert(tr.nil?, case_) From 5dfb5889f82c37913776701ee2866e59c7f55d4b Mon Sep 17 00:00:00 2001 From: joe1chen Date: Mon, 26 Mar 2012 21:18:24 -0700 Subject: [PATCH 49/51] Add formatting for README. --- README.md | 53 ++++++++++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 0746eb55..906d56bd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -=Ruby OpenID +# Ruby OpenID [![Build Status](https://secure.travis-ci.org/joe1chen/ruby-openid.png)](http://travis-ci.org/joe1chen/ruby-openid) @@ -8,40 +8,39 @@ This is a fork by courtenay @ entp (http://entp.com) and joe1chen which merges i fixes some tests and works on ruby 1.8.7 and ruby 1.9.2 (at least). This library seems otherwise abandoned by its authors. -==Features -* Easy to use API for verifying OpenID identites - OpenID::Consumer -* Support for serving OpenID identites - OpenID::Server -* Does not depend on underlying web framework -* Supports multiple storage mechanisms (Filesystem, ActiveRecord, Memory) -* Example code to help you get started, including: - * Ruby on Rails based consumer and server - * OpenIDLoginGenerator for quickly getting creating a rails app that uses - OpenID for authentication - * ActiveRecordOpenIDStore plugin -* Comprehensive test suite -* Supports both OpenID 1 and OpenID 2 transparently - -==Installing +## Features + * Easy to use API for verifying OpenID identites - OpenID::Consumer + * Support for serving OpenID identites - OpenID::Server + * Does not depend on underlying web framework + * Supports multiple storage mechanisms (Filesystem, ActiveRecord, Memory) + * Example code to help you get started, including: + * Ruby on Rails based consumer and server + * OpenIDLoginGenerator for quickly getting creating a rails app that uses OpenID for authentication + * ActiveRecordOpenIDStore plugin + * Comprehensive test suite + * Supports both OpenID 1 and OpenID 2 transparently + +## Installing Before running the examples or writing your own code you'll need to install the library. See the INSTALL file or use rubygems: - gem install ruby-openid + gem install ruby-openid Check the installation: - $ irb - irb> require 'rubygems' - irb> require_gem 'ruby-openid' - => true + $ irb + irb> require 'rubygems' + irb> require_gem 'ruby-openid' + => true The library is known to work with Ruby 1.8.4 on Unix, Max OSX and Win32. Examples have been tested with Rails 1.1 and 1.2, and 2.0. -==Getting Started +## Getting Started The best way to start is to look at the rails_openid example. You can run it with: - cd examples/rails_openid - script/server + cd examples/rails_openid + script/server If you are writing an OpenID Relying Party, a good place to start is: examples/rails_openid/app/controllers/consumer_controller.rb @@ -53,13 +52,13 @@ The library code is quite well documented, so don't be squeamish, and look at the library itself if there's anything you don't understand in the examples. -==Homepage +## Homepage http://github.com/openid/ruby-openid See also: http://openid.net/ -==Community +## Community Discussion regarding the Ruby OpenID library and other JanRain OpenID libraries takes place on the the OpenID mailing list on openid.net. @@ -76,12 +75,12 @@ contribute, see http://openidenabled.com/contribute/ -==Author +## Author Copyright 2006-2008, JanRain, Inc. Contact openid@janrain.com or visit the OpenID channel on pibb.com: http://pibb.com/go/openid -==License +## License Apache Software License. For more information see the LICENSE file. From 74ed5099c2ee9acdbe56870e1e6eaa92d22b849a Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Mon, 26 Mar 2012 22:03:58 -0700 Subject: [PATCH 50/51] Fix circular require --- lib/openid.rb | 1 - lib/openid/fetchers.rb | 2 +- lib/openid/yadis/xri.rb | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/openid.rb b/lib/openid.rb index 6277044a..2e1d03e5 100644 --- a/lib/openid.rb +++ b/lib/openid.rb @@ -14,6 +14,5 @@ require "openid/version" require 'openid/store' -require 'openid/yadis' require "openid/consumer" require 'openid/server' \ No newline at end of file diff --git a/lib/openid/fetchers.rb b/lib/openid/fetchers.rb index 26a0e936..d494e4be 100644 --- a/lib/openid/fetchers.rb +++ b/lib/openid/fetchers.rb @@ -1,5 +1,5 @@ require 'net/http' -require 'openid' +require 'openid/version' require 'openid/util' begin diff --git a/lib/openid/yadis/xri.rb b/lib/openid/yadis/xri.rb index 89dd99af..d0c0ff4f 100644 --- a/lib/openid/yadis/xri.rb +++ b/lib/openid/yadis/xri.rb @@ -1,4 +1,3 @@ -require 'openid/yadis/xrds' require 'openid/fetchers' module OpenID From d8b51dae66cedf1a6b45556a3bf69da935d7d0b1 Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Mon, 26 Mar 2012 22:04:26 -0700 Subject: [PATCH 51/51] Bump version --- lib/openid/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/openid/version.rb b/lib/openid/version.rb index 0786f89a..8ea7c16f 100644 --- a/lib/openid/version.rb +++ b/lib/openid/version.rb @@ -1,3 +1,3 @@ module OpenID - VERSION = "2.1.9.5" + VERSION = "2.1.9.6" end