From c1b85ce8d3aef9bd0fcc70d5f1c13744fcc78b08 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 13:58:47 -0600 Subject: [PATCH 01/89] =?UTF-8?q?=F0=9F=90=9B=20Compatibility=20with=20Rac?= =?UTF-8?q?k::Timeout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - https://github.com/grosser/rack-openid/pull/5 --- lib/rack/openid.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rack/openid.rb b/lib/rack/openid.rb index 3784498..cf8f83d 100644 --- a/lib/rack/openid.rb +++ b/lib/rack/openid.rb @@ -134,7 +134,7 @@ def begin_authentication(env, qs) url = open_id_redirect_url(req, oidreq, params) return redirect_to(url) - rescue ::OpenID::OpenIDError, Timeout::Error => e + rescue ::OpenID::OpenIDError, ::Timeout::Error env[RESPONSE] = MissingResponse.new return @app.call(env) end @@ -302,7 +302,7 @@ def default_store def timeout_protection_from_identity_server yield - rescue Timeout::Error + rescue ::Timeout::Error TimeoutResponse.new end end From abaee4b64e71614c8af8de605fec2c2c7ae5347c Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 15:16:09 -0600 Subject: [PATCH 02/89] =?UTF-8?q?=F0=9F=94=A7=20Ruby=202.7=20for=20develop?= =?UTF-8?q?ment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .tool-versions | 1 + 1 file changed, 1 insertion(+) create mode 100644 .tool-versions diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..59511e1 --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +ruby 2.7.8 From bd94fc2fd19f18beea6355418746c5673fcc8181 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 16:17:21 -0600 Subject: [PATCH 03/89] =?UTF-8?q?=F0=9F=93=9D=20Fix=20typo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Readme.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Readme.md b/Readme.md index fb395fa..ce67462 100644 --- a/Readme.md +++ b/Readme.md @@ -18,8 +18,9 @@ MyApp = lambda do |env| ... when :failure ... - else - [401, {"WWW-Authenticate" => 'OpenID identifier="http://example.com/"'}, []] + else + [401, {"WWW-Authenticate" => 'OpenID identifier="http://example.com/"'}, []] + end end end From 77553c2ab6656169cc45274cfed0b8698ff884a6 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 16:17:42 -0600 Subject: [PATCH 04/89] =?UTF-8?q?=F0=9F=94=A5=20Travis=20CI=20is=20dead?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 6 ------ Readme.md | 2 -- 2 files changed, 8 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 18700f6..0000000 --- a/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: ruby -bundler_args: "" -rvm: - - ree - - 1.9.3 - - 2.0.0 diff --git a/Readme.md b/Readme.md index ce67462..7c26415 100644 --- a/Readme.md +++ b/Readme.md @@ -92,6 +92,4 @@ Authors [Michael Grosser](http://grosser.it)
michael@grosser.it
License: MIT
-[![Build Status](https://travis-ci.org/grosser/rack-openid.png)](https://travis-ci.org/grosser/rack-openid) - From 339c1ed334b71ad095c2330584bbc5c80f07eaa5 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 16:18:58 -0600 Subject: [PATCH 05/89] =?UTF-8?q?=F0=9F=99=88=20Add=20.gitignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2095d5d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/doc/ From 183d51224825e534f144eb355b41b923e12e24cd Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 16:19:53 -0600 Subject: [PATCH 06/89] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Compatibility=20with?= =?UTF-8?q?=20Rack=20v2=20&=20v3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 20 ++++- Gemfile.lock | 163 +++++++++++++++++++++++++++++++++++---- Rakefile | 48 ++++++++++-- rack-openid.gemspec | 45 ++++++++--- test/helper.rb | 1 + test/test_integration.rb | 29 +++---- test/test_rack_openid.rb | 4 +- 7 files changed, 258 insertions(+), 52 deletions(-) diff --git a/Gemfile b/Gemfile index 8f4f412..4bed78e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,9 +1,21 @@ -source 'https://rubygems.org' +# frozen_string_literal: true + +#### IMPORTANT ####################################################### +# Gemfile is for local development ONLY; Gemfile is NOT loaded in CI # +####################################################### IMPORTANT #### + +source "https://rubygems.org" + +git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } gemspec +platform :mri do + # Debugging + gem "byebug", ">= 11" +end + gem 'minitest' gem 'minitest-rg' -gem 'rake' -gem 'bump' -gem 'rots', :git => 'git://github.com/roman/rots.git' +gem 'rots', github: 'roman/rots' +gem 'rack-session' diff --git a/Gemfile.lock b/Gemfile.lock index aeb44e1..a02a809 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,34 +1,167 @@ GIT - remote: git://github.com/roman/rots.git - revision: babb5559aae8914556da528147b6649b9c48f48c + remote: https://github.com/roman/rots + revision: d11e7d820fa8b9ad49aaca5b9317ec84f5a73b46 specs: - rots (0.2.1) + rots (0.2.2) PATH remote: . specs: - rack-openid (1.4.2) - rack (>= 1.1.0) - ruby-openid (>= 2.1.8) + rack-openid2 (1.4.2) + rack (>= 2.2) + ruby-openid2 (>= 3.0) + version_gem (~> 1.1, >= 1.1.4) GEM remote: https://rubygems.org/ specs: - bump (0.4.3) - minitest (5.0.8) - minitest-rg (5.0.0) + ansi (1.5.0) + ast (2.4.2) + backports (3.25.0) + byebug (11.1.3) + diff-lcs (1.5.1) + diffy (3.4.2) + docile (1.4.1) + json (2.7.2) + kettle-soup-cover (1.0.4) + simplecov (~> 0.22) + simplecov-cobertura (~> 2.1) + simplecov-console (~> 0.9, >= 0.9.1) + simplecov-html (~> 0.12) + simplecov-lcov (~> 0.8) + simplecov-rcov (~> 0.3, >= 0.3.3) + simplecov_json_formatter (~> 0.1, >= 0.1.4) + version_gem (~> 1.1, >= 1.1.4) + language_server-protocol (3.17.0.3) + lint_roller (1.1.0) + minitest (5.25.1) + minitest-rg (5.3.0) minitest (~> 5.0) - rack (1.5.2) - rake (10.1.0) - ruby-openid (2.3.0) + parallel (1.26.3) + parser (3.3.5.0) + ast (~> 2.4.1) + racc + racc (1.8.1) + rack (3.1.7) + rack-session (2.0.0) + rack (>= 3.0.0) + rainbow (3.1.1) + rake (13.2.1) + regexp_parser (2.9.2) + rexml (3.3.7) + rspec-block_is_expected (1.0.6) + rubocop (1.64.1) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.31.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.32.3) + parser (>= 3.3.1.0) + rubocop-gradual (0.3.6) + diff-lcs (>= 1.2.0, < 2.0) + diffy (~> 3.0) + parallel (~> 1.10) + rainbow (>= 2.2.2, < 4.0) + rubocop (~> 1.0) + rubocop-lts (18.2.1) + rubocop-ruby2_7 (>= 2.0.4, < 3) + standard-rubocop-lts (>= 1.0.3, < 3) + version_gem (>= 1.1.2, < 3) + rubocop-md (1.2.2) + rubocop (>= 1.0) + rubocop-minitest (0.36.0) + rubocop (>= 1.61, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-packaging (0.5.2) + rubocop (>= 1.33, < 2.0) + rubocop-performance (1.21.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rake (0.6.0) + rubocop (~> 1.0) + rubocop-ruby2_7 (2.0.6) + rubocop-gradual (~> 0.3, >= 0.3.1) + rubocop-md (~> 1.2) + rubocop-rake (~> 0.6) + rubocop-shopify (~> 2.14) + rubocop-thread_safety (~> 0.5, >= 0.5.1) + standard-rubocop-lts (~> 1.0, >= 1.0.7) + version_gem (>= 1.1.3, < 3) + rubocop-shopify (2.15.1) + rubocop (~> 1.51) + rubocop-thread_safety (0.5.1) + rubocop (>= 0.90.0) + ruby-openid2 (3.0.0) + version_gem (~> 1.1, >= 1.1.4) + ruby-progressbar (1.13.0) + simplecov (0.22.0) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) + simplecov-cobertura (2.1.0) + rexml + simplecov (~> 0.19) + simplecov-console (0.9.1) + ansi + simplecov + terminal-table + simplecov-html (0.12.3) + simplecov-lcov (0.8.0) + simplecov-rcov (0.3.7) + simplecov (>= 0.4.1) + simplecov_json_formatter (0.1.4) + standard (1.37.0) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.0) + rubocop (~> 1.64.0) + standard-custom (~> 1.0.0) + standard-performance (~> 1.4) + standard-custom (1.0.2) + lint_roller (~> 1.0) + rubocop (~> 1.50) + standard-performance (1.4.0) + lint_roller (~> 1.1) + rubocop-performance (~> 1.21.0) + standard-rubocop-lts (1.0.10) + rspec-block_is_expected (~> 1.0, >= 1.0.5) + standard (>= 1.35.1, < 2) + standard-custom (>= 1.0.2, < 2) + standard-performance (>= 1.3.1, < 2) + version_gem (>= 1.1.4, < 3) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + unicode-display_width (2.5.0) + version_gem (1.1.4) + yard (0.9.37) + yard-junk (0.0.9) + backports (>= 3.18) + rainbow + yard PLATFORMS ruby DEPENDENCIES - bump + byebug (>= 11) + kettle-soup-cover (~> 1.0, >= 1.0.2) minitest minitest-rg - rack-openid! - rake + rack-openid2! + rack-session + rake (>= 13) rots! + rubocop-lts (~> 18.2, >= 18.2.1) + rubocop-minitest (~> 0.36) + rubocop-packaging (~> 0.5, >= 0.5.2) + standard (>= 1.35.1) + yard (~> 0.9, >= 0.9.34) + yard-junk (~> 0.0) + +BUNDLED WITH + 2.4.22 diff --git a/Rakefile b/Rakefile index 3df9fc3..db98907 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,44 @@ -require 'bundler/setup' -require 'bundler/gem_tasks' -require 'bump/tasks' -require 'rake/testtask' +#!/usr/bin/env rake +require "bundler/gem_tasks" -Rake::TestTask.new(:default) +require "rake/testtask" + +desc "Run tests" +Rake::TestTask.new("test") do |t| + t.libs << "lib" + t.libs << "test" + t.test_files = FileList["test/**/test_*.rb"] + t.verbose = false +end + +begin + require "rubocop/lts" + Rubocop::Lts.install_tasks +rescue LoadError + task(:rubocop_gradual) do + warn("RuboCop (Gradual) is disabled") + end +end + +begin + require "ostruct" # until https://github.com/zverok/yard-junk/pull/42 is merged! + require "yard-junk/rake" + + YardJunk::Rake.define_task +rescue LoadError + task("yard:junk") do + warn("yard:junk is disabled") + end +end + +begin + require "yard" + + YARD::Rake::YardocTask.new(:yard) +rescue LoadError + task(:yard) do + warn("yard is disabled") + end +end + +task default: %i[test rubocop_gradual yard yard:junk] diff --git a/rack-openid.gemspec b/rack-openid.gemspec index da87144..bbfe4b2 100644 --- a/rack-openid.gemspec +++ b/rack-openid.gemspec @@ -1,20 +1,41 @@ $LOAD_PATH.unshift File.expand_path("../lib", __FILE__) -name = "rack-openid" require "rack/openid/version" -Gem::Specification.new name, Rack::OpenID::VERSION do |s| - s.summary = "Provides a more HTTPish API around the ruby-openid library" - s.authors = ["Michael Grosser", "Joshua Peek"] - s.email = "michael@grosser.it" - s.homepage = "https://github.com/grosser/#{name}" - s.files = `git ls-files lib`.split("\n") - s.license = "MIT" +Gem::Specification.new do |spec| + spec.name = "rack-openid2" + spec.version = Rack::OpenID::VERSION + spec.summary = "Provides a more HTTPish API around the ruby-openid library" + spec.authors = ["Peter Boling", "Michael Grosser", "Joshua Peek"] + spec.email = "peter.boling@gmail.com" + spec.homepage = "https://github.com/VitalConnectInc/#{spec.name}" + spec.files = `git ls-files lib`.split("\n") + spec.license = "MIT" cert = File.expand_path("~/.ssh/gem-private-key-grosser.pem") if File.exist?(cert) - s.signing_key = cert - s.cert_chain = ["gem-public_cert.pem"] + spec.signing_key = cert + spec.cert_chain = ["gem-public_cert.pem"] end - s.add_runtime_dependency "rack", ">=1.1.0" - s.add_runtime_dependency "ruby-openid", ">= 2.1.8" + spec.add_dependency("rack", ">= 2.2") + spec.add_dependency("ruby-openid2", ">= 3.0") + spec.add_dependency("version_gem", "~> 1.1", ">= 1.1.4") + + # Testing + spec.add_development_dependency("minitest", ">= 5") + spec.add_development_dependency("minitest-rg", ">= 5") + spec.add_development_dependency("rack-session", ">= 2") + spec.add_development_dependency("rake", ">= 13") + + # Coverage + spec.add_development_dependency("kettle-soup-cover", "~> 1.0", ">= 1.0.2") + + # Linting + spec.add_development_dependency("rubocop-lts", "~> 18.2", ">= 18.2.1") + spec.add_development_dependency("rubocop-minitest", "~> 0.36") + spec.add_development_dependency("rubocop-packaging", "~> 0.5", ">= 0.5.2") + spec.add_development_dependency("standard", ">= 1.35.1") + + # Documentation + spec.add_development_dependency("yard", "~> 0.9", ">= 0.9.34") + spec.add_development_dependency("yard-junk", "~> 0.0") end diff --git a/test/helper.rb b/test/helper.rb index 161a04f..518f5d0 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -4,6 +4,7 @@ require 'net/http' require 'rack' +require 'rack/session' require 'rack/openid' require 'rack/openid/simple_auth' diff --git a/test/test_integration.rb b/test/test_integration.rb index 9ea7ed4..719be25 100644 --- a/test/test_integration.rb +++ b/test/test_integration.rb @@ -112,7 +112,7 @@ def follow_redirect! include RackTestHelpers it "with_get" do - @app = app + @app = app({}) process('/', :method => 'GET') follow_redirect! assert_equal 200, @response.status @@ -122,7 +122,7 @@ def follow_redirect! end it "with_deprecated_identity" do - @app = app + @app = app({}) process('/', :method => 'GET', :identity => "#{RotsServerUrl}/john.doe?openid.success=true") follow_redirect! assert_equal 200, @response.status @@ -132,7 +132,7 @@ def follow_redirect! end it "with_post_method" do - @app = app + @app = app({}) process('/', :method => 'POST') follow_redirect! assert_equal 200, @response.status @@ -291,7 +291,7 @@ def follow_redirect! end it "with_inferred_realm" do - @app = app + @app = app({}) process('/', :method => 'GET') location = @response.headers['Location'] @@ -321,7 +321,7 @@ def follow_redirect! end it "sanitize_query_string" do - @app = app + @app = app({}) process('/', :method => 'GET') follow_redirect! assert_equal 200, @response.status @@ -330,7 +330,7 @@ def follow_redirect! end it "passthrough_standard_http_basic_auth" do - @app = app + @app = app({}) process('/', :method => 'GET', "MOCK_HTTP_BASIC_AUTH" => '1') assert_equal 401, @response.status end @@ -340,7 +340,7 @@ def follow_redirect! def app(options = {}) options[:identifier] ||= "#{RotsServerUrl}/john.doe?openid.success=true" - app = lambda { |env| + rack_app = lambda { |env| if resp = env[Rack::OpenID::RESPONSE] headers = { 'X-Path' => env['PATH_INFO'], @@ -361,7 +361,7 @@ def app(options = {}) [401, {Rack::OpenID::AUTHENTICATE_HEADER => Rack::OpenID.build_header(options)}, []] end } - Rack::Session::Pool.new(Rack::OpenID.new(app)) + Rack::Session::Pool.new(Rack::OpenID.new(rack_app)) end end @@ -369,7 +369,7 @@ def app(options = {}) include RackTestHelpers it "can login" do - @app = app "#{RotsServerUrl}/john.doe?openid.success=true" + @app = simple_app("#{RotsServerUrl}/john.doe?openid.success=true") process '/dashboard' follow_redirect! @@ -384,7 +384,8 @@ def app(options = {}) end it "fails login" do - @app = app "#{RotsServerUrl}/john.doe" + @app = simple_app("#{RotsServerUrl}/john.doe") + @app = simple_app("#{RotsServerUrl}/john.doe") process '/dashboard' follow_redirect! @@ -393,10 +394,10 @@ def app(options = {}) private - def app(identifier) - app = lambda { |env| [200, {'Content-Type' => 'text/html'}, ['Hello']] } - app = Rack::OpenID::SimpleAuth.new(app, identifier) - Rack::Session::Pool.new(app) + def simple_app(identifier) + rack_app = lambda { |env| [200, {'Content-Type' => 'text/html'}, ['Hello']] } + rack_app = Rack::OpenID::SimpleAuth.new(rack_app, identifier) + Rack::Session::Pool.new(rack_app) end end end diff --git a/test/test_rack_openid.rb b/test/test_rack_openid.rb index d9070d5..18ee93b 100644 --- a/test/test_rack_openid.rb +++ b/test/test_rack_openid.rb @@ -15,8 +15,8 @@ def call(*args) call(params) - params["openid.sig"].must_equal "a+string+with+spaces" - params["openid.response_nonce"].must_equal "again+with+spaces!" + _(params["openid.sig"]).must_equal("a+string+with+spaces") + _(params["openid.response_nonce"]).must_equal("again+with+spaces!") end end end From 0e6400dbb414f700031ac760b089bc46a089debf Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 16:27:54 -0600 Subject: [PATCH 07/89] =?UTF-8?q?=F0=9F=8E=A8=20Modernize:=20Push=20the=20?= =?UTF-8?q?button?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .rubocop.yml | 8 + Gemfile | 8 +- LICENSE => LICENSE.txt | 0 Readme.md => README.md | 0 lib/rack/openid.rb | 125 ++++++------- lib/rack/openid/simple_auth.rb | 30 +-- rack-openid.gemspec | 13 +- test/helper.rb | 17 +- test/test_integration.rb | 329 ++++++++++++++++++--------------- 9 files changed, 293 insertions(+), 237 deletions(-) create mode 100644 .rubocop.yml rename LICENSE => LICENSE.txt (100%) rename Readme.md => README.md (100%) diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..ee7c8d5 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,8 @@ +inherit_gem: + rubocop-lts: config/rubygem.yml + +require: + - rubocop-minitest + +Style/EmptyElse: + Enabled: false diff --git a/Gemfile b/Gemfile index 4bed78e..86438b2 100644 --- a/Gemfile +++ b/Gemfile @@ -15,7 +15,7 @@ platform :mri do gem "byebug", ">= 11" end -gem 'minitest' -gem 'minitest-rg' -gem 'rots', github: 'roman/rots' -gem 'rack-session' +gem "minitest" +gem "minitest-rg" +gem "rots", github: "roman/rots" +gem "rack-session" diff --git a/LICENSE b/LICENSE.txt similarity index 100% rename from LICENSE rename to LICENSE.txt diff --git a/Readme.md b/README.md similarity index 100% rename from Readme.md rename to README.md diff --git a/lib/rack/openid.rb b/lib/rack/openid.rb index cf8f83d..b2c0ec4 100644 --- a/lib/rack/openid.rb +++ b/lib/rack/openid.rb @@ -1,12 +1,12 @@ -require 'rack/request' -require 'rack/utils' +require "rack/request" +require "rack/utils" -require 'openid' -require 'openid/consumer' -require 'openid/extensions/sreg' -require 'openid/extensions/ax' -require 'openid/extensions/oauth' -require 'openid/extensions/pape' +require "openid" +require "openid/consumer" +require "openid/extensions/sreg" +require "openid/extensions/ax" +require "openid/extensions/oauth" +require "openid/extensions/pape" module Rack # A Rack middleware that provides a more HTTPish API around the @@ -19,38 +19,40 @@ module Rack # On competition, the OpenID response is automatically verified and # assigned to env["rack.openid.response"]. class OpenID - # Helper method for building the "WWW-Authenticate" header value. - # - # Rack::OpenID.build_header(:identifier => "http://josh.openid.com/") - # #=> OpenID identifier="http://josh.openid.com/" - def self.build_header(params = {}) - 'OpenID ' + params.map { |key, value| - if value.is_a?(Array) - "#{key}=\"#{value.join(',')}\"" - else - "#{key}=\"#{value}\"" - end - }.join(', ') - end + class << self + # Helper method for building the "WWW-Authenticate" header value. + # + # Rack::OpenID.build_header(:identifier => "http://josh.openid.com/") + # #=> OpenID identifier="http://josh.openid.com/" + def build_header(params = {}) + "OpenID " + params.map { |key, value| + if value.is_a?(Array) + "#{key}=\"#{value.join(",")}\"" + else + "#{key}=\"#{value}\"" + end + }.join(", ") + end - # Helper method for parsing "WWW-Authenticate" header values into - # a hash. - # - # Rack::OpenID.parse_header("OpenID identifier='http://josh.openid.com/'") - # #=> {:identifier => "http://josh.openid.com/"} - def self.parse_header(str) - params = {} - if str =~ AUTHENTICATE_REGEXP - str = str.gsub(/#{AUTHENTICATE_REGEXP}\s+/, '') - str.split(', ').each { |pair| - key, *value = pair.split('=') - value = value.join('=') - value.gsub!(/^\"/, '').gsub!(/\"$/, "") - value = value.split(',') - params[key] = value.length > 1 ? value : value.first - } + # Helper method for parsing "WWW-Authenticate" header values into + # a hash. + # + # Rack::OpenID.parse_header("OpenID identifier='http://josh.openid.com/'") + # #=> {:identifier => "http://josh.openid.com/"} + def parse_header(str) + params = {} + if AUTHENTICATE_REGEXP.match?(str) + str = str.gsub(/#{AUTHENTICATE_REGEXP}\s+/o, "") + str.split(", ").each { |pair| + key, *value = pair.split("=") + value = value.join("=") + value.gsub!(/^\"/, "").gsub!(/\"$/, "") + value = value.split(",") + params[key] = (value.length > 1) ? value : value.first + } + end + params end - params end class TimeoutResponse @@ -108,8 +110,8 @@ def call(env) private def sanitize_params!(params) - ['openid.sig', 'openid.response_nonce'].each do |param| - (params[param] || '').gsub!(' ', '+') + ["openid.sig", "openid.response_nonce"].each do |param| + (params[param] || "").tr!(" ", "+") end end @@ -119,11 +121,11 @@ def begin_authentication(env, qs) session = env["rack.session"] unless session - raise RuntimeError, "Rack::OpenID requires a session" + raise "Rack::OpenID requires a session" end - consumer = ::OpenID::Consumer.new(session, @store) - identifier = params['identifier'] || params['identity'] + consumer = ::OpenID::Consumer.new(session, @store) + identifier = params["identifier"] || params["identity"] begin oidreq = consumer.begin(identifier) @@ -133,10 +135,10 @@ def begin_authentication(env, qs) add_pape_fields(oidreq, params) url = open_id_redirect_url(req, oidreq, params) - return redirect_to(url) + redirect_to(url) rescue ::OpenID::OpenIDError, ::Timeout::Error env[RESPONSE] = MissingResponse.new - return @app.call(env) + @app.call(env) end end @@ -145,7 +147,7 @@ def complete_authentication(env) session = env["rack.session"] unless session - raise RuntimeError, "Rack::OpenID requires a session" + raise "Rack::OpenID requires a session" end oidresp = timeout_protection_from_identity_server { @@ -208,7 +210,6 @@ def realm(req, domain = nil) else scheme_with_host_and_port(req) end - end def request_url(req) @@ -225,11 +226,11 @@ def redirect_to(url) def open_id_redirect_url(req, oidreq, options) trust_root = options["trust_root"] - return_to = options["return_to"] - method = options["method"] - immediate = options["immediate"] == "true" + return_to = options["return_to"] + method = options["method"] + immediate = options["immediate"] == "true" - realm = realm(req, options["realm_domain"]) + realm = realm(req, options["realm_domain"]) request_url = request_url(req) if return_to @@ -240,20 +241,20 @@ def open_id_redirect_url(req, oidreq, options) end method = method.to_s.downcase - oidreq.return_to_args['_method'] = method unless method == "get" + oidreq.return_to_args["_method"] = method unless method == "get" oidreq.redirect_url(trust_root || realm, return_to || request_url, immediate) end def add_simple_registration_fields(oidreq, fields) sregreq = ::OpenID::SReg::Request.new - required = Array(fields['required']).reject(&URL_FIELD_SELECTOR) + required = Array(fields["required"]).reject(&URL_FIELD_SELECTOR) sregreq.request_fields(required, true) if required.any? - optional = Array(fields['optional']).reject(&URL_FIELD_SELECTOR) + optional = Array(fields["optional"]).reject(&URL_FIELD_SELECTOR) sregreq.request_fields(optional, false) if optional.any? - policy_url = fields['policy_url'] + policy_url = fields["policy_url"] sregreq.policy_url = policy_url if policy_url oidreq.add_extension(sregreq) @@ -262,8 +263,8 @@ def add_simple_registration_fields(oidreq, fields) def add_attribute_exchange_fields(oidreq, fields) axreq = ::OpenID::AX::FetchRequest.new - required = Array(fields['required']).select(&URL_FIELD_SELECTOR) - optional = Array(fields['optional']).select(&URL_FIELD_SELECTOR) + required = Array(fields["required"]).select(&URL_FIELD_SELECTOR) + optional = Array(fields["optional"]).select(&URL_FIELD_SELECTOR) if required.any? || optional.any? required.each do |field| @@ -279,15 +280,15 @@ def add_attribute_exchange_fields(oidreq, fields) end def add_oauth_fields(oidreq, fields) - if (consumer = fields['oauth[consumer]']) && (scope = fields['oauth[scope]']) - oauthreq = ::OpenID::OAuth::Request.new(consumer, Array(scope).join(' ')) + if (consumer = fields["oauth[consumer]"]) && (scope = fields["oauth[scope]"]) + oauthreq = ::OpenID::OAuth::Request.new(consumer, Array(scope).join(" ")) oidreq.add_extension(oauthreq) end end def add_pape_fields(oidreq, fields) - preferred_auth_policies = fields['pape[preferred_auth_policies]'] - max_auth_age = fields['pape[max_auth_age]'] + preferred_auth_policies = fields["pape[preferred_auth_policies]"] + max_auth_age = fields["pape[max_auth_age]"] if preferred_auth_policies || max_auth_age preferred_auth_policies = preferred_auth_policies.split if preferred_auth_policies.is_a?(String) pape_request = ::OpenID::PAPE::Request.new(preferred_auth_policies || [], max_auth_age) @@ -296,7 +297,7 @@ def add_pape_fields(oidreq, fields) end def default_store - require 'openid/store/memory' + require "openid/store/memory" ::OpenID::Store::Memory.new end diff --git a/lib/rack/openid/simple_auth.rb b/lib/rack/openid/simple_auth.rb index 11e2098..4c7fb48 100644 --- a/lib/rack/openid/simple_auth.rb +++ b/lib/rack/openid/simple_auth.rb @@ -1,5 +1,5 @@ -require 'rack/openid' -require 'rack/request' +require "rack/openid" +require "rack/request" module Rack class OpenID @@ -11,14 +11,16 @@ class OpenID # SimpleAuth will automatically insert the required Rack::OpenID # middleware, so use Rack::OpenID is unnecessary. class SimpleAuth - def self.new(*args) - Rack::OpenID.new(super) + class << self + def new(*args) + Rack::OpenID.new(super) + end end attr_reader :app, :identifier def initialize(app, identifier) - @app = app + @app = app @identifier = identifier end @@ -27,7 +29,7 @@ def call(env) app.call(env) elsif successful_response?(env) authenticate_session(env) - redirect_to requested_url(env) + redirect_to(requested_url(env)) else authentication_request end @@ -36,23 +38,23 @@ def call(env) private def session(env) - env['rack.session'] || raise_session_error + env["rack.session"] || raise_session_error end def raise_session_error - raise RuntimeError, 'Rack::OpenID::SimpleAuth requires a session' + raise "Rack::OpenID::SimpleAuth requires a session" end def session_authenticated?(env) - session(env)['authenticated'] == true + session(env)["authenticated"] == true end def authenticate_session(env) - session(env)['authenticated'] = true + session(env)["authenticated"] = true end def successful_response?(env) - if resp = env[OpenID::RESPONSE] + if (resp = env[OpenID::RESPONSE]) resp.status == :success && resp.display_identifier == identifier end end @@ -63,15 +65,15 @@ def requested_url(env) end def redirect_to(url) - [303, {'Content-Type' => 'text/html', 'Location' => url}, []] + [303, {"Content-Type" => "text/html", "Location" => url}, []] end def authentication_request - [401, { OpenID::AUTHENTICATE_HEADER => www_authenticate_header }, []] + [401, {OpenID::AUTHENTICATE_HEADER => www_authenticate_header}, []] end def www_authenticate_header - OpenID.build_header(:identifier => identifier) + OpenID.build_header(identifier: identifier) end end end diff --git a/rack-openid.gemspec b/rack-openid.gemspec index bbfe4b2..6c5f671 100644 --- a/rack-openid.gemspec +++ b/rack-openid.gemspec @@ -1,4 +1,4 @@ -$LOAD_PATH.unshift File.expand_path("../lib", __FILE__) +$LOAD_PATH.unshift(File.expand_path("../lib", __FILE__)) require "rack/openid/version" Gem::Specification.new do |spec| @@ -8,7 +8,16 @@ Gem::Specification.new do |spec| spec.authors = ["Peter Boling", "Michael Grosser", "Joshua Peek"] spec.email = "peter.boling@gmail.com" spec.homepage = "https://github.com/VitalConnectInc/#{spec.name}" - spec.files = `git ls-files lib`.split("\n") + + # Specify which files should be added to the gem when it is released. + spec.files = Dir[ + # Splats (alphabetical) + "lib/**/*.rb", + # Files (alphabetical) + "LICENSE.txt", + "README.md", + ] + spec.license = "MIT" cert = File.expand_path("~/.ssh/gem-private-key-grosser.pem") if File.exist?(cert) diff --git a/test/helper.rb b/test/helper.rb index 518f5d0..8f5bc00 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,13 +1,12 @@ -require 'bundler/setup' -require 'minitest/autorun' -require 'minitest/rg' -require 'net/http' +require "minitest/autorun" +require "minitest/rg" +require "net/http" -require 'rack' -require 'rack/session' -require 'rack/openid' -require 'rack/openid/simple_auth' +require "rack" +require "rack/session" +require "rack/openid" +require "rack/openid/simple_auth" -log = Logger.new(STDOUT) +log = Logger.new($stdout) log.level = Logger::WARN OpenID::Util.logger = log diff --git a/test/test_integration.rb b/test/test_integration.rb index 719be25..479946c 100644 --- a/test/test_integration.rb +++ b/test/test_integration.rb @@ -8,7 +8,7 @@ def initialize(app) def fetch(url, body = nil, headers = nil, limit = nil) opts = (headers || {}).dup - opts[:input] = body + opts[:input] = body opts[:method] = "POST" if body env = Rack::MockRequest.env_for(url, opts) @@ -27,28 +27,28 @@ def fetch(url, body = nil, headers = nil, limit = nil) end end - RotsServerUrl = 'http://localhost:9292' + ROTS_SERVER_URL = "http://localhost:9292" RotsApp = Rack::Builder.new do - require 'rots' + require "rots" config = { - 'identity' => 'john.doe', - 'sreg' => { - 'nickname' => 'jdoe', - 'fullname' => 'John Doe', - 'email' => 'jhon@doe.com', - 'dob' => Date.parse('1985-09-21'), - 'gender' => 'M' - } + "identity" => "john.doe", + "sreg" => { + "nickname" => "jdoe", + "fullname" => "John Doe", + "email" => "jhon@doe.com", + "dob" => Date.parse("1985-09-21"), + "gender" => "M", + }, } - map("/%s" % config['identity']) do - run Rots::IdentityPageApp.new(config, {}) + map("/%s" % config["identity"]) do + run(Rots::IdentityPageApp.new(config, {})) end - map '/server' do - run Rots::ServerApp.new(config, :storage => Dir.tmpdir) + map("/server") do + run(Rots::ServerApp.new(config, storage: Dir.tmpdir)) end end @@ -63,13 +63,13 @@ def process(*args) end def follow_redirect! - assert @response - assert_equal 303, @response.status + assert(@response) + assert_equal(303, @response.status) - env = Rack::MockRequest.env_for(@response.headers['Location']) + env = Rack::MockRequest.env_for(@response.headers["Location"]) _status, headers, _body = RotsApp.call(env) - uri = URI(headers['Location']) + uri = URI(headers["Location"]) process("#{uri.path}?#{uri.query}") end end @@ -77,34 +77,45 @@ def follow_redirect! describe "headers" do it "builds header" do assert_equal 'OpenID identity="http://example.com/"', - Rack::OpenID.build_header(:identity => "http://example.com/") + Rack::OpenID.build_header(identity: "http://example.com/") assert_equal 'OpenID identity="http://example.com/?foo=bar"', - Rack::OpenID.build_header(:identity => "http://example.com/?foo=bar") + Rack::OpenID.build_header(identity: "http://example.com/?foo=bar") + + header = Rack::OpenID.build_header(identity: "http://example.com/", return_to: "http://example.org/") - header = Rack::OpenID.build_header(:identity => "http://example.com/", :return_to => "http://example.org/") assert_match(/OpenID /, header) assert_match(/identity="http:\/\/example\.com\/"/, header) assert_match(/return_to="http:\/\/example\.org\/"/, header) - header = Rack::OpenID.build_header(:identity => "http://example.com/", :required => ["nickname", "email"]) + header = Rack::OpenID.build_header(identity: "http://example.com/", required: ["nickname", "email"]) + assert_match(/OpenID /, header) assert_match(/identity="http:\/\/example\.com\/"/, header) assert_match(/required="nickname,email"/, header) end it "parses header" do - assert_equal({"identity" => "http://example.com/"}, - Rack::OpenID.parse_header('OpenID identity="http://example.com/"')) - assert_equal({"identity" => "http://example.com/?foo=bar"}, - Rack::OpenID.parse_header('OpenID identity="http://example.com/?foo=bar"')) - assert_equal({"identity" => "http://example.com/", "return_to" => "http://example.org/"}, - Rack::OpenID.parse_header('OpenID identity="http://example.com/", return_to="http://example.org/"')) - assert_equal({"identity" => "http://example.com/", "required" => ["nickname", "email"]}, - Rack::OpenID.parse_header('OpenID identity="http://example.com/", required="nickname,email"')) + assert_equal( + {"identity" => "http://example.com/"}, + Rack::OpenID.parse_header('OpenID identity="http://example.com/"'), + ) + assert_equal( + {"identity" => "http://example.com/?foo=bar"}, + Rack::OpenID.parse_header('OpenID identity="http://example.com/?foo=bar"'), + ) + assert_equal( + {"identity" => "http://example.com/", "return_to" => "http://example.org/"}, + Rack::OpenID.parse_header('OpenID identity="http://example.com/", return_to="http://example.org/"'), + ) + assert_equal( + {"identity" => "http://example.com/", "required" => ["nickname", "email"]}, + Rack::OpenID.parse_header('OpenID identity="http://example.com/", required="nickname,email"'), + ) # ensure we don't break standard HTTP basic auth - assert_equal({}, - Rack::OpenID.parse_header('Realm="Example"')) + assert_empty( + Rack::OpenID.parse_header('Realm="Example"'), + ) end end @@ -113,244 +124,268 @@ def follow_redirect! it "with_get" do @app = app({}) - process('/', :method => 'GET') + process("/", method: "GET") follow_redirect! + assert_equal 200, @response.status - assert_equal 'GET', @response.headers['X-Method'] - assert_equal '/', @response.headers['X-Path'] - assert_equal 'success', @response.body + assert_equal "GET", @response.headers["X-Method"] + assert_equal "/", @response.headers["X-Path"] + assert_equal "success", @response.body end it "with_deprecated_identity" do @app = app({}) - process('/', :method => 'GET', :identity => "#{RotsServerUrl}/john.doe?openid.success=true") + process("/", method: "GET", identity: "#{ROTS_SERVER_URL}/john.doe?openid.success=true") follow_redirect! + assert_equal 200, @response.status - assert_equal 'GET', @response.headers['X-Method'] - assert_equal '/', @response.headers['X-Path'] - assert_equal 'success', @response.body + assert_equal "GET", @response.headers["X-Method"] + assert_equal "/", @response.headers["X-Path"] + assert_equal "success", @response.body end it "with_post_method" do @app = app({}) - process('/', :method => 'POST') + process("/", method: "POST") follow_redirect! + assert_equal 200, @response.status - assert_equal 'POST', @response.headers['X-Method'] - assert_equal '/', @response.headers['X-Path'] - assert_equal 'success', @response.body + assert_equal "POST", @response.headers["X-Method"] + assert_equal "/", @response.headers["X-Path"] + assert_equal "success", @response.body end it "with_custom_return_to" do - @app = app(:return_to => 'http://example.org/complete') - process('/', :method => 'GET') + @app = app(return_to: "http://example.org/complete") + process("/", method: "GET") follow_redirect! + assert_equal 200, @response.status - assert_equal 'GET', @response.headers['X-Method'] - assert_equal '/complete', @response.headers['X-Path'] - assert_equal 'success', @response.body + assert_equal "GET", @response.headers["X-Method"] + assert_equal "/complete", @response.headers["X-Path"] + assert_equal "success", @response.body end it "with_get_nested_params_custom_return_to" do - url = 'http://example.org/complete?user[remember_me]=true' - @app = app(:return_to => url) - process('/', :method => 'GET') + url = "http://example.org/complete?user[remember_me]=true" + @app = app(return_to: url) + process("/", method: "GET") follow_redirect! + assert_equal 200, @response.status - assert_equal 'GET', @response.headers['X-Method'] - assert_equal '/complete', @response.headers['X-Path'] - assert_equal 'success', @response.body - assert_match(/remember_me/, @response.headers['X-Query-String']) + assert_equal "GET", @response.headers["X-Method"] + assert_equal "/complete", @response.headers["X-Path"] + assert_equal "success", @response.body + assert_match(/remember_me/, @response.headers["X-Query-String"]) end it "with_post_nested_params_custom_return_to" do - url = 'http://example.org/complete?user[remember_me]=true' - @app = app(:return_to => url) - process('/', :method => 'POST') + url = "http://example.org/complete?user[remember_me]=true" + @app = app(return_to: url) + process("/", method: "POST") assert_equal 303, @response.status - env = Rack::MockRequest.env_for(@response.headers['Location']) + env = Rack::MockRequest.env_for(@response.headers["Location"]) _status, headers, _body = RotsApp.call(env) - _uri, input = headers['Location'].split('?', 2) - process("http://example.org/complete?user[remember_me]=true", :method => 'POST', :input => input) + _uri, input = headers["Location"].split("?", 2) + process("http://example.org/complete?user[remember_me]=true", method: "POST", input: input) assert_equal 200, @response.status - assert_equal 'POST', @response.headers['X-Method'] - assert_equal '/complete', @response.headers['X-Path'] - assert_equal 'success', @response.body - assert_match(/remember_me/, @response.headers['X-Query-String']) + assert_equal "POST", @response.headers["X-Method"] + assert_equal "/complete", @response.headers["X-Path"] + assert_equal "success", @response.body + assert_match(/remember_me/, @response.headers["X-Query-String"]) end it "with_post_method_custom_return_to" do - @app = app(:return_to => 'http://example.org/complete') - process('/', :method => 'POST') + @app = app(return_to: "http://example.org/complete") + process("/", method: "POST") follow_redirect! + assert_equal 200, @response.status - assert_equal 'GET', @response.headers['X-Method'] - assert_equal '/complete', @response.headers['X-Path'] - assert_equal 'success', @response.body + assert_equal "GET", @response.headers["X-Method"] + assert_equal "/complete", @response.headers["X-Path"] + assert_equal "success", @response.body end it "with_custom_return_method" do - @app = app(:method => 'put') - process('/', :method => 'GET') + @app = app(method: "put") + process("/", method: "GET") follow_redirect! + assert_equal 200, @response.status - assert_equal 'PUT', @response.headers['X-Method'] - assert_equal '/', @response.headers['X-Path'] - assert_equal 'success', @response.body + assert_equal "PUT", @response.headers["X-Method"] + assert_equal "/", @response.headers["X-Path"] + assert_equal "success", @response.body end it "with_simple_registration_fields" do - @app = app(:required => ['nickname', 'email'], :optional => 'fullname') - process('/', :method => 'GET') + @app = app(required: ["nickname", "email"], optional: "fullname") + process("/", method: "GET") follow_redirect! + assert_equal 200, @response.status - assert_equal 'GET', @response.headers['X-Method'] - assert_equal '/', @response.headers['X-Path'] - assert_equal 'success', @response.body + assert_equal "GET", @response.headers["X-Method"] + assert_equal "/", @response.headers["X-Path"] + assert_equal "success", @response.body end it "with_attribute_exchange" do @app = app( - :required => ['http://axschema.org/namePerson/friendly', 'http://axschema.org/contact/email'], - :optional => 'http://axschema.org/namePerson') - process('/', :method => 'GET') + required: ["http://axschema.org/namePerson/friendly", "http://axschema.org/contact/email"], + optional: "http://axschema.org/namePerson", + ) + process("/", method: "GET") follow_redirect! + assert_equal 200, @response.status - assert_equal 'GET', @response.headers['X-Method'] - assert_equal '/', @response.headers['X-Path'] - assert_equal 'success', @response.body + assert_equal "GET", @response.headers["X-Method"] + assert_equal "/", @response.headers["X-Path"] + assert_equal "success", @response.body end it "with_oauth" do @app = app( - :'oauth[consumer]' => 'www.example.com', - :'oauth[scope]' => ['http://docs.google.com/feeds/', 'http://spreadsheets.google.com/feeds/'] + "oauth[consumer]": "www.example.com", + "oauth[scope]": ["http://docs.google.com/feeds/", "http://spreadsheets.google.com/feeds/"], ) - process('/', :method => 'GET') + process("/", method: "GET") + + location = @response.headers["Location"] - location = @response.headers['Location'] assert_match(/openid.oauth.consumer/, location) assert_match(/openid.oauth.scope/, location) follow_redirect! + assert_equal 200, @response.status - assert_equal 'GET', @response.headers['X-Method'] - assert_equal '/', @response.headers['X-Path'] - assert_equal 'success', @response.body + assert_equal "GET", @response.headers["X-Method"] + assert_equal "/", @response.headers["X-Path"] + assert_equal "success", @response.body end it "with_pape" do @app = app( - :'pape[preferred_auth_policies]' => ['test_policy1', 'test_policy2'], - :'pape[max_auth_age]' => 600 + "pape[preferred_auth_policies]": ["test_policy1", "test_policy2"], + "pape[max_auth_age]": 600, ) - process('/', :method => 'GET') + process("/", method: "GET") + + location = @response.headers["Location"] - location = @response.headers['Location'] assert_match(/pape\.preferred_auth_policies=test_policy1\+test_policy2/, location) assert_match(/pape\.max_auth_age=600/, location) follow_redirect! + assert_equal 200, @response.status - assert_equal 'GET', @response.headers['X-Method'] - assert_equal '/', @response.headers['X-Path'] - assert_equal 'success', @response.body + assert_equal "GET", @response.headers["X-Method"] + assert_equal "/", @response.headers["X-Path"] + assert_equal "success", @response.body end it "with_immediate_mode_setup_needed" do - skip do - @app = app(:identifier => "#{RotsServerUrl}/john.doe?openid.success=false", :immediate => true) - process('/', :method => 'GET') + skip("because failing, and not enough time to fix all the things") do + @app = app(identifier: "#{ROTS_SERVER_URL}/john.doe?openid.success=false", immediate: true) + process("/", method: "GET") + + location = @response.headers["Location"] - location = @response.headers['Location'] assert_match(/openid.mode=checkid_immediate/, location) follow_redirect! + assert_equal 307, @response.status - assert_equal 'GET', @response.headers['X-Method'] - assert_equal '/', @response.headers['X-Path'] - assert_equal RotsServerUrl, @response.headers['Location'] - assert_equal 'setup_needed', @response.body + assert_equal "GET", @response.headers["X-Method"] + assert_equal "/", @response.headers["X-Path"] + assert_equal ROTS_SERVER_URL, @response.headers["Location"] + assert_equal "setup_needed", @response.body end end it "with_realm_wildcard" do @app = app( - :realm_domain => "*.example.org" + realm_domain: "*.example.org", ) - process('/', :method => 'GET') + process("/", method: "GET") + + location = @response.headers["Location"] - location = @response.headers['Location'] assert_match(/openid.realm=http%3A%2F%2F%2A.example.org/, location) follow_redirect! + assert_equal 200, @response.status end it "with_inferred_realm" do @app = app({}) - process('/', :method => 'GET') + process("/", method: "GET") + + location = @response.headers["Location"] - location = @response.headers['Location'] assert_match(/openid.realm=http%3A%2F%2Fexample.org/, location) follow_redirect! + assert_equal 200, @response.status end it "with_missing_id" do - @app = app(:identifier => "#{RotsServerUrl}/john.doe") - process('/', :method => 'GET') + @app = app(identifier: "#{ROTS_SERVER_URL}/john.doe") + process("/", method: "GET") follow_redirect! + assert_equal 400, @response.status - assert_equal 'GET', @response.headers['X-Method'] - assert_equal '/', @response.headers['X-Path'] - assert_equal 'cancel', @response.body + assert_equal "GET", @response.headers["X-Method"] + assert_equal "/", @response.headers["X-Path"] + assert_equal "cancel", @response.body end it "with_timeout" do - @app = app(:identifier => RotsServerUrl) - process('/', :method => "GET") + @app = app(identifier: ROTS_SERVER_URL) + process("/", method: "GET") + assert_equal 400, @response.status - assert_equal 'GET', @response.headers['X-Method'] - assert_equal '/', @response.headers['X-Path'] - assert_equal 'missing', @response.body + assert_equal "GET", @response.headers["X-Method"] + assert_equal "/", @response.headers["X-Path"] + assert_equal "missing", @response.body end it "sanitize_query_string" do @app = app({}) - process('/', :method => 'GET') + process("/", method: "GET") follow_redirect! + assert_equal 200, @response.status - assert_equal '/', @response.headers['X-Path'] - assert_equal '', @response.headers['X-Query-String'] + assert_equal "/", @response.headers["X-Path"] + assert_equal "", @response.headers["X-Query-String"] end it "passthrough_standard_http_basic_auth" do @app = app({}) - process('/', :method => 'GET', "MOCK_HTTP_BASIC_AUTH" => '1') + process("/", :method => "GET", "MOCK_HTTP_BASIC_AUTH" => "1") + assert_equal 401, @response.status end private def app(options = {}) - options[:identifier] ||= "#{RotsServerUrl}/john.doe?openid.success=true" + options[:identifier] ||= "#{ROTS_SERVER_URL}/john.doe?openid.success=true" rack_app = lambda { |env| - if resp = env[Rack::OpenID::RESPONSE] + if (resp = env[Rack::OpenID::RESPONSE]) headers = { - 'X-Path' => env['PATH_INFO'], - 'X-Method' => env['REQUEST_METHOD'], - 'X-Query-String' => env['QUERY_STRING'] + "X-Path" => env["PATH_INFO"], + "X-Method" => env["REQUEST_METHOD"], + "X-Query-String" => env["QUERY_STRING"], } if resp.status == :success [200, headers, [resp.status.to_s]] elsif resp.status == :setup_needed - headers['Location'] = RotsServerUrl #TODO update Rots to properly send user_setup_url. This should come from resp. + headers["Location"] = ROTS_SERVER_URL # TODO update Rots to properly send user_setup_url. This should come from resp. [307, headers, [resp.status.to_s]] else [400, headers, [resp.status.to_s]] @@ -369,33 +404,35 @@ def app(options = {}) include RackTestHelpers it "can login" do - @app = simple_app("#{RotsServerUrl}/john.doe?openid.success=true") + @app = simple_app("#{ROTS_SERVER_URL}/john.doe?openid.success=true") - process '/dashboard' + process "/dashboard" follow_redirect! assert_equal 303, @response.status - assert_equal 'http://example.org/dashboard', @response.headers['Location'] + assert_equal "http://example.org/dashboard", @response.headers["Location"] + + cookie = @response.headers["Set-Cookie"].split(";").first + process "/dashboard", "HTTP_COOKIE" => cookie - cookie = @response.headers['Set-Cookie'].split(';').first - process '/dashboard', 'HTTP_COOKIE' => cookie assert_equal 200, @response.status - assert_equal 'Hello', @response.body + assert_equal "Hello", @response.body end it "fails login" do - @app = simple_app("#{RotsServerUrl}/john.doe") - @app = simple_app("#{RotsServerUrl}/john.doe") + @app = simple_app("#{ROTS_SERVER_URL}/john.doe") + @app = simple_app("#{ROTS_SERVER_URL}/john.doe") - process '/dashboard' + process "/dashboard" follow_redirect! - assert_match RotsServerUrl, @response.headers['Location'] + + assert_match ROTS_SERVER_URL, @response.headers["Location"] end private def simple_app(identifier) - rack_app = lambda { |env| [200, {'Content-Type' => 'text/html'}, ['Hello']] } + rack_app = lambda { |env| [200, {"Content-Type" => "text/html"}, ["Hello"]] } rack_app = Rack::OpenID::SimpleAuth.new(rack_app, identifier) Rack::Session::Pool.new(rack_app) end From edad56d116f90d3c643d6f04cf330745318b4830 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 16:35:55 -0600 Subject: [PATCH 08/89] =?UTF-8?q?=F0=9F=93=9D=20Markdown=20formatting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7c26415..f29c7d1 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ Authors - [Mike Dillon](https://github.com/md5) - [Richard Wilson](https://github.com/Senjai) -[Michael Grosser](http://grosser.it)
-michael@grosser.it
-License: MIT
+[Michael Grosser](http://grosser.it) +michael@grosser.it +License: MIT From ac12ece02415df78a67ea6ffcda2c1e51b250ce9 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 18:31:49 -0600 Subject: [PATCH 09/89] =?UTF-8?q?=F0=9F=94=A7=20Integrate=20version=5Fgem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile.lock | 2 +- lib/rack/openid.rb | 11 ++++++++++- lib/rack/openid/version.rb | 4 +++- rack-openid.gemspec => rack-openid2.gemspec | 9 ++++++--- 4 files changed, 20 insertions(+), 6 deletions(-) rename rack-openid.gemspec => rack-openid2.gemspec (82%) diff --git a/Gemfile.lock b/Gemfile.lock index a02a809..df2ee4e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,7 +7,7 @@ GIT PATH remote: . specs: - rack-openid2 (1.4.2) + rack-openid2 (2.0.0) rack (>= 2.2) ruby-openid2 (>= 3.0) version_gem (~> 1.1, >= 1.1.4) diff --git a/lib/rack/openid.rb b/lib/rack/openid.rb index b2c0ec4..02ff4b7 100644 --- a/lib/rack/openid.rb +++ b/lib/rack/openid.rb @@ -1,6 +1,8 @@ +# External Libraries +require "version_gem" require "rack/request" require "rack/utils" - +# Require ruby-openid2 and some of its extensions require "openid" require "openid/consumer" require "openid/extensions/sreg" @@ -8,6 +10,9 @@ require "openid/extensions/oauth" require "openid/extensions/pape" +# This gem +require_relative "openid/version" + module Rack # A Rack middleware that provides a more HTTPish API around the # ruby-openid library. @@ -308,3 +313,7 @@ def timeout_protection_from_identity_server end end end + +Rack::OpenID::Version.class_eval do + extend VersionGem::Basic +end diff --git a/lib/rack/openid/version.rb b/lib/rack/openid/version.rb index d08790b..bf0e799 100644 --- a/lib/rack/openid/version.rb +++ b/lib/rack/openid/version.rb @@ -1,5 +1,7 @@ module Rack class OpenID - VERSION = "1.4.2" + module Version + VERSION = "2.0.0" + end end end diff --git a/rack-openid.gemspec b/rack-openid2.gemspec similarity index 82% rename from rack-openid.gemspec rename to rack-openid2.gemspec index 6c5f671..9368019 100644 --- a/rack-openid.gemspec +++ b/rack-openid2.gemspec @@ -1,9 +1,12 @@ -$LOAD_PATH.unshift(File.expand_path("../lib", __FILE__)) -require "rack/openid/version" +# Get the GEMFILE_VERSION without *require* "my_gem/version", for code coverage accuracy +# See: https://github.com/simplecov-ruby/simplecov/issues/557#issuecomment-825171399 +load "lib/rack/openid/version.rb" +gem_version = Rack::OpenID::Version::VERSION +Rack::OpenID::Version.send(:remove_const, :VERSION) Gem::Specification.new do |spec| spec.name = "rack-openid2" - spec.version = Rack::OpenID::VERSION + spec.version = gem_version spec.summary = "Provides a more HTTPish API around the ruby-openid library" spec.authors = ["Peter Boling", "Michael Grosser", "Joshua Peek"] spec.email = "peter.boling@gmail.com" From 90be1f404c1a9a42e0a04c8b70b7a987e630504a Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 18:36:49 -0600 Subject: [PATCH 10/89] =?UTF-8?q?=F0=9F=94=A7=20binstubs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/bundle | 109 +++++++++++++++++++++++++++++++++++++++++++ bin/byebug | 27 +++++++++++ bin/htmldiff | 27 +++++++++++ bin/ldiff | 27 +++++++++++ bin/racc | 27 +++++++++++ bin/rake | 27 +++++++++++ bin/rots | 27 +++++++++++ bin/rubocop | 27 +++++++++++ bin/rubocop-gradual | 27 +++++++++++ bin/ruby-parse | 27 +++++++++++ bin/ruby-rewrite | 27 +++++++++++ bin/standardrb | 27 +++++++++++ bin/yard | 27 +++++++++++ bin/yard-junk | 27 +++++++++++ bin/yardoc | 27 +++++++++++ bin/yri | 27 +++++++++++ rack-openid2.gemspec | 19 +++++--- 17 files changed, 526 insertions(+), 7 deletions(-) create mode 100755 bin/bundle create mode 100755 bin/byebug create mode 100755 bin/htmldiff create mode 100755 bin/ldiff create mode 100755 bin/racc create mode 100755 bin/rake create mode 100755 bin/rots create mode 100755 bin/rubocop create mode 100755 bin/rubocop-gradual create mode 100755 bin/ruby-parse create mode 100755 bin/ruby-rewrite create mode 100755 bin/standardrb create mode 100755 bin/yard create mode 100755 bin/yard-junk create mode 100755 bin/yardoc create mode 100755 bin/yri diff --git a/bin/bundle b/bin/bundle new file mode 100755 index 0000000..42c7fd7 --- /dev/null +++ b/bin/bundle @@ -0,0 +1,109 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'bundle' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "rubygems" + +m = Module.new do + module_function + + def invoked_as_script? + File.expand_path($0) == File.expand_path(__FILE__) + end + + def env_var_version + ENV["BUNDLER_VERSION"] + end + + def cli_arg_version + return unless invoked_as_script? # don't want to hijack other binstubs + return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update` + bundler_version = nil + update_index = nil + ARGV.each_with_index do |a, i| + if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN + bundler_version = a + end + next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/ + bundler_version = $1 + update_index = i + end + bundler_version + end + + def gemfile + gemfile = ENV["BUNDLE_GEMFILE"] + return gemfile if gemfile && !gemfile.empty? + + File.expand_path("../Gemfile", __dir__) + end + + def lockfile + lockfile = + case File.basename(gemfile) + when "gems.rb" then gemfile.sub(/\.rb$/, ".locked") + else "#{gemfile}.lock" + end + File.expand_path(lockfile) + end + + def lockfile_version + return unless File.file?(lockfile) + lockfile_contents = File.read(lockfile) + return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/ + Regexp.last_match(1) + end + + def bundler_requirement + @bundler_requirement ||= + env_var_version || + cli_arg_version || + bundler_requirement_for(lockfile_version) + end + + def bundler_requirement_for(version) + return "#{Gem::Requirement.default}.a" unless version + + bundler_gem_version = Gem::Version.new(version) + + bundler_gem_version.approximate_recommendation + end + + def load_bundler! + ENV["BUNDLE_GEMFILE"] ||= gemfile + + activate_bundler + end + + def activate_bundler + gem_error = activation_error_handling do + gem "bundler", bundler_requirement + end + return if gem_error.nil? + require_error = activation_error_handling do + require "bundler/version" + end + return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION)) + warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`" + exit 42 + end + + def activation_error_handling + yield + nil + rescue StandardError, LoadError => e + e + end +end + +m.load_bundler! + +if m.invoked_as_script? + load Gem.bin_path("bundler", "bundle") +end diff --git a/bin/byebug b/bin/byebug new file mode 100755 index 0000000..abc90db --- /dev/null +++ b/bin/byebug @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'byebug' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("byebug", "byebug") diff --git a/bin/htmldiff b/bin/htmldiff new file mode 100755 index 0000000..0aeaec8 --- /dev/null +++ b/bin/htmldiff @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'htmldiff' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("diff-lcs", "htmldiff") diff --git a/bin/ldiff b/bin/ldiff new file mode 100755 index 0000000..8173ede --- /dev/null +++ b/bin/ldiff @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'ldiff' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("diff-lcs", "ldiff") diff --git a/bin/racc b/bin/racc new file mode 100755 index 0000000..8190015 --- /dev/null +++ b/bin/racc @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'racc' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("racc", "racc") diff --git a/bin/rake b/bin/rake new file mode 100755 index 0000000..4eb7d7b --- /dev/null +++ b/bin/rake @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'rake' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rake", "rake") diff --git a/bin/rots b/bin/rots new file mode 100755 index 0000000..2ad9295 --- /dev/null +++ b/bin/rots @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'rots' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rots", "rots") diff --git a/bin/rubocop b/bin/rubocop new file mode 100755 index 0000000..369a05b --- /dev/null +++ b/bin/rubocop @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'rubocop' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rubocop", "rubocop") diff --git a/bin/rubocop-gradual b/bin/rubocop-gradual new file mode 100755 index 0000000..0752005 --- /dev/null +++ b/bin/rubocop-gradual @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'rubocop-gradual' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rubocop-gradual", "rubocop-gradual") diff --git a/bin/ruby-parse b/bin/ruby-parse new file mode 100755 index 0000000..d8ebc68 --- /dev/null +++ b/bin/ruby-parse @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'ruby-parse' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("parser", "ruby-parse") diff --git a/bin/ruby-rewrite b/bin/ruby-rewrite new file mode 100755 index 0000000..b4574ab --- /dev/null +++ b/bin/ruby-rewrite @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'ruby-rewrite' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("parser", "ruby-rewrite") diff --git a/bin/standardrb b/bin/standardrb new file mode 100755 index 0000000..b329561 --- /dev/null +++ b/bin/standardrb @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'standardrb' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("standard", "standardrb") diff --git a/bin/yard b/bin/yard new file mode 100755 index 0000000..ea9daf5 --- /dev/null +++ b/bin/yard @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'yard' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("yard", "yard") diff --git a/bin/yard-junk b/bin/yard-junk new file mode 100755 index 0000000..be420a5 --- /dev/null +++ b/bin/yard-junk @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'yard-junk' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("yard-junk", "yard-junk") diff --git a/bin/yardoc b/bin/yardoc new file mode 100755 index 0000000..e1324dc --- /dev/null +++ b/bin/yardoc @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'yardoc' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("yard", "yardoc") diff --git a/bin/yri b/bin/yri new file mode 100755 index 0000000..f968fde --- /dev/null +++ b/bin/yri @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'yri' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("yard", "yri") diff --git a/rack-openid2.gemspec b/rack-openid2.gemspec index 9368019..e4d3be9 100644 --- a/rack-openid2.gemspec +++ b/rack-openid2.gemspec @@ -20,13 +20,18 @@ Gem::Specification.new do |spec| "LICENSE.txt", "README.md", ] - - spec.license = "MIT" - cert = File.expand_path("~/.ssh/gem-private-key-grosser.pem") - if File.exist?(cert) - spec.signing_key = cert - spec.cert_chain = ["gem-public_cert.pem"] - end + spec.executables = spec.files.grep(%r{^bin/}).map { |f| File.basename(f) } + spec.licenses = ["MIT"] + spec.require_paths = ["lib"] + spec.required_ruby_version = ">= 2.7.0" + + spec.metadata["homepage_uri"] = spec.homepage + spec.metadata["source_code_uri"] = "#{spec.homepage}/tree/v#{spec.version}" + spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/v#{spec.version}/CHANGELOG.md" + spec.metadata["bug_tracker_uri"] = "#{spec.homepage}/issues" + spec.metadata["documentation_uri"] = "https://www.rubydoc.info/gems/#{spec.name}/#{spec.version}" + spec.metadata["wiki_uri"] = "#{spec.homepage}/wiki" + spec.metadata["rubygems_mfa_required"] = "true" spec.add_dependency("rack", ">= 2.2") spec.add_dependency("ruby-openid2", ">= 3.0") From c35503f098a2342474c4c0929354a8b4eeae7011 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 18:44:02 -0600 Subject: [PATCH 11/89] =?UTF-8?q?=F0=9F=94=92=EF=B8=8F=20cert=20for=20rele?= =?UTF-8?q?asing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- certs/pboling.pem | 27 +++++++++++++++++++++++++++ rack-openid2.gemspec | 4 ++++ 2 files changed, 31 insertions(+) create mode 100644 certs/pboling.pem diff --git a/certs/pboling.pem b/certs/pboling.pem new file mode 100644 index 0000000..3344386 --- /dev/null +++ b/certs/pboling.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE----- +MIIEgDCCAuigAwIBAgIBATANBgkqhkiG9w0BAQsFADBDMRUwEwYDVQQDDAxwZXRl +ci5ib2xpbmcxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkW +A2NvbTAeFw0yMzA5MjAxNzMwMjhaFw0yNDA5MTkxNzMwMjhaMEMxFTATBgNVBAMM +DHBldGVyLmJvbGluZzEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPy +LGQBGRYDY29tMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA+a9UvHo3 +84k96WgU5Kk5HB+cLZs/modjorsTfqY67MJF5nNvAoqcKTUBW4uG+Zpfnm3jaDO5 +GxhJEIZWfndYzycHT2KMVQ1uTP82ba8ZaKrPlPIafkbui3mdds47qsmqHiblKERg +U532lkwfqHDlJwE7OBZQ59EwWWLynlT/yAUHpOBbqIuHKUxdpmBI+sIjrZcD1e05 +WmjkO6fwIdC5oM757aoPxIgXD587VOViH11Vkm2doskj4T8yONtwVHlcrrhJ9Bzd +/zdp6vEn7GZQrABvpOlqwWxQ72ZnFhJe/RJZf6CXOPOh69Ai0QKYl2a1sYuCJKS3 +nsBnxXJINEEznjR7rZjNUmYD+CZqfjzgPqedRxTlASe7iA4w7xZOqMDzcuhNwcUQ +tMEH6BTktxKP3jXZPXRfHCf6s+HRVb6vezAonTBVyydf5Xp5VwWkd6cwm+2BzHl5 +7kc/3lLxKMcsyEUprAsk8LdHohwZdC267l+RS++AP6Cz6x+nB3oGob19AgMBAAGj +fzB9MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBQCSSas60GqqMjt +xR7LoY1gucEvtzAhBgNVHREEGjAYgRZwZXRlci5ib2xpbmdAZ21haWwuY29tMCEG +A1UdEgQaMBiBFnBldGVyLmJvbGluZ0BnbWFpbC5jb20wDQYJKoZIhvcNAQELBQAD +ggGBAMl9ifcw5p+PdvB7dCPoNKoVdp/2LbC9ztETHuYL2gUMJB6UoS3o9c/piSuR +V3ZMQaijmNu6ms1bWAtJ66LjmYrVflJtf9yp31Kierr9LpisMSUx2qbMOHGa8d2Z +vCUWPF8E9Cg0mP3GAyZ6qql8jDh/anUKeksPXqJvNxNPDu2DVYsa/IWdl96whzS4 +Bl7SwB1E7agps40UcshCSKaVDOU0M+XN6SrnJMElnBic+KSAkBkVFbzS0BE4ODZM +BgE6nYzQ05qhuvbE+oGdACTlemNtDDWCh0uw+7x0q2PocGIDU5zsPn/WNTkCXPmB +CHGvqDNWq4M7ncTKAaS2XExgyb7uPdq9fKiOW8nmH+zCiGzJXzBWwZlKf7L4Ht9E +a3f0e5C+zvee9Z5Ng9ciyfav9/fcXgYt5MjoBv27THr5XfBhgOCIHSYW2tqJmWKi +KuxrfYrN+9HvMdm+nZ6TypmKftHY3Gj+/uu+g8Icm/zrvTWAEE0mcJOkfrIoNPJb +pF8dMA== +-----END CERTIFICATE----- diff --git a/rack-openid2.gemspec b/rack-openid2.gemspec index e4d3be9..7c3d7fd 100644 --- a/rack-openid2.gemspec +++ b/rack-openid2.gemspec @@ -12,6 +12,10 @@ Gem::Specification.new do |spec| spec.email = "peter.boling@gmail.com" spec.homepage = "https://github.com/VitalConnectInc/#{spec.name}" + # See CONTRIBUTING.md + spec.cert_chain = [ENV.fetch("GEM_CERT_PATH", "certs/#{ENV.fetch("GEM_CERT_USER", ENV["USER"])}.pem")] + spec.signing_key = File.expand_path("~/.ssh/gem-private_key.pem") if $PROGRAM_NAME.end_with?("gem") + # Specify which files should be added to the gem when it is released. spec.files = Dir[ # Splats (alphabetical) From 951459dafd8f62995c93c5d10441ae5be97197fc Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 18:45:53 -0600 Subject: [PATCH 12/89] =?UTF-8?q?=F0=9F=93=9D=20CONTRIBUTING.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CONTRIBUTING.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100755 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100755 index 0000000..4f569a7 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,54 @@ +## Contributing + +Bug reports and pull requests are welcome on GitHub at [https://github.com/VitalConnectInc/rack-openid2][🚎src-main] +. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to +the [code of conduct][🤝conduct]. + +To submit a patch, please fork the project and create a patch with tests. +Once you're happy with it send a pull request. + +## Release + +### One-time, Per-developer, Setup + +**IMPORTANT**: Your public key for signing gems will need to be picked up by the line in the +`gemspec` defining the `spec.cert_chain` (check the relevant ENV variables there), +in order to sign the new release. +See: [RubyGems Security Guide][🔒️rubygems-security-guide] + +### To release a new version: + +1. Run `bin/setup && bin/rake` as a tests, coverage, & linting sanity check +2. Update the version number in `version.rb` +3. Run `bin/setup && bin/rake` again as a secondary check, and to update `Gemfile.lock` +4. Run `git commit -am "🔖 Prepare release v"` to commit the changes +5. Run `git push` to trigger the final CI pipeline before release, & merge PRs + - NOTE: Remember to [check the build][🧪build]! +6. Run `git checkout main` +7. Run `git pull origin main` to ensure you will release the latest trunk code. +8. Set `SOURCE_DATE_EPOCH` so `rake build` and `rake release` use same timestamp, and generate same checksums + - Run `export SOURCE_DATE_EPOCH=$EPOCHSECONDS && echo $SOURCE_DATE_EPOCH` + - If the echo above has no output, then it didn't work. + - Note that you'll need the `zsh/datetime` module, if running `zsh`. + - In `bash` you can use `date +%s` instead, i.e. `export SOURCE_DATE_EPOCH=$(date +%s) && echo $SOURCE_DATE_EPOCH` +9. Run `bundle exec rake build` +10. Run [`bin/checksums`][🔒️rubygems-checksums-pr] to create SHA-256 and SHA-512 checksums + - Checksums will be committed automatically by the script, but not pushed +11. Run `bundle exec rake release` which will create a git tag for the version, + push git commits and tags, and push the `.gem` file to [rubygems.org][💎rubygems] + +## Contributors + +[![Contributors][🖐contributors-img]][🖐contributors] + +Made with [contributors-img][🖐contrib-rocks]. + +[🧪build]: https://github.com/VitalConnectInc/rack-openid2/actions +[🤝conduct]: https://github.com/VitalConnectInc/rack-openid2/blob/main/CODE_OF_CONDUCT.md +[🖐contrib-rocks]: https://contrib.rocks +[🖐contributors]: https://github.com/VitalConnectInc/rack-openid2/graphs/contributors +[🖐contributors-img]: https://contrib.rocks/image?repo=VitalConnectInc/rack-openid2 +[💎rubygems]: https://rubygems.org +[🔒️rubygems-security-guide]: https://guides.rubygems.org/security/#building-gems +[🔒️rubygems-checksums-pr]: https://github.com/rubygems/guides/pull/325 +[🚎src-main]: https://github.com/VitalConnectInc/rack-openid2 From 2071e41688f3279bc0e47c555022adf9b0eca3a8 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 18:59:17 -0600 Subject: [PATCH 13/89] =?UTF-8?q?=F0=9F=91=B7=20Add=20GitHub=20Actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/dependabot.yml | 13 +++++ .github/workflows/coverage.yml | 85 +++++++++++++++++++++++++++++++ .github/workflows/heads.yml | 60 ++++++++++++++++++++++ .github/workflows/style.yml | 42 +++++++++++++++ .github/workflows/supported.yml | 57 +++++++++++++++++++++ .github/workflows/unsupported.yml | 55 ++++++++++++++++++++ .rubocop_gradual.lock | 5 ++ .simplecov | 3 ++ bin/bundle | 10 ++-- gemfiles/coverage.gemfile | 12 +++++ gemfiles/style.gemfile | 10 ++++ gemfiles/vanilla.gemfile | 11 ++++ test/helper.rb | 6 --- test/test_helper.rb | 22 ++++++++ test/test_integration.rb | 2 +- test/test_rack_openid.rb | 2 +- 16 files changed, 382 insertions(+), 13 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/coverage.yml create mode 100644 .github/workflows/heads.yml create mode 100644 .github/workflows/style.yml create mode 100644 .github/workflows/supported.yml create mode 100644 .github/workflows/unsupported.yml create mode 100644 .rubocop_gradual.lock create mode 100644 .simplecov create mode 100644 gemfiles/coverage.gemfile create mode 100644 gemfiles/style.gemfile create mode 100644 gemfiles/vanilla.gemfile create mode 100644 test/test_helper.rb diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..46f1c90 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +version: 2 +updates: + - package-ecosystem: bundler + directory: "/" + schedule: + interval: "daily" + open-pull-requests-limit: 10 + ignore: + - dependency-name: "rubocop-lts" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..ab688fb --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,85 @@ +name: Ruby - Coverage + +env: + K_SOUP_COV_MIN_BRANCH: 71 + K_SOUP_COV_MIN_LINE: 89 + K_SOUP_COV_MIN_HARD: true + K_SOUP_COV_DO: true + K_SOUP_COV_COMMAND_NAME: "MiniTest Coverage" + +on: + push: + branches: + - 'main' + tags: + - '!*' # Do not execute on tags + pull_request: + branches: + - '*' + # Allow manually triggering the workflow. + workflow_dispatch: + +permissions: + contents: read + +# Cancels all previous workflow runs for the same branch that have not yet completed. +concurrency: + # The concurrency group contains the workflow name and the branch name. + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + +jobs: + test: + name: Specs with Coverage - Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }} + if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')" + env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps + BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile + runs-on: ubuntu-latest + strategy: + matrix: + rubygems: + - latest + bundler: + - latest + gemfile: + - coverage + ruby: + - '3.1' + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Ruby & RubyGems + uses: ruby/setup-ruby@v1 + with: + ruby-version: "${{ matrix.ruby }}" + rubygems: "${{ matrix.rubygems }}" + bundler: "${{ matrix.bundler }}" + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + + - name: Run tests + run: bundle exec rake test + + - name: Code Coverage Summary Report + uses: irongut/CodeCoverageSummary@v1.3.0 + if: ${{ github.event_name == 'pull_request' }} + with: + filename: ./coverage/coverage.xml + badge: true + fail_below_min: true + format: markdown + hide_branch_rate: false + hide_complexity: true + indicators: true + output: both + thresholds: '93 82' + continue-on-error: ${{ matrix.experimental != 'false' }} + + - name: Add Coverage PR Comment + uses: marocchino/sticky-pull-request-comment@v2 + if: ${{ github.event_name == 'pull_request' }} + with: + recreate: true + path: code-coverage-results.md + continue-on-error: ${{ matrix.experimental != 'false' }} diff --git a/.github/workflows/heads.yml b/.github/workflows/heads.yml new file mode 100644 index 0000000..de2d274 --- /dev/null +++ b/.github/workflows/heads.yml @@ -0,0 +1,60 @@ +name: Ruby Heads Matrix + +env: + K_SOUP_COV_DO: false + +on: + push: + branches: + - 'main' + tags: + - '!*' # Do not execute on tags + pull_request: + branches: + - '*' + # Allow manually triggering the workflow. + workflow_dispatch: + +permissions: + contents: read + +# Cancels all previous workflow runs for the same branch that have not yet completed. +concurrency: + # The concurrency group contains the workflow name and the branch name. + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + +jobs: + test: + name: Specs - Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }} + if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')" + env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps + BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile + runs-on: ubuntu-latest + continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }} + strategy: + fail-fast: true + matrix: + rubygems: + - latest + bundler: + - latest + gemfile: + - vanilla + ruby: + - head + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Ruby & RubyGems + uses: ruby/setup-ruby@v1 + with: + ruby-version: "${{ matrix.ruby }}" + rubygems: "${{ matrix.rubygems }}" + bundler: "${{ matrix.bundler }}" + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + + - name: Run tests + run: bundle exec rake test diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml new file mode 100644 index 0000000..26b1f14 --- /dev/null +++ b/.github/workflows/style.yml @@ -0,0 +1,42 @@ +name: Ruby - Style + +on: + push: + branches: + - 'main' + tags: + - '!*' # Do not execute on tags + pull_request: + branches: + - '*' + +jobs: + rubocop: + name: RuboCop + strategy: + fail-fast: false + matrix: + rubygems: + - latest + bundler: + - latest + gemfile: + - style + ruby: + - "3.2" + runs-on: ubuntu-latest + continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }} + env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps + BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Ruby & RubyGems + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + rubygems: ${{ matrix.rubygems }} + bundler: ${{ matrix.bundler }} + bundler-cache: true + - name: Run RuboCop + run: bundle exec rake rubocop_gradual:check diff --git a/.github/workflows/supported.yml b/.github/workflows/supported.yml new file mode 100644 index 0000000..aadd9af --- /dev/null +++ b/.github/workflows/supported.yml @@ -0,0 +1,57 @@ +name: Supported Ruby Matrix + +env: + K_SOUP_COV_DO: false + +on: + push: + branches: + - 'main' + tags: + - '!*' # Do not execute on tags + pull_request: + branches: + - '*' + # Allow manually triggering the workflow. + workflow_dispatch: + +permissions: + contents: read + +# Cancels all previous workflow runs for the same branch that have not yet completed. +concurrency: + # The concurrency group contains the workflow name and the branch name. + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + +jobs: + test: + name: Specs - Ruby ${{ matrix.ruby }}${{ matrix.name_extra || '' }} + if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')" + env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps + BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile + runs-on: ubuntu-latest + strategy: + matrix: + include: + - ruby: "3.3" + rubygems: latest + bundler: latest + gemfile: vanilla + - ruby: "3.2" + rubygems: latest + bundler: latest + gemfile: vanilla + #- Ruby 3.1 tests are run by coverage.yml + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Ruby & RubyGems + uses: ruby/setup-ruby@v1 + with: + ruby-version: "${{ matrix.ruby }}" + rubygems: "${{ matrix.rubygems }}" + bundler: "${{ matrix.bundler }}" + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Run tests + run: bundle exec rake test diff --git a/.github/workflows/unsupported.yml b/.github/workflows/unsupported.yml new file mode 100644 index 0000000..8d53dd7 --- /dev/null +++ b/.github/workflows/unsupported.yml @@ -0,0 +1,55 @@ +name: Unsupported (EOL) Ruby Matrix + +env: + K_SOUP_COV_DO: false + +on: + push: + branches: + - 'main' + tags: + - '!*' # Do not execute on tags + pull_request: + branches: + - '*' + # Allow manually triggering the workflow. + workflow_dispatch: + +# Cancels all previous workflow runs for the same branch that have not yet completed. +concurrency: + # The concurrency group contains the workflow name and the branch name. + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + +jobs: + test: + name: Specs - Ruby ${{ matrix.ruby }}${{ matrix.name_extra || '' }} + if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')" + env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps + BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile + strategy: + fail-fast: false + matrix: + include: + - ruby: "3.0" + rubygems: "3.3.27" + bundler: none + gemfile: vanilla + - ruby: "2.7" + rubygems: "3.3.27" + bundler: none + gemfile: vanilla + runs-on: ubuntu-20.04 + continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Ruby & RubyGems + uses: ruby/setup-ruby@v1 + with: + ruby-version: "${{ matrix.ruby }}" + rubygems: "${{ matrix.rubygems }}" + bundler: "${{ matrix.bundler }}" + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Run tests + run: bundle exec rake test diff --git a/.rubocop_gradual.lock b/.rubocop_gradual.lock new file mode 100644 index 0000000..cd948fb --- /dev/null +++ b/.rubocop_gradual.lock @@ -0,0 +1,5 @@ +{ + "bin/bundle:4028066867": [ + [64, 5, 20, "ThreadSafety/InstanceVariableInClassMethod: Avoid instance variables in class methods.", 2485198147] + ] +} diff --git a/.simplecov b/.simplecov new file mode 100644 index 0000000..bfe90c0 --- /dev/null +++ b/.simplecov @@ -0,0 +1,3 @@ +require "kettle/soup/cover/config" + +SimpleCov.start diff --git a/bin/bundle b/bin/bundle index 42c7fd7..450605b 100755 --- a/bin/bundle +++ b/bin/bundle @@ -30,7 +30,7 @@ m = Module.new do if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN bundler_version = a end - next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/ + next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/o bundler_version = $1 update_index = i end @@ -56,7 +56,7 @@ m = Module.new do def lockfile_version return unless File.file?(lockfile) lockfile_contents = File.read(lockfile) - return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/ + return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/o Regexp.last_match(1) end @@ -83,15 +83,15 @@ m = Module.new do def activate_bundler gem_error = activation_error_handling do - gem "bundler", bundler_requirement + gem("bundler", bundler_requirement) end return if gem_error.nil? require_error = activation_error_handling do require "bundler/version" end return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION)) - warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`" - exit 42 + warn("Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`") + exit(42) end def activation_error_handling diff --git a/gemfiles/coverage.gemfile b/gemfiles/coverage.gemfile new file mode 100644 index 0000000..84e18c2 --- /dev/null +++ b/gemfiles/coverage.gemfile @@ -0,0 +1,12 @@ +git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } + +source "https://rubygems.org" + +# Root Gemfile is only for local development only. It is not loaded on CI. +# On CI we only need the gemspecs' dependencies (including development dependencies). +# Exceptions, if any, will be found in gemfiles/*.gemfile +gem "kettle-soup-cover", "~> 1.0", ">= 1.0.2" + +gem "rots", github: "roman/rots" + +gemspec path: "../" diff --git a/gemfiles/style.gemfile b/gemfiles/style.gemfile new file mode 100644 index 0000000..827e16b --- /dev/null +++ b/gemfiles/style.gemfile @@ -0,0 +1,10 @@ +git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } + +source "https://rubygems.org" + +# Root Gemfile is only for local development only. It is not loaded on CI. +# On CI we only need the gemspecs' dependencies (including development dependencies). +# Exceptions, if any, will be found in gemfiles/*.gemfile +gem "rubocop-packaging", "~> 0.5", ">= 0.5.2" + +gemspec path: "../" diff --git a/gemfiles/vanilla.gemfile b/gemfiles/vanilla.gemfile new file mode 100644 index 0000000..fdafa83 --- /dev/null +++ b/gemfiles/vanilla.gemfile @@ -0,0 +1,11 @@ +git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } + +source "https://rubygems.org" + +# Root Gemfile is only for local development only. It is not loaded on CI. +# On CI we only need the gemspecs' dependencies (including development dependencies). +# Exceptions, if any, will be found in gemfiles/*.gemfile + +gem "rots", github: "roman/rots" + +gemspec path: "../" diff --git a/test/helper.rb b/test/helper.rb index 8f5bc00..4f114be 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,9 +1,3 @@ -require "minitest/autorun" -require "minitest/rg" -require "net/http" - -require "rack" -require "rack/session" require "rack/openid" require "rack/openid/simple_auth" diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 0000000..d36e74b --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,22 @@ +# External dependencies +require "byebug" if ENV.fetch("DEBUG", "false").casecmp?("true") + +## Last thing before loading this gem is to setup code coverage +begin + # This does not require "simplecov", but + require "kettle-soup-cover" + # this next line has a side-effect of running `.simplecov` + require "simplecov" if defined?(Kettle::Soup::Cover) && Kettle::Soup::Cover::DO_COV +rescue LoadError + nil +end + +# Testing libraries +require "minitest/autorun" +require "minitest/rg" +require "net/http" +require "rack" +require "rack/session" + +# Internal dependencies & mixins +require_relative "helper" diff --git a/test/test_integration.rb b/test/test_integration.rb index 479946c..d443cea 100644 --- a/test/test_integration.rb +++ b/test/test_integration.rb @@ -1,4 +1,4 @@ -require File.expand_path("../helper", __FILE__) +require_relative "test_helper" describe "integration" do class MockFetcher diff --git a/test/test_rack_openid.rb b/test/test_rack_openid.rb index 18ee93b..80d5679 100644 --- a/test/test_rack_openid.rb +++ b/test/test_rack_openid.rb @@ -1,4 +1,4 @@ -require File.expand_path("../helper", __FILE__) +require_relative "test_helper" describe Rack::OpenID do describe ".sanitize_params!" do From 7f2920e95e1682e2dab51326e956792228505bc5 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 19:08:17 -0600 Subject: [PATCH 14/89] =?UTF-8?q?=F0=9F=94=A5=20trash=20old=20cert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gem-public_cert.pem | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 gem-public_cert.pem diff --git a/gem-public_cert.pem b/gem-public_cert.pem deleted file mode 100644 index 2d03746..0000000 --- a/gem-public_cert.pem +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDMjCCAhqgAwIBAgIBADANBgkqhkiG9w0BAQUFADA/MRAwDgYDVQQDDAdtaWNo -YWVsMRcwFQYKCZImiZPyLGQBGRYHZ3Jvc3NlcjESMBAGCgmSJomT8ixkARkWAml0 -MB4XDTEzMDIwMzE4MTMxMVoXDTE0MDIwMzE4MTMxMVowPzEQMA4GA1UEAwwHbWlj -aGFlbDEXMBUGCgmSJomT8ixkARkWB2dyb3NzZXIxEjAQBgoJkiaJk/IsZAEZFgJp -dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMorXo/hgbUq97+kII9H -MsQcLdC/7wQ1ZP2OshVHPkeP0qH8MBHGg6eYisOX2ubNagF9YTCZWnhrdKrwpLOO -cPLaZbjUjljJ3cQR3B8Yn1veV5IhG86QseTBjymzJWsLpqJ1UZGpfB9tXcsFtuxO -6vHvcIHdzvc/OUkICttLbH+1qb6rsHUceqh+JrH4GrsJ5H4hAfIdyS2XMK7YRKbh -h+IBu6dFWJJByzFsYmV1PDXln3UBmgAt65cmCu4qPfThioCGDzbSJrGDGLmw/pFX -FPpVCm1zgYSb1v6Qnf3cgXa2f2wYGm17+zAVyIDpwryFru9yF/jJxE38z/DRsd9R -/88CAwEAAaM5MDcwCQYDVR0TBAIwADAdBgNVHQ4EFgQUsiNnXHtKeMYYcr4yJVmQ -WONL+IwwCwYDVR0PBAQDAgSwMA0GCSqGSIb3DQEBBQUAA4IBAQAlyN7kKo/NQCQ0 -AOzZLZ3WAePvStkCFIJ53tsv5Kyo4pMAllv+BgPzzBt7qi605mFSL6zBd9uLou+W -Co3s48p1dy7CjjAfVQdmVNHF3MwXtfC2OEyvSQPi4xKR8iba8wa3xp9LVo1PuLpw -/6DsrChWw74HfsJN6qJOK684hJeT8lBYAUfiC3wD0owoPSg+XtyAAddisR+KV5Y1 -NmVHuLtQcNTZy+gRht3ahJRMuC6QyLmkTsf+6MaenwAMkAgHdswGsJztOnNnBa3F -y0kCSWmK6D+x/SbfS6r7Ke07MRqziJdB9GuE1+0cIRuFh8EQ+LN6HXCKM5pon/GU -ycwMXfl0 ------END CERTIFICATE----- From bc8e5f90a97f74339b800f8d9a2284bf02c18a23 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 19:12:39 -0600 Subject: [PATCH 15/89] =?UTF-8?q?=F0=9F=93=9D=20CHANGELOG.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e05a58c --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,20 @@ +# Changelog +All notable changes to this project will be documented in this file. + +Since version 2.0.0, the format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] +### Added +### Changed +### Fixed +### Removed + +## 2.0.0 - 2024-09-04 +### Changed +- Upgraded to rack v2+ +- Switched ruby-openid => ruby-openid2 +### Fixed +- Compatibility with Ruby 2.7+ +### Removed +- Support for Ruby < 2.7 From 7870b6bdb4784a8b191ecdbf33c7279d2e53e266 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 19:13:22 -0600 Subject: [PATCH 16/89] =?UTF-8?q?=F0=9F=93=9D=20CODE=5FOF=5FCONDUCT.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CODE_OF_CONDUCT.md | 84 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100755 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100755 index 0000000..c4880b6 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,84 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at peter.boling@gmail.com. All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of actions. + +**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, +available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. From 62bbb6ca24456f7f95298374fd8a90097d315e64 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 19:14:03 -0600 Subject: [PATCH 17/89] =?UTF-8?q?=F0=9F=93=9D=20SECURITY.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SECURITY.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100755 index 0000000..c81e245 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,14 @@ +# Security Policy + +## Supported Versions + +| Version | Supported | +|---------|-----------| +| 2.x | ✅ | +| 1.x | ❌ | + +## Reporting a Vulnerability + +Peter Boling is the primary maintainer of this gem. Please find a way +to [contact him directly](https://railsbling.com/contact) to report the issue. Include as much relevant information as +possible. From 85fe705e7911b5115d9bb883272a035bf45c888c Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 19:18:29 -0600 Subject: [PATCH 18/89] =?UTF-8?q?=F0=9F=92=9A=20Enforce=20code=20coverage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .envrc | 11 +++++++++++ .github/workflows/coverage.yml | 6 +++--- CHANGELOG.md | 2 ++ 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 .envrc diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..decb849 --- /dev/null +++ b/.envrc @@ -0,0 +1,11 @@ +### External Testing Controls +export K_SOUP_COV_DO=true # Means you want code coverage +# Available formats are html, xml, rcov, lcov, json, tty +export K_SOUP_COV_COMMAND_NAME="MiniTest Coverage" +export K_SOUP_COV_FORMATTERS="html,tty" +export K_SOUP_COV_MIN_BRANCH=86 # Means you want to enforce X% branch coverage +export K_SOUP_COV_MIN_LINE=97 # Means you want to enforce X% line coverage +export K_SOUP_COV_MIN_HARD=true # Means you want the build to fail if the coverage thresholds are not met +export K_SOUP_COV_MULTI_FORMATTERS=true +export MAX_ROWS=5 # Setting for simplecov-console gem for tty output, limits to the worst N rows of bad coverage +export DEBUG=true # allow byebug statements diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index ab688fb..1a18505 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,8 +1,8 @@ name: Ruby - Coverage env: - K_SOUP_COV_MIN_BRANCH: 71 - K_SOUP_COV_MIN_LINE: 89 + K_SOUP_COV_MIN_BRANCH: 86 + K_SOUP_COV_MIN_LINE: 97 K_SOUP_COV_MIN_HARD: true K_SOUP_COV_DO: true K_SOUP_COV_COMMAND_NAME: "MiniTest Coverage" @@ -73,7 +73,7 @@ jobs: hide_complexity: true indicators: true output: both - thresholds: '93 82' + thresholds: '97 86' continue-on-error: ${{ matrix.experimental != 'false' }} - name: Add Coverage PR Comment diff --git a/CHANGELOG.md b/CHANGELOG.md index e05a58c..e0e4e04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed ## 2.0.0 - 2024-09-04 +COVERAGE: 97.72% -- 214/219 lines in 3 files +BRANCH COVERAGE: 86.00% -- 43/50 branches in 3 branches ### Changed - Upgraded to rack v2+ - Switched ruby-openid => ruby-openid2 From a1bf999c992032ddeae3bc387a3a9ee1e735b615 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 19:28:06 -0600 Subject: [PATCH 19/89] =?UTF-8?q?=F0=9F=93=9D=20Document=20contributors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE.txt | 1 + README.md | 42 ++++++++++++++++++++++++++++++++---------- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 4eb22c4..2c544db 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,5 @@ Copyright (c) 2010 Joshua Peek +Copyright (c) 2024 Peter Boling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/README.md b/README.md index f29c7d1..2f14085 100644 --- a/README.md +++ b/README.md @@ -79,17 +79,39 @@ TODO - 1 failing test (skipped) - rewrite tests with minitest/spec -Authors -======= -[Joshua Peek](https://github.com/josh) original author +## 🌈 Contributors -### [Contributors](https://github.com/grosser/rack-openid/contributors) - - [Kenny Buckler](https://github.com/kbuckler) - - [Mike Dillon](https://github.com/md5) - - [Richard Wilson](https://github.com/Senjai) +Current maintainer(s): -[Michael Grosser](http://grosser.it) -michael@grosser.it -License: MIT +- [Peter Boling](https://github.com/pboling) +Special thanks to: +- [Joshua Peek](https://github.com/josh) author of original `rack-openid` +- [Michael Grosser](http://grosser.it) maintainer of original `rack-openid` + +and contributors to original `rack-openid`: +- [Kenny Buckler](https://github.com/kbuckler) +- [Mike Dillon](https://github.com/md5) +- [Richard Wilson](https://github.com/Senjai) + +[![Contributors][🖐contributors-img]][🖐contributors] + +Made with [contributors-img][🖐contrib-rocks]. + +[🖐contrib-rocks]: https://contrib.rocks +[🖐contributors]: https://github.com/VitalConnectInc/rack-openid2/graphs/contributors +[🖐contributors-img]: https://contrib.rocks/image?repo=VitalConnectInc/rack-openid2 + +## 📄 License + +The gem is available as open source under the terms of +the [MIT License][📄license] [![License: MIT][📄license-img]][📄license-ref]. +See [LICENSE.txt][📄license] for the official [Copyright Notice][📄copyright-notice-explainer]. + +[comment]: <> ( 📄 LEGAL LINKS ) + +[📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year +[📄license]: LICENSE.txt +[📄license-ref]: https://opensource.org/licenses/MIT +[📄license-img]: https://img.shields.io/badge/License-MIT-green.svg From 3c64d465de7d2b865b3b32b4ce2344cc8fe84913 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 19:29:05 -0600 Subject: [PATCH 20/89] =?UTF-8?q?=F0=9F=9A=A8=20Markdown=20formatting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2f14085..3a7de8f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Provides a more HTTPish API around the ruby-openid library. -# Usage +## Usage You trigger an OpenID request similar to HTTP authentication. From your app, return a "401 Unauthorized" and a "WWW-Authenticate" header with the identifier you would like to validate. @@ -73,12 +73,10 @@ __END__ ``` +## TODO -TODO -==== - - 1 failing test (skipped) - - rewrite tests with minitest/spec - +- 1 failing test (skipped) +- rewrite tests with minitest/spec ## 🌈 Contributors From 73e6e3c8475598e6491dff2fa96865d3dfe7738c Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 19:29:53 -0600 Subject: [PATCH 21/89] =?UTF-8?q?=F0=9F=9A=A8=20Markdown=20formatting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3a7de8f..201cba5 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,7 @@ Made with [contributors-img][🖐contrib-rocks]. The gem is available as open source under the terms of the [MIT License][📄license] [![License: MIT][📄license-img]][📄license-ref]. + See [LICENSE.txt][📄license] for the official [Copyright Notice][📄copyright-notice-explainer]. [comment]: <> ( 📄 LEGAL LINKS ) From f4fa3c40c02d22a6863bf450c0c4163ccb5f6fc4 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 19:47:09 -0600 Subject: [PATCH 22/89] =?UTF-8?q?=F0=9F=9A=A8=20Linting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - caveat, linting will fail on autocorrect - See: https://github.com/skryukov/rubocop-gradual/issues/24#issuecomment-2330437982 --- .rubocop_gradual.lock | 9 +++++++-- bin/bundle | 10 +++++----- bin/setup | 8 ++++++++ 3 files changed, 20 insertions(+), 7 deletions(-) create mode 100755 bin/setup diff --git a/.rubocop_gradual.lock b/.rubocop_gradual.lock index cd948fb..19e9e56 100644 --- a/.rubocop_gradual.lock +++ b/.rubocop_gradual.lock @@ -1,5 +1,10 @@ { - "bin/bundle:4028066867": [ - [64, 5, 20, "ThreadSafety/InstanceVariableInClassMethod: Avoid instance variables in class methods.", 2485198147] + "bin/bundle:3870166066": [ + [33, 24, 58, "Performance/ConstantRegexp: Extract this regexp into a constant, memoize it, or append an `/o` option to its options.", 2287896868], + [59, 40, 62, "Performance/ConstantRegexp: Extract this regexp into a constant, memoize it, or append an `/o` option to its options.", 2593609308], + [64, 5, 20, "ThreadSafety/InstanceVariableInClassMethod: Avoid instance variables in class methods.", 2485198147], + [86, 7, 34, "Style/MethodCallWithArgsParentheses: Use parentheses for method calls with arguments.", 991972134], + [93, 5, 194, "Style/MethodCallWithArgsParentheses: Use parentheses for method calls with arguments.", 1374511802], + [94, 5, 7, "Style/MethodCallWithArgsParentheses: Use parentheses for method calls with arguments.", 285434243] ] } diff --git a/bin/bundle b/bin/bundle index 450605b..42c7fd7 100755 --- a/bin/bundle +++ b/bin/bundle @@ -30,7 +30,7 @@ m = Module.new do if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN bundler_version = a end - next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/o + next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/ bundler_version = $1 update_index = i end @@ -56,7 +56,7 @@ m = Module.new do def lockfile_version return unless File.file?(lockfile) lockfile_contents = File.read(lockfile) - return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/o + return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/ Regexp.last_match(1) end @@ -83,15 +83,15 @@ m = Module.new do def activate_bundler gem_error = activation_error_handling do - gem("bundler", bundler_requirement) + gem "bundler", bundler_requirement end return if gem_error.nil? require_error = activation_error_handling do require "bundler/version" end return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION)) - warn("Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`") - exit(42) + warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`" + exit 42 end def activation_error_handling diff --git a/bin/setup b/bin/setup new file mode 100755 index 0000000..dce67d8 --- /dev/null +++ b/bin/setup @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -euo pipefail +IFS=$'\n\t' +set -vx + +bundle install + +# Do any other automated setup that you need to do here From 0264bc478fb0fc4df5975e4afb2ee8581a9d81ea Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 19:57:01 -0600 Subject: [PATCH 23/89] =?UTF-8?q?=E2=9C=A8=20Badges=20FTW!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 201cba5..9c7db34 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,26 @@ # Rack::OpenID +
+ +[![CI Supported Build][🚎s-wfi]][🚎s-wf] +[![CI Unsupported Build][🚎us-wfi]][🚎us-wf] +[![CI Style Build][🚎st-wfi]][🚎st-wf] +[![CI Coverage Build][🚎cov-wfi]][🚎cov-wf] +[![CI Heads Build][🚎hd-wfi]][🚎hd-wf] + +[🚎s-wf]: https://github.com/VitalConnectInc/rack-openid2/actions/workflows/supported.yml +[🚎s-wfi]: https://github.com/VitalConnectInc/rack-openid2/actions/workflows/supported.yml/badge.svg +[🚎us-wf]: https://github.com/VitalConnectInc/rack-openid2/actions/workflows/unsupported.yml +[🚎us-wfi]: https://github.com/VitalConnectInc/rack-openid2/actions/workflows/unsupported.yml/badge.svg +[🚎st-wf]: https://github.com/VitalConnectInc/rack-openid2/actions/workflows/style.yml +[🚎st-wfi]: https://github.com/VitalConnectInc/rack-openid2/actions/workflows/style.yml/badge.svg +[🚎cov-wf]: https://github.com/VitalConnectInc/rack-openid2/actions/workflows/coverage.yml +[🚎cov-wfi]: https://github.com/VitalConnectInc/rack-openid2/actions/workflows/coverage.yml/badge.svg +[🚎hd-wf]: https://github.com/VitalConnectInc/rack-openid2/actions/workflows/heads.yml +[🚎hd-wfi]: https://github.com/VitalConnectInc/rack-openid2/actions/workflows/heads.yml/badge.svg + +
+ Provides a more HTTPish API around the ruby-openid library. ## Usage From 5a2325081ed2af5825805400f7975bb0cb2157b0 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 20:01:47 -0600 Subject: [PATCH 24/89] =?UTF-8?q?=F0=9F=93=9D=20Normalize=20instructions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CONTRIBUTING.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4f569a7..44bb242 100755 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,17 +24,18 @@ See: [RubyGems Security Guide][🔒️rubygems-security-guide] 4. Run `git commit -am "🔖 Prepare release v"` to commit the changes 5. Run `git push` to trigger the final CI pipeline before release, & merge PRs - NOTE: Remember to [check the build][🧪build]! -6. Run `git checkout main` -7. Run `git pull origin main` to ensure you will release the latest trunk code. -8. Set `SOURCE_DATE_EPOCH` so `rake build` and `rake release` use same timestamp, and generate same checksums +6. Run `export GIT_TRUNK_BRANCH_NAME="$(git remote show origin | grep 'HEAD branch' | cut -d ' ' -f5)" && echo $GIT_TRUNK_BRANCH_NAME` +7. Run `git checkout $GIT_TRUNK_BRANCH_NAME` +8. Run `git pull origin $GIT_TRUNK_BRANCH_NAME` to ensure you will release the latest trunk code +9. Set `SOURCE_DATE_EPOCH` so `rake build` and `rake release` use same timestamp, and generate same checksums - Run `export SOURCE_DATE_EPOCH=$EPOCHSECONDS && echo $SOURCE_DATE_EPOCH` - If the echo above has no output, then it didn't work. - Note that you'll need the `zsh/datetime` module, if running `zsh`. - In `bash` you can use `date +%s` instead, i.e. `export SOURCE_DATE_EPOCH=$(date +%s) && echo $SOURCE_DATE_EPOCH` -9. Run `bundle exec rake build` -10. Run [`bin/checksums`][🔒️rubygems-checksums-pr] to create SHA-256 and SHA-512 checksums +10. Run `bundle exec rake build` +11. Run [`bin/checksums`][🔒️rubygems-checksums-pr] to create SHA-256 and SHA-512 checksums - Checksums will be committed automatically by the script, but not pushed -11. Run `bundle exec rake release` which will create a git tag for the version, +12. Run `bundle exec rake release` which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org][💎rubygems] ## Contributors From 07b646021432773147f3c816a193c030272d6135 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 20:10:04 -0600 Subject: [PATCH 25/89] =?UTF-8?q?=F0=9F=94=92=EF=B8=8F=20Add=20checksums?= =?UTF-8?q?=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/checksums | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100755 bin/checksums diff --git a/bin/checksums b/bin/checksums new file mode 100755 index 0000000..5498152 --- /dev/null +++ b/bin/checksums @@ -0,0 +1,67 @@ +#!/usr/bin/env ruby + +# Script from https://github.com/rubygems/guides/pull/325 +require "digest/sha2" + +# Final clause of Regex `(?=\.gem)` is a positive lookahead assertion +# See: https://learnbyexample.github.io/Ruby_Regexp/lookarounds.html#positive-lookarounds +# Used to pattern match against a gem package name, which always ends with .gem. +# The positive lookahead ensures it is present, and prevents it from being captured. +VERSION_REGEX = /((\d+\.\d+\.\d+)([-.][0-9A-Za-z-]+)*)(?=\.gem)/ + +gem_path_parts = ARGV.first&.split("/") + +if gem_path_parts&.any? + gem_name = gem_path_parts.last + gem_pkg = File.join(gem_path_parts) + puts "Looking for: #{gem_pkg.inspect}" + gems = Dir[gem_pkg] + puts "Found: #{gems.inspect}" +else + gem_pkgs = File.join("pkg", "*.gem") + puts "Looking for: #{gem_pkgs.inspect}" + gems = Dir[gem_pkgs] + raise "Unable to find gems #{gem_pkgs}" if gems.empty? + + # Sort by newest last + # [ "my_gem-2.3.9.gem", "my_gem-2.3.11.pre.alpha.4.gem", "my_gem-2.3.15.gem", ... ] + gems.sort_by! { |gem| Gem::Version.new(gem[VERSION_REGEX]) } + gem_pkg = gems.last + gem_path_parts = gem_pkg.split("/") + gem_name = gem_path_parts.last + puts "Found: #{gems.length} gems; latest is #{gem_name}" +end + +checksum512 = Digest::SHA512.new.hexdigest(File.read(gem_pkg)) +checksum512_path = "checksums/#{gem_name}.sha512" +File.write(checksum512_path, checksum512) + +checksum256 = Digest::SHA256.new.hexdigest(File.read(gem_pkg)) +checksum256_path = "checksums/#{gem_name}.sha256" +File.write(checksum256_path, checksum256) + +version = gem_name[VERSION_REGEX] + +git_cmd = <<~GIT_MSG + git add checksums/* && \ + git commit -m "🔒️ Checksums for v#{version}" +GIT_MSG + +puts <<~RESULTS + [ GEM: #{gem_name} ] + [ VERSION: #{version} ] + [ GEM PKG LOCATION: #{gem_pkg} ] + [ CHECKSUM SHA-256: #{checksum256} ] + [ CHECKSUM SHA-512: #{checksum512} ] + [ CHECKSUM SHA-256 PATH: #{checksum256_path} ] + [ CHECKSUM SHA-512 PATH: #{checksum512_path} ] + + ... Running ... + + #{git_cmd} +RESULTS + +# This will replace the current process with the git process, and exit. +# Any command placed after this will not be run: +# See: https://www.akshaykhot.com/call-shell-commands-in-ruby +exec(git_cmd) From f54faf3616a30994a119db6f4e03374008d0b2aa Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 20:16:49 -0600 Subject: [PATCH 26/89] =?UTF-8?q?=F0=9F=94=92=EF=B8=8F=20Checksums=20for?= =?UTF-8?q?=20v2.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- checksums/rack-openid2-2.0.0.gem.sha256 | 1 + checksums/rack-openid2-2.0.0.gem.sha512 | 1 + 2 files changed, 2 insertions(+) create mode 100644 checksums/rack-openid2-2.0.0.gem.sha256 create mode 100644 checksums/rack-openid2-2.0.0.gem.sha512 diff --git a/checksums/rack-openid2-2.0.0.gem.sha256 b/checksums/rack-openid2-2.0.0.gem.sha256 new file mode 100644 index 0000000..2756171 --- /dev/null +++ b/checksums/rack-openid2-2.0.0.gem.sha256 @@ -0,0 +1 @@ +0ec1f8381e87d63c621db6fa080d30908fd64ce9a72da75fc4e72c7a16e06092 \ No newline at end of file diff --git a/checksums/rack-openid2-2.0.0.gem.sha512 b/checksums/rack-openid2-2.0.0.gem.sha512 new file mode 100644 index 0000000..2617b61 --- /dev/null +++ b/checksums/rack-openid2-2.0.0.gem.sha512 @@ -0,0 +1 @@ +36ca13aed126604789b33e5072fda02a2f6a3cbf651f31802e391e0a37d95db1f454478bceb12e6aa5af7d62b63f4d8e397908963cba271c556c747a7a501a49 \ No newline at end of file From 8625294aceb641010a66b84cbcedf4e74661766f Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 4 Sep 2024 20:29:54 -0600 Subject: [PATCH 27/89] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Oops,=20typo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rack-openid2.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rack-openid2.gemspec b/rack-openid2.gemspec index 7c3d7fd..fd79029 100644 --- a/rack-openid2.gemspec +++ b/rack-openid2.gemspec @@ -7,7 +7,7 @@ Rack::OpenID::Version.send(:remove_const, :VERSION) Gem::Specification.new do |spec| spec.name = "rack-openid2" spec.version = gem_version - spec.summary = "Provides a more HTTPish API around the ruby-openid library" + spec.summary = "Provides a more HTTPish API around the ruby-openid2 library" spec.authors = ["Peter Boling", "Michael Grosser", "Joshua Peek"] spec.email = "peter.boling@gmail.com" spec.homepage = "https://github.com/VitalConnectInc/#{spec.name}" From 013a2b2f68d8b770f009446e81db7e62e20e28a8 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Thu, 5 Sep 2024 00:33:00 -0600 Subject: [PATCH 28/89] =?UTF-8?q?=F0=9F=8D=B1=20Include=20markdown=20files?= =?UTF-8?q?=20in=20released=20gem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rack-openid2.gemspec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rack-openid2.gemspec b/rack-openid2.gemspec index fd79029..de440be 100644 --- a/rack-openid2.gemspec +++ b/rack-openid2.gemspec @@ -21,8 +21,12 @@ Gem::Specification.new do |spec| # Splats (alphabetical) "lib/**/*.rb", # Files (alphabetical) + "CHANGELOG.md", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", "LICENSE.txt", "README.md", + "SECURITY.md" ] spec.executables = spec.files.grep(%r{^bin/}).map { |f| File.basename(f) } spec.licenses = ["MIT"] From 5f5af598f41dd788acaa6936c61532910f96ef51 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Thu, 5 Sep 2024 00:35:48 -0600 Subject: [PATCH 29/89] =?UTF-8?q?=F0=9F=94=96=20Prepare=20release=20v2.0.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 9 +++++++++ Gemfile.lock | 2 +- lib/rack/openid/version.rb | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0e4e04..7823bde 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed ### Removed +## 2.0.1 - 2024-09-05 +### Added +- CHANGELOG.md +- CODE_OF_CONDUCT.md +- CONTRIBUTING.md +- SECURITY.md +### Fixed +- Typo in gemspec description + ## 2.0.0 - 2024-09-04 COVERAGE: 97.72% -- 214/219 lines in 3 files BRANCH COVERAGE: 86.00% -- 43/50 branches in 3 branches diff --git a/Gemfile.lock b/Gemfile.lock index df2ee4e..923c1f9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,7 +7,7 @@ GIT PATH remote: . specs: - rack-openid2 (2.0.0) + rack-openid2 (2.0.1) rack (>= 2.2) ruby-openid2 (>= 3.0) version_gem (~> 1.1, >= 1.1.4) diff --git a/lib/rack/openid/version.rb b/lib/rack/openid/version.rb index bf0e799..c8225fa 100644 --- a/lib/rack/openid/version.rb +++ b/lib/rack/openid/version.rb @@ -1,7 +1,7 @@ module Rack class OpenID module Version - VERSION = "2.0.0" + VERSION = "2.0.1" end end end From df769afc16940ebbfa4df6a56fab88003b3a431b Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Thu, 5 Sep 2024 00:44:24 -0600 Subject: [PATCH 30/89] =?UTF-8?q?=F0=9F=93=8C=20use=20VitalConnectInc/rots?= =?UTF-8?q?=20from=20GitHub?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 2 +- Gemfile.lock | 2 +- gemfiles/coverage.gemfile | 2 +- gemfiles/vanilla.gemfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 86438b2..576aac4 100644 --- a/Gemfile +++ b/Gemfile @@ -17,5 +17,5 @@ end gem "minitest" gem "minitest-rg" -gem "rots", github: "roman/rots" +gem "rots", github: "VitalConnectInc/rots" gem "rack-session" diff --git a/Gemfile.lock b/Gemfile.lock index 923c1f9..e22aede 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,5 +1,5 @@ GIT - remote: https://github.com/roman/rots + remote: https://github.com/VitalConnectInc/rots revision: d11e7d820fa8b9ad49aaca5b9317ec84f5a73b46 specs: rots (0.2.2) diff --git a/gemfiles/coverage.gemfile b/gemfiles/coverage.gemfile index 84e18c2..c87b017 100644 --- a/gemfiles/coverage.gemfile +++ b/gemfiles/coverage.gemfile @@ -7,6 +7,6 @@ source "https://rubygems.org" # Exceptions, if any, will be found in gemfiles/*.gemfile gem "kettle-soup-cover", "~> 1.0", ">= 1.0.2" -gem "rots", github: "roman/rots" +gem "rots", github: "VitalConnectInc/rots" gemspec path: "../" diff --git a/gemfiles/vanilla.gemfile b/gemfiles/vanilla.gemfile index fdafa83..7a685ea 100644 --- a/gemfiles/vanilla.gemfile +++ b/gemfiles/vanilla.gemfile @@ -6,6 +6,6 @@ source "https://rubygems.org" # On CI we only need the gemspecs' dependencies (including development dependencies). # Exceptions, if any, will be found in gemfiles/*.gemfile -gem "rots", github: "roman/rots" +gem "rots", github: "VitalConnectInc/rots" gemspec path: "../" From ebc5d2a1936dcf36fdc865b2329e625271deb09f Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Thu, 5 Sep 2024 00:53:23 -0600 Subject: [PATCH 31/89] =?UTF-8?q?=F0=9F=94=92=EF=B8=8F=20Checksums=20for?= =?UTF-8?q?=20v2.0.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- checksums/rack-openid2-2.0.1.gem.sha256 | 1 + checksums/rack-openid2-2.0.1.gem.sha512 | 1 + 2 files changed, 2 insertions(+) create mode 100644 checksums/rack-openid2-2.0.1.gem.sha256 create mode 100644 checksums/rack-openid2-2.0.1.gem.sha512 diff --git a/checksums/rack-openid2-2.0.1.gem.sha256 b/checksums/rack-openid2-2.0.1.gem.sha256 new file mode 100644 index 0000000..f0af4db --- /dev/null +++ b/checksums/rack-openid2-2.0.1.gem.sha256 @@ -0,0 +1 @@ +1d34f3cc39bb662298176b03a77aab07d1152d1f699d039b2455915f4d87aef3 \ No newline at end of file diff --git a/checksums/rack-openid2-2.0.1.gem.sha512 b/checksums/rack-openid2-2.0.1.gem.sha512 new file mode 100644 index 0000000..40cabb1 --- /dev/null +++ b/checksums/rack-openid2-2.0.1.gem.sha512 @@ -0,0 +1 @@ +96004d0d0b77d64070a3bee66cc23ca9135b16eb24c1561ad530f985c6ab715a1010ca6ecd52821d280abb14003a93d60629579cad14b404116ae7419940b713 \ No newline at end of file From bf46d9cb3daf43a0ca22ba784bcc7f04150c1b71 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Fri, 20 Sep 2024 11:17:54 -0600 Subject: [PATCH 32/89] =?UTF-8?q?=F0=9F=94=A7=20Improved=20integration=20w?= =?UTF-8?q?ith=20direnv=20for=20development?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .envrc | 27 +++++++++++++++++++++++++++ CHANGELOG.md | 4 ++++ 2 files changed, 31 insertions(+) diff --git a/.envrc b/.envrc index decb849..07e34a0 100644 --- a/.envrc +++ b/.envrc @@ -1,3 +1,19 @@ +# Run any command in this library's bin/ without the bin/ prefix! +PATH_add bin + +# Only add things to this file that should be shared with the team. + +# **dotenv** (See end of file for .env.local integration) +# .env would override anything in this file, if enabled. +# .env is a DOCKER standard, and if we use it, it would be in deployed, or DOCKER, environments. +# Override and customize anything below in your own .env.local +# If you are using dotenv and not direnv, +# copy the following `export` statements to your own .env file. + +### General Ruby ### +# Turn off Ruby Warnings about deprecated code +# export RUBYOPT="-W0" + ### External Testing Controls export K_SOUP_COV_DO=true # Means you want code coverage # Available formats are html, xml, rcov, lcov, json, tty @@ -9,3 +25,14 @@ export K_SOUP_COV_MIN_HARD=true # Means you want the build to fail if the covera export K_SOUP_COV_MULTI_FORMATTERS=true export MAX_ROWS=5 # Setting for simplecov-console gem for tty output, limits to the worst N rows of bad coverage export DEBUG=true # allow byebug statements + +# Internal Debugging Controls +export DEBUG=false # do not allow byebug statements (override in .env.local) + +# .env would override anything in this file, if `dotenv` is uncommented below. +# .env is a DOCKER standard, and if we use it, it would be in deployed, or DOCKER, environments, +# and that is why we generally want to leave it commented out. +# dotenv + +# .env.local will override anything in this file. +dotenv_if_exists .env.local diff --git a/CHANGELOG.md b/CHANGELOG.md index 7823bde..8dc6e04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed ### Removed +## 2.0.2 - 2024-09-20 +### Added +- Improved integration with direnv for development + ## 2.0.1 - 2024-09-05 ### Added - CHANGELOG.md From 40a9d93dcfa96794c22a8480d8a611fd39b901da Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Fri, 20 Sep 2024 11:39:33 -0600 Subject: [PATCH 33/89] =?UTF-8?q?=F0=9F=99=88=20Ignore=20ignorable=20thing?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index 2095d5d..2e23cbd 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,7 @@ /doc/ +.env.local +.yardoc/ +coverage/ +pkg/ +.bundle/ +.byebug_history From c855ce91ff154bdb00acf1bc44efc29a47836c79 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Fri, 20 Sep 2024 11:59:10 -0600 Subject: [PATCH 34/89] =?UTF-8?q?=F0=9F=94=A5=20Rakefile=20doesn't=20need?= =?UTF-8?q?=20shebang?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rakefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Rakefile b/Rakefile index db98907..fc0e04d 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,3 @@ -#!/usr/bin/env rake require "bundler/gem_tasks" require "rake/testtask" From 9c60f235ed6bbd735395dabd055e85cf473fd829 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Fri, 20 Sep 2024 11:59:53 -0600 Subject: [PATCH 35/89] =?UTF-8?q?=F0=9F=94=A5=20Remove=20duplicate=20ENV?= =?UTF-8?q?=20var?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - change MAX_ROWS to 1 (override in .env.local) --- .envrc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.envrc b/.envrc index 07e34a0..ec029d8 100644 --- a/.envrc +++ b/.envrc @@ -23,8 +23,7 @@ export K_SOUP_COV_MIN_BRANCH=86 # Means you want to enforce X% branch coverage export K_SOUP_COV_MIN_LINE=97 # Means you want to enforce X% line coverage export K_SOUP_COV_MIN_HARD=true # Means you want the build to fail if the coverage thresholds are not met export K_SOUP_COV_MULTI_FORMATTERS=true -export MAX_ROWS=5 # Setting for simplecov-console gem for tty output, limits to the worst N rows of bad coverage -export DEBUG=true # allow byebug statements +export MAX_ROWS=1 # Setting for simplecov-console gem for tty output, limits to the worst N rows of bad coverage # Internal Debugging Controls export DEBUG=false # do not allow byebug statements (override in .env.local) From bdb124d18df8e468f32d489c37af041c27b14ac2 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Fri, 20 Sep 2024 12:00:20 -0600 Subject: [PATCH 36/89] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Refactor=20test=20re?= =?UTF-8?q?quires=20for=20proper=20load=20order?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/helper.rb | 6 ------ test/support/logging.rb | 7 +++++++ test/test_helper.rb | 20 ++++++++++++++------ test/test_integration.rb | 5 +++-- 4 files changed, 24 insertions(+), 14 deletions(-) delete mode 100644 test/helper.rb create mode 100644 test/support/logging.rb diff --git a/test/helper.rb b/test/helper.rb deleted file mode 100644 index 4f114be..0000000 --- a/test/helper.rb +++ /dev/null @@ -1,6 +0,0 @@ -require "rack/openid" -require "rack/openid/simple_auth" - -log = Logger.new($stdout) -log.level = Logger::WARN -OpenID::Util.logger = log diff --git a/test/support/logging.rb b/test/support/logging.rb new file mode 100644 index 0000000..d33aef2 --- /dev/null +++ b/test/support/logging.rb @@ -0,0 +1,7 @@ +require "logger" + +module TestLogging + LOGGER = Logger.new($stdout) +end + +TestLogging::LOGGER.level = Logger::WARN diff --git a/test/test_helper.rb b/test/test_helper.rb index d36e74b..7807194 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,5 +1,14 @@ # External dependencies require "byebug" if ENV.fetch("DEBUG", "false").casecmp?("true") +require "net/http" +require "rack" +require "rack/session" + +# testing libraries +require "minitest/rg" + +# Test support +require "support/logging" ## Last thing before loading this gem is to setup code coverage begin @@ -11,12 +20,11 @@ nil end -# Testing libraries +# Testing libraries that need to load after simplecov require "minitest/autorun" -require "minitest/rg" -require "net/http" -require "rack" -require "rack/session" # Internal dependencies & mixins -require_relative "helper" +require "rack/openid" +require "rack/openid/simple_auth" + +OpenID::Util.logger = TestLogging::LOGGER diff --git a/test/test_integration.rb b/test/test_integration.rb index d443cea..b36b71f 100644 --- a/test/test_integration.rb +++ b/test/test_integration.rb @@ -1,3 +1,6 @@ +# External libraries +require "rots" + require_relative "test_helper" describe "integration" do @@ -30,8 +33,6 @@ def fetch(url, body = nil, headers = nil, limit = nil) ROTS_SERVER_URL = "http://localhost:9292" RotsApp = Rack::Builder.new do - require "rots" - config = { "identity" => "john.doe", "sreg" => { From 8a0172062f6196a9a7ff2c8fb0c651e0d0154397 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Fri, 20 Sep 2024 12:01:44 -0600 Subject: [PATCH 37/89] =?UTF-8?q?=F0=9F=93=8C=20Update=20to=20new=20home?= =?UTF-8?q?=20of=20rots:=20oauth-xx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 576aac4..c0388a3 100644 --- a/Gemfile +++ b/Gemfile @@ -17,5 +17,5 @@ end gem "minitest" gem "minitest-rg" -gem "rots", github: "VitalConnectInc/rots" +gem "rots", github: "oauth-xx/rots" gem "rack-session" From 7421a86e180f4fb7225d801e4d298f648e7832e2 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Fri, 20 Sep 2024 12:03:40 -0600 Subject: [PATCH 38/89] =?UTF-8?q?=F0=9F=94=A5=20Remove=20duplicate=20depen?= =?UTF-8?q?dencies=20(gemspec=20>=20Gemfile)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Gemfile b/Gemfile index c0388a3..e4a17b2 100644 --- a/Gemfile +++ b/Gemfile @@ -15,7 +15,4 @@ platform :mri do gem "byebug", ">= 11" end -gem "minitest" -gem "minitest-rg" gem "rots", github: "oauth-xx/rots" -gem "rack-session" From 79327a2819f6119f59535736f5d19acef6828e4f Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Fri, 20 Sep 2024 12:04:05 -0600 Subject: [PATCH 39/89] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20ruby-openid2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fixes undeclared dependencies --- Gemfile.lock | 38 +++++++++++++++++++++++++------------- rack-openid2.gemspec | 2 +- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e22aede..a2ccd6c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,15 +1,19 @@ GIT - remote: https://github.com/VitalConnectInc/rots - revision: d11e7d820fa8b9ad49aaca5b9317ec84f5a73b46 + remote: https://github.com/oauth-xx/rots + revision: caeacbf72b3b5966c3a299391911557d5771ceee specs: rots (0.2.2) + net-http + rack (>= 2.0) + ruby-openid2 (~> 3.0) + yaml PATH remote: . specs: rack-openid2 (2.0.1) rack (>= 2.2) - ruby-openid2 (>= 3.0) + ruby-openid2 (~> 3.0, >= 3.0.1) version_gem (~> 1.1, >= 1.1.4) GEM @@ -37,6 +41,9 @@ GEM minitest (5.25.1) minitest-rg (5.3.0) minitest (~> 5.0) + net-http (0.4.1) + uri + ostruct (0.6.0) parallel (1.26.3) parser (3.3.5.0) ast (~> 2.4.1) @@ -73,8 +80,8 @@ GEM rubocop-ruby2_7 (>= 2.0.4, < 3) standard-rubocop-lts (>= 1.0.3, < 3) version_gem (>= 1.1.2, < 3) - rubocop-md (1.2.2) - rubocop (>= 1.0) + rubocop-md (1.2.3) + rubocop (>= 1.45) rubocop-minitest (0.36.0) rubocop (>= 1.61, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) @@ -97,7 +104,9 @@ GEM rubocop (~> 1.51) rubocop-thread_safety (0.5.1) rubocop (>= 0.90.0) - ruby-openid2 (3.0.0) + ruby-openid2 (3.0.1) + net-http (~> 0.4, >= 0.4.1) + rexml (~> 3.3, >= 3.3.7) version_gem (~> 1.1, >= 1.1.4) ruby-progressbar (1.13.0) simplecov (0.22.0) @@ -107,11 +116,11 @@ GEM simplecov-cobertura (2.1.0) rexml simplecov (~> 0.19) - simplecov-console (0.9.1) + simplecov-console (0.9.2) ansi simplecov terminal-table - simplecov-html (0.12.3) + simplecov-html (0.13.1) simplecov-lcov (0.8.0) simplecov-rcov (0.3.7) simplecov (>= 0.4.1) @@ -136,11 +145,14 @@ GEM version_gem (>= 1.1.4, < 3) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - unicode-display_width (2.5.0) + unicode-display_width (2.6.0) + uri (0.13.1) version_gem (1.1.4) + yaml (0.3.0) yard (0.9.37) - yard-junk (0.0.9) + yard-junk (0.0.10) backports (>= 3.18) + ostruct rainbow yard @@ -150,10 +162,10 @@ PLATFORMS DEPENDENCIES byebug (>= 11) kettle-soup-cover (~> 1.0, >= 1.0.2) - minitest - minitest-rg + minitest (>= 5) + minitest-rg (>= 5) rack-openid2! - rack-session + rack-session (>= 2) rake (>= 13) rots! rubocop-lts (~> 18.2, >= 18.2.1) diff --git a/rack-openid2.gemspec b/rack-openid2.gemspec index de440be..359921d 100644 --- a/rack-openid2.gemspec +++ b/rack-openid2.gemspec @@ -42,7 +42,7 @@ Gem::Specification.new do |spec| spec.metadata["rubygems_mfa_required"] = "true" spec.add_dependency("rack", ">= 2.2") - spec.add_dependency("ruby-openid2", ">= 3.0") + spec.add_dependency("ruby-openid2", "~> 3.0", ">= 3.0.1") spec.add_dependency("version_gem", "~> 1.1", ">= 1.1.4") # Testing From b7a8fdb1df33a98851d360029f77ca0afac176bb Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Tue, 24 Sep 2024 14:57:03 -0600 Subject: [PATCH 40/89] =?UTF-8?q?=F0=9F=9A=9A=20retarget=20links=20to=20oa?= =?UTF-8?q?uth-xx=20org?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CONTRIBUTING.md | 14 +++++++------- README.md | 24 ++++++++++++------------ gemfiles/coverage.gemfile | 2 +- gemfiles/vanilla.gemfile | 2 +- rack-openid2.gemspec | 2 +- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 44bb242..94658ce 100755 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ ## Contributing -Bug reports and pull requests are welcome on GitHub at [https://github.com/VitalConnectInc/rack-openid2][🚎src-main] +Bug reports and pull requests are welcome on GitHub at [https://github.com/oauth-xx/rack-openid2][🚎src-main] . This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct][🤝conduct]. @@ -33,7 +33,7 @@ See: [RubyGems Security Guide][🔒️rubygems-security-guide] - Note that you'll need the `zsh/datetime` module, if running `zsh`. - In `bash` you can use `date +%s` instead, i.e. `export SOURCE_DATE_EPOCH=$(date +%s) && echo $SOURCE_DATE_EPOCH` 10. Run `bundle exec rake build` -11. Run [`bin/checksums`][🔒️rubygems-checksums-pr] to create SHA-256 and SHA-512 checksums +11. Run `bin/checksums` (more [context][🔒️rubygems-checksums-pr]) to create SHA-256 and SHA-512 checksums - Checksums will be committed automatically by the script, but not pushed 12. Run `bundle exec rake release` which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org][💎rubygems] @@ -44,12 +44,12 @@ See: [RubyGems Security Guide][🔒️rubygems-security-guide] Made with [contributors-img][🖐contrib-rocks]. -[🧪build]: https://github.com/VitalConnectInc/rack-openid2/actions -[🤝conduct]: https://github.com/VitalConnectInc/rack-openid2/blob/main/CODE_OF_CONDUCT.md +[🧪build]: https://github.com/oauth-xx/rack-openid2/actions +[🤝conduct]: https://github.com/oauth-xx/rack-openid2/blob/main/CODE_OF_CONDUCT.md [🖐contrib-rocks]: https://contrib.rocks -[🖐contributors]: https://github.com/VitalConnectInc/rack-openid2/graphs/contributors -[🖐contributors-img]: https://contrib.rocks/image?repo=VitalConnectInc/rack-openid2 +[🖐contributors]: https://github.com/oauth-xx/rack-openid2/graphs/contributors +[🖐contributors-img]: https://contrib.rocks/image?repo=oauth-xx/rack-openid2 [💎rubygems]: https://rubygems.org [🔒️rubygems-security-guide]: https://guides.rubygems.org/security/#building-gems [🔒️rubygems-checksums-pr]: https://github.com/rubygems/guides/pull/325 -[🚎src-main]: https://github.com/VitalConnectInc/rack-openid2 +[🚎src-main]: https://github.com/oauth-xx/rack-openid2 diff --git a/README.md b/README.md index 9c7db34..7bc0ec8 100644 --- a/README.md +++ b/README.md @@ -8,16 +8,16 @@ [![CI Coverage Build][🚎cov-wfi]][🚎cov-wf] [![CI Heads Build][🚎hd-wfi]][🚎hd-wf] -[🚎s-wf]: https://github.com/VitalConnectInc/rack-openid2/actions/workflows/supported.yml -[🚎s-wfi]: https://github.com/VitalConnectInc/rack-openid2/actions/workflows/supported.yml/badge.svg -[🚎us-wf]: https://github.com/VitalConnectInc/rack-openid2/actions/workflows/unsupported.yml -[🚎us-wfi]: https://github.com/VitalConnectInc/rack-openid2/actions/workflows/unsupported.yml/badge.svg -[🚎st-wf]: https://github.com/VitalConnectInc/rack-openid2/actions/workflows/style.yml -[🚎st-wfi]: https://github.com/VitalConnectInc/rack-openid2/actions/workflows/style.yml/badge.svg -[🚎cov-wf]: https://github.com/VitalConnectInc/rack-openid2/actions/workflows/coverage.yml -[🚎cov-wfi]: https://github.com/VitalConnectInc/rack-openid2/actions/workflows/coverage.yml/badge.svg -[🚎hd-wf]: https://github.com/VitalConnectInc/rack-openid2/actions/workflows/heads.yml -[🚎hd-wfi]: https://github.com/VitalConnectInc/rack-openid2/actions/workflows/heads.yml/badge.svg +[🚎s-wf]: https://github.com/oauth-xx/rack-openid2/actions/workflows/supported.yml +[🚎s-wfi]: https://github.com/oauth-xx/rack-openid2/actions/workflows/supported.yml/badge.svg +[🚎us-wf]: https://github.com/oauth-xx/rack-openid2/actions/workflows/unsupported.yml +[🚎us-wfi]: https://github.com/oauth-xx/rack-openid2/actions/workflows/unsupported.yml/badge.svg +[🚎st-wf]: https://github.com/oauth-xx/rack-openid2/actions/workflows/style.yml +[🚎st-wfi]: https://github.com/oauth-xx/rack-openid2/actions/workflows/style.yml/badge.svg +[🚎cov-wf]: https://github.com/oauth-xx/rack-openid2/actions/workflows/coverage.yml +[🚎cov-wfi]: https://github.com/oauth-xx/rack-openid2/actions/workflows/coverage.yml/badge.svg +[🚎hd-wf]: https://github.com/oauth-xx/rack-openid2/actions/workflows/heads.yml +[🚎hd-wfi]: https://github.com/oauth-xx/rack-openid2/actions/workflows/heads.yml/badge.svg @@ -119,8 +119,8 @@ and contributors to original `rack-openid`: Made with [contributors-img][🖐contrib-rocks]. [🖐contrib-rocks]: https://contrib.rocks -[🖐contributors]: https://github.com/VitalConnectInc/rack-openid2/graphs/contributors -[🖐contributors-img]: https://contrib.rocks/image?repo=VitalConnectInc/rack-openid2 +[🖐contributors]: https://github.com/oauth-xx/rack-openid2/graphs/contributors +[🖐contributors-img]: https://contrib.rocks/image?repo=oauth-xx/rack-openid2 ## 📄 License diff --git a/gemfiles/coverage.gemfile b/gemfiles/coverage.gemfile index c87b017..fa8c11a 100644 --- a/gemfiles/coverage.gemfile +++ b/gemfiles/coverage.gemfile @@ -7,6 +7,6 @@ source "https://rubygems.org" # Exceptions, if any, will be found in gemfiles/*.gemfile gem "kettle-soup-cover", "~> 1.0", ">= 1.0.2" -gem "rots", github: "VitalConnectInc/rots" +gem "rots", github: "oauth-xx/rots" gemspec path: "../" diff --git a/gemfiles/vanilla.gemfile b/gemfiles/vanilla.gemfile index 7a685ea..833c07a 100644 --- a/gemfiles/vanilla.gemfile +++ b/gemfiles/vanilla.gemfile @@ -6,6 +6,6 @@ source "https://rubygems.org" # On CI we only need the gemspecs' dependencies (including development dependencies). # Exceptions, if any, will be found in gemfiles/*.gemfile -gem "rots", github: "VitalConnectInc/rots" +gem "rots", github: "oauth-xx/rots" gemspec path: "../" diff --git a/rack-openid2.gemspec b/rack-openid2.gemspec index 359921d..6522efc 100644 --- a/rack-openid2.gemspec +++ b/rack-openid2.gemspec @@ -10,7 +10,7 @@ Gem::Specification.new do |spec| spec.summary = "Provides a more HTTPish API around the ruby-openid2 library" spec.authors = ["Peter Boling", "Michael Grosser", "Joshua Peek"] spec.email = "peter.boling@gmail.com" - spec.homepage = "https://github.com/VitalConnectInc/#{spec.name}" + spec.homepage = "https://github.com/oauth-xx/#{spec.name}" # See CONTRIBUTING.md spec.cert_chain = [ENV.fetch("GEM_CERT_PATH", "certs/#{ENV.fetch("GEM_CERT_USER", ENV["USER"])}.pem")] From bc28a6b7c01232ef7fbd3006eb14b9ad71f1282a Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Tue, 24 Sep 2024 14:57:22 -0600 Subject: [PATCH 41/89] =?UTF-8?q?=E2=9C=A8=20automatic=20loading=20via=20b?= =?UTF-8?q?undler?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/rack-openid2.rb | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 lib/rack-openid2.rb diff --git a/lib/rack-openid2.rb b/lib/rack-openid2.rb new file mode 100644 index 0000000..f7bc2ea --- /dev/null +++ b/lib/rack-openid2.rb @@ -0,0 +1,2 @@ +# For loading by bundler +require_relative "rack/openid" From d69abdf03b19d2d9bee2a03f1dad9a612a1d7413 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Tue, 24 Sep 2024 14:57:43 -0600 Subject: [PATCH 42/89] =?UTF-8?q?=F0=9F=8E=A8=20Namespace=20constant=20les?= =?UTF-8?q?s=20confusingly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/rack/openid/simple_auth.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rack/openid/simple_auth.rb b/lib/rack/openid/simple_auth.rb index 4c7fb48..9848015 100644 --- a/lib/rack/openid/simple_auth.rb +++ b/lib/rack/openid/simple_auth.rb @@ -54,7 +54,7 @@ def authenticate_session(env) end def successful_response?(env) - if (resp = env[OpenID::RESPONSE]) + if (resp = env[Rack::OpenID::RESPONSE]) resp.status == :success && resp.display_identifier == identifier end end From 2df048f4c5640dbabe581aecc26a8d9e62117898 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Tue, 24 Sep 2024 14:58:00 -0600 Subject: [PATCH 43/89] =?UTF-8?q?=F0=9F=94=A7=20binstub=20for=20rackup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/rackup | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 bin/rackup diff --git a/bin/rackup b/bin/rackup new file mode 100755 index 0000000..6408c79 --- /dev/null +++ b/bin/rackup @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'rackup' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rackup", "rackup") From f7bc4826f3805028b19b9d3d48ac1f93c0dc2184 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Tue, 24 Sep 2024 14:58:23 -0600 Subject: [PATCH 44/89] =?UTF-8?q?=F0=9F=94=A7=20ruby=203.3.5=20for=20devel?= =?UTF-8?q?opment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .tool-versions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.tool-versions b/.tool-versions index 59511e1..1dd1998 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1 @@ -ruby 2.7.8 +ruby 3.3.5 From 8bca1637d3b48d17c3d8e942718127d9b73fe03d Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 25 Sep 2024 13:18:40 -0600 Subject: [PATCH 45/89] =?UTF-8?q?=F0=9F=94=96=20Prepare=20for=20release=20?= =?UTF-8?q?v2.0.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .envrc | 1 + .simplecov | 4 +- CHANGELOG.md | 11 +- Gemfile | 2 - Gemfile.lock | 63 ++- README.md | 68 +++ Rakefile | 7 +- lib/rack/openid/version.rb | 2 +- rack-openid2.gemspec | 12 +- test/{test_helper.rb => support/config.rb} | 20 +- test/test_integration.rb | 566 +++++++-------------- test/test_openid_headers.rb | 46 ++ test/test_rack_openid.rb | 2 +- test/test_simple_auth.rb | 37 ++ 14 files changed, 426 insertions(+), 415 deletions(-) rename test/{test_helper.rb => support/config.rb} (56%) create mode 100644 test/test_openid_headers.rb create mode 100644 test/test_simple_auth.rb diff --git a/.envrc b/.envrc index ec029d8..b56b211 100644 --- a/.envrc +++ b/.envrc @@ -27,6 +27,7 @@ export MAX_ROWS=1 # Setting for simplecov-console gem for tty output, limits to # Internal Debugging Controls export DEBUG=false # do not allow byebug statements (override in .env.local) +export REQUIRE_BENCH=false # set to true in .env.local to turn on require_bench # .env would override anything in this file, if `dotenv` is uncommented below. # .env is a DOCKER standard, and if we use it, it would be in deployed, or DOCKER, environments, diff --git a/.simplecov b/.simplecov index bfe90c0..b540b12 100644 --- a/.simplecov +++ b/.simplecov @@ -1,3 +1,5 @@ require "kettle/soup/cover/config" -SimpleCov.start +SimpleCov.start do + add_filter "test/**/*" +end diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dc6e04..e23e6f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,9 +10,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed ### Removed -## 2.0.2 - 2024-09-20 +## 2.0.2 - 2024-09-25 +- COVERAGE: 97.72% -- 214/219 lines in 4 files +- BRANCH COVERAGE: 86.00% -- 43/50 branches in 4 files +- 39.13% documented ### Added - Improved integration with direnv for development +- Better test coverage +- More tests +- rots v1.0.0 for tests +### Changed +- Upgraded to ruby-openid2 v3.1.0 +- Moved to oauth-xx organization ## 2.0.1 - 2024-09-05 ### Added diff --git a/Gemfile b/Gemfile index e4a17b2..a2b5f72 100644 --- a/Gemfile +++ b/Gemfile @@ -14,5 +14,3 @@ platform :mri do # Debugging gem "byebug", ">= 11" end - -gem "rots", github: "oauth-xx/rots" diff --git a/Gemfile.lock b/Gemfile.lock index a2ccd6c..10ef762 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,19 +1,9 @@ -GIT - remote: https://github.com/oauth-xx/rots - revision: caeacbf72b3b5966c3a299391911557d5771ceee - specs: - rots (0.2.2) - net-http - rack (>= 2.0) - ruby-openid2 (~> 3.0) - yaml - PATH remote: . specs: - rack-openid2 (2.0.1) + rack-openid2 (2.0.2) rack (>= 2.2) - ruby-openid2 (~> 3.0, >= 3.0.1) + ruby-openid2 (~> 3.1, >= 3.1.0) version_gem (~> 1.1, >= 1.1.4) GEM @@ -23,6 +13,7 @@ GEM ast (2.4.2) backports (3.25.0) byebug (11.1.3) + date (3.3.4) diff-lcs (1.5.1) diffy (3.4.2) docile (1.4.1) @@ -38,32 +29,54 @@ GEM version_gem (~> 1.1, >= 1.1.4) language_server-protocol (3.17.0.3) lint_roller (1.1.0) + logger (1.6.1) minitest (5.25.1) + minitest-focus (1.4.0) + minitest (>= 4, < 6) minitest-rg (5.3.0) minitest (~> 5.0) - net-http (0.4.1) - uri + openssl (3.2.0) + optparse (0.5.0) ostruct (0.6.0) parallel (1.26.3) parser (3.3.5.0) ast (~> 2.4.1) racc + psych (5.1.2) + stringio racc (1.8.1) rack (3.1.7) rack-session (2.0.0) rack (>= 3.0.0) + rackup (2.1.0) + rack (>= 3) + webrick (~> 1.8) rainbow (3.1.1) rake (13.2.1) regexp_parser (2.9.2) + require_bench (1.0.4) + version_gem (>= 1.1.3, < 4) rexml (3.3.7) + rots (1.0.0) + date + openssl + optparse + psych (~> 5.1) + rack (>= 2) + rackup (>= 2) + ruby-openid2 (~> 3.1, >= 3.1.0) + stringio + version_gem (~> 1.1, >= 1.1.4) + webrick + yaml (~> 0.3) rspec-block_is_expected (1.0.6) - rubocop (1.64.1) + rubocop (1.65.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) + regexp_parser (>= 2.4, < 3.0) rexml (>= 3.2.5, < 4.0) rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) @@ -104,9 +117,7 @@ GEM rubocop (~> 1.51) rubocop-thread_safety (0.5.1) rubocop (>= 0.90.0) - ruby-openid2 (3.0.1) - net-http (~> 0.4, >= 0.4.1) - rexml (~> 3.3, >= 3.3.7) + ruby-openid2 (3.1.0) version_gem (~> 1.1, >= 1.1.4) ruby-progressbar (1.13.0) simplecov (0.22.0) @@ -125,10 +136,10 @@ GEM simplecov-rcov (0.3.7) simplecov (>= 0.4.1) simplecov_json_formatter (0.1.4) - standard (1.37.0) + standard (1.40.0) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.64.0) + rubocop (~> 1.65.0) standard-custom (~> 1.0.0) standard-performance (~> 1.4) standard-custom (1.0.2) @@ -143,11 +154,12 @@ GEM standard-custom (>= 1.0.2, < 2) standard-performance (>= 1.3.1, < 2) version_gem (>= 1.1.4, < 3) + stringio (3.1.1) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) unicode-display_width (2.6.0) - uri (0.13.1) version_gem (1.1.4) + webrick (1.8.2) yaml (0.3.0) yard (0.9.37) yard-junk (0.0.10) @@ -162,12 +174,15 @@ PLATFORMS DEPENDENCIES byebug (>= 11) kettle-soup-cover (~> 1.0, >= 1.0.2) - minitest (>= 5) + logger (~> 1.6, >= 1.6.1) + minitest (>= 5, < 6) + minitest-focus (~> 1.4) minitest-rg (>= 5) rack-openid2! rack-session (>= 2) rake (>= 13) - rots! + require_bench (~> 1.0, >= 1.0.4) + rots (~> 1.0) rubocop-lts (~> 18.2, >= 18.2.1) rubocop-minitest (~> 0.36) rubocop-packaging (~> 0.5, >= 0.5.2) diff --git a/README.md b/README.md index 7bc0ec8..81f2e4c 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@
+[![Version](https://img.shields.io/gem/v/rack-openid2.svg)](https://rubygems.org/gems/rack-openid2) +[![Downloads Today](https://img.shields.io/gem/rd/rack-openid2.svg)](https://github.com/oauth-xx/rack-openid2) [![CI Supported Build][🚎s-wfi]][🚎s-wf] [![CI Unsupported Build][🚎us-wfi]][🚎us-wf] [![CI Style Build][🚎st-wfi]][🚎st-wf] @@ -19,10 +21,46 @@ [🚎hd-wf]: https://github.com/oauth-xx/rack-openid2/actions/workflows/heads.yml [🚎hd-wfi]: https://github.com/oauth-xx/rack-openid2/actions/workflows/heads.yml/badge.svg +----- + +
+ +[![Liberapay Patrons][⛳liberapay-img]][⛳liberapay] +[![Sponsor Me on Github][🖇sponsor-img]][🖇sponsor] +[![Polar Shield][🖇polar-img]][🖇polar] +[![Donate to my FLOSS or refugee efforts at ko-fi.com][🖇kofi-img]][🖇kofi] +[![Donate to my FLOSS or refugee efforts using Patreon][🖇patreon-img]][🖇patreon] + +[⛳liberapay-img]: https://img.shields.io/liberapay/patrons/pboling.svg?logo=liberapay +[⛳liberapay]: https://liberapay.com/pboling/donate +[🖇sponsor-img]: https://img.shields.io/badge/Sponsor_Me!-pboling.svg?style=social&logo=github +[🖇sponsor]: https://github.com/sponsors/pboling +[🖇polar-img]: https://polar.sh/embed/seeks-funding-shield.svg?org=pboling +[🖇polar]: https://polar.sh/pboling +[🖇kofi-img]: https://img.shields.io/badge/buy%20me%20coffee-donate-yellow.svg +[🖇kofi]: https://ko-fi.com/O5O86SNP4 +[🖇patreon-img]: https://img.shields.io/badge/patreon-donate-yellow.svg +[🖇patreon]: https://patreon.com/galtzo + + + + + +
Provides a more HTTPish API around the ruby-openid library. +## Installation + +Install the gem and add to the application's Gemfile by executing: + + $ bundle add rack-openid2 + +If bundler is not being used to manage dependencies, install the gem by executing: + + $ gem install rack-openid2 + ## Usage You trigger an OpenID request similar to HTTP authentication. From your app, return a "401 Unauthorized" and a "WWW-Authenticate" header with the identifier you would like to validate. @@ -94,6 +132,36 @@ __END__ ``` +## General Info + +| Primary Namespace | `Rack::OpenID` | +|-------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| gem name | [ruby-openid2](https://rubygems.org/gems/rack-openid2) | +| code triage | [![Open Source Helpers](https://www.codetriage.com/oauth-xx/rack-openid2/badges/users.svg)](https://www.codetriage.com/oauth-xx/rack-openid2) | +| documentation | [on Github.com][homepage], [on Rdoc.info][documentation] | +| expert support | [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/peterboling?utm_source=github&utm_medium=button&utm_term=peterboling&utm_campaign=github) | +| `...` 💖 | [![Liberapay Patrons][⛳liberapay-img]][⛳liberapay] [![Sponsor Me][🖇sponsor-img]][🖇sponsor] [![Follow Me on LinkedIn][🖇linkedin-img]][🖇linkedin] [![Find Me on WellFound:][✌️wellfound-img]][✌️wellfound] [![Find Me on CrunchBase][💲crunchbase-img]][💲crunchbase] [![My LinkTree][🌳linktree-img]][🌳linktree] [![Follow Me on Ruby.Social][🐘ruby-mast-img]][🐘ruby-mast] [![Tweet @ Peter][🐦tweet-img]][🐦tweet] [💻][coderme] [🌏][aboutme] | + + +[🐦tweet-img]: https://img.shields.io/twitter/follow/galtzo.svg?style=social&label=Follow%20%40galtzo +[🐦tweet]: http://twitter.com/galtzo +[🚎blog]: http://www.railsbling.com/tags/rack-openid2/ +[🚎blog-img]: https://img.shields.io/badge/blog-railsbling-brightgreen.svg?style=flat +[🖇linkedin]: http://www.linkedin.com/in/peterboling +[🖇linkedin-img]: https://img.shields.io/badge/PeterBoling-blue?style=plastic&logo=linkedin +[✌️wellfound]: https://angel.co/u/peter-boling +[✌️wellfound-img]: https://img.shields.io/badge/peter--boling-orange?style=plastic&logo=wellfound +[💲crunchbase]: https://www.crunchbase.com/person/peter-boling +[💲crunchbase-img]: https://img.shields.io/badge/peter--boling-purple?style=plastic&logo=crunchbase +[🐘ruby-mast]: https://ruby.social/@galtzo +[🐘ruby-mast-img]: https://img.shields.io/mastodon/follow/109447111526622197?domain=https%3A%2F%2Fruby.social&style=plastic&logo=mastodon&label=Ruby%20%40galtzo +[🌳linktree]: https://linktr.ee/galtzo +[🌳linktree-img]: https://img.shields.io/badge/galtzo-purple?style=plastic&logo=linktree + + +[aboutme]: https://about.me/peter.boling +[coderme]: https://coderwall.com/Peter%20Boling + ## TODO - 1 failing test (skipped) diff --git a/Rakefile b/Rakefile index fc0e04d..1c2a162 100644 --- a/Rakefile +++ b/Rakefile @@ -2,11 +2,10 @@ require "bundler/gem_tasks" require "rake/testtask" +require "require_bench" if ENV.fetch("REQUIRE_BENCH", "false").casecmp?("true") + desc "Run tests" Rake::TestTask.new("test") do |t| - t.libs << "lib" - t.libs << "test" - t.test_files = FileList["test/**/test_*.rb"] t.verbose = false end @@ -40,4 +39,4 @@ rescue LoadError end end -task default: %i[test rubocop_gradual yard yard:junk] +task default: %i[test rubocop_gradual:autocorrect yard yard:junk] diff --git a/lib/rack/openid/version.rb b/lib/rack/openid/version.rb index c8225fa..f6d2c07 100644 --- a/lib/rack/openid/version.rb +++ b/lib/rack/openid/version.rb @@ -1,7 +1,7 @@ module Rack class OpenID module Version - VERSION = "2.0.1" + VERSION = "2.0.2" end end end diff --git a/rack-openid2.gemspec b/rack-openid2.gemspec index 6522efc..c5749ee 100644 --- a/rack-openid2.gemspec +++ b/rack-openid2.gemspec @@ -42,18 +42,26 @@ Gem::Specification.new do |spec| spec.metadata["rubygems_mfa_required"] = "true" spec.add_dependency("rack", ">= 2.2") - spec.add_dependency("ruby-openid2", "~> 3.0", ">= 3.0.1") + spec.add_dependency("ruby-openid2", "~> 3.1", ">= 3.1.0") spec.add_dependency("version_gem", "~> 1.1", ">= 1.1.4") # Testing - spec.add_development_dependency("minitest", ">= 5") + spec.add_development_dependency("minitest", ">= 5", "< 6") # Use assert_nil if expecting nil + spec.add_development_dependency("minitest-focus", "~> 1.4") spec.add_development_dependency("minitest-rg", ">= 5") spec.add_development_dependency("rack-session", ">= 2") spec.add_development_dependency("rake", ">= 13") + spec.add_development_dependency("rots", "~> 1.0") + + # Test Logging + spec.add_development_dependency("logger", "~> 1.6", ">= 1.6.1") # Coverage spec.add_development_dependency("kettle-soup-cover", "~> 1.0", ">= 1.0.2") + # Debugging + spec.add_development_dependency("require_bench", "~> 1.0", ">= 1.0.4") + # Linting spec.add_development_dependency("rubocop-lts", "~> 18.2", ">= 18.2.1") spec.add_development_dependency("rubocop-minitest", "~> 0.36") diff --git a/test/test_helper.rb b/test/support/config.rb similarity index 56% rename from test/test_helper.rb rename to test/support/config.rb index 7807194..a0e5282 100644 --- a/test/test_helper.rb +++ b/test/support/config.rb @@ -1,14 +1,15 @@ # External dependencies +require "require_bench" if ENV.fetch("REQUIRE_BENCH", "false").casecmp?("true") require "byebug" if ENV.fetch("DEBUG", "false").casecmp?("true") require "net/http" require "rack" require "rack/session" -# testing libraries +# External testing libraries require "minitest/rg" # Test support -require "support/logging" +require_relative "logging" ## Last thing before loading this gem is to setup code coverage begin @@ -22,9 +23,18 @@ # Testing libraries that need to load after simplecov require "minitest/autorun" +require "minitest/focus" -# Internal dependencies & mixins -require "rack/openid" -require "rack/openid/simple_auth" +# rots depends on this library, but the tests here also depend on it, +# so it needs to load after simplecov, in order to get accurate coverage of this gem, +# since this gem is loaded by rots. +require "rots" +require "rots/mocks" +require "rots/test" OpenID::Util.logger = TestLogging::LOGGER +OpenID.fetcher = Rots::Mocks::Fetcher.new(Rots::Mocks::RotsServer.new) + +# This library +require "rack-openid2" +require "rack/openid/simple_auth" diff --git a/test/test_integration.rb b/test/test_integration.rb index b36b71f..128a2a6 100644 --- a/test/test_integration.rb +++ b/test/test_integration.rb @@ -1,441 +1,259 @@ -# External libraries -require "rots" +require_relative "support/config" -require_relative "test_helper" +describe "openid integration" do + include Rots::Test::RackTestHelpers -describe "integration" do - class MockFetcher - def initialize(app) - @app = app - end - - def fetch(url, body = nil, headers = nil, limit = nil) - opts = (headers || {}).dup - opts[:input] = body - opts[:method] = "POST" if body - env = Rack::MockRequest.env_for(url, opts) - - status, headers, body = @app.call(env) - - buf = [] - buf << "HTTP/1.1 #{status} #{Rack::Utils::HTTP_STATUS_CODES[status]}" - headers.each { |header, value| buf << "#{header}: #{value}" } - buf << "" - body.each { |part| buf << part } + it "with_get" do + app = app({}) + mock_openid_request(app, "/", method: "GET") + follow_openid_redirect!(app) - io = Net::BufferedIO.new(StringIO.new(buf.join("\n"))) - res = Net::HTTPResponse.read_new(io) - res.reading_body(io, true) {} - OpenID::HTTPResponse._from_net_response(res, url) - end + assert_equal 200, @response.status + assert_equal "GET", @response.headers["X-Method"] + assert_equal "/", @response.headers["X-Path"] + assert_equal "success", @response.body end - ROTS_SERVER_URL = "http://localhost:9292" - - RotsApp = Rack::Builder.new do - config = { - "identity" => "john.doe", - "sreg" => { - "nickname" => "jdoe", - "fullname" => "John Doe", - "email" => "jhon@doe.com", - "dob" => Date.parse("1985-09-21"), - "gender" => "M", - }, - } - - map("/%s" % config["identity"]) do - run(Rots::IdentityPageApp.new(config, {})) - end + it "with_deprecated_identity" do + app = app({}) + mock_openid_request(app, "/", method: "GET", identity: "#{Rots::Mocks::RotsServer::SERVER_URL}/john.doe?openid.success=true") + follow_openid_redirect!(app) - map("/server") do - run(Rots::ServerApp.new(config, storage: Dir.tmpdir)) - end + assert_equal 200, @response.status + assert_equal "GET", @response.headers["X-Method"] + assert_equal "/", @response.headers["X-Path"] + assert_equal "success", @response.body end - OpenID.fetcher = MockFetcher.new(RotsApp) + it "with_post_method" do + app = app({}) + mock_openid_request(app, "/", method: "POST") + follow_openid_redirect!(app) - module RackTestHelpers - private - - def process(*args) - env = Rack::MockRequest.env_for(*args) - @response = Rack::MockResponse.new(*@app.call(env)) - end - - def follow_redirect! - assert(@response) - assert_equal(303, @response.status) - - env = Rack::MockRequest.env_for(@response.headers["Location"]) - _status, headers, _body = RotsApp.call(env) - - uri = URI(headers["Location"]) - process("#{uri.path}?#{uri.query}") - end + assert_equal 200, @response.status + assert_equal "POST", @response.headers["X-Method"] + assert_equal "/", @response.headers["X-Path"] + assert_equal "success", @response.body end - describe "headers" do - it "builds header" do - assert_equal 'OpenID identity="http://example.com/"', - Rack::OpenID.build_header(identity: "http://example.com/") - assert_equal 'OpenID identity="http://example.com/?foo=bar"', - Rack::OpenID.build_header(identity: "http://example.com/?foo=bar") + it "with_custom_return_to" do + app = app(return_to: "http://example.org/complete") + mock_openid_request(app, "/", method: "GET") + follow_openid_redirect!(app) - header = Rack::OpenID.build_header(identity: "http://example.com/", return_to: "http://example.org/") - - assert_match(/OpenID /, header) - assert_match(/identity="http:\/\/example\.com\/"/, header) - assert_match(/return_to="http:\/\/example\.org\/"/, header) - - header = Rack::OpenID.build_header(identity: "http://example.com/", required: ["nickname", "email"]) - - assert_match(/OpenID /, header) - assert_match(/identity="http:\/\/example\.com\/"/, header) - assert_match(/required="nickname,email"/, header) - end - - it "parses header" do - assert_equal( - {"identity" => "http://example.com/"}, - Rack::OpenID.parse_header('OpenID identity="http://example.com/"'), - ) - assert_equal( - {"identity" => "http://example.com/?foo=bar"}, - Rack::OpenID.parse_header('OpenID identity="http://example.com/?foo=bar"'), - ) - assert_equal( - {"identity" => "http://example.com/", "return_to" => "http://example.org/"}, - Rack::OpenID.parse_header('OpenID identity="http://example.com/", return_to="http://example.org/"'), - ) - assert_equal( - {"identity" => "http://example.com/", "required" => ["nickname", "email"]}, - Rack::OpenID.parse_header('OpenID identity="http://example.com/", required="nickname,email"'), - ) - - # ensure we don't break standard HTTP basic auth - assert_empty( - Rack::OpenID.parse_header('Realm="Example"'), - ) - end + assert_equal 200, @response.status + assert_equal "GET", @response.headers["X-Method"] + assert_equal "/complete", @response.headers["X-Path"] + assert_equal "success", @response.body end - describe "openid" do - include RackTestHelpers - - it "with_get" do - @app = app({}) - process("/", method: "GET") - follow_redirect! - - assert_equal 200, @response.status - assert_equal "GET", @response.headers["X-Method"] - assert_equal "/", @response.headers["X-Path"] - assert_equal "success", @response.body - end - - it "with_deprecated_identity" do - @app = app({}) - process("/", method: "GET", identity: "#{ROTS_SERVER_URL}/john.doe?openid.success=true") - follow_redirect! - - assert_equal 200, @response.status - assert_equal "GET", @response.headers["X-Method"] - assert_equal "/", @response.headers["X-Path"] - assert_equal "success", @response.body - end + it "with_get_nested_params_custom_return_to" do + url = "http://example.org/complete?user[remember_me]=true" + app = app(return_to: url) + mock_openid_request(app, "/", method: "GET") + follow_openid_redirect!(app) + + assert_equal 200, @response.status + assert_equal "GET", @response.headers["X-Method"] + assert_equal "/complete", @response.headers["X-Path"] + assert_equal "success", @response.body + assert_match(/remember_me/, @response.headers["X-Query-String"]) + end - it "with_post_method" do - @app = app({}) - process("/", method: "POST") - follow_redirect! + it "with_post_nested_params_custom_return_to" do + url = "http://example.org/complete?user[remember_me]=true" + app = app(return_to: url) + mock_openid_request(app, "/", method: "POST") - assert_equal 200, @response.status - assert_equal "POST", @response.headers["X-Method"] - assert_equal "/", @response.headers["X-Path"] - assert_equal "success", @response.body - end + assert_equal 303, @response.status + env = Rack::MockRequest.env_for(@response.headers["Location"]) + _status, headers, _body = Rots::Mocks::RotsServer.new.call(env) - it "with_custom_return_to" do - @app = app(return_to: "http://example.org/complete") - process("/", method: "GET") - follow_redirect! + _uri, input = headers["Location"].split("?", 2) + mock_openid_request(app, "http://example.org/complete?user[remember_me]=true", method: "POST", input: input) - assert_equal 200, @response.status - assert_equal "GET", @response.headers["X-Method"] - assert_equal "/complete", @response.headers["X-Path"] - assert_equal "success", @response.body - end - - it "with_get_nested_params_custom_return_to" do - url = "http://example.org/complete?user[remember_me]=true" - @app = app(return_to: url) - process("/", method: "GET") - follow_redirect! + assert_equal 200, @response.status + assert_equal "POST", @response.headers["X-Method"] + assert_equal "/complete", @response.headers["X-Path"] + assert_equal "success", @response.body + assert_match(/remember_me/, @response.headers["X-Query-String"]) + end - assert_equal 200, @response.status - assert_equal "GET", @response.headers["X-Method"] - assert_equal "/complete", @response.headers["X-Path"] - assert_equal "success", @response.body - assert_match(/remember_me/, @response.headers["X-Query-String"]) - end + it "with_post_method_custom_return_to" do + app = app(return_to: "http://example.org/complete") + mock_openid_request(app, "/", method: "POST") + follow_openid_redirect!(app) - it "with_post_nested_params_custom_return_to" do - url = "http://example.org/complete?user[remember_me]=true" - @app = app(return_to: url) - process("/", method: "POST") + assert_equal 200, @response.status + assert_equal "GET", @response.headers["X-Method"] + assert_equal "/complete", @response.headers["X-Path"] + assert_equal "success", @response.body + end - assert_equal 303, @response.status - env = Rack::MockRequest.env_for(@response.headers["Location"]) - _status, headers, _body = RotsApp.call(env) + it "with_custom_return_method" do + app = app(method: "put") + mock_openid_request(app, "/", method: "GET") + follow_openid_redirect!(app) - _uri, input = headers["Location"].split("?", 2) - process("http://example.org/complete?user[remember_me]=true", method: "POST", input: input) + assert_equal 200, @response.status + assert_equal "PUT", @response.headers["X-Method"] + assert_equal "/", @response.headers["X-Path"] + assert_equal "success", @response.body + end - assert_equal 200, @response.status - assert_equal "POST", @response.headers["X-Method"] - assert_equal "/complete", @response.headers["X-Path"] - assert_equal "success", @response.body - assert_match(/remember_me/, @response.headers["X-Query-String"]) - end + it "with_simple_registration_fields" do + app = app(required: ["nickname", "email"], optional: "fullname") + mock_openid_request(app, "/", method: "GET") + follow_openid_redirect!(app) - it "with_post_method_custom_return_to" do - @app = app(return_to: "http://example.org/complete") - process("/", method: "POST") - follow_redirect! + assert_equal 200, @response.status + assert_equal "GET", @response.headers["X-Method"] + assert_equal "/", @response.headers["X-Path"] + assert_equal "success", @response.body + end - assert_equal 200, @response.status - assert_equal "GET", @response.headers["X-Method"] - assert_equal "/complete", @response.headers["X-Path"] - assert_equal "success", @response.body - end + it "with_attribute_exchange" do + app = app( + required: ["http://axschema.org/namePerson/friendly", "http://axschema.org/contact/email"], + optional: "http://axschema.org/namePerson", + ) + mock_openid_request(app, "/", method: "GET") + follow_openid_redirect!(app) + + assert_equal 200, @response.status + assert_equal "GET", @response.headers["X-Method"] + assert_equal "/", @response.headers["X-Path"] + assert_equal "success", @response.body + end - it "with_custom_return_method" do - @app = app(method: "put") - process("/", method: "GET") - follow_redirect! + it "with_oauth" do + app = app( + "oauth[consumer]": "www.example.com", + "oauth[scope]": ["http://docs.google.com/feeds/", "http://spreadsheets.google.com/feeds/"], + ) + mock_openid_request(app, "/", method: "GET") - assert_equal 200, @response.status - assert_equal "PUT", @response.headers["X-Method"] - assert_equal "/", @response.headers["X-Path"] - assert_equal "success", @response.body - end + location = @response.headers["Location"] - it "with_simple_registration_fields" do - @app = app(required: ["nickname", "email"], optional: "fullname") - process("/", method: "GET") - follow_redirect! + assert_match(/openid.oauth.consumer/, location) + assert_match(/openid.oauth.scope/, location) - assert_equal 200, @response.status - assert_equal "GET", @response.headers["X-Method"] - assert_equal "/", @response.headers["X-Path"] - assert_equal "success", @response.body - end + follow_openid_redirect!(app) - it "with_attribute_exchange" do - @app = app( - required: ["http://axschema.org/namePerson/friendly", "http://axschema.org/contact/email"], - optional: "http://axschema.org/namePerson", - ) - process("/", method: "GET") - follow_redirect! - - assert_equal 200, @response.status - assert_equal "GET", @response.headers["X-Method"] - assert_equal "/", @response.headers["X-Path"] - assert_equal "success", @response.body - end + assert_equal 200, @response.status + assert_equal "GET", @response.headers["X-Method"] + assert_equal "/", @response.headers["X-Path"] + assert_equal "success", @response.body + end - it "with_oauth" do - @app = app( - "oauth[consumer]": "www.example.com", - "oauth[scope]": ["http://docs.google.com/feeds/", "http://spreadsheets.google.com/feeds/"], - ) - process("/", method: "GET") + it "with_pape" do + app = app( + "pape[preferred_auth_policies]": ["test_policy1", "test_policy2"], + "pape[max_auth_age]": 600, + ) + mock_openid_request(app, "/", method: "GET") - location = @response.headers["Location"] + location = @response.headers["Location"] - assert_match(/openid.oauth.consumer/, location) - assert_match(/openid.oauth.scope/, location) + assert_match(/pape\.preferred_auth_policies=test_policy1\+test_policy2/, location) + assert_match(/pape\.max_auth_age=600/, location) - follow_redirect! + follow_openid_redirect!(app) - assert_equal 200, @response.status - assert_equal "GET", @response.headers["X-Method"] - assert_equal "/", @response.headers["X-Path"] - assert_equal "success", @response.body - end + assert_equal 200, @response.status + assert_equal "GET", @response.headers["X-Method"] + assert_equal "/", @response.headers["X-Path"] + assert_equal "success", @response.body + end - it "with_pape" do - @app = app( - "pape[preferred_auth_policies]": ["test_policy1", "test_policy2"], - "pape[max_auth_age]": 600, - ) - process("/", method: "GET") + it "with_immediate_mode_setup_needed" do + skip("because failing, and not enough time to fix all the things") do + app = app(identifier: "#{Rots::Mocks::RotsServer::SERVER_URL}/john.doe?openid.success=false", immediate: true) + mock_openid_request(app, "/", method: "GET") location = @response.headers["Location"] - assert_match(/pape\.preferred_auth_policies=test_policy1\+test_policy2/, location) - assert_match(/pape\.max_auth_age=600/, location) + assert_match(/openid.mode=checkid_immediate/, location) - follow_redirect! + follow_openid_redirect!(app) - assert_equal 200, @response.status + assert_equal 307, @response.status assert_equal "GET", @response.headers["X-Method"] assert_equal "/", @response.headers["X-Path"] - assert_equal "success", @response.body + assert_equal Rots::Mocks::RotsServer::SERVER_URL, @response.headers["Location"] + assert_equal "setup_needed", @response.body end + end - it "with_immediate_mode_setup_needed" do - skip("because failing, and not enough time to fix all the things") do - @app = app(identifier: "#{ROTS_SERVER_URL}/john.doe?openid.success=false", immediate: true) - process("/", method: "GET") - - location = @response.headers["Location"] - - assert_match(/openid.mode=checkid_immediate/, location) - - follow_redirect! - - assert_equal 307, @response.status - assert_equal "GET", @response.headers["X-Method"] - assert_equal "/", @response.headers["X-Path"] - assert_equal ROTS_SERVER_URL, @response.headers["Location"] - assert_equal "setup_needed", @response.body - end - end - - it "with_realm_wildcard" do - @app = app( - realm_domain: "*.example.org", - ) - process("/", method: "GET") - - location = @response.headers["Location"] - - assert_match(/openid.realm=http%3A%2F%2F%2A.example.org/, location) - - follow_redirect! - - assert_equal 200, @response.status - end - - it "with_inferred_realm" do - @app = app({}) - process("/", method: "GET") - - location = @response.headers["Location"] - - assert_match(/openid.realm=http%3A%2F%2Fexample.org/, location) - - follow_redirect! - - assert_equal 200, @response.status - end + it "with_realm_wildcard" do + app = app( + realm_domain: "*.example.org", + ) + mock_openid_request(app, "/", method: "GET") - it "with_missing_id" do - @app = app(identifier: "#{ROTS_SERVER_URL}/john.doe") - process("/", method: "GET") - follow_redirect! + location = @response.headers["Location"] - assert_equal 400, @response.status - assert_equal "GET", @response.headers["X-Method"] - assert_equal "/", @response.headers["X-Path"] - assert_equal "cancel", @response.body - end + assert_match(/openid.realm=http%3A%2F%2F%2A.example.org/, location) - it "with_timeout" do - @app = app(identifier: ROTS_SERVER_URL) - process("/", method: "GET") + follow_openid_redirect!(app) - assert_equal 400, @response.status - assert_equal "GET", @response.headers["X-Method"] - assert_equal "/", @response.headers["X-Path"] - assert_equal "missing", @response.body - end + assert_equal 200, @response.status + end - it "sanitize_query_string" do - @app = app({}) - process("/", method: "GET") - follow_redirect! + it "with_inferred_realm" do + app = app({}) + mock_openid_request(app, "/", method: "GET") - assert_equal 200, @response.status - assert_equal "/", @response.headers["X-Path"] - assert_equal "", @response.headers["X-Query-String"] - end + location = @response.headers["Location"] - it "passthrough_standard_http_basic_auth" do - @app = app({}) - process("/", :method => "GET", "MOCK_HTTP_BASIC_AUTH" => "1") + assert_match(/openid.realm=http%3A%2F%2Fexample.org/, location) - assert_equal 401, @response.status - end + follow_openid_redirect!(app) - private - - def app(options = {}) - options[:identifier] ||= "#{ROTS_SERVER_URL}/john.doe?openid.success=true" - - rack_app = lambda { |env| - if (resp = env[Rack::OpenID::RESPONSE]) - headers = { - "X-Path" => env["PATH_INFO"], - "X-Method" => env["REQUEST_METHOD"], - "X-Query-String" => env["QUERY_STRING"], - } - if resp.status == :success - [200, headers, [resp.status.to_s]] - elsif resp.status == :setup_needed - headers["Location"] = ROTS_SERVER_URL # TODO update Rots to properly send user_setup_url. This should come from resp. - [307, headers, [resp.status.to_s]] - else - [400, headers, [resp.status.to_s]] - end - elsif env["MOCK_HTTP_BASIC_AUTH"] - [401, {Rack::OpenID::AUTHENTICATE_HEADER => 'Realm="Example"'}, []] - else - [401, {Rack::OpenID::AUTHENTICATE_HEADER => Rack::OpenID.build_header(options)}, []] - end - } - Rack::Session::Pool.new(Rack::OpenID.new(rack_app)) - end + assert_equal 200, @response.status end - describe "simple auth" do - include RackTestHelpers - - it "can login" do - @app = simple_app("#{ROTS_SERVER_URL}/john.doe?openid.success=true") + it "with_missing_id" do + app = app(identifier: "#{Rots::Mocks::RotsServer::SERVER_URL}/john.doe") + mock_openid_request(app, "/", method: "GET") + follow_openid_redirect!(app) - process "/dashboard" - follow_redirect! + assert_equal 400, @response.status + assert_equal "GET", @response.headers["X-Method"] + assert_equal "/", @response.headers["X-Path"] + assert_equal "cancel", @response.body + end - assert_equal 303, @response.status - assert_equal "http://example.org/dashboard", @response.headers["Location"] + it "with_timeout" do + app = app(identifier: Rots::Mocks::RotsServer::SERVER_URL) + mock_openid_request(app, "/", method: "GET") - cookie = @response.headers["Set-Cookie"].split(";").first - process "/dashboard", "HTTP_COOKIE" => cookie + assert_equal 400, @response.status + assert_equal "GET", @response.headers["X-Method"] + assert_equal "/", @response.headers["X-Path"] + assert_equal "missing", @response.body + end - assert_equal 200, @response.status - assert_equal "Hello", @response.body - end + it "sanitize_query_string" do + app = app({}) + mock_openid_request(app, "/", method: "GET") + follow_openid_redirect!(app) - it "fails login" do - @app = simple_app("#{ROTS_SERVER_URL}/john.doe") - @app = simple_app("#{ROTS_SERVER_URL}/john.doe") + assert_equal 200, @response.status + assert_equal "/", @response.headers["X-Path"] + assert_equal "", @response.headers["X-Query-String"] + end - process "/dashboard" - follow_redirect! + it "passthrough_standard_http_basic_auth" do + app = app({}) + mock_openid_request(app, "/", :method => "GET", "MOCK_HTTP_BASIC_AUTH" => "1") - assert_match ROTS_SERVER_URL, @response.headers["Location"] - end + assert_equal 401, @response.status + end - private + private - def simple_app(identifier) - rack_app = lambda { |env| [200, {"Content-Type" => "text/html"}, ["Hello"]] } - rack_app = Rack::OpenID::SimpleAuth.new(rack_app, identifier) - Rack::Session::Pool.new(rack_app) - end + def app(options = {}) + Rots::Mocks::ClientApp.new(**options) end end diff --git a/test/test_openid_headers.rb b/test/test_openid_headers.rb new file mode 100644 index 0000000..47d0e66 --- /dev/null +++ b/test/test_openid_headers.rb @@ -0,0 +1,46 @@ +require_relative "support/config" + +describe "openid headers" do + it "builds header" do + assert_equal 'OpenID identity="http://example.com/"', + Rack::OpenID.build_header(identity: "http://example.com/") + assert_equal 'OpenID identity="http://example.com/?foo=bar"', + Rack::OpenID.build_header(identity: "http://example.com/?foo=bar") + + header = Rack::OpenID.build_header(identity: "http://example.com/", return_to: "http://example.org/") + + assert_match(/OpenID /, header) + assert_match(/identity="http:\/\/example\.com\/"/, header) + assert_match(/return_to="http:\/\/example\.org\/"/, header) + + header = Rack::OpenID.build_header(identity: "http://example.com/", required: ["nickname", "email"]) + + assert_match(/OpenID /, header) + assert_match(/identity="http:\/\/example\.com\/"/, header) + assert_match(/required="nickname,email"/, header) + end + + it "parses header" do + assert_equal( + {"identity" => "http://example.com/"}, + Rack::OpenID.parse_header('OpenID identity="http://example.com/"'), + ) + assert_equal( + {"identity" => "http://example.com/?foo=bar"}, + Rack::OpenID.parse_header('OpenID identity="http://example.com/?foo=bar"'), + ) + assert_equal( + {"identity" => "http://example.com/", "return_to" => "http://example.org/"}, + Rack::OpenID.parse_header('OpenID identity="http://example.com/", return_to="http://example.org/"'), + ) + assert_equal( + {"identity" => "http://example.com/", "required" => ["nickname", "email"]}, + Rack::OpenID.parse_header('OpenID identity="http://example.com/", required="nickname,email"'), + ) + + # ensure we don't break standard HTTP basic auth + assert_empty( + Rack::OpenID.parse_header('Realm="Example"'), + ) + end +end diff --git a/test/test_rack_openid.rb b/test/test_rack_openid.rb index 80d5679..4c87d28 100644 --- a/test/test_rack_openid.rb +++ b/test/test_rack_openid.rb @@ -1,4 +1,4 @@ -require_relative "test_helper" +require_relative "support/config" describe Rack::OpenID do describe ".sanitize_params!" do diff --git a/test/test_simple_auth.rb b/test/test_simple_auth.rb new file mode 100644 index 0000000..cd316c2 --- /dev/null +++ b/test/test_simple_auth.rb @@ -0,0 +1,37 @@ +require_relative "support/config" + +describe "simple auth" do + include Rots::Test::RackTestHelpers + + it "can login" do + app = simple_app("#{Rots::Mocks::RotsServer::SERVER_URL}/john.doe?openid.success=true") + mock_openid_request app, "/dashboard" + follow_openid_redirect!(app) + + assert_equal 303, @response.status + assert_equal "http://example.org/dashboard", @response.headers["Location"] + + cookie = @response.headers["Set-Cookie"].split(";").first + mock_openid_request app, "/dashboard", "HTTP_COOKIE" => cookie + + assert_equal 200, @response.status + assert_equal "Hello", @response.body + end + + it "fails login" do + app = simple_app("#{Rots::Mocks::RotsServer::SERVER_URL}/john.doe") + + mock_openid_request app, "/dashboard" + follow_openid_redirect!(app) + + assert_match Rots::Mocks::RotsServer::SERVER_URL, @response.headers["Location"] + end + + private + + def simple_app(identifier) + rack_app = lambda { |env| [200, {"Content-Type" => "text/html"}, ["Hello"]] } + rack_app = Rack::OpenID::SimpleAuth.new(rack_app, identifier) + Rack::Session::Pool.new(rack_app) + end +end From f65b61afa39b0a1db0d12842fffa857e1c9f1914 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 25 Sep 2024 13:28:05 -0600 Subject: [PATCH 46/89] =?UTF-8?q?=F0=9F=94=92=EF=B8=8F=20New=20year,=20new?= =?UTF-8?q?=20cert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- certs/pboling.pem | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/certs/pboling.pem b/certs/pboling.pem index 3344386..b33ee80 100644 --- a/certs/pboling.pem +++ b/certs/pboling.pem @@ -1,27 +1,27 @@ -----BEGIN CERTIFICATE----- MIIEgDCCAuigAwIBAgIBATANBgkqhkiG9w0BAQsFADBDMRUwEwYDVQQDDAxwZXRl ci5ib2xpbmcxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkW -A2NvbTAeFw0yMzA5MjAxNzMwMjhaFw0yNDA5MTkxNzMwMjhaMEMxFTATBgNVBAMM +A2NvbTAeFw0yNDA5MjAwODU4NDJaFw0yNTA5MjAwODU4NDJaMEMxFTATBgNVBAMM DHBldGVyLmJvbGluZzEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPy -LGQBGRYDY29tMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA+a9UvHo3 -84k96WgU5Kk5HB+cLZs/modjorsTfqY67MJF5nNvAoqcKTUBW4uG+Zpfnm3jaDO5 -GxhJEIZWfndYzycHT2KMVQ1uTP82ba8ZaKrPlPIafkbui3mdds47qsmqHiblKERg -U532lkwfqHDlJwE7OBZQ59EwWWLynlT/yAUHpOBbqIuHKUxdpmBI+sIjrZcD1e05 -WmjkO6fwIdC5oM757aoPxIgXD587VOViH11Vkm2doskj4T8yONtwVHlcrrhJ9Bzd -/zdp6vEn7GZQrABvpOlqwWxQ72ZnFhJe/RJZf6CXOPOh69Ai0QKYl2a1sYuCJKS3 -nsBnxXJINEEznjR7rZjNUmYD+CZqfjzgPqedRxTlASe7iA4w7xZOqMDzcuhNwcUQ -tMEH6BTktxKP3jXZPXRfHCf6s+HRVb6vezAonTBVyydf5Xp5VwWkd6cwm+2BzHl5 -7kc/3lLxKMcsyEUprAsk8LdHohwZdC267l+RS++AP6Cz6x+nB3oGob19AgMBAAGj -fzB9MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBQCSSas60GqqMjt -xR7LoY1gucEvtzAhBgNVHREEGjAYgRZwZXRlci5ib2xpbmdAZ21haWwuY29tMCEG +LGQBGRYDY29tMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAjrxsKObI +rFQjBpzvVfqnT6JlF8/pkpgEEjFh7ex3zIerfuHzZvSrx+sRDGxQ8koWWG0Wjx8s +wkBZ5dIqvl0g3sWP5asa28u/09opxkQTC1Ao77iYxcBcwoCe/Dpf1m4Q/m6oH0kL +2AZVNJQL3UkqAcLS0tsj/s/jAKnVlsaZZE5gQiIIi8HtkvSsajtx+Cq2AxDvcWvV +/CliD+pmzYkTjvjwGm8yeyFGGGgrisJMryiZdZlkTwrQSjCzudIKbLeuG8Se4JTD +TAcT+rPubr27v1jwmtIjtiot3rf4nof7LHLb122a/0VR7cC7xPLnXw0Cq1BShvoq +/GKRdSwMNinTOGkFTK1gKnjN+3iD4zyXU3XO3CXoTr+Ju8fXPN1x4tpOMgbv8dme +WbcQMOH9ZjmA5w0bSVRL1c3NhRRpUzrKTNXBEvqOyWjUnintxWKj+cRXx+z+dUgI +dL3kj68fcsiTgl75In3C485pnCMmq1eLuVoiy3jkLNOn2lHeLt9ZK63LAgMBAAGj +fzB9MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBRhfc+2UaVYd74p +yJ1JclGiUYN8+jAhBgNVHREEGjAYgRZwZXRlci5ib2xpbmdAZ21haWwuY29tMCEG A1UdEgQaMBiBFnBldGVyLmJvbGluZ0BnbWFpbC5jb20wDQYJKoZIhvcNAQELBQAD -ggGBAMl9ifcw5p+PdvB7dCPoNKoVdp/2LbC9ztETHuYL2gUMJB6UoS3o9c/piSuR -V3ZMQaijmNu6ms1bWAtJ66LjmYrVflJtf9yp31Kierr9LpisMSUx2qbMOHGa8d2Z -vCUWPF8E9Cg0mP3GAyZ6qql8jDh/anUKeksPXqJvNxNPDu2DVYsa/IWdl96whzS4 -Bl7SwB1E7agps40UcshCSKaVDOU0M+XN6SrnJMElnBic+KSAkBkVFbzS0BE4ODZM -BgE6nYzQ05qhuvbE+oGdACTlemNtDDWCh0uw+7x0q2PocGIDU5zsPn/WNTkCXPmB -CHGvqDNWq4M7ncTKAaS2XExgyb7uPdq9fKiOW8nmH+zCiGzJXzBWwZlKf7L4Ht9E -a3f0e5C+zvee9Z5Ng9ciyfav9/fcXgYt5MjoBv27THr5XfBhgOCIHSYW2tqJmWKi -KuxrfYrN+9HvMdm+nZ6TypmKftHY3Gj+/uu+g8Icm/zrvTWAEE0mcJOkfrIoNPJb -pF8dMA== +ggGBAA4fLU2+mQ++jBhVM2IeyvQdw1nm+0thkH4Ldv8ZOBm5ZxCPGIMoYliDDzg4 +4JDFxZR1wR4sdrz/K5tWtEkN23SKzopwbNb1NIQRSLQ7nOoc+4bkuz9xwKinmIvF +D+5qsl2S27WLKFreMDtGoh0CREIMBUxU4rGTh0gtzmweGR+fnOShg4Jo0kxrjU5h +uYk/uVE+bn/jOEGs43GvKXZLyshpBrZjQ+ArbvxDht5t35zbSxerbUxUPZUbXUCW +tTyh38a9UYjAAHvnh6Y4Fi9wd4/pGNsektrzB3z/zlVj4YF2TMLX9XfNJWEGRGpO +sSkLYdtEX1WQAmuZtActVW2cL3HdQaRbiv7VbfpA0eSk0ZdZHvBCl516ZZu10uX6 +82W1mg6fuezdpeBOiXwrEbZSt/oGiF4V511F6nd55p0okwHc/6nS10F/3aKJ4gwC +I5o+DRfXQHqKucx1ldFHvI2rE/kSCWqGTHN2eyu1sqCPeOoIMxrltJhaejKPkxqj +zaF9Og== -----END CERTIFICATE----- From 4653ec6acac116e3ccc5cfe2817b2a6aff6bf378 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 25 Sep 2024 13:53:05 -0600 Subject: [PATCH 47/89] =?UTF-8?q?=F0=9F=94=92=EF=B8=8F=20Checksums=20for?= =?UTF-8?q?=20v2.0.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- checksums/rack-openid2-2.0.2.gem.sha256 | 1 + checksums/rack-openid2-2.0.2.gem.sha512 | 1 + 2 files changed, 2 insertions(+) create mode 100644 checksums/rack-openid2-2.0.2.gem.sha256 create mode 100644 checksums/rack-openid2-2.0.2.gem.sha512 diff --git a/checksums/rack-openid2-2.0.2.gem.sha256 b/checksums/rack-openid2-2.0.2.gem.sha256 new file mode 100644 index 0000000..a600fe7 --- /dev/null +++ b/checksums/rack-openid2-2.0.2.gem.sha256 @@ -0,0 +1 @@ +2653d209fa12547a129a514e97d3ac29677f3f1198982d9a07b03c6c186d674a \ No newline at end of file diff --git a/checksums/rack-openid2-2.0.2.gem.sha512 b/checksums/rack-openid2-2.0.2.gem.sha512 new file mode 100644 index 0000000..ca7db93 --- /dev/null +++ b/checksums/rack-openid2-2.0.2.gem.sha512 @@ -0,0 +1 @@ +561a500d7b67326bb834d4f8b3a1afc35053d7a546b1611714a6df0710d93fafdf0dc3c40662924b084eb78499a1b75e2eba2a5b67920772824b3587c4a87eb7 \ No newline at end of file From 5c208011cd92bd7ddb5fe4b474a4658d30b0cdf1 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 25 Sep 2024 14:11:54 -0600 Subject: [PATCH 48/89] =?UTF-8?q?=F0=9F=93=9D=20Documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/README.md b/README.md index 81f2e4c..f626d76 100644 --- a/README.md +++ b/README.md @@ -157,6 +157,8 @@ __END__ [🐘ruby-mast-img]: https://img.shields.io/mastodon/follow/109447111526622197?domain=https%3A%2F%2Fruby.social&style=plastic&logo=mastodon&label=Ruby%20%40galtzo [🌳linktree]: https://linktr.ee/galtzo [🌳linktree-img]: https://img.shields.io/badge/galtzo-purple?style=plastic&logo=linktree +[documentation]: http://rdoc.info/github/oauth-xx/rack-openid2/frames +[homepage]: https://github.com/oauth-xx/rack-openid2 [aboutme]: https://about.me/peter.boling @@ -190,6 +192,44 @@ Made with [contributors-img][🖐contrib-rocks]. [🖐contributors]: https://github.com/oauth-xx/rack-openid2/graphs/contributors [🖐contributors-img]: https://contrib.rocks/image?repo=oauth-xx/rack-openid2 +## 🪇 Code of Conduct + +Everyone interacting in this project's codebases, issue trackers, +chat rooms and mailing lists is expected to follow the [code of conduct][🪇conduct]. + +[🪇conduct]: CODE_OF_CONDUCT.md + +## 📌 Versioning + +This Library adheres to [Semantic Versioning 2.0.0][📌semver]. +Violations of this scheme should be reported as bugs. +Specifically, if a minor or patch version is released that breaks backward compatibility, +a new version should be immediately released that restores compatibility. +Breaking changes to the public API will only be introduced with new major versions. + +To get a better understanding of how SemVer is intended to work over a project's lifetime, +read this article from the creator of SemVer: + +- ["Major Version Numbers are Not Sacred"][📌major-versions-not-sacred] + +As a result of this policy, you can (and should) specify a dependency on these libraries using +the [Pessimistic Version Constraint][📌pvc] with two digits of precision. + +For example: + +```ruby +spec.add_dependency("rack-openid2", "~> 2.0") +``` + +See [CHANGELOG.md][📌changelog] for list of releases. + +[comment]: <> ( 📌 VERSIONING LINKS ) + +[📌pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint +[📌semver]: http://semver.org/ +[📌major-versions-not-sacred]: https://tom.preston-werner.com/2022/05/23/major-version-numbers-are-not-sacred.html +[📌changelog]: CHANGELOG.md + ## 📄 License The gem is available as open source under the terms of From e7d4d496a2a6f552a5ca6d0a671023e315bdebec Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 25 Sep 2024 14:27:43 -0600 Subject: [PATCH 49/89] =?UTF-8?q?=F0=9F=93=9D=20Fix=20documentation=20in?= =?UTF-8?q?=20Yard=20(on=20RubyDoc.info)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 10 ++++++++++ README.md | 37 ++++++++++++++++--------------------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e23e6f5..a324004 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed ### Removed +## 2.0.3 - 2024-09-25 +- COVERAGE: 97.72% -- 214/219 lines in 4 files +- BRANCH COVERAGE: 86.00% -- 43/50 branches in 4 files +- 39.13% documented +### Added +- Improved Documentation +### Fixed +- Documentation typos +- Documentation in Yard (on RubyDoc.info) + ## 2.0.2 - 2024-09-25 - COVERAGE: 97.72% -- 214/219 lines in 4 files - BRANCH COVERAGE: 86.00% -- 43/50 branches in 4 files diff --git a/README.md b/README.md index f626d76..8bce996 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # Rack::OpenID -
- [![Version](https://img.shields.io/gem/v/rack-openid2.svg)](https://rubygems.org/gems/rack-openid2) [![Downloads Today](https://img.shields.io/gem/rd/rack-openid2.svg)](https://github.com/oauth-xx/rack-openid2) [![CI Supported Build][🚎s-wfi]][🚎s-wf] @@ -10,6 +8,14 @@ [![CI Coverage Build][🚎cov-wfi]][🚎cov-wf] [![CI Heads Build][🚎hd-wfi]][🚎hd-wf] +----- + +[![Liberapay Patrons][⛳liberapay-img]][⛳liberapay] +[![Sponsor Me on Github][🖇sponsor-img]][🖇sponsor] +[![Polar Shield][🖇polar-img]][🖇polar] +[![Donate to my FLOSS or refugee efforts at ko-fi.com][🖇kofi-img]][🖇kofi] +[![Donate to my FLOSS or refugee efforts using Patreon][🖇patreon-img]][🖇patreon] + [🚎s-wf]: https://github.com/oauth-xx/rack-openid2/actions/workflows/supported.yml [🚎s-wfi]: https://github.com/oauth-xx/rack-openid2/actions/workflows/supported.yml/badge.svg [🚎us-wf]: https://github.com/oauth-xx/rack-openid2/actions/workflows/unsupported.yml @@ -21,16 +27,6 @@ [🚎hd-wf]: https://github.com/oauth-xx/rack-openid2/actions/workflows/heads.yml [🚎hd-wfi]: https://github.com/oauth-xx/rack-openid2/actions/workflows/heads.yml/badge.svg ------ - -
- -[![Liberapay Patrons][⛳liberapay-img]][⛳liberapay] -[![Sponsor Me on Github][🖇sponsor-img]][🖇sponsor] -[![Polar Shield][🖇polar-img]][🖇polar] -[![Donate to my FLOSS or refugee efforts at ko-fi.com][🖇kofi-img]][🖇kofi] -[![Donate to my FLOSS or refugee efforts using Patreon][🖇patreon-img]][🖇patreon] - [⛳liberapay-img]: https://img.shields.io/liberapay/patrons/pboling.svg?logo=liberapay [⛳liberapay]: https://liberapay.com/pboling/donate [🖇sponsor-img]: https://img.shields.io/badge/Sponsor_Me!-pboling.svg?style=social&logo=github @@ -41,13 +37,8 @@ [🖇kofi]: https://ko-fi.com/O5O86SNP4 [🖇patreon-img]: https://img.shields.io/badge/patreon-donate-yellow.svg [🖇patreon]: https://patreon.com/galtzo - - - - - -
-
+[🖇buyme-img]: https://img.buymeacoffee.com/button-api/?text=Buy%20me%20a%20latte&emoji=&slug=pboling&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff +[🖇buyme]: https://www.buymeacoffee.com/pboling Provides a more HTTPish API around the ruby-openid library. @@ -138,7 +129,7 @@ __END__ |-------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | gem name | [ruby-openid2](https://rubygems.org/gems/rack-openid2) | | code triage | [![Open Source Helpers](https://www.codetriage.com/oauth-xx/rack-openid2/badges/users.svg)](https://www.codetriage.com/oauth-xx/rack-openid2) | -| documentation | [on Github.com][homepage], [on Rdoc.info][documentation] | +| documentation | [on Github.com][homepage], [on rubydoc.info][documentation] | | expert support | [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/peterboling?utm_source=github&utm_medium=button&utm_term=peterboling&utm_campaign=github) | | `...` 💖 | [![Liberapay Patrons][⛳liberapay-img]][⛳liberapay] [![Sponsor Me][🖇sponsor-img]][🖇sponsor] [![Follow Me on LinkedIn][🖇linkedin-img]][🖇linkedin] [![Find Me on WellFound:][✌️wellfound-img]][✌️wellfound] [![Find Me on CrunchBase][💲crunchbase-img]][💲crunchbase] [![My LinkTree][🌳linktree-img]][🌳linktree] [![Follow Me on Ruby.Social][🐘ruby-mast-img]][🐘ruby-mast] [![Tweet @ Peter][🐦tweet-img]][🐦tweet] [💻][coderme] [🌏][aboutme] | @@ -157,7 +148,7 @@ __END__ [🐘ruby-mast-img]: https://img.shields.io/mastodon/follow/109447111526622197?domain=https%3A%2F%2Fruby.social&style=plastic&logo=mastodon&label=Ruby%20%40galtzo [🌳linktree]: https://linktr.ee/galtzo [🌳linktree-img]: https://img.shields.io/badge/galtzo-purple?style=plastic&logo=linktree -[documentation]: http://rdoc.info/github/oauth-xx/rack-openid2/frames +[documentation]: https://rubydoc.info/github/oauth-xx/rack-openid2 [homepage]: https://github.com/oauth-xx/rack-openid2 @@ -243,3 +234,7 @@ See [LICENSE.txt][📄license] for the official [Copyright Notice][📄copyright [📄license]: LICENSE.txt [📄license-ref]: https://opensource.org/licenses/MIT [📄license-img]: https://img.shields.io/badge/License-MIT-green.svg + +You made it to the bottom of the page! + +[![Buy me a latte][🖇buyme-img]][🖇buyme] From eeddf92cc2e99b2da2d6bf8d00d80274b1b034df Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 25 Sep 2024 14:29:07 -0600 Subject: [PATCH 50/89] =?UTF-8?q?=F0=9F=94=96=20Prepare=20release=20v2.0.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile.lock | 2 +- lib/rack/openid/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 10ef762..74ecb09 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - rack-openid2 (2.0.2) + rack-openid2 (2.0.3) rack (>= 2.2) ruby-openid2 (~> 3.1, >= 3.1.0) version_gem (~> 1.1, >= 1.1.4) diff --git a/lib/rack/openid/version.rb b/lib/rack/openid/version.rb index f6d2c07..f50ef65 100644 --- a/lib/rack/openid/version.rb +++ b/lib/rack/openid/version.rb @@ -1,7 +1,7 @@ module Rack class OpenID module Version - VERSION = "2.0.2" + VERSION = "2.0.3" end end end From 7534f72bc6e21610be2e6efedb85b214f59cde06 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 25 Sep 2024 14:30:03 -0600 Subject: [PATCH 51/89] =?UTF-8?q?=F0=9F=94=92=EF=B8=8F=20Checksums=20for?= =?UTF-8?q?=20v2.0.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- checksums/rack-openid2-2.0.3.gem.sha256 | 1 + checksums/rack-openid2-2.0.3.gem.sha512 | 1 + 2 files changed, 2 insertions(+) create mode 100644 checksums/rack-openid2-2.0.3.gem.sha256 create mode 100644 checksums/rack-openid2-2.0.3.gem.sha512 diff --git a/checksums/rack-openid2-2.0.3.gem.sha256 b/checksums/rack-openid2-2.0.3.gem.sha256 new file mode 100644 index 0000000..4ffa08e --- /dev/null +++ b/checksums/rack-openid2-2.0.3.gem.sha256 @@ -0,0 +1 @@ +38e39be5c98ff90824fe7dd1f4eb7ce1232c11ce5048b982e9ff9012d5ec90a1 \ No newline at end of file diff --git a/checksums/rack-openid2-2.0.3.gem.sha512 b/checksums/rack-openid2-2.0.3.gem.sha512 new file mode 100644 index 0000000..b700622 --- /dev/null +++ b/checksums/rack-openid2-2.0.3.gem.sha512 @@ -0,0 +1 @@ +fd93bc46b3ad616911148040ad3a7697b39cf925f82e001c3cfd9ec1d3a79bb3d91df88b566a87f297ccb73ff99b7ff9d9cd2fbeffecf19a3af492c8aa24c72e \ No newline at end of file From e06679ad39161555b72d53fcebae7682cbab50b7 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 25 Sep 2024 14:32:41 -0600 Subject: [PATCH 52/89] =?UTF-8?q?=F0=9F=93=9D=20Organize=20Markdown?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8bce996..018aef1 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,6 @@ [🖇kofi]: https://ko-fi.com/O5O86SNP4 [🖇patreon-img]: https://img.shields.io/badge/patreon-donate-yellow.svg [🖇patreon]: https://patreon.com/galtzo -[🖇buyme-img]: https://img.buymeacoffee.com/button-api/?text=Buy%20me%20a%20latte&emoji=&slug=pboling&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff -[🖇buyme]: https://www.buymeacoffee.com/pboling Provides a more HTTPish API around the ruby-openid library. @@ -235,6 +233,15 @@ See [LICENSE.txt][📄license] for the official [Copyright Notice][📄copyright [📄license-ref]: https://opensource.org/licenses/MIT [📄license-img]: https://img.shields.io/badge/License-MIT-green.svg +## 🤑 One more thing + You made it to the bottom of the page! +If you think maintaining this gem is more difficult than parsing a README, +or if you think I've done a bang up job with this gem, +please consider supporting my efforts via this link, +or one of the others at the head. [![Buy me a latte][🖇buyme-img]][🖇buyme] + +[🖇buyme-img]: https://img.buymeacoffee.com/button-api/?text=Buy%20me%20a%20latte&emoji=&slug=pboling&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff +[🖇buyme]: https://www.buymeacoffee.com/pboling From 14f3ca8e3d271b5939c650c9bbfa1fcf0b5713d2 Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 25 Sep 2024 14:41:01 -0600 Subject: [PATCH 53/89] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20typo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 018aef1..5020bfc 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ [🖇patreon-img]: https://img.shields.io/badge/patreon-donate-yellow.svg [🖇patreon]: https://patreon.com/galtzo -Provides a more HTTPish API around the ruby-openid library. +Provides a more HTTP-ish API around the ruby-openid library. ## Installation From ba0017b2fb4614ec682ad0d04337a269ab40084d Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Wed, 25 Sep 2024 14:42:05 -0600 Subject: [PATCH 54/89] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20markdown?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a324004..a14567b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,8 +43,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Typo in gemspec description ## 2.0.0 - 2024-09-04 -COVERAGE: 97.72% -- 214/219 lines in 3 files -BRANCH COVERAGE: 86.00% -- 43/50 branches in 3 branches +- COVERAGE: 97.72% -- 214/219 lines in 3 files +- BRANCH COVERAGE: 86.00% -- 43/50 branches in 3 branches ### Changed - Upgraded to rack v2+ - Switched ruby-openid => ruby-openid2 From c5f173534b03320e691383d560a314b9fad12caf Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 16:15:46 +0000 Subject: [PATCH 55/89] Update rexml to version 3.3.9 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 74ecb09..ffeb43a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -56,7 +56,7 @@ GEM regexp_parser (2.9.2) require_bench (1.0.4) version_gem (>= 1.1.3, < 4) - rexml (3.3.7) + rexml (3.3.9) rots (1.0.0) date openssl From 392bd21e358ce6cd6b4513d8bfa59548c122b763 Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 07:37:09 +0000 Subject: [PATCH 56/89] Update minitest to version 5.25.4 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 74ecb09..bd94a50 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -30,7 +30,7 @@ GEM language_server-protocol (3.17.0.3) lint_roller (1.1.0) logger (1.6.1) - minitest (5.25.1) + minitest (5.25.4) minitest-focus (1.4.0) minitest (>= 4, < 6) minitest-rg (5.3.0) From 92bbc223e48258a0acc57f8e4b00743339febbf4 Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Sun, 5 Jan 2025 09:15:38 +0000 Subject: [PATCH 57/89] Update rack-session to version 2.1.0 --- Gemfile.lock | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 74ecb09..c013afe 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,6 +12,7 @@ GEM ansi (1.5.0) ast (2.4.2) backports (3.25.0) + base64 (0.2.0) byebug (11.1.3) date (3.3.4) diff-lcs (1.5.1) @@ -45,8 +46,9 @@ GEM psych (5.1.2) stringio racc (1.8.1) - rack (3.1.7) - rack-session (2.0.0) + rack (3.1.8) + rack-session (2.1.0) + base64 (>= 0.1.0) rack (>= 3.0.0) rackup (2.1.0) rack (>= 3) From b6d7e13eceea031adf8b79ecec4123d394b4c0c1 Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Sun, 2 Feb 2025 17:20:00 +0000 Subject: [PATCH 58/89] Update logger to version 1.6.5 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index b729a42..89fabfa 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -30,7 +30,7 @@ GEM version_gem (~> 1.1, >= 1.1.4) language_server-protocol (3.17.0.3) lint_roller (1.1.0) - logger (1.6.1) + logger (1.6.5) minitest (5.25.4) minitest-focus (1.4.0) minitest (>= 4, < 6) From 1a6df581517c636cdab59a246dd649fa39c3620f Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Sun, 2 Feb 2025 17:35:57 +0000 Subject: [PATCH 59/89] Update standard to version 1.44.0 --- Gemfile.lock | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b729a42..af2394c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -18,7 +18,7 @@ GEM diff-lcs (1.5.1) diffy (3.4.2) docile (1.4.1) - json (2.7.2) + json (2.9.1) kettle-soup-cover (1.0.4) simplecov (~> 0.22) simplecov-cobertura (~> 2.1) @@ -28,7 +28,7 @@ GEM simplecov-rcov (~> 0.3, >= 0.3.3) simplecov_json_formatter (~> 0.1, >= 0.1.4) version_gem (~> 1.1, >= 1.1.4) - language_server-protocol (3.17.0.3) + language_server-protocol (3.17.0.4) lint_roller (1.1.0) logger (1.6.1) minitest (5.25.4) @@ -40,7 +40,7 @@ GEM optparse (0.5.0) ostruct (0.6.0) parallel (1.26.3) - parser (3.3.5.0) + parser (3.3.7.0) ast (~> 2.4.1) racc psych (5.1.2) @@ -55,10 +55,10 @@ GEM webrick (~> 1.8) rainbow (3.1.1) rake (13.2.1) - regexp_parser (2.9.2) + regexp_parser (2.10.0) require_bench (1.0.4) version_gem (>= 1.1.3, < 4) - rexml (3.3.9) + rexml (3.4.0) rots (1.0.0) date openssl @@ -72,18 +72,17 @@ GEM webrick yaml (~> 0.3) rspec-block_is_expected (1.0.6) - rubocop (1.65.1) + rubocop (1.70.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 2.4, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.31.1, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.36.2, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.32.3) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.38.0) parser (>= 3.3.1.0) rubocop-gradual (0.3.6) diff-lcs (>= 1.2.0, < 2.0) @@ -102,7 +101,7 @@ GEM rubocop-ast (>= 1.31.1, < 2.0) rubocop-packaging (0.5.2) rubocop (>= 1.33, < 2.0) - rubocop-performance (1.21.1) + rubocop-performance (1.23.1) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) rubocop-rake (0.6.0) @@ -138,18 +137,18 @@ GEM simplecov-rcov (0.3.7) simplecov (>= 0.4.1) simplecov_json_formatter (0.1.4) - standard (1.40.0) + standard (1.44.0) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.65.0) + rubocop (~> 1.70.0) standard-custom (~> 1.0.0) - standard-performance (~> 1.4) + standard-performance (~> 1.6) standard-custom (1.0.2) lint_roller (~> 1.0) rubocop (~> 1.50) - standard-performance (1.4.0) + standard-performance (1.6.0) lint_roller (~> 1.1) - rubocop-performance (~> 1.21.0) + rubocop-performance (~> 1.23.0) standard-rubocop-lts (1.0.10) rspec-block_is_expected (~> 1.0, >= 1.0.5) standard (>= 1.35.1, < 2) From aa0e87c59cf49950e79e2da1a61db2d62c9b796c Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Sun, 2 Feb 2025 17:41:56 +0000 Subject: [PATCH 60/89] Update rack to version 3.1.9 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index b729a42..8e649bd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -46,7 +46,7 @@ GEM psych (5.1.2) stringio racc (1.8.1) - rack (3.1.8) + rack (3.1.9) rack-session (2.1.0) base64 (>= 0.1.0) rack (>= 3.0.0) From 94d3a2573a94f0887d5f9fb8d88ad822d377ea05 Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 20:21:47 +0000 Subject: [PATCH 61/89] Update rack to version 3.1.10 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3506e02..60d9f9f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -46,7 +46,7 @@ GEM psych (5.1.2) stringio racc (1.8.1) - rack (3.1.9) + rack (3.1.10) rack-session (2.1.0) base64 (>= 0.1.0) rack (>= 3.0.0) From 2901da6db1fc1f0205a3184e8e49e76e63ad89dd Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 21:16:30 +0000 Subject: [PATCH 62/89] Update standard to version 1.45.0 --- Gemfile.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3506e02..7b39bff 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -18,7 +18,7 @@ GEM diff-lcs (1.5.1) diffy (3.4.2) docile (1.4.1) - json (2.9.1) + json (2.10.1) kettle-soup-cover (1.0.4) simplecov (~> 0.22) simplecov-cobertura (~> 2.1) @@ -40,7 +40,7 @@ GEM optparse (0.5.0) ostruct (0.6.0) parallel (1.26.3) - parser (3.3.7.0) + parser (3.3.7.1) ast (~> 2.4.1) racc psych (5.1.2) @@ -72,14 +72,14 @@ GEM webrick yaml (~> 0.3) rspec-block_is_expected (1.0.6) - rubocop (1.70.0) + rubocop (1.71.2) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.36.2, < 2.0) + rubocop-ast (>= 1.38.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) rubocop-ast (1.38.0) @@ -137,10 +137,10 @@ GEM simplecov-rcov (0.3.7) simplecov (>= 0.4.1) simplecov_json_formatter (0.1.4) - standard (1.44.0) + standard (1.45.0) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.70.0) + rubocop (~> 1.71.0) standard-custom (~> 1.0.0) standard-performance (~> 1.6) standard-custom (1.0.2) From dc2435cd2767a32597d581fdd08e61b874598bcd Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 10:46:22 +0000 Subject: [PATCH 63/89] Update logger to version 1.6.6 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3506e02..3b00602 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -30,7 +30,7 @@ GEM version_gem (~> 1.1, >= 1.1.4) language_server-protocol (3.17.0.4) lint_roller (1.1.0) - logger (1.6.5) + logger (1.6.6) minitest (5.25.4) minitest-focus (1.4.0) minitest (>= 4, < 6) From 1baf954e94cde7c2cd568502f1df7d406ca77e5f Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 11:16:16 +0000 Subject: [PATCH 64/89] Update version_gem to version 1.1.6 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3506e02..4ee07f4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -159,7 +159,7 @@ GEM terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) unicode-display_width (2.6.0) - version_gem (1.1.4) + version_gem (1.1.6) webrick (1.8.2) yaml (0.3.0) yard (0.9.37) From 28c557ea12117dcd0d05e251665a6fdcc8d9c977 Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Tue, 4 Mar 2025 16:31:22 +0000 Subject: [PATCH 65/89] Update rack to version 3.1.11 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index b6b15a8..bf302fb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -46,7 +46,7 @@ GEM psych (5.1.2) stringio racc (1.8.1) - rack (3.1.10) + rack (3.1.11) rack-session (2.1.0) base64 (>= 0.1.0) rack (>= 3.0.0) From 2e61623f9d171644a94eaf8b6a8f3bc2fbdfe0bd Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Tue, 11 Mar 2025 00:25:04 +0000 Subject: [PATCH 66/89] Update rack to version 3.1.12 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index bf302fb..74d4d08 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -46,7 +46,7 @@ GEM psych (5.1.2) stringio racc (1.8.1) - rack (3.1.11) + rack (3.1.12) rack-session (2.1.0) base64 (>= 0.1.0) rack (>= 3.0.0) From 0e33946df43959a0c48d8a9157cdacaa6412303b Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Wed, 12 Mar 2025 16:21:07 +0000 Subject: [PATCH 67/89] Update json to version 2.10.2 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 74d4d08..91cceeb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -18,7 +18,7 @@ GEM diff-lcs (1.5.1) diffy (3.4.2) docile (1.4.1) - json (2.10.1) + json (2.10.2) kettle-soup-cover (1.0.4) simplecov (~> 0.22) simplecov-cobertura (~> 2.1) From c611199a359e42a24294c79c3e00a9d535cb420c Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Wed, 12 Mar 2025 21:16:05 +0000 Subject: [PATCH 68/89] Update standard to version 1.47.0 --- Gemfile.lock | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 91cceeb..f4f81a2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -72,9 +72,10 @@ GEM webrick yaml (~> 0.3) rspec-block_is_expected (1.0.6) - rubocop (1.71.2) + rubocop (1.73.2) json (~> 2.3) - language_server-protocol (>= 3.17.0) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) @@ -82,7 +83,7 @@ GEM rubocop-ast (>= 1.38.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.38.0) + rubocop-ast (1.38.1) parser (>= 3.3.1.0) rubocop-gradual (0.3.6) diff-lcs (>= 1.2.0, < 2.0) @@ -101,9 +102,10 @@ GEM rubocop-ast (>= 1.31.1, < 2.0) rubocop-packaging (0.5.2) rubocop (>= 1.33, < 2.0) - rubocop-performance (1.23.1) - rubocop (>= 1.48.1, < 2.0) - rubocop-ast (>= 1.31.1, < 2.0) + rubocop-performance (1.24.0) + lint_roller (~> 1.1) + rubocop (>= 1.72.1, < 2.0) + rubocop-ast (>= 1.38.0, < 2.0) rubocop-rake (0.6.0) rubocop (~> 1.0) rubocop-ruby2_7 (2.0.6) @@ -137,18 +139,18 @@ GEM simplecov-rcov (0.3.7) simplecov (>= 0.4.1) simplecov_json_formatter (0.1.4) - standard (1.45.0) + standard (1.47.0) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.71.0) + rubocop (~> 1.73.0) standard-custom (~> 1.0.0) - standard-performance (~> 1.6) + standard-performance (~> 1.7) standard-custom (1.0.2) lint_roller (~> 1.0) rubocop (~> 1.50) - standard-performance (1.6.0) + standard-performance (1.7.0) lint_roller (~> 1.1) - rubocop-performance (~> 1.23.0) + rubocop-performance (~> 1.24.0) standard-rubocop-lts (1.0.10) rspec-block_is_expected (~> 1.0, >= 1.0.5) standard (>= 1.35.1, < 2) @@ -156,9 +158,11 @@ GEM standard-performance (>= 1.3.1, < 2) version_gem (>= 1.1.4, < 3) stringio (3.1.1) - terminal-table (3.0.2) - unicode-display_width (>= 1.1.1, < 3) - unicode-display_width (2.6.0) + terminal-table (4.0.0) + unicode-display_width (>= 1.1.1, < 4) + unicode-display_width (3.1.4) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) version_gem (1.1.6) webrick (1.8.2) yaml (0.3.0) From 3e81e010fcb436f4e6410719ec2dba202ff6c52d Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 21:16:41 +0000 Subject: [PATCH 69/89] Update minitest to version 5.25.5 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index f4f81a2..2ca2ddd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -31,7 +31,7 @@ GEM language_server-protocol (3.17.0.4) lint_roller (1.1.0) logger (1.6.6) - minitest (5.25.4) + minitest (5.25.5) minitest-focus (1.4.0) minitest (>= 4, < 6) minitest-rg (5.3.0) From 09547f422ca898400384e677353aad00c90698a6 Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Mon, 24 Mar 2025 05:45:49 +0000 Subject: [PATCH 70/89] Update rubocop-packaging to version 0.6.0 --- Gemfile.lock | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2ca2ddd..929e5d4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,7 +10,7 @@ GEM remote: https://rubygems.org/ specs: ansi (1.5.0) - ast (2.4.2) + ast (2.4.3) backports (3.25.0) base64 (0.2.0) byebug (11.1.3) @@ -40,7 +40,7 @@ GEM optparse (0.5.0) ostruct (0.6.0) parallel (1.26.3) - parser (3.3.7.1) + parser (3.3.7.2) ast (~> 2.4.1) racc psych (5.1.2) @@ -83,8 +83,8 @@ GEM rubocop-ast (>= 1.38.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.38.1) - parser (>= 3.3.1.0) + rubocop-ast (1.41.0) + parser (>= 3.3.7.2) rubocop-gradual (0.3.6) diff-lcs (>= 1.2.0, < 2.0) diffy (~> 3.0) @@ -100,8 +100,9 @@ GEM rubocop-minitest (0.36.0) rubocop (>= 1.61, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) - rubocop-packaging (0.5.2) - rubocop (>= 1.33, < 2.0) + rubocop-packaging (0.6.0) + lint_roller (~> 1.1.0) + rubocop (>= 1.72.1, < 2.0) rubocop-performance (1.24.0) lint_roller (~> 1.1) rubocop (>= 1.72.1, < 2.0) From fd683b422c9ccd771c66a798decd01821bc282c4 Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Wed, 26 Mar 2025 15:25:55 +0000 Subject: [PATCH 71/89] Update byebug to version 12.0.0 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 929e5d4..3617e35 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -13,7 +13,7 @@ GEM ast (2.4.3) backports (3.25.0) base64 (0.2.0) - byebug (11.1.3) + byebug (12.0.0) date (3.3.4) diff-lcs (1.5.1) diffy (3.4.2) From d0b9d458830c3a415374f9b5bcd4d1051e6aa502 Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Fri, 28 Mar 2025 02:54:28 +0000 Subject: [PATCH 72/89] Update logger to version 1.7.0 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3617e35..fdcade9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -30,7 +30,7 @@ GEM version_gem (~> 1.1, >= 1.1.4) language_server-protocol (3.17.0.4) lint_roller (1.1.0) - logger (1.6.6) + logger (1.7.0) minitest (5.25.5) minitest-focus (1.4.0) minitest (>= 4, < 6) From 42f7d1a77f4c7d79f72c837136d5fa5c3ef0814a Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Sat, 5 Apr 2025 05:46:02 +0000 Subject: [PATCH 73/89] Update kettle-soup-cover to version 1.0.5 --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index fdcade9..2cc929a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -19,7 +19,7 @@ GEM diffy (3.4.2) docile (1.4.1) json (2.10.2) - kettle-soup-cover (1.0.4) + kettle-soup-cover (1.0.5) simplecov (~> 0.22) simplecov-cobertura (~> 2.1) simplecov-console (~> 0.9, >= 0.9.1) @@ -58,7 +58,7 @@ GEM regexp_parser (2.10.0) require_bench (1.0.4) version_gem (>= 1.1.3, < 4) - rexml (3.4.0) + rexml (3.4.1) rots (1.0.0) date openssl @@ -131,7 +131,7 @@ GEM simplecov-cobertura (2.1.0) rexml simplecov (~> 0.19) - simplecov-console (0.9.2) + simplecov-console (0.9.3) ansi simplecov terminal-table From a3a630805f6ceb21fac2cb0654e3d47a61fbd270 Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 21:48:34 +0000 Subject: [PATCH 74/89] Update standard to version 1.49.0 --- Gemfile.lock | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2cc929a..92fba9b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -40,9 +40,10 @@ GEM optparse (0.5.0) ostruct (0.6.0) parallel (1.26.3) - parser (3.3.7.2) + parser (3.3.7.4) ast (~> 2.4.1) racc + prism (1.4.0) psych (5.1.2) stringio racc (1.8.1) @@ -72,7 +73,7 @@ GEM webrick yaml (~> 0.3) rspec-block_is_expected (1.0.6) - rubocop (1.73.2) + rubocop (1.75.2) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -80,11 +81,12 @@ GEM parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.38.0, < 2.0) + rubocop-ast (>= 1.44.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.41.0) + rubocop-ast (1.44.0) parser (>= 3.3.7.2) + prism (~> 1.4) rubocop-gradual (0.3.6) diff-lcs (>= 1.2.0, < 2.0) diffy (~> 3.0) @@ -103,9 +105,9 @@ GEM rubocop-packaging (0.6.0) lint_roller (~> 1.1.0) rubocop (>= 1.72.1, < 2.0) - rubocop-performance (1.24.0) + rubocop-performance (1.25.0) lint_roller (~> 1.1) - rubocop (>= 1.72.1, < 2.0) + rubocop (>= 1.75.0, < 2.0) rubocop-ast (>= 1.38.0, < 2.0) rubocop-rake (0.6.0) rubocop (~> 1.0) @@ -140,18 +142,18 @@ GEM simplecov-rcov (0.3.7) simplecov (>= 0.4.1) simplecov_json_formatter (0.1.4) - standard (1.47.0) + standard (1.49.0) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.73.0) + rubocop (~> 1.75.2) standard-custom (~> 1.0.0) - standard-performance (~> 1.7) + standard-performance (~> 1.8) standard-custom (1.0.2) lint_roller (~> 1.0) rubocop (~> 1.50) - standard-performance (1.7.0) + standard-performance (1.8.0) lint_roller (~> 1.1) - rubocop-performance (~> 1.24.0) + rubocop-performance (~> 1.25.0) standard-rubocop-lts (1.0.10) rspec-block_is_expected (~> 1.0, >= 1.0.5) standard (>= 1.35.1, < 2) From f3bda3b24c2bdaf1c216cafcf410c4f38926b618 Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 13:46:53 +0000 Subject: [PATCH 75/89] Update rack to version 3.1.13 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2cc929a..d06a1eb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -46,7 +46,7 @@ GEM psych (5.1.2) stringio racc (1.8.1) - rack (3.1.12) + rack (3.1.13) rack-session (2.1.0) base64 (>= 0.1.0) rack (>= 3.0.0) From 9d01792a2327d6acd4348b38a8d99686cd8812de Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Wed, 16 Apr 2025 19:15:59 +0000 Subject: [PATCH 76/89] Update version_gem to version 1.1.7 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2cc929a..f000197 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -164,7 +164,7 @@ GEM unicode-display_width (3.1.4) unicode-emoji (~> 4.0, >= 4.0.4) unicode-emoji (4.0.4) - version_gem (1.1.6) + version_gem (1.1.7) webrick (1.8.2) yaml (0.3.0) yard (0.9.37) From 696d3c0d0cf2c59f69052e966567e3717517f3b3 Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 17:16:00 +0000 Subject: [PATCH 77/89] Update kettle-soup-cover to version 1.0.6 --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index c3bb152..1ae66f3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -19,7 +19,7 @@ GEM diffy (3.4.2) docile (1.4.1) json (2.10.2) - kettle-soup-cover (1.0.5) + kettle-soup-cover (1.0.6) simplecov (~> 0.22) simplecov-cobertura (~> 2.1) simplecov-console (~> 0.9, >= 0.9.1) @@ -27,7 +27,7 @@ GEM simplecov-lcov (~> 0.8) simplecov-rcov (~> 0.3, >= 0.3.3) simplecov_json_formatter (~> 0.1, >= 0.1.4) - version_gem (~> 1.1, >= 1.1.4) + version_gem (~> 1.1, >= 1.1.7) language_server-protocol (3.17.0.4) lint_roller (1.1.0) logger (1.7.0) From 01e74a61c751ab3492ed528a96f7de0d76b091ae Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Wed, 7 May 2025 11:16:12 +0000 Subject: [PATCH 78/89] Update version_gem to version 1.1.8 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1ae66f3..24a0b27 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -166,7 +166,7 @@ GEM unicode-display_width (3.1.4) unicode-emoji (~> 4.0, >= 4.0.4) unicode-emoji (4.0.4) - version_gem (1.1.7) + version_gem (1.1.8) webrick (1.8.2) yaml (0.3.0) yard (0.9.37) From aee87388f346fc328efee5ed95489b0d0c868403 Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Wed, 7 May 2025 12:16:25 +0000 Subject: [PATCH 79/89] Update rack-session to version 2.1.1 --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1ae66f3..b7815d6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -47,8 +47,8 @@ GEM psych (5.1.2) stringio racc (1.8.1) - rack (3.1.13) - rack-session (2.1.0) + rack (3.1.14) + rack-session (2.1.1) base64 (>= 0.1.0) rack (>= 3.0.0) rackup (2.1.0) From 6616aece5e0d6985c0d9593b8e82d8e6fb195977 Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Wed, 14 May 2025 20:46:14 +0000 Subject: [PATCH 80/89] Update standard to version 1.50.0 --- Gemfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 60eff2a..174d422 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -18,7 +18,7 @@ GEM diff-lcs (1.5.1) diffy (3.4.2) docile (1.4.1) - json (2.10.2) + json (2.12.0) kettle-soup-cover (1.0.6) simplecov (~> 0.22) simplecov-cobertura (~> 2.1) @@ -28,7 +28,7 @@ GEM simplecov-rcov (~> 0.3, >= 0.3.3) simplecov_json_formatter (~> 0.1, >= 0.1.4) version_gem (~> 1.1, >= 1.1.7) - language_server-protocol (3.17.0.4) + language_server-protocol (3.17.0.5) lint_roller (1.1.0) logger (1.7.0) minitest (5.25.5) @@ -39,8 +39,8 @@ GEM openssl (3.2.0) optparse (0.5.0) ostruct (0.6.0) - parallel (1.26.3) - parser (3.3.7.4) + parallel (1.27.0) + parser (3.3.8.0) ast (~> 2.4.1) racc prism (1.4.0) @@ -73,7 +73,7 @@ GEM webrick yaml (~> 0.3) rspec-block_is_expected (1.0.6) - rubocop (1.75.2) + rubocop (1.75.5) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -84,7 +84,7 @@ GEM rubocop-ast (>= 1.44.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.44.0) + rubocop-ast (1.44.1) parser (>= 3.3.7.2) prism (~> 1.4) rubocop-gradual (0.3.6) @@ -142,10 +142,10 @@ GEM simplecov-rcov (0.3.7) simplecov (>= 0.4.1) simplecov_json_formatter (0.1.4) - standard (1.49.0) + standard (1.50.0) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.75.2) + rubocop (~> 1.75.5) standard-custom (~> 1.0.0) standard-performance (~> 1.8) standard-custom (1.0.2) From fae46bf37f761c125239ec002ac3d8b6589d1d27 Mon Sep 17 00:00:00 2001 From: Annibelle Boling Date: Sun, 18 May 2025 04:54:48 -0600 Subject: [PATCH 81/89] =?UTF-8?q?=F0=9F=92=B8=20Created=20FUNDING.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/FUNDING.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..5527dc1 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,13 @@ +# These are supported funding model platforms + +buy_me_a_coffee: pboling +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +github: [pboling] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +issuehunt: pboling # Replace with a single IssueHunt username +ko_fi: pboling # Replace with a single Ko-fi username +liberapay: pboling # Replace with a single Liberapay username +open_collective: # Replace with a single Open Collective username +patreon: galtzo # Replace with a single Patreon username +polar: pboling +thanks_dev: u/gh/pboling +tidelift: rubygems/rack-openid2 # Replace with a single Tidelift platform-name/package-name e.g., npm/babel \ No newline at end of file From b7a91d0917bc0341e7b815f23543820ecfae8e0e Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 04:17:08 +0000 Subject: [PATCH 82/89] Update rack to version 3.1.15 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 174d422..2b3712d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -47,7 +47,7 @@ GEM psych (5.1.2) stringio racc (1.8.1) - rack (3.1.14) + rack (3.1.15) rack-session (2.1.1) base64 (>= 0.1.0) rack (>= 3.0.0) From 4c9f40079c6b4a40641e6bdcb1f8f8c282a34a74 Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Wed, 21 May 2025 22:16:15 +0000 Subject: [PATCH 83/89] Update kettle-soup-cover to version 1.0.9 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 174d422..d2b86ad 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -19,7 +19,7 @@ GEM diffy (3.4.2) docile (1.4.1) json (2.12.0) - kettle-soup-cover (1.0.6) + kettle-soup-cover (1.0.9) simplecov (~> 0.22) simplecov-cobertura (~> 2.1) simplecov-console (~> 0.9, >= 0.9.1) From 2657ec7a5c7208bf4cdd2670d03b41c14c1b596f Mon Sep 17 00:00:00 2001 From: Aboling0 <142766788+Aboling0@users.noreply.github.com> Date: Wed, 28 May 2025 21:25:32 -0600 Subject: [PATCH 84/89] Create CNAME --- CNAME | 1 + 1 file changed, 1 insertion(+) create mode 100644 CNAME diff --git a/CNAME b/CNAME new file mode 100644 index 0000000..953691e --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +rack-openid2.galtzo.com \ No newline at end of file From 08e9e6214d32b4626bfc57999c74edf2bc1ad1d5 Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Sat, 31 May 2025 07:49:18 +0000 Subject: [PATCH 85/89] Update rake to version 13.3.0 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 4c9f9cb..f409f52 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -55,7 +55,7 @@ GEM rack (>= 3) webrick (~> 1.8) rainbow (3.1.1) - rake (13.2.1) + rake (13.3.0) regexp_parser (2.10.0) require_bench (1.0.4) version_gem (>= 1.1.3, < 4) From b49aaebc8dd484a40925b372c274a29ce3b70cb4 Mon Sep 17 00:00:00 2001 From: Annibelle Boling Date: Sat, 31 May 2025 15:58:22 -0600 Subject: [PATCH 86/89] =?UTF-8?q?=F0=9F=93=9D=20Update=20README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index 5020bfc..8916f59 100644 --- a/README.md +++ b/README.md @@ -235,11 +235,7 @@ See [LICENSE.txt][📄license] for the official [Copyright Notice][📄copyright ## 🤑 One more thing -You made it to the bottom of the page! -If you think maintaining this gem is more difficult than parsing a README, -or if you think I've done a bang up job with this gem, -please consider supporting my efforts via this link, -or one of the others at the head. +You made it to the bottom of the page, so perhaps you'll indulge me for another 20 seconds. I maintain many dozens of gems, including this one, because I want Ruby to be a great place for people to solve problems, big and small. Please consider supporting my efforts via the giant yellow link below, or one of the others at the head of this README. [![Buy me a latte][🖇buyme-img]][🖇buyme] From e45f37e8c170a66f88d5f6e3c96d1b728d2c3817 Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Sun, 1 Jun 2025 12:50:02 +0000 Subject: [PATCH 87/89] Update rubocop-minitest to version 0.38.1 --- Gemfile.lock | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index f409f52..65454a2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -18,7 +18,7 @@ GEM diff-lcs (1.5.1) diffy (3.4.2) docile (1.4.1) - json (2.12.0) + json (2.12.2) kettle-soup-cover (1.0.9) simplecov (~> 0.22) simplecov-cobertura (~> 2.1) @@ -73,7 +73,7 @@ GEM webrick yaml (~> 0.3) rspec-block_is_expected (1.0.6) - rubocop (1.75.5) + rubocop (1.75.8) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -99,9 +99,10 @@ GEM version_gem (>= 1.1.2, < 3) rubocop-md (1.2.3) rubocop (>= 1.45) - rubocop-minitest (0.36.0) - rubocop (>= 1.61, < 2.0) - rubocop-ast (>= 1.31.1, < 2.0) + rubocop-minitest (0.38.1) + lint_roller (~> 1.1) + rubocop (>= 1.75.0, < 2.0) + rubocop-ast (>= 1.38.0, < 2.0) rubocop-packaging (0.6.0) lint_roller (~> 1.1.0) rubocop (>= 1.72.1, < 2.0) From e01a469db06272ece422853330c9883961e58823 Mon Sep 17 00:00:00 2001 From: "depfu[bot]" <23717796+depfu[bot]@users.noreply.github.com> Date: Thu, 5 Jun 2025 06:21:02 +0000 Subject: [PATCH 88/89] Update rack to version 3.1.16 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 65454a2..b2dedf0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -47,7 +47,7 @@ GEM psych (5.1.2) stringio racc (1.8.1) - rack (3.1.15) + rack (3.1.16) rack-session (2.1.1) base64 (>= 0.1.0) rack (>= 3.0.0) From 6ad3f7b5505af823948bfeba37ba83c76ff1277c Mon Sep 17 00:00:00 2001 From: Annibelle Boling Date: Fri, 6 Jun 2025 19:01:46 -0600 Subject: [PATCH 89/89] =?UTF-8?q?=F0=9F=93=9D=20Update=20README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 8916f59..1dbc7bc 100644 --- a/README.md +++ b/README.md @@ -8,14 +8,6 @@ [![CI Coverage Build][🚎cov-wfi]][🚎cov-wf] [![CI Heads Build][🚎hd-wfi]][🚎hd-wf] ------ - -[![Liberapay Patrons][⛳liberapay-img]][⛳liberapay] -[![Sponsor Me on Github][🖇sponsor-img]][🖇sponsor] -[![Polar Shield][🖇polar-img]][🖇polar] -[![Donate to my FLOSS or refugee efforts at ko-fi.com][🖇kofi-img]][🖇kofi] -[![Donate to my FLOSS or refugee efforts using Patreon][🖇patreon-img]][🖇patreon] - [🚎s-wf]: https://github.com/oauth-xx/rack-openid2/actions/workflows/supported.yml [🚎s-wfi]: https://github.com/oauth-xx/rack-openid2/actions/workflows/supported.yml/badge.svg [🚎us-wf]: https://github.com/oauth-xx/rack-openid2/actions/workflows/unsupported.yml @@ -27,16 +19,23 @@ [🚎hd-wf]: https://github.com/oauth-xx/rack-openid2/actions/workflows/heads.yml [🚎hd-wfi]: https://github.com/oauth-xx/rack-openid2/actions/workflows/heads.yml/badge.svg -[⛳liberapay-img]: https://img.shields.io/liberapay/patrons/pboling.svg?logo=liberapay +----- + +[![Liberapay Goal Progress][⛳liberapay-img]][⛳liberapay] [![Sponsor Me on Github][🖇sponsor-img]][🖇sponsor] [![Buy me a coffee][🖇buyme-small-img]][🖇buyme] [![Donate on Polar][🖇polar-img]][🖇polar] [![Donate to my FLOSS or refugee efforts at ko-fi.com][🖇kofi-img]][🖇kofi] [![Donate to my FLOSS or refugee efforts using Patreon][🖇patreon-img]][🖇patreon] + +--- + +[⛳liberapay-img]: https://img.shields.io/liberapay/goal/pboling.svg?logo=liberapay [⛳liberapay]: https://liberapay.com/pboling/donate [🖇sponsor-img]: https://img.shields.io/badge/Sponsor_Me!-pboling.svg?style=social&logo=github [🖇sponsor]: https://github.com/sponsors/pboling -[🖇polar-img]: https://polar.sh/embed/seeks-funding-shield.svg?org=pboling +[🖇polar-img]: https://img.shields.io/badge/polar-donate-yellow.svg [🖇polar]: https://polar.sh/pboling -[🖇kofi-img]: https://img.shields.io/badge/buy%20me%20coffee-donate-yellow.svg +[🖇kofi-img]: https://img.shields.io/badge/a_more_different_coffee-✓-yellow.svg [🖇kofi]: https://ko-fi.com/O5O86SNP4 [🖇patreon-img]: https://img.shields.io/badge/patreon-donate-yellow.svg [🖇patreon]: https://patreon.com/galtzo +[🖇buyme-small-img]: https://img.shields.io/badge/buy_me_a_coffee-✓-yellow.svg?style=flat Provides a more HTTP-ish API around the ruby-openid library.