From 20ecd289a0682decf259df9a5993866d3d36463c Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Thu, 29 Apr 2021 16:13:45 +0300 Subject: [PATCH 01/32] whois migration files --- ...180515105348_add_contact_requests_table.rb | 21 +++++ ...ign_key_constraint_from_contact_request.rb | 5 ++ ...0181102124618_remove_whois_records_body.rb | 9 ++ ...73130_add_message_id_to_contact_request.rb | 5 ++ db/structure.sql | 86 ++++++++++++++++++- 5 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20180515105348_add_contact_requests_table.rb create mode 100644 db/migrate/20180627115124_remove_foreign_key_constraint_from_contact_request.rb create mode 100644 db/migrate/20181102124618_remove_whois_records_body.rb create mode 100644 db/migrate/20200914073130_add_message_id_to_contact_request.rb diff --git a/db/migrate/20180515105348_add_contact_requests_table.rb b/db/migrate/20180515105348_add_contact_requests_table.rb new file mode 100644 index 000000000..582a13b82 --- /dev/null +++ b/db/migrate/20180515105348_add_contact_requests_table.rb @@ -0,0 +1,21 @@ +class AddContactRequestsTable < ActiveRecord::Migration[5.0] + def change + # create_table :contact_requests do |t| + # t.integer :whois_record_id, null: false + # t.string :secret, null: false + # t.string :email, null: false + # t.string :name, null: false + # t.datetime :valid_to, null: false + # t.string :status, null: false, default: 'new' + # t.inet :ip_address + + # t.timestamps null: false + # end + + # add_foreign_key :contact_requests, :whois_records + # add_index :contact_requests, :secret, unique: true + # add_index :contact_requests, :email + # add_index :contact_requests, :ip_address + # add_index :contact_requests, :whois_record_id + end +end diff --git a/db/migrate/20180627115124_remove_foreign_key_constraint_from_contact_request.rb b/db/migrate/20180627115124_remove_foreign_key_constraint_from_contact_request.rb new file mode 100644 index 000000000..7632efd12 --- /dev/null +++ b/db/migrate/20180627115124_remove_foreign_key_constraint_from_contact_request.rb @@ -0,0 +1,5 @@ +class RemoveForeignKeyConstraintFromContactRequest < ActiveRecord::Migration[5.0] + def change + # remove_foreign_key :contact_requests, :whois_records + end +end diff --git a/db/migrate/20181102124618_remove_whois_records_body.rb b/db/migrate/20181102124618_remove_whois_records_body.rb new file mode 100644 index 000000000..24124ebdf --- /dev/null +++ b/db/migrate/20181102124618_remove_whois_records_body.rb @@ -0,0 +1,9 @@ +class RemoveWhoisRecordsBody < ActiveRecord::Migration[5.2] + def up + # remove_column :whois_records, :body + end + + def down + # add_column :whois_records, :body, :text + end +end diff --git a/db/migrate/20200914073130_add_message_id_to_contact_request.rb b/db/migrate/20200914073130_add_message_id_to_contact_request.rb new file mode 100644 index 000000000..5f4254d42 --- /dev/null +++ b/db/migrate/20200914073130_add_message_id_to_contact_request.rb @@ -0,0 +1,5 @@ +class AddMessageIdToContactRequest < ActiveRecord::Migration[6.0] + def change + # add_column :contact_requests, :message_id, :string + end +end diff --git a/db/structure.sql b/db/structure.sql index 01565d2f9..09589d325 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -536,6 +536,44 @@ CREATE SEQUENCE public.certificates_id_seq ALTER SEQUENCE public.certificates_id_seq OWNED BY public.certificates.id; +-- +-- Name: contact_requests; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.contact_requests ( + id integer NOT NULL, + whois_record_id integer NOT NULL, + secret character varying NOT NULL, + email character varying NOT NULL, + name character varying NOT NULL, + valid_to timestamp without time zone NOT NULL, + status character varying DEFAULT 'new'::character varying NOT NULL, + ip_address inet, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, + message_id character varying +); + + +-- +-- Name: contact_requests_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.contact_requests_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: contact_requests_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE public.contact_requests_id_seq OWNED BY public.contact_requests.id; + + -- -- Name: contacts; Type: TABLE; Schema: public; Owner: - -- @@ -2602,7 +2640,6 @@ CREATE TABLE public.whois_records ( id integer NOT NULL, domain_id integer, name character varying, - body text, json json, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, @@ -2735,6 +2772,13 @@ ALTER TABLE ONLY public.bounced_mail_addresses ALTER COLUMN id SET DEFAULT nextv ALTER TABLE ONLY public.certificates ALTER COLUMN id SET DEFAULT nextval('public.certificates_id_seq'::regclass); +-- +-- Name: contact_requests id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.contact_requests ALTER COLUMN id SET DEFAULT nextval('public.contact_requests_id_seq'::regclass); + + -- -- Name: contacts id; Type: DEFAULT; Schema: public; Owner: - -- @@ -3193,6 +3237,14 @@ ALTER TABLE ONLY public.certificates ADD CONSTRAINT certificates_pkey PRIMARY KEY (id); +-- +-- Name: contact_requests contact_requests_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.contact_requests + ADD CONSTRAINT contact_requests_pkey PRIMARY KEY (id); + + -- -- Name: contacts contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -3780,6 +3832,34 @@ CREATE INDEX index_accounts_on_registrar_id ON public.accounts USING btree (regi CREATE INDEX index_certificates_on_api_user_id ON public.certificates USING btree (api_user_id); +-- +-- Name: index_contact_requests_on_email; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_contact_requests_on_email ON public.contact_requests USING btree (email); + + +-- +-- Name: index_contact_requests_on_ip_address; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_contact_requests_on_ip_address ON public.contact_requests USING btree (ip_address); + + +-- +-- Name: index_contact_requests_on_secret; Type: INDEX; Schema: public; Owner: - +-- + +CREATE UNIQUE INDEX index_contact_requests_on_secret ON public.contact_requests USING btree (secret); + + +-- +-- Name: index_contact_requests_on_whois_record_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_contact_requests_on_whois_record_id ON public.contact_requests USING btree (whois_record_id); + + -- -- Name: index_contacts_on_code; Type: INDEX; Schema: public; Owner: - -- @@ -4895,11 +4975,13 @@ INSERT INTO "schema_migrations" (version) VALUES ('20180327151906'), ('20180331200125'), ('20180422154642'), +('20180515105348'), ('20180612042234'), ('20180612042625'), ('20180612042953'), ('20180613030330'), ('20180613045614'), +('20180627115124'), ('20180713154915'), ('20180801114403'), ('20180808064402'), @@ -4924,6 +5006,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20181017154143'), ('20181017205123'), ('20181022100114'), +('20181102124618'), ('20181108154921'), ('20181129150515'), ('20181212105100'), @@ -5016,6 +5099,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200908131554'), ('20200910085157'), ('20200910102028'), +('20200914073130'), ('20200916125326'), ('20200917104213'), ('20200921084356'), From 2c37e30923a6f4c73c9556bad29a99a5bd2dd744 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Mon, 17 May 2021 13:35:15 +0300 Subject: [PATCH 02/32] changed method for add additional mails in status notes --- .../clear_force_delete_data.rb | 2 +- .../domains/force_delete_email/base.rb | 18 +++++++++++++++++- .../registrar/contacts/form/_address.haml | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/app/interactions/domains/cancel_force_delete/clear_force_delete_data.rb b/app/interactions/domains/cancel_force_delete/clear_force_delete_data.rb index 1e6bcccd9..8fe6dfbb4 100644 --- a/app/interactions/domains/cancel_force_delete/clear_force_delete_data.rb +++ b/app/interactions/domains/cancel_force_delete/clear_force_delete_data.rb @@ -5,7 +5,7 @@ module Domains domain.force_delete_data = nil domain.force_delete_date = nil domain.force_delete_start = nil - domain.status_notes[DomainStatus::FORCE_DELETE] = nil + domain.status_notes[DomainStatus::FORCE_DELETE] = '' domain.save(validate: false) end end diff --git a/app/interactions/domains/force_delete_email/base.rb b/app/interactions/domains/force_delete_email/base.rb index f2ac9b5f2..49976a3f1 100644 --- a/app/interactions/domains/force_delete_email/base.rb +++ b/app/interactions/domains/force_delete_email/base.rb @@ -11,7 +11,13 @@ module Domains domains = domain_contacts.map(&:domain).flatten + Domain.where(registrant_id: registrant_ids) - domains.each { |domain| process_force_delete(domain) unless domain.force_delete_scheduled? } + domains.each do |domain| + if domain.force_delete_scheduled? + added_additional_email_into_notes(domain) + else + process_force_delete(domain) + end + end end private @@ -24,7 +30,17 @@ module Domains save_status_note(domain) end + def added_additional_email_into_notes(domain) + if !domain.status_notes[DomainStatus::FORCE_DELETE].include? email + domain.status_notes[DomainStatus::FORCE_DELETE].concat(" " + email) + domain.save(validate: false) + end + end + def save_status_note(domain) + # puts "Is blank? #{domain.status_notes[DomainStatus::FORCE_DELETE].blank?}" -> true + # puts "Is nil? #{domain.status_notes[DomainStatus::FORCE_DELETE].nil?}" -> true + # puts "Is present? #{domain.status_notes[DomainStatus::FORCE_DELETE].present?}" -> false domain.status_notes[DomainStatus::FORCE_DELETE] = email domain.save(validate: false) end diff --git a/app/views/registrar/contacts/form/_address.haml b/app/views/registrar/contacts/form/_address.haml index 7789c2891..e70d00cd8 100644 --- a/app/views/registrar/contacts/form/_address.haml +++ b/app/views/registrar/contacts/form/_address.haml @@ -31,6 +31,6 @@ = f.label :country_code, t(:country) + '*' .col-md-7 - country_selected = f.object.persisted? ? f.object.country_code : 'EE' - = f.select(:country_code, SApplicationController.helpers.all_country_options(country_selected), + = f.select(:country_code, ApplicationController.helpers.all_country_options(country_selected), { include_blank: true }, required: true) From 6663609550680be9777c3fdf4991a0bf8336cbd2 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Mon, 17 May 2021 13:44:40 +0300 Subject: [PATCH 03/32] refactoring --- .../domains/cancel_force_delete/clear_force_delete_data.rb | 2 +- app/interactions/domains/force_delete_email/base.rb | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/app/interactions/domains/cancel_force_delete/clear_force_delete_data.rb b/app/interactions/domains/cancel_force_delete/clear_force_delete_data.rb index 8fe6dfbb4..1e6bcccd9 100644 --- a/app/interactions/domains/cancel_force_delete/clear_force_delete_data.rb +++ b/app/interactions/domains/cancel_force_delete/clear_force_delete_data.rb @@ -5,7 +5,7 @@ module Domains domain.force_delete_data = nil domain.force_delete_date = nil domain.force_delete_start = nil - domain.status_notes[DomainStatus::FORCE_DELETE] = '' + domain.status_notes[DomainStatus::FORCE_DELETE] = nil domain.save(validate: false) end end diff --git a/app/interactions/domains/force_delete_email/base.rb b/app/interactions/domains/force_delete_email/base.rb index 49976a3f1..7088be7fa 100644 --- a/app/interactions/domains/force_delete_email/base.rb +++ b/app/interactions/domains/force_delete_email/base.rb @@ -12,7 +12,7 @@ module Domains Domain.where(registrant_id: registrant_ids) domains.each do |domain| - if domain.force_delete_scheduled? + if domain.force_delete_scheduled? && !domain.status_notes[DomainStatus::FORCE_DELETE].nil? added_additional_email_into_notes(domain) else process_force_delete(domain) @@ -38,9 +38,6 @@ module Domains end def save_status_note(domain) - # puts "Is blank? #{domain.status_notes[DomainStatus::FORCE_DELETE].blank?}" -> true - # puts "Is nil? #{domain.status_notes[DomainStatus::FORCE_DELETE].nil?}" -> true - # puts "Is present? #{domain.status_notes[DomainStatus::FORCE_DELETE].present?}" -> false domain.status_notes[DomainStatus::FORCE_DELETE] = email domain.save(validate: false) end From 0ccfd0d8d475b2a83ab3f56bdaf716eb04ecca29 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Mon, 17 May 2021 14:10:28 +0300 Subject: [PATCH 04/32] added test --- .../domains/force_delete_email/base.rb | 6 ++-- test/models/domain/force_delete_test.rb | 33 +++++++++++++++++++ 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/app/interactions/domains/force_delete_email/base.rb b/app/interactions/domains/force_delete_email/base.rb index 7088be7fa..af048d48f 100644 --- a/app/interactions/domains/force_delete_email/base.rb +++ b/app/interactions/domains/force_delete_email/base.rb @@ -11,7 +11,7 @@ module Domains domains = domain_contacts.map(&:domain).flatten + Domain.where(registrant_id: registrant_ids) - domains.each do |domain| + domains.each do |domain| if domain.force_delete_scheduled? && !domain.status_notes[DomainStatus::FORCE_DELETE].nil? added_additional_email_into_notes(domain) else @@ -31,8 +31,8 @@ module Domains end def added_additional_email_into_notes(domain) - if !domain.status_notes[DomainStatus::FORCE_DELETE].include? email - domain.status_notes[DomainStatus::FORCE_DELETE].concat(" " + email) + unless domain.status_notes[DomainStatus::FORCE_DELETE].include? email + domain.status_notes[DomainStatus::FORCE_DELETE].concat(' ' + email) domain.save(validate: false) end end diff --git a/test/models/domain/force_delete_test.rb b/test/models/domain/force_delete_test.rb index 3323e98a3..246a029cf 100644 --- a/test/models/domain/force_delete_test.rb +++ b/test/models/domain/force_delete_test.rb @@ -385,6 +385,39 @@ class ForceDeleteTest < ActionMailer::TestCase assert notification.text.include? asserted_text end + def test_domain_should_have_several_bounced_emails + @domain.update(valid_to: Time.zone.parse('2012-08-05')) + assert_not @domain.force_delete_scheduled? + travel_to Time.zone.parse('2010-07-05') + email_one = 'one@strangesentence@internet.ee' + email_two = 'two@strangesentence@internet.ee' + asserted_text_one = "Invalid email: #{email_one}" + asserted_text_two = "Invalid email: #{email_two}" + + contact_one = @domain.admin_contacts.first + contact_one.update_attribute(:email, email_one) + contact_one.email_verification.verify + + assert contact_one.email_verification_failed? + + contact_two = @domain.admin_contacts.first + contact_two.update_attribute(:email, email_two) + contact_two.email_verification.verify + + assert contact_one.email_verification_failed? + + @domain.reload + + assert @domain.force_delete_scheduled? + assert_equal 'invalid_email', @domain.template_name + assert_equal Date.parse('2010-09-19'), @domain.force_delete_date.to_date + assert_equal Date.parse('2010-08-05'), @domain.force_delete_start.to_date + assert @domain.status_notes[DomainStatus::FORCE_DELETE].include? email_one + assert @domain.status_notes[DomainStatus::FORCE_DELETE].include? email_two + notification = @domain.registrar.notifications.last + assert notification.text.include? asserted_text + end + def test_lifts_force_delete_if_contact_fixed @domain.update(valid_to: Time.zone.parse('2012-08-05')) assert_not @domain.force_delete_scheduled? From 4a8bdc14a18c91294d12fca89d1ed9a1ed9eee5f Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Mon, 17 May 2021 14:30:58 +0300 Subject: [PATCH 05/32] refactoring --- .../domains/force_delete_email/base.rb | 22 +++++++++++-------- test/models/domain/force_delete_test.rb | 2 -- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/app/interactions/domains/force_delete_email/base.rb b/app/interactions/domains/force_delete_email/base.rb index af048d48f..291dcd136 100644 --- a/app/interactions/domains/force_delete_email/base.rb +++ b/app/interactions/domains/force_delete_email/base.rb @@ -12,16 +12,20 @@ module Domains Domain.where(registrant_id: registrant_ids) domains.each do |domain| - if domain.force_delete_scheduled? && !domain.status_notes[DomainStatus::FORCE_DELETE].nil? - added_additional_email_into_notes(domain) - else - process_force_delete(domain) - end + before_execute_force_delete(domain) end end private + def before_execute_force_delete(domain) + if domain.force_delete_scheduled? && !domain.status_notes[DomainStatus::FORCE_DELETE].nil? + added_additional_email_into_notes(domain) + else + process_force_delete(domain) + end + end + def process_force_delete(domain) domain.schedule_force_delete(type: :soft, notify_by_email: true, @@ -31,10 +35,10 @@ module Domains end def added_additional_email_into_notes(domain) - unless domain.status_notes[DomainStatus::FORCE_DELETE].include? email - domain.status_notes[DomainStatus::FORCE_DELETE].concat(' ' + email) - domain.save(validate: false) - end + return if domain.status_notes[DomainStatus::FORCE_DELETE].include? email + + domain.status_notes[DomainStatus::FORCE_DELETE].concat(' ' + email) + domain.save(validate: false) end def save_status_note(domain) diff --git a/test/models/domain/force_delete_test.rb b/test/models/domain/force_delete_test.rb index 246a029cf..1ee0bc77e 100644 --- a/test/models/domain/force_delete_test.rb +++ b/test/models/domain/force_delete_test.rb @@ -414,8 +414,6 @@ class ForceDeleteTest < ActionMailer::TestCase assert_equal Date.parse('2010-08-05'), @domain.force_delete_start.to_date assert @domain.status_notes[DomainStatus::FORCE_DELETE].include? email_one assert @domain.status_notes[DomainStatus::FORCE_DELETE].include? email_two - notification = @domain.registrar.notifications.last - assert notification.text.include? asserted_text end def test_lifts_force_delete_if_contact_fixed From 12dd02d27c1c37c642aa65a694f8f98ebdfa03b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Thu, 20 May 2021 18:23:08 +0300 Subject: [PATCH 06/32] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75c5d3e8f..5f13ccc68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +20.05.2021 +* Moved data migrationd from whois project to registry [#1928](https://github.com/internetee/registry/issues/1928) + 19.05.2021 * Fix for contact update via registrant portal [#1968](https://github.com/internetee/registry/pull/1968) * REPP is returning domain count with domain list for improved pagination handling [#1969](https://github.com/internetee/registry/pull/1969) From 5b276dd7294a1f558ed743dae4ab003e21f77a2d Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Fri, 21 May 2021 12:36:04 +0300 Subject: [PATCH 07/32] changed list of email received --- app/models/domain.rb | 5 ++-- .../expire_period/process_expired_test.rb | 27 +++++++++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 test/interactions/expire_period/process_expired_test.rb diff --git a/app/models/domain.rb b/app/models/domain.rb index 127643f54..9afde0891 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -671,9 +671,8 @@ class Domain < ApplicationRecord end def expired_domain_contact_emails - force_delete_contact_emails.reject do |email| - BouncedMailAddress.where(email: email).count.positive? - end + (primary_contact_emails + + ["info@#{name}", "#{prepared_domain_name}@#{name}"]).uniq end def all_related_emails diff --git a/test/interactions/expire_period/process_expired_test.rb b/test/interactions/expire_period/process_expired_test.rb new file mode 100644 index 000000000..1b60ce319 --- /dev/null +++ b/test/interactions/expire_period/process_expired_test.rb @@ -0,0 +1,27 @@ +require 'test_helper' + +class StartTest < ActiveSupport::TestCase + include ActionMailer::TestHelper + + setup do + @domain = domains(:shop) + @domain.update(expire_time: Time.zone.now - 1.day) + ActionMailer::Base.deliveries.clear + end + + def test_expired_domain_contact_emails_should_not_contain_tech_contacts + contact_list = [] + @domain.tech_contacts.each do |contact| + contact_list << contact.email + end + + email_address = @domain.expired_domain_contact_emails + email = DomainExpireMailer.expired_soft(domain: @domain, + registrar: @domain.registrar, + email: email_address).deliver_now + + email.to.each do |received| + assert_not contact_list.include? received + end + end +end From 8206e58bf24e75946d6e47d56f426ab9bf2db3c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Fri, 21 May 2021 15:45:45 +0300 Subject: [PATCH 08/32] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f13ccc68..a5447e074 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +21.05.2021 +* Tech contacts do not receive expiration emails any more [#1996](https://github.com/internetee/registry/issues/1996) + 20.05.2021 * Moved data migrationd from whois project to registry [#1928](https://github.com/internetee/registry/issues/1928) From 22d55f1e3e3b2246a4cdcb13ff696381489b05a4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 May 2021 05:02:42 +0000 Subject: [PATCH 09/32] Bump puma from 5.3.1 to 5.3.2 Bumps [puma](https://github.com/puma/puma) from 5.3.1 to 5.3.2. - [Release notes](https://github.com/puma/puma/releases) - [Changelog](https://github.com/puma/puma/blob/master/History.md) - [Commits](https://github.com/puma/puma/compare/v5.3.1...v5.3.2) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index b18b06ce1..cc631691b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -341,7 +341,7 @@ GEM coderay (~> 1.1) method_source (~> 1.0) public_suffix (4.0.6) - puma (5.3.1) + puma (5.3.2) nio4r (~> 2.0) que (0.14.3) que-web (0.7.2) From 7a1708f477b467a31bdea70b66cff10825da828a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 May 2021 05:03:20 +0000 Subject: [PATCH 10/32] Bump nokogiri from 1.11.4 to 1.11.5 Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.4 to 1.11.5. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.4...v1.11.5) Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 58b1fde36..952d42dfa 100644 --- a/Gemfile +++ b/Gemfile @@ -24,7 +24,7 @@ gem 'validates_email_format_of', '1.6.3' # validates email against RFC 2822 and # 0.7.3 is the latest for Rails 4.2, however, it is absent on Rubygems server # https://github.com/huacnlee/rails-settings-cached/issues/165 -gem 'nokogiri', '~> 1.11.4' +gem 'nokogiri', '~> 1.11.5' # style gem 'bootstrap-sass', '~> 3.4' diff --git a/Gemfile.lock b/Gemfile.lock index b18b06ce1..817225b0d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -309,10 +309,10 @@ GEM ruby2_keywords (~> 0.0.1) netrc (0.11.0) nio4r (2.5.7) - nokogiri (1.11.4) + nokogiri (1.11.5) mini_portile2 (~> 2.5.0) racc (~> 1.4) - nokogiri (1.11.4-x86_64-linux) + nokogiri (1.11.5-x86_64-linux) racc (~> 1.4) nori (2.6.0) omniauth (1.9.1) @@ -547,7 +547,7 @@ DEPENDENCIES mimemagic (= 0.4.3) minitest (~> 5.14) money-rails - nokogiri (~> 1.11.4) + nokogiri (~> 1.11.5) omniauth omniauth-rails_csrf_protection omniauth-tara! From 090bca8ca00b866c62a3ebefb1dc52ba1a7e57b1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 May 2021 05:03:56 +0000 Subject: [PATCH 11/32] Bump truemail from 2.4.1 to 2.4.2 Bumps [truemail](https://github.com/truemail-rb/truemail) from 2.4.1 to 2.4.2. - [Release notes](https://github.com/truemail-rb/truemail/releases) - [Changelog](https://github.com/truemail-rb/truemail/blob/master/CHANGELOG.md) - [Commits](https://github.com/truemail-rb/truemail/compare/v2.4.1...v2.4.2) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index b18b06ce1..d25e7a8bf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -462,7 +462,7 @@ GEM temple (0.8.2) thor (1.1.0) tilt (2.0.10) - truemail (2.4.1) + truemail (2.4.2) simpleidn (~> 0.2.1) tzinfo (2.0.4) concurrent-ruby (~> 1.0) From 82c048b316c294fd6799acd33bdfb64dad8ed684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Mon, 24 May 2021 17:08:10 +0300 Subject: [PATCH 12/32] Update CHANGELOG.md --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5447e074..03dfa0f7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,13 @@ +24.05.2021 +* Bump puma to 5.3.2 [#1999](https://github.com/internetee/registry/pull/1999) +* Bump nokogiri to 1.11.5 [#2000](https://github.com/internetee/registry/pull/2000) +* BUmp truemail to 2.4.2 [#2001](https://github.com/internetee/registry/pull/2001) + 21.05.2021 * Tech contacts do not receive expiration emails any more [#1996](https://github.com/internetee/registry/issues/1996) 20.05.2021 -* Moved data migrationd from whois project to registry [#1928](https://github.com/internetee/registry/issues/1928) +* Moved data migrations from whois project to registry [#1928](https://github.com/internetee/registry/issues/1928) 19.05.2021 * Fix for contact update via registrant portal [#1968](https://github.com/internetee/registry/pull/1968) From 194489e40f4c99d67201b4de17f495f5f5ff0180 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Wed, 26 May 2021 16:33:05 +0500 Subject: [PATCH 13/32] Fix error on birthday contact creation validation fail --- app/views/epp/error.xml.builder | 2 +- .../epp/contact/create/base_test.rb | 36 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/app/views/epp/error.xml.builder b/app/views/epp/error.xml.builder index be6b94a6a..36a1469a8 100644 --- a/app/views/epp/error.xml.builder +++ b/app/views/epp/error.xml.builder @@ -2,7 +2,7 @@ xml.epp_head do xml.response do @errors.each do |error| x = error&.options - next if x.empty? || x == { value: nil } + next if x.empty? || x == { value: nil } || x[:code].blank? xml.result('code' => x[:code]) do xml.msg(x[:msg], 'lang' => 'en') diff --git a/test/integration/epp/contact/create/base_test.rb b/test/integration/epp/contact/create/base_test.rb index 262487a1e..06087aaa8 100644 --- a/test/integration/epp/contact/create/base_test.rb +++ b/test/integration/epp/contact/create/base_test.rb @@ -41,6 +41,42 @@ class EppContactCreateBaseTest < EppTestCase assert_not_empty contact.code end + def test_responses_with_error_on_birthday + name = 'new' + email = 'new@registrar.test' + phone = '+1.2' + + request_xml = <<-XML + + + + + + + #{name} + + #{phone} + #{email} + + + + + 31-12-2000 + + + + + XML + + + assert_no_difference 'Contact.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_responces_error_with_email_error name = 'new' email = 'new@registrar@test' From d887bcd7345986e0807988c97a992c16f38b10cd Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Tue, 25 May 2021 13:28:16 +0500 Subject: [PATCH 14/32] Add creation of csync inputs based on name_puny --- app/jobs/csync_job.rb | 19 +++++++++++++++---- test/fixtures/nameservers.yml | 5 +++++ test/jobs/csync_job_test.rb | 19 +++++++++++++++++++ 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/app/jobs/csync_job.rb b/app/jobs/csync_job.rb index 1a703a380..99b96fa74 100644 --- a/app/jobs/csync_job.rb +++ b/app/jobs/csync_job.rb @@ -83,9 +83,9 @@ class CsyncJob < ApplicationJob # From this point we're working on generating input for cdnskey-scanner def gather_pollable_domains @logger.info 'CsyncJob Generate: Gathering current domain(s) data' - Nameserver.select(:hostname, :domain_id).all.each do |ns| + Nameserver.select(:hostname_puny, :domain_id).all.each do |ns| %i[secure insecure].each do |i| - @input_store[i][ns.hostname] = [] unless @input_store[i].key? ns.hostname + @input_store[i][ns.hostname_puny] = [] unless @input_store[i].key? ns.hostname_puny end append_domains_to_list(ns) @@ -94,14 +94,16 @@ class CsyncJob < ApplicationJob def append_domains_to_list(nameserver) Domain.where(id: nameserver.domain_id).all.each do |domain| - @input_store[domain.dnskeys.any? ? :secure : :insecure][nameserver.hostname].push domain.name + key = domain.dnskeys.any? ? :secure : :insecure + hostname = nameserver.hostname_puny || nameserver.hostname + @input_store[key][hostname].push domain.name_puny end end def generate_scanner_input @logger.info 'CsyncJob Generate: Gathering current domain(s) data' gather_pollable_domains - + check_directory out_file = File.new(ENV['cdns_scanner_input_file'], 'w+') %i[secure insecure].each do |state| @@ -113,6 +115,15 @@ class CsyncJob < ApplicationJob @logger.info 'CsyncJob Generate: Finished writing output to ' + ENV['cdns_scanner_input_file'] end + def check_directory + dirname = File.dirname(ENV['cdns_scanner_input_file']) + + FileUtils.mkdir_p(dirname) unless File.directory?(dirname) + return if File.exist?(ENV['cdns_scanner_input_file']) + + FileUtils.touch(ENV['cdns_scanner_input_file']) + end + def create_input_lines(out_file, state) @input_store[state].keys.each do |nameserver| domains = @input_store[state][nameserver].join(' ') diff --git a/test/fixtures/nameservers.yml b/test/fixtures/nameservers.yml index 97e2a3c1c..3c8f88722 100644 --- a/test/fixtures/nameservers.yml +++ b/test/fixtures/nameservers.yml @@ -1,5 +1,6 @@ shop_ns1: hostname: ns1.bestnames.test + hostname_puny: ns1.bestnames.test ipv4: - 192.0.2.1 ipv6: @@ -8,6 +9,7 @@ shop_ns1: shop_ns2: hostname: ns2.bestnames.test + hostname_puny: ns2.bestnames.test ipv4: - 192.0.2.2 ipv6: @@ -16,6 +18,7 @@ shop_ns2: airport_ns1: hostname: ns1.bestnames.test + hostname_puny: ns1.bestnames.test ipv4: - 192.0.2.2 ipv6: @@ -24,6 +27,7 @@ airport_ns1: airport_ns2: hostname: ns2.bestnames.test + hostname_puny: ns2.bestnames.test ipv4: - 192.0.2.0 - 192.0.2.3 @@ -34,4 +38,5 @@ airport_ns2: metro_ns1: hostname: ns1.bestnames.test + hostname_puny: ns1.bestnames.test domain: metro diff --git a/test/jobs/csync_job_test.rb b/test/jobs/csync_job_test.rb index 8254b3da9..c015f66a3 100644 --- a/test/jobs/csync_job_test.rb +++ b/test/jobs/csync_job_test.rb @@ -6,6 +6,10 @@ class CsyncJobTest < ActiveSupport::TestCase setup do @dnskey = dnskeys(:one) @domain = domains(:shop) + dirname = File.dirname(ENV['cdns_scanner_input_file']) + + FileUtils.mkdir_p(dirname) unless File.directory?(dirname) + FileUtils.touch(ENV['cdns_scanner_input_file']) unless File.exists?(ENV['cdns_scanner_input_file']) end def test_generates_input_file_for_cdnskey_scanner @@ -19,6 +23,21 @@ class CsyncJobTest < ActiveSupport::TestCase assert_equal expected_contents, IO.read(ENV['cdns_scanner_input_file']) end + def test_generates_input_file_from_name_puny + @domain.update(name: 'pööriöö.ee', name_puny: 'xn--pri-snaaca.ee') + @domain.save(validate: false) + @nameserver = @domain.nameservers.first + @nameserver.update(hostname: 'täpiline.ee', hostname_puny: 'xn--theke1-bua.ee') + @domain.reload + @dnskey.update(domain: @domain) + + expected_contents = "[secure]\nns2.bestnames.test #{@domain.name_puny}\n#{@nameserver.hostname_puny} #{@domain.name_puny}\n" \ + "[insecure]\nns2.bestnames.test airport.test\nns1.bestnames.test airport.test metro.test\n" + + CsyncJob.perform_now(generate: true) + assert_equal expected_contents, IO.read(ENV['cdns_scanner_input_file']) + end + def test_creates_csync_record_when_new_cdnskey_discovered assert_nil @domain.csync_record CsyncJob.perform_now From 8e588f5a84b8018a13100490c55ec269359f16ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Thu, 27 May 2021 13:47:23 +0300 Subject: [PATCH 15/32] Update CHANGELOG.md --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03dfa0f7e..cc25e8b71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +27.05.2021 +* fixed error handling on invalid date format for epp contact create [#2006](https://github.com/internetee/registry/issues/2006) +* csync input file with puycode values [#2003](https://github.com/internetee/registry/issues/2003) +* ForceDelete notes are updated with additionally found email addresses [#1913](https://github.com/internetee/registry/issues/1913) + 24.05.2021 * Bump puma to 5.3.2 [#1999](https://github.com/internetee/registry/pull/1999) * Bump nokogiri to 1.11.5 [#2000](https://github.com/internetee/registry/pull/2000) From a87c7524eca92393e735e6e4bd94e7ba674cb374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Thu, 27 May 2021 16:52:41 +0300 Subject: [PATCH 16/32] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc25e8b71..d6a74126d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ 27.05.2021 * fixed error handling on invalid date format for epp contact create [#2006](https://github.com/internetee/registry/issues/2006) * csync input file with puycode values [#2003](https://github.com/internetee/registry/issues/2003) +* autoloading newest db schema file versions [#1976](https://github.com/internetee/registry/issues/1976) * ForceDelete notes are updated with additionally found email addresses [#1913](https://github.com/internetee/registry/issues/1913) 24.05.2021 From 739752ec59e9abd73f4d738a3090d5ee507c13bd Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Fri, 28 May 2021 11:06:48 +0300 Subject: [PATCH 17/32] added fix --- app/views/admin/domain_versions/archive.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/domain_versions/archive.haml b/app/views/admin/domain_versions/archive.haml index 46a79190b..500675f62 100644 --- a/app/views/admin/domain_versions/archive.haml +++ b/app/views/admin/domain_versions/archive.haml @@ -67,7 +67,7 @@ - else - contact = Contact.all_versions_for([domain.registrant_id], version.created_at).first - if contact.nil? && ver = Version::ContactVersion.where(item_id: domain.registrant_id).last - - contact = Contact.new(ver.object.to_h.merge(ver.object_changes.to_h.each_with_object({}) {|(k,v), o| o[k] = v.last })) + - contact = Contact.new(ver.object.to_h.merge(ver.object_changes.to_h&.slice(*valid_columns))) = contact.try(:name) = " ".html_safe = "(#{t(:deleted)})" From afd6882f6543697f4e48122d5683c25dfd2decd2 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Fri, 28 May 2021 11:36:21 +0300 Subject: [PATCH 18/32] added test --- test/system/admin_area/contact_versions_test.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/system/admin_area/contact_versions_test.rb b/test/system/admin_area/contact_versions_test.rb index 2559a203f..801353e28 100644 --- a/test/system/admin_area/contact_versions_test.rb +++ b/test/system/admin_area/contact_versions_test.rb @@ -24,8 +24,9 @@ class ContactVersionsTest < ApplicationSystemTestCase INSERT INTO log_contacts (item_type, item_id, event, whodunnit, object, object_changes, created_at, session, children, ident_updated_at, uuid) VALUES ('Contact', 75, 'update', '1-AdminUser', - '{"id": 75, "code": "test_code", "auth_info": "8b4d462aa04194ca78840a", "registrar_id": #{@registrar.id}, "old_field": "value"}', - '{"other_made_up_field": "value"}', + '{"id": 75, "code": "test_code", "auth_info": "8b4d462aa04194ca78840a", "registrar_id": #{@registrar.id}, "old_field": "value", + "legal_id": "123"}', + '{"other_made_up_field": "value"}', '2018-04-23 15:50:48.113491', '2018-04-23 12:44:56', '{"legal_documents":[null]}', null, null ) From a2f7b7cbe387e1018112814cb2b10e8783b47175 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Fri, 28 May 2021 13:36:01 +0300 Subject: [PATCH 19/32] fixed old code --- app/views/admin/domain_versions/archive.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/domain_versions/archive.haml b/app/views/admin/domain_versions/archive.haml index 500675f62..03e556c9c 100644 --- a/app/views/admin/domain_versions/archive.haml +++ b/app/views/admin/domain_versions/archive.haml @@ -67,7 +67,7 @@ - else - contact = Contact.all_versions_for([domain.registrant_id], version.created_at).first - if contact.nil? && ver = Version::ContactVersion.where(item_id: domain.registrant_id).last - - contact = Contact.new(ver.object.to_h.merge(ver.object_changes.to_h&.slice(*valid_columns))) + - contact = Contact.new(ver.object.to_h.merge(ver.object_changes.to_h&.slice(*Domain&.column_names))) = contact.try(:name) = " ".html_safe = "(#{t(:deleted)})" From 8926c70bc384f58f47ee05224520a5eae053dcf4 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Fri, 28 May 2021 16:06:12 +0500 Subject: [PATCH 20/32] Fix contact version generation --- app/views/admin/domain_versions/archive.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/domain_versions/archive.haml b/app/views/admin/domain_versions/archive.haml index 03e556c9c..c0ed6fff0 100644 --- a/app/views/admin/domain_versions/archive.haml +++ b/app/views/admin/domain_versions/archive.haml @@ -67,7 +67,7 @@ - else - contact = Contact.all_versions_for([domain.registrant_id], version.created_at).first - if contact.nil? && ver = Version::ContactVersion.where(item_id: domain.registrant_id).last - - contact = Contact.new(ver.object.to_h.merge(ver.object_changes.to_h&.slice(*Domain&.column_names))) + - contact = Contact.new(ver.object.to_h.merge(ver.object_changes.to_h.each_with_object({}) {|(k,v), o| o[k] = v.last })&.slice(*Contact&.column_names)) = contact.try(:name) = " ".html_safe = "(#{t(:deleted)})" From a8d1d66c3ab87e68cf87cb9e8965dbe030098da2 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Fri, 28 May 2021 14:23:42 +0300 Subject: [PATCH 21/32] Refactoring --- app/views/admin/domain_versions/archive.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/admin/domain_versions/archive.haml b/app/views/admin/domain_versions/archive.haml index c0ed6fff0..f4ee67f47 100644 --- a/app/views/admin/domain_versions/archive.haml +++ b/app/views/admin/domain_versions/archive.haml @@ -67,7 +67,8 @@ - else - contact = Contact.all_versions_for([domain.registrant_id], version.created_at).first - if contact.nil? && ver = Version::ContactVersion.where(item_id: domain.registrant_id).last - - contact = Contact.new(ver.object.to_h.merge(ver.object_changes.to_h.each_with_object({}) {|(k,v), o| o[k] = v.last })&.slice(*Contact&.column_names)) + - result = ver.object.to_h.merge(ver.object_changes.to_h.each_with_object({}) {|(k,v), o| o[k] = v.last })&.(*Contact&.column_names) + - contact = Contact.new(result) = contact.try(:name) = " ".html_safe = "(#{t(:deleted)})" From 6144692713c189fcca266f3e12ae4ea42dd5bf16 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Fri, 28 May 2021 14:46:58 +0300 Subject: [PATCH 22/32] refactoring --- app/views/admin/domain_versions/archive.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/admin/domain_versions/archive.haml b/app/views/admin/domain_versions/archive.haml index f4ee67f47..248d58538 100644 --- a/app/views/admin/domain_versions/archive.haml +++ b/app/views/admin/domain_versions/archive.haml @@ -67,7 +67,8 @@ - else - contact = Contact.all_versions_for([domain.registrant_id], version.created_at).first - if contact.nil? && ver = Version::ContactVersion.where(item_id: domain.registrant_id).last - - result = ver.object.to_h.merge(ver.object_changes.to_h.each_with_object({}) {|(k,v), o| o[k] = v.last })&.(*Contact&.column_names) + - merged_obj = ver.object_changes.to_h.each_with_object({}) {|(k,v), o| o[k] = v.last } + - result = ver.object.to_h.merge(merged_obj)&.slice(*Contact&.column_names) - contact = Contact.new(result) = contact.try(:name) = " ".html_safe From 9980ef08b8ce69d4dd60331ee47249dfe1ebeeef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Fri, 28 May 2021 16:26:28 +0300 Subject: [PATCH 23/32] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6a74126d..383c25806 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +28.05.2021 +* fix for legacy contact object errors in admin [#2010](https://github.com/internetee/registry/pull/2010) + 27.05.2021 * fixed error handling on invalid date format for epp contact create [#2006](https://github.com/internetee/registry/issues/2006) * csync input file with puycode values [#2003](https://github.com/internetee/registry/issues/2003) From a2f031d50cfd36f43ebe34050193c0aa8750ac14 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 May 2021 05:01:32 +0000 Subject: [PATCH 24/32] Bump nokogiri from 1.11.5 to 1.11.6 Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.5 to 1.11.6. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.5...v1.11.6) Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 952d42dfa..ce1491990 100644 --- a/Gemfile +++ b/Gemfile @@ -24,7 +24,7 @@ gem 'validates_email_format_of', '1.6.3' # validates email against RFC 2822 and # 0.7.3 is the latest for Rails 4.2, however, it is absent on Rubygems server # https://github.com/huacnlee/rails-settings-cached/issues/165 -gem 'nokogiri', '~> 1.11.5' +gem 'nokogiri', '~> 1.11.6' # style gem 'bootstrap-sass', '~> 3.4' diff --git a/Gemfile.lock b/Gemfile.lock index 807b81892..4282d8661 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -292,7 +292,8 @@ GEM nokogiri (~> 1) rake mini_mime (1.0.3) - mini_portile2 (2.5.1) + mini_portile2 (2.5.2) + net-ftp (~> 0.1) minitest (5.14.4) monetize (1.9.4) money (~> 6.12) @@ -307,12 +308,16 @@ GEM multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) + net-ftp (0.1.2) + net-protocol + time + net-protocol (0.1.0) netrc (0.11.0) nio4r (2.5.7) - nokogiri (1.11.5) + nokogiri (1.11.6) mini_portile2 (~> 2.5.0) racc (~> 1.4) - nokogiri (1.11.5-x86_64-linux) + nokogiri (1.11.6-x86_64-linux) racc (~> 1.4) nori (2.6.0) omniauth (1.9.1) @@ -462,6 +467,7 @@ GEM temple (0.8.2) thor (1.1.0) tilt (2.0.10) + time (0.1.0) truemail (2.4.2) simpleidn (~> 0.2.1) tzinfo (2.0.4) @@ -547,7 +553,7 @@ DEPENDENCIES mimemagic (= 0.4.3) minitest (~> 5.14) money-rails - nokogiri (~> 1.11.5) + nokogiri (~> 1.11.6) omniauth omniauth-rails_csrf_protection omniauth-tara! From 5934adfdc0c36ed7dca4b8b717e8e63d17555f28 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 May 2021 05:02:37 +0000 Subject: [PATCH 25/32] Bump cancancan from 3.2.1 to 3.2.2 Bumps [cancancan](https://github.com/CanCanCommunity/cancancan) from 3.2.1 to 3.2.2. - [Release notes](https://github.com/CanCanCommunity/cancancan/releases) - [Changelog](https://github.com/CanCanCommunity/cancancan/blob/develop/CHANGELOG.md) - [Commits](https://github.com/CanCanCommunity/cancancan/compare/3.2.1...3.2.2) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 807b81892..e02123f29 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -172,7 +172,7 @@ GEM autoprefixer-rails (>= 5.2.1) sassc (>= 2.0.0) builder (3.2.4) - cancancan (3.2.1) + cancancan (3.2.2) capybara (3.35.3) addressable mini_mime (>= 0.1.3) From 3fc4f465ae3f77c23c203241ad104a0aa84e107e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 May 2021 05:03:44 +0000 Subject: [PATCH 26/32] Bump e_invoice from `1e83e0b` to `7832ef6` Bumps [e_invoice](https://github.com/internetee/e_invoice) from `1e83e0b` to `7832ef6`. - [Release notes](https://github.com/internetee/e_invoice/releases) - [Commits](https://github.com/internetee/e_invoice/compare/1e83e0b9d502d0a96d7bbbf9235a6621591d4e66...7832ef67ae9168bbb6aaba67dce6a69424234ff4) Signed-off-by: dependabot[bot] --- Gemfile.lock | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 807b81892..2deb975aa 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -18,7 +18,7 @@ GIT GIT remote: https://github.com/internetee/e_invoice.git - revision: 1e83e0b9d502d0a96d7bbbf9235a6621591d4e66 + revision: 7832ef67ae9168bbb6aaba67dce6a69424234ff4 branch: master specs: e_invoice (0.1.0) @@ -292,7 +292,8 @@ GEM nokogiri (~> 1) rake mini_mime (1.0.3) - mini_portile2 (2.5.1) + mini_portile2 (2.5.2) + net-ftp (~> 0.1) minitest (5.14.4) monetize (1.9.4) money (~> 6.12) @@ -307,6 +308,10 @@ GEM multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) + net-ftp (0.1.2) + net-protocol + time + net-protocol (0.1.0) netrc (0.11.0) nio4r (2.5.7) nokogiri (1.11.5) @@ -462,6 +467,7 @@ GEM temple (0.8.2) thor (1.1.0) tilt (2.0.10) + time (0.1.0) truemail (2.4.2) simpleidn (~> 0.2.1) tzinfo (2.0.4) From 9680b8beb885870d51e1ad9749f82a4309f9bb43 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 May 2021 05:04:44 +0000 Subject: [PATCH 27/32] Bump active_interaction from 4.0.0 to 4.0.1 Bumps [active_interaction](https://github.com/AaronLasseigne/active_interaction) from 4.0.0 to 4.0.1. - [Release notes](https://github.com/AaronLasseigne/active_interaction/releases) - [Changelog](https://github.com/AaronLasseigne/active_interaction/blob/master/CHANGELOG.md) - [Commits](https://github.com/AaronLasseigne/active_interaction/compare/v4.0.0...v4.0.1) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 807b81892..01c3c93e8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -114,7 +114,7 @@ GEM erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - active_interaction (4.0.0) + active_interaction (4.0.1) activemodel (>= 5, < 7) activejob (6.1.3.2) activesupport (= 6.1.3.2) From e15c29a82a8485d8f049d64ff3cc309c4f2e7826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Mon, 31 May 2021 19:25:33 +0300 Subject: [PATCH 28/32] Update CHANGELOG.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 383c25806..69aebb46a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +31.05.2021 +* Bump nokogiri to 1.11.6 ["2012](https://github.com/internetee/registry/pull/2012) +* Bump cancancan to 3.2.2 [#2013](https://github.com/internetee/registry/pull/2013) +* Bump e_invoice to 7832ef6 [#2010](https://github.com/internetee/registry/pull/2014) +* Bump active_interaction to 4.0.1 [#2015](https://github.com/internetee/registry/pull/2015) + 28.05.2021 * fix for legacy contact object errors in admin [#2010](https://github.com/internetee/registry/pull/2010) From 8c948cb532ed9e1946118cd7f28f8c2ae3a962a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Mon, 31 May 2021 19:25:54 +0300 Subject: [PATCH 29/32] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69aebb46a..d8e8f8c58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ 31.05.2021 -* Bump nokogiri to 1.11.6 ["2012](https://github.com/internetee/registry/pull/2012) +* Bump nokogiri to 1.11.6 [#2012](https://github.com/internetee/registry/pull/2012) * Bump cancancan to 3.2.2 [#2013](https://github.com/internetee/registry/pull/2013) * Bump e_invoice to 7832ef6 [#2010](https://github.com/internetee/registry/pull/2014) * Bump active_interaction to 4.0.1 [#2015](https://github.com/internetee/registry/pull/2015) From ff5deb45af036db993e9335b17d944629fef4cd0 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Wed, 26 May 2021 11:00:03 +0300 Subject: [PATCH 30/32] upgraded schema for release prohibited --- lib/schemas/all-ee-1.1.xsd | 2 +- lib/schemas/domain-eis-1.1.xsd | 472 +++++++++++++++++++++++++++++++++ 2 files changed, 473 insertions(+), 1 deletion(-) create mode 100644 lib/schemas/domain-eis-1.1.xsd diff --git a/lib/schemas/all-ee-1.1.xsd b/lib/schemas/all-ee-1.1.xsd index c82fbc433..96d4f5031 100644 --- a/lib/schemas/all-ee-1.1.xsd +++ b/lib/schemas/all-ee-1.1.xsd @@ -30,7 +30,7 @@ schemaLocation="lib/schemas/eis-1.0.xsd"/> - diff --git a/lib/schemas/domain-eis-1.1.xsd b/lib/schemas/domain-eis-1.1.xsd new file mode 100644 index 000000000..8b22f3c3f --- /dev/null +++ b/lib/schemas/domain-eis-1.1.xsd @@ -0,0 +1,472 @@ + + + + + + + + + + + + + + Extensible Provisioning Protocol v1.0 + domain provisioning schema. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From ecd2bc9fa66d48b4a4954378408dac44eb14c045 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Wed, 26 May 2021 12:04:55 +0300 Subject: [PATCH 31/32] added test --- lib/schemas/all-ee-1.1.xsd | 2 +- lib/schemas/domain-eis-1.1.xsd | 2 +- test/integration/epp/domain/info/base_test.rb | 32 +++++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/lib/schemas/all-ee-1.1.xsd b/lib/schemas/all-ee-1.1.xsd index 96d4f5031..70397d753 100644 --- a/lib/schemas/all-ee-1.1.xsd +++ b/lib/schemas/all-ee-1.1.xsd @@ -31,7 +31,7 @@ + schemaLocation="lib/schemas/domain-eis-1.1.xsd"/> diff --git a/lib/schemas/domain-eis-1.1.xsd b/lib/schemas/domain-eis-1.1.xsd index 8b22f3c3f..2b9959053 100644 --- a/lib/schemas/domain-eis-1.1.xsd +++ b/lib/schemas/domain-eis-1.1.xsd @@ -1,4 +1,4 @@ - + 'session=api_bestnames' } response_xml = Nokogiri::XML(response.body) + p response_xml assert_epp_response :completed_successfully assert_equal 'shop.test', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text assert_equal 'ok', response_xml.at_xpath('//domain:status', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")['s'] @@ -71,6 +72,37 @@ class EppDomainInfoBaseTest < EppTestCase assert_equal 0, schema_validation_errors.size end + def test_returns_valid_response_if_release_prohibited + domain = domains(:shop) + domain.update_columns(statuses: [DomainStatus::SERVER_RELEASE_PROHIBITED], + created_at: Time.now - 5.days, + creator_str: 'test', + delete_date: Time.now - 1.day) + + request_xml = <<-XML + + + + + + shop.test + + + + + XML + + post epp_info_path, params: { frame: request_xml }, + headers: { 'HTTP_COOKIE' => 'session=api_bestnames' } + + response_xml = Nokogiri::XML(response.body) + assert_epp_response :completed_successfully + schema = EPP_ALL_SCHEMA + + schema_validation_errors = schema.validate(response_xml) + assert_equal 0, schema_validation_errors.size + end + def test_reveals_transfer_code_when_domain_is_owned_by_current_user assert_equal '65078d5', domains(:shop).transfer_code From a747aa3c0f67bb0f180822c9932d0b422f6b9f77 Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Wed, 26 May 2021 14:42:00 +0300 Subject: [PATCH 32/32] added method in test_helper & updated method for compare schema version --- test/integration/epp/domain/info/base_test.rb | 5 ++++- test/lib/xsd_schema/xsd_schema_test.rb | 1 + test/test_helper.rb | 10 +++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/test/integration/epp/domain/info/base_test.rb b/test/integration/epp/domain/info/base_test.rb index ed7693640..5f44248aa 100644 --- a/test/integration/epp/domain/info/base_test.rb +++ b/test/integration/epp/domain/info/base_test.rb @@ -25,8 +25,11 @@ class EppDomainInfoBaseTest < EppTestCase headers: { 'HTTP_COOKIE' => 'session=api_bestnames' } response_xml = Nokogiri::XML(response.body) - p response_xml + + schema_version = return_xml_domain_schema_version(response_xml) + assert_epp_response :completed_successfully + assert schema_version >= 1.1 assert_equal 'shop.test', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text assert_equal 'ok', response_xml.at_xpath('//domain:status', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")['s'] assert_equal 'john-001', response_xml.at_xpath('//domain:registrant', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text diff --git a/test/lib/xsd_schema/xsd_schema_test.rb b/test/lib/xsd_schema/xsd_schema_test.rb index 0d3e30103..ac5868746 100644 --- a/test/lib/xsd_schema/xsd_schema_test.rb +++ b/test/lib/xsd_schema/xsd_schema_test.rb @@ -18,4 +18,5 @@ class XsdSchemaTest < ActiveSupport::TestCase assert_equal Xsd::Schema::BASE_URL + 'abcde-fghij-1.3.xsd', filename end + end diff --git a/test/test_helper.rb b/test/test_helper.rb index df2e9878e..addeede90 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -22,7 +22,6 @@ require 'sidekiq/testing' Sidekiq::Testing.fake! - # `bin/rails test` is not the same as `bin/rake test`. # All tasks will be loaded (and executed) twice when using the former without `Rake::Task.clear`. # https://github.com/rails/rails/issues/28786 @@ -69,4 +68,13 @@ end class EppTestCase < ActionDispatch::IntegrationTest include Assertions::EppAssertions + + def return_xml_domain_schema_version(response_xml) + version_regex = /-\d+\S\d+/ + domain_schema_tag = response_xml.to_s.scan(/xmlns:domain\S+/) + schema_path = domain_schema_tag.to_s.match(%r{https?://\S+})[0] + version = schema_path.to_s.match(version_regex)[0] + + -version.to_f + end end