diff --git a/app/api/repp/domain_v1.rb b/app/api/repp/domain_v1.rb
index 95dbb5af5..859cb14da 100644
--- a/app/api/repp/domain_v1.rb
+++ b/app/api/repp/domain_v1.rb
@@ -27,10 +27,12 @@ module Repp
end
# example: curl -u registrar1:password localhost:3000/repp/v1/domains/1/transfer_info -H "Auth-Code: authinfopw1"
- get '/:id/transfer_info' do
+ get '/:id/transfer_info', requirements: { id: /.*/ } do
+ ident = params[:id]
+ domain = ident =~ /\A[0-9]+\z/ ? Domain.find_by(id: ident) : Domain.find_by_idn(ident)
- domain = Domain.where("name = ? OR id=?", params[:id], params[:id]).where(auth_info: request.headers['Auth-Code']).first
- error! I18n.t('errors.messages.epp_domain_not_found'), 401 unless domain
+ error! I18n.t('errors.messages.epp_domain_not_found'), 404 unless domain
+ error! I18n.t('errors.messages.epp_authorization_error'), 401 unless domain.auth_info.eql? request.headers['Auth-Code']
contact_repp_json = proc{|contact|
contact.attributes.slice("code", "ident_type", "ident_country_code", "phone", "email", "street", "city", "zip","country_code", "statuses")
diff --git a/app/controllers/admin/settings_controller.rb b/app/controllers/admin/settings_controller.rb
index 4014cd7fc..89ccd9ac6 100644
--- a/app/controllers/admin/settings_controller.rb
+++ b/app/controllers/admin/settings_controller.rb
@@ -51,7 +51,7 @@ class Admin::SettingsController < AdminController
:admin_contacts_max_count,
:tech_contacts_min_count,
:tech_contacts_max_count,
- :ds_algorithm,
+ :ds_digest_type,
:dnskeys_min_count,
:dnskeys_max_count,
:ns_min_count,
diff --git a/app/jobs/domain_delete_confirm_job.rb b/app/jobs/domain_delete_confirm_job.rb
index 0429bc390..cce230234 100644
--- a/app/jobs/domain_delete_confirm_job.rb
+++ b/app/jobs/domain_delete_confirm_job.rb
@@ -8,7 +8,8 @@ class DomainDeleteConfirmJob < Que::Job
domain.poll_message!(:poll_pending_delete_confirmed_by_registrant)
domain.apply_pending_delete!
when RegistrantVerification::REJECTED
- DomainMailer.pending_delete_rejected_notification(domain_id, deliver_emails).deliver
+ DomainMailer.pending_delete_rejected_notification(domain_id, true).deliver
+ domain.statuses.delete(DomainStatus::PENDING_DELETE_CONFIRMATION)
domain.poll_message!(:poll_pending_delete_rejected_by_registrant)
domain.cancel_pending_delete
end
diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb
index b5b46e6f2..d6652492e 100644
--- a/app/mailers/application_mailer.rb
+++ b/app/mailers/application_mailer.rb
@@ -17,7 +17,7 @@ class ApplicationMailer < ActionMailer::Base
end
# turn on delivery on specific (epp) request only, thus rake tasks does not deliver anything
- def delivery_off?(model, deliver_email= false)
+ def delivery_off?(model, deliver_emails = false)
return false if deliver_emails == true
logger.info "EMAIL SENDING WAS NOT ACTIVATED " \
"BY MODEL OBJECT: id ##{model.try(:id)} deliver_emails returned false"
diff --git a/app/mailers/contact_mailer.rb b/app/mailers/contact_mailer.rb
index 71e635540..110ce6a71 100644
--- a/app/mailers/contact_mailer.rb
+++ b/app/mailers/contact_mailer.rb
@@ -4,7 +4,7 @@ class ContactMailer < ApplicationMailer
def email_updated(email, contact_id, should_deliver)
@contact = Contact.find_by(id: contact_id)
return unless email || @contact
- return if delivery_off?(contact, should_deliver)
+ return if delivery_off?(@contact, should_deliver)
return if whitelist_blocked?(email)
begin
diff --git a/app/models/dnskey.rb b/app/models/dnskey.rb
index 26f5a0afd..02b43d729 100644
--- a/app/models/dnskey.rb
+++ b/app/models/dnskey.rb
@@ -17,9 +17,10 @@ class Dnskey < ActiveRecord::Base
end
}
- ALGORITHMS = %w(3 5 6 7 8 10 13 14)
+ ALGORITHMS = Depp::Dnskey::ALGORITHMS.map {|pair| pair[1].to_s}.freeze # IANA numbers, single authority list
PROTOCOLS = %w(3)
FLAGS = %w(0 256 257) # 256 = ZSK, 257 = KSK
+ DS_DIGEST_TYPE = [1,2]
def epp_code_map
{
@@ -66,7 +67,10 @@ class Dnskey < ActiveRecord::Base
end
def generate_digest
- return if flags != 257 # generate ds only with KSK
+ return unless flags == 257 || flags == 256 # require ZoneFlag, but optional SecureEntryPoint
+ self.ds_alg = alg
+ self.ds_digest_type = Setting.ds_digest_type if self.ds_digest_type.blank? || !DS_DIGEST_TYPE.include?(ds_digest_type)
+
flags_hex = self.class.int_to_hex(flags)
protocol_hex = self.class.int_to_hex(protocol)
alg_hex = self.class.int_to_hex(alg)
@@ -74,9 +78,9 @@ class Dnskey < ActiveRecord::Base
hex = [domain.name_in_wire_format, flags_hex, protocol_hex, alg_hex, public_key_hex].join
bin = self.class.hex_to_bin(hex)
- if ds_digest_type == 1
+ if self.ds_digest_type == 1
self.ds_digest = Digest::SHA1.hexdigest(bin).upcase
- elsif ds_digest_type == 2
+ elsif self.ds_digest_type == 2
self.ds_digest = Digest::SHA256.hexdigest(bin).upcase
end
end
@@ -86,7 +90,7 @@ class Dnskey < ActiveRecord::Base
end
def generate_ds_key_tag
- return if flags != 257 # generate ds key tag only with KSK
+ return unless flags == 257 || flags == 256 # require ZoneFlag, but optional SecureEntryPoint
pk = public_key.gsub(' ', '')
wire_format = [flags, protocol, alg].pack('S!>CC')
wire_format += Base64.decode64(pk)
diff --git a/app/models/domain.rb b/app/models/domain.rb
index 18918906a..48188065e 100644
--- a/app/models/domain.rb
+++ b/app/models/domain.rb
@@ -329,7 +329,7 @@ class Domain < ActiveRecord::Base
domain.destroy
bye_bye = domain.versions.last
domain.registrar.messages.create!(
- body: I18n.t(:domain_deleted),
+ body: "#{I18n.t(:domain_deleted)}: #{domain.name}",
attached_obj_id: bye_bye.id,
attached_obj_type: bye_bye.class.to_s # DomainVersion
)
diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb
index 66ea0768f..afdc8e085 100644
--- a/app/models/epp/domain.rb
+++ b/app/models/epp/domain.rb
@@ -387,13 +387,8 @@ class Epp::Domain < Domain
end
def key_data_from(frame)
- result = xm_copy frame, KEY_INTERFACE
- # TODO: can these defaults go where they belong?
- result.merge({
- ds_alg: 3, # DSA/SHA-1 [DSA] RFC2536
- ds_digest_type: Setting.ds_algorithm # only 1
- })
- end
+ xm_copy frame, KEY_INTERFACE
+ end
def ds_data_from(frame)
frame.css('dsData').each do |ds_data|
diff --git a/app/views/admin/settings/index.haml b/app/views/admin/settings/index.haml
index fc4cc4e9d..ede30e979 100644
--- a/app/views/admin/settings/index.haml
+++ b/app/views/admin/settings/index.haml
@@ -47,8 +47,8 @@
%th{class: 'col-xs-6'}= t(:setting)
%th{class: 'col-xs-6'}= t(:value)
%tbody
- /= render 'setting_row', var: :transfer_wait_time
- = render 'setting_row', var: :ds_algorithm
+ = render 'setting_row', var: :transfer_wait_time
+ = render 'setting_row', var: :ds_digest_type
= render 'setting_row', var: :client_side_status_editing_enabled
= render 'setting_row', var: :api_ip_whitelist_enabled
= render 'setting_row', var: :registrar_ip_whitelist_enabled
diff --git a/config/initializers/initial_settings.rb b/config/initializers/initial_settings.rb
index 35c3eebb3..812641a09 100644
--- a/config/initializers/initial_settings.rb
+++ b/config/initializers/initial_settings.rb
@@ -12,7 +12,7 @@ if con.present? && con.table_exists?('settings')
Setting.save_default(:tech_contacts_max_count, 10)
Setting.save_default(:expire_pending_confirmation, 48)
- Setting.save_default(:ds_algorithm, 2)
+ Setting.save_default(:ds_digest_type, 2)
Setting.save_default(:ds_data_allowed, false)
Setting.save_default(:key_data_allowed, true)
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 937096ad6..07f4ebc0a 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -443,7 +443,7 @@ en:
ds_data_allowed: 'DS data allowed'
ds_data_with_key_allowed: 'Allow DS data with key'
key_data_allowed: 'Allow key data'
- ds_algorithm: 'DS algorithm'
+ ds_digest_type: 'DS digest type'
zonefile_settings: 'Zonefile settings'
background_jobs: Background jobs
domain_history: Domain history
diff --git a/db/migrate/20151124200353_add_ident_autofill.rb b/db/migrate/20151124200353_add_ident_autofill.rb
new file mode 100644
index 000000000..d4efb1449
--- /dev/null
+++ b/db/migrate/20151124200353_add_ident_autofill.rb
@@ -0,0 +1,98 @@
+class AddIdentAutofill < ActiveRecord::Migration
+ def change
+ execute <<-SQL
+ CREATE OR REPLACE FUNCTION fill_ident_country()
+ RETURNS BOOLEAN AS $$
+ DECLARE
+ changed BOOLEAN;
+ multiplier INT [];
+ multiplier2 INT [];
+ multiplier3 INT [];
+ multiplier4 INT [];
+ r RECORD;
+ control TEXT;
+ total INT;
+ i INT;
+ mod INT;
+ counter INT;
+ BEGIN
+
+ multiplier := ARRAY [1, 2, 3, 4, 5, 6, 7, 8, 9, 1];
+ multiplier2 := ARRAY [3, 4, 5, 6, 7, 8, 9, 1, 2, 3];
+ multiplier3 := ARRAY [1, 2, 3, 4, 5, 6, 7];
+ multiplier4 := ARRAY [3, 4, 5, 6, 7, 8, 9];
+
+ FOR r IN SELECT id, ident FROM contacts WHERE ident_type = 'priv' AND ident_country_code IS NULL
+ LOOP
+ IF (length(r.ident) = 11 AND (r.ident ~ '^[0-9]+$') AND (substring(r.ident, 1, 1) = '3' OR substring(r.ident, 1, 1) = '4' OR substring(r.ident, 1, 1) = '5' OR substring(r.ident, 1, 1) = '6'))
+ THEN
+ total := 0;
+ counter := 1;
+ FOREACH i IN ARRAY multiplier
+ LOOP
+ total := (total + (i * to_number(substring(r.ident, counter, 1), '9')));
+ counter := (counter + 1);
+ END LOOP;
+ mod := (total % 11);
+ counter := 1;
+ IF (mod >= 10)
+ THEN
+ total = 0;
+ FOREACH i IN ARRAY multiplier2
+ LOOP
+ total := (total + (i * to_number(substring(r.ident, counter, 1), '9')));
+ counter := (counter + 1);
+ END LOOP;
+ mod := (total % 11);
+ END IF;
+
+ IF (mod < 10 AND substring(r.ident, 11, 1) = to_char(mod, 'FM999MI'))
+ THEN
+ UPDATE contacts SET ident_country_code = 'EE' WHERE id = r.id;
+ END IF;
+ total = 0;
+ END IF;
+ END LOOP;
+
+ FOR r IN SELECT id, ident FROM contacts WHERE ident_type = 'org' AND ident_country_code IS NULL
+ LOOP
+ IF (length(r.ident) = 8 AND (r.ident ~ '^[0-9]+$') AND (substring(r.ident, 1, 1) = '1' OR substring(r.ident, 1, 1) = '8' OR substring(r.ident, 1, 1) = '9'))
+ THEN
+ total := 0;
+ counter := 1;
+ FOREACH i IN ARRAY multiplier3
+ LOOP
+ total := (total + (i * to_number(substring(r.ident, counter, 1), '9')));
+ counter := (counter + 1);
+ END LOOP;
+ mod := total % 11;
+ total = 0;
+ counter := 1;
+ IF (mod >= 10)
+ THEN
+ total = 0;
+ FOREACH i IN ARRAY multiplier4
+ LOOP
+ total := (total + (i * to_number(substring(r.ident, counter, 1), '9')));
+ counter := (counter + 1);
+ END LOOP;
+ mod := (total % 11);
+ END IF;
+ IF (mod < 10 AND (substring(r.ident, 8, 1) = to_char(mod, 'FM999MI')))
+ THEN
+ UPDATE contacts SET ident_country_code = 'EE' WHERE id = r.id;
+ END IF;
+ END IF;
+ END LOOP;
+ RETURN changed;
+ END;
+ $$ LANGUAGE plpgsql;
+ SQL
+ end
+
+ def down
+ execute <<-SQL
+ DROP FUNCTION IF EXISTS fill_ident_country()
+ SQL
+ end
+end
diff --git a/db/migrate/20151125155601_restore_ttl_to_zonefile.rb b/db/migrate/20151125155601_restore_ttl_to_zonefile.rb
new file mode 100644
index 000000000..61fe0018c
--- /dev/null
+++ b/db/migrate/20151125155601_restore_ttl_to_zonefile.rb
@@ -0,0 +1,168 @@
+class RestoreTtlToZonefile < ActiveRecord::Migration
+ # rubocop:disable Metrics/MethodLength
+ def up
+ execute <<-SQL
+ CREATE OR REPLACE FUNCTION generate_zonefile(i_origin varchar)
+ RETURNS text AS $$
+ DECLARE
+ zone_header text := concat('$ORIGIN ', i_origin, '.');
+ serial_num varchar;
+ include_filter varchar := '';
+ exclude_filter varchar := '';
+ tmp_var text;
+ ret text;
+ BEGIN
+ -- define filters
+ include_filter = '%' || i_origin;
+
+ -- for %.%.%
+ IF i_origin ~ '\\.' THEN
+ exclude_filter := '';
+ -- for %.%
+ ELSE
+ exclude_filter := '%.%.' || i_origin;
+ END IF;
+
+ SELECT ROUND(extract(epoch from now() at time zone 'utc')) INTO serial_num;
+
+ -- zonefile header
+ SELECT concat(
+ format('%-10s', '$ORIGIN .'), chr(10),
+ format('%-10s', '$TTL'), zf.ttl, chr(10), chr(10),
+ format('%-10s', i_origin || '.'), 'IN SOA ', zf.master_nameserver, '. ', zf.email, '. (', chr(10),
+ format('%-17s', ''), format('%-12s', serial_num), '; serial number', chr(10),
+ format('%-17s', ''), format('%-12s', zf.refresh), '; refresh, seconds', chr(10),
+ format('%-17s', ''), format('%-12s', zf.retry), '; retry, seconds', chr(10),
+ format('%-17s', ''), format('%-12s', zf.expire), '; expire, seconds', chr(10),
+ format('%-17s', ''), format('%-12s', zf.minimum_ttl), '; minimum TTL, seconds', chr(10),
+ format('%-17s', ''), ')'
+ ) FROM zonefile_settings zf WHERE i_origin = zf.origin INTO tmp_var;
+
+ ret = concat(tmp_var, chr(10), chr(10));
+
+ -- ns records
+ SELECT array_to_string(
+ array(
+ SELECT concat(d.name_puny, '. IN NS ', ns.hostname, '.')
+ FROM domains d
+ JOIN nameservers ns ON ns.domain_id = d.id
+ WHERE d.name LIKE include_filter AND d.name NOT LIKE exclude_filter
+ ORDER BY d.name
+ ),
+ chr(10)
+ ) INTO tmp_var;
+
+ ret := concat(ret, '; Zone NS Records', chr(10), tmp_var, chr(10), chr(10));
+
+ -- a glue records for origin nameservers
+ SELECT array_to_string(
+ array(
+ SELECT concat(ns.hostname, '. IN A ', ns.ipv4)
+ FROM nameservers ns
+ JOIN domains d ON d.id = ns.domain_id
+ WHERE d.name = i_origin
+ AND ns.hostname LIKE '%.' || d.name
+ AND ns.ipv4 IS NOT NULL AND ns.ipv4 <> ''
+ ), chr(10)
+ ) INTO tmp_var;
+
+ ret := concat(ret, '; Zone A Records', chr(10), tmp_var);
+
+ -- a glue records for other nameservers
+ SELECT array_to_string(
+ array(
+ SELECT concat(ns.hostname, '. IN A ', ns.ipv4)
+ FROM nameservers ns
+ JOIN domains d ON d.id = ns.domain_id
+ WHERE d.name LIKE include_filter AND d.name NOT LIKE exclude_filter
+ AND ns.hostname LIKE '%.' || d.name
+ AND d.name <> i_origin
+ AND ns.ipv4 IS NOT NULL AND ns.ipv4 <> ''
+ AND NOT EXISTS ( -- filter out glue records that already appeared in origin glue recrods
+ SELECT 1 FROM nameservers nsi
+ JOIN domains di ON nsi.domain_id = di.id
+ WHERE di.name = i_origin
+ AND nsi.hostname = ns.hostname
+ )
+ ), chr(10)
+ ) INTO tmp_var;
+
+ -- TODO This is a possible subtitition to the previous query, stress testing is needed to see which is faster
+
+ -- SELECT ns.*
+ -- FROM nameservers ns
+ -- JOIN domains d ON d.id = ns.domain_id
+ -- WHERE d.name LIKE '%ee' AND d.name NOT LIKE '%pri.ee'
+ -- AND ns.hostname LIKE '%.' || d.name
+ -- AND d.name <> 'ee'
+ -- AND ns.ipv4 IS NOT NULL AND ns.ipv4 <> ''
+ -- AND ns.hostname NOT IN (
+ -- SELECT ns.hostname FROM domains d JOIN nameservers ns ON d.id = ns.domain_id WHERE d.name = 'ee'
+ -- )
+
+ ret := concat(ret, chr(10), tmp_var, chr(10), chr(10));
+
+ -- aaaa glue records for origin nameservers
+ SELECT array_to_string(
+ array(
+ SELECT concat(ns.hostname, '. IN AAAA ', ns.ipv6)
+ FROM nameservers ns
+ JOIN domains d ON d.id = ns.domain_id
+ WHERE d.name = i_origin
+ AND ns.hostname LIKE '%.' || d.name
+ AND ns.ipv6 IS NOT NULL AND ns.ipv6 <> ''
+ ), chr(10)
+ ) INTO tmp_var;
+
+ ret := concat(ret, '; Zone AAAA Records', chr(10), tmp_var);
+
+ -- aaaa glue records for other nameservers
+ SELECT array_to_string(
+ array(
+ SELECT concat(ns.hostname, '. IN AAAA ', ns.ipv6)
+ FROM nameservers ns
+ JOIN domains d ON d.id = ns.domain_id
+ WHERE d.name LIKE include_filter AND d.name NOT LIKE exclude_filter
+ AND ns.hostname LIKE '%.' || d.name
+ AND d.name <> i_origin
+ AND ns.ipv6 IS NOT NULL AND ns.ipv6 <> ''
+ AND NOT EXISTS ( -- filter out glue records that already appeared in origin glue recrods
+ SELECT 1 FROM nameservers nsi
+ JOIN domains di ON nsi.domain_id = di.id
+ WHERE di.name = i_origin
+ AND nsi.hostname = ns.hostname
+ )
+ ), chr(10)
+ ) INTO tmp_var;
+
+ ret := concat(ret, chr(10), tmp_var, chr(10), chr(10));
+
+ -- ds records
+ SELECT array_to_string(
+ array(
+ SELECT concat(
+ d.name_puny, '. 3600 IN DS ', dk.ds_key_tag, ' ',
+ dk.ds_alg, ' ', dk.ds_digest_type, dk.ds_digest
+ )
+ FROM domains d
+ JOIN dnskeys dk ON dk.domain_id = d.id
+ WHERE d.name LIKE include_filter AND d.name NOT LIKE exclude_filter
+ ),
+ chr(10)
+ ) INTO tmp_var;
+
+ ret := concat(ret, '; Zone DS Records', chr(10), tmp_var, chr(10));
+
+ RETURN ret;
+ END;
+ $$
+ LANGUAGE plpgsql;
+ SQL
+ end
+
+ def down
+ execute <<-SQL
+ DROP FUNCTION generate_zonefile(i_origin varchar);
+ SQL
+ end
+end
diff --git a/doc/debian_build_doc.md b/doc/debian_build_doc.md
index 084619b26..1f37cc002 100644
--- a/doc/debian_build_doc.md
+++ b/doc/debian_build_doc.md
@@ -47,7 +47,7 @@ Please install following lib, otherwise your bundler install might not be succes
### Firewall rate limit config
First increase the maximum possible value form 20 to 100 of the hitcount parameter.
-ip_pkt_list_tot of the xt_recent kernel module. Secondly change /proc/xt_recent/ permissions so, epp user can modify the tables.
+ip_pkt_list_tot of the xt_recent kernel module. Secondly change /proc/net/xt_recent/ permissions so, epp user can modify the tables.
This can be done by creating an ip_pkt_list_tot.conf file in /etc/modeprobe.d/ which contains:
````
@@ -79,11 +79,13 @@ iptables -A INPUT -p tcp --dport 43 -m recent --set --rsource --name whois -j AC
#### EPP
+Configure epp server ip in applicatin.yml
+iptables_server_ip: 'x.x.x.x'
Iptables hitcounter is updated by application. For every registrar there is one recent table, where the request counters are stored, registrar handles and sources ips are "connected" with iptables rules.
````
#!/bin/bash
-iptables -A INPUT -p tcp --dport 700 -j CHKLIMITS
+
iptables -N CHKLIMITS
@@ -92,6 +94,6 @@ iptables -A CHKLIMITS -p tcp --dport 700 -s $REGISTRAR_SOURCE2 -m recent --name
iptables -A CHKLIMITS -p tcp --dport 700 -s $REGISTRAR2_SOURCE -m recent --name $REGISTRAR2_CODE --rdest --rcheck --hitcount 100 --seconds 60 -j DROP
iptables -A CHKLIMITS -p tcp --dport 700 -s $REGISTRAR2_SOURCE2 -m recent --name $REGISTRAR2_CODE --rdest --rcheck --hitcount 100 --seconds 60 -j DROP
-
+iptables -A INPUT -p tcp --dport 700 -j CHKLIMITS
````
diff --git a/doc/repp/v1/domain.md b/doc/repp/v1/domain.md
index 79e002b6c..fc417b47f 100644
--- a/doc/repp/v1/domain.md
+++ b/doc/repp/v1/domain.md
@@ -1,3 +1,5 @@
+# Domain listing
+
## GET /repp/v1/domains
Returns domains of the current registrar.
@@ -98,3 +100,83 @@ Content-Type: application/json
"total_number_of_records": 2
}
```
+
+# Transfer info
+
+## GET /repp/v1/domains/*domainname.ee*/transfer_info
+Returns details of contacts associated with a domain to be transfered. Necessary for pre-transfer checks and better user experience in automated registrar systems.
+
+Please note the domain name in the path
+
+#### Request
+```
+GET /repp/v1/domains/ee-test.ee/transfer_info HTTP/1.1
+Accept: application/json
+Authorization: Basic Z2l0bGFiOmdoeXQ5ZTRmdQ==
+Content-Length: 0
+Content-Type: application/json
+Auth-Code: authinfopw
+```
+
+Please note that domain transfer/authorisation code must be placed in header - *Auth-Code*
+
+#### Response
+```
+HTTP/1.1 200 OK
+Cache-Control: max-age=0, private, must-revalidate
+Content-Length: 784
+Content-Type: application/json
+
+{
+ "domain":"ee-test.ee",
+ "registrant":{
+ "code":"EE:R1",
+ "ident_type":"org",
+ "ident_country_code":"EE",
+ "phone":"+372.1234567",
+ "email":"registrant@cache.ee",
+ "street":"Businesstreet 1",
+ "city":"Tallinn",
+ "zip":"10101",
+ "country_code":"EE",
+ "statuses":[
+ "ok",
+ "linked"
+ ]
+ },
+ "admin_contacts":[
+ {
+ "code":"EE:A1",
+ "ident_type":"priv",
+ "ident_country_code":"EE",
+ "phone":"+372.7654321",
+ "email":"admin@cache.ee",
+ "street":"Adminstreet 2",
+ "city":"Tallinn",
+ "zip":"12345",
+ "country_code":"EE",
+ "statuses":[
+ "ok",
+ "linked"
+ ]
+ }
+ ],
+ "tech_contacts":[
+ {
+ "code":"EE:T1",
+ "ident_type":"org",
+ "ident_country_code":"EE",
+ "phone":"+372.7654321",
+ "email":"tech@cache.ee",
+ "street":"Techstreet 1",
+ "city":"Tallinn",
+ "zip":"12345",
+ "country_code":"EE",
+ "statuses":[
+ "ok",
+ "linked"
+ ]
+ }
+ ]
+}
+```
diff --git a/doc/schemas/all-ee-1.0.xsd b/doc/schemas/all-ee-1.0.xsd
index 124f53d24..bd4aeba0c 100644
--- a/doc/schemas/all-ee-1.0.xsd
+++ b/doc/schemas/all-ee-1.0.xsd
@@ -20,15 +20,19 @@
schemaLocation="eppcom-1.0.xsd"/>
+
+
+
+
+
-
-
-
+
diff --git a/doc/schemas/contact-eis-1.0.xsd b/doc/schemas/contact-eis-1.0.xsd
index e1fb084a5..cec571cec 100644
--- a/doc/schemas/contact-eis-1.0.xsd
+++ b/doc/schemas/contact-eis-1.0.xsd
@@ -10,9 +10,9 @@
-
-
-
+
+
+
diff --git a/doc/schemas/domain-eis-1.0.xsd b/doc/schemas/domain-eis-1.0.xsd
index 62da465fe..3fe1188ea 100644
--- a/doc/schemas/domain-eis-1.0.xsd
+++ b/doc/schemas/domain-eis-1.0.xsd
@@ -11,11 +11,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -92,7 +92,6 @@
@@ -386,16 +385,24 @@
+
+
+
+
+
+
+
+
diff --git a/lib/tasks/import.rake b/lib/tasks/import.rake
index 6e6e0664e..de9c17a44 100644
--- a/lib/tasks/import.rake
+++ b/lib/tasks/import.rake
@@ -226,7 +226,6 @@ namespace :import do
registrar_id
creator_str
updator_str
- ident_country_code
legacy_id
street
city
@@ -262,7 +261,6 @@ namespace :import do
Registrar.find_by(legacy_id: x.object.try(:clid)).try(:id),
x.object_registry.try(:registrar).try(:name),
x.object.try(:registrar).try(:name) ? x.object.try(:registrar).try(:name) : x.object_registry.try(:registrar).try(:name),
- x.country.try(:strip),
x.id,
[x.street1.try(:strip), x.street2.try(:strip), x.street3.try(:strip)].join("\n"),
x.city.try(:strip),
@@ -382,8 +380,6 @@ namespace :import do
protocol
alg
public_key
- ds_alg
- ds_digest_type
creator_str
updator_str
legacy_domain_id
@@ -490,8 +486,6 @@ namespace :import do
key.protocol,
key.alg,
key.key,
- 3, # ds_alg
- 1, # ds_digest_type /SHA1)
x.object_registry.try(:registrar).try(:name),
x.object.try(:registrar).try(:name) ? x.object.try(:registrar).try(:name) : x.object_registry.try(:registrar).try(:name),
x.id,
@@ -582,10 +576,10 @@ namespace :import do
puts '-----> Generating dnskey digests...'
- Dnskey.all.each do |x|
- x.generate_digest
- x.generate_ds_key_tag
- x.save(validate: false)
+ Dnskey.all.each do |ds|
+ ds.generate_digest
+ ds.generate_ds_key_tag
+ ds.save(validate: false)
end
puts "-----> Imported #{count} new domains in #{(Time.zone.now.to_f - start).round(2)} seconds"