From b6c46e783e33deff4b8c5491f090c4ee607358c1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 21:03:24 +0000 Subject: [PATCH 1/9] Bump ruby/setup-ruby in the github-actions group across 1 directory Bumps the github-actions group with 1 update in the / directory: [ruby/setup-ruby](https://github.com/ruby/setup-ruby). Updates `ruby/setup-ruby` from 1.188.0 to 1.204.0 - [Release notes](https://github.com/ruby/setup-ruby/releases) - [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb) - [Commits](https://github.com/ruby/setup-ruby/compare/50ba3386b050ad5b97a41fcb81240cbee1d1821f...401c19e14f474b54450cd3905bb8b86e2c8509cf) --- updated-dependencies: - dependency-name: ruby/setup-ruby dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0374a1c..02b07d9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,7 @@ jobs: - name: checkout uses: actions/checkout@v4 - - uses: ruby/setup-ruby@50ba3386b050ad5b97a41fcb81240cbee1d1821f # pin@v1.188.0 + - uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # pin@v1.204.0 with: bundler-cache: true diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c4d63c1..a3d396c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,7 +18,7 @@ jobs: - name: checkout uses: actions/checkout@v4 - - uses: ruby/setup-ruby@50ba3386b050ad5b97a41fcb81240cbee1d1821f # pin@v1.188.0 + - uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # pin@v1.204.0 with: bundler-cache: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0285853..2b69694 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: - name: checkout uses: actions/checkout@v4 - - uses: ruby/setup-ruby@50ba3386b050ad5b97a41fcb81240cbee1d1821f # pin@v1.188.0 + - uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # pin@v1.204.0 with: bundler-cache: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8ab2267..d7d0ee7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,7 @@ jobs: - name: checkout uses: actions/checkout@v4 - - uses: ruby/setup-ruby@50ba3386b050ad5b97a41fcb81240cbee1d1821f # pin@v1.188.0 + - uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # pin@v1.204.0 with: bundler-cache: true ruby-version: ${{ matrix.ruby }} From 60e3c5ea89468791b1e1699f88af0368d591a932 Mon Sep 17 00:00:00 2001 From: Jason Macgowan <1389531+jasonmacgowan@users.noreply.github.com> Date: Wed, 18 Dec 2024 13:38:53 -0500 Subject: [PATCH 2/9] bundle update --all --- .ruby-version | 2 +- spec/acceptance/github-server/Gemfile | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.ruby-version b/.ruby-version index bea438e..9c25013 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.1 +3.3.6 diff --git a/spec/acceptance/github-server/Gemfile b/spec/acceptance/github-server/Gemfile index 6d991bf..29c4369 100644 --- a/spec/acceptance/github-server/Gemfile +++ b/spec/acceptance/github-server/Gemfile @@ -2,7 +2,8 @@ source "https://rubygems.org" -gem "rack", "= 2.2.8.1" +gem "rack", "~> 3.1.8" +gem "rackup", "~> 2.2" gem "rack-test", "~> 2.1" -gem "sinatra", "= 3.2.0" +gem "sinatra", "~> 4.1.1" gem "webrick", "~> 1.8" From fc3b09bdc3d40cdf1369eca06e287f6cb1c0e481 Mon Sep 17 00:00:00 2001 From: Jason Macgowan <1389531+jasonmacgowan@users.noreply.github.com> Date: Wed, 18 Dec 2024 15:48:55 -0500 Subject: [PATCH 3/9] linty lint --- spec/acceptance/github-server/Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/acceptance/github-server/Gemfile b/spec/acceptance/github-server/Gemfile index 29c4369..bee7c83 100644 --- a/spec/acceptance/github-server/Gemfile +++ b/spec/acceptance/github-server/Gemfile @@ -3,7 +3,7 @@ source "https://rubygems.org" gem "rack", "~> 3.1.8" -gem "rackup", "~> 2.2" gem "rack-test", "~> 2.1" +gem "rackup", "~> 2.2" gem "sinatra", "~> 4.1.1" gem "webrick", "~> 1.8" From f7394237d691aa39fc99803aa68f8d43531e0591 Mon Sep 17 00:00:00 2001 From: Jason Macgowan <1389531+jasonmacgowan@users.noreply.github.com> Date: Wed, 18 Dec 2024 16:12:10 -0500 Subject: [PATCH 4/9] fix github-server? --- spec/acceptance/github-server/web.rb | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/spec/acceptance/github-server/web.rb b/spec/acceptance/github-server/web.rb index b8ad149..96e9793 100644 --- a/spec/acceptance/github-server/web.rb +++ b/spec/acceptance/github-server/web.rb @@ -8,18 +8,22 @@ require "webrick/https" require "openssl" -webrick_options = { - Host: "0.0.0.0", - Port: 443, - Logger: WEBrick::Log::new($stderr, WEBrick::Log::DEBUG), - SSLEnable: true, - SSLVerifyClient: OpenSSL::SSL::VERIFY_NONE, - SSLCertificate: OpenSSL::X509::Certificate.new(File.read("/acceptance/github-server/ssl.crt")), - SSLPrivateKey: OpenSSL::PKey::RSA.new(File.read("/acceptance/github-server/ssl.key")), - SSLCertName: [["CN", "github.fake"]] -} - class FakeGitHubApi < Sinatra::Base + set :server, %w[webrick] + set :server_settings, { + Host: "0.0.0.0", + Port: 443, + Logger: WEBrick::Log::new($stderr, WEBrick::Log::DEBUG), + SSLEnable: true, + SSLVerifyClient: OpenSSL::SSL::VERIFY_NONE, + SSLCertificate: OpenSSL::X509::Certificate.new(File.read("/acceptance/github-server/ssl.crt")), + SSLPrivateKey: OpenSSL::PKey::RSA.new(File.read("/acceptance/github-server/ssl.key")), + SSLCertName: [["CN", "github.fake"]] + } + + set :port => 443 + set :bind => "0.0.0.0" + BASE_DIR = "/tmp/github" TEAM_MAP_FILE = File.join(BASE_DIR, "team_map.json") @@ -405,4 +409,4 @@ def graphql_pending_query(query) end end -Rack::Handler::WEBrick.run FakeGitHubApi, **webrick_options +FakeGitHubApi.run! From 07dcaa437781e58e0490f17f87dd647437ce7bc7 Mon Sep 17 00:00:00 2001 From: Jason Macgowan <1389531+jasonmacgowan@users.noreply.github.com> Date: Wed, 18 Dec 2024 16:13:52 -0500 Subject: [PATCH 5/9] fix github-server? --- spec/acceptance/github-server/web.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/acceptance/github-server/web.rb b/spec/acceptance/github-server/web.rb index 96e9793..5b8ea92 100644 --- a/spec/acceptance/github-server/web.rb +++ b/spec/acceptance/github-server/web.rb @@ -21,8 +21,8 @@ class FakeGitHubApi < Sinatra::Base SSLCertName: [["CN", "github.fake"]] } - set :port => 443 - set :bind => "0.0.0.0" + set :port, 443 + set :bind, "0.0.0.0" BASE_DIR = "/tmp/github" From 8d7ad9e28463252c1439c3fa26a6dba1d3012cea Mon Sep 17 00:00:00 2001 From: Jason Macgowan <1389531+jasonmacgowan@users.noreply.github.com> Date: Wed, 18 Dec 2024 16:24:16 -0500 Subject: [PATCH 6/9] fix github-server? --- spec/acceptance/github-server/web.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/acceptance/github-server/web.rb b/spec/acceptance/github-server/web.rb index 5b8ea92..374bc27 100644 --- a/spec/acceptance/github-server/web.rb +++ b/spec/acceptance/github-server/web.rb @@ -23,6 +23,7 @@ class FakeGitHubApi < Sinatra::Base set :port, 443 set :bind, "0.0.0.0" + set :host_authorization, { permitted_hosts: [] } BASE_DIR = "/tmp/github" From 656246c8902a3bcdadbde8c7ad4cba576be85433 Mon Sep 17 00:00:00 2001 From: Jason Macgowan <1389531+jasonmacgowan@users.noreply.github.com> Date: Wed, 18 Dec 2024 16:39:50 -0500 Subject: [PATCH 7/9] fix github-server? --- spec/acceptance/github-server/web.rb | 5 ----- 1 file changed, 5 deletions(-) diff --git a/spec/acceptance/github-server/web.rb b/spec/acceptance/github-server/web.rb index 374bc27..8d61817 100644 --- a/spec/acceptance/github-server/web.rb +++ b/spec/acceptance/github-server/web.rb @@ -226,7 +226,6 @@ def graphql_pending_query(query) send :put, "/entitlements-app-acceptance/orgs/:role" do org_dir = File.join(BASE_DIR, "org", params["role"]) - request.body.rewind postdata = JSON.parse(request.body.read) Dir.glob(File.join(org_dir, "*")).each { |filename| FileUtils.rm_f(filename) } postdata["users"].each { |user| File.open(File.join(org_dir, user), "w") { |f| f.puts Time.now.to_s } } @@ -235,7 +234,6 @@ def graphql_pending_query(query) send :put, "/entitlements-app-acceptance/pending" do pending_dir = File.join(BASE_DIR, "pending") - request.body.rewind postdata = JSON.parse(request.body.read) Dir.glob(File.join(pending_dir, "*")).each { |filename| FileUtils.rm_f(filename) } postdata["users"].each { |user| File.open(File.join(pending_dir, user), "w") { |f| f.puts Time.now.to_s } } @@ -260,7 +258,6 @@ def graphql_pending_query(query) end send :post, "/graphql" do - request.body.rewind postdata = JSON.parse(request.body.read) query = postdata["query"] @@ -299,8 +296,6 @@ def graphql_pending_query(query) # Check for case sensitivity concerns halt 400 unless params["username"] == params["username"].downcase - # Pull out the role from the request body, halt if not provided. - request.body.rewind postdata = JSON.parse(request.body.read) halt 400 unless %[admin member].include?(postdata["role"]) From f912c4943c6c2064688baad47072720bb08429f5 Mon Sep 17 00:00:00 2001 From: Jason Macgowan <1389531+jasonmacgowan@users.noreply.github.com> Date: Wed, 18 Dec 2024 16:56:59 -0500 Subject: [PATCH 8/9] Revert "fix github-server?" This reverts commit 656246c8902a3bcdadbde8c7ad4cba576be85433. --- spec/acceptance/github-server/web.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec/acceptance/github-server/web.rb b/spec/acceptance/github-server/web.rb index 8d61817..374bc27 100644 --- a/spec/acceptance/github-server/web.rb +++ b/spec/acceptance/github-server/web.rb @@ -226,6 +226,7 @@ def graphql_pending_query(query) send :put, "/entitlements-app-acceptance/orgs/:role" do org_dir = File.join(BASE_DIR, "org", params["role"]) + request.body.rewind postdata = JSON.parse(request.body.read) Dir.glob(File.join(org_dir, "*")).each { |filename| FileUtils.rm_f(filename) } postdata["users"].each { |user| File.open(File.join(org_dir, user), "w") { |f| f.puts Time.now.to_s } } @@ -234,6 +235,7 @@ def graphql_pending_query(query) send :put, "/entitlements-app-acceptance/pending" do pending_dir = File.join(BASE_DIR, "pending") + request.body.rewind postdata = JSON.parse(request.body.read) Dir.glob(File.join(pending_dir, "*")).each { |filename| FileUtils.rm_f(filename) } postdata["users"].each { |user| File.open(File.join(pending_dir, user), "w") { |f| f.puts Time.now.to_s } } @@ -258,6 +260,7 @@ def graphql_pending_query(query) end send :post, "/graphql" do + request.body.rewind postdata = JSON.parse(request.body.read) query = postdata["query"] @@ -296,6 +299,8 @@ def graphql_pending_query(query) # Check for case sensitivity concerns halt 400 unless params["username"] == params["username"].downcase + # Pull out the role from the request body, halt if not provided. + request.body.rewind postdata = JSON.parse(request.body.read) halt 400 unless %[admin member].include?(postdata["role"]) From 31bc108e71eec6f7eb16e0d18fb0071abf9df971 Mon Sep 17 00:00:00 2001 From: Jason Macgowan <1389531+jasonmacgowan@users.noreply.github.com> Date: Wed, 18 Dec 2024 16:58:40 -0500 Subject: [PATCH 9/9] fix github-server! --- spec/acceptance/github-server/web.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/acceptance/github-server/web.rb b/spec/acceptance/github-server/web.rb index 374bc27..6ff3928 100644 --- a/spec/acceptance/github-server/web.rb +++ b/spec/acceptance/github-server/web.rb @@ -9,6 +9,8 @@ require "openssl" class FakeGitHubApi < Sinatra::Base + use Rack::RewindableInput::Middleware + set :server, %w[webrick] set :server_settings, { Host: "0.0.0.0",