Merge branch 'master' into alpha

This commit is contained in:
Priit Tark 2015-06-17 07:55:18 +03:00
commit 627851a213
100 changed files with 6902 additions and 1888 deletions

View file

@ -1,3 +1,11 @@
16.06.2015
* Application time_zone should be defined at application.yml, updated application-exaple.yml
15.06.2015
* Apache config update: now only TLSv1.2 allowed with whitelisted chipers, please review all SSL config parameters
08.06.2015 08.06.2015
* Add sk service name to application.yml * Add sk service name to application.yml

10
Gemfile
View file

@ -51,7 +51,7 @@ gem 'jbuilder', '~> 2.2.6' # json api
# registry specfic # registry specfic
gem 'simpleidn', '~> 0.0.5' # For punycode gem 'simpleidn', '~> 0.0.5' # For punycode
gem 'isikukood' # for EE-id validation gem 'isikukood' # for EE-id validation
gem 'money-rails', '~> 1.3.0' # Money helpers gem 'money-rails', '~> 1.4.1'
# deploy # deploy
gem 'whenever', '~> 0.9.4', require: false gem 'whenever', '~> 0.9.4', require: false
@ -72,10 +72,14 @@ gem 'deep_cloneable', '~> 2.1.1'
gem 'digidoc_client', '~> 0.2.1' gem 'digidoc_client', '~> 0.2.1'
# epp # epp
gem 'epp', '~> 1.4.2', github: 'gitlabeu/epp' gem 'epp', '~> 1.4.2', github: 'internetee/epp'
gem 'epp-xml', '~> 1.0.2' # EPP XMLs gem 'epp-xml', '~> 1.0.3' # EIS EPP XMLs
gem 'uuidtools', '~> 2.1.4' # For unique IDs (used by the epp gem) gem 'uuidtools', '~> 2.1.4' # For unique IDs (used by the epp gem)
# que
gem 'que', '~> 0.10.0'
gem 'que-web', '~> 0.4.0'
# for importing legacy db # for importing legacy db
gem 'activerecord-import', '~> 0.7.0' # for inserting dummy data gem 'activerecord-import', '~> 0.7.0' # for inserting dummy data

View file

@ -16,14 +16,6 @@ GIT
data_migrate (1.3.0) data_migrate (1.3.0)
rails (>= 4.1.0) rails (>= 4.1.0)
GIT
remote: git://github.com/gitlabeu/epp.git
revision: 505c3f2739eb1da918e54111aecfb138a822739d
specs:
epp (1.4.2)
hpricot
libxml-ruby
GIT GIT
remote: git://github.com/haml/html2haml.git remote: git://github.com/haml/html2haml.git
revision: 6984f50bdbbd6291535027726a5697f28778ee8d revision: 6984f50bdbbd6291535027726a5697f28778ee8d
@ -35,6 +27,14 @@ GIT
nokogiri (~> 1.6.0) nokogiri (~> 1.6.0)
ruby_parser (~> 3.5) ruby_parser (~> 3.5)
GIT
remote: git://github.com/internetee/epp.git
revision: 505c3f2739eb1da918e54111aecfb138a822739d
specs:
epp (1.4.2)
hpricot
libxml-ruby
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
@ -171,7 +171,7 @@ GEM
nokogiri (>= 1.4.0) nokogiri (>= 1.4.0)
savon (>= 2.4.0) savon (>= 2.4.0)
docile (1.1.5) docile (1.1.5)
epp-xml (1.0.2) epp-xml (1.0.3)
activesupport (~> 4.1) activesupport (~> 4.1)
builder (~> 3.2) builder (~> 3.2)
equalizer (0.0.11) equalizer (0.0.11)
@ -284,7 +284,7 @@ GEM
money (~> 6.5.0) money (~> 6.5.0)
money (6.5.1) money (6.5.1)
i18n (>= 0.6.4, <= 0.7.0) i18n (>= 0.6.4, <= 0.7.0)
money-rails (1.3.0) money-rails (1.4.1)
activesupport (>= 3.0) activesupport (>= 3.0)
monetize (~> 1.1.0) monetize (~> 1.1.0)
money (~> 6.5.0) money (~> 6.5.0)
@ -317,11 +317,18 @@ GEM
coderay (~> 1.1.0) coderay (~> 1.1.0)
method_source (~> 0.8.1) method_source (~> 0.8.1)
slop (~> 3.4) slop (~> 3.4)
que (0.10.0)
que-web (0.4.0)
erubis
que (~> 0.8)
sinatra
rack (1.6.1) rack (1.6.1)
rack-accept (0.4.5) rack-accept (0.4.5)
rack (>= 0.4) rack (>= 0.4)
rack-mount (0.8.3) rack-mount (0.8.3)
rack (>= 1.0.0) rack (>= 1.0.0)
rack-protection (1.5.3)
rack
rack-test (0.6.3) rack-test (0.6.3)
rack (>= 1.0) rack (>= 1.0)
railroady (1.3.0) railroady (1.3.0)
@ -444,6 +451,10 @@ GEM
simplecov-html (~> 0.9.0) simplecov-html (~> 0.9.0)
simplecov-html (0.9.0) simplecov-html (0.9.0)
simpleidn (0.0.5) simpleidn (0.0.5)
sinatra (1.4.6)
rack (~> 1.4)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
slim (2.1.0) slim (2.1.0)
temple (~> 0.6.9) temple (~> 0.6.9)
tilt (>= 1.3.3, < 2.1) tilt (>= 1.3.3, < 2.1)
@ -529,7 +540,7 @@ DEPENDENCIES
devise (~> 3.4.1) devise (~> 3.4.1)
digidoc_client (~> 0.2.1) digidoc_client (~> 0.2.1)
epp (~> 1.4.2)! epp (~> 1.4.2)!
epp-xml (~> 1.0.2) epp-xml (~> 1.0.3)
fabrication (~> 2.12.2) fabrication (~> 2.12.2)
faker (~> 1.3.0) faker (~> 1.3.0)
figaro (~> 1.1.0) figaro (~> 1.1.0)
@ -551,7 +562,7 @@ DEPENDENCIES
kaminari (~> 0.16.3) kaminari (~> 0.16.3)
launchy (~> 2.4.3) launchy (~> 2.4.3)
mina (~> 0.3.1) mina (~> 0.3.1)
money-rails (~> 1.3.0) money-rails (~> 1.4.1)
newrelic_rpm (~> 3.9.9.275) newrelic_rpm (~> 3.9.9.275)
nokogiri (~> 1.6.6.2) nokogiri (~> 1.6.6.2)
nprogress-rails (~> 0.1.6.7) nprogress-rails (~> 0.1.6.7)
@ -562,6 +573,8 @@ DEPENDENCIES
phantomjs-binaries (~> 1.9.2.4) phantomjs-binaries (~> 1.9.2.4)
poltergeist (~> 1.5.1) poltergeist (~> 1.5.1)
pry (~> 0.10.1) pry (~> 0.10.1)
que (~> 0.10.0)
que-web (~> 0.4.0)
railroady (~> 1.3.0) railroady (~> 1.3.0)
rails (= 4.2.1) rails (= 4.2.1)
rails-settings-cached (~> 0.4.1) rails-settings-cached (~> 0.4.1)

View file

@ -97,9 +97,10 @@ For Apache, registry admin goes to port 443 in production, /etc/apache2/sites-en
SSLCertificateChainFile /etc/ssl/certs/your-chain-fail.pem SSLCertificateChainFile /etc/ssl/certs/your-chain-fail.pem
SSLCACertificateFile /etc/ssl/certs/ca.pem SSLCACertificateFile /etc/ssl/certs/ca.pem
SSLProtocol TLSv1 SSLProtocol -all +TLSv1.2
SSLHonorCipherOrder On SSLHonorCipherOrder On
SSLCipherSuite RC4-SHA:HIGH:!ADH SSLCompression off
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
RewriteEnginriteEngine on RewriteEnginriteEngine on
RedirectMatch ^/$ /admin RedirectMatch ^/$ /admin
@ -157,9 +158,10 @@ Registrar configuration (/etc/apache2/sites-enabled/registrar.conf) is as follow
SSLCertificateChainFile /etc/ssl/certs/your-chain-fail.pem SSLCertificateChainFile /etc/ssl/certs/your-chain-fail.pem
SSLCACertificateFile /etc/ssl/certs/ca.pem SSLCACertificateFile /etc/ssl/certs/ca.pem
SSLProtocol TLSv1 SSLProtocol -all +TLSv1.2
SSLHonorCipherOrder On SSLHonorCipherOrder On
SSLCipherSuite RC4-SHA:HIGH:!ADH SSLCompression off
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
RewriteEngine on RewriteEngine on
RedirectMatch ^/$ /registrar RedirectMatch ^/$ /registrar
@ -240,9 +242,10 @@ Registrant configuration (/etc/apache2/sites-enabled/registrant.conf) is as foll
SSLCertificateChainFile /etc/ssl/certs/your-chain-fail.pem SSLCertificateChainFile /etc/ssl/certs/your-chain-fail.pem
SSLCACertificateFile /etc/ssl/certs/ca.pem SSLCACertificateFile /etc/ssl/certs/ca.pem
SSLProtocol TLSv1 SSLProtocol -all +TLSv1.2
SSLHonorCipherOrder On SSLHonorCipherOrder On
SSLCipherSuite RC4-SHA:HIGH:!ADH SSLCompression off
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
RewriteEngine on RewriteEngine on
RedirectMatch ^/$ /registrant RedirectMatch ^/$ /registrant

View file

@ -58,4 +58,7 @@ body > .container
.text-grey .text-grey
color: grey color: grey
.partially-hidden
border: 1px solid #dddddd
padding-left: 4px
padding-right: 4px

View file

@ -16,13 +16,13 @@ class Admin::DomainsController < AdminController
end end
def update def update
add_prefix_to_statuses dp = ignore_empty_statuses
if @domain.update(domain_params) if @domain.update(dp)
flash[:notice] = I18n.t('domain_updated') flash[:notice] = I18n.t('domain_updated')
redirect_to [:admin, @domain] redirect_to [:admin, @domain]
else else
@domain.domain_statuses.build if @domain.domain_statuses.empty? build_associations
flash.now[:alert] = I18n.t('failed_to_update_domain') flash.now[:alert] = I18n.t('failed_to_update_domain')
render 'edit' render 'edit'
end end
@ -53,21 +53,23 @@ class Admin::DomainsController < AdminController
end end
def domain_params def domain_params
params.require(:domain).permit( if params[:domain]
domain_statuses_attributes: [:id, :value, :description, :_destroy] params.require(:domain).permit({ statuses: [] })
) else
{ statuses: [] }
end
end end
def build_associations def build_associations
@domain.domain_statuses.build if @domain.domain_statuses.empty? @server_statuses = @domain.statuses.select { |x| DomainStatus::SERVER_STATUSES.include?(x) }
@server_statuses = @domain.domain_statuses.select(&:server_status?) @server_statuses = [nil] if @server_statuses.empty?
@server_statuses << @domain.domain_statuses.build if @server_statuses.empty? @other_statuses = @domain.statuses.select { |x| !DomainStatus::SERVER_STATUSES.include?(x) }
end end
def add_prefix_to_statuses def ignore_empty_statuses
domain_params[:domain_statuses_attributes].each do |_k, hash| dp = domain_params
hash[:value] = hash[:value].prepend('server') if hash[:value].present? dp[:statuses].reject!(&:blank?)
end dp
end end
end end

View file

@ -56,7 +56,7 @@ class Epp::DomainsController < EppController
@domain.attach_legal_document(Epp::Domain.parse_legal_document_from_frame(params[:parsed_frame])) @domain.attach_legal_document(Epp::Domain.parse_legal_document_from_frame(params[:parsed_frame]))
@domain.save(validate: false) @domain.save(validate: false)
if @domain.epp_destroy(params[:parsed_frame]) if @domain.epp_destroy(params[:parsed_frame], current_user.id)
if @domain.epp_pending_delete.present? if @domain.epp_pending_delete.present?
render_epp_response '/epp/domains/success_pending' render_epp_response '/epp/domains/success_pending'
else else

View file

@ -5,6 +5,7 @@ class EppController < ApplicationController
skip_before_action :verify_authenticity_token skip_before_action :verify_authenticity_token
before_action :generate_svtrid before_action :generate_svtrid
before_action :latin_only
before_action :validate_request before_action :validate_request
before_action :update_epp_session before_action :update_epp_session
helper_method :current_user helper_method :current_user
@ -106,6 +107,14 @@ class EppController < ApplicationController
write_to_epp_log write_to_epp_log
end end
# VALIDATION
def latin_only
return true if params['frame'].blank?
return true if params['frame'].match(/\A[\p{Latin}\p{Z}\p{P}\p{S}\p{Cc}\p{Cf}\w_\'\+\-\.\(\)\/]*\Z/i)
render_epp_response '/epp/latin_error'
false
end
# VALIDATION # VALIDATION
def validate_request def validate_request
validation_method = "validate_#{params[:action]}" validation_method = "validate_#{params[:action]}"

View file

@ -20,7 +20,6 @@ class Registrant::DomainUpdateConfirmsController < RegistrantController
@registrant_verification = RegistrantVerification.new(domain_id: @domain.id, @registrant_verification = RegistrantVerification.new(domain_id: @domain.id,
domain_name: @domain.name, domain_name: @domain.name,
verification_token: params[:token]) verification_token: params[:token])
if params[:rejected] if params[:rejected]
if @registrant_verification.domain_registrant_change_reject! if @registrant_verification.domain_registrant_change_reject!
flash[:notice] = t(:registrant_domain_verification_rejected) flash[:notice] = t(:registrant_domain_verification_rejected)

View file

@ -27,9 +27,10 @@ class Registrant::SessionsController < Devise::SessionsController
@user = User.new @user = User.new
end end
def mid def mid # rubocop: disable Metrics/MethodLength
phone = params[:user][:phone] phone = params[:user][:phone]
client = Digidoc::Client.new endpoint = "#{ENV['sk_digi_doc_service_endpoint']}"
client = Digidoc::Client.new(endpoint)
if Rails.env.test? && phone == "123" if Rails.env.test? && phone == "123"
@user = ApiUser.find_by(identity_code: "14212128025") @user = ApiUser.find_by(identity_code: "14212128025")

View file

@ -0,0 +1,16 @@
class DomainConfirmJob < Que::Job
def run(domain_id, action)
# it's recommended to keep transaction against job table as short as possible.
ActiveRecord::Base.transaction do
domain = Epp::Domain.find(domain_id)
case action
when RegistrantVerification::CONFIRMED
domain.apply_pending_update!
domain.clean_pendings!
when RegistrantVerification::REJECTED
domain.clean_pendings!
end
destroy # it's best to destroy the job in the same transaction
end
end
end

View file

@ -2,7 +2,7 @@ class AdminUser < User
validates :username, :country_code, :roles, presence: true validates :username, :country_code, :roles, presence: true
validates :identity_code, uniqueness: true, allow_blank: true validates :identity_code, uniqueness: true, allow_blank: true
validates :identity_code, presence: true, if: -> { country_code == 'EE' } validates :identity_code, presence: true, if: -> { country_code == 'EE' }
validates :email, presence: true validates :email, presence: true
validates :password, :password_confirmation, presence: true, if: :new_record? validates :password, :password_confirmation, presence: true, if: :new_record?
validates :password_confirmation, presence: true, if: :encrypted_password_changed? validates :password_confirmation, presence: true, if: :encrypted_password_changed?
validate :validate_identity_code, if: -> { country_code == 'EE' } validate :validate_identity_code, if: -> { country_code == 'EE' }

View file

@ -75,7 +75,7 @@ class BankTransaction < ActiveRecord::Base
create_account_activity( create_account_activity(
account: registrar.cash_account, account: registrar.cash_account,
invoice: invoice, invoice: invoice,
sum: sum, sum: invoice.sum_without_vat,
currency: currency, currency: currency,
description: description description: description
) )

View file

@ -54,6 +54,11 @@ class Domain < ActiveRecord::Base
delegate :name, to: :registrar, prefix: true delegate :name, to: :registrar, prefix: true
delegate :street, to: :registrar, prefix: true delegate :street, to: :registrar, prefix: true
after_initialize :init_default_values
def init_default_values
self.pending_json = {} if pending_json.blank?
end
before_create :generate_auth_info before_create :generate_auth_info
before_create :set_validity_dates before_create :set_validity_dates
before_update :manage_statuses before_update :manage_statuses
@ -63,13 +68,16 @@ class Domain < ActiveRecord::Base
true true
end end
before_save :manage_automatic_statuses
before_save :touch_always_version before_save :touch_always_version
def touch_always_version def touch_always_version
self.updated_at = Time.zone.now self.updated_at = Time.zone.now
end end
after_save :manage_automatic_statuses
after_save :update_whois_record after_save :update_whois_record
after_initialize -> { self.statuses = [] if statuses.nil? }
validates :name_dirty, domain_name: true, uniqueness: true validates :name_dirty, domain_name: true, uniqueness: true
validates :puny_label, length: { maximum: 63 } validates :puny_label, length: { maximum: 63 }
validates :period, numericality: { only_integer: true } validates :period, numericality: { only_integer: true }
@ -119,6 +127,12 @@ class Domain < ActiveRecord::Base
validate :validate_nameserver_ips validate :validate_nameserver_ips
validate :statuses_uniqueness
def statuses_uniqueness
return if statuses.uniq == statuses
errors.add(:statuses, :taken)
end
attr_accessor :registrant_typeahead, :update_me, :deliver_emails, attr_accessor :registrant_typeahead, :update_me, :deliver_emails,
:epp_pending_update, :epp_pending_delete :epp_pending_update, :epp_pending_delete
@ -154,9 +168,10 @@ class Domain < ActiveRecord::Base
d = Domain.where('valid_to <= ?', Time.zone.now) d = Domain.where('valid_to <= ?', Time.zone.now)
d.each do |x| d.each do |x|
next unless x.expirable? next unless x.expirable?
x.domain_statuses.create(value: DomainStatus::EXPIRED) x.statuses << DomainStatus::EXPIRED
# TODO: This should be managed by automatic_statuses # TODO: This should be managed by automatic_statuses
x.domain_statuses.where(value: DomainStatus::OK).destroy_all x.statuses.delete(DomainStatus::OK)
x.save(validate: false)
end end
STDOUT << "#{Time.zone.now.utc} - Successfully expired #{d.count} domains\n" unless Rails.env.test? STDOUT << "#{Time.zone.now.utc} - Successfully expired #{d.count} domains\n" unless Rails.env.test?
@ -168,9 +183,10 @@ class Domain < ActiveRecord::Base
d = Domain.where('outzone_at <= ?', Time.zone.now) d = Domain.where('outzone_at <= ?', Time.zone.now)
d.each do |x| d.each do |x|
next unless x.server_holdable? next unless x.server_holdable?
x.domain_statuses.create(value: DomainStatus::SERVER_HOLD) x.statuses << DomainStatus::SERVER_HOLD
# TODO: This should be managed by automatic_statuses # TODO: This should be managed by automatic_statuses
x.domain_statuses.where(value: DomainStatus::OK).destroy_all x.statuses.delete(DomainStatus::OK)
x.save
end end
STDOUT << "#{Time.zone.now.utc} - Successfully set server_hold to #{d.count} domains\n" unless Rails.env.test? STDOUT << "#{Time.zone.now.utc} - Successfully set server_hold to #{d.count} domains\n" unless Rails.env.test?
@ -181,9 +197,10 @@ class Domain < ActiveRecord::Base
d = Domain.where('delete_at <= ?', Time.zone.now) d = Domain.where('delete_at <= ?', Time.zone.now)
d.each do |x| d.each do |x|
x.domain_statuses.create(value: DomainStatus::DELETE_CANDIDATE) if x.delete_candidateable? x.statuses << DomainStatus::DELETE_CANDIDATE if x.delete_candidateable?
# TODO: This should be managed by automatic_statuses # TODO: This should be managed by automatic_statuses
x.domain_statuses.where(value: DomainStatus::OK).destroy_all x.statuses.delete(DomainStatus::OK)
x.save
end end
return if Rails.env.test? return if Rails.env.test?
@ -194,8 +211,8 @@ class Domain < ActiveRecord::Base
STDOUT << "#{Time.zone.now.utc} - Destroying domains\n" unless Rails.env.test? STDOUT << "#{Time.zone.now.utc} - Destroying domains\n" unless Rails.env.test?
c = 0 c = 0
DomainStatus.where(value: DomainStatus::DELETE_CANDIDATE).each do |x| Domain.where("statuses @> '{deleteCandidate}'::varchar[]").each do |x|
x.domain.destroy x.destroy
c += 1 c += 1
end end
@ -232,28 +249,22 @@ class Domain < ActiveRecord::Base
domain_transfers.find_by(status: DomainTransfer::PENDING) domain_transfers.find_by(status: DomainTransfer::PENDING)
end end
def can_be_deleted?
(domain_statuses.pluck(:value) & %W(
#{DomainStatus::SERVER_DELETE_PROHIBITED}
)).empty?
end
def expirable? def expirable?
return false if valid_to > Time.zone.now return false if valid_to > Time.zone.now
domain_statuses.where(value: DomainStatus::EXPIRED).empty? !statuses.include?(DomainStatus::EXPIRED)
end end
def server_holdable? def server_holdable?
return false if outzone_at > Time.zone.now return false if outzone_at > Time.zone.now
return false if domain_statuses.where(value: DomainStatus::SERVER_HOLD).any? return false if statuses.include?(DomainStatus::SERVER_HOLD)
return false if domain_statuses.where(value: DomainStatus::SERVER_MANUAL_INZONE).any? return false if statuses.include?(DomainStatus::SERVER_MANUAL_INZONE)
true true
end end
def delete_candidateable? def delete_candidateable?
return false if delete_at > Time.zone.now return false if delete_at > Time.zone.now
return false if domain_statuses.where(value: DomainStatus::DELETE_CANDIDATE).any? return false if statuses.include?(DomainStatus::DELETE_CANDIDATE)
return false if domain_statuses.where(value: DomainStatus::SERVER_DELETE_PROHIBITED).any? return false if statuses.include?(DomainStatus::SERVER_DELETE_PROHIBITED)
true true
end end
@ -264,15 +275,26 @@ class Domain < ActiveRecord::Base
end end
end end
return false if domain_statuses.where(value: DomainStatus::DELETE_CANDIDATE).any? return false if statuses.include?(DomainStatus::DELETE_CANDIDATE)
true true
end end
def preclean_pendings
self.registrant_verification_token = nil
self.registrant_verification_asked_at = nil
end
def clean_pendings!
preclean_pendings
self.pending_json = {}
statuses.delete(DomainStatus::PENDING_UPDATE)
statuses.delete(DomainStatus::PENDING_DELETE)
save
end
def pending_update? def pending_update?
(domain_statuses.pluck(:value) & %W( statuses.include?(DomainStatus::PENDING_UPDATE)
#{DomainStatus::PENDING_UPDATE}
)).present?
end end
def pending_update! def pending_update!
@ -280,9 +302,10 @@ class Domain < ActiveRecord::Base
self.epp_pending_update = true # for epp self.epp_pending_update = true # for epp
return true unless registrant_verification_asked? return true unless registrant_verification_asked?
pending_json_cache = all_changes pending_json_cache = pending_json
token = registrant_verification_token token = registrant_verification_token
asked_at = registrant_verification_asked_at asked_at = registrant_verification_asked_at
changes_cache = changes
DomainMailer.registrant_pending_updated(self).deliver_now DomainMailer.registrant_pending_updated(self).deliver_now
@ -291,10 +314,13 @@ class Domain < ActiveRecord::Base
self.pending_json = pending_json_cache self.pending_json = pending_json_cache
self.registrant_verification_token = token self.registrant_verification_token = token
self.registrant_verification_asked_at = asked_at self.registrant_verification_asked_at = asked_at
domain_statuses.create(value: DomainStatus::PENDING_UPDATE) self.statuses = [DomainStatus::PENDING_UPDATE]
pending_json[:domain] = changes_cache
end end
# rubocop: disable Metrics/CyclomaticComplexity
def registrant_update_confirmable?(token) def registrant_update_confirmable?(token)
return true if Rails.env.development?
return false unless pending_update? return false unless pending_update?
return false if registrant_verification_token.blank? return false if registrant_verification_token.blank?
return false if registrant_verification_asked_at.blank? return false if registrant_verification_asked_at.blank?
@ -304,6 +330,7 @@ class Domain < ActiveRecord::Base
end end
def registrant_delete_confirmable?(token) def registrant_delete_confirmable?(token)
return true if Rails.env.development?
return false unless pending_delete? return false unless pending_delete?
return false if registrant_verification_token.blank? return false if registrant_verification_token.blank?
return false if registrant_verification_asked_at.blank? return false if registrant_verification_asked_at.blank?
@ -311,24 +338,25 @@ class Domain < ActiveRecord::Base
return false if registrant_verification_token != token return false if registrant_verification_token != token
true true
end end
# rubocop: enable Metrics/CyclomaticComplexity
def force_deletable? def force_deletable?
domain_statuses.where(value: DomainStatus::FORCE_DELETE).empty? !statuses.include?(DomainStatus::FORCE_DELETE)
end end
def registrant_verification_asked? def registrant_verification_asked?
registrant_verification_asked_at.present? && registrant_verification_token.present? registrant_verification_asked_at.present? && registrant_verification_token.present?
end end
def registrant_verification_asked! def registrant_verification_asked!(frame_str, current_user_id)
pending_json['frame'] = frame_str
pending_json['current_user_id'] = current_user_id
self.registrant_verification_asked_at = Time.zone.now self.registrant_verification_asked_at = Time.zone.now
self.registrant_verification_token = SecureRandom.hex(42) self.registrant_verification_token = SecureRandom.hex(42)
end end
def pending_delete? def pending_delete?
(domain_statuses.pluck(:value) & %W( statuses.include?(DomainStatus::PENDING_DELETE)
#{DomainStatus::PENDING_DELETE}
)).present?
end end
def pending_delete! def pending_delete!
@ -336,7 +364,9 @@ class Domain < ActiveRecord::Base
self.epp_pending_delete = true # for epp self.epp_pending_delete = true # for epp
return true unless registrant_verification_asked? return true unless registrant_verification_asked?
domain_statuses.create(value: DomainStatus::PENDING_DELETE) self.statuses = [DomainStatus::PENDING_DELETE]
save(validate: false) # should check if this did succeed
DomainMailer.pending_deleted(self).deliver_now DomainMailer.pending_deleted(self).deliver_now
end end
@ -393,12 +423,10 @@ class Domain < ActiveRecord::Base
name name
end end
def pending_registrant_name def pending_registrant
return '' if pending_json.blank? return '' if pending_json.blank?
return '' if pending_json['domain'].blank?
return '' if pending_json['domain']['registrant_id'].blank? return '' if pending_json['domain']['registrant_id'].blank?
registrant = Registrant.find_by(id: pending_json['domain']['registrant_id'].last) Registrant.find_by(id: pending_json['domain']['registrant_id'].last)
registrant.try(:name)
end end
# rubocop:disable Lint/Loop # rubocop:disable Lint/Loop
@ -418,41 +446,38 @@ class Domain < ActiveRecord::Base
end end
def set_force_delete def set_force_delete
domain_statuses.where(value: DomainStatus::FORCE_DELETE).first_or_create statuses << DomainStatus::FORCE_DELETE
domain_statuses.where(value: DomainStatus::SERVER_RENEW_PROHIBITED).first_or_create statuses << DomainStatus::SERVER_RENEW_PROHIBITED
domain_statuses.where(value: DomainStatus::SERVER_TRANSFER_PROHIBITED).first_or_create statuses << DomainStatus::SERVER_TRANSFER_PROHIBITED
domain_statuses.where(value: DomainStatus::SERVER_UPDATE_PROHIBITED).first_or_create statuses << DomainStatus::SERVER_UPDATE_PROHIBITED
domain_statuses.where(value: DomainStatus::SERVER_MANUAL_INZONE).first_or_create statuses << DomainStatus::SERVER_MANUAL_INZONE
domain_statuses.where(value: DomainStatus::PENDING_DELETE).first_or_create statuses << DomainStatus::PENDING_DELETE
domain_statuses.where(value: DomainStatus::CLIENT_DELETE_PROHIBITED).destroy_all statuses.delete(DomainStatus::CLIENT_DELETE_PROHIBITED)
domain_statuses.where(value: DomainStatus::SERVER_DELETE_PROHIBITED).destroy_all statuses.delete(DomainStatus::SERVER_DELETE_PROHIBITED)
domain_statuses.reload
self.force_delete_at = Time.zone.now + Setting.redemption_grace_period.days unless force_delete_at self.force_delete_at = Time.zone.now + Setting.redemption_grace_period.days unless force_delete_at
save(validate: false) save(validate: false)
end end
def unset_force_delete def unset_force_delete
domain_statuses.where(value: DomainStatus::FORCE_DELETE).destroy_all statuses.delete(DomainStatus::FORCE_DELETE)
domain_statuses.where(value: DomainStatus::SERVER_RENEW_PROHIBITED).destroy_all statuses.delete(DomainStatus::SERVER_RENEW_PROHIBITED)
domain_statuses.where(value: DomainStatus::SERVER_TRANSFER_PROHIBITED).destroy_all statuses.delete(DomainStatus::SERVER_TRANSFER_PROHIBITED)
domain_statuses.where(value: DomainStatus::SERVER_UPDATE_PROHIBITED).destroy_all statuses.delete(DomainStatus::SERVER_UPDATE_PROHIBITED)
domain_statuses.where(value: DomainStatus::SERVER_MANUAL_INZONE).destroy_all statuses.delete(DomainStatus::SERVER_MANUAL_INZONE)
domain_statuses.where(value: DomainStatus::PENDING_DELETE).destroy_all statuses.delete(DomainStatus::PENDING_DELETE)
domain_statuses.reload
self.force_delete_at = nil self.force_delete_at = nil
save(validate: false) save(validate: false)
end end
def manage_automatic_statuses def manage_automatic_statuses
# domain_statuses.create(value: DomainStatus::DELETE_CANDIDATE) if delete_candidateable? # domain_statuses.create(value: DomainStatus::DELETE_CANDIDATE) if delete_candidateable?
if domain_statuses.empty? && valid? if statuses.empty? && valid?
domain_statuses.create(value: DomainStatus::OK) statuses << DomainStatus::OK
elsif domain_statuses.length > 1 || !valid? elsif statuses.length > 1 || !valid?
domain_statuses.find_by(value: DomainStatus::OK).try(:destroy) statuses.delete(DomainStatus::OK)
end end
# otherwise domain_statuses are in old state for domain object
domain_statuses.reload
end end
def children_log def children_log
@ -465,17 +490,6 @@ class Domain < ActiveRecord::Base
log log
end end
def all_changes
all_changes = HashWithIndifferentAccess.new
all_changes[:domain] = changes
all_changes[:admin_contacts] = admin_contacts.map(&:changes)
all_changes[:tech_contacts] = tech_contacts.map(&:changes)
all_changes[:nameservers] = nameservers.map(&:changes)
all_changes[:registrant] = registrant.try(:changes)
all_changes[:domain_statuses] = domain_statuses.map(&:changes)
all_changes
end
def update_whois_record def update_whois_record
whois_record.blank? ? create_whois_record : whois_record.save whois_record.blank? ? create_whois_record : whois_record.save
end end

View file

@ -124,7 +124,7 @@ class DomainStatus < ActiveRecord::Base
end end
def statuses_for_admin def statuses_for_admin
SERVER_STATUSES.map { |x| x.sub('server', '') } SERVER_STATUSES.map { |x| [x.sub('server', ''), x] }
end end
end end
end end

View file

@ -110,10 +110,12 @@ class Epp::Domain < Domain
at[:period_unit] = Epp::Domain.parse_period_unit_from_frame(frame) || 'y' at[:period_unit] = Epp::Domain.parse_period_unit_from_frame(frame) || 'y'
# at[:statuses] = domain_statuses_attrs(frame, action)
# binding.pry
at[:nameservers_attributes] = nameservers_attrs(frame, action) at[:nameservers_attributes] = nameservers_attrs(frame, action)
at[:admin_domain_contacts_attributes] = admin_domain_contacts_attrs(frame, action) at[:admin_domain_contacts_attributes] = admin_domain_contacts_attrs(frame, action)
at[:tech_domain_contacts_attributes] = tech_domain_contacts_attrs(frame, action) at[:tech_domain_contacts_attributes] = tech_domain_contacts_attrs(frame, action)
at[:domain_statuses_attributes] = domain_statuses_attrs(frame, action) # at[:domain_statuses_attributes] = domain_statuses_attrs(frame, action)
if new_record? if new_record?
dnskey_frame = frame.css('extension create') dnskey_frame = frame.css('extension create')
@ -235,24 +237,6 @@ class Epp::Domain < Domain
attrs attrs
end end
def domain_status_list_from(frame)
status_list = []
frame.css('status').each do |x|
unless DomainStatus::CLIENT_STATUSES.include?(x['s'])
add_epp_error('2303', 'status', x['s'], [:domain_statuses, :not_found])
next
end
status_list << {
value: x['s'],
description: x.text
}
end
status_list
end
# rubocop: disable Metrics/PerceivedComplexity # rubocop: disable Metrics/PerceivedComplexity
# rubocop: disable Metrics/CyclomaticComplexity # rubocop: disable Metrics/CyclomaticComplexity
def dnskeys_attrs(frame, action) def dnskeys_attrs(frame, action)
@ -336,14 +320,10 @@ class Epp::Domain < Domain
if action == 'rem' if action == 'rem'
to_destroy = [] to_destroy = []
status_list.each do |x| status_list.each do |x|
status = domain_statuses.find_by(value: x[:value]) if statuses.include?(x)
if status.blank? to_destroy << x
add_epp_error('2303', 'status', x[:value], [:domain_statuses, :not_found])
else else
to_destroy << { add_epp_error('2303', 'status', x, [:domain_statuses, :not_found])
id: status.id,
_destroy: 1
}
end end
end end
@ -362,10 +342,7 @@ class Epp::Domain < Domain
next next
end end
status_list << { status_list << x['s']
value: x['s'],
description: x.text
}
end end
status_list status_list
@ -381,7 +358,7 @@ class Epp::Domain < Domain
}] }]
end end
def update(frame, current_user) def update(frame, current_user, verify = true)
return super if frame.blank? return super if frame.blank?
at = {}.with_indifferent_access at = {}.with_indifferent_access
at.deep_merge!(attrs_from(frame.css('chg'), current_user)) at.deep_merge!(attrs_from(frame.css('chg'), current_user))
@ -392,16 +369,27 @@ class Epp::Domain < Domain
at[:admin_domain_contacts_attributes] += at_add[:admin_domain_contacts_attributes] at[:admin_domain_contacts_attributes] += at_add[:admin_domain_contacts_attributes]
at[:tech_domain_contacts_attributes] += at_add[:tech_domain_contacts_attributes] at[:tech_domain_contacts_attributes] += at_add[:tech_domain_contacts_attributes]
at[:dnskeys_attributes] += at_add[:dnskeys_attributes] at[:dnskeys_attributes] += at_add[:dnskeys_attributes]
at[:domain_statuses_attributes] += at_add[:domain_statuses_attributes] at[:statuses] =
statuses - domain_statuses_attrs(frame.css('rem'), 'rem') + domain_statuses_attrs(frame.css('add'), 'add')
if frame.css('registrant').present? && frame.css('registrant').attr('verified').to_s.downcase != 'yes' # at[:statuses] += at_add[:domain_statuses_attributes]
registrant_verification_asked!
if verify && frame.css('registrant').present? && frame.css('registrant').attr('verified').to_s.downcase != 'yes'
registrant_verification_asked!(frame.to_s, current_user.id)
end end
self.deliver_emails = true # turn on email delivery for epp self.deliver_emails = true # turn on email delivery for epp
errors.empty? && super(at) errors.empty? && super(at)
end end
def apply_pending_update!
preclean_pendings
user = ApiUser.find(pending_json['current_user_id'])
frame = Nokogiri::XML(pending_json['frame'])
statuses.delete(DomainStatus::PENDING_UPDATE)
clean_pendings! if update(frame, user, false)
end
def attach_legal_document(legal_document_data) def attach_legal_document(legal_document_data)
return unless legal_document_data return unless legal_document_data
@ -411,11 +399,11 @@ class Epp::Domain < Domain
) )
end end
def epp_destroy(frame) def epp_destroy(frame, user_id)
return false unless valid? return false unless valid?
if frame.css('delete').attr('verified').to_s.downcase != 'yes' if frame.css('delete').attr('verified').to_s.downcase != 'yes'
registrant_verification_asked! registrant_verification_asked!(frame.to_s, user_id)
pending_delete! pending_delete!
manage_automatic_statuses manage_automatic_statuses
true # aka 1001 pending_delete true # aka 1001 pending_delete
@ -439,8 +427,8 @@ class Epp::Domain < Domain
self.period = period self.period = period
self.period_unit = unit self.period_unit = unit
domain_statuses.where(value: DomainStatus::SERVER_HOLD).destroy_all statuses.delete(DomainStatus::SERVER_HOLD)
domain_statuses.where(value: DomainStatus::EXPIRED).destroy_all statuses.delete(DomainStatus::EXPIRED)
save save
end end
@ -682,9 +670,7 @@ class Epp::Domain < Domain
begin begin
errors.add(:base, :domain_status_prohibits_operation) errors.add(:base, :domain_status_prohibits_operation)
return false return false
end if (domain_statuses.pluck(:value) & %W( end if statuses.include?(DomainStatus::CLIENT_DELETE_PROHIBITED)
#{DomainStatus::CLIENT_DELETE_PROHIBITED}
)).any?
true true
end end

View file

@ -17,12 +17,12 @@ class RegistrantVerification < ActiveRecord::Base
def domain_registrant_change_confirm! def domain_registrant_change_confirm!
self.action_type = DOMAIN_REGISTRANT_CHANGE self.action_type = DOMAIN_REGISTRANT_CHANGE
self.action = CONFIRMED self.action = CONFIRMED
save DomainConfirmJob.enqueue domain.id, CONFIRMED if save
end end
def domain_registrant_change_reject! def domain_registrant_change_reject!
self.action_type = DOMAIN_REGISTRANT_CHANGE self.action_type = DOMAIN_REGISTRANT_CHANGE
self.action = REJECTED self.action = REJECTED
save DomainConfirmJob.enqueue domain.id, REJECTED if save
end end
end end

View file

@ -20,11 +20,11 @@ class WhoisRecord < ActiveRecord::Base
includes( includes(
domain: [ domain: [
:registrant, :registrant,
:registrar, :registrar,
:nameservers, :nameservers,
{ tech_contacts: :registrar }, { tech_contacts: :registrar },
{ admin_contacts: :registrar } { admin_contacts: :registrar }
] ]
) )
end end
end end
@ -34,19 +34,23 @@ class WhoisRecord < ActiveRecord::Base
h = HashWithIndifferentAccess.new h = HashWithIndifferentAccess.new
return h if domain.blank? return h if domain.blank?
status_map = {
'ok' => 'ok (paid and in zone)'
}
@disclosed = [] @disclosed = []
h[:name] = domain.name h[:name] = domain.name
h[:registrant] = domain.registrant.name h[:registrant] = domain.registrant.name
h[:status] = domain.domain_statuses.map(&:human_value).join(', ') h[:status] = domain.statuses.map { |x| status_map[x] || x }.join(', ')
h[:registered] = domain.registered_at.try(:to_s, :iso8601) h[:registered] = domain.registered_at.try(:to_s, :iso8601)
h[:updated_at] = domain.updated_at.try(:to_s, :iso8601) h[:updated_at] = domain.updated_at.try(:to_s, :iso8601)
h[:valid_to] = domain.valid_to.try(:to_s, :iso8601) h[:valid_to] = domain.valid_to.try(:to_s, :iso8601)
# update registar triggers when adding new attributes # update registar triggers when adding new attributes
h[:registrar] = domain.registrar.name h[:registrar] = domain.registrar.name
h[:registrar_phone] = domain.registrar.phone h[:registrar_phone] = domain.registrar.phone
h[:registrar_address] = domain.registrar.address h[:registrar_address] = domain.registrar.address
h[:registrar_update_at] = domain.registrar.updated_at.try(:to_s, :iso8601) h[:registrar_update_at] = domain.registrar.updated_at.try(:to_s, :iso8601)
h[:admin_contacts] = [] h[:admin_contacts] = []
domain.admin_contacts.each do |ac| domain.admin_contacts.each do |ac|

View file

@ -7,7 +7,8 @@
%dd= @contact.code %dd= @contact.code
%dt= t(:password) %dt= t(:password)
%dd= @contact.auth_info %dd
= text_field_tag :auth_info, @contact.auth_info, readonly: true, class: 'partially-hidden'
%br %br

View file

@ -1,26 +1,29 @@
#domain-statuses #domain-statuses
= f.fields_for :domain_statuses, @server_statuses do |status_fields| - @server_statuses.each do |x|
.panel.panel-default .panel.panel-default
.panel-heading.clearfix .panel-heading.clearfix
.pull-left= t(:status) .pull-left= t(:status)
.pull-right .pull-right
= link_to(t(:add_another), '#', class: 'btn btn-primary btn-xs add-domain-status') = link_to(t(:add_another), '#', class: 'btn btn-primary btn-xs add-domain-status')
= link_to(t(:delete), '#', class: 'btn btn-danger btn-xs destroy') = link_to(t(:delete), '#', class: 'btn btn-danger btn-xs destroy-status')
.panel-body .panel-body
.errors
= render 'shared/errors', object: status_fields.object
- if status_fields.object.errors.any?
%hr
.form-group .form-group
= status_fields.label :value, class: 'col-md-2 control-label' = f.label 'status', class: 'col-md-2 control-label'
.col-md-10 .col-md-10
= status_fields.select :value, options_for_select(DomainStatus.statuses_for_admin, status_fields.object.value.try(:sub, 'server', '')), {include_blank: true}, {class: 'form-control'} = select_tag 'domain[statuses][]', options_for_select(DomainStatus.statuses_for_admin, x), include_blank: true, class: 'form-control'
.form-group .form-group
= status_fields.label :description, class: 'col-md-2 control-label' = label_tag t(:description), nil, class: 'col-md-2 control-label'
.col-md-10 .col-md-10
= status_fields.text_field :description, class: 'form-control', autocomplete: 'off' = text_field_tag :description, nil, class: 'form-control', autocomplete: 'off'
- @other_statuses.each do |x|
= hidden_field_tag 'domain[statuses][]', x, readonly: true
:coffee :coffee
$("#domain-statuses").nestedAttributes $("#domain-statuses").nestedAttributes
bindAddTo: $(".add-domain-status") bindAddTo: $(".add-domain-status")
afterAdd: (item) ->
item.find(".errors").html "" $('.destroy-status').on 'click', (e) ->
e.preventDefault()
if $('.panel').length > 1
$(this).parents('.panel').remove()
else
$(this).parents('.panel').find('select').val('')

View file

@ -13,7 +13,8 @@
%dd= link_to(@domain.registrar, root_path) %dd= link_to(@domain.registrar, root_path)
%dt= t(:password) %dt= t(:password)
%dd= @domain.auth_info %dd
= text_field_tag :password, @domain.auth_info, readonly: true, class: 'partially-hidden'
%dt= t(:valid_from) %dt= t(:valid_from)
%dd= l(@domain.valid_from) %dd= l(@domain.valid_from)

View file

@ -1,5 +1,4 @@
- panel_class = @domain.errors.messages[:domain_statuses] ? 'panel-danger' : 'panel-default' #domain_statuses.panel.panel-default
#domain_statuses.panel{class: panel_class}
.panel-heading.clearfix .panel-heading.clearfix
= t(:statuses) = t(:statuses)
.table-responsive .table-responsive
@ -9,12 +8,7 @@
%th{class: 'col-xs-6'}= t(:status) %th{class: 'col-xs-6'}= t(:status)
%th{class: 'col-xs-6'}= t(:description) %th{class: 'col-xs-6'}= t(:description)
%tbody %tbody
- @domain.domain_statuses.each do |x| - @domain.statuses.each do |x|
%tr %tr
%td= x.value %td= x
%td= x.description %td
- if @domain.errors.messages[:domain_statuses]
%tfoot
- @domain.errors.messages[:domain_statuses].each do |x|
%tr
%td{colspan: 4}= x

View file

@ -0,0 +1,9 @@
- value = Setting.send(var)
%tr
%td= t(var)
- if [TrueClass, FalseClass].include?(value.class)
%td
= hidden_field_tag("[settings][#{var}]", '')
= check_box_tag("[settings][#{var}]", true, value)
- else
%td= text_field_tag("[settings][#{var}]", value)

View file

@ -1,27 +1,72 @@
= render 'shared/title', name: t(:settings) = render 'shared/title', name: t(:settings)
= form_tag [:admin, :settings] do = form_tag [:admin, :settings] do
.panel.panel-default
.panel-heading.clearfix
= t(:domain_validation_rules)
.table-responsive
%table.table.table-hover.table-bordered.table-condensed
%thead
%tr
%th{class: 'col-xs-6'}= t(:setting)
%th{class: 'col-xs-6'}= t(:value)
%tbody
= render 'setting_row', var: :admin_contacts_min_count
= render 'setting_row', var: :admin_contacts_max_count
= render 'setting_row', var: :tech_contacts_min_count
= render 'setting_row', var: :tech_contacts_max_count
= render 'setting_row', var: :ds_data_allowed
= render 'setting_row', var: :key_data_allowed
= render 'setting_row', var: :dnskeys_min_count
= render 'setting_row', var: :dnskeys_max_count
= render 'setting_row', var: :ns_min_count
= render 'setting_row', var: :ns_max_count
.panel.panel-default
.panel-heading.clearfix
= t(:domain_expiring)
.table-responsive
%table.table.table-hover.table-bordered.table-condensed
%thead
%tr
%th{class: 'col-xs-6'}= t(:setting)
%th{class: 'col-xs-6'}= t(:value)
%tbody
= render 'setting_row', var: :days_to_renew_domain_before_expire
= render 'setting_row', var: :expire_warning_period
= render 'setting_row', var: :redemption_grace_period
.panel.panel-default
.panel-heading.clearfix
= t(:billing)
.table-responsive
%table.table.table-hover.table-bordered.table-condensed
%thead
%tr
%th{class: 'col-xs-6'}= t(:setting)
%th{class: 'col-xs-6'}= t(:value)
%tbody
= render 'setting_row', var: :eis_iban
= render 'setting_row', var: :eis_bank
= render 'setting_row', var: :eis_swift
= render 'setting_row', var: :eis_invoice_contact
= render 'setting_row', var: :invoice_number_min
= render 'setting_row', var: :invoice_number_max
= render 'setting_row', var: :days_to_keep_overdue_invoices_active
.panel.panel-default
.panel-heading.clearfix
= t(:other)
.table-responsive
%table.table.table-hover.table-bordered.table-condensed
%thead
%tr
%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: :client_side_status_editing_enabled
.row .row
.col-md-8 .col-md-12.text-right
.table-responsive
%table.table.table-hover.table-bordered.table-condensed
%thead
%tr
%th{class: 'col-xs-4'}
= t(:setting)
%th{class: 'col-xs-2'}
= t(:value)
%tbody
- @settings.each do |x|
%tr
%td= t("#{x.var}")
- if [TrueClass, FalseClass].include?(x.value.class)
%td
= hidden_field_tag("[settings][#{x.var}]", '')
= check_box_tag("[settings][#{x.var}]", true, x.value)
- else
%td= text_field_tag("[settings][#{x.var}]", x.value)
%hr
.row
.col-md-8.text-right
%button.btn.btn-primary=t(:save) %button.btn.btn-primary=t(:save)

View file

@ -9,8 +9,6 @@ Isikukood: <%= @domain.registrant_ident %><br>
<% else %> <% else %>
Äriregistrikood: <%= @domain.registrant_ident %><br> Äriregistrikood: <%= @domain.registrant_ident %><br>
<% end %> <% end %>
Epost: <%= @domain.registrant_email %><br>
Tel: <%= @domain.registrant_phone %><br>
Tänav: <%= @domain.registrant_street %><br> Tänav: <%= @domain.registrant_street %><br>
Linn: <%= @domain.registrant_city %><br> Linn: <%= @domain.registrant_city %><br>
Riik: <%= @domain.registrant_country %> Riik: <%= @domain.registrant_country %>
@ -34,8 +32,6 @@ Personal code: <%= @domain.registrant_ident %><br>
<% else %> <% else %>
Business Registry code: <%= @domain.registrant_ident %><br> Business Registry code: <%= @domain.registrant_ident %><br>
<% end %> <% end %>
E-mail: <%= @domain.registrant_email %><br>
Tel: <%= @domain.registrant_phone %><br>
Street: <%= @domain.registrant_street %><br> Street: <%= @domain.registrant_street %><br>
City: <%= @domain.registrant_city %><br> City: <%= @domain.registrant_city %><br>
Country: <%= @domain.registrant_country %> Country: <%= @domain.registrant_country %>

View file

@ -9,8 +9,6 @@ Isikukood: <%= @domain.registrant_ident %>
<% else %> <% else %>
Äriregistrikood: <%= @domain.registrant_ident %> Äriregistrikood: <%= @domain.registrant_ident %>
<% end %> <% end %>
Epost: <%= @domain.registrant_email %>
Tel: <%= @domain.registrant_phone %>
Tänav: <%= @domain.registrant_street %> Tänav: <%= @domain.registrant_street %>
Linn: <%= @domain.registrant_city %> Linn: <%= @domain.registrant_city %>
Riik: <%= @domain.registrant_country %> Riik: <%= @domain.registrant_country %>
@ -34,8 +32,6 @@ Personal code: <%= @domain.registrant_ident %>
<% else %> <% else %>
Business Registry code: <%= @domain.registrant_ident %> Business Registry code: <%= @domain.registrant_ident %>
<% end %> <% end %>
E-mail: <%= @domain.registrant_email %>
Tel: <%= @domain.registrant_phone %>
Street: <%= @domain.registrant_street %> Street: <%= @domain.registrant_street %>
City: <%= @domain.registrant_city %> City: <%= @domain.registrant_city %>
Country: <%= @domain.registrant_country %> Country: <%= @domain.registrant_country %>

View file

@ -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:chkData', 'xmlns:contact' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd') do
@results.each do |result| @results.each do |result|
xml.tag!('contact:cd') do xml.tag!('contact:cd') do
xml.tag! "contact:id", result[:code], avail: result[:avail] xml.tag! "contact:id", result[:code], avail: result[:avail]

View file

@ -5,7 +5,7 @@ xml.epp_head do
end end
xml.resData do xml.resData do
xml.tag!('contact:creData', 'xmlns:contact' => 'urn:ietf:params:xml:ns:contact-1.0') do xml.tag!('contact:creData', 'xmlns:contact' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd') do
xml.tag!('contact:id', @contact.code) xml.tag!('contact:id', @contact.code)
xml.tag!('contact:crDate', @contact.created_at.try(:iso8601)) xml.tag!('contact:crDate', @contact.created_at.try(:iso8601))
end end

View file

@ -5,7 +5,7 @@ xml.epp_head do
end end
xml.resData do xml.resData do
xml.tag!('contact:infData', 'xmlns:contact' => 'urn:ietf:params:xml:ns:contact-1.0') do xml.tag!('contact:infData', 'xmlns:contact' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd') do
xml.tag!('contact:id', @contact.code) xml.tag!('contact:id', @contact.code)
xml.tag!('contact:roid', @contact.roid) xml.tag!('contact:roid', @contact.roid)

View file

@ -5,7 +5,7 @@ xml.epp_head do
end end
xml.resData do xml.resData do
xml.tag!('contact:creData', 'xmlns:contact' => 'urn:ietf:params:xml:ns:contact-1.0') do xml.tag!('contact:creData', 'xmlns:contact' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd') do
xml.tag!('contact:id', @contact.code) xml.tag!('contact:id', @contact.code)
xml.tag!('contact:crDate', @contact.created_at.try(:iso8601)) xml.tag!('contact:crDate', @contact.created_at.try(:iso8601))
end end

View file

@ -5,7 +5,7 @@ xml.epp_head do
end end
xml.resData do xml.resData do
xml.tag!('domain:chkData', 'xmlns:domain' => 'urn:ietf:params:xml:ns:domain-1.0') do xml.tag!('domain:chkData', 'xmlns:domain' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd') do
@domains.each do |x| @domains.each do |x|
xml.tag!('domain:cd') do xml.tag!('domain:cd') do
xml.tag!('domain:name', x[:name], 'avail' => x[:avail]) xml.tag!('domain:name', x[:name], 'avail' => x[:avail])

View file

@ -5,7 +5,7 @@ xml.epp_head do
end end
xml.resData do xml.resData do
xml.tag!('domain:creData', 'xmlns:domain' => 'urn:ietf:params:xml:ns:domain-1.0') do xml.tag!('domain:creData', 'xmlns:domain' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd') do
xml.tag!('domain:name', @domain.name) xml.tag!('domain:name', @domain.name)
xml.tag!('domain:crDate', @domain.created_at.try(:iso8601)) xml.tag!('domain:crDate', @domain.created_at.try(:iso8601))
xml.tag!('domain:exDate', @domain.valid_to.try(:iso8601)) xml.tag!('domain:exDate', @domain.valid_to.try(:iso8601))

View file

@ -5,12 +5,11 @@ xml.epp_head do
end end
xml.resData do xml.resData do
xml.tag!('domain:infData', 'xmlns:domain' => 'urn:ietf:params:xml:ns:domain-1.0') do xml.tag!('domain:infData', 'xmlns:domain' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd') do
xml.tag!('domain:name', @domain.name) xml.tag!('domain:name', @domain.name)
xml.tag!('domain:roid', @domain.roid) xml.tag!('domain:roid', @domain.roid)
@domain.domain_statuses.each do |ds| @domain.statuses.each do |s|
xml.tag!('domain:status', ds.description, 's' => ds.value) unless ds.description.blank? xml.tag!('domain:status', 's' => s)
xml.tag!('domain:status', 's' => ds.value) if ds.description.blank?
end end
xml.tag!('domain:registrant', @domain.registrant_code) xml.tag!('domain:registrant', @domain.registrant_code)

View file

@ -1,4 +1,4 @@
builder.tag!('domain:trnData', 'xmlns:domain' => 'urn:ietf:params:xml:ns:domain-1.0') do builder.tag!('domain:trnData', 'xmlns:domain' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd') do
builder.tag!('domain:name', dt.domain_name) builder.tag!('domain:name', dt.domain_name)
builder.tag!('domain:trStatus', dt.status) builder.tag!('domain:trStatus', dt.status)
builder.tag!('domain:reID', dt.transfer_to.code) builder.tag!('domain:reID', dt.transfer_to.code)

View file

@ -5,7 +5,7 @@ xml.epp_head do
end end
xml.resData do xml.resData do
xml.tag!('domain:renData', 'xmlns:domain' => 'urn:ietf:params:xml:ns:domain-1.0') do xml.tag!('domain:renData', 'xmlns:domain' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd') do
xml.tag!('domain:name', @domain[:name]) xml.tag!('domain:name', @domain[:name])
xml.tag!('domain:exDate', @domain.valid_to.try(:iso8601)) xml.tag!('domain:exDate', @domain.valid_to.try(:iso8601))
end end

View file

@ -0,0 +1,8 @@
xml.epp_head do
xml.response do
xml.result('code' => '2306') do
xml.msg('Parameter value policy error. Allowed only Latin characters.', 'lang' => 'en')
end
render('epp/shared/trID', builder: xml)
end
end

View file

@ -2,7 +2,7 @@ xml.instruct!(:xml, standalone: 'no')
xml.epp( xml.epp(
'xmlns' => 'urn:ietf:params:xml:ns:epp-1.0', 'xmlns' => 'urn:ietf:params:xml:ns:epp-1.0',
'xmlns:secDNS' => 'urn:ietf:params:xml:ns:secDNS-1.1', 'xmlns:secDNS' => 'urn:ietf:params:xml:ns:secDNS-1.1',
'xmlns:domain' => 'urn:ietf:params:xml:ns:domain-1.0', 'xmlns:domain' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd',
'xmlns:keyrelay' => 'urn:ietf:params:xml:ns:keyrelay-1.0' 'xmlns:keyrelay' => 'urn:ietf:params:xml:ns:keyrelay-1.0'
) do ) do
xml.response do xml.response do

View file

@ -5,8 +5,8 @@ xml.epp_head do
xml.svcMenu do xml.svcMenu do
xml.version '1.0' xml.version '1.0'
xml.lang 'en' xml.lang 'en'
xml.objURI 'urn:ietf:params:xml:ns:domain-1.0' xml.objURI 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd'
xml.objURI 'urn:ietf:params:xml:ns:contact-1.0' xml.objURI 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd'
xml.objURI 'urn:ietf:params:xml:ns:host-1.0' xml.objURI 'urn:ietf:params:xml:ns:host-1.0'
xml.objURI 'urn:ietf:params:xml:ns:keyrelay-1.0' xml.objURI 'urn:ietf:params:xml:ns:keyrelay-1.0'
xml.svcExtension do xml.svcExtension do

View file

@ -65,7 +65,7 @@
-# %li= link_to t(:domains_history), admin_domain_versions_path -# %li= link_to t(:domains_history), admin_domain_versions_path
%li= link_to t(:epp_logs), admin_epp_logs_path %li= link_to t(:epp_logs), admin_epp_logs_path
%li= link_to t(:repp_logs), admin_repp_logs_path %li= link_to t(:repp_logs), admin_repp_logs_path
-# %li= link_to t(:background_jobs), admin_delayed_jobs_path %li= link_to t(:que), '/admin/que'
- if signed_in? - if signed_in?
%ul.nav.navbar-nav.navbar-right %ul.nav.navbar-nav.navbar-right

View file

@ -25,13 +25,13 @@
.row .row
.col-md-12.text-center.confirmation .col-md-12.text-center.confirmation
.column-keys .column-keys
%p= t(:domain_name) + ':' %p= t(:domain_name) + ':'
%p= t(:current_registrant) + ':' %p= t(:current_registrant) + ':'
%p= t(:new_pending_registrant) + ':' %p= t(:new_pending_registrant) + ':'
.column-values .column-values
%p= @domain.name %p= @domain.name
%p= @domain.registrant_name %p= "#{@domain.registrant_name} (#{@domain.registrant.ident})"
%p= @domain.pending_registrant_name %p= "#{@domain.pending_registrant.try(:name)} (#{@domain.pending_registrant.try(:ident)})"
.row .row
.col-md-12.text-center .col-md-12.text-center

View file

@ -7,7 +7,9 @@
%dd= @contact.id %dd= @contact.id
%dt= t(:password) %dt= t(:password)
%dd= @contact.password %dd
= text_field_tag :password, @contact.password, readonly: true, class: 'partially-hidden'
%br %br

View file

@ -3,7 +3,7 @@
<command> <command>
<check> <check>
<contact:check <contact:check
xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"> xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
<contact:id>sh8013</contact:id> <contact:id>sh8013</contact:id>
</contact:check> </contact:check>
</check> </check>

View file

@ -3,7 +3,7 @@
<command> <command>
<check> <check>
<contact:check <contact:check
xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"> xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
<contact:id>sh8013</contact:id> <contact:id>sh8013</contact:id>
<contact:id>sh13</contact:id> <contact:id>sh13</contact:id>
<contact:id>vsdfvq</contact:id> <contact:id>vsdfvq</contact:id>

View file

@ -2,7 +2,7 @@
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0"> <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command> <command>
<create> <create>
<contact:create xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"> <contact:create xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
<contact:postalInfo> <contact:postalInfo>
<contact:name>Sillius Soddus</contact:name> <contact:name>Sillius Soddus</contact:name>
<contact:addr> <contact:addr>

View file

@ -3,7 +3,7 @@
<command> <command>
<delete> <delete>
<contact:delete <contact:delete
xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"> xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
<contact:id>sh8013</contact:id> <contact:id>sh8013</contact:id>
<contact:authInfo> <contact:authInfo>
<contact:pw>wrong-one</contact:pw> <contact:pw>wrong-one</contact:pw>

View file

@ -2,7 +2,7 @@
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0"> <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command> <command>
<info> <info>
<contact:info xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"> <contact:info xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
<contact:id>sh8013</contact:id> <contact:id>sh8013</contact:id>
<contact:authInfo> <contact:authInfo>
<contact:pw>Aas34fq</contact:pw> <contact:pw>Aas34fq</contact:pw>

View file

@ -2,7 +2,7 @@
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0"> <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command> <command>
<update> <update>
<contact:update xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"> <contact:update xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
<contact:id>sh8013</contact:id> <contact:id>sh8013</contact:id>
<contact:chg> <contact:chg>
<contact:postalInfo> <contact:postalInfo>

View file

@ -3,7 +3,7 @@
<command> <command>
<check> <check>
<domain:check <domain:check
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"> xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd">
<domain:name>example.ee</domain:name> <domain:name>example.ee</domain:name>
</domain:check> </domain:check>
</check> </check>

View file

@ -3,7 +3,7 @@
<command> <command>
<create> <create>
<domain:create <domain:create
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"> xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd">
<domain:name>example.ee</domain:name> <domain:name>example.ee</domain:name>
<domain:period unit="y">1</domain:period> <domain:period unit="y">1</domain:period>
<domain:ns> <domain:ns>

View file

@ -3,7 +3,7 @@
<command> <command>
<delete> <delete>
<domain:delete <domain:delete
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"> xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd">
<domain:name>example.ee</domain:name> <domain:name>example.ee</domain:name>
</domain:delete> </domain:delete>
</delete> </delete>

View file

@ -3,7 +3,7 @@
<command> <command>
<info> <info>
<domain:info <domain:info
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"> xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd">
<domain:name hosts="all">example.ee</domain:name> <domain:name hosts="all">example.ee</domain:name>
<domain:authInfo> <domain:authInfo>
<domain:pw>2fooBAR</domain:pw> <domain:pw>2fooBAR</domain:pw>

View file

@ -3,7 +3,7 @@
<command> <command>
<renew> <renew>
<domain:renew <domain:renew
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"> xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd">
<domain:name>example.ee</domain:name> <domain:name>example.ee</domain:name>
<domain:curExpDate>2014-08-07</domain:curExpDate> <domain:curExpDate>2014-08-07</domain:curExpDate>
<domain:period unit="y">1</domain:period> <domain:period unit="y">1</domain:period>

View file

@ -3,7 +3,7 @@
<command> <command>
<transfer op="query"> <transfer op="query">
<domain:transfer <domain:transfer
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"> xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd">
<domain:name>example.ee</domain:name> <domain:name>example.ee</domain:name>
<domain:authInfo> <domain:authInfo>
<domain:pw roid="JD1234-REP">2BARfoo</domain:pw> <domain:pw roid="JD1234-REP">2BARfoo</domain:pw>

View file

@ -3,7 +3,7 @@
<command> <command>
<update> <update>
<domain:update <domain:update
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"> xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd">
<domain:name>example.ee</domain:name> <domain:name>example.ee</domain:name>
<domain:chg> <domain:chg>
<domain:registrant>mak21</domain:registrant> <domain:registrant>mak21</domain:registrant>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1" xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" xmlns:ext="urn:ietf:params:xml:ns:keyrelay-1.0"> <epp xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1" xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd" xmlns:ext="urn:ietf:params:xml:ns:keyrelay-1.0">
<command> <command>
<ext:keyrelay> <ext:keyrelay>
<ext:name>example6.ee</ext:name> <ext:name>example6.ee</ext:name>

View file

@ -4,6 +4,7 @@ app_name: '.EE Registry'
zonefile_export_dir: 'export/zonefiles' zonefile_export_dir: 'export/zonefiles'
bank_statement_import_dir: 'import/bank_statements' bank_statement_import_dir: 'import/bank_statements'
legal_documents_dir: 'import/legal_documents' legal_documents_dir: 'import/legal_documents'
time_zone: 'Tallinn' # more zones by rake time:zones:all
# New Relic app name, keep only current mode, remove other names. # New Relic app name, keep only current mode, remove other names.
# Example: 'Admin, EPP, REPP' will have name 'Admin, EPP, REPP - production' at New Relic. # Example: 'Admin, EPP, REPP' will have name 'Admin, EPP, REPP - production' at New Relic.

View file

@ -21,7 +21,8 @@ module Registry
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
config.time_zone = 'UTC' # NB! It should be defined, otherwise ActiveRecord usese other class. config.time_zone = ENV['time_zone'] # NB! It should be defined,
# otherwise ActiveRecord usese other class internally.
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
@ -49,6 +50,8 @@ module Registry
# Instead, the errors will propagate normally just like in other Active Record callbacks. # Instead, the errors will propagate normally just like in other Active Record callbacks.
config.active_record.raise_in_transactional_callbacks = true config.active_record.raise_in_transactional_callbacks = true
config.active_record.schema_format = :sql
config.generators do |g| config.generators do |g|
g.stylesheets false g.stylesheets false
g.javascripts false g.javascripts false

View file

@ -37,6 +37,8 @@ Rails.application.configure do
# For rails-settings-cached conflict # For rails-settings-cached conflict
config.cache_store = :file_store, 'tmp/cache_test' config.cache_store = :file_store, 'tmp/cache_test'
config.time_zone = 'UTC'
# Raises error for missing translations # Raises error for missing translations
# config.action_view.raise_on_missing_translations = true # config.action_view.raise_on_missing_translations = true

View file

@ -10,6 +10,7 @@ required = %w(
webclient_ip webclient_ip
legal_documents_dir legal_documents_dir
bank_statement_import_dir bank_statement_import_dir
time_zone
) )
Figaro.require_keys(required) Figaro.require_keys(required)

View file

@ -0,0 +1 @@
Que.mode = :off

View file

@ -1,6 +1,4 @@
TEST_EMAILS = %w( TEST_EMAILS = %w(
martin@gitlab.eu
priit@gitlab.eu
timo.vohmar@internet.ee timo.vohmar@internet.ee
rene.vahtel@internet.ee rene.vahtel@internet.ee
martin.mettig@internet.ee martin.mettig@internet.ee
@ -9,6 +7,9 @@ TEST_EMAILS = %w(
norman.aeg@internet.ee norman.aeg@internet.ee
martti.oigus@internet.ee martti.oigus@internet.ee
jana.jarve@internet.ee jana.jarve@internet.ee
martin@gitlab.eu
priit@gitlab.eu
info@gitlab.eu
test@example.com test@example.com
test@example.org test@example.org
) )

View file

@ -100,6 +100,8 @@ en:
invalid: 'Statuses are invalid' invalid: 'Statuses are invalid'
not_found: 'Status was not found' not_found: 'Status was not found'
taken: 'Status already exists on this domain' taken: 'Status already exists on this domain'
statuses:
taken: 'Status already exists on this domain'
registrar: registrar:
blank: 'Registrar is missing' blank: 'Registrar is missing'
dnskeys: dnskeys:
@ -788,8 +790,8 @@ en:
reject_domain_registrant_update: 'Reject domain ownership change' reject_domain_registrant_update: 'Reject domain ownership change'
domain_registrant_change_title: 'Please confirm or reject domain ownership change' domain_registrant_change_title: 'Please confirm or reject domain ownership change'
domain_registrant_change_body: 'There is a request to change domain ownership. Before doing it we need your confirmation.' domain_registrant_change_body: 'There is a request to change domain ownership. Before doing it we need your confirmation.'
new_pending_registrant: 'New owner' new_pending_registrant: 'New registrant'
current_registrant: 'Current owner' current_registrant: 'Current registrant'
registrant_domain_verification_failed: 'Domain verification not available' registrant_domain_verification_failed: 'Domain verification not available'
domain_registrant_change_confirmed_title: 'Domain owner change has been confirmed' domain_registrant_change_confirmed_title: 'Domain owner change has been confirmed'
domain_registrant_change_confirmed_body: 'You have successfully confirmed domain owner change.' domain_registrant_change_confirmed_body: 'You have successfully confirmed domain owner change.'
@ -820,3 +822,5 @@ en:
object_is_not_eligible_for_renewal: 'Object is not eligible for renewal' object_is_not_eligible_for_renewal: 'Object is not eligible for renewal'
set_force_delete: 'Set force delete' set_force_delete: 'Set force delete'
unset_force_delete: 'Unset force delete' unset_force_delete: 'Unset force delete'
domain_expiring: 'Domain expiring'
domain_validation_rules: 'Domain validation rules'

View file

@ -224,6 +224,10 @@ Rails.application.routes.draw do
get 'logout' => '/devise/sessions#destroy' get 'logout' => '/devise/sessions#destroy'
end end
authenticate :user do
mount Que::Web, at: 'que'
end
root 'dashboards#show' root 'dashboards#show'
end end

View file

@ -1 +1,8 @@
worker_processes 2 worker_processes 2
# after_fork do |server, worker|
# binding.pry
# ActiveRecord::Base.establish_connection
# Que.mode = :async
# end

View file

@ -0,0 +1,15 @@
class RefactorDomainStatuses < ActiveRecord::Migration
def self.up
Domain.all.each do |x|
x.statuses = []
x.domain_statuses.each do |ds|
x.statuses << ds.value
end
x.save
end
end
def self.down
raise ActiveRecord::IrreversibleMigration
end
end

View file

@ -0,0 +1,11 @@
class AddQue < ActiveRecord::Migration
def self.up
# The current version as of this migration's creation.
Que.migrate! :version => 3
end
def self.down
# Completely removes Que's job queue.
Que.migrate! :version => 0
end
end

View file

@ -0,0 +1,5 @@
class AddStatusesToDomain < ActiveRecord::Migration
def change
add_column :domains, :statuses, :string, array: true
end
end

View file

@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20150609103333) do ActiveRecord::Schema.define(version: 20150612123111) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
@ -19,7 +19,7 @@ ActiveRecord::Schema.define(version: 20150609103333) do
create_table "account_activities", force: :cascade do |t| create_table "account_activities", force: :cascade do |t|
t.integer "account_id" t.integer "account_id"
t.integer "invoice_id" t.integer "invoice_id"
t.decimal "sum", precision: 10, scale: 2 t.decimal "sum", precision: 8, scale: 2
t.string "currency" t.string "currency"
t.integer "bank_transaction_id" t.integer "bank_transaction_id"
t.datetime "created_at" t.datetime "created_at"
@ -36,7 +36,7 @@ ActiveRecord::Schema.define(version: 20150609103333) do
create_table "accounts", force: :cascade do |t| create_table "accounts", force: :cascade do |t|
t.integer "registrar_id" t.integer "registrar_id"
t.string "account_type" t.string "account_type"
t.decimal "balance", precision: 10, scale: 2, default: 0.0, null: false t.decimal "balance", precision: 8, scale: 2, default: 0.0, null: false
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
t.string "currency" t.string "currency"
@ -98,7 +98,7 @@ ActiveRecord::Schema.define(version: 20150609103333) do
t.string "buyer_name" t.string "buyer_name"
t.string "document_no" t.string "document_no"
t.string "description" t.string "description"
t.decimal "sum", precision: 10, scale: 2 t.decimal "sum", precision: 8, scale: 2
t.string "reference_no" t.string "reference_no"
t.datetime "paid_at" t.datetime "paid_at"
t.datetime "created_at" t.datetime "created_at"
@ -114,7 +114,7 @@ ActiveRecord::Schema.define(version: 20150609103333) do
t.string "vk_rec_id" t.string "vk_rec_id"
t.string "vk_stamp" t.string "vk_stamp"
t.string "vk_t_no" t.string "vk_t_no"
t.decimal "vk_amount", precision: 10, scale: 2 t.decimal "vk_amount", precision: 8, scale: 2
t.string "vk_curr" t.string "vk_curr"
t.string "vk_rec_acc" t.string "vk_rec_acc"
t.string "vk_rec_name" t.string "vk_rec_name"
@ -203,6 +203,12 @@ ActiveRecord::Schema.define(version: 20150609103333) do
t.string "updator_str" t.string "updator_str"
end end
create_table "data_migrations", id: false, force: :cascade do |t|
t.string "version", null: false
end
add_index "data_migrations", ["version"], name: "unique_data_migrations", unique: true, using: :btree
create_table "delegation_signers", force: :cascade do |t| create_table "delegation_signers", force: :cascade do |t|
t.integer "domain_id" t.integer "domain_id"
t.string "key_tag" t.string "key_tag"
@ -306,6 +312,8 @@ ActiveRecord::Schema.define(version: 20150609103333) do
t.datetime "registrant_verification_asked_at" t.datetime "registrant_verification_asked_at"
t.string "registrant_verification_token" t.string "registrant_verification_token"
t.json "pending_json" t.json "pending_json"
t.datetime "force_delete_at"
t.string "statuses", array: true
end end
add_index "domains", ["delete_at"], name: "index_domains_on_delete_at", using: :btree add_index "domains", ["delete_at"], name: "index_domains_on_delete_at", using: :btree
@ -328,10 +336,10 @@ ActiveRecord::Schema.define(version: 20150609103333) do
create_table "invoice_items", force: :cascade do |t| create_table "invoice_items", force: :cascade do |t|
t.integer "invoice_id" t.integer "invoice_id"
t.string "description", null: false t.string "description", null: false
t.string "unit" t.string "unit"
t.integer "amount" t.integer "amount"
t.decimal "price", precision: 10, scale: 2 t.decimal "price", precision: 8, scale: 2
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
t.string "creator_str" t.string "creator_str"
@ -341,20 +349,20 @@ ActiveRecord::Schema.define(version: 20150609103333) do
add_index "invoice_items", ["invoice_id"], name: "index_invoice_items_on_invoice_id", using: :btree add_index "invoice_items", ["invoice_id"], name: "index_invoice_items_on_invoice_id", using: :btree
create_table "invoices", force: :cascade do |t| create_table "invoices", force: :cascade do |t|
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
t.string "invoice_type", null: false t.string "invoice_type", null: false
t.datetime "due_date", null: false t.datetime "due_date", null: false
t.string "payment_term" t.string "payment_term"
t.string "currency", null: false t.string "currency", null: false
t.string "description" t.string "description"
t.string "reference_no" t.string "reference_no"
t.decimal "vat_prc", precision: 10, scale: 2, null: false t.decimal "vat_prc", precision: 8, scale: 2, null: false
t.datetime "paid_at" t.datetime "paid_at"
t.integer "seller_id" t.integer "seller_id"
t.string "seller_name", null: false t.string "seller_name", null: false
t.string "seller_reg_no" t.string "seller_reg_no"
t.string "seller_iban", null: false t.string "seller_iban", null: false
t.string "seller_bank" t.string "seller_bank"
t.string "seller_swift" t.string "seller_swift"
t.string "seller_vat_no" t.string "seller_vat_no"
@ -368,7 +376,7 @@ ActiveRecord::Schema.define(version: 20150609103333) do
t.string "seller_email" t.string "seller_email"
t.string "seller_contact_name" t.string "seller_contact_name"
t.integer "buyer_id" t.integer "buyer_id"
t.string "buyer_name", null: false t.string "buyer_name", null: false
t.string "buyer_reg_no" t.string "buyer_reg_no"
t.string "buyer_country_code" t.string "buyer_country_code"
t.string "buyer_state" t.string "buyer_state"
@ -382,7 +390,7 @@ ActiveRecord::Schema.define(version: 20150609103333) do
t.string "updator_str" t.string "updator_str"
t.integer "number" t.integer "number"
t.datetime "cancelled_at" t.datetime "cancelled_at"
t.decimal "sum_cache", precision: 10, scale: 2 t.decimal "sum_cache", precision: 8, scale: 2
end end
add_index "invoices", ["buyer_id"], name: "index_invoices_on_buyer_id", using: :btree add_index "invoices", ["buyer_id"], name: "index_invoices_on_buyer_id", using: :btree
@ -900,6 +908,17 @@ ActiveRecord::Schema.define(version: 20150609103333) do
t.string "operation_category" t.string "operation_category"
end end
create_table "que_jobs", id: false, force: :cascade do |t|
t.integer "priority", limit: 2, default: 100, null: false
t.datetime "run_at", default: "now()", null: false
t.integer "job_id", limit: 8, default: "nextval('que_jobs_job_id_seq'::regclass)", null: false
t.text "job_class", null: false
t.json "args", default: [], null: false
t.integer "error_count", default: 0, null: false
t.text "last_error"
t.text "queue", default: "", null: false
end
create_table "registrant_verifications", force: :cascade do |t| create_table "registrant_verifications", force: :cascade do |t|
t.string "domain_name" t.string "domain_name"
t.string "verification_token" t.string "verification_token"
@ -983,7 +1002,7 @@ ActiveRecord::Schema.define(version: 20150609103333) do
t.text "crt" t.text "crt"
t.string "type" t.string "type"
t.string "registrant_ident" t.string "registrant_ident"
t.string "encrypted_password", default: "" t.string "encrypted_password", default: "", null: false
t.datetime "remember_created_at" t.datetime "remember_created_at"
t.integer "failed_attempts", default: 0, null: false t.integer "failed_attempts", default: 0, null: false
t.datetime "locked_at" t.datetime "locked_at"

4733
db/structure.sql Normal file

File diff suppressed because it is too large Load diff

View file

@ -18,8 +18,8 @@ Our implementation supports following protocols:
Related XML Schema Definitions (may differ from policies applied to registry): Related XML Schema Definitions (may differ from policies applied to registry):
[contact-1.0.xsd](schemas/contact-1.0.xsd) [contact-eis-1.0.xsd](schemas/contact-eis-1.0.xsd)
[domain-1.0.xsd](schemas/domain-1.0.xsd) [domain-eis-1.0.xsd](schemas/domain-eis-1.0.xsd)
[eis-1.0.xsd](schemas/eis-1.0.xsd) [eis-1.0.xsd](schemas/eis-1.0.xsd)
[epp-1.0.xsd](schemas/epp-1.0.xsd) [epp-1.0.xsd](schemas/epp-1.0.xsd)
[eppcom-1.0.xsd](schemas/eppcom-1.0.xsd) [eppcom-1.0.xsd](schemas/eppcom-1.0.xsd)

File diff suppressed because it is too large Load diff

View file

@ -12,7 +12,7 @@ Contact Mapping protocol short version:
Field name Min-max Field description Field name Min-max Field description
----------------------- ------- ----------------- ----------------------- ------- -----------------
<create> 1 <create> 1
<contact:create> 1 Attribute: xmlns:contact="urn:ietf:params:xml:ns:contact-1.0" <contact:create> 1 Attribute: xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd"
<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
@ -45,7 +45,7 @@ Contact Mapping protocol short version:
Field name Min-max Field description Field name Min-max Field description
----------------------- ------- ----------------- ----------------------- ------- -----------------
<update> 1 <update> 1
<contact:update> 1 Attribute: xmlns:contact="urn:ietf:params:xml:ns:contact-1.0" <contact:update> 1 Attribute: xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd"
<contact:id> 1 Contact id, required <contact:id> 1 Contact id, required
<contact:chg> 1 Change container <contact:chg> 1 Change container
<contact:postalInfo> 1 Postal information container <contact:postalInfo> 1 Postal information container
@ -82,7 +82,7 @@ Contact Mapping protocol short version:
Field name Min-max Field description Field name Min-max Field description
----------------------- ------- ----------------- ----------------------- ------- -----------------
<delete> 1 <delete> 1
<contact:delete> 1 Attribute: xmlns:contact="urn:ietf:params:xml:ns:contact-1.0" <contact:delete> 1 Attribute: xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd"
<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"
@ -100,7 +100,7 @@ Contact Mapping protocol short version:
Field name Min-max Field description Field name Min-max Field description
----------------------- ------- ----------------- ----------------------- ------- -----------------
<check> 1 <check> 1
<contact:check> 1 Attribute: xmlns:contact="urn:ietf:params:xml:ns:contact-1.0" <contact:check> 1 Attribute: xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd"
<contact:id> 1-n Contact id <contact:id> 1-n Contact id
<clTRID> 0-1 Client transaction id <clTRID> 0-1 Client transaction id
@ -112,7 +112,7 @@ Contact Mapping protocol short version:
Field name Min-max Field description Field name Min-max Field description
----------------------- ------- ----------------- ----------------------- ------- -----------------
<info> 1 <info> 1
<contact:info> 1 Attribute: xmlns:contact="urn:ietf:params:xml:ns:contact-1.0" <contact:info> 1 Attribute: xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd"
<contact:id> 1-n Contact id <contact:id> 1-n 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"

View file

@ -13,7 +13,7 @@ Domain name mapping protocol short version:
Field name Min-max Field description Field name Min-max Field description
------------------------- ------- ----------------- ------------------------- ------- -----------------
<create> 1 <create> 1
<domain:create> 1 Attribute: xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" <domain:create> 1 Attribute: xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd"
<domain:name> 1 Domain name. Can contain unicode characters. <domain:name> 1 Domain name. Can contain unicode characters.
<domain:period> 0-1 Registration period for domain. <domain:period> 0-1 Registration period for domain.
Must add up to 1 / 2 / 3 years. Must add up to 1 / 2 / 3 years.
@ -47,7 +47,7 @@ Domain name mapping protocol short version:
Field name Min-max Field description Field name Min-max Field description
------------------------ -------- ----------------- ------------------------ -------- -----------------
<update> 1 <update> 1
<domain:update> 1 Attribute: xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" <domain:update> 1 Attribute: xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd"
<domain:name> 1 Domain name. Can contain unicode characters. <domain:name> 1 Domain name. Can contain unicode characters.
<domain:chg> 0-1 Attributes to change <domain:chg> 0-1 Attributes to change
<domain:registrant> 0-1 Contact reference to the registrant <domain:registrant> 0-1 Contact reference to the registrant
@ -94,7 +94,7 @@ Domain name mapping protocol short version:
Field name Min-max Field description Field name Min-max Field description
----------------------- ------- ----------------- ----------------------- ------- -----------------
<delete> 1 <delete> 1
<domain:delete> 1 Attribute: xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" <domain:delete> 1 Attribute: xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd"
Optional attribute: verified="yes/no" Optional attribute: verified="yes/no"
<domain:name> 1 Domain name. Can contain unicode characters. <domain:name> 1 Domain name. Can contain unicode characters.
<extension> 1 <extension> 1
@ -110,7 +110,7 @@ Domain name mapping protocol short version:
Field name Min-max Field description Field name Min-max Field description
----------------------- ------- ----------------- ----------------------- ------- -----------------
<info> 1 <info> 1
<domain:info> 1 Attribute: xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" <domain:info> 1 Attribute: xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd"
<domain:name> 1 Domain name. Can contain unicode characters. <domain:name> 1 Domain name. Can contain unicode characters.
Attribute: hosts="all / del / sub / none" Attribute: hosts="all / del / sub / none"
<domain:authInfo> 0-1 Required if registrar is not the owner of the domain. <domain:authInfo> 0-1 Required if registrar is not the owner of the domain.
@ -124,7 +124,7 @@ Domain name mapping protocol short version:
Field name Min-max Field description Field name Min-max Field description
----------------------- ------- ----------------- ----------------------- ------- -----------------
<renew> 1 <renew> 1
<domain:renew> 1 Attribute: xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" <domain:renew> 1 Attribute: xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd"
<domain:name> 1 Domain name. Can contain unicode characters. <domain:name> 1 Domain name. Can contain unicode characters.
<domain:curExpDate> 1 Current expiry date (ISO8601 format) <domain:curExpDate> 1 Current expiry date (ISO8601 format)
<domain:period> 1 Registration period for domain. <domain:period> 1 Registration period for domain.
@ -142,7 +142,7 @@ Domain name mapping protocol short version:
Field name Min-max Field description Field name Min-max Field description
----------------------- ------- ----------------- ----------------------- ------- -----------------
<transfer> 1 <transfer> 1
<domain:transfer> 1 Attribute: xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" <domain:transfer> 1 Attribute: xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd"
<domain:name> 1 Domain name. Can contain unicode characters. <domain:name> 1 Domain name. Can contain unicode characters.
<domain:authInfo> 1 <domain:authInfo> 1
<domain:pw> 1 Domain password. Attribute: roid="String" <domain:pw> 1 Domain password. Attribute: roid="String"
@ -159,7 +159,7 @@ Domain name mapping protocol short version:
Field name Min-max Field description Field name Min-max Field description
----------------------- ------- ----------------- ----------------------- ------- -----------------
<check> 1 <check> 1
<domain:check> 1 Attribute: xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" <domain:check> 1 Attribute: xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd"
<domain:name> 1 Domain name. Can contain unicode characters. <domain:name> 1 Domain name. Can contain unicode characters.
<clTRID> 0-1 Client transaction id <clTRID> 0-1 Client transaction id

View file

@ -17,6 +17,7 @@ Here are functions like login, logout, hello, poll
<login> 1 <login> 1
<clID> 1 Username <clID> 1 Username
<pw> 1 Password <pw> 1 Password
<newPW> 0-1 Optional new password for EPP user
<options> 0-1 <options> 0-1
<version> 0-1 1.0 <version> 0-1 1.0
<lang> 0-1 en <lang> 0-1 en

View file

@ -1,7 +1,14 @@
# REPP integration specification # REPP integration specification
REPP uses currently Basic Authentication (http://tools.ietf.org/html/rfc2617#section-2) with ssl certificate and key. REPP uses HTTP/1.1 protocol (http://www.ietf.org/rfc/rfc2616.txt) and
Credentials and certificate are issued by EIS (in an exchange for desired API username, CSR (where CN must match username) and IP). Basic Authentication (http://tools.ietf.org/html/rfc2617#section-2) using
Secure Transport (https://tools.ietf.org/html/rfc5246) with certificate and key (https://tools.ietf.org/html/rfc5280).
Credentials and certificate are issued by EIS (in an exchange for desired API username, CSR and IP).
To quickly test the API, use curl:
curl -q -k --cert user.crt.pem --key user.key.pem https://TBA/repp/v1/accounts/balance -u username:password
Test API endpoint: TBA Test API endpoint: TBA
Production API endpoint: TBA Production API endpoint: TBA

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="urn:ietf:params:xml:ns:contact-1.0" <schema targetNamespace="urn:ietf:params:xml:ns:contact-1.0"
xmlns:contact="urn:ietf:params:xml:ns:contact-1.0" xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"
@ -10,8 +10,8 @@
<!-- <!--
Import common element types. Import common element types.
--> -->
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0" schemaLocation="doc/schemas/eppcom-1.0.xsd"/> <import namespace="urn:ietf:params:xml:ns:eppcom-1.0"/>
<import namespace="urn:ietf:params:xml:ns:epp-1.0" schemaLocation="doc/schemas/epp-1.0.xsd"/> <import namespace="urn:ietf:params:xml:ns:epp-1.0"/>
<annotation> <annotation>
<documentation> <documentation>
@ -25,7 +25,7 @@
--> -->
<element name="check" type="contact:mIDType"/> <element name="check" type="contact:mIDType"/>
<element name="create" type="contact:createType"/> <element name="create" type="contact:createType"/>
<element name="delete" type="contact:authIDType"/> <element name="delete" type="contact:sIDType"/>
<element name="info" type="contact:authIDType"/> <element name="info" type="contact:authIDType"/>
<element name="transfer" type="contact:authIDType"/> <element name="transfer" type="contact:authIDType"/>
<element name="update" type="contact:updateType"/> <element name="update" type="contact:updateType"/>
@ -38,6 +38,7 @@
<length value="2"/> <length value="2"/>
</restriction> </restriction>
</simpleType> </simpleType>
<complexType name="e164Type"> <complexType name="e164Type">
<simpleContent> <simpleContent>
<extension base="contact:e164StringType"> <extension base="contact:e164StringType">
@ -48,7 +49,7 @@
<simpleType name="e164StringType"> <simpleType name="e164StringType">
<restriction base="token"> <restriction base="token">
<!--<pattern value="(\+[0-9]{1,3}\.[0-9]{1,14})?"/> --> <pattern value="(\+[0-9]{1,3}\.[0-9]{1,14})?"/>
<maxLength value="17"/> <maxLength value="17"/>
</restriction> </restriction>
</simpleType> </simpleType>
@ -77,7 +78,7 @@
--> -->
<complexType name="createType"> <complexType name="createType">
<sequence> <sequence>
<element name="id" type="eppcom:clIDType" minOccurs="0"/> <element name="id" type="eppcom:clIDType"/>
<element name="postalInfo" type="contact:postalInfoType" <element name="postalInfo" type="contact:postalInfoType"
maxOccurs="2"/> maxOccurs="2"/>
<element name="voice" type="contact:e164Type" <element name="voice" type="contact:e164Type"
@ -85,8 +86,9 @@
<element name="fax" type="contact:e164Type" <element name="fax" type="contact:e164Type"
minOccurs="0"/> minOccurs="0"/>
<element name="email" type="eppcom:minTokenType"/> <element name="email" type="eppcom:minTokenType"/>
<element name="authInfo" type="contact:authInfoType" minOccurs="0"/> <element name="authInfo" type="contact:authInfoType"/>
<element name="disclose" type="contact:discloseType"
minOccurs="0"/>
</sequence> </sequence>
</complexType> </complexType>
@ -97,7 +99,8 @@
minOccurs="0"/> minOccurs="0"/>
<element name="addr" type="contact:addrType"/> <element name="addr" type="contact:addrType"/>
</sequence> </sequence>
<attribute name="type" type="contact:postalInfoEnumType"/> <attribute name="type" type="contact:postalInfoEnumType"
use="required"/>
</complexType> </complexType>
<simpleType name="postalInfoEnumType"> <simpleType name="postalInfoEnumType">
@ -127,6 +130,21 @@
</choice> </choice>
</complexType> </complexType>
<complexType name="discloseType">
<sequence>
<element name="name" type="contact:intLocType"
minOccurs="0" maxOccurs="2"/>
<element name="org" type="contact:intLocType"
minOccurs="0" maxOccurs="2"/>
<element name="addr" type="contact:intLocType"
minOccurs="0" maxOccurs="2"/>
<element name="voice" minOccurs="0"/>
<element name="fax" minOccurs="0"/>
<element name="email" minOccurs="0"/>
</sequence>
<attribute name="flag" type="boolean" use="required"/>
</complexType>
<complexType name="intLocType"> <complexType name="intLocType">
<attribute name="type" type="contact:postalInfoEnumType" <attribute name="type" type="contact:postalInfoEnumType"
use="required"/> use="required"/>
@ -202,6 +220,8 @@
minOccurs="0"/> minOccurs="0"/>
<element name="authInfo" type="contact:authInfoType" <element name="authInfo" type="contact:authInfoType"
minOccurs="0"/> minOccurs="0"/>
<element name="disclose" type="contact:discloseType"
minOccurs="0"/>
</sequence> </sequence>
</complexType> </complexType>
@ -214,7 +234,8 @@
<element name="addr" type="contact:addrType" <element name="addr" type="contact:addrType"
minOccurs="0"/> minOccurs="0"/>
</sequence> </sequence>
<attribute name="type" type="contact:postalInfoEnumType"/> <attribute name="type" type="contact:postalInfoEnumType"
use="required"/>
</complexType> </complexType>
<!-- <!--
@ -290,6 +311,8 @@
minOccurs="0"/> minOccurs="0"/>
<element name="authInfo" type="contact:authInfoType" <element name="authInfo" type="contact:authInfoType"
minOccurs="0"/> minOccurs="0"/>
<element name="disclose" type="contact:discloseType"
minOccurs="0"/>
</sequence> </sequence>
</complexType> </complexType>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="urn:ietf:params:xml:ns:contact-1.0" <schema targetNamespace="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd"
xmlns:contact="urn:ietf:params:xml:ns:contact-1.0" xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd"
xmlns:epp="urn:ietf:params:xml:ns:epp-1.0" xmlns:epp="urn:ietf:params:xml:ns:epp-1.0"
xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0" xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"
xmlns="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/XMLSchema"

View file

@ -11,10 +11,9 @@
<!-- <!--
Import common element types. Import common element types.
--> -->
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0" schemaLocation="doc/schemas/eppcom-1.0.xsd"/> <import namespace="urn:ietf:params:xml:ns:eppcom-1.0"/>
<import namespace="urn:ietf:params:xml:ns:epp-1.0" schemaLocation="doc/schemas/epp-1.0.xsd"/> <import namespace="urn:ietf:params:xml:ns:epp-1.0"/>
<import namespace="urn:ietf:params:xml:ns:host-1.0" schemaLocation="doc/schemas/host-1.0.xsd"/> <import namespace="urn:ietf:params:xml:ns:host-1.0"/>
<import namespace="urn:ietf:params:xml:ns:secDNS-1.1" schemaLocation="doc/schemas/secDNS-1.1.xsd"/>
<annotation> <annotation>
<documentation> <documentation>
@ -47,7 +46,7 @@
minOccurs="0"/> minOccurs="0"/>
<element name="contact" type="domain:contactType" <element name="contact" type="domain:contactType"
minOccurs="0" maxOccurs="unbounded"/> minOccurs="0" maxOccurs="unbounded"/>
<element name="authInfo" type="domain:authInfoType" minOccurs="0"/> <element name="authInfo" type="domain:authInfoType"/>
</sequence> </sequence>
</complexType> </complexType>
@ -63,7 +62,7 @@
<simpleType name="pLimitType"> <simpleType name="pLimitType">
<restriction base="unsignedShort"> <restriction base="unsignedShort">
<minInclusive value="1"/> <minInclusive value="1"/>
<maxInclusive value="1095"/> <maxInclusive value="99"/>
</restriction> </restriction>
</simpleType> </simpleType>
@ -71,7 +70,6 @@
<restriction base="token"> <restriction base="token">
<enumeration value="y"/> <enumeration value="y"/>
<enumeration value="m"/> <enumeration value="m"/>
<enumeration value="d"/>
</restriction> </restriction>
</simpleType> </simpleType>
@ -91,7 +89,6 @@
<sequence> <sequence>
<element name="hostName" type="eppcom:labelType"/> <element name="hostName" type="eppcom:labelType"/>
<element name="hostAddr" type="host:addrType" <element name="hostAddr" type="host:addrType"
minOccurs="0" maxOccurs="unbounded"/> minOccurs="0" maxOccurs="unbounded"/>
</sequence> </sequence>
</complexType> </complexType>
@ -240,28 +237,12 @@
Allow the registrant value to be nullified by changing the Allow the registrant value to be nullified by changing the
minLength restriction to "0". minLength restriction to "0".
--> -->
<simpleType name="clIDChgType">
<complexType name="clIDChgType">
<simpleContent>
<extension base="domain:clIDChgSimpleType">
<attribute name="verified" type="domain:verifiedType"/>
</extension>
</simpleContent>
</complexType>
<simpleType name="clIDChgSimpleType">
<restriction base="token"> <restriction base="token">
<minLength value="0"/> <minLength value="0"/>
<maxLength value="16"/>
</restriction> </restriction>
</simpleType> </simpleType>
<simpleType name="verifiedType">
<restriction base="token">
<enumeration value="yes"/>
<enumeration value="no"/>
</restriction>
</simpleType>
<!-- <!--
Allow the authInfo value to be nullified by including an Allow the authInfo value to be nullified by including an
@ -444,6 +425,7 @@
minOccurs="0"/> minOccurs="0"/>
</sequence> </sequence>
</complexType> </complexType>
<!-- <!--
End of schema. End of schema.
--> -->

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="urn:ietf:params:xml:ns:domain-1.0" <schema targetNamespace="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd"
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd"
xmlns:host="urn:ietf:params:xml:ns:host-1.0" xmlns:host="urn:ietf:params:xml:ns:host-1.0"
xmlns:epp="urn:ietf:params:xml:ns:epp-1.0" xmlns:epp="urn:ietf:params:xml:ns:epp-1.0"
xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0" xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"

View file

@ -2,6 +2,7 @@ class DeviseCustomFailure < Devise::FailureApp
def redirect_url def redirect_url
return registrant_login_url if request.original_fullpath.to_s.match(/^\/registrant/) return registrant_login_url if request.original_fullpath.to_s.match(/^\/registrant/)
return registrar_login_url if request.original_fullpath.to_s.match(/^\/registrar/) return registrar_login_url if request.original_fullpath.to_s.match(/^\/registrar/)
return '/admin' if request.original_fullpath.to_s.match(%r{^\/admin\/que})
return admin_login_url if request.original_fullpath.to_s.match(/^\/admin/) return admin_login_url if request.original_fullpath.to_s.match(/^\/admin/)
root_url root_url
end end

View file

@ -1,7 +1,7 @@
class EppConstraint class EppConstraint
OBJECT_TYPES = { OBJECT_TYPES = {
domain: { domain: 'urn:ietf:params:xml:ns:domain-1.0' }, domain: { domain: 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd' },
contact: { contact: 'urn:ietf:params:xml:ns:contact-1.0' } contact: { contact: 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd' }
} }
def initialize(type) def initialize(type)

View file

@ -224,6 +224,7 @@ namespace :import do
legacy_id legacy_id
legacy_registrar_id legacy_registrar_id
legacy_registrant_id legacy_registrant_id
statuses
) )
domain_contact_columns = %w( domain_contact_columns = %w(
@ -234,6 +235,7 @@ namespace :import do
legacy_contact_id legacy_contact_id
) )
# rubocop: disable Lint/UselessAssignment
domain_status_columns = %w( domain_status_columns = %w(
description description
value value
@ -241,6 +243,7 @@ namespace :import do
updator_str updator_str
legacy_domain_id legacy_domain_id
) )
# rubocop: enable Lint/UselessAssignment
nameserver_columns = %w( nameserver_columns = %w(
hostname hostname
@ -263,7 +266,7 @@ namespace :import do
legacy_domain_id legacy_domain_id
) )
domains, nameservers, dnskeys, domain_statuses, domain_contacts = [], [], [], [], [] domains, nameservers, dnskeys, domain_contacts = [], [], [], []
existing_domain_ids = Domain.pluck(:legacy_id) existing_domain_ids = Domain.pluck(:legacy_id)
user = "rake-#{`whoami`.strip} #{ARGV.join ' '}" user = "rake-#{`whoami`.strip} #{ARGV.join ' '}"
count = 0 count = 0
@ -281,6 +284,18 @@ namespace :import do
count += 1 count += 1
begin begin
# domain statuses
domain_statuses = []
ok = true
x.object_states.each do |state|
next if state.name.blank?
domain_statuses << state.name
ok = false
end
# OK status is default
domain_statuses << DomainStatus::OK if ok
domains << [ domains << [
x.object_registry.name.try(:strip), x.object_registry.name.try(:strip),
x.object_registry.try(:crdate), x.object_registry.try(:crdate),
@ -296,7 +311,8 @@ namespace :import do
user, user,
x.id, x.id,
x.object_registry.try(:crid), x.object_registry.try(:crid),
x.registrant x.registrant,
domain_statuses
] ]
# admin contacts # admin contacts
@ -321,31 +337,6 @@ namespace :import do
] ]
end end
# domain statuses
ok = true
x.object_states.each do |state|
next if state.name.blank?
domain_statuses << [
state.desc,
state.name,
user,
user,
x.id
]
ok = false
end
# OK status is default
if ok
domain_statuses << [
nil,
DomainStatus::OK,
user,
user,
x.id
]
end
# nameservers # nameservers
x.nsset.hosts.each do |host| x.nsset.hosts.each do |host|
ip_maps = host.host_ipaddr_maps ip_maps = host.host_ipaddr_maps
@ -384,9 +375,8 @@ namespace :import do
Domain.import domain_columns, domains, validate: false Domain.import domain_columns, domains, validate: false
Nameserver.import nameserver_columns, nameservers, validate: false Nameserver.import nameserver_columns, nameservers, validate: false
Dnskey.import dnskey_columns, dnskeys, validate: false Dnskey.import dnskey_columns, dnskeys, validate: false
DomainStatus.import domain_status_columns, domain_statuses, validate: false
DomainContact.import domain_contact_columns, domain_contacts, validate: false DomainContact.import domain_contact_columns, domain_contacts, validate: false
domains, nameservers, dnskeys, domain_statuses, domain_contacts = [], [], [], [], [] domains, nameservers, dnskeys, domain_contacts = [], [], [], []
end end
rescue => e rescue => e
puts "ERROR on index #{index}" puts "ERROR on index #{index}"
@ -397,7 +387,6 @@ namespace :import do
Domain.import domain_columns, domains, validate: false Domain.import domain_columns, domains, validate: false
Nameserver.import nameserver_columns, nameservers, validate: false Nameserver.import nameserver_columns, nameservers, validate: false
Dnskey.import dnskey_columns, dnskeys, validate: false Dnskey.import dnskey_columns, dnskeys, validate: false
DomainStatus.import domain_status_columns, domain_statuses, validate: false
DomainContact.import domain_contact_columns, domain_contacts, validate: false DomainContact.import domain_contact_columns, domain_contacts, validate: false
puts '-----> Updating relations...' puts '-----> Updating relations...'
@ -461,16 +450,6 @@ namespace :import do
"AND domain_id IS NULL" "AND domain_id IS NULL"
) )
# statuses
ActiveRecord::Base.connection.execute(
"UPDATE domain_statuses "\
"SET domain_id = domains.id "\
"FROM domains "\
"WHERE domains.legacy_id = legacy_domain_id "\
"AND legacy_domain_id IS NOT NULL "\
"AND domain_id IS NULL"
)
puts '-----> Generating dnskey digests...' puts '-----> Generating dnskey digests...'
Dnskey.all.each do |x| Dnskey.all.each do |x|

View file

@ -412,7 +412,7 @@ describe 'EPP Contact', epp: true do
} }
} }
response = update_request({ id: { value: 'FIRST0:SH8013' } }, extension) response = update_request({ id: { value: 'FIRST0:SH8013' } }, extension)
response[:msg].should == response[:msg].should ==
'Parameter value policy error. Update of ident data not allowed [ident]' 'Parameter value policy error. Update of ident data not allowed [ident]'
response[:result_code].should == '2306' response[:result_code].should == '2306'
@ -975,7 +975,7 @@ describe 'EPP Contact', epp: true do
<command> <command>
<check> <check>
<contact:check <contact:check
xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"> xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
<contact:id>FIXED:CHECK-1234</contact:id> <contact:id>FIXED:CHECK-1234</contact:id>
<contact:id>check-4321</contact:id> <contact:id>check-4321</contact:id>
</contact:check> </contact:check>
@ -991,7 +991,7 @@ describe 'EPP Contact', epp: true do
<command> <command>
<check> <check>
<contact:check <contact:check
xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"> xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
<contact:id>FIXED:CHECK-LEGACY</contact:id> <contact:id>FIXED:CHECK-LEGACY</contact:id>
<contact:id>CID:FIXED:CHECK-LEGACY</contact:id> <contact:id>CID:FIXED:CHECK-LEGACY</contact:id>
</contact:check> </contact:check>

View file

@ -317,7 +317,7 @@ describe 'EPP Domain', epp: true do
response = epp_plain_request(xml) response = epp_plain_request(xml)
response[:msg].should == 'Command completed successfully' response[:msg].should == 'Command completed successfully'
response[:result_code].should == '1000' response[:result_code].should == '1000'
Domain.first.valid_to.should be_within(5).of(1.year.since) Domain.first.valid_to.should be_within(60).of(1.year.since)
end end
it 'does not create a domain with invalid period' do it 'does not create a domain with invalid period' do
@ -1501,7 +1501,8 @@ describe 'EPP Domain', epp: true do
end end
it 'should not allow any update when status pending update' do it 'should not allow any update when status pending update' do
domain.domain_statuses.create(value: DomainStatus::PENDING_UPDATE) domain.statuses << DomainStatus::PENDING_UPDATE
domain.save
existing_pw = domain.auth_info existing_pw = domain.auth_info
@ -1592,11 +1593,10 @@ describe 'EPP Domain', epp: true do
new_contact = d.tech_contacts.find_by(code: 'FIXED:MAK21') new_contact = d.tech_contacts.find_by(code: 'FIXED:MAK21')
new_contact.should be_truthy new_contact.should be_truthy
d.domain_statuses.count.should == 2 d.statuses.count.should == 2
d.domain_statuses.first.description.should == 'Payment overdue.' d.statuses.include?('clientHold').should == true
d.domain_statuses.first.value.should == 'clientHold' d.statuses.include?('clientUpdateProhibited').should == true
d.domain_statuses.last.value.should == 'clientUpdateProhibited'
d.dnskeys.count.should == 2 d.dnskeys.count.should == 2
response = epp_plain_request(xml) response = epp_plain_request(xml)
@ -1621,39 +1621,39 @@ describe 'EPP Domain', epp: true do
response[:results][2][:msg].should == 'Contact already exists on this domain [contact_code_cache]' response[:results][2][:msg].should == 'Contact already exists on this domain [contact_code_cache]'
response[:results][2][:value].should == 'FIXED:MAK21' response[:results][2][:value].should == 'FIXED:MAK21'
response[:results][3][:msg].should == 'Status already exists on this domain [value]' # response[:results][3][:msg].should == 'Status already exists on this domain [value]'
if response[:results][3][:value] == 'clientHold' # if response[:results][3][:value] == 'clientHold'
response[:results][3][:value].should == 'clientHold' # response[:results][3][:value].should == 'clientHold'
else # else
response[:results][3][:value].should == 'clientUpdateProhibited' # response[:results][3][:value].should == 'clientUpdateProhibited'
end # end
response[:results][4][:msg].should == 'Status already exists on this domain [value]' # response[:results][4][:msg].should == 'Status already exists on this domain [value]'
if response[:results][4][:value] == 'clientHold' # if response[:results][4][:value] == 'clientHold'
response[:results][4][:value].should == 'clientHold' # response[:results][4][:value].should == 'clientHold'
else # else
response[:results][4][:value].should == 'clientUpdateProhibited' # response[:results][4][:value].should == 'clientUpdateProhibited'
end # end
response[:results][5][:msg].should == 'Public key already exists [public_key]' response[:results][3][:msg].should == 'Public key already exists [public_key]'
if response[:results][5][:value] == '700b97b591ed27ec2590d19f06f88bba700b97b591ed27ec2590d19f' if response[:results][3][:value] == '700b97b591ed27ec2590d19f06f88bba700b97b591ed27ec2590d19f'
response[:results][5][:value].should == response[:results][3][:value].should ==
'700b97b591ed27ec2590d19f06f88bba700b97b591ed27ec2590d19f' '700b97b591ed27ec2590d19f06f88bba700b97b591ed27ec2590d19f'
else else
response[:results][5][:value].should == response[:results][3][:value].should ==
'841936717ae427ace63c28d04918569a841936717ae427ace63c28d0' '841936717ae427ace63c28d04918569a841936717ae427ace63c28d0'
end end
response[:results][6][:msg].should == 'Public key already exists [public_key]' response[:results][4][:msg].should == 'Public key already exists [public_key]'
if response[:results][6][:value] == '700b97b591ed27ec2590d19f06f88bba700b97b591ed27ec2590d19f' if response[:results][4][:value] == '700b97b591ed27ec2590d19f06f88bba700b97b591ed27ec2590d19f'
response[:results][6][:value].should == response[:results][4][:value].should ==
'700b97b591ed27ec2590d19f06f88bba700b97b591ed27ec2590d19f' '700b97b591ed27ec2590d19f06f88bba700b97b591ed27ec2590d19f'
else else
response[:results][6][:value].should == response[:results][4][:value].should ==
'841936717ae427ace63c28d04918569a841936717ae427ace63c28d0' '841936717ae427ace63c28d04918569a841936717ae427ace63c28d0'
end end
d.domain_statuses.count.should == 2 d.statuses.count.should == 2
end end
it 'updates domain with registrant change what triggers action pending' do it 'updates domain with registrant change what triggers action pending' do
@ -1729,8 +1729,8 @@ describe 'EPP Domain', epp: true do
new_contact = d.tech_contacts.find_by(code: 'FIXED:PENDINGMAK21') new_contact = d.tech_contacts.find_by(code: 'FIXED:PENDINGMAK21')
new_contact.should_not be_truthy # aka should not add new contact new_contact.should_not be_truthy # aka should not add new contact
d.domain_statuses.count.should == 1 d.statuses.count.should == 1
d.domain_statuses.first.value.should == 'pendingUpdate' d.statuses.first.should == 'pendingUpdate'
d.dnskeys.count.should == 0 d.dnskeys.count.should == 0
end end
@ -1840,10 +1840,11 @@ describe 'EPP Domain', epp: true do
response[:results][0][:msg].should == 'Command completed successfully' response[:results][0][:msg].should == 'Command completed successfully'
response[:results][0][:result_code].should == '1000' response[:results][0][:result_code].should == '1000'
d.reload
d.dnskeys.count.should == 1 d.dnskeys.count.should == 1
d.domain_statuses.count.should == 1 d.statuses.count.should == 1
d.domain_statuses.first.value.should == 'clientUpdateProhibited' d.statuses.first.should == 'clientUpdateProhibited'
rem_ns = d.nameservers.find_by(hostname: 'ns1.example.com') rem_ns = d.nameservers.find_by(hostname: 'ns1.example.com')
rem_ns.should be_falsey rem_ns.should be_falsey
@ -1862,13 +1863,17 @@ describe 'EPP Domain', epp: true do
response[:results][1][:value].should == 'FIXED:CITIZEN_1234' response[:results][1][:value].should == 'FIXED:CITIZEN_1234'
response[:results][2][:result_code].should == '2303' response[:results][2][:result_code].should == '2303'
response[:results][2][:msg].should == 'Status was not found' response[:results][2][:msg].should == 'DS was not found'
response[:results][2][:value].should == 'clientHold' response[:results][2][:value].should == '700b97b591ed27ec2590d19f06f88bba700b97b591ed27ec2590d19f'
response[:results][3][:result_code].should == '2303'
response[:results][3][:msg].should == 'Status was not found'
response[:results][3][:value].should == 'clientHold'
end end
it 'does not remove server statuses' do it 'does not remove server statuses' do
d = Domain.last domain.statuses << DomainStatus::SERVER_HOLD
d.domain_statuses.create(value: DomainStatus::SERVER_HOLD) domain.save
xml = domain_update_xml({ xml = domain_update_xml({
name: { value: domain.name }, name: { value: domain.name },
@ -2079,9 +2084,10 @@ describe 'EPP Domain', epp: true do
Domain.start_expire_period Domain.start_expire_period
Domain.start_redemption_grace_period Domain.start_redemption_grace_period
domain.domain_statuses.where(value: DomainStatus::EXPIRED).count.should == 1 domain.reload
domain.domain_statuses.where(value: DomainStatus::SERVER_HOLD).count.should == 1 domain.statuses.include?(DomainStatus::EXPIRED).should == true
domain.domain_statuses.where(value: DomainStatus::OK).count.should == 0 domain.statuses.include?(DomainStatus::SERVER_HOLD).should == true
domain.statuses.include?(DomainStatus::OK).should == false
exp_date = domain.valid_to.to_date exp_date = domain.valid_to.to_date
@ -2095,9 +2101,10 @@ describe 'EPP Domain', epp: true do
response[:results][0][:msg].should == 'Command completed successfully' response[:results][0][:msg].should == 'Command completed successfully'
response[:results][0][:result_code].should == '1000' response[:results][0][:result_code].should == '1000'
domain.domain_statuses.where(value: DomainStatus::EXPIRED).count.should == 0 domain.reload
domain.domain_statuses.where(value: DomainStatus::SERVER_HOLD).count.should == 0 domain.statuses.include?(DomainStatus::EXPIRED).should == false
domain.domain_statuses.where(value: DomainStatus::OK).count.should == 1 domain.statuses.include?(DomainStatus::SERVER_HOLD).should == false
domain.statuses.include?(DomainStatus::OK).should == true
domain.reload domain.reload
domain.valid_to.should be_within(5).of(new_valid_to) domain.valid_to.should be_within(5).of(new_valid_to)
@ -2122,7 +2129,7 @@ describe 'EPP Domain', epp: true do
### INFO ### ### INFO ###
it 'returns domain info' do it 'returns domain info' do
domain.domain_statuses.build(value: DomainStatus::CLIENT_HOLD, description: 'Payment overdue.') domain.statuses << DomainStatus::CLIENT_HOLD
domain.nameservers.build(hostname: 'ns1.example.com', ipv4: '192.168.1.1', ipv6: '1080:0:0:0:8:800:200C:417A') domain.nameservers.build(hostname: 'ns1.example.com', ipv4: '192.168.1.1', ipv6: '1080:0:0:0:8:800:200C:417A')
domain.dnskeys.build( domain.dnskeys.build(
@ -2157,7 +2164,6 @@ describe 'EPP Domain', epp: true do
inf_data = response[:parsed].css('resData infData') inf_data = response[:parsed].css('resData infData')
inf_data.css('name').text.should == domain.name inf_data.css('name').text.should == domain.name
inf_data.css('status').text.should == 'Payment overdue.'
inf_data.css('status').first[:s].should == 'clientHold' inf_data.css('status').first[:s].should == 'clientHold'
inf_data.css('registrant').text.should == domain.registrant_code inf_data.css('registrant').text.should == domain.registrant_code
inf_data.css('roid').text.should == domain.roid inf_data.css('roid').text.should == domain.roid
@ -2318,7 +2324,8 @@ describe 'EPP Domain', epp: true do
end end
it 'does not delete domain with specific status' do it 'does not delete domain with specific status' do
domain.domain_statuses.create(value: DomainStatus::CLIENT_DELETE_PROHIBITED) domain.statuses << DomainStatus::CLIENT_DELETE_PROHIBITED
domain.save
response = epp_plain_request(@epp_xml.domain.delete({ response = epp_plain_request(@epp_xml.domain.delete({
name: { value: domain.name } name: { value: domain.name }
@ -2336,7 +2343,8 @@ describe 'EPP Domain', epp: true do
end end
it 'does not delete domain with pending delete' do it 'does not delete domain with pending delete' do
domain.domain_statuses.create(value: DomainStatus::PENDING_DELETE) domain.statuses << DomainStatus::PENDING_DELETE
domain.save
response = epp_plain_request(@epp_xml.domain.delete({ response = epp_plain_request(@epp_xml.domain.delete({
name: { value: domain.name } name: { value: domain.name }

View file

@ -4,6 +4,7 @@ describe 'EPP Helper', epp: true do
context 'in context of Domain' do context 'in context of Domain' do
before(:all) { @uniq_no = proc { @i ||= 0; @i += 1 } } before(:all) { @uniq_no = proc { @i ||= 0; @i += 1 } }
# rubocop: disable Metrics/LineLength
it 'generates valid transfer xml' do it 'generates valid transfer xml' do
dn = next_domain_name dn = next_domain_name
expected = Nokogiri::XML('<?xml version="1.0" encoding="UTF-8" standalone="no"?> expected = Nokogiri::XML('<?xml version="1.0" encoding="UTF-8" standalone="no"?>
@ -11,7 +12,7 @@ describe 'EPP Helper', epp: true do
<command> <command>
<transfer op="query"> <transfer op="query">
<domain:transfer <domain:transfer
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"> xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd">
<domain:name>' + dn + '</domain:name> <domain:name>' + dn + '</domain:name>
<domain:authInfo> <domain:authInfo>
<domain:pw roid="citizen_1234-REP">98oiewslkfkd</domain:pw> <domain:pw roid="citizen_1234-REP">98oiewslkfkd</domain:pw>
@ -31,7 +32,7 @@ describe 'EPP Helper', epp: true do
<command> <command>
<transfer op="approve"> <transfer op="approve">
<domain:transfer <domain:transfer
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"> xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd">
<domain:name>one.ee</domain:name> <domain:name>one.ee</domain:name>
<domain:authInfo> <domain:authInfo>
<domain:pw roid="askdf">test</domain:pw> <domain:pw roid="askdf">test</domain:pw>
@ -53,5 +54,6 @@ describe 'EPP Helper', epp: true do
generated = Nokogiri::XML(xml).to_s.squish generated = Nokogiri::XML(xml).to_s.squish
generated.should == expected generated.should == expected
end end
# rubocop: enable Metrics/LineLength
end end
end end

View file

@ -3,7 +3,7 @@
<command> <command>
<create> <create>
<contact:create <contact:create
xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"> xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
<contact:id>loc_int</contact:id> <contact:id>loc_int</contact:id>
<contact:postalInfo type="int"> <contact:postalInfo type="int">
<contact:name>John Doe Int</contact:name> <contact:name>John Doe Int</contact:name>

View file

@ -3,7 +3,7 @@
<command> <command>
<delete> <delete>
<contact:delete <contact:delete
xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"> xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
<contact:id>dwa1234</contact:id> <contact:id>dwa1234</contact:id>
</contact:delete> </contact:delete>
</delete> </delete>

View file

@ -3,7 +3,7 @@
<command> <command>
<delete> <delete>
<contact:delete <contact:delete
xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"> xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
</contact:delete> </contact:delete>
</delete> </delete>
<clTRID>ABC-12345</clTRID> <clTRID>ABC-12345</clTRID>

View file

@ -3,7 +3,7 @@
<command> <command>
<info> <info>
<contact:info <contact:info
xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"> xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
<contact:id>info-4444</contact:id> <contact:id>info-4444</contact:id>
<contact:authInfo> <contact:authInfo>
<contact:pw>2fooBAR</contact:pw> <contact:pw>2fooBAR</contact:pw>

View file

@ -3,7 +3,7 @@
<command> <command>
<info> <info>
<contact:info <contact:info
xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"> xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
</contact:info> </contact:info>
</info> </info>
<clTRID>ABC-12345</clTRID> <clTRID>ABC-12345</clTRID>

View file

@ -3,7 +3,7 @@
<command> <command>
<update> <update>
<contact:update <contact:update
xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"> xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
<contact:id>sh8013</contact:id> <contact:id>sh8013</contact:id>
<contact:chg> <contact:chg>
<contact:postalInfo type="int"> <contact:postalInfo type="int">

View file

@ -3,7 +3,7 @@
<command> <command>
<update> <update>
<contact:update <contact:update
xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"> xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
</contact:update> </contact:update>
</update> </update>
<clTRID>ABC-12345</clTRID> <clTRID>ABC-12345</clTRID>

View file

@ -3,7 +3,7 @@
<command> <command>
<update> <update>
<contact:update <contact:update
xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"> xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
<contact:id>sh8013</contact:id> <contact:id>sh8013</contact:id>
<contact:chg> <contact:chg>
<contact:voice x="1234">123456798</contact:voice> <contact:voice x="1234">123456798</contact:voice>

View file

@ -41,7 +41,7 @@ describe 'EPP Session', epp: true do
end end
it 'prohibits further actions unless logged in' do it 'prohibits further actions unless logged in' do
@xsd = Nokogiri::XML::Schema(File.read('doc/schemas/domain-1.0.xsd')) @xsd = Nokogiri::XML::Schema(File.read('doc/schemas/domain-eis-1.0.xsd'))
response = epp_plain_request(@epp_xml.domain.info(name: { value: 'test.ee' })) response = epp_plain_request(@epp_xml.domain.info(name: { value: 'test.ee' }))
response[:msg].should == 'You need to login first.' response[:msg].should == 'You need to login first.'
response[:result_code].should == '2002' response[:result_code].should == '2002'
@ -55,6 +55,14 @@ describe 'EPP Session', epp: true do
response[:clTRID].should be_nil response[:clTRID].should be_nil
end end
it 'should return latin only error' do
wrong_user = @epp_xml.session.login(clID: { value: '你好你好' }, pw: { value: 'ghyt9e4fu' })
response = epp_plain_request(wrong_user)
response[:msg].should == 'Parameter value policy error. Allowed only Latin characters.'
response[:result_code].should == '2306'
response[:clTRID].should == 'ABC-12345'
end
context 'with valid user' do context 'with valid user' do
it 'logs in epp user' do it 'logs in epp user' do
response = epp_plain_request(@login_xml_cache) response = epp_plain_request(@login_xml_cache)

View file

@ -22,11 +22,12 @@ feature 'DomainDeleteConfirm', type: :feature do
context 'as unknown user with domain with token' do context 'as unknown user with domain with token' do
before :all do before :all do
@domain = Fabricate( @domain = Fabricate(
:domain, :domain,
registrant_verification_token: '123', registrant_verification_token: '123',
registrant_verification_asked_at: Time.zone.now registrant_verification_asked_at: Time.zone.now
) )
@domain.domain_statuses.create(value: DomainStatus::PENDING_DELETE) @domain.statuses << DomainStatus::PENDING_DELETE
@domain.save
end end
it 'should see warning info if token is missing in request' do it 'should see warning info if token is missing in request' do

View file

@ -22,11 +22,12 @@ feature 'DomainUpdateConfirm', type: :feature do
context 'as unknown user with domain with update token' do context 'as unknown user with domain with update token' do
before :all do before :all do
@domain = Fabricate( @domain = Fabricate(
:domain, :domain,
registrant_verification_token: '123', registrant_verification_token: '123',
registrant_verification_asked_at: Time.zone.now registrant_verification_asked_at: Time.zone.now
) )
@domain.domain_statuses.create(value: DomainStatus::PENDING_UPDATE) @domain.statuses << DomainStatus::PENDING_UPDATE
@domain.save
end end
it 'should see warning info if token is missing in request' do it 'should see warning info if token is missing in request' do

View file

@ -63,7 +63,7 @@ describe BankStatement do
AccountActivity.count.should == 1 AccountActivity.count.should == 1
r.cash_account.balance.should == 240.0 r.cash_account.balance.should == 200.0
bs.bank_transactions.unbinded.count.should == 1 bs.bank_transactions.unbinded.count.should == 1
bs.partially_binded?.should == true bs.partially_binded?.should == true

View file

@ -45,7 +45,7 @@ describe BankTransaction do
bt.bind_invoice(invoice.number) bt.bind_invoice(invoice.number)
invoice.receipt_date.should_not be_blank invoice.receipt_date.should_not be_blank
r.cash_account.balance.should == 240.0 r.cash_account.balance.should == 200.0
end end
it 'should not bind transaction with mismatching sums' do it 'should not bind transaction with mismatching sums' do

View file

@ -96,50 +96,60 @@ describe Domain do
it 'should expire domains' do it 'should expire domains' do
Domain.start_expire_period Domain.start_expire_period
@domain.domain_statuses.where(value: DomainStatus::EXPIRED).count.should == 0 @domain.statuses.include?(DomainStatus::EXPIRED).should == false
@domain.valid_to = Time.zone.now - 10.days @domain.valid_to = Time.zone.now - 10.days
@domain.save @domain.save
Domain.start_expire_period Domain.start_expire_period
@domain.domain_statuses.where(value: DomainStatus::EXPIRED).count.should == 1 @domain.reload
@domain.statuses.include?(DomainStatus::EXPIRED).should == true
Domain.start_expire_period Domain.start_expire_period
@domain.domain_statuses.where(value: DomainStatus::EXPIRED).count.should == 1 @domain.reload
@domain.statuses.include?(DomainStatus::EXPIRED).should == true
end end
it 'should start redemption grace period' do it 'should start redemption grace period' do
Domain.start_redemption_grace_period Domain.start_redemption_grace_period
@domain.domain_statuses.where(value: DomainStatus::SERVER_HOLD).count.should == 0 @domain.reload
@domain.statuses.include?(DomainStatus::SERVER_HOLD).should == false
@domain.outzone_at = Time.zone.now @domain.outzone_at = Time.zone.now
@domain.domain_statuses.create(value: DomainStatus::SERVER_MANUAL_INZONE) # this prohibits server_hold @domain.statuses << DomainStatus::SERVER_MANUAL_INZONE # this prohibits server_hold
@domain.save @domain.save
Domain.start_redemption_grace_period Domain.start_redemption_grace_period
@domain.domain_statuses.where(value: DomainStatus::SERVER_HOLD).count.should == 0 @domain.reload
@domain.statuses.include?(DomainStatus::SERVER_HOLD).should == false
@domain.domain_statuses.destroy_all @domain.statuses = []
@domain.save
Domain.start_redemption_grace_period Domain.start_redemption_grace_period
@domain.domain_statuses.where(value: DomainStatus::SERVER_HOLD).count.should == 1 @domain.reload
@domain.statuses.include?(DomainStatus::SERVER_HOLD).should == true
end end
it 'should start delete period' do it 'should start delete period' do
Domain.start_delete_period Domain.start_delete_period
@domain.domain_statuses.where(value: DomainStatus::DELETE_CANDIDATE).count.should == 0 @domain.reload
@domain.statuses.include?(DomainStatus::DELETE_CANDIDATE).should == false
@domain.delete_at = Time.zone.now @domain.delete_at = Time.zone.now
@domain.domain_statuses.create(value: DomainStatus::SERVER_DELETE_PROHIBITED) # this prohibits delete_candidate @domain.statuses << DomainStatus::SERVER_DELETE_PROHIBITED # this prohibits delete_candidate
@domain.save @domain.save
Domain.start_delete_period Domain.start_delete_period
@domain.domain_statuses.where(value: DomainStatus::DELETE_CANDIDATE).count.should == 0 @domain.reload
@domain.statuses.include?(DomainStatus::DELETE_CANDIDATE).should == false
@domain.domain_statuses.destroy_all @domain.statuses = []
@domain.save
Domain.start_delete_period Domain.start_delete_period
@domain.reload
@domain.domain_statuses.where(value: DomainStatus::DELETE_CANDIDATE).count.should == 1 @domain.statuses.include?(DomainStatus::DELETE_CANDIDATE).should == true
end end
it 'should destroy delete candidates' do it 'should destroy delete candidates' do
@ -159,15 +169,16 @@ describe Domain do
end end
it 'should set force delete time' do it 'should set force delete time' do
@domain.statuses = ['ok']
@domain.set_force_delete @domain.set_force_delete
@domain.domain_statuses.count.should == 6 @domain.statuses.count.should == 6
fda = Time.zone.now + Setting.redemption_grace_period fda = Time.zone.now + Setting.redemption_grace_period.days
@domain.force_delete_at.should be_within(20).of(fda) @domain.force_delete_at.should be_within(20).of(fda)
@domain.unset_force_delete @domain.unset_force_delete
@domain.domain_statuses.count.should == 1 @domain.statuses.count.should == 1
@domain.force_delete_at.should be_nil @domain.force_delete_at.should be_nil
end end
@ -175,7 +186,7 @@ describe Domain do
before :all do before :all do
@domain.registrant_verification_token = 123 @domain.registrant_verification_token = 123
@domain.registrant_verification_asked_at = Time.zone.now @domain.registrant_verification_asked_at = Time.zone.now
@domain.domain_statuses.create(value: DomainStatus::PENDING_UPDATE) @domain.statuses << DomainStatus::PENDING_UPDATE
end end
it 'should be registrant update confirm ready' do it 'should be registrant update confirm ready' do
@ -187,7 +198,7 @@ describe Domain do
end end
it 'should not be registrant update confirm ready when no correct status' do it 'should not be registrant update confirm ready when no correct status' do
@domain.domain_statuses.delete_all @domain.statuses = []
@domain.registrant_update_confirmable?('123').should == false @domain.registrant_update_confirmable?('123').should == false
end end
end end
@ -196,7 +207,7 @@ describe Domain do
before :all do before :all do
@domain.registrant_verification_token = 123 @domain.registrant_verification_token = 123
@domain.registrant_verification_asked_at = Time.zone.now @domain.registrant_verification_asked_at = Time.zone.now
@domain.domain_statuses.create(value: DomainStatus::PENDING_UPDATE) @domain.statuses << DomainStatus::PENDING_UPDATE
end end
it 'should be registrant update confirm ready' do it 'should be registrant update confirm ready' do
@ -208,7 +219,7 @@ describe Domain do
end end
it 'should not be registrant update confirm ready when no correct status' do it 'should not be registrant update confirm ready when no correct status' do
@domain.domain_statuses.delete_all @domain.statuses = []
@domain.registrant_update_confirmable?('123').should == false @domain.registrant_update_confirmable?('123').should == false
end end
end end
@ -441,24 +452,23 @@ describe Domain do
it 'manages statuses automatically' do it 'manages statuses automatically' do
d = Fabricate(:domain) d = Fabricate(:domain)
expect(d.domain_statuses.count).to eq(1) expect(d.statuses.count).to eq(1)
expect(d.domain_statuses.first.value).to eq(DomainStatus::OK) expect(d.statuses.first).to eq(DomainStatus::OK)
d.period = 2 d.period = 2
d.save d.save
d.reload d.reload
expect(d.statuses.count).to eq(1)
expect(d.statuses.first).to eq(DomainStatus::OK)
expect(d.domain_statuses.count).to eq(1) d.statuses << DomainStatus::CLIENT_DELETE_PROHIBITED
expect(d.domain_statuses.first.reload.value).to eq(DomainStatus::OK)
d.domain_statuses.build(value: DomainStatus::CLIENT_DELETE_PROHIBITED)
d.save d.save
d.reload d.reload
expect(d.domain_statuses.count).to eq(1) expect(d.statuses.count).to eq(1)
expect(d.domain_statuses.first.value).to eq(DomainStatus::CLIENT_DELETE_PROHIBITED) expect(d.statuses.first).to eq(DomainStatus::CLIENT_DELETE_PROHIBITED)
end end
with_versioning do with_versioning do

View file

@ -7,6 +7,7 @@ require 'shoulda/matchers'
require 'capybara/poltergeist' require 'capybara/poltergeist'
require 'paper_trail/frameworks/rspec' require 'paper_trail/frameworks/rspec'
PaperTrail.whodunnit = 'autotest' PaperTrail.whodunnit = 'autotest'
require "money-rails/test_helpers"
if ENV['ROBOT'] if ENV['ROBOT']
require 'simplecov' require 'simplecov'