From 4f29626e81ad401e8d39f5299be48b54f4a200b7 Mon Sep 17 00:00:00 2001 From: Eric Boehs Date: Fri, 10 Jan 2025 12:36:04 -0600 Subject: [PATCH] revert: restore faraday version to 2.12 (#20228) Original PR: https://github.com/department-of-veterans-affairs/vets-api/pull/19978 Revert PR: https://github.com/department-of-veterans-affairs/vets-api/pull/20141 This reverts a previous commit that downgraded the Faraday gem to version 2.10 due to test failures. We believe that was a false alarm and was actually just flaky tests. --- .github/CODEOWNERS | 1 + Gemfile | 2 +- Gemfile.lock | 13 ++++---- config/settings.yml | 4 +-- .../support/helpers/iam_session_helper.rb | 8 ----- spec/fixtures/iam_ssoe/oauth.crt | 31 +++++++++++++++++++ spec/fixtures/iam_ssoe/oauth.key | 28 +++++++++++++++++ spec/lib/iam_ssoe_oauth/service_spec.rb | 6 ---- .../iam_ssoe_oauth/session_manager_spec.rb | 6 ---- 9 files changed, 70 insertions(+), 29 deletions(-) create mode 100644 spec/fixtures/iam_ssoe/oauth.crt create mode 100644 spec/fixtures/iam_ssoe/oauth.key diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 8057ce93c38..ff83414787f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1308,6 +1308,7 @@ spec/fixtures/fhir @department-of-veterans-affairs/vfs-vaos @department-of-veter spec/fixtures/files @department-of-veterans-affairs/Disability-Experience @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group spec/fixtures/hca @department-of-veterans-affairs/vfs-authenticated-experience-backend @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group spec/fixtures/form1010_ezr @department-of-veterans-affairs/vfs-10-10 @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group +spec/fixtures/iam_ssoe @department-of-veterans-affairs/octo-identity spec/fixtures/identity_dashboard @department-of-veterans-affairs/octo-identity spec/fixtures/idme @department-of-veterans-affairs/octo-identity spec/fixtures/json/detailed_schema_errors_schema.json @department-of-veterans-affairs/lighthouse-banana-peels @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group diff --git a/Gemfile b/Gemfile index 47d47e0ae3c..1e0079286cc 100644 --- a/Gemfile +++ b/Gemfile @@ -69,7 +69,7 @@ gem 'dogstatsd-ruby' gem 'dry-struct' gem 'dry-types' gem 'ethon', '>=0.13.0' -gem 'faraday', '~> 2.10' +gem 'faraday', '~> 2.12' gem 'faraday-follow_redirects' gem 'faraday-httpclient' gem 'faraday-multipart' diff --git a/Gemfile.lock b/Gemfile.lock index 887b9cb1b0d..686b1eb1f2d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -435,8 +435,9 @@ GEM railties (>= 5.0.0) faker (3.5.1) i18n (>= 1.8.11, < 2) - faraday (2.10.1) - faraday-net_http (>= 2.0, < 3.2) + faraday (2.12.2) + faraday-net_http (>= 2.0, < 3.5) + json logger faraday-follow_redirects (0.3.0) faraday (>= 1, < 3) @@ -446,8 +447,8 @@ GEM httpclient (>= 2.2) faraday-multipart (1.1.0) multipart-post (~> 2.0) - faraday-net_http (3.1.1) - net-http + faraday-net_http (3.4.0) + net-http (>= 0.5.0) faraday-retry (2.2.1) faraday (~> 2.0) faraday-typhoeus (1.1.0) @@ -648,7 +649,7 @@ GEM ffi-compiler (~> 1.0) rake (~> 13.0) lockbox (2.0.1) - logger (1.6.4) + logger (1.6.5) loofah (2.23.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -1198,7 +1199,7 @@ DEPENDENCIES facilities_api! factory_bot_rails faker - faraday (~> 2.10) + faraday (~> 2.12) faraday-follow_redirects faraday-httpclient faraday-multipart diff --git a/config/settings.yml b/config/settings.yml index 32f6b5eca5f..c7830322354 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -813,8 +813,8 @@ sentry: dsn: ~ iam_ssoe: - client_cert_path: ~ - client_key_path: ~ + client_cert_path: spec/fixtures/iam_ssoe/oauth.crt + client_key_path: spec/fixtures/iam_ssoe/oauth.key client_id: "Mobile_App_API_Server_LOWERS" # oauth (rest) and sts (soap) services are on different hosts oauth_url: "https://int.fed.eauth.va.gov:444" diff --git a/modules/mobile/spec/support/helpers/iam_session_helper.rb b/modules/mobile/spec/support/helpers/iam_session_helper.rb index 1848b630345..b00e46d1205 100644 --- a/modules/mobile/spec/support/helpers/iam_session_helper.rb +++ b/modules/mobile/spec/support/helpers/iam_session_helper.rb @@ -24,12 +24,6 @@ def iam_headers_no_camel(additional_headers = nil) headers end - def stub_iam_certs - allow(IAMSSOeOAuth::Configuration.instance).to receive_messages( - ssl_cert: instance_double(OPENSSL_X509_CERTIFICATE), ssl_key: instance_double(OPENSSL_PKEY_RSA) - ) - end - def iam_sign_in(iam_user = FactoryBot.build(:iam_user), access_token = nil) token = access_token || DEFAULT_ACCESS_TOKEN IAMUser.create(iam_user) @@ -42,11 +36,9 @@ def iam_sign_in(iam_user = FactoryBot.build(:iam_user), access_token = nil) config.before :each, type: :request do Flipper.enable('va_online_scheduling') - stub_iam_certs end config.before :each, type: :controller do Flipper.enable('va_online_scheduling') - stub_iam_certs end end diff --git a/spec/fixtures/iam_ssoe/oauth.crt b/spec/fixtures/iam_ssoe/oauth.crt new file mode 100644 index 00000000000..1712308174a --- /dev/null +++ b/spec/fixtures/iam_ssoe/oauth.crt @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFUzCCBDugAwIBAgIHPQAAAACD1zANBgkqhkiG9w0BAQsFADBIMRMwEQYKCZIm +iZPyLGQBGRYDZ292MRIwEAYKCZImiZPyLGQBGRYCdmExHTAbBgNVBAMTFFZBLUlu +dGVybmFsLVMyLUlDQTExMB4XDTI0MDIyMzE4NDA1NloXDTI1MDMxODE4NDA1Nlow +gYkxCzAJBgNVBAYTAlVTMQ0wCwYDVQQIEwRELkMuMRMwEQYDVQQHEwpXYXNoaW5n +dG9uMSwwKgYDVQQKEyNVLlMuIERlcGFydG1lbnQgb2YgVmV0ZXJhbnMgQWZmYWly +czEoMCYGA1UEAxMfc2lnbi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GCCsGAQUFBwMCMCcGCSsG +AQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwDQYJKoZIhvcNAQEL +BQADggEBADyXXS17hGBd8dp6hGo+CUeuShO2s38uKRt5HcbZorTOzfWUfHo/l7a1 +czhb2ZOdapQopUvt0rdvFZzoVcrdcx8bfrn971RZ57g5R+g6rqTalYIZwqWa1c81 +MyXbCXwsqYbhjfU0nZLE6H5CFRU9sx/5deCMUJPqHHb9lh9OCacoY97DaDRw1BvE +GK/h4/XvmLzI61A7dQUkRiKlqjc09waxgkcOB78fZvSYpMAgh5myYjNeCpcJal2F ++Ljd1vn51+QpoXaZnM8A/cBDNrQo90f9CrXRFQYmFUnCK9QfPgurmDQ0p6bUDr0X +s3LksgSsEbwk1mQLkLPnEvgstmoXOVA= +-----END CERTIFICATE----- diff --git a/spec/fixtures/iam_ssoe/oauth.key b/spec/fixtures/iam_ssoe/oauth.key new file mode 100644 index 00000000000..a39740e275d --- /dev/null +++ b/spec/fixtures/iam_ssoe/oauth.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC66ik9bMKUR6l7 +l84Ui8QfvQM0xp5qmDo4Tfv98/+H7JTvsisFiGDkgPh0IWJA9yqrZxJcljr4Xy+W +B8YtLujwI6IIpAVWs8dgmS4HLxwuMKblpXutczORpRp1v/lb8avr+onbsYBGAupJ +CVzGF15cbRgYULnEVHJwWfyFpZXk4EVW0HvRkASKcSLAwqXfE8Rb6p8P5p1gFAuo +MH+dj3/cWbkV8o1RQE71NmPmE81xCFkWhEN41vxEJYDyi6h20DGrjuY4fzeKak81 +1uEZrvBmx1A4F/Psv+u57mZqtK9aSm+u5N04xo+gRjLWnSzgUhlchCz24/zKbwA7 +69olE3L5AgMBAAECggEABiEJiycW1k/nQdM/gbL3kmbbRQ7CQRKOzivYeIJYvbdH +RvjbqknHi5ajDwPNOf4g2w/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h1l9fIwS/ +hA+wQ1jAvkDffTYrkkTCMhA6gJhd4LJpApXg5U0XO5uhlibMZEOIlTmXzLW30wB2 +/ZtxYyyRdgfjyjauRWdgmUQ= +-----END PRIVATE KEY----- diff --git a/spec/lib/iam_ssoe_oauth/service_spec.rb b/spec/lib/iam_ssoe_oauth/service_spec.rb index 282c6260402..a74643a89ec 100644 --- a/spec/lib/iam_ssoe_oauth/service_spec.rb +++ b/spec/lib/iam_ssoe_oauth/service_spec.rb @@ -6,12 +6,6 @@ describe 'IAMSSOeOAuth::Service' do let(:service) { IAMSSOeOAuth::Service.new } - before do - allow(IAMSSOeOAuth::Configuration.instance).to receive_messages( - ssl_cert: instance_double('OpenSSL::X509::Certificate'), ssl_key: instance_double('OpenSSL::PKey::RSA') - ) - end - describe '#post_introspect' do context 'with an active user response' do let(:response) do diff --git a/spec/lib/iam_ssoe_oauth/session_manager_spec.rb b/spec/lib/iam_ssoe_oauth/session_manager_spec.rb index 354f9c22f21..b377a07d3e5 100644 --- a/spec/lib/iam_ssoe_oauth/session_manager_spec.rb +++ b/spec/lib/iam_ssoe_oauth/session_manager_spec.rb @@ -7,12 +7,6 @@ let(:access_token) { 'ypXeAwQedpmAy5xFD2u5' } let(:session_manager) { IAMSSOeOAuth::SessionManager.new(access_token) } - before do - allow(IAMSSOeOAuth::Configuration.instance).to receive_messages( - ssl_cert: instance_double('OpenSSL::X509::Certificate'), ssl_key: instance_double('OpenSSL::PKey::RSA') - ) - end - describe '#find_or_create_user' do context 'with a valid access token' do before do