mirror of
https://github.com/internetee/registry.git
synced 2025-07-27 13:06:18 +02:00
Merge branch 'master' of github.com:domify/registry into domains-nested-refactor
This commit is contained in:
commit
2c35617745
15 changed files with 226 additions and 92 deletions
|
@ -81,3 +81,7 @@ Style/CommentIndentation:
|
||||||
# It did not alayws suggested good format
|
# It did not alayws suggested good format
|
||||||
Style/AlignParameters:
|
Style/AlignParameters:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
# No need fancy style of numbers such as 1_000_000
|
||||||
|
Style/NumericLiterals:
|
||||||
|
Enabled: false
|
||||||
|
|
|
@ -9,7 +9,7 @@ group :red_green_refactor, halt_on_fail: true do
|
||||||
# watch(%r{^(config|lib)/.*})
|
# watch(%r{^(config|lib)/.*})
|
||||||
# end
|
# end
|
||||||
|
|
||||||
guard :rspec, cmd: 'spring rspec', notification: false do
|
guard :rspec, cmd: 'spring rspec --fail-fast', notification: false do
|
||||||
watch(%r{^spec/.+_spec\.rb$})
|
watch(%r{^spec/.+_spec\.rb$})
|
||||||
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
||||||
watch('spec/spec_helper.rb') { "spec" }
|
watch('spec/spec_helper.rb') { "spec" }
|
||||||
|
|
|
@ -90,7 +90,7 @@ class Epp::ContactsController < EppController
|
||||||
@prefix = 'create > create >'
|
@prefix = 'create > create >'
|
||||||
requires(
|
requires(
|
||||||
'postalInfo > name', 'postalInfo > addr > city',
|
'postalInfo > name', 'postalInfo > addr > city',
|
||||||
'postalInfo > addr > cc', 'ident', 'voice', 'email'
|
'postalInfo > addr > cc', 'voice', 'email'
|
||||||
)
|
)
|
||||||
ident = params[:parsed_frame].css('ident')
|
ident = params[:parsed_frame].css('ident')
|
||||||
if ident.present? && ident.text != 'birthday' && ident.attr('cc').blank?
|
if ident.present? && ident.text != 'birthday' && ident.attr('cc').blank?
|
||||||
|
@ -99,8 +99,9 @@ class Epp::ContactsController < EppController
|
||||||
msg: I18n.t('errors.messages.required_attribute_missing', key: 'ident country code missing')
|
msg: I18n.t('errors.messages.required_attribute_missing', key: 'ident country code missing')
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
contact_org_disabled
|
||||||
@prefix = nil
|
@prefix = nil
|
||||||
requires 'extension > extdata > legalDocument'
|
requires 'extension > extdata > ident'
|
||||||
end
|
end
|
||||||
|
|
||||||
def validate_update
|
def validate_update
|
||||||
|
@ -111,15 +112,23 @@ class Epp::ContactsController < EppController
|
||||||
msg: I18n.t('errors.messages.required_parameter_missing', key: 'add, rem or chg')
|
msg: I18n.t('errors.messages.required_parameter_missing', key: 'add, rem or chg')
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
contact_org_disabled
|
||||||
requires 'id', 'authInfo > pw'
|
requires 'id', 'authInfo > pw'
|
||||||
@prefix = nil
|
@prefix = nil
|
||||||
requires 'extension > extdata > legalDocument'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def validate_delete
|
def validate_delete
|
||||||
@prefix = 'delete > delete >'
|
@prefix = 'delete > delete >'
|
||||||
requires 'id', 'authInfo > pw'
|
requires 'id', 'authInfo > pw'
|
||||||
@prefix = nil
|
@prefix = nil
|
||||||
requires 'extension > extdata > legalDocument'
|
end
|
||||||
|
|
||||||
|
def contact_org_disabled
|
||||||
|
return true if ENV['contact_org_enabled'] == 'true'
|
||||||
|
return true if params[:parsed_frame].css('postalInfo org').text.blank?
|
||||||
|
epp_errors << {
|
||||||
|
code: '2306',
|
||||||
|
msg: "#{I18n.t(:contact_org_error)}: postalInfo > org [org]"
|
||||||
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,51 +4,70 @@ class ContactStatus < ActiveRecord::Base
|
||||||
|
|
||||||
belongs_to :contact
|
belongs_to :contact
|
||||||
|
|
||||||
|
# Requests to delete the object MUST be rejected.
|
||||||
CLIENT_DELETE_PROHIBITED = 'clientDeleteProhibited'
|
CLIENT_DELETE_PROHIBITED = 'clientDeleteProhibited'
|
||||||
SERVER_DELETE_PROHIBITED = 'serverDeleteProhibited'
|
SERVER_DELETE_PROHIBITED = 'serverDeleteProhibited'
|
||||||
CLIENT_HOLD = 'clientHold'
|
|
||||||
SERVER_HOLD = 'serverHold'
|
# Requests to transfer the object MUST be rejected.
|
||||||
CLIENT_RENEW_PROHIBITED = 'clientRenewProhibited'
|
|
||||||
SERVER_RENEW_PROHIBITED = 'serverRenewProhibited'
|
|
||||||
CLIENT_TRANSFER_PROHIBITED = 'clientTransferProhibited'
|
CLIENT_TRANSFER_PROHIBITED = 'clientTransferProhibited'
|
||||||
SERVER_TRANSFER_PROHIBITED = 'serverTransferProhibited'
|
SERVER_TRANSFER_PROHIBITED = 'serverTransferProhibited'
|
||||||
|
|
||||||
|
# The contact object has at least one active association with
|
||||||
|
# another object, such as a domain object. Servers SHOULD provide
|
||||||
|
# services to determine existing object associations.
|
||||||
|
# "linked" status MAY be combined with any status.
|
||||||
|
LINKED = 'linked'
|
||||||
|
|
||||||
|
# This is the normal status value for an object that has no pending
|
||||||
|
# operations or prohibitions. This value is set and removed by the
|
||||||
|
# server as other status values are added or removed.
|
||||||
|
# "ok" status MAY only be combined with "linked" status.
|
||||||
|
OK = 'ok'
|
||||||
|
|
||||||
|
# Requests to update the object (other than to remove this status) MUST be rejected.
|
||||||
CLIENT_UPDATE_PROHIBITED = 'clientUpdateProhibited'
|
CLIENT_UPDATE_PROHIBITED = 'clientUpdateProhibited'
|
||||||
SERVER_UPDATE_PROHIBITED = 'serverUpdateProhibited'
|
SERVER_UPDATE_PROHIBITED = 'serverUpdateProhibited'
|
||||||
INACTIVE = 'inactive'
|
|
||||||
OK = 'ok'
|
|
||||||
PENDING_CREATE = 'pendingCreate'
|
|
||||||
PENDING_DELETE = 'pendingDelete'
|
|
||||||
PENDING_RENEW = 'pendingRenew'
|
|
||||||
PENDING_TRANSFER = 'pendingTransfer'
|
|
||||||
PENDING_UPDATE = 'pendingUpdate'
|
|
||||||
|
|
||||||
SERVER_MANUAL_INZONE = 'serverManualInzone'
|
# A transform command has been processed for the object, but the
|
||||||
SERVER_REGISTRANT_CHANGE_PROHIBITED = 'serverRegistrantChangeProhibited'
|
# action has not been completed by the server. Server operators can
|
||||||
SERVER_ADMIN_CHANGE_PROHIBITED = 'serverAdminChangeProhibited'
|
# delay action completion for a variety of reasons, such as to allow
|
||||||
SERVER_TECH_CHANGE_PROHIBITED = 'serverTechChangeProhibited'
|
# for human review or third-party action. A transform command that
|
||||||
FORCE_DELETE = 'forceDelete'
|
# is processed, but whose requested action is pending, is noted with
|
||||||
DELETE_CANDIDATE = 'deleteCandidate'
|
# response code 1001.
|
||||||
EXPIRED = 'expired'
|
# When the requested action has been completed, the pendingCreate,
|
||||||
|
# pendingDelete, pendingTransfer, or pendingUpdate status value MUST be
|
||||||
|
# removed. All clients involved in the transaction MUST be notified
|
||||||
|
# using a service message that the action has been completed and that
|
||||||
|
# the status of the object has changed.
|
||||||
|
# The pendingCreate, pendingDelete, pendingTransfer, and pendingUpdate
|
||||||
|
# status values MUST NOT be combined with each other.
|
||||||
|
PENDING_CREATE = 'pendingCreate'
|
||||||
|
# "pendingTransfer" status MUST NOT be combined with either
|
||||||
|
# "clientTransferProhibited" or "serverTransferProhibited" status.
|
||||||
|
PENDING_TRANSFER = 'pendingTransfer'
|
||||||
|
# "pendingUpdate" status MUST NOT be combined with either
|
||||||
|
# "clientUpdateProhibited" or "serverUpdateProhibited" status.
|
||||||
|
PENDING_UPDATE = 'pendingUpdate'
|
||||||
|
# "pendingDelete" MUST NOT be combined with either
|
||||||
|
# "clientDeleteProhibited" or "serverDeleteProhibited" status.
|
||||||
|
PENDING_DELETE = 'pendingDelete'
|
||||||
|
|
||||||
STATUSES = [
|
STATUSES = [
|
||||||
CLIENT_DELETE_PROHIBITED, SERVER_DELETE_PROHIBITED, CLIENT_HOLD, SERVER_HOLD,
|
CLIENT_DELETE_PROHIBITED, SERVER_DELETE_PROHIBITED,
|
||||||
CLIENT_RENEW_PROHIBITED, SERVER_RENEW_PROHIBITED, CLIENT_TRANSFER_PROHIBITED,
|
CLIENT_TRANSFER_PROHIBITED,
|
||||||
SERVER_TRANSFER_PROHIBITED, CLIENT_UPDATE_PROHIBITED, SERVER_UPDATE_PROHIBITED,
|
SERVER_TRANSFER_PROHIBITED, CLIENT_UPDATE_PROHIBITED, SERVER_UPDATE_PROHIBITED,
|
||||||
INACTIVE, OK, PENDING_CREATE, PENDING_DELETE, PENDING_RENEW, PENDING_TRANSFER,
|
OK, PENDING_CREATE, PENDING_DELETE, PENDING_TRANSFER,
|
||||||
PENDING_UPDATE, SERVER_MANUAL_INZONE, SERVER_REGISTRANT_CHANGE_PROHIBITED,
|
PENDING_UPDATE, LINKED
|
||||||
SERVER_ADMIN_CHANGE_PROHIBITED, SERVER_TECH_CHANGE_PROHIBITED, FORCE_DELETE,
|
|
||||||
DELETE_CANDIDATE, EXPIRED
|
|
||||||
]
|
]
|
||||||
|
|
||||||
CLIENT_STATUSES = [
|
CLIENT_STATUSES = [
|
||||||
CLIENT_DELETE_PROHIBITED, CLIENT_HOLD, CLIENT_RENEW_PROHIBITED, CLIENT_TRANSFER_PROHIBITED,
|
CLIENT_DELETE_PROHIBITED, CLIENT_TRANSFER_PROHIBITED,
|
||||||
CLIENT_UPDATE_PROHIBITED
|
CLIENT_UPDATE_PROHIBITED
|
||||||
]
|
]
|
||||||
|
|
||||||
SERVER_STATUSES = [
|
SERVER_STATUSES = [
|
||||||
SERVER_DELETE_PROHIBITED, SERVER_HOLD, SERVER_RENEW_PROHIBITED, SERVER_TRANSFER_PROHIBITED,
|
SERVER_DELETE_PROHIBITED, SERVER_TRANSFER_PROHIBITED,
|
||||||
SERVER_UPDATE_PROHIBITED, SERVER_MANUAL_INZONE, SERVER_REGISTRANT_CHANGE_PROHIBITED,
|
SERVER_UPDATE_PROHIBITED
|
||||||
SERVER_ADMIN_CHANGE_PROHIBITED, SERVER_TECH_CHANGE_PROHIBITED
|
|
||||||
]
|
]
|
||||||
|
|
||||||
def epp_code_map
|
def epp_code_map
|
||||||
|
|
|
@ -4,22 +4,64 @@ class DomainStatus < ActiveRecord::Base
|
||||||
|
|
||||||
belongs_to :domain
|
belongs_to :domain
|
||||||
|
|
||||||
|
# Requests to delete the object MUST be rejected.
|
||||||
CLIENT_DELETE_PROHIBITED = 'clientDeleteProhibited'
|
CLIENT_DELETE_PROHIBITED = 'clientDeleteProhibited'
|
||||||
SERVER_DELETE_PROHIBITED = 'serverDeleteProhibited'
|
SERVER_DELETE_PROHIBITED = 'serverDeleteProhibited'
|
||||||
|
|
||||||
|
# DNS delegation information MUST NOT be published for the object.
|
||||||
CLIENT_HOLD = 'clientHold'
|
CLIENT_HOLD = 'clientHold'
|
||||||
SERVER_HOLD = 'serverHold'
|
SERVER_HOLD = 'serverHold'
|
||||||
|
|
||||||
|
# Requests to renew the object MUST be rejected.
|
||||||
CLIENT_RENEW_PROHIBITED = 'clientRenewProhibited'
|
CLIENT_RENEW_PROHIBITED = 'clientRenewProhibited'
|
||||||
SERVER_RENEW_PROHIBITED = 'serverRenewProhibited'
|
SERVER_RENEW_PROHIBITED = 'serverRenewProhibited'
|
||||||
|
|
||||||
|
# Requests to transfer the object MUST be rejected.
|
||||||
CLIENT_TRANSFER_PROHIBITED = 'clientTransferProhibited'
|
CLIENT_TRANSFER_PROHIBITED = 'clientTransferProhibited'
|
||||||
SERVER_TRANSFER_PROHIBITED = 'serverTransferProhibited'
|
SERVER_TRANSFER_PROHIBITED = 'serverTransferProhibited'
|
||||||
|
|
||||||
|
# Requests to update the object (other than to remove this status) MUST be rejected.
|
||||||
CLIENT_UPDATE_PROHIBITED = 'clientUpdateProhibited'
|
CLIENT_UPDATE_PROHIBITED = 'clientUpdateProhibited'
|
||||||
SERVER_UPDATE_PROHIBITED = 'serverUpdateProhibited'
|
SERVER_UPDATE_PROHIBITED = 'serverUpdateProhibited'
|
||||||
|
|
||||||
|
# Delegation information has not been associated with the object.
|
||||||
|
# This is the default status when a domain object is first created
|
||||||
|
# and there are no associated host objects for the DNS delegation.
|
||||||
|
# This status can also be set by the server when all host-object
|
||||||
|
# associations are removed.
|
||||||
INACTIVE = 'inactive'
|
INACTIVE = 'inactive'
|
||||||
|
|
||||||
|
# This is the normal status value for an object that has no pending
|
||||||
|
# operations or prohibitions. This value is set and removed by the
|
||||||
|
# server as other status values are added or removed.
|
||||||
|
# "ok" status MUST NOT be combined with any other status.
|
||||||
OK = 'ok'
|
OK = 'ok'
|
||||||
|
|
||||||
|
# A transform command has been processed for the object, but the
|
||||||
|
# action has not been completed by the server. Server operators can
|
||||||
|
# delay action completion for a variety of reasons, such as to allow
|
||||||
|
# for human review or third-party action. A transform command that
|
||||||
|
# is processed, but whose requested action is pending, is noted with
|
||||||
|
# response code 1001.
|
||||||
|
# When the requested action has been completed, the pendingCreate,
|
||||||
|
# pendingDelete, pendingRenew, pendingTransfer, or pendingUpdate status
|
||||||
|
# value MUST be removed. All clients involved in the transaction MUST
|
||||||
|
# be notified using a service message that the action has been
|
||||||
|
# completed and that the status of the object has changed.
|
||||||
|
# The pendingCreate, pendingDelete, pendingRenew, pendingTransfer, and
|
||||||
|
# pendingUpdate status values MUST NOT be combined with each other.
|
||||||
PENDING_CREATE = 'pendingCreate'
|
PENDING_CREATE = 'pendingCreate'
|
||||||
|
# "pendingDelete" status MUST NOT be combined with either
|
||||||
|
# "clientDeleteProhibited" or "serverDeleteProhibited" status.
|
||||||
PENDING_DELETE = 'pendingDelete'
|
PENDING_DELETE = 'pendingDelete'
|
||||||
|
# "pendingRenew" status MUST NOT be combined with either
|
||||||
|
# "clientRenewProhibited" or "serverRenewProhibited" status.
|
||||||
PENDING_RENEW = 'pendingRenew'
|
PENDING_RENEW = 'pendingRenew'
|
||||||
|
# "pendingTransfer" status MUST NOT be combined with either
|
||||||
|
# "clientTransferProhibited" or "serverTransferProhibited" status.
|
||||||
PENDING_TRANSFER = 'pendingTransfer'
|
PENDING_TRANSFER = 'pendingTransfer'
|
||||||
|
# "pendingUpdate" status MUST NOT be combined with either
|
||||||
|
# "clientUpdateProhibited" or "serverUpdateProhibited" status.
|
||||||
PENDING_UPDATE = 'pendingUpdate'
|
PENDING_UPDATE = 'pendingUpdate'
|
||||||
|
|
||||||
SERVER_MANUAL_INZONE = 'serverManualInzone'
|
SERVER_MANUAL_INZONE = 'serverManualInzone'
|
||||||
|
|
|
@ -18,13 +18,6 @@ class Epp::Contact < Contact
|
||||||
at[:fax] = f.css('fax').text if f.css('fax').present?
|
at[:fax] = f.css('fax').text if f.css('fax').present?
|
||||||
at[:phone] = f.css('voice').text if f.css('voice').present?
|
at[:phone] = f.css('voice').text if f.css('voice').present?
|
||||||
at[:auth_info] = f.css('authInfo pw').text if f.css('authInfo pw').present?
|
at[:auth_info] = f.css('authInfo pw').text if f.css('authInfo pw').present?
|
||||||
|
|
||||||
if f.css('ident').present? && f.css('ident').attr('type').present?
|
|
||||||
at[:ident] = f.css('ident').text
|
|
||||||
at[:ident_type] = f.css('ident').attr('type').try(:text)
|
|
||||||
at[:ident_country_code] = f.css('ident').attr('cc').try(:text)
|
|
||||||
end
|
|
||||||
|
|
||||||
at[:address_attributes] = {}.with_indifferent_access
|
at[:address_attributes] = {}.with_indifferent_access
|
||||||
sat = at[:address_attributes]
|
sat = at[:address_attributes]
|
||||||
sat[:city] = f.css('postalInfo addr city').text if f.css('postalInfo addr city').present?
|
sat[:city] = f.css('postalInfo addr city').text if f.css('postalInfo addr city').present?
|
||||||
|
@ -38,7 +31,7 @@ class Epp::Contact < Contact
|
||||||
if legal_frame.present?
|
if legal_frame.present?
|
||||||
at[:legal_documents_attributes] = legal_document_attrs(legal_frame)
|
at[:legal_documents_attributes] = legal_document_attrs(legal_frame)
|
||||||
end
|
end
|
||||||
|
at.merge!(ident_attrs(f.css('ident').first))
|
||||||
at
|
at
|
||||||
end
|
end
|
||||||
# rubocop: enable Metrics/MethodLength
|
# rubocop: enable Metrics/MethodLength
|
||||||
|
@ -63,10 +56,27 @@ class Epp::Contact < Contact
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def ident_attrs(ident_frame)
|
||||||
|
return {} if ident_frame.blank?
|
||||||
|
return {} if ident_frame.try('text').blank?
|
||||||
|
return {} if ident_frame.attr('type').blank?
|
||||||
|
return {} if ident_frame.attr('cc').blank?
|
||||||
|
|
||||||
|
{
|
||||||
|
ident: ident_frame.text,
|
||||||
|
ident_type: ident_frame.attr('type'),
|
||||||
|
ident_country_code: ident_frame.attr('cc')
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
def legal_document_attrs(legal_frame)
|
def legal_document_attrs(legal_frame)
|
||||||
|
return [] if legal_frame.blank?
|
||||||
|
return [] if legal_frame.try('text').blank?
|
||||||
|
return [] if legal_frame.attr('type').blank?
|
||||||
|
|
||||||
[{
|
[{
|
||||||
body: legal_frame.text,
|
body: legal_frame.text,
|
||||||
document_type: legal_frame['type']
|
document_type: legal_frame.attr('type')
|
||||||
}]
|
}]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -93,6 +103,7 @@ class Epp::Contact < Contact
|
||||||
return super if frame.blank?
|
return super if frame.blank?
|
||||||
at = {}.with_indifferent_access
|
at = {}.with_indifferent_access
|
||||||
at.deep_merge!(self.class.attrs_from(frame.css('chg')))
|
at.deep_merge!(self.class.attrs_from(frame.css('chg')))
|
||||||
|
at.merge!(self.class.ident_attrs(frame.css('ident').first))
|
||||||
legal_frame = frame.css('legalDocument').first
|
legal_frame = frame.css('legalDocument').first
|
||||||
at[:legal_documents_attributes] = self.class.legal_document_attrs(legal_frame)
|
at[:legal_documents_attributes] = self.class.legal_document_attrs(legal_frame)
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
.panel-body
|
.panel-body
|
||||||
- unless @contact.address.nil?
|
- unless @contact.address.nil?
|
||||||
%dl.dl-horizontal
|
%dl.dl-horizontal
|
||||||
- if @contact.bic?
|
- if @contact.org_name.present?
|
||||||
%dt= t(:org_name)
|
%dt= t(:org_name)
|
||||||
%dd= @contact.org_name
|
%dd= @contact.org_name
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ xml.epp_head do
|
||||||
end
|
end
|
||||||
|
|
||||||
xml.resData do
|
xml.resData do
|
||||||
xml.tag!('contact:chkData', 'xmlns:contact' => 'urn:ietf:params:xml:ns:contact-1.0') do
|
xml.tag!('contact:infData', 'xmlns:contact' => 'urn:ietf:params:xml:ns:contact-1.0') do
|
||||||
xml.tag!('contact:id', @contact.code)
|
xml.tag!('contact:id', @contact.code)
|
||||||
xml << render('/epp/contacts/postal_info')
|
xml << render('/epp/contacts/postal_info')
|
||||||
xml.tag!('contact:voice', @contact.phone) #if @disclosure.try(:phone) || @owner
|
xml.tag!('contact:voice', @contact.phone) #if @disclosure.try(:phone) || @owner
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
app_name: .EE Registry
|
app_name: .EE Registry
|
||||||
zonefile_export_dir: 'export/zonefiles'
|
zonefile_export_dir: 'export/zonefiles'
|
||||||
|
|
||||||
|
# Contact epp will not accept org value by default
|
||||||
|
# and returns 2306 "Parameter value policy error"
|
||||||
|
contact_org_enabled: 'false'
|
||||||
|
|
||||||
# You can use `rake secret` to generate a secure secret key.
|
# You can use `rake secret` to generate a secure secret key.
|
||||||
# Your secret key is used for verifying the integrity of signed cookies.
|
# Your secret key is used for verifying the integrity of signed cookies.
|
||||||
# If you change this key, all old signed cookies will become invalid!
|
# If you change this key, all old signed cookies will become invalid!
|
||||||
|
|
|
@ -490,3 +490,4 @@ en:
|
||||||
sign_this_request: 'Sign this request'
|
sign_this_request: 'Sign this request'
|
||||||
revoke_this_certificate: 'Revoke this certificate'
|
revoke_this_certificate: 'Revoke this certificate'
|
||||||
crt_revoked: 'CRT (revoked)'
|
crt_revoked: 'CRT (revoked)'
|
||||||
|
contact_org_error: 'Parameter value policy error. Org should be blank'
|
||||||
|
|
|
@ -16,7 +16,7 @@ Contact Mapping protocol short version:
|
||||||
<contact:id> 0-1 Contact id, optional, generated automatically if missing
|
<contact:id> 0-1 Contact id, optional, generated automatically if missing
|
||||||
<contact:postalInfo> 1 Postal information container
|
<contact:postalInfo> 1 Postal information container
|
||||||
<contact:name> 1 Full name of the contact
|
<contact:name> 1 Full name of the contact
|
||||||
<contact:org> 0-1 Name of organization
|
<contact:org> 0 Org is not supported and should be blank or missing
|
||||||
<contact:addr> 1 Address container
|
<contact:addr> 1 Address container
|
||||||
<contact:street> 0-n Street name
|
<contact:street> 0-n Street name
|
||||||
<contact:city> 1 City name
|
<contact:city> 1 City name
|
||||||
|
@ -25,14 +25,14 @@ Contact Mapping protocol short version:
|
||||||
<contact:cc> 1 Country code, 2 letters uppercase, in ISO_3166-1 alpha 2
|
<contact:cc> 1 Country code, 2 letters uppercase, in ISO_3166-1 alpha 2
|
||||||
<contact:voice> 1 Phone number in format \+ddd.d+
|
<contact:voice> 1 Phone number in format \+ddd.d+
|
||||||
<contact:email> 1 E-mail
|
<contact:email> 1 E-mail
|
||||||
<contact:ident> 1 Contact identificator
|
<extension> 1
|
||||||
|
<eis:extdata> 1 Attribute: xmlns:eis="urn:ee:eis:xml:epp:eis-1.0"
|
||||||
|
<eis:ident> 1 Contact identificator
|
||||||
Attribute: type="bic/priv/birthday"
|
Attribute: type="bic/priv/birthday"
|
||||||
"bic" # Business registry code
|
"bic" # Business registry code
|
||||||
"priv" # National idendtification number
|
"priv" # National idendtification number
|
||||||
"birthday" # Birthday date in format in DD-MM-YYYY
|
"birthday" # Birthday date in format in DD-MM-YYYY
|
||||||
<extension> 1
|
<eis:legalDocument> 0-1 Base64 encoded document
|
||||||
<eis:extdata> 1 Attribute: xmlns:eis="urn:ee:eis:xml:epp:eis-1.0"
|
|
||||||
<eis:legalDocument> 1 Base64 encoded document
|
|
||||||
Attribute: type="pdf/bdoc/ddoc/zip/rar/gz/tar/7z"
|
Attribute: type="pdf/bdoc/ddoc/zip/rar/gz/tar/7z"
|
||||||
|
|
||||||
[EXAMPLE REQUEST AND RESPONSE](/doc/epp-examples.md#epp-contact-with-valid-user-create-command-successfully-creates-a-contact)
|
[EXAMPLE REQUEST AND RESPONSE](/doc/epp-examples.md#epp-contact-with-valid-user-create-command-successfully-creates-a-contact)
|
||||||
|
@ -47,7 +47,7 @@ Contact Mapping protocol short version:
|
||||||
<contact:chg> 1 Change container
|
<contact:chg> 1 Change container
|
||||||
<contact:postalInfo> 1 Postal information container
|
<contact:postalInfo> 1 Postal information container
|
||||||
<contact:name> 0-1 Full name of the contact
|
<contact:name> 0-1 Full name of the contact
|
||||||
<contact:org> 0-1 Name of organization
|
<contact:org> 0 Org is not supported and should be blank or missing
|
||||||
<contact:addr> 0-1 Address container
|
<contact:addr> 0-1 Address container
|
||||||
<contact:street> 0-n Street name
|
<contact:street> 0-n Street name
|
||||||
<contact:city> 0-1 City name
|
<contact:city> 0-1 City name
|
||||||
|
@ -56,15 +56,15 @@ Contact Mapping protocol short version:
|
||||||
<contact:cc> 0-1 Country code, 2 letters uppercase, in ISO_3166-1 alpha 2
|
<contact:cc> 0-1 Country code, 2 letters uppercase, in ISO_3166-1 alpha 2
|
||||||
<contact:voice> 0-1 Phone number in format \+ddd.d+
|
<contact:voice> 0-1 Phone number in format \+ddd.d+
|
||||||
<contact:email> 0-1 E-mail
|
<contact:email> 0-1 E-mail
|
||||||
<contact:ident> 0-1 Contact identificator
|
|
||||||
Attribute: type="bic/priv/birthday"
|
|
||||||
"bic" # Business registry code
|
|
||||||
"priv" # National idendtification number
|
|
||||||
"birthday" # Birthday date in format in DD-MM-YYYY
|
|
||||||
<contact:authInfo> 0-1 Required if registrar is not the owner of the contact.
|
<contact:authInfo> 0-1 Required if registrar is not the owner of the contact.
|
||||||
<contact:pw> 1 Contact password. Attribute: roid="String"
|
<contact:pw> 1 Contact password. Attribute: roid="String"
|
||||||
<extension> 0-1
|
<extension> 0-1
|
||||||
<eis:extdata> 0-1 Attribute: xmlns:eis="urn:ee:eis:xml:epp:eis-1.0"
|
<eis:extdata> 0-1 Attribute: xmlns:eis="urn:ee:eis:xml:epp:eis-1.0"
|
||||||
|
<eis:ident> 0-1 Contact identificator
|
||||||
|
Attribute: type="bic/priv/birthday"
|
||||||
|
"bic" # Business registry code
|
||||||
|
"priv" # National idendtification number
|
||||||
|
"birthday" # Birthday date in format in DD-MM-YYYY
|
||||||
<eis:legalDocument> 0-1 Base64 encoded document.
|
<eis:legalDocument> 0-1 Base64 encoded document.
|
||||||
Attribute: type="pdf/bdoc/ddoc/zip/rar/gz/tar/7z"
|
Attribute: type="pdf/bdoc/ddoc/zip/rar/gz/tar/7z"
|
||||||
|
|
||||||
|
@ -80,9 +80,9 @@ Contact Mapping protocol short version:
|
||||||
<contact:id> 1 Contact id
|
<contact:id> 1 Contact id
|
||||||
<contact:authInfo> 0-1 Required if registrar is not the owner of the contact.
|
<contact:authInfo> 0-1 Required if registrar is not the owner of the contact.
|
||||||
<contact:pw> 1 Contact password. Attribute: roid="String"
|
<contact:pw> 1 Contact password. Attribute: roid="String"
|
||||||
<extension> 1
|
<extension> 0-1
|
||||||
<eis:extdata> 1 Attribute: xmlns:eis="urn:ee:eis:xml:epp:eis-1.0"
|
<eis:extdata> 0-1 Attribute: xmlns:eis="urn:ee:eis:xml:epp:eis-1.0"
|
||||||
<eis:legalDocument> 1 Base64 encoded document.
|
<eis:legalDocument> 0-1 Base64 encoded document.
|
||||||
Attribute: type="pdf/bdoc/ddoc/zip/rar/gz/tar/7z"
|
Attribute: type="pdf/bdoc/ddoc/zip/rar/gz/tar/7z"
|
||||||
<clTRID> 0-1 Client transaction id
|
<clTRID> 0-1 Client transaction id
|
||||||
|
|
||||||
|
|
|
@ -15,17 +15,23 @@ describe 'EPP Contact', epp: true do
|
||||||
|
|
||||||
@contact = Fabricate(:contact, registrar: @registrar1)
|
@contact = Fabricate(:contact, registrar: @registrar1)
|
||||||
|
|
||||||
@legal_document = {
|
@extension = {
|
||||||
legalDocument: {
|
legalDocument: {
|
||||||
value: 'JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp==',
|
value: 'JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp==',
|
||||||
attrs: { type: 'pdf' }
|
attrs: { type: 'pdf' }
|
||||||
|
},
|
||||||
|
ident: {
|
||||||
|
value: '37605030299',
|
||||||
|
attrs: { type: 'priv', cc: 'EE' }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with valid user' do
|
context 'with valid user' do
|
||||||
context 'create command' do
|
context 'create command' do
|
||||||
def create_request(overwrites = {})
|
def create_request(overwrites = {}, extension = {})
|
||||||
|
extension = @extension if extension.blank?
|
||||||
|
|
||||||
defaults = {
|
defaults = {
|
||||||
postalInfo: {
|
postalInfo: {
|
||||||
name: { value: 'John Doe' },
|
name: { value: 'John Doe' },
|
||||||
|
@ -36,10 +42,9 @@ describe 'EPP Contact', epp: true do
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
voice: { value: '+372.1234567' },
|
voice: { value: '+372.1234567' },
|
||||||
email: { value: 'test@example.example' },
|
email: { value: 'test@example.example' }
|
||||||
ident: { value: '37605030299', attrs: { type: 'priv', cc: 'EE' } }
|
|
||||||
}
|
}
|
||||||
create_xml = @epp_xml.create(defaults.deep_merge(overwrites), @legal_document)
|
create_xml = @epp_xml.create(defaults.deep_merge(overwrites), extension)
|
||||||
epp_plain_request(create_xml, :xml)
|
epp_plain_request(create_xml, :xml)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -52,13 +57,11 @@ describe 'EPP Contact', epp: true do
|
||||||
response[:results][2][:msg].should ==
|
response[:results][2][:msg].should ==
|
||||||
'Required parameter missing: create > create > postalInfo > addr > cc [cc]'
|
'Required parameter missing: create > create > postalInfo > addr > cc [cc]'
|
||||||
response[:results][3][:msg].should ==
|
response[:results][3][:msg].should ==
|
||||||
'Required parameter missing: create > create > ident [ident]'
|
|
||||||
response[:results][4][:msg].should ==
|
|
||||||
'Required parameter missing: create > create > voice [voice]'
|
'Required parameter missing: create > create > voice [voice]'
|
||||||
response[:results][5][:msg].should ==
|
response[:results][4][:msg].should ==
|
||||||
'Required parameter missing: create > create > email [email]'
|
'Required parameter missing: create > create > email [email]'
|
||||||
response[:results][6][:msg].should ==
|
response[:results][5][:msg].should ==
|
||||||
'Required parameter missing: extension > extdata > legalDocument [legal_document]'
|
'Required parameter missing: extension > extdata > ident [ident]'
|
||||||
|
|
||||||
response[:results][0][:result_code].should == '2003'
|
response[:results][0][:result_code].should == '2003'
|
||||||
response[:results][1][:result_code].should == '2003'
|
response[:results][1][:result_code].should == '2003'
|
||||||
|
@ -66,9 +69,8 @@ describe 'EPP Contact', epp: true do
|
||||||
response[:results][3][:result_code].should == '2003'
|
response[:results][3][:result_code].should == '2003'
|
||||||
response[:results][4][:result_code].should == '2003'
|
response[:results][4][:result_code].should == '2003'
|
||||||
response[:results][5][:result_code].should == '2003'
|
response[:results][5][:result_code].should == '2003'
|
||||||
response[:results][6][:result_code].should == '2003'
|
|
||||||
|
|
||||||
response[:results].count.should == 7
|
response[:results].count.should == 6
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'successfully creates a contact' do
|
it 'successfully creates a contact' do
|
||||||
|
@ -94,9 +96,17 @@ describe 'EPP Contact', epp: true do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'successfully saves ident type' do
|
it 'successfully saves ident type' do
|
||||||
response = create_request(
|
extension = {
|
||||||
{ ident: { value: '1990-22-12', attrs: { type: 'birthday' } } }
|
legalDocument: {
|
||||||
)
|
value: 'JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp==',
|
||||||
|
attrs: { type: 'pdf' }
|
||||||
|
},
|
||||||
|
ident: {
|
||||||
|
value: '1990-22-12',
|
||||||
|
attrs: { type: 'birthday', cc: 'US' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
response = create_request({}, extension)
|
||||||
|
|
||||||
response[:msg].should == 'Command completed successfully'
|
response[:msg].should == 'Command completed successfully'
|
||||||
response[:result_code].should == '1000'
|
response[:result_code].should == '1000'
|
||||||
|
@ -128,15 +138,21 @@ describe 'EPP Contact', epp: true do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'successfully saves custom code' do
|
it 'successfully saves custom code' do
|
||||||
response = create_request(
|
response = create_request({ id: { value: '12345' } })
|
||||||
{ id: { value: '12345' } }
|
|
||||||
)
|
|
||||||
|
|
||||||
response[:msg].should == 'Command completed successfully'
|
response[:msg].should == 'Command completed successfully'
|
||||||
response[:result_code].should == '1000'
|
response[:result_code].should == '1000'
|
||||||
|
|
||||||
Contact.last.code.should == 'registrar1:12345'
|
Contact.last.code.should == 'registrar1:12345'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'should return parameter value policy errror' do
|
||||||
|
response = create_request({ postalInfo: { org: { value: 'should not save' } } })
|
||||||
|
response[:msg].should ==
|
||||||
|
'Parameter value policy error. Org should be blank: postalInfo > org [org]'
|
||||||
|
response[:result_code].should == '2306'
|
||||||
|
|
||||||
|
Contact.last.org_name.should == nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'update command' do
|
context 'update command' do
|
||||||
|
@ -150,7 +166,9 @@ describe 'EPP Contact', epp: true do
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_request(overwrites = {})
|
def update_request(overwrites = {}, extension = {})
|
||||||
|
extension = @extension if extension.blank?
|
||||||
|
|
||||||
defaults = {
|
defaults = {
|
||||||
id: { value: 'asd123123er' },
|
id: { value: 'asd123123er' },
|
||||||
authInfo: { pw: { value: 'password' } },
|
authInfo: { pw: { value: 'password' } },
|
||||||
|
@ -168,7 +186,7 @@ describe 'EPP Contact', epp: true do
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
update_xml = @epp_xml.update(defaults.deep_merge(overwrites), @legal_document)
|
update_xml = @epp_xml.update(defaults.deep_merge(overwrites), extension)
|
||||||
epp_plain_request(update_xml, :xml)
|
epp_plain_request(update_xml, :xml)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -184,10 +202,7 @@ describe 'EPP Contact', epp: true do
|
||||||
response[:results][2][:msg].should ==
|
response[:results][2][:msg].should ==
|
||||||
'Required parameter missing: update > update > authInfo > pw [pw]'
|
'Required parameter missing: update > update > authInfo > pw [pw]'
|
||||||
response[:results][2][:result_code].should == '2003'
|
response[:results][2][:result_code].should == '2003'
|
||||||
response[:results][3][:msg].should ==
|
response[:results].count.should == 3
|
||||||
'Required parameter missing: extension > extdata > legalDocument [legal_document]'
|
|
||||||
response[:results][3][:result_code].should == '2003'
|
|
||||||
response[:results].count.should == 4
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns error if obj doesnt exist' do
|
it 'returns error if obj doesnt exist' do
|
||||||
|
@ -242,6 +257,38 @@ describe 'EPP Contact', epp: true do
|
||||||
|
|
||||||
@contact.reload.code.should == 'sh8013'
|
@contact.reload.code.should == 'sh8013'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'should update ident' do
|
||||||
|
extension = {
|
||||||
|
legalDocument: {
|
||||||
|
value: 'JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp==',
|
||||||
|
attrs: { type: 'pdf' }
|
||||||
|
},
|
||||||
|
ident: {
|
||||||
|
value: '1990-22-12',
|
||||||
|
attrs: { type: 'birthday', cc: 'US' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
response = update_request({ id: { value: 'sh8013' } }, extension)
|
||||||
|
response[:msg].should == 'Command completed successfully'
|
||||||
|
response[:result_code].should == '1000'
|
||||||
|
|
||||||
|
Contact.find_by(code: 'sh8013').ident_type.should == 'birthday'
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should return parameter value policy errror for org update' do
|
||||||
|
response = update_request({
|
||||||
|
id: { value: 'sh8013' },
|
||||||
|
chg: {
|
||||||
|
postalInfo: { org: { value: 'should not save' } }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
response[:msg].should ==
|
||||||
|
'Parameter value policy error. Org should be blank: postalInfo > org [org]'
|
||||||
|
response[:result_code].should == '2306'
|
||||||
|
|
||||||
|
Contact.find_by(code: 'sh8013').org_name.should == nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'delete command' do
|
context 'delete command' do
|
||||||
|
@ -254,7 +301,7 @@ describe 'EPP Contact', epp: true do
|
||||||
id: { value: @contact.code },
|
id: { value: @contact.code },
|
||||||
authInfo: { pw: { value: @contact.auth_info } }
|
authInfo: { pw: { value: @contact.auth_info } }
|
||||||
}
|
}
|
||||||
delete_xml = @epp_xml.delete(defaults.deep_merge(overwrites), @legal_document)
|
delete_xml = @epp_xml.delete(defaults.deep_merge(overwrites), @extension)
|
||||||
epp_plain_request(delete_xml, :xml)
|
epp_plain_request(delete_xml, :xml)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -267,10 +314,7 @@ describe 'EPP Contact', epp: true do
|
||||||
response[:results][1][:msg].should ==
|
response[:results][1][:msg].should ==
|
||||||
'Required parameter missing: delete > delete > authInfo > pw [pw]'
|
'Required parameter missing: delete > delete > authInfo > pw [pw]'
|
||||||
response[:results][1][:result_code].should == '2003'
|
response[:results][1][:result_code].should == '2003'
|
||||||
response[:results][2][:msg].should ==
|
response[:results].count.should == 2
|
||||||
'Required parameter missing: extension > extdata > legalDocument [legal_document]'
|
|
||||||
response[:results][2][:result_code].should == '2003'
|
|
||||||
response[:results].count.should == 3
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns error if obj doesnt exist' do
|
it 'returns error if obj doesnt exist' do
|
||||||
|
@ -381,7 +425,7 @@ describe 'EPP Contact', epp: true do
|
||||||
response[:msg].should == 'Command completed successfully'
|
response[:msg].should == 'Command completed successfully'
|
||||||
response[:result_code].should == '1000'
|
response[:result_code].should == '1000'
|
||||||
|
|
||||||
contact = response[:parsed].css('resData chkData')
|
contact = response[:parsed].css('resData infData')
|
||||||
contact.css('name').first.text.should == 'Johnny Awesome'
|
contact.css('name').first.text.should == 'Johnny Awesome'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -697,7 +697,7 @@ describe 'EPP Domain', epp: true do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with valid domain' do
|
context 'with valid domain' do
|
||||||
before(:each) { Fabricate(:domain, name: next_domain_name, registrar: @registrar1, dnskeys: []) }
|
before(:each) { Fabricate(:domain, registrar: @registrar1, dnskeys: []) }
|
||||||
let(:domain) { Domain.last }
|
let(:domain) { Domain.last }
|
||||||
|
|
||||||
### TRANSFER ###
|
### TRANSFER ###
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
Fabricator(:domain) do
|
Fabricator(:domain) do
|
||||||
name { "fabricate_name#{rand(1_000_000)}.ee" }
|
name { sequence(:name) { |i| "fabricate_name#{i}.ee" } }
|
||||||
valid_to Date.new(2014, 8, 7)
|
valid_to Date.new(2014, 8, 7)
|
||||||
period 1
|
period 1
|
||||||
period_unit 'y'
|
period_unit 'y'
|
||||||
|
|
|
@ -112,7 +112,7 @@ module Epp
|
||||||
end
|
end
|
||||||
|
|
||||||
def next_domain_name
|
def next_domain_name
|
||||||
"example#{rand(100000000)}.ee"
|
"example#{rand(100_000_000_000_000_000)}.ee"
|
||||||
end
|
end
|
||||||
|
|
||||||
### REQUEST TEMPLATES ###
|
### REQUEST TEMPLATES ###
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue