From 6523e01abea907d01a7ecd0b0f9c19ab8e7d3597 Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 3 Jun 2024 10:39:29 +0100 Subject: [PATCH] Updates Test environment (#719) * fix: Gemfile & Gemfile.lock to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-RUBY-RACK-1061917 * fix: Gemfile & Gemfile.lock to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-RUBY-RACK-1061917 * fix: Gemfile & Gemfile.lock to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-RUBY-ACTIONCABLE-20338 * fix: Gemfile & Gemfile.lock to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-RUBY-RACK-1061917 * Update .travis.yml Fix for the travis issue caused by drop of support for postgres appt package. * fix: Gemfile & Gemfile.lock to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-RUBY-RACK-1061917 * fix: Gemfile & Gemfile.lock to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-RUBY-RACK-1061917 * fix: Gemfile & Gemfile.lock to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-RUBY-RACK-1061917 * updated controller with registry check * fix rubocop * Added to org manag controller registry update * Updated registry Removed from controller registry update * GMBP-213: Add Dockerfile (Dev) (#659) * Dockerise app ready for migration * Add apt-get upgrade * Add && * Use the slim version of the base image * Fix Dockerfile * Fix Dockerfile * Try ubuntu:23.10, remove nodejs * Back to ubuntu 22.04 * Add user * Fix adding user rails * Fix user and group * Update Gemfile * Update Dockerfile * Switch to multi-stage build * Remove zlib1g from runtime * Move make jobs to right place * Switch to Alpine base, compile sqlite gem * Add comment about alpine and musl * Update comments * Use official ruby alpine image * Fix deprecation warning * Change branch to tag * Update test.rb * Update .ruby-version * Update Gemfile --------- Co-authored-by: mo-zag Co-authored-by: Andrew Hemming Co-authored-by: Andrew Hemming * Updated for cloud-watch (#688) * fix: Gemfile & Gemfile.lock to reduce vulnerabilities (#666) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-RUBY-RACK-1061917 Co-authored-by: snyk-bot Co-authored-by: mo-zag * [Snyk] Security upgrade rails from 7.1.2 to 7.1.3 (#672) * fix: Gemfile & Gemfile.lock to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-RUBY-RACK-1061917 * Update Gemfile.lock --------- Co-authored-by: snyk-bot Co-authored-by: mohammed Aziz * Spotlight API and Registry Update integration merge into develop branch (#697) * Updated manifest and travis Updated manifest and travis to map to testing env * Update .travis.yml * Update user.rb * vault-temp-fix-to-cf_vault.rb * Remove vault fix * Update auth.rb * Update manage_organisations_controller_spec.rb * Update remove_organisations_additional_identifier_controller_spec.rb * Update update_organisations_controller_spec.rb * GMBP-213: Add Dockerfile (Staging/Test) (#674) * Updated for cloud-watch * Updated contact service for registry update * Some logging in contact service is down or not saved data * push to Cloud-watch logs Testing (#682) * Cloudwatch logs * fix logs Update to remove depandacy of ENV var. * Updated logging * removed RAILS_LOG_TO_STDOUT dependancy * Update aws_ssm.rb * Update aws_ssm.rb * Updated RAILS_LOG_TO_STDOUT * Update aws_ssm.rb * Create rollbar.rb * Revert "Update aws_ssm.rb" This reverts commit d48bcafda47986a34d9f3b98f6795e07536c35aa. * SF update * Removed contact api debug helpers. * Update contact_service.rb Stop pushing to Rollbar if 404 error * Update contact_service.rb * Update registry_update_controller.rb * Removed registry checker. * Update search_api.rb * Revert "Update search_api.rb" This reverts commit 9e5bdf45ba676665ee70b91d218f4448b57b464a. * Updated Registry checker * test callback for spotlight * New spotlight api integration. * Removed registry update from two controllers Can be put back when ready. * Updated code for rubocop issues * Update user.rb Removed logger info --------- Co-authored-by: ccsnareshkumar <66829713+ccsnareshkumar@users.noreply.github.com> Co-authored-by: Tom Co-authored-by: Iulia R Ionita Co-authored-by: Tom Berey Co-authored-by: ccsnareshk <90035996+ccsnareshk@users.noreply.github.com> Co-authored-by: Andrew Hemming * Update spotlight/search.rb (#698) * Update spotlight/search.rb Adds a conditional check to the spotlight API search to ensure only active organisations are returned when searching. * Update US-DUN-404123456.json Add missing field to stubs, for tests to pass. Also matches the external data. * Update US-DUN-34578904.json * Update US-DUN-444444440.json * Update US-DUN-505123456.json * Update US-DUN-606123456.json * Update US-DUN-707123456.json * Update US-DUN-808123456.json * Update US-DUN-901123456.json * Update US-DUN-909123456.json * Update US-DUN-011122333.json * Update US-DUN-101123456.json * Update US-DUN-111111111.json * Update US-DUN-111123456.json * Update US-DUN-220123456.json * Update US-DUN-222123456.json * Update US-DUN-222223456.json * Update US-DUN-303123456.json * Update search_api_additional_identifiers.rb (#699) * Debug spotlight issues (#700) * Update search_api_additional_identifiers.rb * Update search_api_additional_identifiers.rb * Update search.rb (#701) * Update search.rb (#702) * Fixing spotlight parameter issue and remove logging (#703) * Update search_api_additional_identifiers.rb * Update search.rb * Update search.rb (#704) * Update search.rb * spotlight-add-extra-logging-for-debug (#705) spotlight-add-extra-logging-for-debug * Update search.rb (#706) remove extra logging. rename param to what it should be. * Update search.rb (#707) * Fix Spotlight Issues & Remove Debug Logging (#708) Fixes remaining Spotlight issues, by accounting for where the external API returns a 200, even though the DnB API itself returns a negative response of 400 Bad Request, with no record/data. Removes any added logging that was used for debugging the above issues. * Update spotlight/search.rb Adjust the conditional requirements for returning a negative 404 response, based on external API messaging. * Update companies_house/search.rb (#709) Remove additional Identifier checking for DUNs, after the Primary Companies House Identifier has been found, (since Spotlight does not yet support this). * PPG-1127-Search-for-addition-identifiers-when-DUNs-Spotlight (#718) * Bump rdoc from 6.6.2 to 6.6.3.1 (#696) Bumps [rdoc](https://github.com/ruby/rdoc) from 6.6.2 to 6.6.3.1. - [Release notes](https://github.com/ruby/rdoc/releases) - [Changelog](https://github.com/ruby/rdoc/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rdoc/compare/v6.6.2...v6.6.3.1) --- updated-dependencies: - dependency-name: rdoc dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tom * fix: Gemfile & Gemfile.lock to reduce vulnerabilities (#717) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-RUBY-REXML-6861566 Co-authored-by: snyk-bot Co-authored-by: Tom * fix: Gemfile & Gemfile.lock to reduce vulnerabilities (#716) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-RUBY-ACTIONPACK-6274386 - https://snyk.io/vuln/SNYK-RUBY-ACTIONPACK-6274387 - https://snyk.io/vuln/SNYK-RUBY-NOKOGIRI-6228056 - https://snyk.io/vuln/SNYK-RUBY-RACK-1061917 - https://snyk.io/vuln/SNYK-RUBY-RACK-6274383 - https://snyk.io/vuln/SNYK-RUBY-RACK-6274384 - https://snyk.io/vuln/SNYK-RUBY-RACK-6274385 Co-authored-by: snyk-bot Co-authored-by: Tom * Bump rack-cors from 2.0.1 to 2.0.2 (#694) Bumps [rack-cors](https://github.com/cyu/rack-cors) from 2.0.1 to 2.0.2. - [Changelog](https://github.com/cyu/rack-cors/blob/master/CHANGELOG.md) - [Commits](https://github.com/cyu/rack-cors/compare/v2.0.1...v2.0.2) --- updated-dependencies: - dependency-name: rack-cors dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tom * Update application.rb (#673) Filter sensitive fields from logs Co-authored-by: Tom * Bump rack from 2.2.8 to 3.0.9.1 (#693) Bumps [rack](https://github.com/rack/rack) from 2.2.8 to 3.0.9.1. - [Release notes](https://github.com/rack/rack/releases) - [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md) - [Commits](https://github.com/rack/rack/compare/v2.2.8...v3.0.9.1) --- updated-dependencies: - dependency-name: rack dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tom * [Snyk] Security upgrade puma from 5.6.7 to 5.6.8 (#670) * fix: Gemfile & Gemfile.lock to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-RUBY-PUMA-6146928 * Update Gemfile.lock --------- Co-authored-by: snyk-bot Co-authored-by: mohammed Aziz Co-authored-by: Tom --------- Signed-off-by: dependabot[bot] Co-authored-by: snyk-bot Co-authored-by: mohammed Aziz Co-authored-by: mo-zag Co-authored-by: georges1996 <40758489+georges1996@users.noreply.github.com> Co-authored-by: Andrew Hemming Co-authored-by: Andrew Hemming Co-authored-by: cosborneCCS <57792536+cosborneCCS@users.noreply.github.com> Co-authored-by: ccs-wattsa Co-authored-by: ccsnareshkumar <66829713+ccsnareshkumar@users.noreply.github.com> Co-authored-by: Iulia R Ionita Co-authored-by: ccsnareshk <90035996+ccsnareshk@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: ccs-snyk <158492397+ccs-snyk@users.noreply.github.com> Co-authored-by: John Denford <63358032+johndenford@users.noreply.github.com> --- Gemfile | 14 +- Gemfile.lock | 358 +++++++++--------- .../search_api_additional_identifiers.rb | 1 - app/services/spotlight/search.rb | 17 +- config/application.rb | 1 + 5 files changed, 193 insertions(+), 198 deletions(-) diff --git a/Gemfile b/Gemfile index 371ebc4f..4dd2c17d 100644 --- a/Gemfile +++ b/Gemfile @@ -8,7 +8,7 @@ gem 'rails', '~> 7.1.3' # Use sqlite3 as the database for Active Record. When using Alpine, needs to be compiled from source using the musl C compiler. gem 'sqlite3', '~> 1.6', git: 'https://github.com/sparklemotion/sqlite3-ruby.git', tag: 'v1.6.5' # Use Puma as the app server -gem 'puma', '~> 5.6', '>= 5.6.7' +gem 'puma', '~> 6.0', '>= 6.0.0' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder # gem 'jbuilder', '~> 2.7' # Use Redis adapter to run Action Cable in production @@ -40,7 +40,7 @@ gem 'flog' # gem 'vault' # error logging gem 'rollbar' -gem 'webmock', '>= 3.12.1' +gem 'webmock', '>= 3.20.0' # aws ssm gem 'aws-sdk-ssm' @@ -51,12 +51,12 @@ group :development, :test do # gem 'spring-watcher-listen', '~> 2.0.0' gem 'byebug', platforms: %i[mri mingw x64_mingw] gem 'dotenv-rails', '>= 2.7.6' - gem 'i18n-tasks', '>= 1.0.13' + gem 'i18n-tasks', '>= 1.0.14' gem 'rspec-rails', '>= 6.0.4' - gem 'rubocop', '>= 1.12.0' - gem 'rubocop-performance', '>= 1.10.2' - gem 'rubocop-rails', '>= 2.21.1' - gem 'rubocop-rspec', '>= 2.2.0' # or gem 'rubocop-minitest' + gem 'rubocop', '>= 1.56.4' + gem 'rubocop-performance', '>= 1.19.1' + gem 'rubocop-rails', '>= 2.21.2' + gem 'rubocop-rspec', '>= 2.24.1' # or gem 'rubocop-minitest' gem 'brakeman' gem 'pry-rails' gem 'factory_bot_rails', '>= 6.4.3' diff --git a/Gemfile.lock b/Gemfile.lock index 595de0c1..acaf7c57 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,35 +9,35 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (7.1.3) - actionpack (= 7.1.3) - activesupport (= 7.1.3) + actioncable (7.1.3.3) + actionpack (= 7.1.3.3) + activesupport (= 7.1.3.3) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.3) - actionpack (= 7.1.3) - activejob (= 7.1.3) - activerecord (= 7.1.3) - activestorage (= 7.1.3) - activesupport (= 7.1.3) + actionmailbox (7.1.3.3) + actionpack (= 7.1.3.3) + activejob (= 7.1.3.3) + activerecord (= 7.1.3.3) + activestorage (= 7.1.3.3) + activesupport (= 7.1.3.3) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.1.3) - actionpack (= 7.1.3) - actionview (= 7.1.3) - activejob (= 7.1.3) - activesupport (= 7.1.3) + actionmailer (7.1.3.3) + actionpack (= 7.1.3.3) + actionview (= 7.1.3.3) + activejob (= 7.1.3.3) + activesupport (= 7.1.3.3) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.2) - actionpack (7.1.3) - actionview (= 7.1.3) - activesupport (= 7.1.3) + actionpack (7.1.3.3) + actionview (= 7.1.3.3) + activesupport (= 7.1.3.3) nokogiri (>= 1.8.5) racc rack (>= 2.2.4) @@ -45,38 +45,38 @@ GEM rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.1.3) - actionpack (= 7.1.3) - activerecord (= 7.1.3) - activestorage (= 7.1.3) - activesupport (= 7.1.3) + actiontext (7.1.3.3) + actionpack (= 7.1.3.3) + activerecord (= 7.1.3.3) + activestorage (= 7.1.3.3) + activesupport (= 7.1.3.3) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.3) - activesupport (= 7.1.3) + actionview (7.1.3.3) + activesupport (= 7.1.3.3) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.1.3) - activesupport (= 7.1.3) + activejob (7.1.3.3) + activesupport (= 7.1.3.3) globalid (>= 0.3.6) - activemodel (7.1.3) - activesupport (= 7.1.3) - activerecord (7.1.3) - activemodel (= 7.1.3) - activesupport (= 7.1.3) + activemodel (7.1.3.3) + activesupport (= 7.1.3.3) + activerecord (7.1.3.3) + activemodel (= 7.1.3.3) + activesupport (= 7.1.3.3) timeout (>= 0.4.0) - activerecord-postgis-adapter (9.0.0) + activerecord-postgis-adapter (9.0.2) activerecord (~> 7.1.0) rgeo-activerecord (~> 7.0.0) - activestorage (7.1.3) - actionpack (= 7.1.3) - activejob (= 7.1.3) - activerecord (= 7.1.3) - activesupport (= 7.1.3) + activestorage (7.1.3.3) + actionpack (= 7.1.3.3) + activejob (= 7.1.3.3) + activerecord (= 7.1.3.3) + activesupport (= 7.1.3.3) marcel (~> 1.0) - activesupport (7.1.3) + activesupport (7.1.3.3) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) @@ -86,52 +86,46 @@ GEM minitest (>= 5.1) mutex_m tzinfo (~> 2.0) - addressable (2.8.5) + addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) ast (2.4.2) - aws-eventstream (1.2.0) - aws-partitions (1.820.0) - aws-sdk-core (3.181.0) - aws-eventstream (~> 1, >= 1.0.2) + aws-eventstream (1.3.0) + aws-partitions (1.935.0) + aws-sdk-core (3.196.1) + aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) - aws-sigv4 (~> 1.5) + aws-sigv4 (~> 1.8) jmespath (~> 1, >= 1.6.1) - aws-sdk-ssm (1.156.0) - aws-sdk-core (~> 3, >= 3.177.0) + aws-sdk-ssm (1.169.0) + aws-sdk-core (~> 3, >= 3.193.0) aws-sigv4 (~> 1.1) - aws-sigv4 (1.6.0) + aws-sigv4 (1.8.0) aws-eventstream (~> 1, >= 1.0.2) - base64 (0.1.1) - better_html (2.0.2) - actionview (>= 6.0) - activesupport (>= 6.0) - ast (~> 2.0) - erubi (~> 1.4) - parser (>= 2.4) - smart_properties - bigdecimal (3.1.5) - bootsnap (1.16.0) + base64 (0.2.0) + bigdecimal (3.1.8) + bootsnap (1.18.3) msgpack (~> 1.2) - brakeman (6.0.1) + brakeman (6.1.2) + racc builder (3.2.4) byebug (11.1.3) coderay (1.1.3) concurrent-ruby (1.2.3) connection_pool (2.4.1) - crack (0.4.5) + crack (1.0.0) + bigdecimal rexml crass (1.0.6) date (3.3.4) - diff-lcs (1.5.0) + diff-lcs (1.5.1) docile (1.4.0) - dotenv (2.8.1) - dotenv-rails (2.8.1) - dotenv (= 2.8.1) - railties (>= 3.2) - drb (2.2.0) - ruby2_keywords + dotenv (3.1.2) + dotenv-rails (3.1.2) + dotenv (= 3.1.2) + railties (>= 6.1) + drb (2.2.1) erubi (1.12.0) - factory_bot (6.4.5) + factory_bot (6.4.6) activesupport (>= 5.0.0) factory_bot_rails (6.4.3) factory_bot (~> 6.4) @@ -151,7 +145,7 @@ GEM faraday-em_http (1.0.0) faraday-em_synchrony (1.0.0) faraday-excon (1.1.0) - faraday-http-cache (2.5.0) + faraday-http-cache (2.5.1) faraday (>= 0.8) faraday-httpclient (1.0.1) faraday-multipart (1.0.4) @@ -163,8 +157,8 @@ GEM faraday-retry (1.0.3) faraday_middleware (1.2.0) faraday (~> 1.0) - ffi (1.15.5) - flog (4.7.0) + ffi (1.16.3) + flog (4.8.0) path_expander (~> 1.0) ruby_parser (~> 3.1, > 3.1.0) sexp_processor (~> 4.8) @@ -174,18 +168,18 @@ GEM faraday (>= 1.0) faraday_middleware graphql-client - graphql (2.1.0) - graphql-client (0.18.0) + graphql (2.3.4) + base64 + graphql-client (0.22.0) activesupport (>= 3.0) - graphql - hashdiff (1.0.1) - highline (2.1.0) - i18n (1.14.1) + graphql (>= 1.13.0) + hashdiff (1.1.0) + highline (3.0.1) + i18n (1.14.5) concurrent-ruby (~> 1.0) - i18n-tasks (1.0.13) + i18n-tasks (1.0.14) activesupport (>= 4.0.2) ast (>= 2.1.0) - better_html (>= 1.0, < 3.0) erubi highline (>= 2.0.0) i18n @@ -193,15 +187,16 @@ GEM rails-i18n rainbow (>= 2.2.2, < 4.0) terminal-table (>= 1.5.1) - io-console (0.7.1) - irb (1.11.1) - rdoc + io-console (0.7.2) + irb (1.13.1) + rdoc (>= 4.0.0) reline (>= 0.4.2) jmespath (1.6.2) - json (2.6.3) - jwt (2.7.1) + json (2.7.2) + jwt (2.8.1) + base64 language_server-protocol (3.17.0.3) - listen (3.8.0) + listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) loofah (2.22.0) @@ -212,38 +207,38 @@ GEM net-imap net-pop net-smtp - marcel (1.0.2) - method_source (1.0.0) + marcel (1.0.4) + method_source (1.1.0) mini_mime (1.1.5) - mini_portile2 (2.8.5) - minitest (5.21.1) + mini_portile2 (2.8.6) + minitest (5.23.1) msgpack (1.7.2) multi_json (1.15.0) - multipart-post (2.3.0) + multipart-post (2.4.1) mutex_m (0.2.0) - net-imap (0.4.9.1) + net-imap (0.4.11) date net-protocol net-pop (0.1.2) net-protocol net-protocol (0.2.2) timeout - net-smtp (0.4.0.1) + net-smtp (0.5.0) net-protocol - nio4r (2.7.0) - nokogiri (1.16.0-x86_64-darwin) + nio4r (2.7.3) + nokogiri (1.16.5-x86_64-darwin) racc (~> 1.4) - nokogiri (1.16.0-x86_64-linux) + nokogiri (1.16.5-x86_64-linux) racc (~> 1.4) olive_branch (4.0.1) multi_json rails (>= 4.0) - parallel (1.23.0) - parser (3.2.2.4) + parallel (1.24.0) + parser (3.3.1.0) ast (~> 2.4.1) racc path_expander (1.1.1) - pg (1.5.4) + pg (1.5.6) pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) @@ -251,34 +246,34 @@ GEM pry (>= 0.10.4) psych (5.1.2) stringio - public_suffix (5.0.3) - puma (5.6.7) + public_suffix (5.0.5) + puma (6.4.2) nio4r (~> 2.0) - racc (1.7.3) - rack (2.2.8) - rack-cors (2.0.1) + racc (1.8.0) + rack (3.0.11) + rack-cors (2.0.2) rack (>= 2.0.0) - rack-session (1.0.2) - rack (< 3) + rack-session (2.0.0) + rack (>= 3.0.0) rack-test (2.1.0) rack (>= 1.3) - rackup (1.0.0) - rack (< 3) - webrick - rails (7.1.3) - actioncable (= 7.1.3) - actionmailbox (= 7.1.3) - actionmailer (= 7.1.3) - actionpack (= 7.1.3) - actiontext (= 7.1.3) - actionview (= 7.1.3) - activejob (= 7.1.3) - activemodel (= 7.1.3) - activerecord (= 7.1.3) - activestorage (= 7.1.3) - activesupport (= 7.1.3) + rackup (2.1.0) + rack (>= 3) + webrick (~> 1.8) + rails (7.1.3.3) + actioncable (= 7.1.3.3) + actionmailbox (= 7.1.3.3) + actionmailer (= 7.1.3.3) + actionpack (= 7.1.3.3) + actiontext (= 7.1.3.3) + actionview (= 7.1.3.3) + activejob (= 7.1.3.3) + activemodel (= 7.1.3.3) + activerecord (= 7.1.3.3) + activestorage (= 7.1.3.3) + activesupport (= 7.1.3.3) bundler (>= 1.15.0) - railties (= 7.1.3) + railties (= 7.1.3.3) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -286,39 +281,39 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - rails-i18n (7.0.8) + rails-i18n (7.0.9) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (7.1.3) - actionpack (= 7.1.3) - activesupport (= 7.1.3) + railties (7.1.3.3) + actionpack (= 7.1.3.3) + activesupport (= 7.1.3.3) irb rackup (>= 1.0.0) rake (>= 12.2) thor (~> 1.0, >= 1.2.2) zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.1.0) + rake (13.2.1) rb-fsevent (0.11.2) - rb-inotify (0.10.1) + rb-inotify (0.11.1) ffi (~> 1.0) - rdoc (6.6.2) + rdoc (6.7.0) psych (>= 4.0.0) - redis (5.0.7) - redis-client (>= 0.9.0) - redis-actionpack (5.3.0) + redis (5.2.0) + redis-client (>= 0.22.0) + redis-actionpack (5.4.0) actionpack (>= 5, < 8) - redis-rack (>= 2.1.0, < 3) + redis-rack (>= 2.1.0, < 4) redis-store (>= 1.1.0, < 2) redis-activesupport (5.3.0) activesupport (>= 3, < 8) redis-store (>= 1.3, < 2) - redis-client (0.17.0) + redis-client (0.22.2) connection_pool redis-namespace (1.11.0) redis (>= 4) - redis-rack (2.1.4) - rack (>= 2.0.8, < 3) + redis-rack (3.0.0) + rack-session (>= 0.2.0) redis-store (>= 1.2, < 2) redis-rails (5.0.2) redis-actionpack (>= 5.0, < 6) @@ -326,84 +321,89 @@ GEM redis-store (>= 1.2, < 2) redis-store (1.10.0) redis (>= 4, < 6) - regexp_parser (2.8.1) - reline (0.4.2) + regexp_parser (2.9.2) + reline (0.5.7) io-console (~> 0.5) - rexml (3.2.6) - rgeo (3.0.0) + rexml (3.2.8) + strscan (>= 3.0.9) + rgeo (3.0.1) rgeo-activerecord (7.0.1) activerecord (>= 5.0) rgeo (>= 1.0.0) - rollbar (3.4.0) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) + rollbar (3.5.2) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.6) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-rails (6.1.0) + rspec-support (~> 3.13.0) + rspec-rails (6.1.2) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) - rspec-core (~> 3.12) - rspec-expectations (~> 3.12) - rspec-mocks (~> 3.12) - rspec-support (~> 3.12) - rspec-support (3.12.1) - rubocop (1.56.3) - base64 (~> 0.1.1) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.1) + rubocop (1.64.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.2.3) + 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.28.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.29.0) - parser (>= 3.2.1.0) - rubocop-capybara (2.18.0) + rubocop-ast (1.31.3) + parser (>= 3.3.1.0) + rubocop-capybara (2.20.0) + rubocop (~> 1.41) + rubocop-factory_bot (2.25.1) rubocop (~> 1.41) - rubocop-factory_bot (2.23.1) - rubocop (~> 1.33) - rubocop-performance (1.19.0) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) - rubocop-rails (2.21.1) + rubocop-performance (1.21.0) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.25.0) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) - rubocop-rspec (2.24.0) - rubocop (~> 1.33) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rspec (2.29.2) + rubocop (~> 1.40) rubocop-capybara (~> 2.17) rubocop-factory_bot (~> 2.22) + rubocop-rspec_rails (~> 2.28) + rubocop-rspec_rails (2.28.3) + rubocop (~> 1.40) ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) - ruby_parser (3.20.3) + ruby_parser (3.21.0) + racc (~> 1.5) sexp_processor (~> 4.16) - sexp_processor (4.17.0) + sexp_processor (4.17.1) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) - smart_properties (1.17.0) stringio (3.1.0) + strscan (3.1.0) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - thor (1.3.0) + thor (1.3.1) timeout (0.4.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) tzinfo-data (1.2024.1) tzinfo (>= 1.0.0) unicode-display_width (2.5.0) - webmock (3.19.1) + webmock (3.23.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) @@ -411,7 +411,7 @@ GEM websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - zeitwerk (2.6.12) + zeitwerk (2.6.15) PLATFORMS x86_64-darwin-21 @@ -430,13 +430,13 @@ DEPENDENCIES faraday_middleware flog graphlient - i18n-tasks (>= 1.0.13) + i18n-tasks (>= 1.0.14) jwt listen (~> 3.2) olive_branch (>= 4.0.1) pg pry-rails - puma (~> 5.6, >= 5.6.7) + puma (~> 6.0, >= 6.0.0) rack-cors rails (~> 7.1.3) redis @@ -444,14 +444,14 @@ DEPENDENCIES redis-rails (>= 5.0.2) rollbar rspec-rails (>= 6.0.4) - rubocop (>= 1.12.0) - rubocop-performance (>= 1.10.2) - rubocop-rails (>= 2.21.1) - rubocop-rspec (>= 2.2.0) + rubocop (>= 1.56.4) + rubocop-performance (>= 1.19.1) + rubocop-rails (>= 2.21.2) + rubocop-rspec (>= 2.24.1) simplecov sqlite3 (~> 1.6)! tzinfo-data - webmock (>= 3.12.1) + webmock (>= 3.20.0) RUBY VERSION ruby 3.2.2p53 diff --git a/app/services/search_api_additional_identifiers.rb b/app/services/search_api_additional_identifiers.rb index e5397c00..48575946 100644 --- a/app/services/search_api_additional_identifiers.rb +++ b/app/services/search_api_additional_identifiers.rb @@ -14,7 +14,6 @@ def call when Common::AdditionalIdentifier::SCHEME_ENG_WALES_CHARITY, Common::AdditionalIdentifier::SCHEME_NORTHEN_IRELAND_CHARITY, Common::AdditionalIdentifier::SCHEME_SCOTISH_CHARITY @result = get_charity_additional(@organisation_id, @scheme_id) when Common::AdditionalIdentifier::SCHEME_DANDB - # @result = get_duns_additional(@organisation_id) @result = get_spotlight_additional(@organisation_id, @scheme_id) end diff --git a/app/services/spotlight/search.rb b/app/services/spotlight/search.rb index 915f91ea..431d1ab7 100644 --- a/app/services/spotlight/search.rb +++ b/app/services/spotlight/search.rb @@ -71,23 +71,18 @@ def build_response { name: name, identifier: Spotlight::Indentifier.new(@result).build_response, - additionalIdentifiers: filter_additional_indentifiers, + additionalIdentifiers: additional_identifiers, address: Spotlight::Address.new(@result).build_response, contactPoint: Spotlight::Contact.new(@result).build_response } end def additional_identifiers - additional_identifiers_links if Common::ApiHelper.exists_or_null(@result['CompaniesHouseNumber']).present? - end - - def additional_identifiers_links - @additional_indentifers_list.concat(Common::AdditionalIdentifier.new.filter_dandb_ids(@result, @id_number)) - end - - def filter_additional_indentifiers - additional_identifiers - @additional_indentifers_list.uniq { |identifier| identifier[:id] } + additional_identifiers_list = [] + additional_identifiers_list << SearchApiAdditionalIdentifiers.new(@result['CompaniesHouseNumber'], Common::AdditionalIdentifier::SCHEME_COMPANIES_HOUSE).call if Common::ApiHelper.exists_or_null(@result['CompaniesHouseNumber']).present? + additional_identifiers_list << SearchApiAdditionalIdentifiers.new(@result['CharityCommissionforEnglandandWales'], Common::AdditionalIdentifier::SCHEME_ENG_WALES_CHARITY).call if Common::ApiHelper.exists_or_null(@result['CharityCommissionforEnglandandWales']).present? + additional_identifiers_list << SearchApiAdditionalIdentifiers.new(@result['CharityCommissionforNorthernIreland'], Common::AdditionalIdentifier::SCHEME_NORTHEN_IRELAND_CHARITY).call if Common::ApiHelper.exists_or_null(@result['CharityCommissionforNorthernIreland']).present? + additional_identifiers_list end def name diff --git a/config/application.rb b/config/application.rb index abda9042..d7d886d7 100644 --- a/config/application.rb +++ b/config/application.rb @@ -38,5 +38,6 @@ class Application < Rails::Application # Convert all keys to camelCase config.middleware.use OliveBranch::Middleware, inflection: 'camel' + config.filter_parameters += [:api_key] end end