From d35042a1be225b51887bd2918b63c6f87dcb69d6 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Mon, 4 Jan 2021 18:30:20 +0500 Subject: [PATCH 01/55] Add test to check if Whois::Record saved --- test/models/domain/releasable/auctionable_test.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/models/domain/releasable/auctionable_test.rb b/test/models/domain/releasable/auctionable_test.rb index de3ac0ff6..bb0485f7d 100644 --- a/test/models/domain/releasable/auctionable_test.rb +++ b/test/models/domain/releasable/auctionable_test.rb @@ -58,6 +58,20 @@ class DomainReleasableAuctionableTest < ActiveSupport::TestCase end end + def test_updates_whois + @domain.update!(delete_date: '2010-07-04') + travel_to Time.zone.parse('2010-07-05') + + Domain.release_domains + + whois_record = Whois::Record.find_by(name: @domain.name) + + json = { "name"=>@domain.name, + "status"=>["AtAuction"], + "disclaimer"=> Setting.registry_whois_disclaimer } + assert_equal whois_record.json, json + end + def test_notifies_registrar @domain.update!(delete_date: '2010-07-04') travel_to Time.zone.parse('2010-07-05') From 0c5ef72c7da90a02d6d4ce370e5a78cf47046b12 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Tue, 5 Jan 2021 14:58:01 +0500 Subject: [PATCH 02/55] Add logging & domain lock on release --- app/models/concerns/domain/releasable.rb | 10 +++++++++- app/models/concerns/to_stdout.rb | 8 ++++++++ app/models/dns/domain_name.rb | 5 ++++- app/models/whois/record.rb | 6 ++++++ test/models/domain/releasable/auctionable_test.rb | 4 +++- 5 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 app/models/concerns/to_stdout.rb diff --git a/app/models/concerns/domain/releasable.rb b/app/models/concerns/domain/releasable.rb index 4aa5faa58..12a182b65 100644 --- a/app/models/concerns/domain/releasable.rb +++ b/app/models/concerns/domain/releasable.rb @@ -39,9 +39,12 @@ module Concerns def release if release_to_auction - transaction do + with_lock do + to_stdout "Checking if domain_name is auctionable: #{domain_name.auctionable?}" domain_name.sell_at_auction if domain_name.auctionable? + to_stdout 'Destroying domain' destroy! + to_stdout 'Sending registrar notification' registrar.notifications.create!(text: "#{I18n.t(:domain_deleted)}: #{name}", attached_obj_id: id, attached_obj_type: self.class) @@ -50,6 +53,11 @@ module Concerns discard end end + + def to_stdout(message) + time = Time.zone.now.utc + STDOUT << "#{time} - #{message}\n" unless Rails.env.test? + end end end end diff --git a/app/models/concerns/to_stdout.rb b/app/models/concerns/to_stdout.rb new file mode 100644 index 000000000..2a01ee668 --- /dev/null +++ b/app/models/concerns/to_stdout.rb @@ -0,0 +1,8 @@ +module ToStdout + extend ActiveSupport::Concern + + def to_stdout(message) + time = Time.zone.now.utc + STDOUT << "#{time} - #{message}\n" unless Rails.env.test? + end +end diff --git a/app/models/dns/domain_name.rb b/app/models/dns/domain_name.rb index c1af4d5e7..0daa7bbae 100644 --- a/app/models/dns/domain_name.rb +++ b/app/models/dns/domain_name.rb @@ -2,6 +2,7 @@ module DNS # Namespace is needed, because a class with the same name is defined by `domain_name` gem, # a dependency of `actionmailer`, class DomainName + include ToStdout def initialize(name) @name = name end @@ -36,6 +37,7 @@ module DNS auction = Auction.new auction.domain = name auction.start + to_stdout "Created the auction: #{auction.inspect}" update_whois_from_auction(auction) end @@ -100,7 +102,8 @@ module DNS whois_record = Whois::Record.find_or_create_by!(name: name) do |record| record.json = {} end - + to_stdout "Starting to update WHOIS record #{whois_record.inspect}\n\n"\ + "from auction #{auction.inspect}" whois_record.update_from_auction(auction) end end diff --git a/app/models/whois/record.rb b/app/models/whois/record.rb index 1d827e22a..b4f70c28f 100644 --- a/app/models/whois/record.rb +++ b/app/models/whois/record.rb @@ -1,24 +1,30 @@ module Whois class Record < Whois::Server + include ToStdout self.table_name = 'whois_records' def self.disclaimer Setting.registry_whois_disclaimer end + # rubocop:disable Metrics/AbcSize def update_from_auction(auction) if auction.started? update!(json: { name: auction.domain, status: ['AtAuction'], disclaimer: self.class.disclaimer }) + to_stdout "Updated from auction WHOIS record #{inspect}" elsif auction.no_bids? + to_stdout "Destroying WHOIS record #{inspect}" destroy! elsif auction.awaiting_payment? || auction.payment_received? update!(json: { name: auction.domain, status: ['PendingRegistration'], disclaimer: self.class.disclaimer, registration_deadline: auction.whois_deadline }) + to_stdout "Updated from auction WHOIS record #{inspect}" end end + # rubocop:enable Metrics/AbcSize end end diff --git a/test/models/domain/releasable/auctionable_test.rb b/test/models/domain/releasable/auctionable_test.rb index bb0485f7d..a74f41c90 100644 --- a/test/models/domain/releasable/auctionable_test.rb +++ b/test/models/domain/releasable/auctionable_test.rb @@ -25,6 +25,7 @@ class DomainReleasableAuctionableTest < ActiveSupport::TestCase def test_skips_auction_when_domains_is_blocked assert_equal 'shop.test', @domain.name blocked_domains(:one).update!(name: 'shop.test') + @domain.save!(validate: false) @domain.release @@ -34,6 +35,7 @@ class DomainReleasableAuctionableTest < ActiveSupport::TestCase def test_skips_auction_when_domains_is_reserved assert_equal 'shop.test', @domain.name reserved_domains(:one).update!(name: 'shop.test') + @domain.save!(validate: false) @domain.release @@ -58,7 +60,7 @@ class DomainReleasableAuctionableTest < ActiveSupport::TestCase end end - def test_updates_whois + def test_updates_whois_server @domain.update!(delete_date: '2010-07-04') travel_to Time.zone.parse('2010-07-05') From b60a7e571f01ee941780af8a90a8dc426b3aa04e Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Tue, 5 Jan 2021 17:21:13 +0500 Subject: [PATCH 03/55] Delete original WhoisRecord after domain deletion --- app/models/concerns/domain/releasable.rb | 20 +++++++++---------- app/models/domain.rb | 2 +- .../domain/releasable/auctionable_test.rb | 6 +++++- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/app/models/concerns/domain/releasable.rb b/app/models/concerns/domain/releasable.rb index 12a182b65..b800a4aa5 100644 --- a/app/models/concerns/domain/releasable.rb +++ b/app/models/concerns/domain/releasable.rb @@ -39,16 +39,16 @@ module Concerns def release if release_to_auction - with_lock do - to_stdout "Checking if domain_name is auctionable: #{domain_name.auctionable?}" - domain_name.sell_at_auction if domain_name.auctionable? - to_stdout 'Destroying domain' - destroy! - to_stdout 'Sending registrar notification' - registrar.notifications.create!(text: "#{I18n.t(:domain_deleted)}: #{name}", - attached_obj_id: id, - attached_obj_type: self.class) - end + lock! + to_stdout 'Destroying domain' + destroy! + to_stdout "Checking if domain_name is auctionable: #{domain_name.auctionable?}" + domain_name.sell_at_auction if domain_name.auctionable? + + to_stdout 'Sending registrar notification' + registrar.notifications.create!(text: "#{I18n.t(:domain_deleted)}: #{name}", + attached_obj_id: id, + attached_obj_type: self.class) else discard end diff --git a/app/models/domain.rb b/app/models/domain.rb index 49f18d9db..589a0b661 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -78,7 +78,7 @@ class Domain < ApplicationRecord true end - after_commit :update_whois_record, unless: -> { domain_name.at_auction? } + after_commit :update_whois_record after_create :update_reserved_domains def update_reserved_domains diff --git a/test/models/domain/releasable/auctionable_test.rb b/test/models/domain/releasable/auctionable_test.rb index a74f41c90..d24f46913 100644 --- a/test/models/domain/releasable/auctionable_test.rb +++ b/test/models/domain/releasable/auctionable_test.rb @@ -63,11 +63,15 @@ class DomainReleasableAuctionableTest < ActiveSupport::TestCase def test_updates_whois_server @domain.update!(delete_date: '2010-07-04') travel_to Time.zone.parse('2010-07-05') + old_whois = @domain.whois_record Domain.release_domains - whois_record = Whois::Record.find_by(name: @domain.name) + assert_raises ActiveRecord::RecordNotFound do + old_whois.reload + end + whois_record = Whois::Record.find_by(name: @domain.name) json = { "name"=>@domain.name, "status"=>["AtAuction"], "disclaimer"=> Setting.registry_whois_disclaimer } From 217f009fa3443cfe817ea6a9f72f479ba45677b8 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Wed, 6 Jan 2021 12:09:03 +0500 Subject: [PATCH 04/55] Small logic fixes --- app/models/concerns/domain/releasable.rb | 6 ------ app/models/domain.rb | 1 + 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/app/models/concerns/domain/releasable.rb b/app/models/concerns/domain/releasable.rb index b800a4aa5..51e1a6f1c 100644 --- a/app/models/concerns/domain/releasable.rb +++ b/app/models/concerns/domain/releasable.rb @@ -39,7 +39,6 @@ module Concerns def release if release_to_auction - lock! to_stdout 'Destroying domain' destroy! to_stdout "Checking if domain_name is auctionable: #{domain_name.auctionable?}" @@ -53,11 +52,6 @@ module Concerns discard end end - - def to_stdout(message) - time = Time.zone.now.utc - STDOUT << "#{time} - #{message}\n" unless Rails.env.test? - end end end end diff --git a/app/models/domain.rb b/app/models/domain.rb index 589a0b661..34a8c26ff 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -10,6 +10,7 @@ class Domain < ApplicationRecord include Concerns::Domain::RegistryLockable include Concerns::Domain::Releasable include Concerns::Domain::Disputable + include ToStdout attr_accessor :roles From 1d5c46e6a09f6ed96f9b28725de9629b01c08d99 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Wed, 6 Jan 2021 15:33:02 +0500 Subject: [PATCH 05/55] Move ToStdout to /app/lib folder and include it in app.rb --- app/{models/concerns => lib}/to_stdout.rb | 6 ++---- app/models/concerns/domain/releasable.rb | 6 +++--- app/models/dns/domain_name.rb | 7 +++---- app/models/domain.rb | 1 - app/models/whois/record.rb | 7 +++---- config/application.rb | 2 ++ 6 files changed, 13 insertions(+), 16 deletions(-) rename app/{models/concerns => lib}/to_stdout.rb (57%) diff --git a/app/models/concerns/to_stdout.rb b/app/lib/to_stdout.rb similarity index 57% rename from app/models/concerns/to_stdout.rb rename to app/lib/to_stdout.rb index 2a01ee668..eeab82c15 100644 --- a/app/models/concerns/to_stdout.rb +++ b/app/lib/to_stdout.rb @@ -1,7 +1,5 @@ -module ToStdout - extend ActiveSupport::Concern - - def to_stdout(message) +class ToStdout + def self.msg(message) time = Time.zone.now.utc STDOUT << "#{time} - #{message}\n" unless Rails.env.test? end diff --git a/app/models/concerns/domain/releasable.rb b/app/models/concerns/domain/releasable.rb index 51e1a6f1c..0a17b062a 100644 --- a/app/models/concerns/domain/releasable.rb +++ b/app/models/concerns/domain/releasable.rb @@ -39,12 +39,12 @@ module Concerns def release if release_to_auction - to_stdout 'Destroying domain' + ToStdout.msg 'Destroying domain' destroy! - to_stdout "Checking if domain_name is auctionable: #{domain_name.auctionable?}" + ToStdout.msg "Checking if domain_name is auctionable: #{domain_name.auctionable?}" domain_name.sell_at_auction if domain_name.auctionable? - to_stdout 'Sending registrar notification' + ToStdout.msg 'Sending registrar notification' registrar.notifications.create!(text: "#{I18n.t(:domain_deleted)}: #{name}", attached_obj_id: id, attached_obj_type: self.class) diff --git a/app/models/dns/domain_name.rb b/app/models/dns/domain_name.rb index 0daa7bbae..1e9cd6587 100644 --- a/app/models/dns/domain_name.rb +++ b/app/models/dns/domain_name.rb @@ -2,7 +2,6 @@ module DNS # Namespace is needed, because a class with the same name is defined by `domain_name` gem, # a dependency of `actionmailer`, class DomainName - include ToStdout def initialize(name) @name = name end @@ -37,7 +36,7 @@ module DNS auction = Auction.new auction.domain = name auction.start - to_stdout "Created the auction: #{auction.inspect}" + ToStdout.msg "Created the auction: #{auction.inspect}" update_whois_from_auction(auction) end @@ -102,8 +101,8 @@ module DNS whois_record = Whois::Record.find_or_create_by!(name: name) do |record| record.json = {} end - to_stdout "Starting to update WHOIS record #{whois_record.inspect}\n\n"\ - "from auction #{auction.inspect}" + ToStdout.msg "Starting to update WHOIS record #{whois_record.inspect}\n\n"\ + "from auction #{auction.inspect}" whois_record.update_from_auction(auction) end end diff --git a/app/models/domain.rb b/app/models/domain.rb index 34a8c26ff..589a0b661 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -10,7 +10,6 @@ class Domain < ApplicationRecord include Concerns::Domain::RegistryLockable include Concerns::Domain::Releasable include Concerns::Domain::Disputable - include ToStdout attr_accessor :roles diff --git a/app/models/whois/record.rb b/app/models/whois/record.rb index b4f70c28f..1501381a3 100644 --- a/app/models/whois/record.rb +++ b/app/models/whois/record.rb @@ -1,6 +1,5 @@ module Whois class Record < Whois::Server - include ToStdout self.table_name = 'whois_records' def self.disclaimer @@ -13,16 +12,16 @@ module Whois update!(json: { name: auction.domain, status: ['AtAuction'], disclaimer: self.class.disclaimer }) - to_stdout "Updated from auction WHOIS record #{inspect}" + ToStdout.msg "Updated from auction WHOIS record #{inspect}" elsif auction.no_bids? - to_stdout "Destroying WHOIS record #{inspect}" + ToStdout.msg "Destroying WHOIS record #{inspect}" destroy! elsif auction.awaiting_payment? || auction.payment_received? update!(json: { name: auction.domain, status: ['PendingRegistration'], disclaimer: self.class.disclaimer, registration_deadline: auction.whois_deadline }) - to_stdout "Updated from auction WHOIS record #{inspect}" + ToStdout.msg "Updated from auction WHOIS record #{inspect}" end end # rubocop:enable Metrics/AbcSize diff --git a/config/application.rb b/config/application.rb index a5fb17c9d..014c03269 100644 --- a/config/application.rb +++ b/config/application.rb @@ -36,8 +36,10 @@ module DomainNameRegistry # Autoload all model subdirs config.autoload_paths += Dir[Rails.root.join('app', 'models', '**/')] + config.autoload_paths += Dir[Rails.root.join('app', 'lib', '**/')] config.autoload_paths += Dir[Rails.root.join('app', 'interactions', '**/')] config.eager_load_paths << config.root.join('lib', 'validators') + config.eager_load_paths << config.root.join('app', 'lib') config.watchable_dirs['lib'] = %i[rb] config.active_record.schema_format = :sql From 58d2bdb7754db122ed63f232a72efe27915d499b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Thu, 14 Jan 2021 11:15:07 +0200 Subject: [PATCH 06/55] Accept puny-coded domain for polling Transfer Info --- app/controllers/repp/v1/domains_controller.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/controllers/repp/v1/domains_controller.rb b/app/controllers/repp/v1/domains_controller.rb index ba90f23f2..3715e78ed 100644 --- a/app/controllers/repp/v1/domains_controller.rb +++ b/app/controllers/repp/v1/domains_controller.rb @@ -68,9 +68,7 @@ module Repp def set_authorized_domain @epp_errors ||= [] - h = {} - h[transfer_info_params[:id].match?(/\A[0-9]+\z/) ? :id : :name] = transfer_info_params[:id] - @domain = Domain.find_by!(h) + @domain = domain_from_url_hash return if @domain.transfer_code.eql?(request.headers['Auth-Code']) @@ -78,6 +76,13 @@ module Repp handle_errors end + def domain_from_url_hash + entry = transfer_info_params[:id] + return Domain.find(entry) if entry.match?(/\A[0-9]+\z/) + + Domain.find_by!('name = ? OR name_puny = ?', entry, entry) + end + def limit index_params[:limit] || 200 end From 887283fd72595f808a230a7e1bed61b408c9cc2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Thu, 14 Jan 2021 11:15:39 +0200 Subject: [PATCH 07/55] Use around_action instead of after_action for REPP logging --- app/controllers/repp/v1/base_controller.rb | 29 +++++++++++++--------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/app/controllers/repp/v1/base_controller.rb b/app/controllers/repp/v1/base_controller.rb index 2814ce2da..a194caf1a 100644 --- a/app/controllers/repp/v1/base_controller.rb +++ b/app/controllers/repp/v1/base_controller.rb @@ -1,7 +1,7 @@ module Repp module V1 class BaseController < ActionController::API - rescue_from ActiveRecord::RecordNotFound, with: :not_found_error + around_action :log_request before_action :authenticate_user before_action :validate_webclient_ca before_action :check_ip_restriction @@ -9,21 +9,31 @@ module Repp before_action :set_paper_trail_whodunnit - rescue_from ActionController::ParameterMissing do |exception| - render json: { code: 2003, message: exception }, status: :bad_request + private + + def log_request + yield + rescue ActiveRecord::RecordNotFound + @response = { code: 2303, message: 'Object does not exist' } + render(json: @response, status: :not_found) + rescue ActionController::ParameterMissing => e + @response = { code: 2003, message: e } + render(json: @response, status: :bad_request) + ensure + create_repp_log end - after_action do + # rubocop:disable Metrics/AbcSize + def create_repp_log ApiLog::ReppLog.create( request_path: request.path, request_method: request.request_method, request_params: request.params.except('route_info').to_json, uuid: request.try(:uuid), - response: @response.to_json, response_code: status, ip: request.ip, + response: @response.to_json, response_code: response.status, ip: request.ip, api_user_name: current_user.try(:username), api_user_registrar: current_user.try(:registrar).try(:to_s) ) end - - private + # rubocop:enable Metrics/AbcSize def set_paper_trail_whodunnit ::PaperTrail.request.whodunnit = current_user @@ -120,11 +130,6 @@ module Repp render(json: @response, status: :unauthorized) end - - def not_found_error - @response = { code: 2303, message: 'Object does not exist' } - render(json: @response, status: :not_found) - end end end end From 97abe3fb9edf7f21c714c28b73406c18a79c535a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Thu, 14 Jan 2021 12:15:48 +0200 Subject: [PATCH 08/55] Test puny domain for transfer info --- .../repp/v1/domains/transfer_info_test.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/integration/repp/v1/domains/transfer_info_test.rb b/test/integration/repp/v1/domains/transfer_info_test.rb index f57675b06..df6bc4f12 100644 --- a/test/integration/repp/v1/domains/transfer_info_test.rb +++ b/test/integration/repp/v1/domains/transfer_info_test.rb @@ -37,4 +37,17 @@ class ReppV1DomainsTransferInfoTest < ActionDispatch::IntegrationTest assert_equal 'Authorization error', json[:message] assert_empty json[:data] end + + def test_processes_puny_domains + @domain.update(name_puny: 'xn--prototp-s2aa.ee') + + headers = @auth_headers + headers['Auth-Code'] = @domain.transfer_code + + get "/repp/v1/domains/xn--prototp-s2aa.ee/transfer_info", headers: headers + json = JSON.parse(response.body, symbolize_names: true) + + assert_response :ok + assert_equal 1000, json[:code] + end end From c57f058ff943c26faa5ed2e135751027182c97fa Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Thu, 14 Jan 2021 18:35:31 +0500 Subject: [PATCH 09/55] Raise ruby version --- .github/workflows/ruby.yml | 2 +- .ruby-version | 2 +- Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index eea0ccc03..166c1c447 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -17,7 +17,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-18.04] - ruby: [2.6, 2.7 ] + ruby: [ 2.7, 3.0 ] runs-on: ${{ matrix.os }} continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }} steps: diff --git a/.ruby-version b/.ruby-version index 57cf282eb..37c2961c2 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.6.5 +2.7.2 diff --git a/Dockerfile b/Dockerfile index 5d241eeef..97b0452e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM internetee/ruby:2.6-buster +FROM internetee/ruby:2.7-buster RUN mkdir -p /opt/webapps/app/tmp/pids WORKDIR /opt/webapps/app From 91a0b5e2a620fb5260d4e6168285e8d5dfa4acc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Thu, 14 Jan 2021 16:25:32 +0200 Subject: [PATCH 10/55] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 153354e74..50e8560d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +14.01.2021 +* Fixed IDN and punycode support for REPP domain transfer_info request [#1801](https://github.com/internetee/registry/issues/1801) + 06.01.2021 * IMproved tests whois update for bulk nameserver change [#1739](https://github.com/internetee/registry/issues/1739) * Bulk ForceDelete funcionality in admin [#1177](https://github.com/internetee/registry/issues/1177) From dda241c0dca61ae9855bc8d05f1d191089d51b15 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Thu, 14 Jan 2021 19:35:49 +0500 Subject: [PATCH 11/55] Remove I18n gem-monkey-patching --- .github/workflows/ruby.yml | 7 +------ lib/gem_monkey_patches/i18n.rb | 1 + test/system/admin_area/prices_test.rb | 1 + 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 166c1c447..8880e83d4 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -17,7 +17,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-18.04] - ruby: [ 2.7, 3.0 ] + ruby: [ 2.7 ] runs-on: ${{ matrix.os }} continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }} steps: @@ -100,11 +100,6 @@ jobs: - name: Give test coverage reporter executable permissions run: chmod +x cc-test-reporter - - uses: actions/download-artifact@v1 - with: - name: coverage-2.6 - path: coverage - - uses: actions/download-artifact@v1 with: name: coverage-2.7 diff --git a/lib/gem_monkey_patches/i18n.rb b/lib/gem_monkey_patches/i18n.rb index 2f7fceff7..7d0613247 100644 --- a/lib/gem_monkey_patches/i18n.rb +++ b/lib/gem_monkey_patches/i18n.rb @@ -5,6 +5,7 @@ module I18n alias_method :original_localize, :localize def localize(object, options = {}) + options.merge!({ default: '-' }) object.present? ? original_localize(object, options) : '' end end diff --git a/test/system/admin_area/prices_test.rb b/test/system/admin_area/prices_test.rb index dbb91966a..f5a299c38 100644 --- a/test/system/admin_area/prices_test.rb +++ b/test/system/admin_area/prices_test.rb @@ -20,6 +20,7 @@ class AdminAreaPricesTest < ApplicationSystemTestCase fill_in 'Valid from', with: effective_date click_on 'Create price' + assert_text 'Price has been created' assert_text I18n.localize(effective_date) end From 59ddc5acce3ae10b4a7095e09334464ca79800e1 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Fri, 15 Jan 2021 15:32:40 +0500 Subject: [PATCH 12/55] Turn off removing auctioned Whois::Record --- app/models/whois/record.rb | 6 ++++++ app/models/whois_record.rb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/models/whois/record.rb b/app/models/whois/record.rb index 1501381a3..dc9cc2ba0 100644 --- a/app/models/whois/record.rb +++ b/app/models/whois/record.rb @@ -2,6 +2,12 @@ module Whois class Record < Whois::Server self.table_name = 'whois_records' + def self.without_auctions + ids = Whois::Record.all.select { |record| Auction.where(domain: record.name).blank? } + .pluck(:id) + Whois::Record.where(id: ids) + end + def self.disclaimer Setting.registry_whois_disclaimer end diff --git a/app/models/whois_record.rb b/app/models/whois_record.rb index 3563b9630..19805d583 100644 --- a/app/models/whois_record.rb +++ b/app/models/whois_record.rb @@ -97,7 +97,7 @@ class WhoisRecord < ApplicationRecord end def destroy_whois_record - Whois::Record.where(name: name).delete_all + Whois::Record.without_auctions.where(name: name).delete_all end private From 1e1ade3def39323d126a6e600b140f939abe3b91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Tue, 19 Jan 2021 14:35:39 +0200 Subject: [PATCH 13/55] Fix legal document assigning --- app/models/epp/domain.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb index 6a51b4cfe..d3a57df1f 100644 --- a/app/models/epp/domain.rb +++ b/app/models/epp/domain.rb @@ -520,6 +520,7 @@ class Epp::Domain < Domain def attach_legal_document(legal_document_data) return unless legal_document_data + return unless legal_document_data[:body] return if legal_document_data[:body].starts_with?(ENV['legal_documents_dir']) legal_documents.create( From 70a5d9f27ad20c8e0eea3fd7a6fc921f58c67f3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Wed, 20 Jan 2021 14:05:11 +0200 Subject: [PATCH 14/55] Registrant API: Optimize contact link(s) query --- app/models/contact.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/contact.rb b/app/models/contact.rb index e30312b4a..35425629b 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -361,8 +361,9 @@ class Contact < ApplicationRecord end def related_domains - a = related_domain_descriptions - a.keys.map { |d| { name: d, id: a[d][:id], roles: a[d][:roles] } } + dom_id = DomainContact.select(:domain_id).where(contact_id: id).map(&:domain_id).uniq + res = Domain.where(id: dom_id).or(Domain.where(registrant_id: id)).select(:name, :uuid) + res.pluck(:name, :uuid).map { |name, id| { name: name, id: id } } end def status_notes_array=(notes) From 434509f15015c539d9711a5e193a08342c6d4823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Wed, 20 Jan 2021 14:42:14 +0200 Subject: [PATCH 15/55] Registrant API: Limit contact links to 11 --- app/models/contact.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/contact.rb b/app/models/contact.rb index 35425629b..7ae51992d 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -360,9 +360,10 @@ class Contact < ApplicationRecord @desc end + # Limits returned objects to 11 def related_domains - dom_id = DomainContact.select(:domain_id).where(contact_id: id).map(&:domain_id).uniq - res = Domain.where(id: dom_id).or(Domain.where(registrant_id: id)).select(:name, :uuid) + ids = DomainContact.select(:domain_id).where(contact_id: id).limit(11).map(&:domain_id).uniq + res = Domain.where(id: ids).or(Domain.where(registrant_id: id)).select(:name, :uuid).limit(11) res.pluck(:name, :uuid).map { |name, id| { name: name, id: id } } end From 1d1c336117cd5f3f16f959ed5af70d0076c97ec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Thu, 21 Jan 2021 13:18:47 +0200 Subject: [PATCH 16/55] Registrant API: Verify new contact link(s) structure --- .../api/registrant/registrant_api_contacts_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/integration/api/registrant/registrant_api_contacts_test.rb b/test/integration/api/registrant/registrant_api_contacts_test.rb index 191222764..f3998a2e9 100644 --- a/test/integration/api/registrant/registrant_api_contacts_test.rb +++ b/test/integration/api/registrant/registrant_api_contacts_test.rb @@ -57,6 +57,15 @@ class RegistrantApiContactsTest < ApplicationIntegrationTest assert_equal({ errors: [base: ['Not authorized']] }, json_body) end + def test_gets_contact_domain_links_when_requested + get "/api/v1/registrant/contacts/#{@contact.uuid}?links=true", headers: @auth_headers + + expected_links = @contact.domains.uniq.map { |d| { name: d.name, id: d.uuid }} + assert_response :ok + response_json = JSON.parse(response.body, symbolize_names: true) + + assert_empty expected_links - response_json[:links] + end private def auth_token From f07f03f0f9f0c07ebf690aeb7a9c0091d0e94591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Thu, 21 Jan 2021 15:39:21 +0200 Subject: [PATCH 17/55] Registrant API: Simplify authorized contact search query --- .../api/v1/registrant/contacts_controller.rb | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/v1/registrant/contacts_controller.rb b/app/controllers/api/v1/registrant/contacts_controller.rb index e11458ff8..ec59ed83f 100644 --- a/app/controllers/api/v1/registrant/contacts_controller.rb +++ b/app/controllers/api/v1/registrant/contacts_controller.rb @@ -24,7 +24,7 @@ module Api end def show - contact = current_user_contacts.find_by(uuid: params[:uuid]) + contact = representable_contact(params[:uuid]) links = params[:links] == 'true' if contact @@ -91,6 +91,22 @@ module Api private + def representable_contact(uuid) + country = current_registrant_user.country.alpha2 + contact = Contact.find_by(uuid: uuid, ident: current_registrant_user.ident, + ident_type: 'priv', ident_country_code: country) + return contact if contact + + Contact.find_by(uuid: uuid, ident_type: 'org', ident: company_codes, + ident_country_code: country) + rescue CompanyRegister::NotAvailableError + nil + end + + def company_codes + current_registrant_user.companies.collect(&:registration_number) + end + def current_user_contacts current_registrant_user.contacts(representable: false) rescue CompanyRegister::NotAvailableError From 5cc04d255f4639b2c043a4e5253317e4791c4f21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Thu, 21 Jan 2021 21:23:18 +0200 Subject: [PATCH 18/55] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50e8560d6..aa12fbd39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +21.01.2021 +* Registrant API: optimised contact linking [#1807](https://github.com/internetee/registry/pull/1807) + 14.01.2021 * Fixed IDN and punycode support for REPP domain transfer_info request [#1801](https://github.com/internetee/registry/issues/1801) From b6df415fb9659678b708a38a93316fed9d96f039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Thu, 21 Jan 2021 21:26:23 +0200 Subject: [PATCH 19/55] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa12fbd39..08f68a169 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ 21.01.2021 * Registrant API: optimised contact linking [#1807](https://github.com/internetee/registry/pull/1807) +20.01.2021 +* Fixed legaldoc assignment issue on registrant confirmation [#1806](https://github.com/internetee/registry/pull/1806) + 14.01.2021 * Fixed IDN and punycode support for REPP domain transfer_info request [#1801](https://github.com/internetee/registry/issues/1801) From 35a6438cf494415299a2c4bd956700ba4709828a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Tue, 26 Jan 2021 10:45:24 +0200 Subject: [PATCH 20/55] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08f68a169..3770abd4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +26.01.2021 +* Ruby update to 2.7 [#1791](https://github.com/internetee/registry/issues/1791) + 21.01.2021 * Registrant API: optimised contact linking [#1807](https://github.com/internetee/registry/pull/1807) From 54da4c991429f710f5b76a4afb0167a70342bf38 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Mon, 25 Jan 2021 16:03:41 +0200 Subject: [PATCH 21/55] Test for Illegal chars in DNSkey --- .../epp/domain/create/base_test.rb | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/test/integration/epp/domain/create/base_test.rb b/test/integration/epp/domain/create/base_test.rb index 9d817524d..a026c3eed 100644 --- a/test/integration/epp/domain/create/base_test.rb +++ b/test/integration/epp/domain/create/base_test.rb @@ -2,6 +2,51 @@ require 'test_helper' class EppDomainCreateBaseTest < EppTestCase + def test_some_test + name = "new.#{dns_zones(:one).origin}" + contact = contacts(:john) + registrant = contact.becomes(Registrant) + + pub_key = "AwEAAddt2AkLf\n + \n + YGKgiEZB5SmIF8E\n + vrjxNMH6HtxWEA4RJ9Ao6LCWheg8" + + request_xml = <<-XML + + + + + + #{name} + #{registrant.code} + + + + + + 257 + 3 + 8 + #{pub_key} + + + + #{'test' * 2000} + + + + + XML + assert_no_difference 'Domain.count' do + post epp_create_path, params: { frame: request_xml }, + headers: { 'HTTP_COOKIE' => 'session=api_bestnames' } + end + + assert_epp_response :parameter_value_syntax_error + end + + def test_not_registers_domain_without_legaldoc now = Time.zone.parse('2010-07-05') travel_to now From b3df3590b7326e3fb30a840813b8e609099c5ac8 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Mon, 25 Jan 2021 16:07:44 +0200 Subject: [PATCH 22/55] Test for Illegal chars in DNSkey --- test/integration/epp/domain/create/base_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/epp/domain/create/base_test.rb b/test/integration/epp/domain/create/base_test.rb index a026c3eed..99b82c8b6 100644 --- a/test/integration/epp/domain/create/base_test.rb +++ b/test/integration/epp/domain/create/base_test.rb @@ -10,7 +10,7 @@ class EppDomainCreateBaseTest < EppTestCase pub_key = "AwEAAddt2AkLf\n \n YGKgiEZB5SmIF8E\n - vrjxNMH6HtxWEA4RJ9Ao6LCWheg8" + vrjxNMH6HtxW\rEA4RJ9Ao6LCWheg8" request_xml = <<-XML From cdf1721ba20ae14a7e3d228cfc60854e20b11ccc Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Wed, 27 Jan 2021 10:20:30 +0200 Subject: [PATCH 23/55] changed test name --- test/integration/epp/domain/create/base_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/epp/domain/create/base_test.rb b/test/integration/epp/domain/create/base_test.rb index 99b82c8b6..e3b7a39ee 100644 --- a/test/integration/epp/domain/create/base_test.rb +++ b/test/integration/epp/domain/create/base_test.rb @@ -2,7 +2,7 @@ require 'test_helper' class EppDomainCreateBaseTest < EppTestCase - def test_some_test + def test_illegal_chars_in_dns_key name = "new.#{dns_zones(:one).origin}" contact = contacts(:john) registrant = contact.becomes(Registrant) From db729d24210becd89cd00dac66614efa3386179e Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Wed, 27 Jan 2021 15:12:15 +0500 Subject: [PATCH 24/55] Add check if key is Base64-encoded --- app/models/epp/domain.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb index d3a57df1f..c4d70c2ee 100644 --- a/app/models/epp/domain.rb +++ b/app/models/epp/domain.rb @@ -312,6 +312,7 @@ class Epp::Domain < Domain keys = [] return keys if frame.blank? inf_data = DnsSecKeys.new(frame) + add_epp_error('2005', nil, nil, %i[dnskeys invalid]) if not_base64?(inf_data) if action == 'rem' && frame.css('rem > all').first.try(:text) == 'true' @@ -333,6 +334,16 @@ class Epp::Domain < Domain errors.any? ? [] : keys end + def not_base64?(inf_data) + inf_data.key_data.any? do |key| + value = key[:public_key] + + !value.is_a?(String) || Base64.strict_encode64(Base64.strict_decode64(value)) != value + end + rescue ArgumentError + true + end + class DnsSecKeys def initialize(frame) @key_data = [] @@ -381,7 +392,7 @@ class Epp::Domain < Domain def key_data_from(frame) xm_copy frame, KEY_INTERFACE - end + end def ds_data_from(frame) frame.css('dsData').each do |ds_data| From 0859c5d87b0791036ea4f6f3f232105d1f1070ca Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Wed, 27 Jan 2021 20:03:31 +0500 Subject: [PATCH 25/55] Update Figaro version to 1.2.0 --- Gemfile | 2 +- Gemfile.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 9bbcba254..dd879a11b 100644 --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,7 @@ gem 'rest-client' gem 'uglifier' # load env -gem 'figaro', '1.1.1' +gem 'figaro', '~> 1.2' # model related gem 'activerecord-import' diff --git a/Gemfile.lock b/Gemfile.lock index 2a0bb55b1..51c880c9e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -202,8 +202,8 @@ GEM erubis (2.7.0) execjs (2.7.0) ffi (1.13.1) - figaro (1.1.1) - thor (~> 0.14) + figaro (1.2.0) + thor (>= 0.14.0, < 2) globalid (0.4.2) activesupport (>= 4.2.0) gyoku (1.3.1) @@ -502,7 +502,7 @@ DEPENDENCIES e_invoice! epp! epp-xml (= 1.1.0)! - figaro (= 1.1.1) + figaro (~> 1.2) haml (~> 5.0) isikukood iso8601 (= 0.12.1) From ea5586a5a743b1bbb38996d1f054f1b07cec5a87 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Wed, 27 Jan 2021 17:14:21 +0200 Subject: [PATCH 26/55] added test for registrar account activities --- .../registrar_area/account_activities_test.rb | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test/system/registrar_area/account_activities_test.rb diff --git a/test/system/registrar_area/account_activities_test.rb b/test/system/registrar_area/account_activities_test.rb new file mode 100644 index 000000000..1944dc2fb --- /dev/null +++ b/test/system/registrar_area/account_activities_test.rb @@ -0,0 +1,28 @@ +require 'application_system_test_case' + +class RegistrarAccountActivitiesTest < ApplicationSystemTestCase + setup do + @registrar = registrars(:bestnames) + sign_in users(:api_bestnames) + end + + def test_show_account_activity_page + account_activities(:one).update(sum: "123.00") + visit registrar_account_activities_path + assert_text 'Account activity' + end + + def test_download_account_activity + now = Time.zone.parse('2010-07-05 08:00') + travel_to now + account_activities(:one).update(sum: "123.00") + + get registrar_account_activities_path(format: :csv) + + assert_response :ok + assert_equal "text/csv", response.headers['Content-Type'] + assert_equal %(attachment; filename="account_activities_#{Time.zone.now.to_formatted_s(:number)}.csv"; filename*=UTF-8''account_activities_#{Time.zone.now.to_formatted_s(:number)}.csv), + response.headers['Content-Disposition'] + assert_not_empty response.body + end +end \ No newline at end of file From 2b6e02eccae495e02c41275924b98ec39e915bdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Wed, 27 Jan 2021 20:32:21 +0200 Subject: [PATCH 27/55] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3770abd4c..a63041b57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +27.01.2021 +* Figaro update to 1.2.0 [#1823](https://github.com/internetee/registry/pull/1823) + 26.01.2021 * Ruby update to 2.7 [#1791](https://github.com/internetee/registry/issues/1791) From 5a9e5adcc9ecf8c5bd98cd41737516d179bf042b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Thu, 28 Jan 2021 09:25:37 +0200 Subject: [PATCH 28/55] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a63041b57..21611828f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +28.01.2021 +* Fix for whois record creation issue on releasing domain to auction [#1139](https://github.com/internetee/registry/issues/1139) + 27.01.2021 * Figaro update to 1.2.0 [#1823](https://github.com/internetee/registry/pull/1823) From 07eb5c809b4a0e3a0837b6e0229f1ef9fb9a4924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Thu, 28 Jan 2021 09:57:29 +0200 Subject: [PATCH 29/55] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21611828f..af203ffbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ 28.01.2021 +* Improved DNSSEC key validation for illegal characters [#1790](https://github.com/internetee/registry/issues/1790) * Fix for whois record creation issue on releasing domain to auction [#1139](https://github.com/internetee/registry/issues/1139) 27.01.2021 From b369bfeef692c8f7c838d31954d904d7c4f2b8cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Thu, 28 Jan 2021 11:15:35 +0200 Subject: [PATCH 30/55] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index af203ffbd..97d7afeb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ 28.01.2021 * Improved DNSSEC key validation for illegal characters [#1790](https://github.com/internetee/registry/issues/1790) * Fix for whois record creation issue on releasing domain to auction [#1139](https://github.com/internetee/registry/issues/1139) +* Improved registrar account activity tests [#1824](https://github.com/internetee/registry/pull/1824) 27.01.2021 * Figaro update to 1.2.0 [#1823](https://github.com/internetee/registry/pull/1823) From 541c2d769aa2931a8cfc25df97ac367c89422822 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Fri, 22 Jan 2021 10:47:31 +0200 Subject: [PATCH 31/55] Contact test for new registrant after domain transfer --- .../epp/domain/transfer/request_test.rb | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/integration/epp/domain/transfer/request_test.rb b/test/integration/epp/domain/transfer/request_test.rb index 1c3614421..4090d9c0d 100644 --- a/test/integration/epp/domain/transfer/request_test.rb +++ b/test/integration/epp/domain/transfer/request_test.rb @@ -12,6 +12,28 @@ class EppDomainTransferRequestTest < EppTestCase Setting.transfer_wait_time = @original_transfer_wait_time end + def test_new_contacts_should_be_created_after_transfer_domain + registrar_id = @domain.registrar.id + contacts_id_values = [] + + contact_id = Contact.find_by(registrar_id: registrar_id) + + @domain.domain_contacts[0].update!(contact_id: contact_id.id) + @domain.domain_contacts[1].update!(contact_id: contact_id.id) + + @domain.domain_contacts.each do |contact| + contacts_id_values.push(contact.contact_id) + end + + post epp_transfer_path, params: { frame: request_xml }, + headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } + + @domain.reload + + assert_epp_response :completed_successfully + assert_equal @domain.domain_contacts[0].contact_id, @domain.domain_contacts[1].contact_id + end + def test_transfers_domain_at_once post epp_transfer_path, params: { frame: request_xml }, headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } From 21fc5edb4434e5599e6ef9a2a9fbb8458eed6bee Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Fri, 22 Jan 2021 16:07:26 +0500 Subject: [PATCH 32/55] Add semantic test fixes & maybe solution for an issue --- app/models/concerns/domain/transferable.rb | 8 ++++++-- .../epp/domain/transfer/request_test.rb | 15 ++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/app/models/concerns/domain/transferable.rb b/app/models/concerns/domain/transferable.rb index 9de2fff83..5400e9409 100644 --- a/app/models/concerns/domain/transferable.rb +++ b/app/models/concerns/domain/transferable.rb @@ -59,7 +59,7 @@ module Concerns::Domain::Transferable copied_ids = [] domain_contacts.each do |dc| contact = Contact.find(dc.contact_id) - next if copied_ids.include?(contact.id) || contact.registrar == new_registrar + next if copied_ids.include?(uniq_contact_hash(dc)) || contact.registrar == new_registrar if registrant_id_was == contact.id # registrant was copied previously, do not copy it again oc = OpenStruct.new(id: registrant_id) @@ -72,7 +72,11 @@ module Concerns::Domain::Transferable else dc.update(contact_id: oc.id) end - copied_ids << contact.id + copied_ids << uniq_contact_hash(dc) end end + + def uniq_contact_hash(contact) + Digest::SHA1.hexdigest(contact.contact_id.to_s + contact.type) + end end diff --git a/test/integration/epp/domain/transfer/request_test.rb b/test/integration/epp/domain/transfer/request_test.rb index 4090d9c0d..e41716457 100644 --- a/test/integration/epp/domain/transfer/request_test.rb +++ b/test/integration/epp/domain/transfer/request_test.rb @@ -14,16 +14,11 @@ class EppDomainTransferRequestTest < EppTestCase def test_new_contacts_should_be_created_after_transfer_domain registrar_id = @domain.registrar.id - contacts_id_values = [] - contact_id = Contact.find_by(registrar_id: registrar_id) + new_contact = Contact.find_by(registrar_id: registrar_id) - @domain.domain_contacts[0].update!(contact_id: contact_id.id) - @domain.domain_contacts[1].update!(contact_id: contact_id.id) - - @domain.domain_contacts.each do |contact| - contacts_id_values.push(contact.contact_id) - end + @domain.domain_contacts[0].update!(contact_id: new_contact.id) + @domain.domain_contacts[1].update!(contact_id: new_contact.id) post epp_transfer_path, params: { frame: request_xml }, headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } @@ -31,7 +26,9 @@ class EppDomainTransferRequestTest < EppTestCase @domain.reload assert_epp_response :completed_successfully - assert_equal @domain.domain_contacts[0].contact_id, @domain.domain_contacts[1].contact_id + + result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) + assert_equal result_hash[new_contact.id], 2 end def test_transfers_domain_at_once From 90e97aeddd58ba4e70574bc95007d0699a05e3b3 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Fri, 22 Jan 2021 15:47:44 +0200 Subject: [PATCH 33/55] added more scenarios --- .../epp/domain/transfer/request_test.rb | 57 ++++++++++++++++++- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/test/integration/epp/domain/transfer/request_test.rb b/test/integration/epp/domain/transfer/request_test.rb index e41716457..668d01b76 100644 --- a/test/integration/epp/domain/transfer/request_test.rb +++ b/test/integration/epp/domain/transfer/request_test.rb @@ -12,11 +12,65 @@ class EppDomainTransferRequestTest < EppTestCase Setting.transfer_wait_time = @original_transfer_wait_time end - def test_new_contacts_should_be_created_after_transfer_domain + def test_transfer_domain_with_contacts_if_registrant_and_tech_are_shared registrar_id = @domain.registrar.id new_contact = Contact.find_by(registrar_id: registrar_id) + @domain.domain_contacts[1].update!(contact_id: new_contact.id) + + puts @domain.domain_contacts[1].contact_id + + post epp_transfer_path, params: { frame: request_xml }, + headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } + + @domain.reload + + assert_epp_response :completed_successfully + + puts @domain.domain_contacts[1].contact_id + + result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) + assert_equal result_hash[new_contact.id], 1 + end + + def test_transfer_domain_with_contacts_if_registrant_and_admin_are_shared + registrar_id = @domain.registrar.id + + new_contact = Contact.find_by(registrar_id: registrar_id) + + @domain.domain_contacts[0].update!(contact_id: new_contact.id) + + post epp_transfer_path, params: { frame: request_xml }, + headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } + + @domain.reload + + assert_epp_response :completed_successfully + + result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) + assert_equal result_hash[new_contact.id], 1 + end + + def test_transfer_domain_with_contacts_if_admin_and_tech_are_shared + + contact_id = @domain.domain_contacts[0].contact_id + @domain.domain_contacts[1].update!(contact_id: contact_id) + + post epp_transfer_path, params: { frame: request_xml }, + headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } + + @domain.reload + + assert_epp_response :completed_successfully + result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) + assert_equal result_hash[contact_id], 2 + end + + def test_transfer_domain_with_contacts_if_admin_and_tech_and_registrant_are_shared + registrar_id = @domain.registrar.id + new_contact = Contact.find_by(registrar_id: registrar_id) + @domain.domain_contacts[0].update!(contact_id: new_contact.id) @domain.domain_contacts[1].update!(contact_id: new_contact.id) @@ -26,7 +80,6 @@ class EppDomainTransferRequestTest < EppTestCase @domain.reload assert_epp_response :completed_successfully - result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) assert_equal result_hash[new_contact.id], 2 end From 4a5dc432021c2b7e767963529b0a6b8e7341144d Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Fri, 22 Jan 2021 15:48:06 +0200 Subject: [PATCH 34/55] added more scenarios-2 --- test/integration/epp/domain/transfer/request_test.rb | 7 ------- 1 file changed, 7 deletions(-) diff --git a/test/integration/epp/domain/transfer/request_test.rb b/test/integration/epp/domain/transfer/request_test.rb index 668d01b76..3f4514d06 100644 --- a/test/integration/epp/domain/transfer/request_test.rb +++ b/test/integration/epp/domain/transfer/request_test.rb @@ -14,29 +14,22 @@ class EppDomainTransferRequestTest < EppTestCase def test_transfer_domain_with_contacts_if_registrant_and_tech_are_shared registrar_id = @domain.registrar.id - new_contact = Contact.find_by(registrar_id: registrar_id) @domain.domain_contacts[1].update!(contact_id: new_contact.id) - puts @domain.domain_contacts[1].contact_id - post epp_transfer_path, params: { frame: request_xml }, headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } @domain.reload assert_epp_response :completed_successfully - - puts @domain.domain_contacts[1].contact_id - result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) assert_equal result_hash[new_contact.id], 1 end def test_transfer_domain_with_contacts_if_registrant_and_admin_are_shared registrar_id = @domain.registrar.id - new_contact = Contact.find_by(registrar_id: registrar_id) @domain.domain_contacts[0].update!(contact_id: new_contact.id) From a2760e1f9eef9098c69165aa52a504c206b0969e Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Fri, 22 Jan 2021 17:17:07 +0200 Subject: [PATCH 35/55] fixed tests assert --- test/integration/epp/domain/transfer/request_test.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/integration/epp/domain/transfer/request_test.rb b/test/integration/epp/domain/transfer/request_test.rb index 3f4514d06..53ad55688 100644 --- a/test/integration/epp/domain/transfer/request_test.rb +++ b/test/integration/epp/domain/transfer/request_test.rb @@ -3,6 +3,7 @@ require 'test_helper' class EppDomainTransferRequestTest < EppTestCase def setup @domain = domains(:shop) + @domain_library = domains(:library) @new_registrar = registrars(:goodnames) @original_transfer_wait_time = Setting.transfer_wait_time Setting.transfer_wait_time = 0 @@ -63,15 +64,13 @@ class EppDomainTransferRequestTest < EppTestCase def test_transfer_domain_with_contacts_if_admin_and_tech_and_registrant_are_shared registrar_id = @domain.registrar.id new_contact = Contact.find_by(registrar_id: registrar_id) - - @domain.domain_contacts[0].update!(contact_id: new_contact.id) - @domain.domain_contacts[1].update!(contact_id: new_contact.id) + + @domain.admin_domain_contacts[0].update!(contact_id: new_contact.id) + @domain.tech_domain_contacts[0].update!(contact_id: new_contact.id) post epp_transfer_path, params: { frame: request_xml }, headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } - @domain.reload - assert_epp_response :completed_successfully result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) assert_equal result_hash[new_contact.id], 2 From 01234cb8a8d9cd3ecd729825ca2c147c2ddfd052 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Fri, 22 Jan 2021 18:41:06 +0200 Subject: [PATCH 36/55] refactoring --- test/integration/epp/domain/transfer/request_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/epp/domain/transfer/request_test.rb b/test/integration/epp/domain/transfer/request_test.rb index 53ad55688..795d1c3d5 100644 --- a/test/integration/epp/domain/transfer/request_test.rb +++ b/test/integration/epp/domain/transfer/request_test.rb @@ -17,7 +17,7 @@ class EppDomainTransferRequestTest < EppTestCase registrar_id = @domain.registrar.id new_contact = Contact.find_by(registrar_id: registrar_id) - @domain.domain_contacts[1].update!(contact_id: new_contact.id) + @domain.tech_domain_contacts[0].update!(contact_id: new_contact.id) post epp_transfer_path, params: { frame: request_xml }, headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } @@ -33,7 +33,7 @@ class EppDomainTransferRequestTest < EppTestCase registrar_id = @domain.registrar.id new_contact = Contact.find_by(registrar_id: registrar_id) - @domain.domain_contacts[0].update!(contact_id: new_contact.id) + @domain.admin_domain_contacts[0].update!(contact_id: new_contact.id) post epp_transfer_path, params: { frame: request_xml }, headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } From 3bfac1ba436dd12023f0cb98391ae7c8c5e6e3eb Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Fri, 22 Jan 2021 19:49:06 +0200 Subject: [PATCH 37/55] compare fix --- test/integration/epp/domain/transfer/request_test.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/integration/epp/domain/transfer/request_test.rb b/test/integration/epp/domain/transfer/request_test.rb index 795d1c3d5..f38947649 100644 --- a/test/integration/epp/domain/transfer/request_test.rb +++ b/test/integration/epp/domain/transfer/request_test.rb @@ -26,7 +26,8 @@ class EppDomainTransferRequestTest < EppTestCase assert_epp_response :completed_successfully result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) - assert_equal result_hash[new_contact.id], 1 + puts "Shared registrar and tech: #{result_hash}" + assert result_hash[new_contact.id] < 2 end def test_transfer_domain_with_contacts_if_registrant_and_admin_are_shared @@ -41,9 +42,9 @@ class EppDomainTransferRequestTest < EppTestCase @domain.reload assert_epp_response :completed_successfully - result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) - assert_equal result_hash[new_contact.id], 1 + puts "Shared registrar and tech: #{result_hash}" + assert result_hash[new_contact.id] < 2 end def test_transfer_domain_with_contacts_if_admin_and_tech_are_shared From a336ee95f85b86b578379fa428e140a4146bc5bb Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Fri, 22 Jan 2021 20:27:37 +0200 Subject: [PATCH 38/55] fixed compare --- .../epp/domain/transfer/request_test.rb | 37 ++++++++++++++++++- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/test/integration/epp/domain/transfer/request_test.rb b/test/integration/epp/domain/transfer/request_test.rb index f38947649..160a6915a 100644 --- a/test/integration/epp/domain/transfer/request_test.rb +++ b/test/integration/epp/domain/transfer/request_test.rb @@ -18,15 +18,32 @@ class EppDomainTransferRequestTest < EppTestCase new_contact = Contact.find_by(registrar_id: registrar_id) @domain.tech_domain_contacts[0].update!(contact_id: new_contact.id) + @domain.reload + + puts + puts "test_transfer_domain_with_contacts_if_registrant_and_tech_are_shared" + puts "Registrar id #{new_contact.id}" + puts "Tech #{@domain.tech_domain_contacts[0].contact_id}" + puts "Tech #{@domain.tech_domain_contacts[1].contact_id}" + puts "Admin #{@domain.admin_domain_contacts[0].contact_id}" post epp_transfer_path, params: { frame: request_xml }, headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } @domain.reload + registrar_id = @domain.registrar.id + new_contact_2 = Contact.find_by(registrar_id: registrar_id) + + puts "Registrar id #{new_contact_2.id}" + puts "Tech #{@domain.tech_domain_contacts[0].contact_id}" + puts "Tech #{@domain.tech_domain_contacts[1].contact_id}" + puts "Admin #{@domain.admin_domain_contacts[0].contact_id}" + assert_epp_response :completed_successfully result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) - puts "Shared registrar and tech: #{result_hash}" + + puts "Result hash #{result_hash}" assert result_hash[new_contact.id] < 2 end @@ -35,15 +52,31 @@ class EppDomainTransferRequestTest < EppTestCase new_contact = Contact.find_by(registrar_id: registrar_id) @domain.admin_domain_contacts[0].update!(contact_id: new_contact.id) + @domain.reload + + puts + puts "test_transfer_domain_with_contacts_if_registrant_and_admin_are_shared" + puts "Registrar id #{new_contact.id}" + puts "Tech 1 #{@domain.tech_domain_contacts[0].contact_id}" # ????? + puts "Tech 2 #{@domain.tech_domain_contacts[1].contact_id}" + puts "Admin #{@domain.admin_domain_contacts[0].contact_id}" post epp_transfer_path, params: { frame: request_xml }, headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } @domain.reload + registrar_id = @domain.registrar.id + new_contact_2 = Contact.find_by(registrar_id: registrar_id) + + puts "Registrar id #{new_contact_2.id}" + puts "Tech 1 #{@domain.tech_domain_contacts[0].contact_id}" + puts "Tech 2 #{@domain.tech_domain_contacts[1].contact_id}" + puts "Admin #{@domain.admin_domain_contacts[0].contact_id}" + assert_epp_response :completed_successfully result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) - puts "Shared registrar and tech: #{result_hash}" + puts "Result hash #{result_hash}" assert result_hash[new_contact.id] < 2 end From 72c9e894fa77205cc9ba3e0f1edc5eabd2b7c8fd Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Fri, 22 Jan 2021 21:07:18 +0200 Subject: [PATCH 39/55] fixed --- .../epp/domain/transfer/request_test.rb | 36 ++++--------------- 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/test/integration/epp/domain/transfer/request_test.rb b/test/integration/epp/domain/transfer/request_test.rb index 160a6915a..a0a49c289 100644 --- a/test/integration/epp/domain/transfer/request_test.rb +++ b/test/integration/epp/domain/transfer/request_test.rb @@ -20,13 +20,6 @@ class EppDomainTransferRequestTest < EppTestCase @domain.tech_domain_contacts[0].update!(contact_id: new_contact.id) @domain.reload - puts - puts "test_transfer_domain_with_contacts_if_registrant_and_tech_are_shared" - puts "Registrar id #{new_contact.id}" - puts "Tech #{@domain.tech_domain_contacts[0].contact_id}" - puts "Tech #{@domain.tech_domain_contacts[1].contact_id}" - puts "Admin #{@domain.admin_domain_contacts[0].contact_id}" - post epp_transfer_path, params: { frame: request_xml }, headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } @@ -35,48 +28,33 @@ class EppDomainTransferRequestTest < EppTestCase registrar_id = @domain.registrar.id new_contact_2 = Contact.find_by(registrar_id: registrar_id) - puts "Registrar id #{new_contact_2.id}" - puts "Tech #{@domain.tech_domain_contacts[0].contact_id}" - puts "Tech #{@domain.tech_domain_contacts[1].contact_id}" - puts "Admin #{@domain.admin_domain_contacts[0].contact_id}" assert_epp_response :completed_successfully result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) - puts "Result hash #{result_hash}" assert result_hash[new_contact.id] < 2 end + # ??????????????????? def test_transfer_domain_with_contacts_if_registrant_and_admin_are_shared registrar_id = @domain.registrar.id new_contact = Contact.find_by(registrar_id: registrar_id) @domain.admin_domain_contacts[0].update!(contact_id: new_contact.id) + + # ????????? need to find out + @domain.tech_domain_contacts[1].delete @domain.reload - - puts - puts "test_transfer_domain_with_contacts_if_registrant_and_admin_are_shared" - puts "Registrar id #{new_contact.id}" - puts "Tech 1 #{@domain.tech_domain_contacts[0].contact_id}" # ????? - puts "Tech 2 #{@domain.tech_domain_contacts[1].contact_id}" - puts "Admin #{@domain.admin_domain_contacts[0].contact_id}" + # ?????????????????????????? post epp_transfer_path, params: { frame: request_xml }, headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } @domain.reload - registrar_id = @domain.registrar.id - new_contact_2 = Contact.find_by(registrar_id: registrar_id) - - puts "Registrar id #{new_contact_2.id}" - puts "Tech 1 #{@domain.tech_domain_contacts[0].contact_id}" - puts "Tech 2 #{@domain.tech_domain_contacts[1].contact_id}" - puts "Admin #{@domain.admin_domain_contacts[0].contact_id}" - assert_epp_response :completed_successfully result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) - puts "Result hash #{result_hash}" + assert result_hash[new_contact.id] < 2 end @@ -88,8 +66,6 @@ class EppDomainTransferRequestTest < EppTestCase post epp_transfer_path, params: { frame: request_xml }, headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } - @domain.reload - assert_epp_response :completed_successfully result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) assert_equal result_hash[contact_id], 2 From 6b053d026058bebbb1d635a1f0e5bc934cddc003 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Fri, 22 Jan 2021 21:14:15 +0200 Subject: [PATCH 40/55] fixed --- test/integration/epp/domain/transfer/request_test.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/integration/epp/domain/transfer/request_test.rb b/test/integration/epp/domain/transfer/request_test.rb index a0a49c289..7ab45b891 100644 --- a/test/integration/epp/domain/transfer/request_test.rb +++ b/test/integration/epp/domain/transfer/request_test.rb @@ -54,7 +54,9 @@ class EppDomainTransferRequestTest < EppTestCase assert_epp_response :completed_successfully result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) - + puts @domain.admin_domain_contacts[0].contact_id + puts @domain.tech_domain_contacts[0].contact_id + puts result_hash assert result_hash[new_contact.id] < 2 end From fc0aeefcc1df7f85927e5c59d0d1b725c91491fb Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Fri, 22 Jan 2021 21:46:02 +0200 Subject: [PATCH 41/55] fixed --- test/integration/epp/domain/transfer/request_test.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/test/integration/epp/domain/transfer/request_test.rb b/test/integration/epp/domain/transfer/request_test.rb index 7ab45b891..91ca47a21 100644 --- a/test/integration/epp/domain/transfer/request_test.rb +++ b/test/integration/epp/domain/transfer/request_test.rb @@ -41,6 +41,7 @@ class EppDomainTransferRequestTest < EppTestCase new_contact = Contact.find_by(registrar_id: registrar_id) @domain.admin_domain_contacts[0].update!(contact_id: new_contact.id) + @domain.tech_domain_contacts[0].update!(contact_id: '999914115') # ????????? # ????????? need to find out @domain.tech_domain_contacts[1].delete From 0f789895557e1b55424fb2f9279fed61baba47bb Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Fri, 22 Jan 2021 22:13:28 +0200 Subject: [PATCH 42/55] fixed --- .../epp/domain/transfer/request_test.rb | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/test/integration/epp/domain/transfer/request_test.rb b/test/integration/epp/domain/transfer/request_test.rb index 91ca47a21..185bd6b7c 100644 --- a/test/integration/epp/domain/transfer/request_test.rb +++ b/test/integration/epp/domain/transfer/request_test.rb @@ -55,9 +55,6 @@ class EppDomainTransferRequestTest < EppTestCase assert_epp_response :completed_successfully result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) - puts @domain.admin_domain_contacts[0].contact_id - puts @domain.tech_domain_contacts[0].contact_id - puts result_hash assert result_hash[new_contact.id] < 2 end @@ -69,9 +66,16 @@ class EppDomainTransferRequestTest < EppTestCase post epp_transfer_path, params: { frame: request_xml }, headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } + @domain.reload + + contact = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) + assert_epp_response :completed_successfully result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) assert_equal result_hash[contact_id], 2 + + result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) + assert result_hash_codes[contact.code] > 1 end def test_transfer_domain_with_contacts_if_admin_and_tech_and_registrant_are_shared @@ -84,9 +88,16 @@ class EppDomainTransferRequestTest < EppTestCase post epp_transfer_path, params: { frame: request_xml }, headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } + @domain.reload + + contact = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) + assert_epp_response :completed_successfully result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) assert_equal result_hash[new_contact.id], 2 + + result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) + assert result_hash_codes[contact.code] > 1 end def test_transfers_domain_at_once From ccbde76473b9f00c43c3fef93c8a4216b360cc8b Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Sat, 23 Jan 2021 09:38:22 +0200 Subject: [PATCH 43/55] Update transfer domain with shared contacts --- .../epp/domain/transfer/request_test.rb | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/test/integration/epp/domain/transfer/request_test.rb b/test/integration/epp/domain/transfer/request_test.rb index 185bd6b7c..dd306c80d 100644 --- a/test/integration/epp/domain/transfer/request_test.rb +++ b/test/integration/epp/domain/transfer/request_test.rb @@ -25,14 +25,14 @@ class EppDomainTransferRequestTest < EppTestCase @domain.reload - registrar_id = @domain.registrar.id - new_contact_2 = Contact.find_by(registrar_id: registrar_id) - + contact = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) assert_epp_response :completed_successfully result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) - assert result_hash[new_contact.id] < 2 + + result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) + assert result_hash_codes[contact.code] < 2 end # ??????????????????? @@ -53,13 +53,20 @@ class EppDomainTransferRequestTest < EppTestCase @domain.reload + contact_one = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) + contact_two = Contact.find_by(id: @domain.tech_domain_contacts[0].contact_id) + assert_epp_response :completed_successfully result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) assert result_hash[new_contact.id] < 2 + + result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) + assert result_hash_codes[contact_one.code] < 2 + assert result_hash_codes[contact_two.code] < 2 + end def test_transfer_domain_with_contacts_if_admin_and_tech_are_shared - contact_id = @domain.domain_contacts[0].contact_id @domain.domain_contacts[1].update!(contact_id: contact_id) From 9e88e74cc3b878eb309904c8b2fa80c4d74dc244 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Sat, 23 Jan 2021 11:38:58 +0200 Subject: [PATCH 44/55] Update transfer domain with shared contacts --- .../epp/domain/transfer/request_test.rb | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/test/integration/epp/domain/transfer/request_test.rb b/test/integration/epp/domain/transfer/request_test.rb index dd306c80d..8aed6fd48 100644 --- a/test/integration/epp/domain/transfer/request_test.rb +++ b/test/integration/epp/domain/transfer/request_test.rb @@ -3,7 +3,7 @@ require 'test_helper' class EppDomainTransferRequestTest < EppTestCase def setup @domain = domains(:shop) - @domain_library = domains(:library) + @contact = contacts(:william) @new_registrar = registrars(:goodnames) @original_transfer_wait_time = Setting.transfer_wait_time Setting.transfer_wait_time = 0 @@ -67,22 +67,26 @@ class EppDomainTransferRequestTest < EppTestCase end def test_transfer_domain_with_contacts_if_admin_and_tech_are_shared - contact_id = @domain.domain_contacts[0].contact_id - @domain.domain_contacts[1].update!(contact_id: contact_id) + @domain.admin_domain_contacts[0].update!(contact_id: @contact.id) + @domain.tech_domain_contacts[0].update!(contact_id: @contact.id) post epp_transfer_path, params: { frame: request_xml }, headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } @domain.reload - contact = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) + contact_fresh = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) assert_epp_response :completed_successfully result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) - assert_equal result_hash[contact_id], 2 + assert_equal result_hash[contact_fresh.original_id], 2 result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) - assert result_hash_codes[contact.code] > 1 + assert result_hash_codes[contact_fresh.code] > 1 + + assert_equal @contact.phone, contact_fresh.phone + assert_equal @contact.name, contact_fresh.name + assert_equal @contact.ident, contact_fresh.ident end def test_transfer_domain_with_contacts_if_admin_and_tech_and_registrant_are_shared From a7c708bdf0066d9f409db9d37bb248b87303f796 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Sat, 23 Jan 2021 11:48:00 +0200 Subject: [PATCH 45/55] Update transfer domain with shared contacts --- test/integration/epp/domain/transfer/request_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/epp/domain/transfer/request_test.rb b/test/integration/epp/domain/transfer/request_test.rb index 8aed6fd48..cd67639ee 100644 --- a/test/integration/epp/domain/transfer/request_test.rb +++ b/test/integration/epp/domain/transfer/request_test.rb @@ -3,7 +3,7 @@ require 'test_helper' class EppDomainTransferRequestTest < EppTestCase def setup @domain = domains(:shop) - @contact = contacts(:william) + @contact = contacts(:jane) @new_registrar = registrars(:goodnames) @original_transfer_wait_time = Setting.transfer_wait_time Setting.transfer_wait_time = 0 From f0ca552cc1ba9f10920028702e71f4d7009aeab2 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Sat, 23 Jan 2021 11:55:40 +0200 Subject: [PATCH 46/55] Update transfer domain with shared contacts --- .../epp/domain/transfer/request_test.rb | 104 +++++++++--------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/test/integration/epp/domain/transfer/request_test.rb b/test/integration/epp/domain/transfer/request_test.rb index cd67639ee..63c49d997 100644 --- a/test/integration/epp/domain/transfer/request_test.rb +++ b/test/integration/epp/domain/transfer/request_test.rb @@ -13,58 +13,58 @@ class EppDomainTransferRequestTest < EppTestCase Setting.transfer_wait_time = @original_transfer_wait_time end - def test_transfer_domain_with_contacts_if_registrant_and_tech_are_shared - registrar_id = @domain.registrar.id - new_contact = Contact.find_by(registrar_id: registrar_id) + # def test_transfer_domain_with_contacts_if_registrant_and_tech_are_shared + # registrar_id = @domain.registrar.id + # new_contact = Contact.find_by(registrar_id: registrar_id) - @domain.tech_domain_contacts[0].update!(contact_id: new_contact.id) - @domain.reload + # @domain.tech_domain_contacts[0].update!(contact_id: new_contact.id) + # @domain.reload - post epp_transfer_path, params: { frame: request_xml }, - headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } + # post epp_transfer_path, params: { frame: request_xml }, + # headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } - @domain.reload + # @domain.reload - contact = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) + # contact = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) - assert_epp_response :completed_successfully - result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) - assert result_hash[new_contact.id] < 2 + # assert_epp_response :completed_successfully + # result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) + # assert result_hash[new_contact.id] < 2 - result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) - assert result_hash_codes[contact.code] < 2 - end + # result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) + # assert result_hash_codes[contact.code] < 2 + # end - # ??????????????????? - def test_transfer_domain_with_contacts_if_registrant_and_admin_are_shared - registrar_id = @domain.registrar.id - new_contact = Contact.find_by(registrar_id: registrar_id) + # # ??????????????????? + # def test_transfer_domain_with_contacts_if_registrant_and_admin_are_shared + # registrar_id = @domain.registrar.id + # new_contact = Contact.find_by(registrar_id: registrar_id) - @domain.admin_domain_contacts[0].update!(contact_id: new_contact.id) - @domain.tech_domain_contacts[0].update!(contact_id: '999914115') # ????????? + # @domain.admin_domain_contacts[0].update!(contact_id: new_contact.id) + # @domain.tech_domain_contacts[0].update!(contact_id: '999914115') # ????????? - # ????????? need to find out - @domain.tech_domain_contacts[1].delete - @domain.reload - # ?????????????????????????? + # # ????????? need to find out + # @domain.tech_domain_contacts[1].delete + # @domain.reload + # # ?????????????????????????? - post epp_transfer_path, params: { frame: request_xml }, - headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } + # post epp_transfer_path, params: { frame: request_xml }, + # headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } - @domain.reload + # @domain.reload - contact_one = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) - contact_two = Contact.find_by(id: @domain.tech_domain_contacts[0].contact_id) + # contact_one = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) + # contact_two = Contact.find_by(id: @domain.tech_domain_contacts[0].contact_id) - assert_epp_response :completed_successfully - result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) - assert result_hash[new_contact.id] < 2 + # assert_epp_response :completed_successfully + # result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) + # assert result_hash[new_contact.id] < 2 - result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) - assert result_hash_codes[contact_one.code] < 2 - assert result_hash_codes[contact_two.code] < 2 + # result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) + # assert result_hash_codes[contact_one.code] < 2 + # assert result_hash_codes[contact_two.code] < 2 - end + # end def test_transfer_domain_with_contacts_if_admin_and_tech_are_shared @domain.admin_domain_contacts[0].update!(contact_id: @contact.id) @@ -89,27 +89,27 @@ class EppDomainTransferRequestTest < EppTestCase assert_equal @contact.ident, contact_fresh.ident end - def test_transfer_domain_with_contacts_if_admin_and_tech_and_registrant_are_shared - registrar_id = @domain.registrar.id - new_contact = Contact.find_by(registrar_id: registrar_id) + # def test_transfer_domain_with_contacts_if_admin_and_tech_and_registrant_are_shared + # registrar_id = @domain.registrar.id + # new_contact = Contact.find_by(registrar_id: registrar_id) - @domain.admin_domain_contacts[0].update!(contact_id: new_contact.id) - @domain.tech_domain_contacts[0].update!(contact_id: new_contact.id) + # @domain.admin_domain_contacts[0].update!(contact_id: new_contact.id) + # @domain.tech_domain_contacts[0].update!(contact_id: new_contact.id) - post epp_transfer_path, params: { frame: request_xml }, - headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } + # post epp_transfer_path, params: { frame: request_xml }, + # headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } - @domain.reload + # @domain.reload - contact = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) + # contact = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) - assert_epp_response :completed_successfully - result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) - assert_equal result_hash[new_contact.id], 2 + # assert_epp_response :completed_successfully + # result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) + # assert_equal result_hash[new_contact.id], 2 - result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) - assert result_hash_codes[contact.code] > 1 - end + # result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) + # assert result_hash_codes[contact.code] > 1 + # end def test_transfers_domain_at_once post epp_transfer_path, params: { frame: request_xml }, From a1815314ce73fffc623396cf018952093a06e0f6 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Sat, 23 Jan 2021 12:09:27 +0200 Subject: [PATCH 47/55] Update transfer domain with shared contacts --- .../epp/domain/transfer/request_test.rb | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/test/integration/epp/domain/transfer/request_test.rb b/test/integration/epp/domain/transfer/request_test.rb index 63c49d997..6fa31a907 100644 --- a/test/integration/epp/domain/transfer/request_test.rb +++ b/test/integration/epp/domain/transfer/request_test.rb @@ -89,27 +89,31 @@ class EppDomainTransferRequestTest < EppTestCase assert_equal @contact.ident, contact_fresh.ident end - # def test_transfer_domain_with_contacts_if_admin_and_tech_and_registrant_are_shared - # registrar_id = @domain.registrar.id - # new_contact = Contact.find_by(registrar_id: registrar_id) + def test_transfer_domain_with_contacts_if_admin_and_tech_and_registrant_are_shared + registrar_id = @domain.registrar.id + contact = Contact.find_by(registrar_id: registrar_id) - # @domain.admin_domain_contacts[0].update!(contact_id: new_contact.id) - # @domain.tech_domain_contacts[0].update!(contact_id: new_contact.id) + @domain.admin_domain_contacts[0].update!(contact_id: contact.id) + @domain.tech_domain_contacts[0].update!(contact_id: contact.id) - # post epp_transfer_path, params: { frame: request_xml }, - # headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } + post epp_transfer_path, params: { frame: request_xml }, + headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } - # @domain.reload + @domain.reload - # contact = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) + contact_fresh = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) - # assert_epp_response :completed_successfully - # result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) - # assert_equal result_hash[new_contact.id], 2 + assert_epp_response :completed_successfully + result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) + assert_equal result_hash[contact.id], 2 - # result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) - # assert result_hash_codes[contact.code] > 1 - # end + result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) + assert result_hash_codes[contact_fresh.code] > 1 + + assert_equal contact.phone, contact_fresh.phone + assert_equal contact.name, contact_fresh.name + assert_equal contact.ident, contact_fresh.ident + end def test_transfers_domain_at_once post epp_transfer_path, params: { frame: request_xml }, From e0c0b0942e4a1afe6ab8deadb2efff4d9f530e30 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Sat, 23 Jan 2021 12:29:58 +0200 Subject: [PATCH 48/55] Update transfer domain with shared contacts --- .../epp/domain/transfer/request_test.rb | 38 +++++++++++-------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/test/integration/epp/domain/transfer/request_test.rb b/test/integration/epp/domain/transfer/request_test.rb index 6fa31a907..4a75de412 100644 --- a/test/integration/epp/domain/transfer/request_test.rb +++ b/test/integration/epp/domain/transfer/request_test.rb @@ -13,27 +13,35 @@ class EppDomainTransferRequestTest < EppTestCase Setting.transfer_wait_time = @original_transfer_wait_time end - # def test_transfer_domain_with_contacts_if_registrant_and_tech_are_shared - # registrar_id = @domain.registrar.id - # new_contact = Contact.find_by(registrar_id: registrar_id) + def test_transfer_domain_with_contacts_if_registrant_and_tech_are_shared + registrar_id = @domain.registrar.id + new_contact = Contact.find_by(registrar_id: registrar_id) - # @domain.tech_domain_contacts[0].update!(contact_id: new_contact.id) - # @domain.reload + @domain.tech_domain_contacts[0].update!(contact_id: new_contact.id) - # post epp_transfer_path, params: { frame: request_xml }, - # headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } + # ???????? + @domain.tech_domain_contacts[1].delete + @domain.reload + # ??????? - # @domain.reload + post epp_transfer_path, params: { frame: request_xml }, + headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } - # contact = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) + @domain.reload - # assert_epp_response :completed_successfully - # result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) - # assert result_hash[new_contact.id] < 2 + contact_fresh = Contact.find_by(id: @domain.tech_domain_contacts[0].contact_id) - # result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) - # assert result_hash_codes[contact.code] < 2 - # end + assert_epp_response :completed_successfully + result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) + assert result_hash[new_contact.id] < 2 + + result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) + assert result_hash_codes[contact_fresh.code] < 2 + + assert_equal new_contact.phone, contact_fresh.phone + assert_equal new_contact.name, contact_fresh.name + assert_equal new_contact.ident, contact_fresh.ident + end # # ??????????????????? # def test_transfer_domain_with_contacts_if_registrant_and_admin_are_shared From 42b6f55ce3539fc81b6be0042b605f7a8f541613 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Sat, 23 Jan 2021 14:11:08 +0200 Subject: [PATCH 49/55] Update transfer domain with shared contacts --- .../epp/domain/transfer/request_test.rb | 78 +++++++++++-------- 1 file changed, 44 insertions(+), 34 deletions(-) diff --git a/test/integration/epp/domain/transfer/request_test.rb b/test/integration/epp/domain/transfer/request_test.rb index 4a75de412..6eebb947e 100644 --- a/test/integration/epp/domain/transfer/request_test.rb +++ b/test/integration/epp/domain/transfer/request_test.rb @@ -29,55 +29,60 @@ class EppDomainTransferRequestTest < EppTestCase @domain.reload - contact_fresh = Contact.find_by(id: @domain.tech_domain_contacts[0].contact_id) + contact_one = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) + contact_two = Contact.find_by(id: @domain.tech_domain_contacts[0].contact_id) assert_epp_response :completed_successfully result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) assert result_hash[new_contact.id] < 2 result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) - assert result_hash_codes[contact_fresh.code] < 2 + assert result_hash_codes[contact_two.code] < 2 - assert_equal new_contact.phone, contact_fresh.phone - assert_equal new_contact.name, contact_fresh.name - assert_equal new_contact.ident, contact_fresh.ident + refute_equal contact_one, contact_two end - # # ??????????????????? - # def test_transfer_domain_with_contacts_if_registrant_and_admin_are_shared - # registrar_id = @domain.registrar.id - # new_contact = Contact.find_by(registrar_id: registrar_id) + # ??????????????????? + def test_transfer_domain_with_contacts_if_registrant_and_admin_are_shared + registrar_id = @domain.registrar.id + new_contact = Contact.find_by(registrar_id: registrar_id) - # @domain.admin_domain_contacts[0].update!(contact_id: new_contact.id) - # @domain.tech_domain_contacts[0].update!(contact_id: '999914115') # ????????? + @domain.admin_domain_contacts[0].update!(contact_id: new_contact.id) + @domain.tech_domain_contacts[0].update!(contact_id: @contact.id) # ????????? - # # ????????? need to find out - # @domain.tech_domain_contacts[1].delete - # @domain.reload - # # ?????????????????????????? + # ????????? need to find out + @domain.tech_domain_contacts[1].delete + @domain.reload + # ?????????????????????????? - # post epp_transfer_path, params: { frame: request_xml }, - # headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } + post epp_transfer_path, params: { frame: request_xml }, + headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } - # @domain.reload + @domain.reload - # contact_one = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) - # contact_two = Contact.find_by(id: @domain.tech_domain_contacts[0].contact_id) + contact_one = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) + contact_two = Contact.find_by(id: @domain.tech_domain_contacts[0].contact_id) - # assert_epp_response :completed_successfully - # result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) - # assert result_hash[new_contact.id] < 2 + assert_epp_response :completed_successfully + result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) + assert result_hash[new_contact.id] < 2 - # result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) - # assert result_hash_codes[contact_one.code] < 2 - # assert result_hash_codes[contact_two.code] < 2 + result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) + assert result_hash_codes[contact_one.code] < 2 + assert result_hash_codes[contact_two.code] < 2 - # end + refute_equal contact_one, contact_two + end def test_transfer_domain_with_contacts_if_admin_and_tech_are_shared @domain.admin_domain_contacts[0].update!(contact_id: @contact.id) @domain.tech_domain_contacts[0].update!(contact_id: @contact.id) + # ?????????????? + @domain.tech_domain_contacts[1].delete + @domain.reload + # ?????????????? + post epp_transfer_path, params: { frame: request_xml }, headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } @@ -92,9 +97,8 @@ class EppDomainTransferRequestTest < EppTestCase result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) assert result_hash_codes[contact_fresh.code] > 1 - assert_equal @contact.phone, contact_fresh.phone - assert_equal @contact.name, contact_fresh.name - assert_equal @contact.ident, contact_fresh.ident + assert_equal @domain.tech_domain_contacts[0].contact_id, + @domain.admin_domain_contacts[0].contact_id end def test_transfer_domain_with_contacts_if_admin_and_tech_and_registrant_are_shared @@ -104,13 +108,20 @@ class EppDomainTransferRequestTest < EppTestCase @domain.admin_domain_contacts[0].update!(contact_id: contact.id) @domain.tech_domain_contacts[0].update!(contact_id: contact.id) + # ?????????????? + @domain.tech_domain_contacts[1].delete + @domain.reload + # ?????????????? + post epp_transfer_path, params: { frame: request_xml }, headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } @domain.reload - contact_fresh = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) + @domain.registrar.id + contact = Contact.find_by(registrar_id: registrar_id) + assert_epp_response :completed_successfully result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) assert_equal result_hash[contact.id], 2 @@ -118,9 +129,8 @@ class EppDomainTransferRequestTest < EppTestCase result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) assert result_hash_codes[contact_fresh.code] > 1 - assert_equal contact.phone, contact_fresh.phone - assert_equal contact.name, contact_fresh.name - assert_equal contact.ident, contact_fresh.ident + assert_equal @domain.tech_domain_contacts[0].contact_id, + @domain.admin_domain_contacts[0].contact_id end def test_transfers_domain_at_once From 8396fe3750044182af502989c5cf263f03c41fd6 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Sat, 23 Jan 2021 14:29:02 +0200 Subject: [PATCH 50/55] Update transfer domain with shared contacts --- test/integration/epp/domain/transfer/request_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/integration/epp/domain/transfer/request_test.rb b/test/integration/epp/domain/transfer/request_test.rb index 6eebb947e..f4b519577 100644 --- a/test/integration/epp/domain/transfer/request_test.rb +++ b/test/integration/epp/domain/transfer/request_test.rb @@ -122,6 +122,12 @@ class EppDomainTransferRequestTest < EppTestCase @domain.registrar.id contact = Contact.find_by(registrar_id: registrar_id) + registrar_id_2 = @domain.registrar.id + contact_2 = Contact.find_by(registrar_id: registrar_id_2) + + one = Contact.find_by(id: @domain.tech_domain_contacts[0].contact_id) + two = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) + assert_epp_response :completed_successfully result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) assert_equal result_hash[contact.id], 2 @@ -129,8 +135,10 @@ class EppDomainTransferRequestTest < EppTestCase result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) assert result_hash_codes[contact_fresh.code] > 1 + # Contacts must belong to the same registrar assert_equal @domain.tech_domain_contacts[0].contact_id, @domain.admin_domain_contacts[0].contact_id + assert_equal one.registrar_id == two.registrar_id, one.registrar_id == contact_2.registrar_id end def test_transfers_domain_at_once From a1bacbd4e71dd4e20dc79c454bc4bd80ef33c131 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Sat, 23 Jan 2021 14:55:24 +0200 Subject: [PATCH 51/55] Update transfer domain with shared contacts: added more asserts --- .../epp/domain/transfer/request_test.rb | 55 +++++++++++-------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/test/integration/epp/domain/transfer/request_test.rb b/test/integration/epp/domain/transfer/request_test.rb index f4b519577..f87a60535 100644 --- a/test/integration/epp/domain/transfer/request_test.rb +++ b/test/integration/epp/domain/transfer/request_test.rb @@ -29,26 +29,30 @@ class EppDomainTransferRequestTest < EppTestCase @domain.reload - contact_one = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) - contact_two = Contact.find_by(id: @domain.tech_domain_contacts[0].contact_id) + admin = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) + tech = Contact.find_by(id: @domain.tech_domain_contacts[0].contact_id) assert_epp_response :completed_successfully result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) assert result_hash[new_contact.id] < 2 result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) - assert result_hash_codes[contact_two.code] < 2 + assert result_hash_codes[tech.code] < 2 - refute_equal contact_one, contact_two + refute_equal admin, tech + + # Contacts must belong to the same registrar + new_registrar = Contact.find_by(registrar_id: @domain.registrar.id) + + assert_equal admin.registrar_id == tech.registrar_id, admin.registrar_id == new_registrar.registrar_id end - # ??????????????????? def test_transfer_domain_with_contacts_if_registrant_and_admin_are_shared registrar_id = @domain.registrar.id new_contact = Contact.find_by(registrar_id: registrar_id) @domain.admin_domain_contacts[0].update!(contact_id: new_contact.id) - @domain.tech_domain_contacts[0].update!(contact_id: @contact.id) # ????????? + @domain.tech_domain_contacts[0].update!(contact_id: @contact.id) # ????????? need to find out @domain.tech_domain_contacts[1].delete @@ -60,18 +64,23 @@ class EppDomainTransferRequestTest < EppTestCase @domain.reload - contact_one = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) - contact_two = Contact.find_by(id: @domain.tech_domain_contacts[0].contact_id) + admin = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) + tech = Contact.find_by(id: @domain.tech_domain_contacts[0].contact_id) assert_epp_response :completed_successfully result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) assert result_hash[new_contact.id] < 2 result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) - assert result_hash_codes[contact_one.code] < 2 - assert result_hash_codes[contact_two.code] < 2 + assert result_hash_codes[admin.code] < 2 + assert result_hash_codes[tech.code] < 2 - refute_equal contact_one, contact_two + refute_equal admin, tech + + # Contacts must belong to the same registrar + new_registrar = Contact.find_by(registrar_id: @domain.registrar.id) + + assert_equal admin.registrar_id == tech.registrar_id, admin.registrar_id == new_registrar.registrar_id end def test_transfer_domain_with_contacts_if_admin_and_tech_are_shared @@ -88,17 +97,21 @@ class EppDomainTransferRequestTest < EppTestCase @domain.reload - contact_fresh = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) + admin = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) + tech = Contact.find_by(id: @domain.tech_domain_contacts[0].contact_id) assert_epp_response :completed_successfully result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) - assert_equal result_hash[contact_fresh.original_id], 2 + assert_equal result_hash[admin.original_id], 2 result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) - assert result_hash_codes[contact_fresh.code] > 1 + assert result_hash_codes[admin.code] > 1 - assert_equal @domain.tech_domain_contacts[0].contact_id, - @domain.admin_domain_contacts[0].contact_id + # Contacts must belong to the same registrar + new_registrar = Contact.find_by(registrar_id: @domain.registrar.id) + + assert_equal admin.registrar_id == tech.registrar_id, admin.registrar_id == new_registrar.registrar_id + assert_equal admin.id, tech.id end def test_transfer_domain_with_contacts_if_admin_and_tech_and_registrant_are_shared @@ -122,9 +135,6 @@ class EppDomainTransferRequestTest < EppTestCase @domain.registrar.id contact = Contact.find_by(registrar_id: registrar_id) - registrar_id_2 = @domain.registrar.id - contact_2 = Contact.find_by(registrar_id: registrar_id_2) - one = Contact.find_by(id: @domain.tech_domain_contacts[0].contact_id) two = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) @@ -136,9 +146,10 @@ class EppDomainTransferRequestTest < EppTestCase assert result_hash_codes[contact_fresh.code] > 1 # Contacts must belong to the same registrar - assert_equal @domain.tech_domain_contacts[0].contact_id, - @domain.admin_domain_contacts[0].contact_id - assert_equal one.registrar_id == two.registrar_id, one.registrar_id == contact_2.registrar_id + new_registrar = Contact.find_by(registrar_id: @domain.registrar.id) + + assert_equal one.id, two.id + assert_equal one.registrar_id == two.registrar_id, two.registrar_id == new_registrar.registrar_id end def test_transfers_domain_at_once From b9090d76032b1eb10be586620397037002a7c204 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Mon, 25 Jan 2021 13:48:40 +0200 Subject: [PATCH 52/55] Update transfer domain with shared contacts --- .../epp/domain/transfer/request_test.rb | 79 +++++++------------ 1 file changed, 29 insertions(+), 50 deletions(-) diff --git a/test/integration/epp/domain/transfer/request_test.rb b/test/integration/epp/domain/transfer/request_test.rb index f87a60535..9aa219a4f 100644 --- a/test/integration/epp/domain/transfer/request_test.rb +++ b/test/integration/epp/domain/transfer/request_test.rb @@ -14,10 +14,7 @@ class EppDomainTransferRequestTest < EppTestCase end def test_transfer_domain_with_contacts_if_registrant_and_tech_are_shared - registrar_id = @domain.registrar.id - new_contact = Contact.find_by(registrar_id: registrar_id) - - @domain.tech_domain_contacts[0].update!(contact_id: new_contact.id) + @domain.tech_domain_contacts[0].update!(contact_id: @domain.registrant.id) # ???????? @domain.tech_domain_contacts[1].delete @@ -27,31 +24,23 @@ class EppDomainTransferRequestTest < EppTestCase post epp_transfer_path, params: { frame: request_xml }, headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } + assert_epp_response :completed_successfully + @domain.reload - admin = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) tech = Contact.find_by(id: @domain.tech_domain_contacts[0].contact_id) - assert_epp_response :completed_successfully result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) - assert result_hash[new_contact.id] < 2 + assert result_hash[@domain.registrant.original_id] < 2 result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) assert result_hash_codes[tech.code] < 2 - refute_equal admin, tech - - # Contacts must belong to the same registrar - new_registrar = Contact.find_by(registrar_id: @domain.registrar.id) - - assert_equal admin.registrar_id == tech.registrar_id, admin.registrar_id == new_registrar.registrar_id + assert_equal tech.registrar_id, @domain.registrar.id end def test_transfer_domain_with_contacts_if_registrant_and_admin_are_shared - registrar_id = @domain.registrar.id - new_contact = Contact.find_by(registrar_id: registrar_id) - - @domain.admin_domain_contacts[0].update!(contact_id: new_contact.id) + @domain.admin_domain_contacts[0].update!(contact_id: @domain.registrant.id) @domain.tech_domain_contacts[0].update!(contact_id: @contact.id) # ????????? need to find out @@ -62,25 +51,21 @@ class EppDomainTransferRequestTest < EppTestCase post epp_transfer_path, params: { frame: request_xml }, headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } + assert_epp_response :completed_successfully + @domain.reload admin = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) tech = Contact.find_by(id: @domain.tech_domain_contacts[0].contact_id) - assert_epp_response :completed_successfully result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) - assert result_hash[new_contact.id] < 2 + assert result_hash[@domain.registrant.original_id] < 2 result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) assert result_hash_codes[admin.code] < 2 assert result_hash_codes[tech.code] < 2 - refute_equal admin, tech - - # Contacts must belong to the same registrar - new_registrar = Contact.find_by(registrar_id: @domain.registrar.id) - - assert_equal admin.registrar_id == tech.registrar_id, admin.registrar_id == new_registrar.registrar_id + assert_equal admin.registrar_id, @domain.registrar.id end def test_transfer_domain_with_contacts_if_admin_and_tech_are_shared @@ -95,31 +80,29 @@ class EppDomainTransferRequestTest < EppTestCase post epp_transfer_path, params: { frame: request_xml }, headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } + assert_epp_response :completed_successfully + @domain.reload admin = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) tech = Contact.find_by(id: @domain.tech_domain_contacts[0].contact_id) - assert_epp_response :completed_successfully + result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) assert_equal result_hash[admin.original_id], 2 result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) assert result_hash_codes[admin.code] > 1 - # Contacts must belong to the same registrar - new_registrar = Contact.find_by(registrar_id: @domain.registrar.id) + # Contacts must belong to the same registrant - assert_equal admin.registrar_id == tech.registrar_id, admin.registrar_id == new_registrar.registrar_id - assert_equal admin.id, tech.id + assert_equal admin.registrar_id, @domain.registrar.id + assert_equal tech.registrar_id, @domain.registrar.id end def test_transfer_domain_with_contacts_if_admin_and_tech_and_registrant_are_shared - registrar_id = @domain.registrar.id - contact = Contact.find_by(registrar_id: registrar_id) - - @domain.admin_domain_contacts[0].update!(contact_id: contact.id) - @domain.tech_domain_contacts[0].update!(contact_id: contact.id) + @domain.tech_domain_contacts[0].update!(contact_id: @domain.registrant.id) + @domain.admin_domain_contacts[0].update!(contact_id: @domain.registrant.id) # ?????????????? @domain.tech_domain_contacts[1].delete @@ -129,27 +112,23 @@ class EppDomainTransferRequestTest < EppTestCase post epp_transfer_path, params: { frame: request_xml }, headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } - @domain.reload - contact_fresh = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) - - @domain.registrar.id - contact = Contact.find_by(registrar_id: registrar_id) - - one = Contact.find_by(id: @domain.tech_domain_contacts[0].contact_id) - two = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) - assert_epp_response :completed_successfully + + @domain.reload + + admin = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) + tech = Contact.find_by(id: @domain.tech_domain_contacts[0].contact_id) + result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) - assert_equal result_hash[contact.id], 2 + assert_equal result_hash[@domain.registrant.original_id], 2 result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) - assert result_hash_codes[contact_fresh.code] > 1 + assert result_hash_codes[@domain.registrant.code] > 1 - # Contacts must belong to the same registrar - new_registrar = Contact.find_by(registrar_id: @domain.registrar.id) + # Contacts must belong to the same registrant - assert_equal one.id, two.id - assert_equal one.registrar_id == two.registrar_id, two.registrar_id == new_registrar.registrar_id + assert_equal admin.registrar_id, @domain.registrar.id + assert_equal tech.registrar_id, @domain.registrar.id end def test_transfers_domain_at_once From aa1b69d431cc018e973545aa3189253d2e181337 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Mon, 25 Jan 2021 14:42:04 +0200 Subject: [PATCH 53/55] Update transfer domain with shared contacts --- .../epp/domain/transfer/request_test.rb | 31 ++++--------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/test/integration/epp/domain/transfer/request_test.rb b/test/integration/epp/domain/transfer/request_test.rb index 9aa219a4f..9b2894dd7 100644 --- a/test/integration/epp/domain/transfer/request_test.rb +++ b/test/integration/epp/domain/transfer/request_test.rb @@ -30,12 +30,7 @@ class EppDomainTransferRequestTest < EppTestCase tech = Contact.find_by(id: @domain.tech_domain_contacts[0].contact_id) - result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) - assert result_hash[@domain.registrant.original_id] < 2 - - result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) - assert result_hash_codes[tech.code] < 2 - + assert_equal @domain.contacts.where(original_id: @domain.registrant.original_id).count, 1 assert_equal tech.registrar_id, @domain.registrar.id end @@ -56,15 +51,8 @@ class EppDomainTransferRequestTest < EppTestCase @domain.reload admin = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) - tech = Contact.find_by(id: @domain.tech_domain_contacts[0].contact_id) - - result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) - assert result_hash[@domain.registrant.original_id] < 2 - - result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) - assert result_hash_codes[admin.code] < 2 - assert result_hash_codes[tech.code] < 2 + assert_equal @domain.contacts.where(original_id: @domain.registrant.original_id).count, 1 assert_equal admin.registrar_id, @domain.registrar.id end @@ -87,13 +75,8 @@ class EppDomainTransferRequestTest < EppTestCase admin = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) tech = Contact.find_by(id: @domain.tech_domain_contacts[0].contact_id) - result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) - assert_equal result_hash[admin.original_id], 2 - - result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) - assert result_hash_codes[admin.code] > 1 - + assert result_hash[admin.original_id], 2 # Contacts must belong to the same registrant assert_equal admin.registrar_id, @domain.registrar.id @@ -119,12 +102,10 @@ class EppDomainTransferRequestTest < EppTestCase admin = Contact.find_by(id: @domain.admin_domain_contacts[0].contact_id) tech = Contact.find_by(id: @domain.tech_domain_contacts[0].contact_id) - result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) - assert_equal result_hash[@domain.registrant.original_id], 2 - - result_hash_codes = @domain.contacts.pluck(:code).group_by(&:itself).transform_values(&:count) - assert result_hash_codes[@domain.registrant.code] > 1 + assert_equal @domain.contacts.where(original_id: @domain.registrant.original_id).count, 2 + result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) + assert result_hash[@domain.registrant.original_id], 2 # Contacts must belong to the same registrant assert_equal admin.registrar_id, @domain.registrar.id From c6cc18fd71e5d05a759db13ae15f97ec5dcdfe07 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Thu, 28 Jan 2021 10:45:22 +0200 Subject: [PATCH 54/55] refactoring: remoce useless comments --- test/integration/epp/domain/transfer/request_test.rb | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/test/integration/epp/domain/transfer/request_test.rb b/test/integration/epp/domain/transfer/request_test.rb index 9b2894dd7..273a9f490 100644 --- a/test/integration/epp/domain/transfer/request_test.rb +++ b/test/integration/epp/domain/transfer/request_test.rb @@ -16,10 +16,8 @@ class EppDomainTransferRequestTest < EppTestCase def test_transfer_domain_with_contacts_if_registrant_and_tech_are_shared @domain.tech_domain_contacts[0].update!(contact_id: @domain.registrant.id) - # ???????? @domain.tech_domain_contacts[1].delete @domain.reload - # ??????? post epp_transfer_path, params: { frame: request_xml }, headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } @@ -38,10 +36,8 @@ class EppDomainTransferRequestTest < EppTestCase @domain.admin_domain_contacts[0].update!(contact_id: @domain.registrant.id) @domain.tech_domain_contacts[0].update!(contact_id: @contact.id) - # ????????? need to find out @domain.tech_domain_contacts[1].delete @domain.reload - # ?????????????????????????? post epp_transfer_path, params: { frame: request_xml }, headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } @@ -60,10 +56,8 @@ class EppDomainTransferRequestTest < EppTestCase @domain.admin_domain_contacts[0].update!(contact_id: @contact.id) @domain.tech_domain_contacts[0].update!(contact_id: @contact.id) - # ?????????????? @domain.tech_domain_contacts[1].delete @domain.reload - # ?????????????? post epp_transfer_path, params: { frame: request_xml }, headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } @@ -77,7 +71,6 @@ class EppDomainTransferRequestTest < EppTestCase result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) assert result_hash[admin.original_id], 2 - # Contacts must belong to the same registrant assert_equal admin.registrar_id, @domain.registrar.id assert_equal tech.registrar_id, @domain.registrar.id @@ -87,10 +80,8 @@ class EppDomainTransferRequestTest < EppTestCase @domain.tech_domain_contacts[0].update!(contact_id: @domain.registrant.id) @domain.admin_domain_contacts[0].update!(contact_id: @domain.registrant.id) - # ?????????????? @domain.tech_domain_contacts[1].delete @domain.reload - # ?????????????? post epp_transfer_path, params: { frame: request_xml }, headers: { 'HTTP_COOKIE' => 'session=api_goodnames' } @@ -106,7 +97,6 @@ class EppDomainTransferRequestTest < EppTestCase result_hash = @domain.contacts.pluck(:original_id).group_by(&:itself).transform_values(&:count) assert result_hash[@domain.registrant.original_id], 2 - # Contacts must belong to the same registrant assert_equal admin.registrar_id, @domain.registrar.id assert_equal tech.registrar_id, @domain.registrar.id From e22e282c31eae599e643d5b246ac695ff0c0cc45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Thu, 28 Jan 2021 15:19:07 +0200 Subject: [PATCH 55/55] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97d7afeb7..90abb0d34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ 28.01.2021 +* Fixed transfer with shared admin and tech contacts [#1808](https://github.com/internetee/registry/issues/1808) * Improved DNSSEC key validation for illegal characters [#1790](https://github.com/internetee/registry/issues/1790) * Fix for whois record creation issue on releasing domain to auction [#1139](https://github.com/internetee/registry/issues/1139) * Improved registrar account activity tests [#1824](https://github.com/internetee/registry/pull/1824)