diff --git a/.rubocop.yml b/.rubocop.yml index b1ceb5312..e28a5b39b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,6 +5,7 @@ AllCops: - 'Guardfile' # stuff generated by AR and rails - 'db/schema.rb' + - 'db/schema-read-only.rb' - 'db/whois_schema.rb' - 'db/api_log_schema.rb' - 'db/migrate/*' @@ -60,6 +61,11 @@ Style/NilComparison: Exclude: - 'spec/**/*' +# let's save space in spec +Style/AlignHash: + Exclude: + - 'spec/**/*' + # No need to force reduce to use |a, e| as parameters. # Configuration parameters: Methods. Style/SingleLineBlockParams: @@ -90,3 +96,27 @@ Style/NumericLiterals: # Too often suggest wrong syntax in subarray, this should be fix in rubocop first Style/WordArray: Enabled: false + +# Ok to use parallel assigment such as: var1, var2 = [], [] +Style/ParallelAssignment: + Enabled: false + +# not working perfectly or not important enough to care +Style/EmptyLinesAroundBlockBody: + Enabled: false + +# The ABC size is a calculated magnitude, so this number can be a Fixnum or a Float. +Metrics/AbcSize: + Max: 35 + +# Very strange intention requirement, disabled for now +Style/FirstParameterIndentation: + Enabled: false + +# old school regex // works fine +Style/RegexpLiteral: + Enabled: false + +# annoying to maintain, small thing, no real problem +Style/SpaceInsideHashLiteralBraces: + Enabled: false diff --git a/.spring.rb b/.spring.rb new file mode 100644 index 000000000..48b5ff783 --- /dev/null +++ b/.spring.rb @@ -0,0 +1,2 @@ +Spring.watch 'config/application.yml' +eee diff --git a/.travis.yml b/.travis.yml index 2dd3a99b2..1025db403 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,6 @@ before_script: - cp config/database-travis.yml config/database.yml - RAILS_ENV=test bundle exec rake db:all:drop - RAILS_ENV=test bundle exec rake db:all:setup - - RAILS_ENV=test bundle exec rake zonefile:replace_procedure script: - RAILS_ENV=test bundle exec rake cache: bundler diff --git a/CHANGELOG.md b/CHANGELOG.md index f700d1b1f..e59ffa327 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,22 @@ +14.07.2015 + +* Updated que init script doc example, now status and stop works faster +* Updated registry server cronjob with mina cron:setup + +07.07.2015 + +* Before applyling 20150707104937_refactor_reserved_domains.rb migration, enable hstore extension in db + +01.07.2015 + +* Added que init script example at doc/que directory, please setup que accornding to doc/que/README.md + +26.06.2015 + +* Added new relic license key ta application-example.yml, please update application.yml + 22.06.2015 + * Update zonefile 16.06.2015 diff --git a/Gemfile b/Gemfile index e040fcac8..921074895 100644 --- a/Gemfile +++ b/Gemfile @@ -1,18 +1,27 @@ +# Use https only for accessing github +# https://github.com/bundler/bundler/pull/3447 +git_source(:github) do |repo_name| + repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") + "https://github.com/#{repo_name}.git" +end if Bundler::VERSION < '2' + source 'https://rubygems.org' # core -gem 'rails', '4.2.1' +gem 'rails', '4.2.3' gem 'iso8601', '~> 0.8.2' # for dates and times gem 'hashie-forbidden_attributes', '~> 0.1.1' # load env -gem 'figaro', '~> 1.1.0' +gem 'figaro', '~> 1.1.1' # model related gem 'pg', '~> 0.18.0' gem 'ransack', '~> 1.5.1' # for searching # with polymorphic fix -gem 'paper_trail', github: 'airblade/paper_trail', ref: 'a453811226ec4ea59753ba6b827e390ced2fc140' +gem 'paper_trail', + github: 'airblade/paper_trail', + ref: 'a453811226ec4ea59753ba6b827e390ced2fc140' gem 'rails-settings-cached', '~> 0.4.1' # for settings # html-xml @@ -21,7 +30,7 @@ gem 'nokogiri', '~> 1.6.6.2' # For XML parsing # style gem 'sass-rails', '~> 5.0.3' # sass style -gem 'bootstrap-sass', '~> 3.3.4.1' # bootstrap style +gem 'bootstrap-sass', '~> 3.3.5.1' # bootstrap style # js gem 'uglifier', '~> 2.7.1' # minifies js @@ -41,11 +50,11 @@ gem 'select2-rails', '~> 3.5.9.3' # for autocomplete gem 'bootstrap-datepicker-rails', '~> 1.3.1.1' # datepicker # rights -gem 'devise', '~> 3.4.1' # authenitcation -gem 'cancancan', '~> 1.9.2' # autharization +gem 'devise', '~> 3.5.1' # authenitcation +gem 'cancancan', '~> 1.11.0' # autharization # rest api -gem 'grape', '~> 0.10.1' +gem 'grape', '~> 0.12.0' gem 'jbuilder', '~> 2.2.6' # json api # registry specfic @@ -60,10 +69,10 @@ gem 'data_migrate', ref: '35d22b09ff37a4e9d61ab326ad5d8eb0edf1fc81' # monitors -gem 'newrelic_rpm', '~> 3.9.9.275' +gem 'newrelic_rpm', '~> 3.12.0.288' # country listing -gem 'countries', '~> 0.10.0' +gem 'countries', '~> 0.11.4' # cloning activerecord objects gem 'deep_cloneable', '~> 2.1.1' @@ -77,8 +86,9 @@ gem 'epp-xml', '~> 1.0.3' # EIS EPP XMLs 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' +gem 'que', '~> 0.10.0' +gem 'que-web', '~> 0.4.0' +gem 'daemons-rails', '~> 1.2.1' # for importing legacy db gem 'activerecord-import', '~> 0.7.0' # for inserting dummy data @@ -91,18 +101,22 @@ gem 'jquery-ui-rails', '~> 5.0.3' group :development do # dev tools - gem 'spring', '~> 1.3.3' + gem 'spring', '~> 1.3.6' gem 'spring-commands-rspec', '~> 1.0.4' - gem 'guard', '~> 2.6.1' # run tests automatically - gem 'guard-rspec', '~> 4.3.1' - gem 'guard-rails', '~> 0.7.0' # run EPP server automatically - gem 'rubocop', '~> 0.26.1' - gem 'guard-rubocop', '~> 1.1.0' + # emits errors, needs more investigation + # gem 'spring-watcher-listen', # otherwise spring polls the filesystem on every 0.2 seconds + # github: 'jonleighton/spring-watcher-listen', + # ref: '7f6003e14f8f9ca178a5194f210c07f54cfb67ec' + gem 'guard', '~> 2.12.6' # run tests automatically + gem 'guard-rspec', '~> 4.5.2' + gem 'guard-rails', '~> 0.7.1' # run EPP server automatically + gem 'rubocop', '~> 0.32.1' + gem 'guard-rubocop', '~> 1.2.0' # improved errors - gem 'better_errors', '~> 2.0.0' + gem 'better_errors', '~> 2.1.1' # webconsole replacement gem 'binding_of_caller', '~> 0.7.2' - gem 'traceroute', '~> 0.4.0' # for finding dead routes and unused actions + gem 'traceroute', '~> 0.5.0' # for finding dead routes and unused actions # deploy gem 'mina', '~> 0.3.1' # for fast deployment @@ -110,30 +124,33 @@ end group :development, :test do # test stack - gem 'rspec-rails', '~> 3.0.2' + gem 'rspec-rails', '~> 3.3.2' gem 'capybara', '~> 2.4.1' gem 'phantomjs-binaries', '~> 1.9.2.4' - gem 'poltergeist', '~> 1.5.1' # We are using PhantomJS instead - gem 'phantomjs', '~> 1.9.7.1' - gem 'fabrication', '~> 2.12.2' # Replacement for fixtures - gem 'shoulda-matchers', '~> 2.6.1', require: false # Additional matchers for RSpec + gem 'poltergeist', '~> 1.6.0' # We are using PhantomJS instead + gem 'phantomjs', '~> 1.9.8.0' + gem 'fabrication', '~> 2.13.2' # Replacement for fixtures + gem 'shoulda-matchers', '~> 2.8.0', require: false # Additional matchers for RSpec gem 'launchy', '~> 2.4.3' # for opening browser automatically # helper gems - gem 'database_cleaner', '~> 1.3.0' # For cleaning db in feature and epp tests - gem 'faker', '~> 1.3.0' # Library to generate fake data + gem 'database_cleaner', '~> 1.4.1' # For cleaning db in feature and epp tests + gem 'faker', '~> 1.4.3' # Library to generate fake data # debug gem 'pry', '~> 0.10.1' # code review - gem 'simplecov', '~> 0.9.1', require: false - gem 'rubycritic', '~> 1.1.1' + gem 'simplecov', '~> 0.10.0', require: false + gem 'rubycritic', '~> 1.4.0' gem 'bullet', '~> 4.14.4' # for finding database optimizations - gem 'bundler-audit', '~> 0.3.1' # for finding future vulnerable gems - gem 'brakeman', '~> 2.6.2', require: false # for security audit' + gem 'bundler-audit', + github: 'rubysec/bundler-audit', + ref: 'f89ef7fae1090bbad825ea76812d56d72b417055' # for finding future vulnerable gems + gem 'brakeman', '~> 3.0.5', require: false # for security audit' # tmp, otherwise conflics with breakman - gem 'html2haml', github: 'haml/html2haml', ref: '6984f50bdbbd6291535027726a5697f28778ee8d' + # gem 'html2haml', github: 'haml/html2haml', ref: '6984f50bdbbd6291535027726a5697f28778ee8d' + gem 'html2haml', '~> 2.0.0' gem 'sdoc', '~> 0.4.0' # bundle exec rake doc:rails generates the API under doc/api. gem 'railroady', '~> 1.3.0' # to generate database diagrams @@ -143,5 +160,5 @@ group :development, :test do # for travis gem 'rake' - gem "autodoc" + gem 'autodoc' end diff --git a/Gemfile.lock b/Gemfile.lock index 463b6afad..b6ac5c808 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,5 +1,5 @@ GIT - remote: git://github.com/airblade/paper_trail.git + remote: https://github.com/airblade/paper_trail.git revision: a453811226ec4ea59753ba6b827e390ced2fc140 ref: a453811226ec4ea59753ba6b827e390ced2fc140 specs: @@ -9,7 +9,7 @@ GIT request_store (~> 1.1.0) GIT - remote: git://github.com/gitlabeu/data_migrate.git + remote: https://github.com/gitlabeu/data_migrate.git revision: 35d22b09ff37a4e9d61ab326ad5d8eb0edf1fc81 ref: 35d22b09ff37a4e9d61ab326ad5d8eb0edf1fc81 specs: @@ -17,64 +17,66 @@ GIT rails (>= 4.1.0) GIT - remote: git://github.com/haml/html2haml.git - revision: 6984f50bdbbd6291535027726a5697f28778ee8d - ref: 6984f50bdbbd6291535027726a5697f28778ee8d - specs: - html2haml (2.0.0.beta.2) - erubis (~> 2.7.0) - haml (~> 4.0.0) - nokogiri (~> 1.6.0) - ruby_parser (~> 3.5) - -GIT - remote: git://github.com/internetee/epp.git + remote: https://github.com/internetee/epp.git revision: 505c3f2739eb1da918e54111aecfb138a822739d specs: epp (1.4.2) hpricot libxml-ruby +GIT + remote: https://github.com/rubysec/bundler-audit.git + revision: f89ef7fae1090bbad825ea76812d56d72b417055 + ref: f89ef7fae1090bbad825ea76812d56d72b417055 + specs: + bundler-audit (0.4.0) + bundler (~> 1.2) + thor (~> 0.18) + GEM remote: https://rubygems.org/ specs: - actionmailer (4.2.1) - actionpack (= 4.2.1) - actionview (= 4.2.1) - activejob (= 4.2.1) + abstract_type (0.0.7) + actionmailer (4.2.3) + actionpack (= 4.2.3) + actionview (= 4.2.3) + activejob (= 4.2.3) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.1) - actionview (= 4.2.1) - activesupport (= 4.2.1) + actionpack (4.2.3) + actionview (= 4.2.3) + activesupport (= 4.2.3) rack (~> 1.6) rack-test (~> 0.6.2) rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.1) - actionview (4.2.1) - activesupport (= 4.2.1) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (4.2.3) + activesupport (= 4.2.3) builder (~> 3.1) erubis (~> 2.7.0) rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.1) - activejob (4.2.1) - activesupport (= 4.2.1) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + activejob (4.2.3) + activesupport (= 4.2.3) globalid (>= 0.3.0) - activemodel (4.2.1) - activesupport (= 4.2.1) + activemodel (4.2.3) + activesupport (= 4.2.3) builder (~> 3.1) - activerecord (4.2.1) - activemodel (= 4.2.1) - activesupport (= 4.2.1) + activerecord (4.2.3) + activemodel (= 4.2.3) + activesupport (= 4.2.3) arel (~> 6.0) activerecord-import (0.7.0) activerecord (>= 3.0) - activesupport (4.2.1) + activesupport (4.2.3) i18n (~> 0.7) json (~> 1.7, >= 1.7.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) + adamantium (0.2.0) + ice_nine (~> 0.11.0) + memoizable (~> 0.4.0) addressable (2.3.8) akami (1.3.1) gyoku (>= 0.4.0) @@ -87,7 +89,7 @@ GEM actionpack activesupport (>= 3.0.0) rspec - autoprefixer-rails (5.2.0.1) + autoprefixer-rails (5.2.1) execjs json axiom-types (0.1.1) @@ -95,7 +97,7 @@ GEM ice_nine (~> 0.11.0) thread_safe (~> 0.3, >= 0.3.1) bcrypt (3.1.10) - better_errors (2.0.0) + better_errors (2.1.1) coderay (>= 1.0.0) erubis (>= 2.6.6) rack (>= 0.9.0) @@ -103,28 +105,24 @@ GEM debug_inspector (>= 0.0.1) bootstrap-datepicker-rails (1.3.1.1) railties (>= 3.0) - bootstrap-sass (3.3.4.1) + bootstrap-sass (3.3.5.1) autoprefixer-rails (>= 5.0.0.1) - sass (>= 3.2.19) - brakeman (2.6.3) + sass (>= 3.3.0) + brakeman (3.0.5) erubis (~> 2.6) fastercsv (~> 1.5) haml (>= 3.0, < 5.0) highline (~> 1.6.20) multi_json (~> 1.2) ruby2ruby (~> 2.1.1) - ruby_parser (~> 3.5.0) + ruby_parser (~> 3.7.0) sass (~> 3.0) - slim (>= 1.3.6, < 3.0) terminal-table (~> 1.4) builder (3.2.2) bullet (4.14.7) activesupport (>= 3.0.0) uniform_notifier (~> 1.9.0) - bundler-audit (0.3.1) - bundler (~> 1.2) - thor (~> 0.18) - cancancan (1.9.2) + cancancan (1.11.0) capybara (2.4.4) mime-types (>= 1.16) nokogiri (>= 1.3.3) @@ -145,18 +143,26 @@ GEM coffee-script-source execjs coffee-script-source (1.9.1.1) - countries (0.10.0) + concord (0.1.5) + adamantium (~> 0.2.0) + equalizer (~> 0.0.9) + countries (0.11.4) currencies (~> 0.4.2) + i18n_data (~> 0.7.0) crack (0.4.2) safe_yaml (~> 1.0.0) currencies (0.4.2) - database_cleaner (1.3.0) + daemons (1.2.3) + daemons-rails (1.2.1) + daemons + multi_json (~> 1.0) + database_cleaner (1.4.1) debug_inspector (0.0.2) deep_cloneable (2.1.1) activerecord (>= 3.1.0, < 5.0.0) descendants_tracker (0.0.4) thread_safe (~> 0.3, >= 0.3.1) - devise (3.4.1) + devise (3.5.1) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 3.2.6, < 5) @@ -177,11 +183,11 @@ GEM equalizer (0.0.11) erubis (2.7.0) execjs (2.5.2) - fabrication (2.12.2) - faker (1.3.0) + fabrication (2.13.2) + faker (1.4.3) i18n (~> 0.5) fastercsv (1.5.5) - ffi (1.9.8) + ffi (1.9.9) figaro (1.1.1) thor (~> 0.14) flay (2.4.0) @@ -193,7 +199,7 @@ GEM formatador (0.2.5) globalid (0.3.5) activesupport (>= 4.1.0) - grape (0.10.1) + grape (0.12.0) activesupport builder hashie (>= 2.1.0) @@ -203,18 +209,24 @@ GEM rack-accept rack-mount virtus (>= 1.0.0) - guard (2.6.1) + guard (2.12.7) formatador (>= 0.2.4) - listen (~> 2.7) + listen (>= 2.7, <= 4.0) lumberjack (~> 1.0) + nenv (~> 0.1) + notiffany (~> 0.0) pry (>= 0.9.12) + shellany (~> 0.0) thor (>= 0.18.1) - guard-rails (0.7.0) - guard (~> 2.0) - guard-rspec (4.3.1) + guard-compat (1.2.1) + guard-rails (0.7.1) + guard (~> 2.11) + guard-compat (~> 1.0) + guard-rspec (4.5.2) guard (~> 2.1) - rspec (>= 2.14, < 4.0) - guard-rubocop (1.1.0) + guard-compat (~> 1.1) + rspec (>= 2.99.0, < 4.0) + guard-rubocop (1.2.0) guard (~> 2.0) rubocop (~> 0.20) gyoku (1.3.1) @@ -233,11 +245,17 @@ GEM highline (1.6.21) hitimes (1.2.2) hpricot (0.8.6) - html5_validators (1.2.0) + html2haml (2.0.0) + erubis (~> 2.7.0) + haml (~> 4.0.0) + nokogiri (~> 1.6.0) + ruby_parser (~> 3.5) + html5_validators (1.2.1) httpclient (2.6.0.1) httpi (2.4.1) rack i18n (0.7.0) + i18n_data (0.7.0) ice_nine (0.11.1) isikukood (0.1.2) iso8601 (0.8.6) @@ -260,7 +278,7 @@ GEM kgio (2.9.3) launchy (2.4.3) addressable (~> 2.3) - libv8 (3.16.14.7) + libv8 (3.16.14.8) libxml-ruby (2.8.0) listen (2.10.1) celluloid (~> 0.16.0) @@ -271,6 +289,8 @@ GEM lumberjack (1.0.9) mail (2.6.3) mime-types (>= 1.16, < 3) + memoizable (0.4.2) + thread_safe (~> 0.3, >= 0.3.1) method_source (0.8.2) mime-types (2.6.1) mina (0.3.4) @@ -289,28 +309,33 @@ GEM railties (>= 3.0) multi_json (1.11.1) multi_xml (0.5.5) - newrelic_rpm (3.9.9.275) + nenv (0.2.0) + newrelic_rpm (3.12.0.288) nokogiri (1.6.6.2) mini_portile (~> 0.6.0) nori (2.6.0) + notiffany (0.0.6) + nenv (~> 0.1) + shellany (~> 0.0) nprogress-rails (0.1.6.7) open4 (1.3.4) orm_adapter (0.5.0) - parser (2.3.0.pre.2) + parser (2.2.2.5) ast (>= 1.1, < 3.0) pdfkit (0.6.2) pg (0.18.2) - phantomjs (1.9.7.1) + phantomjs (1.9.8.0) phantomjs-binaries (1.9.2.4) sys-uname (= 0.9.0) - poltergeist (1.5.1) + poltergeist (1.6.0) capybara (~> 2.1) cliver (~> 0.3.1) multi_json (~> 1.0) websocket-driver (>= 0.2.0) polyamorous (1.2.0) activerecord (>= 3.0) - powerpack (0.0.9) + powerpack (0.1.1) + procto (0.0.2) pry (0.10.1) coderay (~> 1.1.0) method_source (~> 0.8.1) @@ -330,16 +355,16 @@ GEM rack-test (0.6.3) rack (>= 1.0) railroady (1.3.0) - rails (4.2.1) - actionmailer (= 4.2.1) - actionpack (= 4.2.1) - actionview (= 4.2.1) - activejob (= 4.2.1) - activemodel (= 4.2.1) - activerecord (= 4.2.1) - activesupport (= 4.2.1) + rails (4.2.3) + actionmailer (= 4.2.3) + actionpack (= 4.2.3) + actionview (= 4.2.3) + activejob (= 4.2.3) + activemodel (= 4.2.3) + activerecord (= 4.2.3) + activesupport (= 4.2.3) bundler (>= 1.3.0, < 2.0) - railties (= 4.2.1) + railties (= 4.2.3) sprockets-rails rails-deprecated_sanitizer (1.0.3) activesupport (>= 4.2.0.alpha) @@ -351,13 +376,13 @@ GEM loofah (~> 2.0) rails-settings-cached (0.4.1) rails (>= 4.0.0) - railties (4.2.1) - actionpack (= 4.2.1) - activesupport (= 4.2.1) + railties (4.2.3) + actionpack (= 4.2.3) + activesupport (= 4.2.3) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rainbow (2.0.0) - raindrops (0.13.0) + raindrops (0.14.0) rake (10.4.2) ransack (1.5.1) actionpack (>= 3.0) @@ -369,56 +394,55 @@ GEM rb-inotify (0.9.5) ffi (>= 0.5.0) rdoc (4.2.0) - reek (1.3.8) + reek (1.6.5) + parser (~> 2.2.0.pre.7) rainbow (>= 1.99, < 3.0) - ruby2ruby (>= 2.0.8, < 3.0) - ruby_parser (~> 3.3) - sexp_processor + unparser (~> 0.2.2) ref (1.0.5) request_store (1.1.0) responders (2.1.0) railties (>= 4.2.0, < 5) - rspec (3.0.0) - rspec-core (~> 3.0.0) - rspec-expectations (~> 3.0.0) - rspec-mocks (~> 3.0.0) - rspec-core (3.0.4) - rspec-support (~> 3.0.0) - rspec-expectations (3.0.4) + rspec (3.3.0) + rspec-core (~> 3.3.0) + rspec-expectations (~> 3.3.0) + rspec-mocks (~> 3.3.0) + rspec-core (3.3.1) + rspec-support (~> 3.3.0) + rspec-expectations (3.3.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.0.0) - rspec-mocks (3.0.4) - rspec-support (~> 3.0.0) - rspec-rails (3.0.2) - actionpack (>= 3.0) - activesupport (>= 3.0) - railties (>= 3.0) - rspec-core (~> 3.0.0) - rspec-expectations (~> 3.0.0) - rspec-mocks (~> 3.0.0) - rspec-support (~> 3.0.0) - rspec-support (3.0.4) - rubocop (0.26.1) + rspec-support (~> 3.3.0) + rspec-mocks (3.3.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.3.0) + rspec-rails (3.3.2) + actionpack (>= 3.0, < 4.3) + activesupport (>= 3.0, < 4.3) + railties (>= 3.0, < 4.3) + rspec-core (~> 3.3.0) + rspec-expectations (~> 3.3.0) + rspec-mocks (~> 3.3.0) + rspec-support (~> 3.3.0) + rspec-support (3.3.0) + rubocop (0.32.1) astrolabe (~> 1.3) - parser (>= 2.2.0.pre.4, < 3.0) - powerpack (~> 0.0.6) + parser (>= 2.2.2.5, < 3.0) + powerpack (~> 0.1) rainbow (>= 1.99.1, < 3.0) ruby-progressbar (~> 1.4) ruby-progressbar (1.7.5) ruby2ruby (2.1.4) ruby_parser (~> 3.1) sexp_processor (~> 4.0) - ruby_parser (3.5.0) + ruby_parser (3.7.0) sexp_processor (~> 4.1) - rubycritic (1.1.1) + rubycritic (1.4.0) flay (= 2.4.0) flog (= 4.2.1) - parser (~> 2.1) - reek (= 1.3.8) - ruby2ruby (>= 2.1.1, < 3.0) + parser (>= 2.2.0, < 3.0) + reek (= 1.6.5) virtus (~> 1.0) safe_yaml (1.0.4) - sass (3.4.14) + sass (3.4.15) sass-rails (5.0.3) railties (>= 4.0.0, < 5.0) sass (~> 3.1) @@ -440,35 +464,32 @@ GEM thor (~> 0.14) selectize-rails (0.12.1) sexp_processor (4.6.0) - shoulda-matchers (2.6.2) + shellany (0.0.1) + shoulda-matchers (2.8.0) activesupport (>= 3.0.0) - simplecov (0.9.2) + simplecov (0.10.0) docile (~> 1.1.0) - multi_json (~> 1.0) - simplecov-html (~> 0.9.0) - simplecov-html (0.9.0) + json (~> 1.8) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.0) simpleidn (0.0.5) sinatra (1.4.6) rack (~> 1.4) rack-protection (~> 1.4) tilt (>= 1.3, < 3) - slim (2.1.0) - temple (~> 0.6.9) - tilt (>= 1.3.3, < 2.1) slop (3.6.0) spring (1.3.6) spring-commands-rspec (1.0.4) spring (>= 0.9.1) sprockets (3.2.0) rack (~> 1.0) - sprockets-rails (2.3.1) + sprockets-rails (2.3.2) actionpack (>= 3.0) activesupport (>= 3.0) sprockets (>= 2.8, < 4.0) sys-uname (0.9.0) ffi (>= 1.0.0) - temple (0.6.10) - terminal-table (1.4.5) + terminal-table (1.5.2) therubyracer (0.12.2) libv8 (~> 3.16.14.0) ref @@ -477,7 +498,7 @@ GEM tilt (1.4.1) timers (4.0.1) hitimes - traceroute (0.4.0) + traceroute (0.5.0) rails (>= 3.0.0) turbolinks (2.5.3) coffee-rails @@ -491,6 +512,14 @@ GEM rack raindrops (~> 0.7) uniform_notifier (1.9.0) + unparser (0.2.4) + abstract_type (~> 0.0.7) + adamantium (~> 0.2.0) + concord (~> 0.1.5) + diff-lcs (~> 1.2.5) + equalizer (~> 0.0.9) + parser (~> 2.2.2) + procto (~> 0.0.2) uuidtools (2.1.5) virtus (1.0.5) axiom-types (~> 0.1) @@ -516,36 +545,37 @@ PLATFORMS DEPENDENCIES activerecord-import (~> 0.7.0) autodoc - better_errors (~> 2.0.0) + better_errors (~> 2.1.1) binding_of_caller (~> 0.7.2) bootstrap-datepicker-rails (~> 1.3.1.1) - bootstrap-sass (~> 3.3.4.1) - brakeman (~> 2.6.2) + bootstrap-sass (~> 3.3.5.1) + brakeman (~> 3.0.5) bullet (~> 4.14.4) - bundler-audit (~> 0.3.1) - cancancan (~> 1.9.2) + bundler-audit! + cancancan (~> 1.11.0) capybara (~> 2.4.1) coderay (~> 1.1.0) coffee-rails (~> 4.1.0) - countries (~> 0.10.0) + countries (~> 0.11.4) + daemons-rails (~> 1.2.1) data_migrate! - database_cleaner (~> 1.3.0) + database_cleaner (~> 1.4.1) deep_cloneable (~> 2.1.1) - devise (~> 3.4.1) + devise (~> 3.5.1) digidoc_client (~> 0.2.1) epp (~> 1.4.2)! epp-xml (~> 1.0.3) - fabrication (~> 2.12.2) - faker (~> 1.3.0) - figaro (~> 1.1.0) - grape (~> 0.10.1) - guard (~> 2.6.1) - guard-rails (~> 0.7.0) - guard-rspec (~> 4.3.1) - guard-rubocop (~> 1.1.0) + fabrication (~> 2.13.2) + faker (~> 1.4.3) + figaro (~> 1.1.1) + grape (~> 0.12.0) + guard (~> 2.12.6) + guard-rails (~> 0.7.1) + guard-rspec (~> 4.5.2) + guard-rubocop (~> 1.2.0) haml-rails (~> 0.9.0) hashie-forbidden_attributes (~> 0.1.1) - html2haml! + html2haml (~> 2.0.0) html5_validators (~> 1.2.0) isikukood iso8601 (~> 0.8.2) @@ -557,37 +587,37 @@ DEPENDENCIES launchy (~> 2.4.3) mina (~> 0.3.1) money-rails (~> 1.4.1) - newrelic_rpm (~> 3.9.9.275) + newrelic_rpm (~> 3.12.0.288) nokogiri (~> 1.6.6.2) nprogress-rails (~> 0.1.6.7) paper_trail! pdfkit (~> 0.6.2) pg (~> 0.18.0) - phantomjs (~> 1.9.7.1) + phantomjs (~> 1.9.8.0) phantomjs-binaries (~> 1.9.2.4) - poltergeist (~> 1.5.1) + poltergeist (~> 1.6.0) pry (~> 0.10.1) que (~> 0.10.0) que-web (~> 0.4.0) railroady (~> 1.3.0) - rails (= 4.2.1) + rails (= 4.2.3) rails-settings-cached (~> 0.4.1) rake ransack (~> 1.5.1) - rspec-rails (~> 3.0.2) - rubocop (~> 0.26.1) - rubycritic (~> 1.1.1) + rspec-rails (~> 3.3.2) + rubocop (~> 0.32.1) + rubycritic (~> 1.4.0) sass-rails (~> 5.0.3) sdoc (~> 0.4.0) select2-rails (~> 3.5.9.3) selectize-rails (~> 0.12.1) - shoulda-matchers (~> 2.6.1) - simplecov (~> 0.9.1) + shoulda-matchers (~> 2.8.0) + simplecov (~> 0.10.0) simpleidn (~> 0.0.5) - spring (~> 1.3.3) + spring (~> 1.3.6) spring-commands-rspec (~> 1.0.4) therubyracer (~> 0.12.2) - traceroute (~> 0.4.0) + traceroute (~> 0.5.0) turbolinks (~> 2.5.3) uglifier (~> 2.7.1) unicorn diff --git a/README.md b/README.md index 01276c1e0..1af56f5e9 100644 --- a/README.md +++ b/README.md @@ -398,7 +398,7 @@ sudo apt-get install libxext-dev libxrender1 fontconfig ### Deployment * [Application build and update](/doc/application_build_doc.md) - +* [Registry que server](/doc/que/README.md) ### Autotesting diff --git a/app/controllers/admin/bank_statements_controller.rb b/app/controllers/admin/bank_statements_controller.rb index b667d0fb6..1e69aa1af 100644 --- a/app/controllers/admin/bank_statements_controller.rb +++ b/app/controllers/admin/bank_statements_controller.rb @@ -22,6 +22,22 @@ class Admin::BankStatementsController < AdminController def create @bank_statement = BankStatement.new(bank_statement_params) + if @bank_statement.save + flash[:notice] = I18n.t('record_created') + redirect_to [:admin, @bank_statement] + else + flash.now[:alert] = I18n.t('failed_to_create_record') + render 'new' + end + end + + def import + @bank_statement = BankStatement.new + end + + def create_from_import + @bank_statement = BankStatement.new(bank_statement_params) + if @bank_statement.import flash[:notice] = I18n.t('record_created') redirect_to [:admin, @bank_statement] @@ -53,6 +69,6 @@ class Admin::BankStatementsController < AdminController end def bank_statement_params - params.require(:bank_statement).permit(:th6_file) + params.require(:bank_statement).permit(:th6_file, :bank_code, :iban) end end diff --git a/app/controllers/admin/bank_transactions_controller.rb b/app/controllers/admin/bank_transactions_controller.rb index ca1da48a8..1aaf452a8 100644 --- a/app/controllers/admin/bank_transactions_controller.rb +++ b/app/controllers/admin/bank_transactions_controller.rb @@ -1,6 +1,25 @@ class Admin::BankTransactionsController < AdminController load_and_authorize_resource + def new + @bank_statement = BankStatement.find(params[:bank_statement_id]) + @bank_transaction = BankTransaction.new(currency: 'EUR') + end + + def create + @bank_transaction = BankTransaction.new( + bank_transaction_params.merge(bank_statement_id: params[:bank_statement_id]) + ) + + if @bank_transaction.save + flash[:notice] = I18n.t('record_created') + redirect_to [:admin, @bank_transaction] + else + flash.now[:alert] = I18n.t('failed_to_create_record') + render 'new' + end + end + def update if @bank_transaction.update(bank_transaction_params) flash[:notice] = I18n.t('record_updated') @@ -24,6 +43,10 @@ class Admin::BankTransactionsController < AdminController private def bank_transaction_params - params.require(:bank_transaction).permit(:description, :sum, :reference_no) + params.require(:bank_transaction).permit( + :description, :sum, :reference_no, :document_no, + :bank_reference, :iban, :buyer_bank_code, :buyer_iban, + :buyer_name, :currency, :paid_at + ) end end diff --git a/app/controllers/admin/blocked_domains_controller.rb b/app/controllers/admin/blocked_domains_controller.rb new file mode 100644 index 000000000..2df3f90d9 --- /dev/null +++ b/app/controllers/admin/blocked_domains_controller.rb @@ -0,0 +1,23 @@ +class Admin::BlockedDomainsController < AdminController + load_and_authorize_resource + + def index + bd = BlockedDomain.first_or_initialize + @blocked_domains = bd.names.join("\n") + end + + def create + names = params[:blocked_domains].split("\r\n").map(&:strip) + + bd = BlockedDomain.first_or_create + + if bd.update(names: names) + flash[:notice] = I18n.t('record_updated') + redirect_to :back + else + @blocked_domains = params[:blocked_domains] + flash.now[:alert] = I18n.t('failed_to_update_record') + render :index + end + end +end diff --git a/app/controllers/admin/invoices_controller.rb b/app/controllers/admin/invoices_controller.rb index fdbe80070..39d4e805c 100644 --- a/app/controllers/admin/invoices_controller.rb +++ b/app/controllers/admin/invoices_controller.rb @@ -1,6 +1,26 @@ class Admin::InvoicesController < AdminController load_and_authorize_resource + before_action :set_invoice, only: [:forward, :download_pdf] + + def new + @deposit = Deposit.new + end + + def create + r = Registrar.find_by(id: deposit_params[:registrar_id]) + @deposit = Deposit.new(deposit_params.merge(registrar: r)) + @invoice = @deposit.issue_prepayment_invoice + + if @invoice.persisted? + flash[:notice] = t(:record_created) + redirect_to [:admin, @invoice] + else + flash[:alert] = t(:failed_to_create_record) + render 'new' + end + end + def index @q = Invoice.includes(:account_activity).search(params[:q]) @q.sorts = 'id desc' if @q.sorts.empty? @@ -20,4 +40,34 @@ class Admin::InvoicesController < AdminController render :show end end + + def forward + @invoice.billing_email = @invoice.buyer.billing_email + + return unless request.post? + + @invoice.billing_email = params[:invoice][:billing_email] + + if @invoice.forward(render_to_string('registrar/invoices/pdf', layout: false)) + flash[:notice] = t(:invoice_forwared) + redirect_to([:admin, @invoice]) + else + flash.now[:alert] = t(:failed_to_forward_invoice) + end + end + + def download_pdf + pdf = @invoice.pdf(render_to_string('registrar/invoices/pdf', layout: false)) + send_data pdf, filename: @invoice.pdf_name + end + + private + + def deposit_params + params.require(:deposit).permit(:amount, :description, :registrar_id) + end + + def set_invoice + @invoice = Invoice.find(params[:invoice_id]) + end end diff --git a/app/controllers/admin/pricelists_controller.rb b/app/controllers/admin/pricelists_controller.rb index f17b877fd..200d27e48 100644 --- a/app/controllers/admin/pricelists_controller.rb +++ b/app/controllers/admin/pricelists_controller.rb @@ -32,6 +32,11 @@ class Admin::PricelistsController < AdminController end end + def destroy + @pricelist.destroy + redirect_to admin_pricelists_url + end + private def set_pricelist diff --git a/app/controllers/admin/reserved_domains_controller.rb b/app/controllers/admin/reserved_domains_controller.rb new file mode 100644 index 000000000..eb3a5faae --- /dev/null +++ b/app/controllers/admin/reserved_domains_controller.rb @@ -0,0 +1,30 @@ +class Admin::ReservedDomainsController < AdminController + load_and_authorize_resource + + def index + rd = ReservedDomain.first_or_initialize + @reserved_domains = rd.names.to_yaml + end + + def create + @reserved_domains = params[:reserved_domains] + + begin + names = YAML.load(params[:reserved_domains]) + rescue + flash.now[:alert] = I18n.t('invalid_yaml') + logger.warn 'Invalid YAML' + render :index and return + end + + rd = ReservedDomain.first_or_create + + if rd.update(names: names) + flash[:notice] = I18n.t('record_updated') + redirect_to :back + else + flash.now[:alert] = I18n.t('failed_to_update_record') + render :index + end + end +end diff --git a/app/controllers/admin/settings_controller.rb b/app/controllers/admin/settings_controller.rb index 7c91bcbb0..805c983f4 100644 --- a/app/controllers/admin/settings_controller.rb +++ b/app/controllers/admin/settings_controller.rb @@ -37,13 +37,46 @@ class Admin::SettingsController < AdminController params.require(:setting_group).permit(settings_attributes: [:value, :id]) end - def casted_settings + def casted_settings # rubocop:disable Metrics/MethodLength settings = {} + + ints = [ + :admin_contacts_min_count, + :admin_contacts_max_count, + :tech_contacts_min_count, + :tech_contacts_max_count, + :ds_algorithm, + :dnskeys_min_count, + :dnskeys_max_count, + :ns_min_count, + :ns_max_count, + :transfer_wait_time, + :invoice_number_min, + :invoice_number_max, + :days_to_keep_overdue_invoices_active, + :days_to_renew_domain_before_expire, + :expire_warning_period, + :redemption_grace_period, + :expire_pending_confirmation + ] + + floats = [:registry_vat_prc] + + booleans = [ + :ds_data_allowed, + :key_data_allowed, + :client_side_status_editing_enabled, + :registrar_ip_whitelist_enabled, + :api_ip_whitelist_enabled + ] + params[:settings].each do |k, v| - settings[k] = v.to_i if Setting[k].class == Fixnum - settings[k] = v.to_f if Setting[k].class == Float - settings[k] = (v == 'true' ? true : false) if [TrueClass, FalseClass].include?(Setting[k].class) + settings[k] = v + settings[k] = v.to_i if ints.include?(k.to_sym) + settings[k] = v.to_f if floats.include?(k.to_sym) + settings[k] = (v == 'true' ? true : false) if booleans.include?(k.to_sym) end + settings end end diff --git a/app/controllers/admin/zonefiles_controller.rb b/app/controllers/admin/zonefiles_controller.rb index 9977d30b6..7d3b68ec6 100644 --- a/app/controllers/admin/zonefiles_controller.rb +++ b/app/controllers/admin/zonefiles_controller.rb @@ -1,7 +1,6 @@ class Admin::ZonefilesController < ApplicationController authorize_resource class: false # TODO: Refactor this - # rubocop:disable Metrics/MethodLength def create if ZonefileSetting.pluck(:origin).include?(params[:origin]) diff --git a/app/controllers/epp/domains_controller.rb b/app/controllers/epp/domains_controller.rb index 9f7ffb6ec..7cd4be2f3 100644 --- a/app/controllers/epp/domains_controller.rb +++ b/app/controllers/epp/domains_controller.rb @@ -18,18 +18,35 @@ class Epp::DomainsController < EppController render_epp_response '/epp/domains/info' end + # rubocop: disable Metrics/PerceivedComplexity + # rubocop: disable Metrics/CyclomaticComplexity def create authorize! :create, Epp::Domain @domain = Epp::Domain.new_from_epp(params[:parsed_frame], current_user) + handle_errors(@domain) and return if @domain.errors.any? + @domain.valid? + handle_errors(@domain) and return if @domain.errors.any? - if @domain.errors.any? || !@domain.save - handle_errors(@domain) - else - render_epp_response '/epp/domains/create' + handle_errors and return unless balance_ok?('create') + + ActiveRecord::Base.transaction do + if @domain.save # TODO: Maybe use validate: false here because we have already validated the domain? + current_user.registrar.debit!({ + sum: @domain_pricelist.price.amount, + description: "#{I18n.t('create')} #{@domain.name}", + activity_type: AccountActivity::CREATE, + log_pricelist_id: @domain_pricelist.id + }) + + render_epp_response '/epp/domains/create' + else + handle_errors(@domain) + end end end + # rubocop: enable Metrics/PerceivedComplexity + # rubocop: enable Metrics/CyclomaticComplexity - # rubocop:disable Metrics/CyclomaticComplexity def update authorize! :update, @domain, @password @@ -44,7 +61,6 @@ class Epp::DomainsController < EppController end end - # rubocop:disable Metrics/CyclomaticComplexity def delete authorize! :delete, @domain, @password @@ -66,7 +82,6 @@ class Epp::DomainsController < EppController handle_errors(@domain) end end - # rubocop:enbale Metrics/CyclomaticComplexity def check authorize! :check, Epp::Domain @@ -79,17 +94,35 @@ class Epp::DomainsController < EppController def renew authorize! :renew, @domain - handle_errors(@domain) and return unless @domain.renew( - params[:parsed_frame].css('curExpDate').text, - params[:parsed_frame].css('period').text, - params[:parsed_frame].css('period').first['unit'] - ) + period = params[:parsed_frame].css('period').text + period_unit = params[:parsed_frame].css('period').first['unit'] - render_epp_response '/epp/domains/renew' + ActiveRecord::Base.transaction do + success = @domain.renew( + params[:parsed_frame].css('curExpDate').text, + period, period_unit + ) + + if success + unless balance_ok?('renew', period, period_unit) + handle_errors + fail ActiveRecord::Rollback + end + + current_user.registrar.debit!({ + sum: @domain_pricelist.price.amount, + description: "#{I18n.t('renew')} #{@domain.name}", + activity_type: AccountActivity::RENEW, + log_pricelist_id: @domain_pricelist.id + }) + + render_epp_response '/epp/domains/renew' + else + handle_errors(@domain) + end + end end - # rubocop: disable Metrics/PerceivedComplexity - # rubocop: disable Metrics/MethodLength def transfer authorize! :transfer, @domain, @password action = params[:parsed_frame].css('transfer').first[:op] @@ -102,8 +135,6 @@ class Epp::DomainsController < EppController handle_errors(@domain) end end - # rubocop: enable Metrics/MethodLength - # rubocop: enable Metrics/CyclomaticComplexity private @@ -161,7 +192,7 @@ class Epp::DomainsController < EppController requires 'name' @prefix = nil - requires_attribute 'transfer', 'op', values: %(approve, query, reject) + requires_attribute 'transfer', 'op', values: %(approve, query, reject, request) end def find_domain @@ -192,4 +223,17 @@ class Epp::DomainsController < EppController msg: "#{I18n.t(:client_side_status_editing_error)}: status [status]" } end + + def balance_ok?(operation, period = nil, unit = nil) + @domain_pricelist = @domain.pricelist(operation, period.try(:to_i), unit) + if current_user.registrar.balance < @domain_pricelist.price.amount + epp_errors << { + code: '2104', + msg: I18n.t('billing_failure_credit_balance_low') + } + + return false + end + true + end end diff --git a/app/controllers/epp/keyrelays_controller.rb b/app/controllers/epp/keyrelays_controller.rb index cbfdae665..d6515758f 100644 --- a/app/controllers/epp/keyrelays_controller.rb +++ b/app/controllers/epp/keyrelays_controller.rb @@ -1,7 +1,6 @@ class Epp::KeyrelaysController < EppController skip_authorization_check # TODO: move authorization under ability - # rubocop: disable Metrics/PerceivedComplexity # rubocop: disable Metrics/CyclomaticComplexity def keyrelay # keyrelay temp turned off @@ -30,7 +29,6 @@ class Epp::KeyrelaysController < EppController exactly_one_of 'expiry > relative', 'expiry > absolute' end - # rubocop: enable Metrics/PerceivedComplexity # rubocop: enable Metrics/CyclomaticComplexity def find_domain diff --git a/app/controllers/epp/sessions_controller.rb b/app/controllers/epp/sessions_controller.rb index b6b75fcfd..99a148c9c 100644 --- a/app/controllers/epp/sessions_controller.rb +++ b/app/controllers/epp/sessions_controller.rb @@ -7,17 +7,49 @@ class Epp::SessionsController < EppController # rubocop: disable Metrics/PerceivedComplexity # rubocop: disable Metrics/CyclomaticComplexity + # rubocop: disable Metrics/MethodLength + # rubocop: disable Metrics/AbcSize def login - cert_valid = true + success = true @api_user = ApiUser.find_by(login_params) - if request.ip != ENV['webclient_ip'] && @api_user - unless @api_user.api_pki_ok?(request.env['HTTP_SSL_CLIENT_CERT'], request.env['HTTP_SSL_CLIENT_S_DN_CN']) - cert_valid = false + if request.ip == ENV['webclient_ip'] && !Rails.env.test? && !Rails.env.development? + client_md5 = Certificate.parse_md_from_string(request.env['HTTP_SSL_CLIENT_CERT']) + server_md5 = Certificate.parse_md_from_string(File.read(ENV['cert_path'])) + if client_md5 != server_md5 + @msg = 'Authentication error; server closing connection (certificate is not valid)' + success = false end end - if @api_user.try(:active) && cert_valid && ip_white? && connection_limit_ok? + if request.ip != ENV['webclient_ip'] && @api_user + unless @api_user.api_pki_ok?(request.env['HTTP_SSL_CLIENT_CERT'], request.env['HTTP_SSL_CLIENT_S_DN_CN']) + @msg = 'Authentication error; server closing connection (certificate is not valid)' + success = false + end + end + + if success && !@api_user + @msg = 'Authentication error; server closing connection (API user not found)' + success = false + end + + if success && !@api_user.try(:active) + @msg = 'Authentication error; server closing connection (API user is not active)' + success = false + end + + if success && !ip_white? + @msg = 'Authentication error; server closing connection (IP is not whitelisted)' + success = false + end + + if success && !connection_limit_ok? + @msg = 'Authentication error; server closing connection (connection limit reached)' + success = false + end + + if success if parsed_frame.css('newPW').first unless @api_user.update(password: parsed_frame.css('newPW').first.text) response.headers['X-EPP-Returncode'] = '2200' @@ -33,14 +65,15 @@ class Epp::SessionsController < EppController render_epp_response('login_fail') end end + # rubocop: enable Metrics/MethodLength + # rubocop: enable Metrics/AbcSize + # rubocop: enable Metrics/PerceivedComplexity + # rubocop: enable Metrics/CyclomaticComplexity def ip_white? return true if request.ip == ENV['webclient_ip'] if @api_user - unless @api_user.registrar.api_ip_white?(request.ip) - @msg = t('ip_is_not_whitelisted') - return false - end + return false unless @api_user.registrar.api_ip_white?(request.ip) end true end @@ -51,16 +84,10 @@ class Epp::SessionsController < EppController 'registrar_id = ? AND updated_at >= ?', @api_user.registrar_id, Time.zone.now - 5.minutes ).count - if c >= 4 - @msg = t('connection_limit_reached') - return false - end + return false if c >= 4 true end - # rubocop: enable Metrics/PerceivedComplexity - # rubocop: enable Metrics/CyclomaticComplexity - def logout @api_user = current_user # cache current_user for logging epp_session.destroy diff --git a/app/controllers/epp_controller.rb b/app/controllers/epp_controller.rb index 4b1af94ce..2cd1c8bc7 100644 --- a/app/controllers/epp_controller.rb +++ b/app/controllers/epp_controller.rb @@ -10,15 +10,29 @@ class EppController < ApplicationController before_action :update_epp_session helper_method :current_user - rescue_from CanCan::AccessDenied do |_exception| + rescue_from StandardError do |e| @errors ||= [] - if @errors.blank? - @errors = [{ - msg: t('errors.messages.epp_authorization_error'), - code: '2201' - }] + if e.class == CanCan::AccessDenied + if @errors.blank? + @errors = [{ + msg: t('errors.messages.epp_authorization_error'), + code: '2201' + }] + end + else + if @errors.blank? + @errors = [{ + msg: 'Internal error.', + code: '2400' + }] + end + + logger.error e.message + logger.error e.backtrace.join("\n") + # TODO: NOITFY AIRBRAKE / ERRBIT HERE end + render_epp_response '/epp/error' end @@ -124,7 +138,7 @@ class EppController < ApplicationController # validate legal document's type here because it may be in most of the requests @prefix = nil if element_count('extdata > legalDocument') > 0 - requires_attribute('extdata > legalDocument', 'type', values: LegalDocument::TYPES) + requires_attribute('extdata > legalDocument', 'type', values: LegalDocument::TYPES, policy: true) end handle_errors and return if epp_errors.any? @@ -174,12 +188,27 @@ class EppController < ApplicationController attribute = element[attribute_selector] - return if attribute && options[:values].include?(attribute) + unless attribute + epp_errors << { + code: '2003', + msg: I18n.t('errors.messages.required_parameter_missing', key: attribute_selector) + } + return + end - epp_errors << { - code: '2306', - msg: I18n.t('attribute_is_invalid', attribute: attribute_selector) - } + return if options[:values].include?(attribute) + + if options[:policy] + epp_errors << { + code: '2306', + msg: I18n.t('attribute_is_invalid', attribute: attribute_selector) + } + else + epp_errors << { + code: '2004', + msg: I18n.t('parameter_value_range_error', key: attribute_selector) + } + end end def optional_attribute(element_selector, attribute_selector, options) @@ -272,7 +301,6 @@ class EppController < ApplicationController end # rubocop: enable Style/PredicateName - # rubocop: disable Metrics/PerceivedComplexity # rubocop: disable Metrics/CyclomaticComplexity def write_to_epp_log # return nil if EPP_LOG_ENABLED @@ -295,7 +323,6 @@ class EppController < ApplicationController ip: request.ip }) end - # rubocop: enable Metrics/PerceivedComplexity # rubocop: enable Metrics/CyclomaticComplexity def iptables_counter_update diff --git a/app/controllers/registrant/domain_delete_confirms_controller.rb b/app/controllers/registrant/domain_delete_confirms_controller.rb index 09e3bff58..f6f05d628 100644 --- a/app/controllers/registrant/domain_delete_confirms_controller.rb +++ b/app/controllers/registrant/domain_delete_confirms_controller.rb @@ -8,8 +8,8 @@ class Registrant::DomainDeleteConfirmsController < RegistrantController @domain = nil unless @domain.registrant_delete_confirmable?(params[:token]) end - # # rubocop: disable Metrics/PerceivedComplexity - # # rubocop: disable Metrics/CyclomaticComplexity + # rubocop: disable Metrics/PerceivedComplexity + # rubocop: disable Metrics/AbcSize def update @domain = Domain.find(params[:id]) unless @domain.registrant_delete_confirmable?(params[:token]) @@ -39,5 +39,5 @@ class Registrant::DomainDeleteConfirmsController < RegistrantController end end # rubocop: enable Metrics/PerceivedComplexity - # rubocop: enable Metrics/CyclomaticComplexity + # rubocop: enable Metrics/AbcSize end diff --git a/app/controllers/registrant/domain_update_confirms_controller.rb b/app/controllers/registrant/domain_update_confirms_controller.rb index debe7294b..598681d7a 100644 --- a/app/controllers/registrant/domain_update_confirms_controller.rb +++ b/app/controllers/registrant/domain_update_confirms_controller.rb @@ -9,7 +9,7 @@ class Registrant::DomainUpdateConfirmsController < RegistrantController end # rubocop: disable Metrics/PerceivedComplexity - # rubocop: disable Metrics/CyclomaticComplexity + # rubocop: disable Metrics/AbcSize def update @domain = Domain.find(params[:id]) unless @domain.registrant_update_confirmable?(params[:token]) @@ -39,5 +39,5 @@ class Registrant::DomainUpdateConfirmsController < RegistrantController end end # rubocop: enable Metrics/PerceivedComplexity - # rubocop: enable Metrics/CyclomaticComplexity + # rubocop: enable Metrics/AbcSize end diff --git a/app/controllers/registrant/sessions_controller.rb b/app/controllers/registrant/sessions_controller.rb index 2d8c3013d..f0a292137 100644 --- a/app/controllers/registrant/sessions_controller.rb +++ b/app/controllers/registrant/sessions_controller.rb @@ -4,6 +4,7 @@ class Registrant::SessionsController < Devise::SessionsController def login end + # rubocop: disable Metrics/AbcSize def id if Rails.env.development? sign_in(RegistrantUser.find_or_create_by_idc_data('test'), event: :authentication) @@ -22,12 +23,14 @@ class Registrant::SessionsController < Devise::SessionsController redirect_to registrant_login_url end end + # rubocop: enable Metrics/AbcSize def login_mid @user = User.new end - def mid # rubocop: disable Metrics/MethodLength + # rubocop: disable Metrics/MethodLength + def mid phone = params[:user][:phone] endpoint = "#{ENV['sk_digi_doc_service_endpoint']}" client = Digidoc::Client.new(endpoint) @@ -64,8 +67,9 @@ class Registrant::SessionsController < Devise::SessionsController render json: { message: t(:no_such_user) }, status: :unauthorized end end + # rubocop: enable Metrics/MethodLength - # rubocop: disable Metrics/PerceivedComplexity + # rubocop: disable Metrics/AbcSize # rubocop: disable Metrics/CyclomaticComplexity # rubocop: disable Metrics/MethodLength def mid_status @@ -104,7 +108,7 @@ class Registrant::SessionsController < Devise::SessionsController render json: { message: t(:internal_error) }, status: :bad_request end end - # rubocop: enable Metrics/PerceivedComplexity + # rubocop: enable Metrics/AbcSize # rubocop: enable Metrics/CyclomaticComplexity # rubocop: enable Metrics/MethodLength diff --git a/app/controllers/registrar/account_activities_controller.rb b/app/controllers/registrar/account_activities_controller.rb index 54c3f6d24..2b3fc7951 100644 --- a/app/controllers/registrar/account_activities_controller.rb +++ b/app/controllers/registrar/account_activities_controller.rb @@ -1,10 +1,28 @@ class Registrar::AccountActivitiesController < RegistrarController load_and_authorize_resource - def index + def index # rubocop: disable Metrics/AbcSize + params[:q] ||= {} account = current_user.registrar.cash_account + + ca_cache = params[:q][:created_at_lteq] + begin + end_time = params[:q][:created_at_lteq].try(:to_date) + params[:q][:created_at_lteq] = end_time.try(:end_of_day) + rescue + logger.warn('Invalid date') + end + @q = account.activities.includes(:invoice).search(params[:q]) @q.sorts = 'id desc' if @q.sorts.empty? - @account_activities = @q.result.page(params[:page]) + + respond_to do |format| + format.html { @account_activities = @q.result.page(params[:page]) } + format.csv do + send_data @q.result.to_csv, filename: "account_activities_#{Time.zone.now.to_formatted_s(:number)}.csv" + end + end + + params[:q][:created_at_lteq] = ca_cache end end diff --git a/app/controllers/registrar/sessions_controller.rb b/app/controllers/registrar/sessions_controller.rb index 3fea41f75..940e5f415 100644 --- a/app/controllers/registrar/sessions_controller.rb +++ b/app/controllers/registrar/sessions_controller.rb @@ -14,11 +14,9 @@ class Registrar::SessionsController < Devise::SessionsController # rubocop:disable Metrics/PerceivedComplexity # rubocop:disable Metrics/CyclomaticComplexity # rubocop:disable Metrics/MethodLength + # rubocop:disable Metrics/AbcSize def create - @depp_user = Depp::User.new(params[:depp_user].merge( - pki: !(Rails.env.development? || Rails.env.test?) - ) - ) + @depp_user = Depp::User.new(params[:depp_user].merge(pki: !(Rails.env.development? || Rails.env.test?))) if @depp_user.pki && request.env['HTTP_SSL_CLIENT_S_DN_CN'].blank? @depp_user.errors.add(:base, :webserver_missing_user_name_directive) @@ -64,6 +62,7 @@ class Registrar::SessionsController < Devise::SessionsController # rubocop:enable Metrics/CyclomaticComplexity # rubocop:enable Metrics/PerceivedComplexity # rubocop:enable Metrics/MethodLength + # rubocop:enable Metrics/AbcSize def id @user = ApiUser.find_by_idc_data(request.env['SSL_CLIENT_S_DN']) @@ -119,9 +118,9 @@ class Registrar::SessionsController < Devise::SessionsController render json: { message: t(:no_such_user) }, status: :unauthorized end end - # rubocop: enable Metrics/MethodLength + # rubocop:enable Metrics/MethodLength - # rubocop: disable Metrics/PerceivedComplexity + # rubocop: disable Metrics/AbcSize # rubocop: disable Metrics/CyclomaticComplexity # rubocop: disable Metrics/MethodLength def mid_status @@ -159,7 +158,7 @@ class Registrar::SessionsController < Devise::SessionsController render json: { message: t(:internal_error) }, status: :bad_request end end - # rubocop: enable Metrics/PerceivedComplexity + # rubocop: enable Metrics/AbcSize # rubocop: enable Metrics/CyclomaticComplexity # rubocop: enable Metrics/MethodLength diff --git a/app/controllers/registrar_controller.rb b/app/controllers/registrar_controller.rb index e1b6b5a3c..37ec99bfd 100644 --- a/app/controllers/registrar_controller.rb +++ b/app/controllers/registrar_controller.rb @@ -1,6 +1,5 @@ class RegistrarController < ApplicationController before_action :authenticate_user!, :check_ip - # before_action :check_ip layout 'registrar/application' include Registrar::ApplicationHelper diff --git a/app/mailers/contact_mailer.rb b/app/mailers/contact_mailer.rb index 8b443d279..800544b2e 100644 --- a/app/mailers/contact_mailer.rb +++ b/app/mailers/contact_mailer.rb @@ -12,7 +12,7 @@ class ContactMailer < ApplicationMailer emails = [] emails << [@contact.email, @contact.email_was] if @contact.registrant_domains.present? - emails << @contact.domains.map(&:email) if @contact.domains.present? + emails << @contact.domains.map(&:registrant_email) if @contact.domains.present? emails = emails.uniq emails.each do |email| diff --git a/app/mailers/domain_mailer.rb b/app/mailers/domain_mailer.rb index c9e072395..599658936 100644 --- a/app/mailers/domain_mailer.rb +++ b/app/mailers/domain_mailer.rb @@ -3,7 +3,7 @@ class DomainMailer < ApplicationMailer @domain = domain return if Rails.env.production? ? false : !TEST_EMAILS.include?(@domain.registrant_email) - # turn on delivery on specific request only, thus rake tasks does not deliver anything + # turn on delivery on specific EPP request only, thus rake tasks does not deliver anything return if @domain.deliver_emails != true if @domain.registrant_verification_token.blank? @@ -25,11 +25,22 @@ class DomainMailer < ApplicationMailer subject: "#{I18n.t(:domain_registrant_pending_updated_subject, name: @domain.name)} [#{@domain.name}]") end + def registrant_updated(domain) + @domain = domain + return if Rails.env.production? ? false : !TEST_EMAILS.include?(@domain.registrant_email) + + # turn on delivery on specific EPP request only, thus rake tasks does not deliver anything + return if @domain.deliver_emails != true + + mail(to: @domain.registrant_email, + subject: "#{I18n.t(:domain_registrant_updated, name: @domain.name)} [#{@domain.name}]") + end + def pending_deleted(domain) @domain = domain return if Rails.env.production? ? false : !TEST_EMAILS.include?(@domain.registrant_email) - # turn on delivery on specific request only, thus rake tasks does not deliver anything + # turn on delivery on specific EPP request only, thus rake tasks does not deliver anything return if @domain.deliver_emails != true if @domain.registrant_verification_token.blank? diff --git a/app/models/ability.rb b/app/models/ability.rb index 3c641fdcb..b7c763708 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -3,6 +3,7 @@ class Ability # rubocop: disable Metrics/CyclomaticComplexity # rubocop: disable Metrics/PerceivedComplexity # rubocop: disable Metrics/LineLength + # rubocop: disable Metrics/AbcSize def initialize(user) alias_action :show, to: :view alias_action :show, :create, :update, :destroy, to: :crud @@ -105,6 +106,8 @@ class Ability def admin customer_service can :manage, Setting + can :manage, BlockedDomain + can :manage, ReservedDomain can :manage, ZonefileSetting can :manage, DomainVersion can :manage, Pricelist diff --git a/app/models/account_activity.rb b/app/models/account_activity.rb index d6feb50de..84a9f9137 100644 --- a/app/models/account_activity.rb +++ b/app/models/account_activity.rb @@ -1,13 +1,37 @@ +require 'csv' + class AccountActivity < ActiveRecord::Base include Versions belongs_to :account belongs_to :bank_transaction belongs_to :invoice + CREATE = 'create' + RENEW = 'renew' + ADD_CREDIT = 'add_credit' + after_create :update_balance def update_balance account.balance += sum account.save end + + class << self + def types_for_select + [CREATE, RENEW, ADD_CREDIT].map { |x| [I18n.t(x), x] } + end + + def to_csv + attributes = %w(description activity_type created_at sum) + + CSV.generate(headers: true) do |csv| + csv << %w(description activity_type receipt_date sum) + + all.each do |x| # rubocop:disable Rails/FindEach + csv << attributes.map { |attr| x.send(attr) } + end + end + end + end end diff --git a/app/models/api_user.rb b/app/models/api_user.rb index 3312de5d4..3d18ea181 100644 --- a/app/models/api_user.rb +++ b/app/models/api_user.rb @@ -1,9 +1,9 @@ require 'open3' -# rubocop: disable Metrics/ClassLength class ApiUser < User include EppErrors - def epp_code_map # rubocop:disable Metrics/MethodLength + + def epp_code_map { '2306' => [ # Parameter policy error [:password, :blank] @@ -77,4 +77,3 @@ class ApiUser < User end end end -# rubocop: enable Metrics/ClassLength diff --git a/app/models/bank_statement.rb b/app/models/bank_statement.rb index bb670d227..7267b4773 100644 --- a/app/models/bank_statement.rb +++ b/app/models/bank_statement.rb @@ -4,7 +4,7 @@ class BankStatement < ActiveRecord::Base attr_accessor :th6_file - validates :bank_code, :iban, :queried_at, presence: true + validates :bank_code, :iban, presence: true FULLY_BINDED = 'fully_binded' PARTIALLY_BINDED = 'partially_binded' @@ -27,6 +27,7 @@ class BankStatement < ActiveRecord::Base File.open(import_file_path, 'w') { |f| f.write(th6_file.open.read) } end + # rubocop: disable Metrics/AbcSize def parse_th6_row(row) return parse_th6_header(row) if row[4, 3].strip == '000' return if row[4, 3].strip == '999' # skip footer @@ -47,6 +48,7 @@ class BankStatement < ActiveRecord::Base reference_no: row[280, 35].strip } end + # rubocop: enable Metrics/AbcSize def parse_th6_header(row) self.bank_code = row[7, 3].strip diff --git a/app/models/bank_transaction.rb b/app/models/bank_transaction.rb index 1a2ec5568..2e5b90a2e 100644 --- a/app/models/bank_transaction.rb +++ b/app/models/bank_transaction.rb @@ -3,7 +3,9 @@ class BankTransaction < ActiveRecord::Base belongs_to :bank_statement has_one :account_activity - scope :unbinded, -> { where('id NOT IN (SELECT bank_transaction_id FROM account_activities)') } + scope :unbinded, lambda { + where('id NOT IN (SELECT bank_transaction_id FROM account_activities where bank_transaction_id IS NOT NULL)') + } def binded? account_activity.present? @@ -77,7 +79,8 @@ class BankTransaction < ActiveRecord::Base invoice: invoice, sum: invoice.sum_without_vat, currency: currency, - description: description + description: description, + activity_type: AccountActivity::ADD_CREDIT ) end end diff --git a/app/models/blocked_domain.rb b/app/models/blocked_domain.rb new file mode 100644 index 000000000..2a646a74f --- /dev/null +++ b/app/models/blocked_domain.rb @@ -0,0 +1,5 @@ +class BlockedDomain < ActiveRecord::Base + include Versions + + after_initialize -> { self.names = [] if names.nil? } +end diff --git a/app/models/certificate.rb b/app/models/certificate.rb index b354f87f2..ecf58f77a 100644 --- a/app/models/certificate.rb +++ b/app/models/certificate.rb @@ -76,6 +76,7 @@ class Certificate < ActiveRecord::Base @cached_status = REVOKED end + # rubocop: disable Metrics/AbcSize def sign! csr_file = Tempfile.new('client_csr') csr_file.write(csr) @@ -107,6 +108,7 @@ class Certificate < ActiveRecord::Base return false end end + # rubocop: enable Metrics/AbcSize def revoke! crt_file = Tempfile.new('client_crt') @@ -198,5 +200,14 @@ class Certificate < ActiveRecord::Base _out, _err, _st = Open3.capture3("sudo /etc/init.d/apache2 reload") STDOUT << "#{Time.zone.now.utc} - Apache reloaded\n" end + + def parse_md_from_string(crt) + return nil if crt.blank? + crt = crt.split(' ').join("\n") + crt.gsub!("-----BEGIN\nCERTIFICATE-----\n", "-----BEGIN CERTIFICATE-----\n") + crt.gsub!("\n-----END\nCERTIFICATE-----", "\n-----END CERTIFICATE-----") + cert = OpenSSL::X509::Certificate.new(crt) + OpenSSL::Digest::MD5.new(cert.to_der).to_s + end end end diff --git a/app/models/deposit.rb b/app/models/deposit.rb index 18cb8e05d..fae4336cf 100644 --- a/app/models/deposit.rb +++ b/app/models/deposit.rb @@ -4,7 +4,7 @@ class Deposit extend ActiveModel::Naming include DisableHtml5Validation - attr_accessor :amount, :description, :registrar + attr_accessor :amount, :description, :registrar, :registrar_id validates :amount, :registrar, presence: true diff --git a/app/models/depp/contact.rb b/app/models/depp/contact.rb index be0429c2f..ddac61049 100644 --- a/app/models/depp/contact.rb +++ b/app/models/depp/contact.rb @@ -20,7 +20,6 @@ module Depp class << self attr_reader :epp_xml, :user - # rubocop: disable Metrics/MethodLength def new_from_params(params) new( id: params[:code], @@ -43,8 +42,8 @@ module Depp country_code: params[:country_code] ) end - # rubocop: enable Metrics/MethodLength + # rubocop:disable Metrics/AbcSize def find_by_id(id) data = info_xml(id) @@ -77,6 +76,7 @@ module Depp statuses: data.css('status').map { |s| [s['s'], s.text] } ) end + # rubocop:enable Metrics/AbcSize def user=(user) @user = user @@ -170,7 +170,8 @@ module Depp handle_errors(data) end - # rubocop: disable Metrics/MethodLength + # rubocop:disable Metrics/MethodLength + # rubocop:disable Metrics/AbcSize def update_attributes(params) self.ident_country_code = params[:ident_country_code] self.ident_type = params[:ident_type] @@ -214,7 +215,8 @@ module Depp data = Depp::Contact.user.request(update_xml) handle_errors(data) end - # rubocop: enable Metrics/MethodLength + # rubocop:enbale Metrics/AbcSize + # rubocop:enable Metrics/MethodLength def delete delete_xml = Contact.epp_xml.delete( diff --git a/app/models/depp/domain.rb b/app/models/depp/domain.rb index 4a13d5ba5..fa252819e 100644 --- a/app/models/depp/domain.rb +++ b/app/models/depp/domain.rb @@ -79,7 +79,8 @@ module Depp end def transfer(params) - op = params[:query] ? 'query' : nil + op = params[:request] ? 'request' : nil + op = params[:query] ? 'query' : op op = params[:approve] ? 'approve' : op op = params[:reject] ? 'reject' : op @@ -130,7 +131,9 @@ module Depp ret.with_indifferent_access end - def construct_params_from_server_data(data) # rubocop:disable Metrics/MethodLength + # rubocop:disable Metrics/MethodLength + # rubocop:disable Metrics/AbcSize + def construct_params_from_server_data(data) ret = default_params ret[:name] = data.css('name').text ret[:registrant] = data.css('registrant').text @@ -176,18 +179,22 @@ module Depp ret end + # rubocop:enable Metrics/MethodLength + # rubocop:enable Metrics/AbcSize def construct_custom_params_hash(domain_params) - custom_params = {} + custom_params = { _anonymus: [] } if domain_params[:legal_document].present? type = domain_params[:legal_document].original_filename.split('.').last.downcase - custom_params = { - _anonymus: [ - legalDocument: { value: Base64.encode64(domain_params[:legal_document].read), attrs: { type: type } } - ] + custom_params[:_anonymus] << { + legalDocument: { value: Base64.encode64(domain_params[:legal_document].read), attrs: { type: type } } } end + if domain_params[:reserved_pw].present? + custom_params[:_anonymus] << { reserved: { pw: { value: domain_params[:reserved_pw] } } } + end + custom_params end @@ -233,7 +240,7 @@ module Depp host_attr << { hostAddr: { value: v['ipv4'], attrs: { ip: 'v4' } } } if v['ipv4'].present? host_attr << { hostAddr: { value: v['ipv6'], attrs: { ip: 'v6' } } } if v['ipv6'].present? - ret << { hostAttr: host_attr } + ret << { hostAttr: host_attr } end ret @@ -256,11 +263,11 @@ module Depp domain_params[:dnskeys_attributes].each do |_k, v| if v['ds_key_tag'].blank? kd = create_key_data_hash(v) - ret << { + ret << { keyData: kd } if kd else - ret << { + ret << { dsData: [ keyTag: { value: v['ds_key_tag'] }, alg: { value: v['ds_alg'] }, diff --git a/app/models/depp/keyrelay.rb b/app/models/depp/keyrelay.rb index f4e609c05..8e8eaec26 100644 --- a/app/models/depp/keyrelay.rb +++ b/app/models/depp/keyrelay.rb @@ -8,7 +8,7 @@ module Depp self.epp_xml = EppXml::Keyrelay.new(cl_trid_prefix: current_user.tag) end - def keyrelay(params) # rubocop:disable Metrics/MethodLength + def keyrelay(params) custom_params = {} if params[:legal_document].present? type = params[:legal_document].original_filename.split('.').last.downcase diff --git a/app/models/depp/user.rb b/app/models/depp/user.rb index fcce49c10..4efbd42d9 100644 --- a/app/models/depp/user.rb +++ b/app/models/depp/user.rb @@ -36,6 +36,7 @@ module Depp Nokogiri::XML(e.response_xml.to_s).remove_namespaces! end + # rubocop:disable Metrics/AbcSize def repp_request(path, params = {}) client_cert = File.read(ENV['cert_path']) client_key = File.read(ENV['key_path']) @@ -51,8 +52,7 @@ module Depp use_ssl: (uri.scheme == 'https'), verify_mode: OpenSSL::SSL::VERIFY_NONE, cert: OpenSSL::X509::Certificate.new(client_cert), - key: OpenSSL::PKey::RSA.new(client_key) - ) do |http| + key: OpenSSL::PKey::RSA.new(client_key)) do |http| http.request(req) end @@ -67,6 +67,7 @@ module Depp ret end + # rubocop:enable Metrics/AbcSize private diff --git a/app/models/dnskey.rb b/app/models/dnskey.rb index 5dd03ae50..0c426978c 100644 --- a/app/models/dnskey.rb +++ b/app/models/dnskey.rb @@ -114,7 +114,7 @@ class Dnskey < ActiveRecord::Base end def bin_to_hex(s) - s.each_byte.map { |b| sprintf('%02X', b) }.join + s.each_byte.map { |b| format('%02X', b) }.join end end end diff --git a/app/models/domain.rb b/app/models/domain.rb index 50e8b6fa4..e6bf2ea41 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -61,6 +61,7 @@ class Domain < ActiveRecord::Base before_create :generate_auth_info before_create :set_validity_dates + before_create -> { self.reserved = in_reserved_list?; nil } before_update :manage_statuses def manage_statuses return unless registrant_id_changed? @@ -78,12 +79,32 @@ class Domain < ActiveRecord::Base after_initialize -> { self.statuses = [] if statuses.nil? } + after_create :update_reserved_domains + def update_reserved_domains + return unless in_reserved_list? + rd = ReservedDomain.first + rd.names[name] = SecureRandom.hex + rd.save + end + validates :name_dirty, domain_name: true, uniqueness: true validates :puny_label, length: { maximum: 63 } validates :period, numericality: { only_integer: true } validates :registrant, :registrar, presence: true validate :validate_period + validate :validate_reservation + def validate_reservation + return if persisted? || !in_reserved_list? + + if reserved_pw.blank? + errors.add(:base, :required_parameter_missing_reserved) + return false + end + + return if ReservedDomain.pw_for(name) == reserved_pw + errors.add(:base, :invalid_auth_information_reserved) + end validates :nameservers, object_count: { min: -> { Setting.ns_min_count }, @@ -134,7 +155,7 @@ class Domain < ActiveRecord::Base end attr_accessor :registrant_typeahead, :update_me, :deliver_emails, - :epp_pending_update, :epp_pending_delete + :epp_pending_update, :epp_pending_delete, :reserved_pw def subordinate_nameservers nameservers.select { |x| x.hostname.end_with?(name) } @@ -146,9 +167,9 @@ class Domain < ActiveRecord::Base class << self def convert_period_to_time(period, unit) - return period.to_i.days if unit == 'd' - return period.to_i.months if unit == 'm' - return period.to_i.years if unit == 'y' + return (period.to_i / 365).years if unit == 'd' + return (period.to_i / 12).years if unit == 'm' + return period.to_i.years if unit == 'y' end def included @@ -162,16 +183,34 @@ class Domain < ActiveRecord::Base ) end + def clean_expired_pendings + STDOUT << "#{Time.zone.now.utc} - Clean expired domain pendings\n" unless Rails.env.test? + + expire_at = Setting.expire_pending_confirmation.hours.ago + count = 0 + expired_pending_domains = Domain.where('registrant_verification_asked_at <= ?', expire_at) + expired_pending_domains.each do |domain| + unless domain.pending_update? || domain.pending_delete? + msg = "#{Time.zone.now.utc} - ISSUE: DOMAIN #{domain.id}: #{domain.name} IS IN EXPIRED PENDING LIST, " \ + "but no pendingDelete/pendingUpdate state present!\n" + STDOUT << msg unless Rails.env.test? + next + end + count += 1 + domain.clean_pendings! + end + + STDOUT << "#{Time.zone.now.utc} - Successfully cancelled #{count} domain pendings\n" unless Rails.env.test? + count + end + def start_expire_period STDOUT << "#{Time.zone.now.utc} - Expiring domains\n" unless Rails.env.test? - d = Domain.where('valid_to <= ?', Time.zone.now) - d.each do |x| - next unless x.expirable? - x.statuses << DomainStatus::EXPIRED - # TODO: This should be managed by automatic_statuses - x.statuses.delete(DomainStatus::OK) - x.save(validate: false) + domains = Domain.where('valid_to <= ?', Time.zone.now) + domains.each do |domain| + next unless domain.expirable? + domain.set_expired! end STDOUT << "#{Time.zone.now.utc} - Successfully expired #{d.count} domains\n" unless Rails.env.test? @@ -207,6 +246,7 @@ class Domain < ActiveRecord::Base STDOUT << "#{Time.zone.now.utc} - Successfully set delete_candidate to #{d.count} domains\n" end + # rubocop:disable Rails/FindEach def destroy_delete_candidates STDOUT << "#{Time.zone.now.utc} - Destroying domains\n" unless Rails.env.test? @@ -223,6 +263,7 @@ class Domain < ActiveRecord::Base STDOUT << "#{Time.zone.now.utc} - Successfully destroyed #{c} domains\n" unless Rails.env.test? end + # rubocop:enable Rails/FindEach end def name=(value) @@ -245,6 +286,10 @@ class Domain < ActiveRecord::Base @registrant_typeahead || registrant.try(:name) || nil end + def in_reserved_list? + ReservedDomain.pw_for(name).present? + end + def pending_transfer domain_transfers.find_by(status: DomainTransfer::PENDING) end @@ -370,6 +415,25 @@ class Domain < ActiveRecord::Base DomainMailer.pending_deleted(self).deliver_now end + def pricelist(operation, period_i = nil, unit = nil) + period_i ||= period + unit ||= period_unit + + zone = name.split('.').drop(1).join('.') + + p = period_i / 365 if unit == 'd' + p = period_i / 12 if unit == 'm' + p = period_i if unit == 'y' + + if p > 1 + p = "#{p}years" + else + p = "#{p}year" + end + + Pricelist.pricelist_for(zone, operation, p) + end + ### VALIDATIONS ### def validate_nameserver_ips @@ -410,8 +474,8 @@ class Domain < ActiveRecord::Base res = '' parts = name.split('.') parts.each do |x| - res += sprintf('%02X', x.length) # length of label in hex - res += x.each_byte.map { |b| sprintf('%02X', b) }.join # label + res += format('%02X', x.length) # length of label in hex + res += x.each_byte.map { |b| format('%02X', b) }.join # label end res += '00' @@ -471,6 +535,19 @@ class Domain < ActiveRecord::Base save(validate: false) end + def set_expired + # TODO: currently valid_to attribute update logic is open + # self.valid_to = valid_from + self.class.convert_period_to_time(period, period_unit) + self.outzone_at = Time.zone.now + Setting.expire_warning_period.days + self.delete_at = Time.zone.now + Setting.redemption_grace_period.days + statuses << DomainStatus::EXPIRED + end + + def set_expired! + set_expired + save(validate: false) + end + def manage_automatic_statuses # domain_statuses.create(value: DomainStatus::DELETE_CANDIDATE) if delete_candidateable? if statuses.empty? && valid? diff --git a/app/models/domain_status.rb b/app/models/domain_status.rb index b33b5446c..0f984b4e7 100644 --- a/app/models/domain_status.rb +++ b/app/models/domain_status.rb @@ -71,6 +71,7 @@ class DomainStatus < ActiveRecord::Base FORCE_DELETE = 'forceDelete' DELETE_CANDIDATE = 'deleteCandidate' EXPIRED = 'expired' + RESERVED = 'reserved' STATUSES = [ CLIENT_DELETE_PROHIBITED, SERVER_DELETE_PROHIBITED, CLIENT_HOLD, SERVER_HOLD, diff --git a/app/models/epp/contact.rb b/app/models/epp/contact.rb index d9ba0a48a..d85b16cec 100644 --- a/app/models/epp/contact.rb +++ b/app/models/epp/contact.rb @@ -1,4 +1,3 @@ -# rubocop: disable Metrics/ClassLength class Epp::Contact < Contact include EppErrors @@ -15,6 +14,7 @@ class Epp::Contact < Contact # rubocop: disable Metrics/PerceivedComplexity # rubocop: disable Metrics/CyclomaticComplexity # rubocop: disable Metrics/MethodLength + # rubocop: disable Metrics/AbcSize def attrs_from(frame, rem = nil) f = frame at = {}.with_indifferent_access @@ -53,6 +53,7 @@ class Epp::Contact < Contact # rubocop: enable Metrics/MethodLength # rubocop: enable Metrics/PerceivedComplexity # rubocop: enable Metrics/CyclomaticComplexity + # rubocop: enable Metrics/AbcSize def new(frame, registrar) return super if frame.blank? @@ -149,4 +150,3 @@ class Epp::Contact < Contact super(at) end end -# rubocop: enable Metrics/ClassLength diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb index f978b760f..72fd602b6 100644 --- a/app/models/epp/domain.rb +++ b/app/models/epp/domain.rb @@ -25,7 +25,8 @@ class Epp::Domain < Domain ], '2003' => [ # Required parameter missing [:registrant, :blank], - [:registrar, :blank] + [:registrar, :blank], + [:base, :required_parameter_missing_reserved] ], '2004' => [ # Parameter value range error [:nameservers, :out_of_range, @@ -60,9 +61,13 @@ class Epp::Domain < Domain '2201' => [ # Authorisation error [:auth_info, :wrong_pw] ], + '2202' => [ + [:base, :invalid_auth_information_reserved] + ], '2302' => [ # Object exists [:name_dirty, :taken, { value: { obj: 'name', val: name_dirty } }], - [:name_dirty, :reserved, { value: { obj: 'name', val: name_dirty } }] + [:name_dirty, :reserved, { value: { obj: 'name', val: name_dirty } }], + [:name_dirty, :blocked, { value: { obj: 'name', val: name_dirty } }] ], '2304' => [ # Object status prohibits operation [:base, :domain_status_prohibits_operation] @@ -81,13 +86,14 @@ class Epp::Domain < Domain def attach_default_contacts return if registrant.blank? regt = Registrant.find(registrant.id) # temp for bullet - tech_contacts << regt if tech_domain_contacts.blank? + tech_contacts << regt if tech_domain_contacts.blank? admin_contacts << regt if admin_domain_contacts.blank? && regt.priv? end # rubocop: disable Metrics/PerceivedComplexity # rubocop: disable Metrics/CyclomaticComplexity # rubocop: disable Metrics/MethodLength + # rubocop: disable Metrics/AbcSize def attrs_from(frame, current_user, action = nil) at = {}.with_indifferent_access @@ -110,6 +116,8 @@ class Epp::Domain < Domain at[:period_unit] = Epp::Domain.parse_period_unit_from_frame(frame) || 'y' + at[:reserved_pw] = frame.css('reserved > pw').text + # at[:statuses] = domain_statuses_attrs(frame, action) # binding.pry at[:nameservers_attributes] = nameservers_attrs(frame, action) @@ -130,6 +138,7 @@ class Epp::Domain < Domain # rubocop: enable Metrics/PerceivedComplexity # rubocop: enable Metrics/CyclomaticComplexity # rubocop: enable Metrics/MethodLength + # rubocop: enable Metrics/AbcSize def nameservers_attrs(frame, action) ns_list = nameservers_from(frame) @@ -358,6 +367,7 @@ class Epp::Domain < Domain }] end + # rubocop: disable Metrics/AbcSize def update(frame, current_user, verify = true) return super if frame.blank? at = {}.with_indifferent_access @@ -380,6 +390,7 @@ class Epp::Domain < Domain self.deliver_emails = true # turn on email delivery for epp errors.empty? && super(at) end + # rubocop: enable Metrics/AbcSize def apply_pending_update! preclean_pendings @@ -387,7 +398,10 @@ class Epp::Domain < Domain frame = Nokogiri::XML(pending_json['frame']) statuses.delete(DomainStatus::PENDING_UPDATE) - clean_pendings! if update(frame, user, false) + return unless update(frame, user, false) + clean_pendings! + self.deliver_emails = true # turn on email delivery for epp + DomainMailer.registrant_updated(self).deliver_now end def apply_pending_delete! @@ -408,7 +422,7 @@ class Epp::Domain < Domain ) end - def epp_destroy(frame, user_id, verify=true) + def epp_destroy(frame, user_id, verify = true) return false unless valid? if verify && frame.css('delete').attr('verified').to_s.downcase != 'yes' @@ -418,7 +432,7 @@ class Epp::Domain < Domain manage_automatic_statuses true # aka 1001 pending_delete else - destroy + set_expired! end end @@ -450,6 +464,8 @@ class Epp::Domain < Domain def transfer(frame, action, current_user) case action when 'query' + return domain_transfers.last if domain_transfers.any? + when 'request' return pending_transfer if pending_transfer return query_transfer(frame, current_user) when 'approve' @@ -457,7 +473,7 @@ class Epp::Domain < Domain when 'reject' return reject_transfer(frame, current_user) if pending_transfer end - add_epp_error('2303', nil, nil, I18n.t('pending_transfer_was_not_found')) + add_epp_error('2303', nil, nil, I18n.t('no_transfers_found')) end # TODO: Eager load problems here. Investigate how it's possible not to query contact again @@ -524,6 +540,7 @@ class Epp::Domain < Domain # rubocop: enable Metrics/CyclomaticComplexity # rubocop: disable Metrics/MethodLength + # rubocop: disable Metrics/AbcSize def query_transfer(frame, current_user) return false unless can_be_transferred_to?(current_user.registrar) @@ -533,10 +550,10 @@ class Epp::Domain < Domain transaction do begin dt = domain_transfers.create!( - transfer_requested_at: Time.zone.now, - transfer_to: current_user.registrar, - transfer_from: registrar - ) + transfer_requested_at: Time.zone.now, + transfer_to: current_user.registrar, + transfer_from: registrar + ) if dt.pending? registrar.messages.create!( @@ -565,6 +582,7 @@ class Epp::Domain < Domain end end end + # rubocop: enable Metrics/AbcSize # rubocop: enable Metrics/MethodLength def approve_transfer(frame, current_user) @@ -621,13 +639,14 @@ class Epp::Domain < Domain end # rubocop:disable Metrics/MethodLength + # rubocop:disable Metrics/AbcSize def keyrelay(parsed_frame, requester) if registrar == requester errors.add(:base, :domain_already_belongs_to_the_querying_registrar) and return false end abs_datetime = parsed_frame.css('absolute').text - abs_datetime = DateTime.parse(abs_datetime) if abs_datetime.present? + abs_datetime = DateTime.zone.parse(abs_datetime) if abs_datetime.present? transaction do kr = keyrelays.build( @@ -664,6 +683,7 @@ class Epp::Domain < Domain true end + # rubocop:enable Metrics/AbcSize # rubocop:enable Metrics/MethodLength ### VALIDATIONS ### @@ -733,7 +753,7 @@ class Epp::Domain < Domain next end - unless DomainNameValidator.validate_reservation(x) + if ReservedDomain.pw_for(x).present? res << { name: x, avail: 0, reason: I18n.t('errors.messages.epp_domain_reserved') } next end diff --git a/app/models/invoice.rb b/app/models/invoice.rb index aa5a8c430..f55851849 100644 --- a/app/models/invoice.rb +++ b/app/models/invoice.rb @@ -7,7 +7,9 @@ class Invoice < ActiveRecord::Base accepts_nested_attributes_for :invoice_items - scope :unbinded, -> { where('id NOT IN (SELECT invoice_id FROM account_activities)') } + scope :unbinded, lambda { + where('id NOT IN (SELECT invoice_id FROM account_activities where invoice_id IS NOT NULL)') + } attr_accessor :billing_email validates :billing_email, format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i }, allow_blank: true @@ -15,11 +17,11 @@ class Invoice < ActiveRecord::Base validates :invoice_type, :due_date, :currency, :seller_name, :seller_iban, :buyer_name, :invoice_items, :vat_prc, presence: true - before_save :set_invoice_number + before_create :set_invoice_number def set_invoice_number last_no = Invoice.order(number: :desc).where('number IS NOT NULL').limit(1).pluck(:number).first - if last_no + if last_no && last_no >= Setting.invoice_number_min.to_i self.number = last_no + 1 else self.number = Setting.invoice_number_min.to_i @@ -36,16 +38,16 @@ class Invoice < ActiveRecord::Base class << self def cancel_overdue_invoices - logger.info "#{Time.zone.now.utc} - Cancelling overdue invoices\n" + STDOUT << "#{Time.zone.now.utc} - Cancelling overdue invoices\n" unless Rails.env.test? cr_at = Time.zone.now - Setting.days_to_keep_overdue_invoices_active.days invoices = Invoice.unbinded.where( - 'due_date < ? AND created_at < ? AND cancelled_at IS NULL', Time.zone.now, cr_at + 'due_date < ? AND cancelled_at IS NULL', cr_at ) count = invoices.update_all(cancelled_at: Time.zone.now) - logger.info "#{Time.zone.now.utc} - Successfully cancelled #{count} overdue invoices\n" + STDOUT << "#{Time.zone.now.utc} - Successfully cancelled #{count} overdue invoices\n" unless Rails.env.test? end end diff --git a/app/models/legal_document.rb b/app/models/legal_document.rb index 0972767f7..f1a63e976 100644 --- a/app/models/legal_document.rb +++ b/app/models/legal_document.rb @@ -15,7 +15,10 @@ class LegalDocument < ActiveRecord::Base loop do rand = SecureRandom.random_number.to_s.last(4) next if rand.to_i == 0 || rand.length < 4 - self.path = "#{ENV['legal_documents_dir']}/#{Time.zone.now.to_formatted_s(:number)}_#{rand}.#{document_type}" + + dir = "#{ENV['legal_documents_dir']}/#{Time.zone.now.strftime('%Y/%m/%d')}" + FileUtils.mkdir_p(dir) + self.path = "#{dir}/#{Time.zone.now.to_formatted_s(:number)}_#{rand}.#{document_type}" break unless File.file?(path) end diff --git a/app/models/nameserver.rb b/app/models/nameserver.rb index 0fad0ff5c..6206a4f16 100644 --- a/app/models/nameserver.rb +++ b/app/models/nameserver.rb @@ -47,8 +47,7 @@ class Nameserver < ActiveRecord::Base def replace_hostname_ends(domains, old_end, new_end) domains = domains.where('EXISTS( select 1 from nameservers ns where ns.domain_id = domains.id AND ns.hostname LIKE ? - )', "%#{old_end}" - ) + )', "%#{old_end}") count, success_count = 0.0, 0.0 domains.each do |d| diff --git a/app/models/pending.rb b/app/models/pending.rb deleted file mode 100644 index 07ab0bd88..000000000 --- a/app/models/pending.rb +++ /dev/null @@ -1,3 +0,0 @@ -class Pending < ActiveRecord::Base - belongs_to :domain -end diff --git a/app/models/pricelist.rb b/app/models/pricelist.rb index cfdb53776..bb37ad0e1 100644 --- a/app/models/pricelist.rb +++ b/app/models/pricelist.rb @@ -1,6 +1,8 @@ class Pricelist < ActiveRecord::Base include Versions # version/pricelist_version.rb + scope :valid, -> { where("valid_from <= ? AND valid_to >= ? OR valid_to IS NULL", Time.zone.now, Time.zone.now) } + monetize :price_cents validates :price_cents, :price_currency, :price, @@ -13,10 +15,18 @@ class Pricelist < ActiveRecord::Base after_initialize :init_values def init_values return unless new_record? - self.valid_from = Time.zone.now.beginning_of_year + self.valid_from = Time.zone.now.beginning_of_year unless valid_from end def name "#{operation_category} #{category}" end + + class << self + def pricelist_for(zone, operation, period) + lists = valid.where(category: zone, operation_category: operation, duration: period) + return lists.first if lists.count == 1 + lists.where('valid_to IS NOT NULL').order(valid_from: :desc).first + end + end end diff --git a/app/models/registrar.rb b/app/models/registrar.rb index 38f09aa04..1da3f2d20 100644 --- a/app/models/registrar.rb +++ b/app/models/registrar.rb @@ -12,6 +12,8 @@ class Registrar < ActiveRecord::Base has_many :priv_contacts, -> { privs }, class_name: 'Contact' has_many :white_ips, dependent: :destroy + delegate :balance, to: :cash_account + validates :name, :reg_no, :country_code, :email, :code, presence: true validates :name, :reg_no, :reference_no, :code, uniqueness: true validate :forbidden_codes @@ -64,42 +66,35 @@ class Registrar < ActiveRecord::Base res.reduce([]) { |o, v| o << { id: v[:id], display_key: "#{v[:name]} (#{v[:reg_no]})" } } end - def eis - find_by(reg_no: '90010019') - end - def ordered order(name: :asc) end end - def issue_prepayment_invoice(amount, description = nil) # rubocop:disable Metrics/MethodLength - # Currently only EIS can issue invoices - eis = self.class.eis - + # rubocop:disable Metrics/MethodLength + def issue_prepayment_invoice(amount, description = nil) invoices.create( invoice_type: 'DEB', due_date: Time.zone.now.to_date + 1.day, payment_term: 'prepayment', description: description, currency: 'EUR', - vat_prc: 0.2, - seller_id: eis.id, - seller_name: eis.name, - seller_reg_no: eis.reg_no, - seller_iban: Setting.eis_iban, - seller_bank: Setting.eis_bank, - seller_swift: Setting.eis_swift, - seller_vat_no: eis.vat_no, - seller_country_code: eis.country_code, - seller_state: eis.state, - seller_street: eis.street, - seller_city: eis.city, - seller_zip: eis.zip, - seller_phone: eis.phone, - seller_url: eis.url, - seller_email: eis.email, - seller_contact_name: Setting.eis_invoice_contact, + vat_prc: Setting.registry_vat_prc, + seller_name: Setting.registry_juridical_name, + seller_reg_no: Setting.registry_reg_no, + seller_iban: Setting.registry_iban, + seller_bank: Setting.registry_bank, + seller_swift: Setting.registry_swift, + seller_vat_no: Setting.registry_vat_no, + seller_country_code: Setting.registry_country_code, + seller_state: Setting.registry_state, + seller_street: Setting.registry_street, + seller_city: Setting.registry_city, + seller_zip: Setting.registry_zip, + seller_phone: Setting.registry_phone, + seller_url: Setting.registry_url, + seller_email: Setting.registry_email, + seller_contact_name: Setting.registry_invoice_contact, buyer_id: id, buyer_name: name, buyer_reg_no: reg_no, @@ -122,11 +117,23 @@ class Registrar < ActiveRecord::Base ] ) end + # rubocop:enable Metrics/MethodLength def cash_account accounts.find_by(account_type: Account::CASH) end + def debit!(args) + args[:sum] *= -1 + args[:currency] = 'EUR' + cash_account.account_activities.create!(args) + end + + def credit!(args) + args[:currency] = 'EUR' + cash_account.account_activities.create!(args) + end + def domain_transfers at = DomainTransfer.arel_table DomainTransfer.where( @@ -153,10 +160,12 @@ class Registrar < ActiveRecord::Base end def api_ip_white?(ip) + return true unless Setting.api_ip_whitelist_enabled white_ips.api.pluck(:ipv4, :ipv6).flatten.include?(ip) || global_ip_white?(ip) end def registrar_ip_white?(ip) + return true unless Setting.registrar_ip_whitelist_enabled white_ips.registrar.pluck(:ipv4, :ipv6).flatten.include?(ip) || global_ip_white?(ip) end diff --git a/app/models/reserved_domain.rb b/app/models/reserved_domain.rb index 807c44f91..61a57ec50 100644 --- a/app/models/reserved_domain.rb +++ b/app/models/reserved_domain.rb @@ -1,3 +1,9 @@ class ReservedDomain < ActiveRecord::Base include Versions # version/reserved_domain_version.rb + + class << self + def pw_for(domain_name) + select("names -> '#{domain_name}' AS pw").first.try(:pw) + end + end end diff --git a/app/models/version/blocked_domain_version.rb b/app/models/version/blocked_domain_version.rb new file mode 100644 index 000000000..82e6b30da --- /dev/null +++ b/app/models/version/blocked_domain_version.rb @@ -0,0 +1,4 @@ +class BlockedDomainVersion < PaperTrail::Version + self.table_name = :log_blocked_domains + self.sequence_name = :log_blocked_domains_id_seq +end diff --git a/app/models/white_ip.rb b/app/models/white_ip.rb index f62cb2f9f..d8f9dd7fa 100644 --- a/app/models/white_ip.rb +++ b/app/models/white_ip.rb @@ -24,6 +24,8 @@ class WhiteIp < ActiveRecord::Base class << self def registrar_ip_white?(ip) + return true unless Setting.registrar_ip_whitelist_enabled + at = WhiteIp.arel_table WhiteIp.where( at[:interface].eq(REGISTRAR).or( diff --git a/app/models/whois_record.rb b/app/models/whois_record.rb index e1b168935..5113b331f 100644 --- a/app/models/whois_record.rb +++ b/app/models/whois_record.rb @@ -30,6 +30,7 @@ class WhoisRecord < ActiveRecord::Base end # rubocop:disable Metrics/MethodLength + # rubocop:disable Metrics/AbcSize def generate_json h = HashWithIndifferentAccess.new return h if domain.blank? @@ -108,10 +109,11 @@ More information at http://internet.ee EOS end # rubocop:enable Metrics/MethodLength + # rubocop:enable Metrics/AbcSize def contacts_body(admins, techs) admins ||= [] - techs ||= [] + techs ||= [] out = '' out << (admins.size > 1 ? "\nAdministrative contacts" : "\nAdministrative contact") diff --git a/app/validators/date_time_iso8601_validator.rb b/app/validators/date_time_iso8601_validator.rb index d764620e8..cc77e0d9e 100644 --- a/app/validators/date_time_iso8601_validator.rb +++ b/app/validators/date_time_iso8601_validator.rb @@ -9,7 +9,7 @@ class DateTimeIso8601Validator < ActiveModel::EachValidator return true if value.empty? begin - DateTime.parse(value) + DateTime.zone.parse(value) rescue => _e return false end diff --git a/app/validators/domain_name_validator.rb b/app/validators/domain_name_validator.rb index 93046c882..79fec0291 100644 --- a/app/validators/domain_name_validator.rb +++ b/app/validators/domain_name_validator.rb @@ -2,8 +2,8 @@ class DomainNameValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) if !self.class.validate_format(value) record.errors[attribute] << (options[:message] || record.errors.generate_message(attribute, :invalid)) - elsif !self.class.validate_reservation(value) - record.errors.add(attribute, (options[:message] || record.errors.generate_message(attribute, :reserved))) + elsif !self.class.validate_blocked(value) + record.errors.add(attribute, (options[:message] || record.errors.generate_message(attribute, :blocked))) end end @@ -31,9 +31,9 @@ class DomainNameValidator < ActiveModel::EachValidator # rubocop: enable Style/DoubleNegation end - def validate_reservation(value) + def validate_blocked(value) return true unless value - !ReservedDomain.exists?(name: value.mb_chars.downcase.strip) + BlockedDomain.where("names @> ?::varchar[]", "{#{value}}").count == 0 end end end diff --git a/app/validators/object_count_validator.rb b/app/validators/object_count_validator.rb index b442a360a..d2d880fea 100644 --- a/app/validators/object_count_validator.rb +++ b/app/validators/object_count_validator.rb @@ -1,7 +1,9 @@ class ObjectCountValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) min, max = options[:min].call, options[:max].call - return if value.reject(&:marked_for_destruction?).length.between?(min, max) + values = value.reject(&:marked_for_destruction?) + + return if values.size.between?(min, max) association = options[:association] || attribute record.errors.add(association, :out_of_range, { min: min, max: max }) end diff --git a/app/views/admin/admin_users/_form.haml b/app/views/admin/admin_users/_form.haml index 9a9aa8a80..114a380d7 100644 --- a/app/views/admin/admin_users/_form.haml +++ b/app/views/admin/admin_users/_form.haml @@ -1,4 +1,4 @@ -= form_for([:admin, @admin_user], html: { class: 'form-horizontal' }) do |f| += form_for([:admin, @admin_user], html: { class: 'form-horizontal', autocomplete: 'off' }) do |f| = render 'shared/full_errors', object: @admin_user .row @@ -14,12 +14,12 @@ - not_required = @admin_user.new_record? ? '' : 'not-required' = f.label :password, class: not_required .col-md-8 - = f.password_field(:password, class: 'form-control') + = f.text_field(:password, class: 'form-control') .form-group .col-md-4.control-label = f.label :password_confirmation, class: not_required .col-md-8 - = f.password_field(:password_confirmation, class: 'form-control') + = f.text_field(:password_confirmation, class: 'form-control') %hr .form-group @@ -36,7 +36,7 @@ .col-md-4.control-label = f.label :country_code, t(:country) .col-md-8 - = f.select(:country_code, + = f.select(:country_code, SortedCountry.all_options(f.object.country_code), {}, class: 'form-control') %hr .form-group @@ -48,7 +48,7 @@ %hr .row .col-md-8.text-right - = button_tag(t(:save), class: 'btn btn-primary') + = button_tag(t(:save), class: 'btn btn-warning') :coffee $("#admin_user_password").removeAttr('required') diff --git a/app/views/admin/bank_statements/_form.haml b/app/views/admin/bank_statements/_form.haml new file mode 100644 index 000000000..158d69e89 --- /dev/null +++ b/app/views/admin/bank_statements/_form.haml @@ -0,0 +1,19 @@ += form_for([:admin, @bank_statement], html: { class: 'form-horizontal' }) do |f| + = render 'shared/full_errors', object: @bank_statement + + .row + .col-md-8 + .form-group + .col-md-4.control-label + = f.label :bank_code + .col-md-8 + = f.text_field(:bank_code, class: 'form-control') + .form-group + .col-md-4.control-label + = f.label :iban + .col-md-8 + = f.text_field(:iban, class: 'form-control') + %hr + .row + .col-md-8.text-right + = button_tag(t(:save), class: 'btn btn-warning') diff --git a/app/views/admin/bank_statements/import.haml b/app/views/admin/bank_statements/import.haml new file mode 100644 index 000000000..e432abdf1 --- /dev/null +++ b/app/views/admin/bank_statements/import.haml @@ -0,0 +1,20 @@ +- content_for :actions do + = link_to(t(:back_to_bank_statements), admin_bank_statements_path, class: 'btn btn-default') += render 'shared/title', name: t(:import_th6_bank_statement) + += form_for(@bank_statement, url: { action: :create_from_import }, multipart: true) do |f| + = render 'shared/full_errors', object: @bank_statement + + .row + .col-md-8 + .form-group + .col-md-4.control-label + = f.label :th6_file + .col-md-8 + = f.file_field :th6_file + .col-md-4 + %p= t(:bank_statement_desc).html_safe + %hr + .row + .col-md-8.text-right + = button_tag(t(:save), class: 'btn btn-primary') diff --git a/app/views/admin/bank_statements/index.haml b/app/views/admin/bank_statements/index.haml index afb3a7be1..0810c15fe 100644 --- a/app/views/admin/bank_statements/index.haml +++ b/app/views/admin/bank_statements/index.haml @@ -1,5 +1,6 @@ - content_for :actions do - = link_to(t(:import), new_admin_bank_statement_path, class: 'btn btn-primary') + = link_to(t(:add), new_admin_bank_statement_path, class: 'btn btn-primary') + = link_to(t(:import), import_admin_bank_statements_path, class: 'btn btn-primary') = render 'shared/title', name: t(:bank_statements) .row diff --git a/app/views/admin/bank_statements/new.haml b/app/views/admin/bank_statements/new.haml index 452ffd264..4e5ff09d3 100644 --- a/app/views/admin/bank_statements/new.haml +++ b/app/views/admin/bank_statements/new.haml @@ -1,20 +1,6 @@ - content_for :actions do - = link_to(t(:back_to_bank_statements), admin_bank_statements_path, class: 'btn btn-default') -= render 'shared/title', name: t(:import_th6_bank_statement) + = link_to(t(:back), admin_bank_statements_path, class: 'btn btn-default') -= form_for([:admin, @bank_statement], multipart: true) do |f| - = render 'shared/full_errors', object: @bank_statement += render 'shared/title', name: t(:create_bank_statement) - .row - .col-md-8 - .form-group - .col-md-4.control-label - = f.label :th6_file - .col-md-8 - = f.file_field :th6_file - .col-md-4 - %p= t(:bank_statement_desc).html_safe - %hr - .row - .col-md-8.text-right - = button_tag(t(:save), class: 'btn btn-primary') += render 'form' diff --git a/app/views/admin/bank_statements/show.haml b/app/views/admin/bank_statements/show.haml index 6eb808515..db8d64004 100644 --- a/app/views/admin/bank_statements/show.haml +++ b/app/views/admin/bank_statements/show.haml @@ -1,5 +1,5 @@ - content_for :actions do - = link_to(t(:bind_invoices), bind_invoices_admin_bank_statement_path, + = link_to(t(:bind_invoices), bind_invoices_admin_bank_statement_path, class: 'btn btn-primary', method: :post) = link_to(t(:back_to_bank_statements), admin_bank_statements_path, class: 'btn btn-default') = render 'shared/title', name: t(:bank_statement) @@ -23,17 +23,24 @@ - sc = 'text-danger' if @bank_statement.not_binded? %dd{class: sc}= t(@bank_statement.status) - %dt= t(:queried_at) - %dd= l(@bank_statement.queried_at) + - if @bank_statement.queried_at + %dt= t(:queried_at) + %dd= l(@bank_statement.queried_at) - %dt= t(:imported_at) + %dt= t(:created_at) %dd= l(@bank_statement.created_at) - if @bank_statement.import_file_path %dt= t(:import_file) %dd= link_to(t(:download), download_import_file_admin_bank_statement_path(@bank_statement)) -%h2.text-center-xs= t(:bank_transactions) +.row + .col-sm-6 + %h3.text-center-xs + = t(:bank_transactions) + .col-sm-6.text-right + %h3.text-right.text-center-xs + = link_to(t(:add), new_admin_bank_statement_bank_transaction_path(@bank_statement), class: 'btn btn-primary') %hr .row .col-md-12 diff --git a/app/views/admin/bank_transactions/_form.haml b/app/views/admin/bank_transactions/_form.haml new file mode 100644 index 000000000..244284fda --- /dev/null +++ b/app/views/admin/bank_transactions/_form.haml @@ -0,0 +1,71 @@ += form_for([:admin, @bank_statement, @bank_transaction], html: { class: 'form-horizontal' }) do |f| + = render 'shared/full_errors', object: @bank_transaction + + .row + .col-md-8 + - if @bank_transaction.persisted? + .form-group + = f.label :status, class: 'col-md-4 control-label' + - c = @bank_transaction.binded? ? 'text-success' : 'text-danger' + .col-md-8.form-control-static{class: c} + = @bank_transaction.binded? ? t(:binded) : t(:not_binded) + + .form-group + = f.label :description, class: 'col-md-4 control-label required' + .col-md-8 + = f.text_field(:description, class: 'form-control', required: true) + + .form-group + = f.label :sum, class: 'col-md-4 control-label required' + .col-md-8 + = f.text_field(:sum, class: 'form-control', required: true) + + .form-group + = f.label :reference_no, class: 'col-md-4 control-label required' + .col-md-8 + = f.text_field(:reference_no, class: 'form-control', required: true) + + .form-group + = f.label :document_no, class: 'col-md-4 control-label' + .col-md-8 + = f.text_field(:document_no, class: 'form-control') + + .form-group + = f.label :bank_reference, class: 'col-md-4 control-label' + .col-md-8 + = f.text_field(:bank_reference, class: 'form-control') + + .form-group + = f.label :iban, class: 'col-md-4 control-label' + .col-md-8 + = f.text_field(:iban, class: 'form-control') + + .form-group + = f.label :buyer_bank_code, class: 'col-md-4 control-label' + .col-md-8 + = f.text_field(:buyer_bank_code, class: 'form-control') + + .form-group + = f.label :buyer_iban, class: 'col-md-4 control-label' + .col-md-8 + = f.text_field(:buyer_iban, class: 'form-control') + + .form-group + = f.label :buyer_name, class: 'col-md-4 control-label' + .col-md-8 + = f.text_field(:buyer_name, class: 'form-control') + + .form-group + = f.label :currency, class: 'col-md-4 control-label' + .col-md-8 + = f.text_field(:currency, class: 'form-control', readonly: true) + + .form-group + = f.label :paid_at, class: 'col-md-4 control-label required' + .col-md-8 + = f.text_field(:paid_at, class: 'form-control datepicker', required: true) + + %hr + .row + .col-md-8.text-right + = button_tag(t(:save), class: 'btn btn-warning') diff --git a/app/views/admin/bank_transactions/edit.haml b/app/views/admin/bank_transactions/edit.haml index 5c38ea6e0..8bb5a2666 100644 --- a/app/views/admin/bank_transactions/edit.haml +++ b/app/views/admin/bank_transactions/edit.haml @@ -2,73 +2,4 @@ = link_to(t(:back), admin_bank_transaction_path(@bank_transaction), class: 'btn btn-default') = render 'shared/title', name: t(:bank_transaction) -= form_for([:admin, @bank_transaction], html: { class: 'form-horizontal' }) do |f| - = render 'shared/full_errors', object: @bank_transaction - - .row - .col-md-8 - .form-group - = f.label :status, class: 'col-md-2 control-label' - - c = @bank_transaction.binded? ? 'text-success' : 'text-danger' - .col-md-10.form-control-static{class: c} - = @bank_transaction.binded? ? t(:binded) : t(:not_binded) - - .form-group - = f.label :description, class: 'col-md-2 control-label' - .col-md-10 - = f.text_field(:description, class: 'form-control') - - .form-group - = f.label :sum, class: 'col-md-2 control-label' - .col-md-10 - = f.text_field(:sum, class: 'form-control') - - .form-group - = f.label :reference_no, class: 'col-md-2 control-label' - .col-md-10 - = f.text_field(:reference_no, class: 'form-control') - - .form-group - = f.label :document_no, class: 'col-md-2 control-label' - .col-md-10 - = f.text_field(:document_no, class: 'form-control', disabled: :disabled) - - .form-group - = f.label :bank_reference, class: 'col-md-2 control-label' - .col-md-10 - = f.text_field(:bank_reference, class: 'form-control', disabled: :disabled) - - .form-group - = f.label :iban, class: 'col-md-2 control-label' - .col-md-10 - = f.text_field(:iban, class: 'form-control', disabled: :disabled) - - .form-group - = f.label :buyer_bank_code, class: 'col-md-2 control-label' - .col-md-10 - = f.text_field(:buyer_bank_code, class: 'form-control', disabled: :disabled) - - .form-group - = f.label :buyer_iban, class: 'col-md-2 control-label' - .col-md-10 - = f.text_field(:buyer_iban, class: 'form-control', disabled: :disabled) - - .form-group - = f.label :buyer_name, class: 'col-md-2 control-label' - .col-md-10 - = f.text_field(:buyer_name, class: 'form-control', disabled: :disabled) - - .form-group - = f.label :currency, class: 'col-md-2 control-label' - .col-md-10 - = f.text_field(:currency, class: 'form-control', disabled: :disabled) - - .form-group - = f.label :paid_at, class: 'col-md-2 control-label' - .col-md-10 - = f.text_field(:paid_at, class: 'form-control', disabled: :disabled) - - %hr - .row - .col-md-8.text-right - = button_tag(t(:save), class: 'btn btn-primary') += render 'form' diff --git a/app/views/admin/bank_transactions/new.haml b/app/views/admin/bank_transactions/new.haml new file mode 100644 index 000000000..403eb415e --- /dev/null +++ b/app/views/admin/bank_transactions/new.haml @@ -0,0 +1,6 @@ +- content_for :actions do + = link_to(t(:back), admin_bank_statement_path(@bank_statement), class: 'btn btn-default') + += render 'shared/title', name: t(:create_bank_transaction) + += render 'form' diff --git a/app/views/admin/blocked_domains/index.haml b/app/views/admin/blocked_domains/index.haml new file mode 100644 index 000000000..bd5660193 --- /dev/null +++ b/app/views/admin/blocked_domains/index.haml @@ -0,0 +1,10 @@ += render 'shared/title', name: t(:blocked_domains) + += form_tag([:admin, :blocked_domains]) do |f| + .row + .col-md-12 + = text_area_tag :blocked_domains, @blocked_domains, class: 'form-control', rows: 30 + %hr + .row + .col-md-12.text-right + %button.btn.btn-warning=t(:save) diff --git a/app/views/admin/domains/partials/_general.haml b/app/views/admin/domains/partials/_general.haml index 53c73c65b..91b4aeabd 100644 --- a/app/views/admin/domains/partials/_general.haml +++ b/app/views/admin/domains/partials/_general.haml @@ -10,7 +10,7 @@ %dd= l(@domain.registered_at) %dt= t(:registrar) - %dd= link_to(@domain.registrar, root_path) + %dd= link_to(@domain.registrar, admin_registrar_path(@domain.registrar)) %dt= t(:password) %dd diff --git a/app/views/admin/invoices/forward.haml b/app/views/admin/invoices/forward.haml new file mode 100644 index 000000000..25f59d3ad --- /dev/null +++ b/app/views/admin/invoices/forward.haml @@ -0,0 +1,15 @@ +- content_for :actions do + = link_to(t(:back_to_invoice), admin_invoice_path(@invoice), class: 'btn btn-default') += render 'shared/title', name: t(:forward_invoice) + += form_for([:admin, @invoice], url: { action: :forward }, method: :post) do |f| + .row + .col-md-4.col-md-offset-4 + = render 'shared/full_errors', object: @invoice + .form-group + = f.label :billing_email + = f.text_field :billing_email, class: 'form-control', autocomplete: 'off' + + .row + .col-md-12.text-right + = button_tag(t(:forward), class: 'btn btn-warning') diff --git a/app/views/admin/invoices/index.haml b/app/views/admin/invoices/index.haml index 45efe74de..837300133 100644 --- a/app/views/admin/invoices/index.haml +++ b/app/views/admin/invoices/index.haml @@ -1,7 +1,7 @@ -.row - .col-sm-12 - %h2.text-center-xs= t(:invoices) -%hr +- content_for :actions do + = link_to(t(:add), new_admin_invoice_path, class: 'btn btn-primary') += render 'shared/title', name: t(:invoices) + .row .col-md-12 .table-responsive diff --git a/app/views/admin/invoices/new.haml b/app/views/admin/invoices/new.haml new file mode 100644 index 000000000..3b10341af --- /dev/null +++ b/app/views/admin/invoices/new.haml @@ -0,0 +1,33 @@ +- content_for :actions do + = link_to(t(:back), admin_invoices_path, class: 'btn btn-default') += render 'shared/title', name: t(:create_new_invoice) + += form_for([:admin, @deposit], url: admin_invoices_path, method: :post, html: { class: 'form-horizontal' }) do |f| + = render 'shared/full_errors', object: @deposit + + .row + .col-md-8 + .form-group + .col-md-4.control-label + = f.label :registrar_id, class: 'required' + .col-md-8 + = f.select :registrar_id, Registrar.all.map { |r| [r.name, r.id] }, { include_blank: true }, class: 'form-control selectize', required: true + + .form-group + .col-md-4.control-label + = f.label :amount, class: 'required' + .col-md-8 + .input-group + = f.text_field :amount, class: 'form-control', required: true + .input-group-addon + EUR + + .form-group + .col-md-4.control-label + = f.label :description + .col-md-8 + = f.text_area :description, class: 'form-control' + %hr + .row + .col-md-8.text-right + = button_tag(t(:save), class: 'btn btn-warning') diff --git a/app/views/admin/invoices/show.haml b/app/views/admin/invoices/show.haml index 9bab21f1d..1d8480da4 100644 --- a/app/views/admin/invoices/show.haml +++ b/app/views/admin/invoices/show.haml @@ -4,8 +4,10 @@ = @invoice .col-sm-6 %h1.text-right.text-center-xs + = link_to(t(:download), admin_invoice_download_pdf_path(@invoice), class: 'btn btn-default') + = link_to(t(:forward), admin_invoice_forward_path(@invoice), class: 'btn btn-default') - if !@invoice.cancelled? && !@invoice.binded? - = link_to(t(:cancel), cancel_admin_invoice_path(@invoice), method: :patch, class: 'btn btn-default') + = link_to(t(:cancel), cancel_admin_invoice_path(@invoice), method: :patch, class: 'btn btn-warning') = link_to(t(:back), admin_invoices_path, class: 'btn btn-default') %hr = render 'shared/full_errors', object: @invoice diff --git a/app/views/admin/pricelists/_form.haml b/app/views/admin/pricelists/_form.haml index 9ac3c4fa2..9e1715e72 100644 --- a/app/views/admin/pricelists/_form.haml +++ b/app/views/admin/pricelists/_form.haml @@ -29,5 +29,7 @@ %hr .row .col-md-12.text-right - = button_tag(t(:save), class: 'btn btn-primary') - + = button_tag(t(:save), class: 'btn btn-warning') + - if !f.object.new_record? && can?(:delete, f.object) + = link_to t(:delete), admin_pricelist_path(f.object), + method: :delete, data: { confirm: t(:are_you_sure_destroy) }, class: 'btn btn-danger' diff --git a/app/views/admin/reserved_domains/index.haml b/app/views/admin/reserved_domains/index.haml new file mode 100644 index 000000000..9dd6955bd --- /dev/null +++ b/app/views/admin/reserved_domains/index.haml @@ -0,0 +1,10 @@ += render 'shared/title', name: t(:reserved_domains) + += form_tag([:admin, :reserved_domains]) do |f| + .row + .col-md-12 + = text_area_tag :reserved_domains, @reserved_domains, class: 'form-control', rows: 30 + %hr + .row + .col-md-12.text-right + %button.btn.btn-warning=t(:save) diff --git a/app/views/admin/settings/index.haml b/app/views/admin/settings/index.haml index cd0e1d9a4..85926fcef 100644 --- a/app/views/admin/settings/index.haml +++ b/app/views/admin/settings/index.haml @@ -21,6 +21,7 @@ = render 'setting_row', var: :dnskeys_max_count = render 'setting_row', var: :ns_min_count = render 'setting_row', var: :ns_max_count + = render 'setting_row', var: :expire_pending_confirmation .panel.panel-default .panel-heading.clearfix @@ -36,24 +37,6 @@ = 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) @@ -67,6 +50,51 @@ = render 'setting_row', var: :transfer_wait_time = render 'setting_row', var: :ds_algorithm = render 'setting_row', var: :client_side_status_editing_enabled + = render 'setting_row', var: :api_ip_whitelist_enabled + = render 'setting_row', var: :registrar_ip_whitelist_enabled + + .panel.panel-default + .panel-heading.clearfix + = t(:billing_settings) + .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: :invoice_number_min + = render 'setting_row', var: :invoice_number_max + = render 'setting_row', var: :days_to_keep_overdue_invoices_active + = render 'setting_row', var: :registry_billing_email + = render 'setting_row', var: :registry_invoice_contact + = render 'setting_row', var: :registry_vat_no + = render 'setting_row', var: :registry_vat_prc + = render 'setting_row', var: :registry_bank + = render 'setting_row', var: :registry_iban + = render 'setting_row', var: :registry_swift + + .panel.panel-default + .panel-heading.clearfix + = t(:registry_settings) + .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: :registry_juridical_name + = render 'setting_row', var: :registry_reg_no + = render 'setting_row', var: :registry_email + = render 'setting_row', var: :registry_phone + = render 'setting_row', var: :registry_url + = render 'setting_row', var: :registry_street + = render 'setting_row', var: :registry_city + = render 'setting_row', var: :registry_state + = render 'setting_row', var: :registry_zip + = render 'setting_row', var: :registry_country_code + .row .col-md-12.text-right %button.btn.btn-primary=t(:save) diff --git a/app/views/domain_mailer/pending_deleted.html.erb b/app/views/domain_mailer/pending_deleted.html.erb index a6ba283e0..972318ee4 100644 --- a/app/views/domain_mailer/pending_deleted.html.erb +++ b/app/views/domain_mailer/pending_deleted.html.erb @@ -4,7 +4,7 @@ Registrisse laekus taotlus domeeni <%= @domain.name %> kustutamiseks. Palun veen

Muudatuse kinnitamiseks külastage palun allolevat võrgulehekülge, kontrollige uuesti üle muudatuse andmed ning vajutage nuppu kinnitan:

-Taotlus on aktiivne <48> tundi ja lükatakse automaatselt tagasi kui te seda enne ise ei kinnita või tagasi lükka.
+Taotlus on aktiivne <%= Setting.expire_pending_confirmation %> tundi ja lükatakse automaatselt tagasi kui te seda enne ise ei kinnita või tagasi lükka.
<%= link_to @verification_url, @verification_url %>

Lugupidamisega
@@ -19,7 +19,7 @@ Application for deletion of your domain <%= @domain.name %> has been filed. Plea To confirm the update please visit this website, once again review the data and press approve:
<%= link_to @verification_url, @verification_url %>

-The application will remain in pending status for <48> hrs and will be automaticcally rejected if it is not approved nor rejected before. +The application will remain in pending status for <%= Setting.expire_pending_confirmation %> hrs and will be automaticcally rejected if it is not approved nor rejected before.

Best Regards,
Estonian Internet Foundation diff --git a/app/views/domain_mailer/pending_deleted.text.erb b/app/views/domain_mailer/pending_deleted.text.erb index da9763c55..80e01945a 100644 --- a/app/views/domain_mailer/pending_deleted.text.erb +++ b/app/views/domain_mailer/pending_deleted.text.erb @@ -4,7 +4,7 @@ Registrisse laekus taotlus domeeni <%= @domain.name %> kustutamiseks. Palun veen Muudatuse kinnitamiseks külastage palun allolevat võrgulehekülge, kontrollige uuesti üle muudatuse andmed ning vajutage nuppu kinnitan: -Taotlus on aktiivne <48> tundi ja lükatakse automaatselt tagasi kui te seda enne ise ei kinnita või tagasi lükka. +Taotlus on aktiivne <%= Setting.expire_pending_confirmation %> tundi ja lükatakse automaatselt tagasi kui te seda enne ise ei kinnita või tagasi lükka. <%= link_to @verification_url, @verification_url %> Lugupidamisega @@ -19,7 +19,7 @@ Application for deletion of your domain <%= @domain.name %> has been filed. Plea To confirm the update please visit this website, once again review the data and press approve: <%= link_to @verification_url, @verification_url %> -The application will remain in pending status for <48> hrs and will be automaticcally rejected if it is not approved nor rejected before. +The application will remain in pending status for <%= Setting.expire_pending_confirmation %> hrs and will be automaticcally rejected if it is not approved nor rejected before. Best Regards, Estonian Internet Foundation diff --git a/app/views/domain_mailer/registrant_pending_updated.html.erb b/app/views/domain_mailer/registrant_pending_updated.html.erb index 9f071df10..2689eff68 100644 --- a/app/views/domain_mailer/registrant_pending_updated.html.erb +++ b/app/views/domain_mailer/registrant_pending_updated.html.erb @@ -13,7 +13,9 @@ Tänav: <%= @domain.registrant_street %>
Linn: <%= @domain.registrant_city %>
Riik: <%= @domain.registrant_country %>

+Taotlus on aktiivne <%= Setting.expire_pending_confirmation %> tundi ja lükatakse automaatselt tagasi kui te seda enne ise ei kinnita või tagasi lükka.
Muudatuse kinnitamiseks külastage palun allolevat võrgulehekülge, kontrollige uuesti üle muudatuse andmed ning vajutage nuppu kinnitan:
+ <%= link_to @verification_url, @verification_url %>

Lugupidamisega
@@ -36,6 +38,7 @@ Street: <%= @domain.registrant_street %>
City: <%= @domain.registrant_city %>
Country: <%= @domain.registrant_country %>

+The application will remain in pending status for <%= Setting.expire_pending_confirmation %> hrs and will be automaticcally rejected if it is not approved nor rejected before.
To confirm the update please visit this website, once again review the data and press approve:
<%= link_to @verification_url, @verification_url %>

diff --git a/app/views/domain_mailer/registrant_pending_updated.text.erb b/app/views/domain_mailer/registrant_pending_updated.text.erb index 228c7f0a4..04a85bf5e 100644 --- a/app/views/domain_mailer/registrant_pending_updated.text.erb +++ b/app/views/domain_mailer/registrant_pending_updated.text.erb @@ -13,6 +13,7 @@ Tänav: <%= @domain.registrant_street %> Linn: <%= @domain.registrant_city %> Riik: <%= @domain.registrant_country %> +Taotlus on aktiivne <%= Setting.expire_pending_confirmation %> tundi ja lükatakse automaatselt tagasi kui te seda enne ise ei kinnita või tagasi lükka. Muudatuse kinnitamiseks külastage palun allolevat võrgulehekülge, kontrollige uuesti üle muudatuse andmed ning vajutage nuppu kinnitan: <%= @verification_url %> @@ -36,6 +37,7 @@ Street: <%= @domain.registrant_street %> City: <%= @domain.registrant_city %> Country: <%= @domain.registrant_country %> +The application will remain in pending status for <%= Setting.expire_pending_confirmation %> hrs and will be automaticcally rejected if it is not approved nor rejected before. To confirm the update please visit this website, once again review the data and press approve: <%= @verification_url %> diff --git a/app/views/domain_mailer/registrant_updated.html.erb b/app/views/domain_mailer/registrant_updated.html.erb new file mode 100644 index 000000000..eb8352b8e --- /dev/null +++ b/app/views/domain_mailer/registrant_updated.html.erb @@ -0,0 +1,39 @@ +Tere, +

+Domeeni <%= @domain.name %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud. +

+Uued registreerija andmed:
+Nimi: <%= @domain.registrant_name %>
+<% if @domain.registrant.priv? %> +Isikukood: <%= @domain.registrant_ident %>
+<% else %> +Äriregistrikood: <%= @domain.registrant_ident %>
+<% end %> +Epost: <%= @domain.registrant_email %>
+Tänav: <%= @domain.registrant_street %>
+Linn: <%= @domain.registrant_city %>
+Riik: <%= @domain.registrant_country %> +

+Lugupidamisega
+Eesti Interneti SA +

+
+

+Hi, +

+Process for changing registrant of the domain <%= @domain.name %> has been approved and the data in the registry is updated. +

+New registrant:
+Name: <%= @domain.registrant_name %>
+<% if @domain.registrant.priv? %> +Personal code: <%= @domain.registrant_ident %>
+<% else %> +Business Registry code: <%= @domain.registrant_ident %>
+<% end %> +E-mail: <%= @domain.registrant_email %>
+Street: <%= @domain.registrant_street %>
+City: <%= @domain.registrant_city %>
+Country: <%= @domain.registrant_country %> +

+Best Regards,
+Estonian Internet Foundation diff --git a/app/views/domain_mailer/registrant_updated.text.erb b/app/views/domain_mailer/registrant_updated.text.erb new file mode 100644 index 000000000..503c111f6 --- /dev/null +++ b/app/views/domain_mailer/registrant_updated.text.erb @@ -0,0 +1,39 @@ +Tere, + +Domeeni <%= @domain.name %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud. + +Uued registreerija andmed: +Nimi: <%= @domain.registrant_name %> +<% if @domain.registrant.priv? %> +Isikukood: <%= @domain.registrant_ident %> +<% else %> +Äriregistrikood: <%= @domain.registrant_ident %> +<% end %> +Epost: <%= @domain.registrant_email %> +Tänav: <%= @domain.registrant_street %> +Linn: <%= @domain.registrant_city %> +Riik: <%= @domain.registrant_country %> + +Lugupidamisega +Eesti Interneti SA + +-------------------------------------- + +Hi, + +Process for changing registrant of the domain <%= @domain.name %> has been approved and the data in the registry is updated. + +New registrant: +Name: <%= @domain.registrant_name %> +<% if @domain.registrant.priv? %> +Personal code: <%= @domain.registrant_ident %> +<% else %> +Business Registry code: <%= @domain.registrant_ident %> +<% end %> +E-mail: <%= @domain.registrant_email %> +Street: <%= @domain.registrant_street %> +City: <%= @domain.registrant_city %> +Country: <%= @domain.registrant_country %> + +Best Regards, +Estonian Internet Foundation diff --git a/app/views/invoice_mailer/invoice_email.html.erb b/app/views/invoice_mailer/invoice_email.html.erb index 0a9e4163b..35f0dbb6e 100644 --- a/app/views/invoice_mailer/invoice_email.html.erb +++ b/app/views/invoice_mailer/invoice_email.html.erb @@ -1,5 +1,5 @@ <%= t(:you_have_a_new_invoice) %>

<%= t(:sincerely) %>,
-<%= Setting.eis_invoice_contact %>
+<%= Setting.registry_invoice_contact %>
<%= @invoice.seller_phone %> diff --git a/app/views/invoice_mailer/invoice_email.text.erb b/app/views/invoice_mailer/invoice_email.text.erb index ae65fd7da..ab8595474 100644 --- a/app/views/invoice_mailer/invoice_email.text.erb +++ b/app/views/invoice_mailer/invoice_email.text.erb @@ -1,5 +1,5 @@ <%= t(:you_have_a_new_invoice) %> <%= t(:sincerely) %>, -<%= Setting.eis_invoice_contact %> +<%= Setting.registry_invoice_contact %> <%= @invoice.seller_phone %> diff --git a/app/views/layouts/admin/application.haml b/app/views/layouts/admin/application.haml index 2cde75596..da411864c 100644 --- a/app/views/layouts/admin/application.haml +++ b/app/views/layouts/admin/application.haml @@ -59,9 +59,8 @@ %li.dropdown-header= t(:system) %li= link_to t(:settings), admin_settings_path %li= link_to t(:zonefile), admin_zonefile_settings_path - %li.dropdown-header= t(:system) - %li= link_to t(:settings), admin_settings_path - %li= link_to t(:zonefile), admin_zonefile_settings_path + %li= link_to t(:blocked_domains), admin_blocked_domains_path + %li= link_to t(:reserved_domains), admin_reserved_domains_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(:repp_logs), admin_repp_logs_path diff --git a/app/views/registrar/account_activities/index.haml b/app/views/registrar/account_activities/index.haml index 45783d727..371184cf9 100644 --- a/app/views/registrar/account_activities/index.haml +++ b/app/views/registrar/account_activities/index.haml @@ -1,29 +1,67 @@ - content_for :actions do = link_to(t(:back_to_billing), registrar_invoices_path, class: 'btn btn-default') + = link_to(t(:export_csv), url_for(params.merge(format: 'csv')), class: 'btn btn-default') + = render 'shared/title', name: t(:account_activity) +.row + .col-md-12 + = search_form_for @q, url: [:registrar, :account_activities], html: { style: 'margin-bottom: 0;' } do |f| + .row + .col-md-6 + .form-group + = f.label t(:activity_type) + = f.select :activity_type_in, AccountActivity.types_for_select, {}, class: 'form-control js-combobox', placeholder: t(:choose), multiple: true + .col-md-6 + .form-group + = f.label t(:description) + = f.search_field :description_cont, class: 'form-control', placeholder: t(:description), autocomplete: 'off' + .row + .col-md-3 + .form-group + = f.label t(:receipt_date_from) + = f.search_field :created_at_gteq, value: params[:q][:created_at_gteq], class: 'form-control datepicker', placeholder: t(:receipt_date_from), autocomplete: 'off' + .col-md-3 + .form-group + = f.label t(:receipt_date_until) + = f.search_field :created_at_lteq, value: params[:q][:created_at_lteq], class: 'form-control datepicker', placeholder: t(:receipt_date_until), autocomplete: 'off' + .col-md-6{style: 'padding-top: 25px;'} + %button.btn.btn-default +   + %span.glyphicon.glyphicon-search +   + %button.btn.btn-default.js-reset-form + = t(:clear_fields) +%hr + .row .col-md-12 .table-responsive %table.table.table-hover.table-condensed %thead %tr - %th{class: 'col-xs-5'}= t(:description) - %th{class: 'col-xs-3'}= t(:receipt_date) - %th{class: 'col-xs-2'}= t(:invoice) - %th{class: 'col-xs-2'}= t(:sum) + %th{class: 'col-xs-5'} + = sort_link(@q, 'description') + %th{class: 'col-xs-2'} + = sort_link(@q, 'activity_type') + %th{class: 'col-xs-3'} + = sort_link(@q, 'created_at', t(:receipt_date)) + %th{class: 'col-xs-2'} + = sort_link(@q, 'sum') %tbody - @account_activities.each do |x| %tr %td= x.description.present? ? x.description : '-' + %td= x.activity_type ? t(x.activity_type) : '' %td= l(x.created_at) - - if x.invoice - %td= link_to(x.invoice, [:registrar, x.invoice]) - - else - %td \- - c = x.sum > 0.0 ? 'text-success' : 'text-danger' - s = x.sum > 0.0 ? "+#{x.sum} #{x.currency}" : "#{x.sum} #{x.currency}" %td{class: c}= s .row .col-md-12 = paginate @account_activities + +:coffee + $(".js-reset-form").on "click", (e) -> + e.preventDefault(); + window.location = "#{registrar_account_activities_path}" diff --git a/app/views/registrar/domains/form_partials/_general.haml b/app/views/registrar/domains/form_partials/_general.haml index bde4ff67f..8057a1848 100644 --- a/app/views/registrar/domains/form_partials/_general.haml +++ b/app/views/registrar/domains/form_partials/_general.haml @@ -5,7 +5,7 @@ = label_tag :domain_name, t(:name), class: 'required' .col-md-7 - readonly = params[:domain_name] ? true : false - = text_field_tag('domain[name]', @domain_params[:name], + = text_field_tag('domain[name]', @domain_params[:name], class: 'form-control', readonly: readonly, required: true) - unless params[:domain_name] @@ -13,13 +13,20 @@ .col-md-3.control-label = label_tag :domain_period, t(:period), class: 'required' .col-md-7 - = select_tag 'domain[period]', + = select_tag 'domain[period]', options_for_select(Depp::Domain::PERIODS, @domain_params[:period]), { class: 'form-control' } .form-group .col-md-3.control-label = label_tag :domain_registrant, t(:registrant), class: 'required' .col-md-7 - = select_tag "domain[registrant]", + = select_tag "domain[registrant]", options_for_select(@contacts_autocomplete_map, selected: @domain_params[:registrant]), include_blank: true, class: 'js-combobox', required: true + + - unless params[:domain_name] + .form-group + .col-md-3.control-label + = label_tag :domain_reserved_pw, t(:reserved_pw) + .col-md-7 + = text_field_tag('domain[reserved_pw]', @domain_params[:reserved_pw], class: 'form-control') diff --git a/app/views/registrar/domains/transfer_index.haml b/app/views/registrar/domains/transfer_index.haml index ecc5ff1a4..ccdfea305 100644 --- a/app/views/registrar/domains/transfer_index.haml +++ b/app/views/registrar/domains/transfer_index.haml @@ -22,6 +22,6 @@ = file_field_tag 'legal_document' .form-group .col-md-10.text-right - %button.btn.btn-warning{ name: 'query' }= t(:transfer) + %button.btn.btn-warning{ name: 'request' }= t(:transfer) /%button.btn.btn-warning{ name: 'approve' }= t(:approve) /%button.btn.btn-warning{ name: 'reject' }= t(:reject) diff --git a/app/views/registrar/invoices/index.haml b/app/views/registrar/invoices/index.haml index d0c38940b..e20158ea7 100644 --- a/app/views/registrar/invoices/index.haml +++ b/app/views/registrar/invoices/index.haml @@ -23,12 +23,12 @@ = f.search_field :number_lteq, class: 'form-control', placeholder: t(:maximum_invoice_no), autocomplete: 'off' .col-md-3 .form-group - = f.label t(:due_date_after) - = f.search_field :due_date_gt, value: params[:q][:due_date_gt], class: 'form-control datepicker', placeholder: t(:due_date_after), autocomplete: 'off' + = f.label t(:due_date_from) + = f.search_field :due_date_gteq, value: params[:q][:due_date_gteq], class: 'form-control datepicker', placeholder: t(:due_date_from), autocomplete: 'off' .col-md-3 .form-group - = f.label t(:due_date_before) - = f.search_field :due_date_lt, value: params[:q][:due_date_lt], class: 'form-control datepicker', placeholder: t(:due_date_before), autocomplete: 'off' + = f.label t(:due_date_until) + = f.search_field :due_date_lteq, value: params[:q][:due_date_lteq], class: 'form-control datepicker', placeholder: t(:due_date_until), autocomplete: 'off' .row .col-md-3 .form-group diff --git a/bin/delayed_job b/bin/delayed_job deleted file mode 100755 index edf195985..000000000 --- a/bin/delayed_job +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env ruby - -require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment')) -require 'delayed/command' -Delayed::Command.new(ARGV).daemonize diff --git a/bin/robot b/bin/robot index 0e77d4fba..a9255c78d 100755 --- a/bin/robot +++ b/bin/robot @@ -31,8 +31,6 @@ bundle install RAILS_ENV=test bundle exec rake db:all:drop RAILS_ENV=test bundle exec rake db:all:setup -RAILS_ENV=test bundle exec rake zonefile:replace_procedure -RAILS_ENV=test bundle exec rake assets:precompile echo "GIT_LAST_COMMITS" git log --pretty='%s (%cn, %cr)' --abbrev-commit --graph --decorate -n 20 --no-color @@ -44,7 +42,7 @@ RCODE=$? echo "END_OF_RUBOCOP_RESULTS" echo "TEST_RESULTS" -# basic test +# basic tests without EPP # ROBOT=true bundle exec rake # all tests with EPP diff --git a/config/application-example.yml b/config/application-example.yml index 24a551769..c01412138 100644 --- a/config/application-example.yml +++ b/config/application-example.yml @@ -9,6 +9,7 @@ time_zone: 'Tallinn' # more zones by rake time:zones:all # 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. new_relic_app_name: 'Admin, EPP, REPP, Registrar, Registrant' +new_relic_license_key: '42d1c2ba4ed17a9cf6297c59d80e563a3dd3c4fa' # You can use `rake secret` to generate a secure secret key. # Your secret key is used for verifying the integrity of signed cookies. diff --git a/config/application.rb b/config/application.rb index 9931ce25e..3fe81b40c 100644 --- a/config/application.rb +++ b/config/application.rb @@ -21,8 +21,8 @@ module Registry # 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. - config.time_zone = ENV['time_zone'] # NB! It should be defined, - # otherwise ActiveRecord usese other class internally. + config.time_zone = ENV['time_zone'] || 'Tallinn' # 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. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] diff --git a/config/daemons.yml b/config/daemons.yml new file mode 100644 index 000000000..29ce969f4 --- /dev/null +++ b/config/daemons.yml @@ -0,0 +1,7 @@ +dir_mode: script +dir: ../../log +multiple: true +backtrace: true +monitor: true +ontop: false +app_name: 'que' diff --git a/config/deploy.rb b/config/deploy.rb index ddb993b17..05eb64ab4 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -16,6 +16,7 @@ set :deploy_to, '$HOME/registry' set :repository, 'https://github.com/domify/registry' # dev repo set :branch, 'master' set :rails_env, 'alpha' +set :que_restart, true # alpha branch, only use for heavy debugging task :epp do @@ -24,6 +25,7 @@ task :epp do set :repository, 'https://github.com/domify/registry' # dev repo set :branch, 'master' set :rails_env, 'alpha' + set :que_restart, false end # alpha branch, only use for heavy debugging @@ -33,6 +35,7 @@ task :registrar do set :repository, 'https://github.com/domify/registry' # dev repo set :branch, 'master' set :rails_env, 'alpha' + set :que_restart, false end # alpha branch, only use for heavy debugging @@ -42,6 +45,7 @@ task :registrant do set :repository, 'https://github.com/domify/registry' # dev repo set :branch, 'master' set :rails_env, 'alpha' + set :que_restart, false end # staging @@ -51,6 +55,7 @@ task :st do set :repository, 'https://github.com/internetee/registry' # production repo set :branch, 'staging' set :rails_env, 'staging' + set :que_restart, true end # staging @@ -60,6 +65,7 @@ task :eppst do set :repository, 'https://github.com/internetee/registry' # production repo set :branch, 'staging' set :rails_env, 'staging' + set :que_restart, false end # staging @@ -69,6 +75,7 @@ task :registrarst do set :repository, 'https://github.com/internetee/registry' # production repo set :branch, 'staging' set :rails_env, 'staging' + set :que_restart, false end # staging @@ -78,6 +85,7 @@ task :registrantst do set :repository, 'https://github.com/internetee/registry' # production repo set :branch, 'staging' set :rails_env, 'staging' + set :que_restart, false end # production @@ -87,6 +95,7 @@ task :pr do set :repository, 'https://github.com/internetee/registry' # production repo set :branch, 'master' set :rails_env, 'production' + set :que_restart, true end # production @@ -96,6 +105,7 @@ task :epppr do set :repository, 'https://github.com/internetee/registry' # production repo set :branch, 'master' set :rails_env, 'production' + set :que_restart, false end # production @@ -105,6 +115,7 @@ task :registrarpr do set :repository, 'https://github.com/internetee/registry' # production repo set :branch, 'master' set :rails_env, 'production' + set :que_restart, false end # production @@ -114,6 +125,7 @@ task :registrantpr do set :repository, 'https://github.com/internetee/registry' # production repo set :branch, 'master' set :rails_env, 'production' + set :que_restart, false end # Manually create these paths in shared/ (eg: shared/config/database.yml) in your server. @@ -193,6 +205,7 @@ task deploy: :environment do to :launch do invoke :restart invoke :'deploy:cleanup' + queue! "QUE_WORKER_COUNT=1 #{rake} daemon:que:restart" if que_restart end end end diff --git a/config/environments/alpha.rb b/config/environments/alpha.rb index 00cf88f5b..01ae5d81d 100644 --- a/config/environments/alpha.rb +++ b/config/environments/alpha.rb @@ -81,3 +81,8 @@ Rails.application.configure do # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false end + +# In off mode, queueing a job will simply insert it into the database - +# the current process will make no effort to run it. +# You should use this if you want to use a dedicated process to work tasks +Que.mode = :off diff --git a/config/environments/development.rb b/config/environments/development.rb index 562159d27..ce01368f9 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -47,3 +47,8 @@ Rails.application.configure do Bullet.unused_eager_loading_enable = false end end + +# In this mode, any jobs you queue will be run in the same thread, synchronously +# (that is, MyJob.enqueue runs the job and won't return until it's completed). +# This makes your application's behavior easier to test +Que.mode = :sync diff --git a/config/environments/production.rb b/config/environments/production.rb index 00cf88f5b..01ae5d81d 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -81,3 +81,8 @@ Rails.application.configure do # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false end + +# In off mode, queueing a job will simply insert it into the database - +# the current process will make no effort to run it. +# You should use this if you want to use a dedicated process to work tasks +Que.mode = :off diff --git a/config/environments/staging.rb b/config/environments/staging.rb index 81690cb98..ee1303a1c 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -84,3 +84,8 @@ Rails.application.configure do # TODO: Change this: config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } end + +# In off mode, queueing a job will simply insert it into the database - +# the current process will make no effort to run it. +# You should use this if you want to use a dedicated process to work tasks +Que.mode = :off diff --git a/config/environments/test.rb b/config/environments/test.rb index 6c75b5a00..b56e173c1 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -57,3 +57,8 @@ Rails.application.configure do Bullet.add_whitelist type: :n_plus_one_query, class_name: 'Contact', association: :registrar end end + +# In this mode, any jobs you queue will be run in the same thread, synchronously +# (that is, MyJob.enqueue runs the job and won't return until it's completed). +# This makes your application's behavior easier to test +Que.mode = :sync diff --git a/config/initializers/autolabel.rb b/config/initializers/autolabel.rb index 160d6c322..ad877d540 100644 --- a/config/initializers/autolabel.rb +++ b/config/initializers/autolabel.rb @@ -11,6 +11,7 @@ class ActionView::Helpers::FormBuilder content = content_or_options end + # rubocop:disable Style/MultilineOperationIndentation if object.class.respond_to?(:validators_on) && object.class.validators_on(method).map(&:class).include?(ActiveRecord::Validations::PresenceValidator) @@ -20,6 +21,7 @@ class ActionView::Helpers::FormBuilder options[:class] = ((options[:class] || "") + ' required').split(' ').uniq.join(' ') end end + # rubocop:enable Style/MultilineOperationIndentation orig_label(method, content, options || {}, &block) end diff --git a/config/initializers/initial_settings.rb b/config/initializers/initial_settings.rb index 824cf0fcc..2cff727b4 100644 --- a/config/initializers/initial_settings.rb +++ b/config/initializers/initial_settings.rb @@ -10,6 +10,7 @@ if con.present? && con.table_exists?('settings') Setting.save_default(:admin_contacts_max_count, 10) Setting.save_default(:tech_contacts_min_count, 1) Setting.save_default(:tech_contacts_max_count, 10) + Setting.save_default(:expire_pending_confirmation, 48) Setting.save_default(:ds_algorithm, 2) Setting.save_default(:ds_data_allowed, true) @@ -24,16 +25,33 @@ if con.present? && con.table_exists?('settings') Setting.save_default(:client_side_status_editing_enabled, false) - Setting.save_default(:eis_iban, 'EE557700771000598731') - Setting.save_default(:eis_bank, 'LHV Pank') - Setting.save_default(:eis_swift, 'LHVBEE22') - Setting.save_default(:eis_invoice_contact, 'Martti Õigus') - Setting.save_default(:invoice_number_min, '131050') - Setting.save_default(:invoice_number_max, '149999') + Setting.save_default(:invoice_number_min, 131050) + Setting.save_default(:invoice_number_max, 149999) Setting.save_default(:days_to_keep_overdue_invoices_active, 30) Setting.save_default(:days_to_renew_domain_before_expire, 90) Setting.save_default(:expire_warning_period, 15) Setting.save_default(:redemption_grace_period, 30) + + Setting.save_default(:registrar_ip_whitelist_enabled, true) + Setting.save_default(:api_ip_whitelist_enabled, true) + + Setting.save_default(:registry_juridical_name, 'Eesti Interneti SA') + Setting.save_default(:registry_reg_no, '90010019') + Setting.save_default(:registry_email, 'info@internet.ee') + Setting.save_default(:registry_billing_email, 'info@internet.ee') + Setting.save_default(:registry_phone, '+372 727 1000') + Setting.save_default(:registry_country_code, 'EE') + Setting.save_default(:registry_state, 'Harjumaa') + Setting.save_default(:registry_street, 'Paldiski mnt 80') + Setting.save_default(:registry_city, 'Tallinn') + Setting.save_default(:registry_zip, '10617') + Setting.save_default(:registry_vat_no, 'EE101286464') + Setting.save_default(:registry_url, 'www.internet.ee') + Setting.save_default(:registry_vat_prc, 0.2) + Setting.save_default(:registry_iban, 'EE557700771000598731') + Setting.save_default(:registry_bank, 'LHV Pank') + Setting.save_default(:registry_swift, 'LHVBEE22') + Setting.save_default(:registry_invoice_contact, 'Martti Õigus') end # dev only setting diff --git a/config/initializers/money.rb b/config/initializers/money.rb index 30df8eadf..bd14a3f3d 100644 --- a/config/initializers/money.rb +++ b/config/initializers/money.rb @@ -1,7 +1,6 @@ # encoding : utf-8 MoneyRails.configure do |config| - # To set the default currency # config.default_currency = :eur diff --git a/config/initializers/new_relic_app_name.rb b/config/initializers/new_relic_app_name.rb deleted file mode 100644 index 662fdf6b1..000000000 --- a/config/initializers/new_relic_app_name.rb +++ /dev/null @@ -1,4 +0,0 @@ -if !Rails.env.test? && ENV['new_relic_app_name'].present? - require 'newrelic' - NewRelic::Agent.config[:app_name] = "#{ENV['new_relic_app_name']} - #{Rails.env}" -end diff --git a/config/initializers/que.rb b/config/initializers/que.rb deleted file mode 100644 index b9e5a68ab..000000000 --- a/config/initializers/que.rb +++ /dev/null @@ -1 +0,0 @@ -Que.mode = :off diff --git a/config/locales/en.yml b/config/locales/en.yml index 2336303e6..0b71bf267 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -60,9 +60,12 @@ en: ds_data_not_allowed: 'dsData object is not allowed' ds_data_with_key_not_allowed: 'dsData object with key data is not allowed' key_data_not_allowed: 'keyData object is not allowed' + required_parameter_missing_reserved: 'Required parameter missing; reserved>pw element required for reserved domains' + invalid_auth_information_reserved: 'Invalid authorization information; invalid reserved>pw value' name_dirty: invalid: 'Domain name is invalid' - reserved: 'Domain name is reserved or restricted' + reserved: 'Domain name is reserved' + blocked: 'Domain name is blocked' taken: 'Domain name already exists' puny_label: too_long: 'Domain name is too long (maximum is 63 characters)' @@ -237,7 +240,7 @@ en: errors: messages: blank: 'is missing' - epp_domain_reserved: 'Domain name is reserved or restricted' + epp_domain_reserved: 'Domain name is reserved' epp_obj_does_not_exist: 'Object does not exist' epp_command_failed: 'Command failed' epp_authorization_error: 'Authorization error' @@ -288,6 +291,7 @@ en: description: 'Description' delete: 'Delete' are_you_sure: 'Are you sure?' + are_you_sure_destroy: 'You are going to delete, are you sure?' back: 'Back' new_domain: 'New domain' registrar_name: 'Registrar name' @@ -753,8 +757,8 @@ en: cannot_bind_cancelled_invoice: 'Cannot bind cancelled invoice' minimum_invoice_no: 'Miminum invoice no' maximum_invoice_no: 'Maximum invoice no' - due_date_after: 'Due date after' - due_date_before: 'Due date before' + due_date_from: 'Due date from' + due_date_until: 'Due date until' minimum_total: 'Minimum total' maximum_total: 'Maximum total' hostname_end: 'Hostname end' @@ -807,10 +811,8 @@ en: domain_delete_confirmed_body: 'You have successfully submitted delete confirmation. You will receive registry final confirmation to email.' domain_delete_rejected_title: 'Domain deletion has been rejected successfully' domain_delete_rejected_body: 'You have rejected domain deletion.' - ip_is_not_whitelisted: 'IP is not whitelisted' no_permission: 'No permission' access_denied: 'Access denied' - connection_limit_reached: 'Connection limit reached' common_name: 'Common name' md5: 'Md5' interface: 'Interface' @@ -831,3 +833,40 @@ en: domain_expiring: 'Domain expiring' domain_validation_rules: 'Domain validation rules' bank_statement_desc: 'Import file row will match only when matching following attributes:
ref number
payment amount
invoice number (the very first number in comment field)
.' + create_bank_statement: 'Create bank statement' + create_bank_transaction: 'Create bank transaction' + create_new_invoice: 'Create new invoice' + ip_is_not_whitelisted: 'IP is not whitelisted' + billing_settings: 'Billing settings' + registry_settings: 'Registry settings' + registry_billing_email: 'Billing e-mail' + registry_invoice_contact: 'Invoice contact' + registry_vat_no: 'VAT no.' + registry_vat_prc: 'VAT prc.' + registry_bank: 'Bank' + registry_iban: 'IBAN' + registry_swift: 'SWIFT' + registry_juridical_name: 'Juridical name' + registry_reg_no: 'Reg no.' + registry_email: 'E-mail' + registry_phone: 'Phone' + registry_url: 'URL' + registry_street: 'Street' + registry_city: 'City' + registry_state: 'State / Province' + registry_zip: 'Postcode' + registry_country_code: 'Country' + blocked_domains: 'Blocked domains' + billing_failure_credit_balance_low: 'Billing failure - credit balance low' + create: 'Create' + activity_type: 'Activity type' + receipt_date_from: 'Receipt date from' + receipt_date_until: 'Receipt date until' + add_credit: 'Add credit' + export_csv: 'Export CSV' + reserved_domains: 'Reserved domains' + invalid_yaml: 'Invalid YAML' + reserved_pw: 'Reserved pw' + no_transfers_found: 'No transfers found' + parameter_value_range_error: 'Parameter value range error: %{key}' + domain_registrant_updated: 'Domeeni %{name} registreerija vahetus teostatud / Registrant change of %{name} has been finished.' diff --git a/config/newrelic.yml b/config/newrelic.yml index 6dc617a9d..e83d67abd 100644 --- a/config/newrelic.yml +++ b/config/newrelic.yml @@ -15,7 +15,7 @@ common: &default_settings # You must specify the license key associated with your New Relic # account. This key binds your Agent's data to your account in the # New Relic service. - license_key: '42d1c2ba4ed17a9cf6297c59d80e563a3dd3c4fa' + license_key: <%= ENV['new_relic_license_key'] || '42d1c2ba4ed17a9cf6297c59d80e563a3dd3c4fa' %> # Agent Enabled (Ruby/Rails Only) # Use this setting to force the agent to run or not run. @@ -49,7 +49,7 @@ common: &default_settings # See https://newrelic.com/docs/site/renaming-applications for more details # on renaming your New Relic applications. # - app_name: Registry + app_name: <%= "#{ENV['new_relic_app_name']} - #{Rails.env}" %> # When "true", the agent collects performance data about your # application and reports this data to the New Relic service at @@ -192,7 +192,6 @@ development: <<: *default_settings # Turn on communication to New Relic service in development mode monitor_mode: false - app_name: Registry (Development) # Rails Only - when running in Developer Mode, the New Relic Agent will # present performance information on the last 100 transactions you have @@ -213,7 +212,6 @@ test: alpha: <<: *default_settings monitor_mode: true - app_name: Registry (Alpha) # Many applications have a staging environment which behaves # identically to production. Support for that environment is provided @@ -221,7 +219,6 @@ alpha: staging: <<: *default_settings monitor_mode: true - app_name: Registry (Staging) # Turn on the agent in production for 24x7 monitoring. NewRelic # testing shows an average performance impact of < 5 ms per diff --git a/config/routes.rb b/config/routes.rb index 5986f213f..bb1828c36 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -161,6 +161,12 @@ Rails.application.routes.draw do resources :pricelists resources :bank_statements do + resources :bank_transactions + collection do + get 'import' + post 'create_from_import' + end + post 'bind_invoices', on: :member get 'download_import_file', on: :member end @@ -170,7 +176,9 @@ Rails.application.routes.draw do end resources :invoices do + get 'download_pdf' patch 'cancel', on: :member + match 'forward', via: [:post, :get] end resources :domains do @@ -183,6 +191,9 @@ Rails.application.routes.draw do resources :settings + resources :blocked_domains + resources :reserved_domains + resources :registrars do resources :api_users resources :white_ips diff --git a/config/schedule.rb b/config/schedule.rb index 6796ebbde..c418de420 100644 --- a/config/schedule.rb +++ b/config/schedule.rb @@ -16,28 +16,38 @@ every 10.minutes do runner 'ZonefileSetting.generate_zonefiles' end -every 6.months, at: '12pm' do +every 6.months, at: '12:01am' do runner 'Contact.destroy_orphans' end -every :day, at: '12:10pm' do +every :day, at: '12:10am' do runner 'Invoice.cancel_overdue_invoices' end -every :day, at: '12:15pm' do +every :day, at: '12:15am' do runner 'Domain.expire_domains' end +every :day, at: '12:20am' do + runner 'Domain.clean_expired_pendings' +end + every 3.hours do runner 'Certificate.update_crl' end -every :hour do - runner 'Domain.start_expire_period' - runner 'Domain.start_redemption_grace_period' - runner 'Domain.start_delete_period' -end - every 42.minutes do runner 'Domain.destroy_delete_candidates' end + +every 45.minutes do + runner 'Domain.start_expire_period' +end + +every 50.minutes do + runner 'Domain.start_delete_period' +end + +every 52.minutes do + runner 'Domain.start_redemption_grace_period' +end diff --git a/config/spring.rb b/config/spring.rb new file mode 100644 index 000000000..12c701147 --- /dev/null +++ b/config/spring.rb @@ -0,0 +1 @@ +Spring.watch 'config/application.yml' diff --git a/db/migrate/20140730082358_add_reserved_domains.rb b/db/migrate/20140730082358_add_reserved_domains.rb index f6afecd7b..26a2ea0de 100644 --- a/db/migrate/20140730082358_add_reserved_domains.rb +++ b/db/migrate/20140730082358_add_reserved_domains.rb @@ -2,7 +2,7 @@ class AddReservedDomains < ActiveRecord::Migration def up create_table :reserved_domains do |t| t.string :name - t.timestamps + t.timestamps null: false end domains = %w( diff --git a/db/migrate/20150701074344_create_blocked_domains.rb b/db/migrate/20150701074344_create_blocked_domains.rb new file mode 100644 index 000000000..41bff1f56 --- /dev/null +++ b/db/migrate/20150701074344_create_blocked_domains.rb @@ -0,0 +1,25 @@ +class CreateBlockedDomains < ActiveRecord::Migration + def change + create_table :blocked_domains do |t| + t.string :names, array: true + t.timestamps + t.string "creator_str" + t.string "updator_str" + end + + create_table "log_blocked_domains", force: :cascade do |t| + t.string "item_type", null: false + t.integer "item_id", null: false + t.string "event", null: false + t.string "whodunnit" + t.json "object" + t.json "object_changes" + t.datetime "created_at" + t.string "session" + t.json "children" + end + + add_index "log_blocked_domains", ["item_type", "item_id"], name: "index_log_blocked_domains_on_item_type_and_item_id", using: :btree + add_index "log_blocked_domains", ["whodunnit"], name: "index_log_blocked_domains_on_whodunnit", using: :btree + end +end diff --git a/db/migrate/20150703084632_increase_precision_of_pricelist.rb b/db/migrate/20150703084632_increase_precision_of_pricelist.rb new file mode 100644 index 000000000..6d60d4786 --- /dev/null +++ b/db/migrate/20150703084632_increase_precision_of_pricelist.rb @@ -0,0 +1,5 @@ +class IncreasePrecisionOfPricelist < ActiveRecord::Migration + def change + change_column :pricelists, :price_cents, :decimal, precision: 10, scale: 2 + end +end diff --git a/db/migrate/20150706091724_add_activity_type_to_account_activities.rb b/db/migrate/20150706091724_add_activity_type_to_account_activities.rb new file mode 100644 index 000000000..df6f21f3a --- /dev/null +++ b/db/migrate/20150706091724_add_activity_type_to_account_activities.rb @@ -0,0 +1,5 @@ +class AddActivityTypeToAccountActivities < ActiveRecord::Migration + def change + add_column :account_activities, :activity_type, :string + end +end diff --git a/db/migrate/20150707104937_refactor_reserved_domains.rb b/db/migrate/20150707104937_refactor_reserved_domains.rb new file mode 100644 index 000000000..6f6c00682 --- /dev/null +++ b/db/migrate/20150707104937_refactor_reserved_domains.rb @@ -0,0 +1,6 @@ +class RefactorReservedDomains < ActiveRecord::Migration + def change + remove_column :reserved_domains, :name + add_column :reserved_domains, :names, :hstore + end +end diff --git a/db/migrate/20150707154543_increase_decimal_precision.rb b/db/migrate/20150707154543_increase_decimal_precision.rb new file mode 100644 index 000000000..47cf59997 --- /dev/null +++ b/db/migrate/20150707154543_increase_decimal_precision.rb @@ -0,0 +1,11 @@ +class IncreaseDecimalPrecision < ActiveRecord::Migration + def change + change_column :account_activities, :sum, :decimal, precision: 10, scale: 2 + change_column :accounts, :balance, :decimal, precision: 10, scale: 2, default: 0.0, null: false + change_column :bank_transactions, :sum, :decimal, precision: 10, scale: 2 + change_column :banklink_transactions, :vk_amount, :decimal, precision: 10, scale: 2 + change_column :invoice_items, :price, :decimal, precision: 10, scale: 2 + change_column :invoices, :vat_prc, :decimal, precision: 10, scale: 2 + change_column :invoices, :sum_cache, :decimal, precision: 10, scale: 2 + end +end diff --git a/db/migrate/20150709092549_add_reserved_field_to_domain.rb b/db/migrate/20150709092549_add_reserved_field_to_domain.rb new file mode 100644 index 000000000..676253575 --- /dev/null +++ b/db/migrate/20150709092549_add_reserved_field_to_domain.rb @@ -0,0 +1,5 @@ +class AddReservedFieldToDomain < ActiveRecord::Migration + def change + add_column :domains, :reserved, :boolean, default: false + end +end diff --git a/db/migrate/20150713113436_add_log_pricelist_id_to_account_activity.rb b/db/migrate/20150713113436_add_log_pricelist_id_to_account_activity.rb new file mode 100644 index 000000000..083101d04 --- /dev/null +++ b/db/migrate/20150713113436_add_log_pricelist_id_to_account_activity.rb @@ -0,0 +1,5 @@ +class AddLogPricelistIdToAccountActivity < ActiveRecord::Migration + def change + add_column :account_activities, :log_pricelist_id, :integer + end +end diff --git a/db/schema.rb b/db/schema-read-only.rb similarity index 93% rename from db/schema.rb rename to db/schema-read-only.rb index b83051936..7880fe213 100644 --- a/db/schema.rb +++ b/db/schema-read-only.rb @@ -11,15 +11,16 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20150612123111) do +ActiveRecord::Schema.define(version: 20150713113436) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" + enable_extension "hstore" create_table "account_activities", force: :cascade do |t| t.integer "account_id" t.integer "invoice_id" - t.decimal "sum", precision: 8, scale: 2 + t.decimal "sum", precision: 10, scale: 2 t.string "currency" t.integer "bank_transaction_id" t.datetime "created_at" @@ -27,6 +28,8 @@ ActiveRecord::Schema.define(version: 20150612123111) do t.string "description" t.string "creator_str" t.string "updator_str" + t.string "activity_type" + t.integer "log_pricelist_id" end add_index "account_activities", ["account_id"], name: "index_account_activities_on_account_id", using: :btree @@ -36,7 +39,7 @@ ActiveRecord::Schema.define(version: 20150612123111) do create_table "accounts", force: :cascade do |t| t.integer "registrar_id" t.string "account_type" - t.decimal "balance", precision: 8, scale: 2, default: 0.0, null: false + t.decimal "balance", precision: 10, scale: 2, default: 0.0, null: false t.datetime "created_at" t.datetime "updated_at" t.string "currency" @@ -98,7 +101,7 @@ ActiveRecord::Schema.define(version: 20150612123111) do t.string "buyer_name" t.string "document_no" t.string "description" - t.decimal "sum", precision: 8, scale: 2 + t.decimal "sum", precision: 10, scale: 2 t.string "reference_no" t.datetime "paid_at" t.datetime "created_at" @@ -114,7 +117,7 @@ ActiveRecord::Schema.define(version: 20150612123111) do t.string "vk_rec_id" t.string "vk_stamp" t.string "vk_t_no" - t.decimal "vk_amount", precision: 8, scale: 2 + t.decimal "vk_amount", precision: 10, scale: 2 t.string "vk_curr" t.string "vk_rec_acc" t.string "vk_rec_name" @@ -131,6 +134,14 @@ ActiveRecord::Schema.define(version: 20150612123111) do t.datetime "updated_at" end + create_table "blocked_domains", force: :cascade do |t| + t.string "names", array: true + t.datetime "created_at" + t.datetime "updated_at" + t.string "creator_str" + t.string "updator_str" + end + create_table "cached_nameservers", id: false, force: :cascade do |t| t.string "hostname", limit: 255 t.string "ipv4", limit: 255 @@ -188,6 +199,7 @@ ActiveRecord::Schema.define(version: 20150612123111) do t.string "country_code" t.string "state" t.integer "legacy_id" + t.string "statuses", array: true end add_index "contacts", ["code"], name: "index_contacts_on_code", using: :btree @@ -313,7 +325,8 @@ ActiveRecord::Schema.define(version: 20150612123111) do t.string "registrant_verification_token" t.json "pending_json" t.datetime "force_delete_at" - t.string "statuses", array: true + t.string "statuses", array: true + t.boolean "reserved", default: false end add_index "domains", ["delete_at"], name: "index_domains_on_delete_at", using: :btree @@ -336,10 +349,10 @@ ActiveRecord::Schema.define(version: 20150612123111) do create_table "invoice_items", force: :cascade do |t| t.integer "invoice_id" - t.string "description", null: false + t.string "description", null: false t.string "unit" t.integer "amount" - t.decimal "price", precision: 8, scale: 2 + t.decimal "price", precision: 10, scale: 2 t.datetime "created_at" t.datetime "updated_at" t.string "creator_str" @@ -349,20 +362,20 @@ ActiveRecord::Schema.define(version: 20150612123111) do add_index "invoice_items", ["invoice_id"], name: "index_invoice_items_on_invoice_id", using: :btree create_table "invoices", force: :cascade do |t| - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "invoice_type", null: false - t.datetime "due_date", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "invoice_type", null: false + t.datetime "due_date", null: false t.string "payment_term" - t.string "currency", null: false + t.string "currency", null: false t.string "description" t.string "reference_no" - t.decimal "vat_prc", precision: 8, scale: 2, null: false + t.decimal "vat_prc", precision: 10, scale: 2, null: false t.datetime "paid_at" t.integer "seller_id" - t.string "seller_name", null: false + t.string "seller_name", null: false t.string "seller_reg_no" - t.string "seller_iban", null: false + t.string "seller_iban", null: false t.string "seller_bank" t.string "seller_swift" t.string "seller_vat_no" @@ -376,7 +389,7 @@ ActiveRecord::Schema.define(version: 20150612123111) do t.string "seller_email" t.string "seller_contact_name" t.integer "buyer_id" - t.string "buyer_name", null: false + t.string "buyer_name", null: false t.string "buyer_reg_no" t.string "buyer_country_code" t.string "buyer_state" @@ -390,7 +403,7 @@ ActiveRecord::Schema.define(version: 20150612123111) do t.string "updator_str" t.integer "number" t.datetime "cancelled_at" - t.decimal "sum_cache", precision: 8, scale: 2 + t.decimal "sum_cache", precision: 10, scale: 2 end add_index "invoices", ["buyer_id"], name: "index_invoices_on_buyer_id", using: :btree @@ -521,6 +534,21 @@ ActiveRecord::Schema.define(version: 20150612123111) do add_index "log_bank_transactions", ["item_type", "item_id"], name: "index_log_bank_transactions_on_item_type_and_item_id", using: :btree add_index "log_bank_transactions", ["whodunnit"], name: "index_log_bank_transactions_on_whodunnit", using: :btree + create_table "log_blocked_domains", force: :cascade do |t| + t.string "item_type", null: false + t.integer "item_id", null: false + t.string "event", null: false + t.string "whodunnit" + t.json "object" + t.json "object_changes" + t.datetime "created_at" + t.string "session" + t.json "children" + end + + add_index "log_blocked_domains", ["item_type", "item_id"], name: "index_log_blocked_domains_on_item_type_and_item_id", using: :btree + add_index "log_blocked_domains", ["whodunnit"], name: "index_log_blocked_domains_on_whodunnit", using: :btree + create_table "log_certificates", force: :cascade do |t| t.string "item_type", null: false t.integer "item_id", null: false @@ -896,14 +924,14 @@ ActiveRecord::Schema.define(version: 20150612123111) do create_table "pricelists", force: :cascade do |t| t.string "desc" t.string "category" - t.decimal "price_cents", precision: 8, scale: 2, default: 0.0, null: false - t.string "price_currency", default: "EUR", null: false + t.decimal "price_cents", precision: 10, scale: 2, default: 0.0, null: false + t.string "price_currency", default: "EUR", null: false t.datetime "valid_from" t.datetime "valid_to" t.string "creator_str" t.string "updator_str" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.string "duration" t.string "operation_category" end @@ -960,11 +988,11 @@ ActiveRecord::Schema.define(version: 20150612123111) do add_index "registrars", ["code"], name: "index_registrars_on_code", using: :btree create_table "reserved_domains", force: :cascade do |t| - t.string "name" t.datetime "created_at" t.datetime "updated_at" t.string "creator_str" t.string "updator_str" + t.hstore "names" end create_table "settings", force: :cascade do |t| @@ -1002,7 +1030,7 @@ ActiveRecord::Schema.define(version: 20150612123111) do t.text "crt" t.string "type" t.string "registrant_ident" - t.string "encrypted_password", default: "", null: false + t.string "encrypted_password", default: "" t.datetime "remember_created_at" t.integer "failed_attempts", default: 0, null: false t.datetime "locked_at" diff --git a/db/seeds.rb b/db/seeds.rb index 16b938cc4..cec5c9318 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -119,17 +119,17 @@ ZonefileSetting.where({ master_nameserver: 'ns.tld.ee' }).first_or_create! -Registrar.where( - name: 'EIS', - reg_no: '90010019', - phone: '+3727271000', - country_code: 'EE', - vat_no: 'EE101286464', - email: 'info@internet.ee', - state: 'Harjumaa', - city: 'Tallinn', - street: 'Paldiski mnt 80', - zip: '10617', - url: 'www.internet.ee', - code: 'EIS' -).first_or_create! +# Registrar.where( +# name: 'EIS', +# reg_no: '90010019', +# phone: '+3727271000', +# country_code: 'EE', +# vat_no: 'EE101286464', +# email: 'info@internet.ee', +# state: 'Harjumaa', +# city: 'Tallinn', +# street: 'Paldiski mnt 80', +# zip: '10617', +# url: 'www.internet.ee', +# code: 'EIS' +# ).first_or_create! diff --git a/db/structure.sql b/db/structure.sql index efb3463bd..f8e53da5d 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -23,6 +23,20 @@ CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; +-- +-- Name: hstore; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS hstore WITH SCHEMA public; + + +-- +-- Name: EXTENSION hstore; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION hstore IS 'data type for storing sets of (key, value) pairs'; + + SET search_path = public, pg_catalog; -- @@ -41,7 +55,7 @@ CREATE FUNCTION generate_zonefile(i_origin character varying) RETURNS text ret text; BEGIN -- define filters - include_filter = '%' || i_origin; + include_filter = '%.' || i_origin; -- for %.%.% IF i_origin ~ '\.' THEN @@ -74,7 +88,7 @@ CREATE FUNCTION generate_zonefile(i_origin character varying) RETURNS text SELECT concat(d.name_puny, '. IN NS ', ns.hostname, '.') FROM domains d JOIN nameservers ns ON ns.domain_id = d.id - WHERE d.name LIKE include_filter AND d.name NOT LIKE exclude_filter + WHERE d.name LIKE include_filter AND d.name NOT LIKE exclude_filter OR d.name = i_origin ORDER BY d.name ), chr(10) @@ -205,7 +219,9 @@ CREATE TABLE account_activities ( updated_at timestamp without time zone, description character varying, creator_str character varying, - updator_str character varying + updator_str character varying, + activity_type character varying, + log_pricelist_id integer ); @@ -236,7 +252,7 @@ CREATE TABLE accounts ( id integer NOT NULL, registrar_id integer, account_type character varying, - balance numeric(10,2) DEFAULT 0 NOT NULL, + balance numeric(10,2) DEFAULT 0.0 NOT NULL, created_at timestamp without time zone, updated_at timestamp without time zone, currency character varying, @@ -472,6 +488,39 @@ CREATE SEQUENCE banklink_transactions_id_seq ALTER SEQUENCE banklink_transactions_id_seq OWNED BY banklink_transactions.id; +-- +-- Name: blocked_domains; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- + +CREATE TABLE blocked_domains ( + id integer NOT NULL, + names character varying[], + created_at timestamp without time zone, + updated_at timestamp without time zone, + creator_str character varying, + updator_str character varying +); + + +-- +-- Name: blocked_domains_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE blocked_domains_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: blocked_domains_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE blocked_domains_id_seq OWNED BY blocked_domains.id; + + -- -- Name: cached_nameservers; Type: TABLE; Schema: public; Owner: -; Tablespace: -- @@ -582,7 +631,8 @@ CREATE TABLE contacts ( zip character varying, country_code character varying, state character varying, - legacy_id integer + legacy_id integer, + statuses character varying[] ); @@ -639,6 +689,15 @@ CREATE SEQUENCE countries_id_seq ALTER SEQUENCE countries_id_seq OWNED BY countries.id; +-- +-- Name: data_migrations; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- + +CREATE TABLE data_migrations ( + version character varying NOT NULL +); + + -- -- Name: delegation_signers; Type: TABLE; Schema: public; Owner: -; Tablespace: -- @@ -885,7 +944,8 @@ CREATE TABLE domains ( registrant_verification_token character varying, pending_json json, force_delete_at timestamp without time zone, - statuses character varying[] + statuses character varying[], + reserved boolean DEFAULT false ); @@ -1349,6 +1409,43 @@ CREATE SEQUENCE log_bank_transactions_id_seq ALTER SEQUENCE log_bank_transactions_id_seq OWNED BY log_bank_transactions.id; +-- +-- Name: log_blocked_domains; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- + +CREATE TABLE log_blocked_domains ( + id integer NOT NULL, + item_type character varying NOT NULL, + item_id integer NOT NULL, + event character varying NOT NULL, + whodunnit character varying, + object json, + object_changes json, + created_at timestamp without time zone, + session character varying, + children json +); + + +-- +-- Name: log_blocked_domains_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE log_blocked_domains_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: log_blocked_domains_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE log_blocked_domains_id_seq OWNED BY log_blocked_domains.id; + + -- -- Name: log_certificates; Type: TABLE; Schema: public; Owner: -; Tablespace: -- @@ -2287,7 +2384,7 @@ CREATE TABLE pricelists ( id integer NOT NULL, "desc" character varying, category character varying, - price_cents numeric(8,2) DEFAULT 0 NOT NULL, + price_cents numeric(10,2) DEFAULT 0 NOT NULL, price_currency character varying DEFAULT 'EUR'::character varying NOT NULL, valid_from timestamp without time zone, valid_to timestamp without time zone, @@ -2452,11 +2549,11 @@ ALTER SEQUENCE registrars_id_seq OWNED BY registrars.id; CREATE TABLE reserved_domains ( id integer NOT NULL, - name character varying, created_at timestamp without time zone, updated_at timestamp without time zone, creator_str character varying, - updator_str character varying + updator_str character varying, + names hstore ); @@ -2766,6 +2863,13 @@ ALTER TABLE ONLY bank_transactions ALTER COLUMN id SET DEFAULT nextval('bank_tra ALTER TABLE ONLY banklink_transactions ALTER COLUMN id SET DEFAULT nextval('banklink_transactions_id_seq'::regclass); +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY blocked_domains ALTER COLUMN id SET DEFAULT nextval('blocked_domains_id_seq'::regclass); + + -- -- Name: id; Type: DEFAULT; Schema: public; Owner: - -- @@ -2920,6 +3024,13 @@ ALTER TABLE ONLY log_bank_statements ALTER COLUMN id SET DEFAULT nextval('log_ba ALTER TABLE ONLY log_bank_transactions ALTER COLUMN id SET DEFAULT nextval('log_bank_transactions_id_seq'::regclass); +-- +-- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY log_blocked_domains ALTER COLUMN id SET DEFAULT nextval('log_blocked_domains_id_seq'::regclass); + + -- -- Name: id; Type: DEFAULT; Schema: public; Owner: - -- @@ -3228,6 +3339,14 @@ ALTER TABLE ONLY banklink_transactions ADD CONSTRAINT banklink_transactions_pkey PRIMARY KEY (id); +-- +-- Name: blocked_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- + +ALTER TABLE ONLY blocked_domains + ADD CONSTRAINT blocked_domains_pkey PRIMARY KEY (id); + + -- -- Name: certificates_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- @@ -3404,6 +3523,14 @@ ALTER TABLE ONLY log_bank_transactions ADD CONSTRAINT log_bank_transactions_pkey PRIMARY KEY (id); +-- +-- Name: log_blocked_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- + +ALTER TABLE ONLY log_blocked_domains + ADD CONSTRAINT log_blocked_domains_pkey PRIMARY KEY (id); + + -- -- Name: log_certificates_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- @@ -4014,6 +4141,20 @@ CREATE INDEX index_log_bank_transactions_on_item_type_and_item_id ON log_bank_tr CREATE INDEX index_log_bank_transactions_on_whodunnit ON log_bank_transactions USING btree (whodunnit); +-- +-- Name: index_log_blocked_domains_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- + +CREATE INDEX index_log_blocked_domains_on_item_type_and_item_id ON log_blocked_domains USING btree (item_type, item_id); + + +-- +-- Name: index_log_blocked_domains_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- + +CREATE INDEX index_log_blocked_domains_on_whodunnit ON log_blocked_domains USING btree (whodunnit); + + -- -- Name: index_log_certificates_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- @@ -4378,6 +4519,13 @@ CREATE INDEX index_whois_records_on_domain_id ON whois_records USING btree (doma CREATE INDEX index_whois_records_on_registrar_id ON whois_records USING btree (registrar_id); +-- +-- Name: unique_data_migrations; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- + +CREATE UNIQUE INDEX unique_data_migrations ON data_migrations USING btree (version); + + -- -- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -; Tablespace: -- @@ -4713,6 +4861,10 @@ INSERT INTO schema_migrations (version) VALUES ('20150522164020'); INSERT INTO schema_migrations (version) VALUES ('20150525075550'); +INSERT INTO schema_migrations (version) VALUES ('20150601083516'); + +INSERT INTO schema_migrations (version) VALUES ('20150601083800'); + INSERT INTO schema_migrations (version) VALUES ('20150603141054'); INSERT INTO schema_migrations (version) VALUES ('20150603141549'); @@ -4721,8 +4873,12 @@ INSERT INTO schema_migrations (version) VALUES ('20150603211318'); INSERT INTO schema_migrations (version) VALUES ('20150603212659'); +INSERT INTO schema_migrations (version) VALUES ('20150609093515'); + INSERT INTO schema_migrations (version) VALUES ('20150609103333'); +INSERT INTO schema_migrations (version) VALUES ('20150610111019'); + INSERT INTO schema_migrations (version) VALUES ('20150610112238'); INSERT INTO schema_migrations (version) VALUES ('20150610144547'); @@ -4731,3 +4887,23 @@ INSERT INTO schema_migrations (version) VALUES ('20150611124920'); INSERT INTO schema_migrations (version) VALUES ('20150612123111'); +INSERT INTO schema_migrations (version) VALUES ('20150612125720'); + +INSERT INTO schema_migrations (version) VALUES ('20150701074344'); + +INSERT INTO schema_migrations (version) VALUES ('20150703084632'); + +INSERT INTO schema_migrations (version) VALUES ('20150706091724'); + +INSERT INTO schema_migrations (version) VALUES ('20150707103241'); + +INSERT INTO schema_migrations (version) VALUES ('20150707103801'); + +INSERT INTO schema_migrations (version) VALUES ('20150707104937'); + +INSERT INTO schema_migrations (version) VALUES ('20150707154543'); + +INSERT INTO schema_migrations (version) VALUES ('20150709092549'); + +INSERT INTO schema_migrations (version) VALUES ('20150713113436'); + diff --git a/doc/application_build_doc.md b/doc/application_build_doc.md index 156d4c542..3056b1992 100644 --- a/doc/application_build_doc.md +++ b/doc/application_build_doc.md @@ -16,6 +16,7 @@ Application build and update For production you probably would like to create databases to your locale, example: create database registry_production owner registry encoding 'UTF-8' LC_COLLATE 'et_EE.utf8' LC_CTYPE 'et_EE.utf8' template template0; + create extension hstore; Deploy overview: (database schema should be loaded and seeds should be present) diff --git a/doc/controllers_brief.svg b/doc/controllers_brief.svg index 12c11a890..a5a1a555a 100644 --- a/doc/controllers_brief.svg +++ b/doc/controllers_brief.svg @@ -4,98 +4,268 @@ - - + + controllers_diagram - + _diagram_info -Controllers diagram -Date: Dec 15 2014 - 14:23 -Migration version: 20141202114457 -Generated by RailRoady 1.2.0 -http://railroady.prestonlee.com +Controllers diagram +Date: Jul 08 2015 - 13:40 +Migration version: 20150707103801 +Generated by RailRoady 1.3.0 +http://railroady.prestonlee.com - -ApplicationController - -ApplicationController + +RegistrantController + +RegistrantController - -SessionsController - -SessionsController + +Epp::DomainsController + +Epp::DomainsController - -Epp::CommandsController - -Epp::CommandsController + +Epp::KeyrelaysController + +Epp::KeyrelaysController Epp::SessionsController - -Epp::SessionsController + +Epp::SessionsController + + +Epp::PollsController + +Epp::PollsController + + +Epp::ContactsController + +Epp::ContactsController -Epp::ErrorsController - -Epp::ErrorsController +Epp::ErrorsController + +Epp::ErrorsController -AdminController - -AdminController +AdminController + +AdminController - -Admin::UsersController - -Admin::UsersController - - -Admin::EppUsersController - -Admin::EppUsersController - - -Admin::RegistrarsController - -Admin::RegistrarsController - - -Admin::DomainVersionsController - -Admin::DomainVersionsController + +RegistrarController + +RegistrarController -Admin::DomainsController - -Admin::DomainsController +Admin::DomainsController + +Admin::DomainsController -Admin::DelayedJobsController - -Admin::DelayedJobsController +Admin::DelayedJobsController + +Admin::DelayedJobsController - -Admin::ZonefileSettingsController - -Admin::ZonefileSettingsController + +Admin::WhiteIpsController + +Admin::WhiteIpsController - -Admin::ContactsController - -Admin::ContactsController + +Admin::PricelistsController + +Admin::PricelistsController + + +Admin::ZonefilesController + +Admin::ZonefilesController Admin::SettingsController - -Admin::SettingsController + +Admin::SettingsController - -Admin::ZonefilesController - -Admin::ZonefilesController + +Admin::ApiUsersController + +Admin::ApiUsersController + + +Admin::KeyrelaysController + +Admin::KeyrelaysController + + +Admin::SessionsController + +Admin::SessionsController + + +Admin::DomainVersionsController + +Admin::DomainVersionsController + + +Admin::ContactsController + +Admin::ContactsController + + +Admin::CertificatesController + +Admin::CertificatesController + + +Admin::BankStatementsController + +Admin::BankStatementsController + + +Admin::BankTransactionsController + +Admin::BankTransactionsController + + +Admin::BlockedDomainsController + +Admin::BlockedDomainsController + + +Admin::DashboardsController + +Admin::DashboardsController + + +Admin::ZonefileSettingsController + +Admin::ZonefileSettingsController + + +Admin::RegistrarsController + +Admin::RegistrarsController + + +Admin::ReppLogsController + +Admin::ReppLogsController + + +Admin::InvoicesController + +Admin::InvoicesController + + +Admin::AdminUsersController + +Admin::AdminUsersController + + +Admin::EppLogsController + +Admin::EppLogsController + + +Admin::LegalDocumentsController + +Admin::LegalDocumentsController + + +ApplicationController + +ApplicationController + + +Registrar::DomainsController + +Registrar::DomainsController + + +Registrar::KeyrelaysController + +Registrar::KeyrelaysController + + +Registrar::SessionsController + +Registrar::SessionsController + + +Registrar::PollsController + +Registrar::PollsController + + +Registrar::DepositsController + +Registrar::DepositsController + + +Registrar::ContactsController + +Registrar::ContactsController + + +Registrar::DeppController + +Registrar::DeppController + + +Registrar::NameserversController + +Registrar::NameserversController + + +Registrar::XmlConsolesController + +Registrar::XmlConsolesController + + +Registrar::InvoicesController + +Registrar::InvoicesController + + +Registrar::AccountActivitiesController + +Registrar::AccountActivitiesController + + +Registrant::DomainsController + +Registrant::DomainsController + + +Registrant::SessionsController + +Registrant::SessionsController + + +Registrant::DomainUpdateConfirmsController + +Registrant::DomainUpdateConfirmsController + + +Registrant::WhoisController + +Registrant::WhoisController + + +Registrant::DomainDeleteConfirmsController + +Registrant::DomainDeleteConfirmsController + + +EppController + +EppController diff --git a/doc/controllers_complete.svg b/doc/controllers_complete.svg index c4e29780c..40c0a2ec1 100644 --- a/doc/controllers_complete.svg +++ b/doc/controllers_complete.svg @@ -4,235 +4,736 @@ - - + + controllers_diagram - + _diagram_info -Controllers diagram -Date: Dec 15 2014 - 14:23 -Migration version: 20141202114457 -Generated by RailRoady 1.2.0 -http://railroady.prestonlee.com +Controllers diagram +Date: Jul 08 2015 - 13:40 +Migration version: 20150707103801 +Generated by RailRoady 1.3.0 +http://railroady.prestonlee.com - -ApplicationController - -ApplicationController - -after_sign_in_path_for - - -_layout + +RegistrantController + +RegistrantController + +head_title_sufix + + +_layout - -SessionsController - -SessionsController - -create -login -switch_registrar - - -_layout + +Epp::DomainsController + +Epp::DomainsController + +check +create +delete +info +renew +transfer +update + + +_layout +balance_ok? +find_domain +find_password +status_editing_disabled +validate_check +validate_create +validate_delete +validate_info +validate_renew +validate_transfer +validate_update - -Epp::CommandsController - -Epp::CommandsController - - - -_layout -check -create -delete -info -renew -transfer -update -user_for_paper_trail + +Epp::KeyrelaysController + +Epp::KeyrelaysController + +keyrelay + + +_layout +find_domain +validate_keyrelay Epp::SessionsController - -Epp::SessionsController - - - -_layout -hello -login -login_params -logout + +Epp::SessionsController + +connection_limit_ok? +hello +ip_white? +login +login_params +logout +parsed_frame + + +_layout + + +Epp::PollsController + +Epp::PollsController + +ack_poll +poll +req_poll + + +_layout +validate_poll + + +Epp::ContactsController + +Epp::ContactsController + +check +create +delete +info +renew +update + + +_layout +contact_org_disabled +fax_disabled +find_contact +find_password +status_editing_disabled +validate_check +validate_create +validate_delete +validate_info +validate_update -Epp::ErrorsController - -Epp::ErrorsController - -error - - -_layout +Epp::ErrorsController + +Epp::ErrorsController + +error +not_found + + +_layout -AdminController - -AdminController - -verify_admin - - -_layout +AdminController + +AdminController + +head_title_sufix + + +_layout - -Admin::UsersController - -Admin::UsersController - -create -destroy -edit -index -new -show -update - - -_layout -set_user -user_params - - -Admin::EppUsersController - -Admin::EppUsersController - -create -destroy -edit -index -new -show -update - - -_layout -epp_user_params -set_epp_user - - -Admin::RegistrarsController - -Admin::RegistrarsController - -create -destroy -edit -index -new -search -update - - -_layout -registrar_params -set_registrar - - -Admin::DomainVersionsController - -Admin::DomainVersionsController - -index -show - - -_layout + +RegistrarController + +RegistrarController + +check_ip +depp_controller? +head_title_sufix + + +_layout -Admin::DomainsController - -Admin::DomainsController - -edit -index -show -update - - -_layout -add_prefix_to_statuses -build_associations -domain_params -set_domain +Admin::DomainsController + +Admin::DomainsController + +edit +index +set_force_delete +show +unset_force_delete +update + + +_layout +build_associations +domain_params +ignore_empty_statuses +set_domain -Admin::DelayedJobsController - -Admin::DelayedJobsController - -index - - -_layout +Admin::DelayedJobsController + +Admin::DelayedJobsController + +index + + +_layout - -Admin::ZonefileSettingsController - -Admin::ZonefileSettingsController - -edit -index -update - - -_layout -set_zonefile_setting -zonefile_setting_params + +Admin::WhiteIpsController + +Admin::WhiteIpsController + +create +destroy +edit +new +show +update + + +_layout +set_registrar +white_ip_params - -Admin::ContactsController - -Admin::ContactsController - -index -search - - -_layout -set_contact + +Admin::PricelistsController + +Admin::PricelistsController + +create +edit +index +new +update + + +_layout +pricelist_params +set_pricelist + + +Admin::ZonefilesController + +Admin::ZonefilesController + +create + + +_layout Admin::SettingsController - -Admin::SettingsController - -create -index -show -update - - -_layout -casted_settings -set_setting_group -setting_group_params + +Admin::SettingsController + +create +index +show +update + + +_layout +casted_settings +set_setting_group +setting_group_params - -Admin::ZonefilesController - -Admin::ZonefilesController - -create -index - - -_layout + +Admin::ApiUsersController + +Admin::ApiUsersController + +create +destroy +edit +index +new +show +update + + +_layout +api_user_params +set_api_user + + +Admin::KeyrelaysController + +Admin::KeyrelaysController + +index +show + + +_layout + + +Admin::SessionsController + +Admin::SessionsController + +create +login + + +_layout + + +Admin::DomainVersionsController + +Admin::DomainVersionsController + +index + + +_layout + + +Admin::ContactsController + +Admin::ContactsController + +index +search + + +_layout +set_contact + + +Admin::CertificatesController + +Admin::CertificatesController + +create +destroy +download_crt +download_csr +new +revoke +show +sign + + +_layout +certificate_params +set_api_user +set_certificate + + +Admin::BankStatementsController + +Admin::BankStatementsController + +bind_invoices +create +create_from_import +download_import_file +import +index +new +show + + +_layout +bank_statement_params +set_bank_statement + + +Admin::BankTransactionsController + +Admin::BankTransactionsController + +bind +create +new +update + + +_layout +bank_transaction_params + + +Admin::BlockedDomainsController + +Admin::BlockedDomainsController + +create +index + + +_layout + + +Admin::DashboardsController + +Admin::DashboardsController + +show + + +_layout + + +Admin::ZonefileSettingsController + +Admin::ZonefileSettingsController + +edit +index +update + + +_layout +set_zonefile_setting +zonefile_setting_params + + +Admin::RegistrarsController + +Admin::RegistrarsController + +create +destroy +edit +index +new +search +update + + +_layout +registrar_params +set_registrar + + +Admin::ReppLogsController + +Admin::ReppLogsController + +index +show + + +_layout + + +Admin::InvoicesController + +Admin::InvoicesController + +cancel +create +index +new +show + + +_layout +deposit_params + + +Admin::AdminUsersController + +Admin::AdminUsersController + +create +destroy +edit +index +new +show +update + + +_layout +admin_user_params +set_user + + +Admin::EppLogsController + +Admin::EppLogsController + +index +show + + +_layout + + +Admin::LegalDocumentsController + +Admin::LegalDocumentsController + +show + + +_layout + + +ApplicationController + +ApplicationController + +admin_request? +after_sign_in_path_for +after_sign_out_path_for +api_user_log_str +current_root_url +depp_current_user +registrant_request? +registrar_request? +user_for_paper_trail + + +_layout + + +Registrar::DomainsController + +Registrar::DomainsController + +check +create +delete +destroy +edit +index +info +new +renew +transfer +update + + +_layout +init_contacts_autocomplete_map +init_domain + + +Registrar::KeyrelaysController + +Registrar::KeyrelaysController + +create +show + + +_layout + + +Registrar::SessionsController + +Registrar::SessionsController + +create +depp_controller? +find_user_by_idc +id +login +login_mid +mid +mid_status + + +_layout +check_ip +role_base_root_url + + +Registrar::PollsController + +Registrar::PollsController + +confirm_keyrelay +confirm_transfer +destroy +show + + +_layout +init_epp_xml + + +Registrar::DepositsController + +Registrar::DepositsController + +create +new + + +_layout +deposit_params + + +Registrar::ContactsController + +Registrar::ContactsController + +create +delete +destroy +edit +index +new +show +update + + +_layout +init_epp_contact + + +Registrar::DeppController + +Registrar::DeppController + +authenticate_user +depp_controller? +depp_current_user +response_ok? + + +_layout + + +Registrar::NameserversController + +Registrar::NameserversController + + + +_layout + + +Registrar::XmlConsolesController + +Registrar::XmlConsolesController + +create +load_xml +show + + +_layout + + +Registrar::InvoicesController + +Registrar::InvoicesController + +cancel +download_pdf +forward +index +show + + +_layout +set_invoice + + +Registrar::AccountActivitiesController + +Registrar::AccountActivitiesController + +index + + +_layout + + +Registrant::DomainsController + +Registrant::DomainsController + +index + + +_layout + + +Registrant::SessionsController + +Registrant::SessionsController + +find_user_by_idc +id +login +login_mid +mid +mid_status + + +_layout + + +Registrant::DomainUpdateConfirmsController + +Registrant::DomainUpdateConfirmsController + +show +update + + +_layout + + +Registrant::WhoisController + +Registrant::WhoisController + +index + + +_layout + + +Registrant::DomainDeleteConfirmsController + +Registrant::DomainDeleteConfirmsController + +show +update + + +_layout + + +EppController + +EppController + +create_full_selectors +current_user +element_count +epp_errors +epp_session +exactly_one_of +generate_svtrid +handle_errors +has_attribute +iptables_counter_update +latin_only +mutually_exclusive +optional +optional_attribute +params_hash +render_epp_response +requires +requires_attribute +update_epp_session +validate_request +write_to_epp_log +xml_attrs_present? + + +_layout diff --git a/doc/epp-examples.md b/doc/epp-examples.md index c9dd1c38b..05a7c95e8 100644 --- a/doc/epp-examples.md +++ b/doc/epp-examples.md @@ -1,6 +1,6 @@ # EPP REQUEST - RESPONSE EXAMPLES -GENERATED AT: 2015-06-16 14:45:11 UTC -EXAMPLE COUNT: 168 +GENERATED AT: 2015-07-13 08:09:38 UTC +EXAMPLE COUNT: 177 --- @@ -44,7 +44,7 @@ RESPONSE: ABC-12345 - ccReg-0628016030 + ccReg-0618295689 @@ -98,7 +98,7 @@ RESPONSE: ABC-12345 - ccReg-4850323861 + ccReg-2870310688 @@ -149,13 +149,13 @@ RESPONSE: - FIRST0:E6D21A5B - 2015-06-16T14:45:14Z + FIRST0:39FDCF9F + 2015-07-13T08:09:40Z ABC-12345 - ccReg-8174523782 + ccReg-5460080031 @@ -206,13 +206,13 @@ RESPONSE: - FIRST0:2991302F - 2015-06-16T14:45:14Z + FIRST0:D94B3B80 + 2015-07-13T08:09:40Z ABC-12345 - ccReg-5902458408 + ccReg-1701802241 @@ -263,13 +263,13 @@ RESPONSE: - FIRST0:939795FC - 2015-06-16T14:45:14Z + FIRST0:8EB9FF1C + 2015-07-13T08:09:40Z ABC-12345 - ccReg-7781355479 + ccReg-4899452053 @@ -320,13 +320,13 @@ RESPONSE: - FIRST0:8F2D96DF - 2015-06-16T14:45:14Z + FIRST0:CC224814 + 2015-07-13T08:09:40Z ABC-12345 - ccReg-9037049309 + ccReg-4861590993 @@ -379,12 +379,12 @@ RESPONSE: FIRST0:ABC12345 - 2015-06-16T14:45:14Z + 2015-07-13T08:09:40Z ABC-12345 - ccReg-5231101974 + ccReg-5935450848 @@ -437,12 +437,12 @@ RESPONSE: FIRST0:ABC:ABC:12345 - 2015-06-16T14:45:14Z + 2015-07-13T08:09:40Z ABC-12345 - ccReg-6422793401 + ccReg-2686282727 @@ -494,7 +494,7 @@ RESPONSE: ABC-12345 - ccReg-2948594360 + ccReg-8146651939 @@ -544,7 +544,7 @@ RESPONSE: ABC-12345 - ccReg-5099683978 + ccReg-5581241527 @@ -597,12 +597,12 @@ RESPONSE: FIRST0:CID:FIRST0:ABC:ABC:NEW:12345 - 2015-06-16T14:45:16Z + 2015-07-13T08:09:43Z ABC-12345 - ccReg-1644285201 + ccReg-7844818405 @@ -655,12 +655,12 @@ RESPONSE: FIRST0:CID:FIRST0:ABC:CID:ABC:NEW:12345 - 2015-06-16T14:45:16Z + 2015-07-13T08:09:43Z ABC-12345 - ccReg-9700239330 + ccReg-9977379702 @@ -713,12 +713,12 @@ RESPONSE: FIRST0:ABC22 - 2015-06-16T14:45:17Z + 2015-07-13T08:09:43Z ABC-12345 - ccReg-2521051245 + ccReg-5280988354 @@ -771,12 +771,12 @@ RESPONSE: FIRST0:CID2:FIRST0:ABC:ABC:11111 - 2015-06-16T14:45:17Z + 2015-07-13T08:09:43Z ABC-12345 - ccReg-0724862982 + ccReg-2496065899 @@ -829,12 +829,12 @@ RESPONSE: FIRST0:CID:FIRST0 - 2015-06-16T14:45:17Z + 2015-07-13T08:09:43Z ABC-12345 - ccReg-6737500376 + ccReg-6105084302 @@ -885,13 +885,13 @@ RESPONSE: - FIRST0:83F0C8EE - 2015-06-16T14:45:17Z + FIRST0:BD65CE88 + 2015-07-13T08:09:43Z ABC-12345 - ccReg-1953331836 + ccReg-7730845183 @@ -942,13 +942,13 @@ RESPONSE: - FIRST0:89839115 - 2015-06-16T14:45:17Z + FIRST0:32CC6124 + 2015-07-13T08:09:43Z ABC-12345 - ccReg-1961057833 + ccReg-5965537420 @@ -1000,7 +1000,7 @@ RESPONSE: ABC-12345 - ccReg-7530778283 + ccReg-6428920407 @@ -1052,7 +1052,7 @@ RESPONSE: ABC-12345 - ccReg-9380671496 + ccReg-7656849449 @@ -1088,7 +1088,7 @@ RESPONSE: ABC-12345 - ccReg-3302729368 + ccReg-2056150890 @@ -1141,7 +1141,7 @@ RESPONSE: ABC-12345 - ccReg-9700707144 + ccReg-1334382115 @@ -1192,12 +1192,12 @@ RESPONSE: FIRST0:SH8013 - 2015-06-16T14:45:19Z + 2015-07-13T08:09:45Z ABC-12345 - ccReg-3460954479 + ccReg-2833711488 @@ -1238,12 +1238,12 @@ RESPONSE: FIRST0:SH8013 - 2015-06-16T14:45:19Z + 2015-07-13T08:09:45Z ABC-12345 - ccReg-3321686496 + ccReg-2702640931 @@ -1291,7 +1291,7 @@ RESPONSE: ABC-12345 - ccReg-1310720284 + ccReg-9141239618 @@ -1340,12 +1340,12 @@ RESPONSE: FIRST0:SH8013 - 2015-06-16T14:45:19Z + 2015-07-13T08:09:45Z ABC-12345 - ccReg-5319423932 + ccReg-9170655194 @@ -1391,7 +1391,7 @@ RESPONSE: ABC-12345 - ccReg-8595538880 + ccReg-9045686845 @@ -1439,7 +1439,7 @@ RESPONSE: ABC-12345 - ccReg-1546881965 + ccReg-3102023477 @@ -1477,7 +1477,7 @@ RESPONSE: ABC-12345 - ccReg-2967153959 + ccReg-5108760843 @@ -1523,7 +1523,7 @@ RESPONSE: ABC-12345 - ccReg-2076214878 + ccReg-8619274236 @@ -1576,7 +1576,7 @@ RESPONSE: ABC-12345 - ccReg-0468202475 + ccReg-4679507984 @@ -1630,7 +1630,7 @@ RESPONSE: ABC-12345 - ccReg-7942047636 + ccReg-1149916612 @@ -1681,7 +1681,7 @@ RESPONSE: ABC-12345 - ccReg-9797329583 + ccReg-3709656481 @@ -1732,7 +1732,7 @@ RESPONSE: ABC-12345 - ccReg-7526123941 + ccReg-7193966819 @@ -1783,7 +1783,7 @@ RESPONSE: ABC-12345 - ccReg-4123279413 + ccReg-8289884012 @@ -1822,7 +1822,7 @@ RESPONSE: ABC-12345 - ccReg-6929449846 + ccReg-5602755069 @@ -1864,12 +1864,12 @@ RESPONSE: FIRST0:SH8013 - 2015-06-16T14:45:19Z + 2015-07-13T08:09:45Z ABC-12345 - ccReg-1481668570 + ccReg-9494548866 @@ -1914,7 +1914,7 @@ RESPONSE: ABC-12345 - ccReg-0260056975 + ccReg-3793177760 @@ -1959,12 +1959,12 @@ RESPONSE: FIRST0:SH8013 - 2015-06-16T14:45:19Z + 2015-07-13T08:09:45Z ABC-12345 - ccReg-9676737932 + ccReg-9626068041 @@ -2008,7 +2008,7 @@ RESPONSE: ABC-12345 - ccReg-9359806010 + ccReg-9232532819 @@ -2052,7 +2052,7 @@ RESPONSE: ABC-12345 - ccReg-5415478708 + ccReg-9780958644 @@ -2097,12 +2097,12 @@ RESPONSE: FIRST0:SH8013 - 2015-06-16T14:45:19Z + 2015-07-13T08:09:45Z ABC-12345 - ccReg-7303720395 + ccReg-9339539428 @@ -2147,12 +2147,12 @@ RESPONSE: FIRST0:SH8013 - 2015-06-16T14:45:19Z + 2015-07-13T08:09:45Z ABC-12345 - ccReg-8343028402 + ccReg-1811284213 @@ -2200,12 +2200,12 @@ RESPONSE: FIRST0:SH8013 - 2015-06-16T14:45:19Z + 2015-07-13T08:09:45Z ABC-12345 - ccReg-3396633434 + ccReg-7287677937 @@ -2249,12 +2249,12 @@ RESPONSE: FIRST0:SH8013 - 2015-06-16T14:45:19Z + 2015-07-13T08:09:45Z ABC-12345 - ccReg-2557605520 + ccReg-3365372793 @@ -2297,7 +2297,7 @@ RESPONSE: ABC-12345 - ccReg-5903969239 + ccReg-1219827368 @@ -2340,7 +2340,7 @@ RESPONSE: ABC-12345 - ccReg-4958556368 + ccReg-3971655755 @@ -2373,7 +2373,7 @@ RESPONSE: ABC-12345 - ccReg-3948826508 + ccReg-8754962923 @@ -2420,7 +2420,7 @@ RESPONSE: ABC-12345 - ccReg-6894400452 + ccReg-9819373260 @@ -2436,7 +2436,7 @@ REQUEST: - FIRST0:SH660293943 + FIRST0:SH510454133 password @@ -2464,7 +2464,7 @@ RESPONSE: ABC-12345 - ccReg-3167684614 + ccReg-7214487869 @@ -2480,7 +2480,7 @@ REQUEST: - FIRST0:SH918459854 + FIRST0:SH503034294 wrong password @@ -2508,7 +2508,7 @@ RESPONSE: ABC-12345 - ccReg-4976622556 + ccReg-3122380030 @@ -2524,7 +2524,7 @@ REQUEST: - FIRST0:SH479142985 + FIRST0:SH673355085 ABC-12345 @@ -2543,7 +2543,7 @@ RESPONSE: ABC-12345 - ccReg-5497436667 + ccReg-1862227156 @@ -2559,7 +2559,7 @@ REQUEST: - FIRST0:SH948515446 + FIRST0:SH268059126 password @@ -2587,7 +2587,7 @@ RESPONSE: ABC-12345 - ccReg-5113374232 + ccReg-2654739015 @@ -2635,7 +2635,7 @@ RESPONSE: ABC-12345 - ccReg-2787819683 + ccReg-7333416442 @@ -2649,7 +2649,7 @@ REQUEST: - FIRST0:SH756528579 + FIRST0:SH909522549 password @@ -2677,7 +2677,7 @@ RESPONSE: ABC-12345 - ccReg-1059535053 + ccReg-0590479812 @@ -2723,7 +2723,7 @@ RESPONSE: ABC-12345 - ccReg-9721519129 + ccReg-5714766005 @@ -2771,7 +2771,7 @@ RESPONSE: ABC-12345 - ccReg-5463189772 + ccReg-8540093009 @@ -2785,7 +2785,7 @@ REQUEST: - FIRST0:SH6727132410 + FIRST0:SH9262555410 ABC-12345 @@ -2804,7 +2804,7 @@ RESPONSE: ABC-12345 - ccReg-0140635504 + ccReg-9788975407 @@ -2850,7 +2850,7 @@ RESPONSE: ABC-12345 - ccReg-3361341345 + ccReg-0232934407 @@ -2898,7 +2898,7 @@ RESPONSE: ABC-12345 - ccReg-2140366200 + ccReg-1649878002 @@ -2912,7 +2912,7 @@ REQUEST: - FIRST0:SH6052359511 + FIRST0:SH6216347011 wrong password @@ -2940,7 +2940,7 @@ RESPONSE: ABC-12345 - ccReg-4307228004 + ccReg-8638671941 @@ -2986,7 +2986,7 @@ RESPONSE: ABC-12345 - ccReg-9967906837 + ccReg-0461625368 @@ -3019,7 +3019,7 @@ RESPONSE: ABC-12345 - ccReg-1546452843 + ccReg-7185406208 @@ -3066,7 +3066,7 @@ RESPONSE: ABC-12345 - ccReg-5794718821 + ccReg-1361275825 @@ -3113,7 +3113,7 @@ RESPONSE: ABC-12345 - ccReg-9107912155 + ccReg-5807230391 @@ -3146,7 +3146,7 @@ RESPONSE: ABC-12345 - ccReg-0867319397 + ccReg-9534409035 @@ -3187,7 +3187,7 @@ RESPONSE: ABC-12345 - ccReg-1035787772 + ccReg-0503118697 @@ -3239,10 +3239,10 @@ RESPONSE: +372.12345678 - litzy_kuvalis@pfannerstillhowe.org + mikel_schmidt@daugherty.biz fixed registrar TEST-CREATOR - 2015-06-16T14:45:37Z + 2015-07-13T08:10:04Z password @@ -3255,7 +3255,7 @@ RESPONSE: ABC-12345 - ccReg-8740910444 + ccReg-8819586690 @@ -3307,10 +3307,10 @@ RESPONSE: +372.12345678 - litzy_kuvalis@pfannerstillhowe.org + mikel_schmidt@daugherty.biz fixed registrar TEST-CREATOR - 2015-06-16T14:45:37Z + 2015-07-13T08:10:04Z password @@ -3323,7 +3323,7 @@ RESPONSE: ABC-12345 - ccReg-0768016805 + ccReg-0635458096 @@ -3375,10 +3375,10 @@ RESPONSE: +372.12345678 - litzy_kuvalis@pfannerstillhowe.org + mikel_schmidt@daugherty.biz registrar1 TEST-CREATOR - 2015-06-16T14:45:37Z + 2015-07-13T08:10:04Z password @@ -3391,7 +3391,7 @@ RESPONSE: ABC-12345 - ccReg-1418789936 + ccReg-6424655076 @@ -3407,7 +3407,7 @@ REQUEST: - FIRST0:SH168939920 + FIRST0:SH282362170 wrong-pw @@ -3429,11 +3429,11 @@ RESPONSE: - FIRST0:SH168939920 + FIRST0:SH282362170 EIS-1 - Tiana Cummerata0 + Brandon Gutkowski0 Short street 11 Tallinn @@ -3443,10 +3443,10 @@ RESPONSE: +372.12345678 - litzy_kuvalis@pfannerstillhowe.org + mikel_schmidt@daugherty.biz registrar1 TEST-CREATOR - 2015-06-16T14:45:13Z + 2015-07-13T08:09:39Z password @@ -3459,7 +3459,7 @@ RESPONSE: ABC-12345 - ccReg-8270641025 + ccReg-6150961261 @@ -3501,7 +3501,7 @@ RESPONSE: EIS-32 - Jarred Reichel15 + Hans Dooley15 Short street 11 Tallinn @@ -3511,10 +3511,10 @@ RESPONSE: +372.12345678 - litzy_kuvalis@pfannerstillhowe.org + mikel_schmidt@daugherty.biz fixed registrar TEST-CREATOR - 2015-06-16T14:45:37Z + 2015-07-13T08:10:04Z password @@ -3527,7 +3527,7 @@ RESPONSE: ABC-12345 - ccReg-0424201637 + ccReg-5948603765 @@ -3575,7 +3575,7 @@ RESPONSE: ABC-12345 - ccReg-6919284154 + ccReg-9055288154 @@ -3589,7 +3589,7 @@ REQUEST: - FIRST0:SH168939920 + FIRST0:SH282362170 password @@ -3611,11 +3611,11 @@ RESPONSE: - FIRST0:SH168939920 + FIRST0:SH282362170 EIS-1 - Tiana Cummerata0 + Brandon Gutkowski0 Short street 11 Tallinn @@ -3625,10 +3625,10 @@ RESPONSE: +372.12345678 - litzy_kuvalis@pfannerstillhowe.org + mikel_schmidt@daugherty.biz registrar1 TEST-CREATOR - 2015-06-16T14:45:13Z + 2015-07-13T08:09:39Z password @@ -3641,7 +3641,7 @@ RESPONSE: ABC-12345 - ccReg-4155363959 + ccReg-3649803181 @@ -3687,7 +3687,7 @@ RESPONSE: ABC-12345 - ccReg-9980678480 + ccReg-1933675184 @@ -3735,7 +3735,7 @@ RESPONSE: ABC-12345 - ccReg-6386920424 + ccReg-5420323891 @@ -3749,7 +3749,7 @@ REQUEST: - FIRST0:SH168939920 + FIRST0:SH282362170 wrong-pw @@ -3771,7 +3771,7 @@ RESPONSE: ABC-12345 - ccReg-8614373807 + ccReg-4827213455 @@ -3817,7 +3817,7 @@ RESPONSE: ABC-12345 - ccReg-9444940598 + ccReg-7118835839 @@ -3865,7 +3865,7 @@ RESPONSE: ABC-12345 - ccReg-1099785761 + ccReg-9117613031 @@ -3879,7 +3879,7 @@ REQUEST: - FIRST0:SH168939920 + FIRST0:SH282362170 @@ -3901,20 +3901,20 @@ RESPONSE: - FIRST0:SH168939920 + FIRST0:SH282362170 EIS-1 - Tiana Cummerata0 + Brandon Gutkowski0 registrar1 TEST-CREATOR - 2015-06-16T14:45:13Z + 2015-07-13T08:09:39Z ABC-12345 - ccReg-7660283209 + ccReg-1234334129 @@ -3960,7 +3960,7 @@ RESPONSE: ABC-12345 - ccReg-8143425519 + ccReg-2736288018 @@ -4006,7 +4006,70 @@ RESPONSE: ABC-12345 - ccReg-2175230306 + ccReg-9795814246 + + + +``` + +### EPP Domain should return error if balance low + +REQUEST: + +```xml + + + + + + example8141781761361142.ee + 1 + + + ns1.example.net + 192.0.2.2 + 1080:0:0:0:8:800:200C:417A + + + ns2.example.net + + + FIXED:CITIZEN_1234 + FIXED:SH8013 + FIXED:SH8013 + FIXED:SH801333 + + + + + + 257 + 3 + 5 + AwEAAddt2AkLfYGKgiEZB5SmIF8EvrjxNMH6HtxWEA4RJ9Ao6LCWheg8 + + + + dGVzdCBmYWlsCg== + + + ABC-12345 + + +``` + +RESPONSE: + +```xml + + + + + Billing failure - credit balance low + + + ABC-12345 + ccReg-5775792464 @@ -4022,7 +4085,7 @@ REQUEST: - example51359824296846476.ee + example25336679785374406.ee 1 @@ -4078,7 +4141,7 @@ RESPONSE: ABC-12345 - ccReg-6335804328 + ccReg-1869400002 @@ -4122,7 +4185,7 @@ RESPONSE: ABC-12345 - ccReg-4990944724 + ccReg-3527497563 @@ -4138,7 +4201,7 @@ REQUEST: - example18858770590752611.ee + example49861011752583930.ee 1 @@ -4185,14 +4248,14 @@ RESPONSE: - example18858770590752611.ee - 2015-06-16T14:45:40Z - 2016-06-16T14:45:40Z + example49861011752583930.ee + 2015-07-13T08:10:08Z + 2016-07-13T08:10:08Z ABC-12345 - ccReg-0460679321 + ccReg-2908644272 @@ -4208,7 +4271,7 @@ REQUEST: - example53637086732201506.ee + example52367797551189787.ee 1 @@ -4247,14 +4310,14 @@ RESPONSE: - example53637086732201506.ee - 2015-06-16T14:45:40Z - 2016-06-16T14:45:40Z + example52367797551189787.ee + 2015-07-13T08:10:09Z + 2016-07-13T08:10:09Z ABC-12345 - ccReg-2657489548 + ccReg-7361617669 @@ -4270,14 +4333,14 @@ REQUEST: - example55255947651220293.ee + example95532387633828733.ee 1 - ns1.example55255947651220293.ee + ns1.example95532387633828733.ee - ns2.example55255947651220293.ee + ns2.example95532387633828733.ee FIXED:CITIZEN_1234 @@ -4315,7 +4378,7 @@ RESPONSE: ABC-12345 - ccReg-5446638954 + ccReg-9261817668 @@ -4378,7 +4441,7 @@ RESPONSE: ABC-12345 - ccReg-2558205520 + ccReg-6772570562 @@ -4436,15 +4499,215 @@ RESPONSE: - - Domain name is reserved or restricted [name_dirty] - + + Required parameter missing; reserved>pw element required for reserved domains + + + ABC-12345 + ccReg-3733065800 + + + +``` + +REQUEST: + +```xml + + + + + + 1162.ee + 1 + + + ns1.example.net + 192.0.2.2 + 1080:0:0:0:8:800:200C:417A + + + ns2.example.net + + + FIXED:CITIZEN_1234 + FIXED:SH8013 + FIXED:SH8013 + FIXED:SH801333 + + + + + + 257 + 3 + 5 + AwEAAddt2AkLfYGKgiEZB5SmIF8EvrjxNMH6HtxWEA4RJ9Ao6LCWheg8 + + + + dGVzdCBmYWlsCg== + + wrong_pw + + + + ABC-12345 + + +``` + +RESPONSE: + +```xml + + + + + Invalid authorization information; invalid reserved>pw value + + + ABC-12345 + ccReg-7112576450 + + + +``` + +### EPP Domain with citizen as a registrant creates a reserved domain with correct auth info + +REQUEST: + +```xml + + + + + + 1162.ee + 1 + + + ns1.example.net + 192.0.2.2 + 1080:0:0:0:8:800:200C:417A + + + ns2.example.net + + + FIXED:CITIZEN_1234 + FIXED:SH8013 + FIXED:SH8013 + FIXED:SH801333 + + + + + + 257 + 3 + 5 + AwEAAddt2AkLfYGKgiEZB5SmIF8EvrjxNMH6HtxWEA4RJ9Ao6LCWheg8 + + + + dGVzdCBmYWlsCg== + + abc + + + + ABC-12345 + + +``` + +RESPONSE: + +```xml + + + + + Command completed successfully + + + 1162.ee + 2015-07-13T08:10:13Z + 2016-07-13T08:10:13Z + + + + ABC-12345 + ccReg-5049259745 + + + +``` + +### EPP Domain with citizen as a registrant does not create blocked domain + +REQUEST: + +```xml + + + + + + ftp.ee + 1 + + + ns1.example.net + 192.0.2.2 + 1080:0:0:0:8:800:200C:417A + + + ns2.example.net + + + FIXED:CITIZEN_1234 + FIXED:SH8013 + FIXED:SH8013 + FIXED:SH801333 + + + + + + 257 + 3 + 5 + AwEAAddt2AkLfYGKgiEZB5SmIF8EvrjxNMH6HtxWEA4RJ9Ao6LCWheg8 + + + + dGVzdCBmYWlsCg== + + + ABC-12345 + + +``` + +RESPONSE: + +```xml + + + + + Domain name is blocked [name_dirty] + + ftp.ee ABC-12345 - ccReg-3241448329 + ccReg-0819724563 @@ -4460,7 +4723,7 @@ REQUEST: - example79107476359960104.ee + example66869374929851351.ee 1 @@ -4503,7 +4766,7 @@ RESPONSE: ABC-12345 - ccReg-2841149464 + ccReg-1539701883 @@ -4519,7 +4782,7 @@ REQUEST: - example89212032300871964.ee + example46569369919922504.ee 1 FIXED:CITIZEN_1234 FIXED:SH8013 @@ -4559,7 +4822,7 @@ RESPONSE: ABC-12345 - ccReg-6780943188 + ccReg-6017666451 @@ -4575,7 +4838,7 @@ REQUEST: - example83430684429956047.ee + example9775945649237234.ee 1 @@ -4656,7 +4919,7 @@ RESPONSE: ABC-12345 - ccReg-2034075719 + ccReg-2484227692 @@ -4672,7 +4935,7 @@ REQUEST: - example48749833529852102.ee + example25543970040464568.ee 1 @@ -4726,7 +4989,7 @@ RESPONSE: ABC-12345 - ccReg-8625622303 + ccReg-0271766119 @@ -4742,7 +5005,7 @@ REQUEST: - example62530771922904064.ee + example83419576189614996.ee 1 ns1.example.ee @@ -4783,7 +5046,7 @@ RESPONSE: ABC-12345 - ccReg-9223003685 + ccReg-7801167272 @@ -4799,7 +5062,7 @@ REQUEST: - example57855176106155885.ee + example78746795673349410.ee 1 @@ -4841,14 +5104,14 @@ RESPONSE: - example57855176106155885.ee - 2015-06-16T14:45:49Z - 2016-06-16T14:45:49Z + example78746795673349410.ee + 2015-07-13T08:10:20Z + 2016-07-13T08:10:20Z ABC-12345 - ccReg-3987518347 + ccReg-7812759820 @@ -4864,7 +5127,7 @@ REQUEST: - example36117415864684846.ee + example86459993736024103.ee 1 @@ -4915,7 +5178,7 @@ RESPONSE: ABC-12345 - ccReg-8191386800 + ccReg-0770361263 @@ -4931,8 +5194,8 @@ REQUEST: - example47616294102238590.ee - 1 + example77378499664954502.ee + 365 ns1.example.net @@ -4978,14 +5241,154 @@ RESPONSE: - example47616294102238590.ee - 2015-06-16T14:45:50Z - 2016-06-16T14:45:50Z + example77378499664954502.ee + 2015-07-13T08:10:22Z + 2016-07-13T08:10:22Z ABC-12345 - ccReg-9254659589 + ccReg-2279305615 + + + +``` + +### EPP Domain with citizen as a registrant creates a domain with longer periods + +REQUEST: + +```xml + + + + + + example91344146443917444.ee + 2 + + + ns1.example.net + 192.0.2.2 + 1080:0:0:0:8:800:200C:417A + + + ns2.example.net + + + FIXED:CITIZEN_1234 + FIXED:SH8013 + FIXED:SH8013 + FIXED:SH801333 + + + + + + 257 + 3 + 5 + AwEAAddt2AkLfYGKgiEZB5SmIF8EvrjxNMH6HtxWEA4RJ9Ao6LCWheg8 + + + + dGVzdCBmYWlsCg== + + + ABC-12345 + + +``` + +RESPONSE: + +```xml + + + + + Command completed successfully + + + + example91344146443917444.ee + 2015-07-13T08:10:22Z + 2017-07-13T08:10:22Z + + + + ABC-12345 + ccReg-7948856904 + + + +``` + +### EPP Domain with citizen as a registrant creates a domain with longer periods + +REQUEST: + +```xml + + + + + + example37678434336097153.ee + 36 + + + ns1.example.net + 192.0.2.2 + 1080:0:0:0:8:800:200C:417A + + + ns2.example.net + + + FIXED:CITIZEN_1234 + FIXED:SH8013 + FIXED:SH8013 + FIXED:SH801333 + + + + + + 257 + 3 + 5 + AwEAAddt2AkLfYGKgiEZB5SmIF8EvrjxNMH6HtxWEA4RJ9Ao6LCWheg8 + + + + dGVzdCBmYWlsCg== + + + ABC-12345 + + +``` + +RESPONSE: + +```xml + + + + + Command completed successfully + + + + example37678434336097153.ee + 2015-07-13T08:10:22Z + 2018-07-13T08:10:22Z + + + + ABC-12345 + ccReg-0923978415 @@ -5001,7 +5404,7 @@ REQUEST: - example59902259057282424.ee + example16191991725339317.ee 367 @@ -5051,7 +5454,7 @@ RESPONSE: ABC-12345 - ccReg-5831577897 + ccReg-3982837408 @@ -5067,7 +5470,7 @@ REQUEST: - example35799150293426379.ee + example40866032952252613.ee 1 @@ -5126,14 +5529,14 @@ RESPONSE: - example35799150293426379.ee - 2015-06-16T14:45:52Z - 2016-06-16T14:45:52Z + example40866032952252613.ee + 2015-07-13T08:10:23Z + 2016-07-13T08:10:23Z ABC-12345 - ccReg-6805098026 + ccReg-9573434963 @@ -5149,7 +5552,7 @@ REQUEST: - example77419485730565318.ee + example9781392118411734.ee 1 @@ -5244,7 +5647,7 @@ RESPONSE: ABC-12345 - ccReg-5499891820 + ccReg-6068485630 @@ -5260,7 +5663,7 @@ REQUEST: - example62893290773940803.ee + example82547809365634736.ee 1 @@ -5316,7 +5719,7 @@ RESPONSE: ABC-12345 - ccReg-1606849858 + ccReg-6743869283 @@ -5332,7 +5735,7 @@ REQUEST: - example89542634347493363.ee + example24299031431104455.ee 1 @@ -5385,7 +5788,7 @@ RESPONSE: ABC-12345 - ccReg-0277146354 + ccReg-4538001040 @@ -5401,7 +5804,7 @@ REQUEST: - example5611622315382730.ee + example86624189051768810.ee 1 @@ -5448,14 +5851,14 @@ RESPONSE: - example5611622315382730.ee - 2015-06-16T14:45:55Z - 2016-06-16T14:45:55Z + example86624189051768810.ee + 2015-07-13T08:10:27Z + 2016-07-13T08:10:27Z ABC-12345 - ccReg-2786067157 + ccReg-4356869009 @@ -5471,7 +5874,7 @@ REQUEST: - example28205147543381731.ee + example70522154515526376.ee 1 @@ -5524,14 +5927,14 @@ RESPONSE: - example28205147543381731.ee - 2015-06-16T14:45:55Z - 2016-06-16T14:45:55Z + example70522154515526376.ee + 2015-07-13T08:10:27Z + 2016-07-13T08:10:27Z ABC-12345 - ccReg-3180633288 + ccReg-0834839872 @@ -5547,7 +5950,7 @@ REQUEST: - example81689211125437444.ee + example11125999187215251.ee 1 @@ -5600,7 +6003,7 @@ RESPONSE: ABC-12345 - ccReg-0596552578 + ccReg-4189398038 @@ -5616,7 +6019,7 @@ REQUEST: - example16808329279089073.ee + example58593539019684182.ee 1 @@ -5663,7 +6066,7 @@ RESPONSE: ABC-12345 - ccReg-3845103907 + ccReg-1718210348 @@ -5679,7 +6082,7 @@ REQUEST: - example57773978303296424.ee + example83982312915963874.ee 1 @@ -5732,7 +6135,7 @@ RESPONSE: ABC-12345 - ccReg-0236248171 + ccReg-2950027969 @@ -5748,7 +6151,7 @@ REQUEST: - example82556663094409029.ee + example46238990207964440.ee 1 @@ -5793,14 +6196,14 @@ RESPONSE: - example82556663094409029.ee - 2015-06-16T14:45:59Z - 2016-06-16T14:45:59Z + example46238990207964440.ee + 2015-07-13T08:10:31Z + 2016-07-13T08:10:31Z ABC-12345 - ccReg-7792326836 + ccReg-0620001088 @@ -5816,7 +6219,7 @@ REQUEST: - example61224688298392772.ee + example88328132023816416.ee 1 @@ -5861,7 +6264,7 @@ RESPONSE: ABC-12345 - ccReg-4835312018 + ccReg-4854981199 @@ -5877,7 +6280,7 @@ REQUEST: - example2482715006886939.ee + example63410537948779137.ee 1 @@ -5925,7 +6328,7 @@ RESPONSE: ABC-12345 - ccReg-0994405489 + ccReg-1289788540 @@ -5973,7 +6376,7 @@ RESPONSE: ABC-12345 - ccReg-9434443874 + ccReg-9947034870 @@ -5985,11 +6388,11 @@ REQUEST: - + domain1.ee - cade780e81c248d9e6363fd303b523c3 + a6c1a37f9466f510bc45a6f9b9d0095e @@ -6017,15 +6420,15 @@ RESPONSE: domain1.ee serverApproved REGDOMAIN2 - 2015-06-16T14:46:02Z + 2015-07-13T08:10:33Z REGDOMAIN1 - 2015-06-16T14:46:02Z - 2016-06-16T14:46:02Z + 2015-07-13T08:10:33Z + 2016-07-13T08:10:33Z ABC-12345 - ccReg-6107518806 + ccReg-7553127734 @@ -6071,7 +6474,7 @@ RESPONSE: ABC-12345 - ccReg-9351177423 + ccReg-0227567769 @@ -6099,23 +6502,23 @@ RESPONSE: Command completed successfully; ack to dequeue - 2015-06-16T14:46:02Z - Domain transfer was approved, associated contacts are: ["REGDOMAIN2:2E38C324", "REGDOMAIN2:30A5A03D"] + 2015-07-13T08:10:33Z + Domain transfer was approved, associated contacts were: ["FIXED:SH2458466313", "FIXED:SH6857426112"] and registrant was FIXED:REGISTRANT240360470 domain1.ee serverApproved REGDOMAIN2 - 2015-06-16T14:46:02Z + 2015-07-13T08:10:33Z REGDOMAIN1 - 2015-06-16T14:46:02Z - 2016-06-16T14:46:02Z + 2015-07-13T08:10:33Z + 2016-07-13T08:10:33Z ABC-12345 - ccReg-5221788468 + ccReg-5437902047 @@ -6127,11 +6530,11 @@ REQUEST: - + domain1.ee - e3b00963e2849df1654840a4805b8390 + a79127ff7dc2919c88c697cdfbdf0b08 @@ -6159,15 +6562,15 @@ RESPONSE: domain1.ee pending REGDOMAIN1 - 2015-06-16T14:46:02Z + 2015-07-13T08:10:34Z REGDOMAIN2 - 2015-06-16T15:46:02Z - 2016-06-16T14:46:02Z + 2015-07-13T09:10:34Z + 2016-07-13T08:10:33Z ABC-12345 - ccReg-5943956125 + ccReg-7214241560 @@ -6179,11 +6582,11 @@ REQUEST: - + domain1.ee - e3b00963e2849df1654840a4805b8390 + a79127ff7dc2919c88c697cdfbdf0b08 @@ -6211,15 +6614,15 @@ RESPONSE: domain1.ee pending REGDOMAIN1 - 2015-06-16T14:46:02Z + 2015-07-13T08:10:34Z REGDOMAIN2 - 2015-06-16T15:46:02Z - 2016-06-16T14:46:02Z + 2015-07-13T09:10:34Z + 2016-07-13T08:10:33Z ABC-12345 - ccReg-0973430912 + ccReg-6123955551 @@ -6265,7 +6668,7 @@ RESPONSE: ABC-12345 - ccReg-7808499308 + ccReg-6308918955 @@ -6293,7 +6696,7 @@ RESPONSE: Command completed successfully; ack to dequeue - 2015-06-16T14:46:02Z + 2015-07-13T08:10:34Z Transfer requested. @@ -6301,15 +6704,15 @@ RESPONSE: domain1.ee pending REGDOMAIN1 - 2015-06-16T14:46:02Z + 2015-07-13T08:10:34Z REGDOMAIN2 - 2015-06-16T15:46:02Z - 2016-06-16T14:46:02Z + 2015-07-13T09:10:34Z + 2016-07-13T08:10:33Z ABC-12345 - ccReg-7198000795 + ccReg-9560017151 @@ -6355,7 +6758,7 @@ RESPONSE: ABC-12345 - ccReg-8981002307 + ccReg-9032834985 @@ -6401,7 +6804,7 @@ RESPONSE: ABC-12345 - ccReg-0623446914 + ccReg-9332036940 @@ -6431,7 +6834,7 @@ RESPONSE: ABC-12345 - ccReg-3648943159 + ccReg-8727580885 @@ -6477,7 +6880,7 @@ RESPONSE: ABC-12345 - ccReg-5814325246 + ccReg-4349221001 @@ -6525,7 +6928,7 @@ RESPONSE: ABC-12345 - ccReg-6044514213 + ccReg-5525442277 @@ -6537,11 +6940,11 @@ REQUEST: - + domain2.ee - 024bb6c14f1f351ff88bd3bdb24ec907 + 55293c4e006ab91a8bb56ad2c3b542e8 @@ -6569,15 +6972,15 @@ RESPONSE: domain2.ee pending REGDOMAIN2 - 2015-06-16T14:46:03Z + 2015-07-13T08:10:34Z REGDOMAIN1 - 2015-06-16T15:46:03Z - 2016-06-16T14:46:03Z + 2015-07-13T09:10:34Z + 2016-07-13T08:10:34Z ABC-12345 - ccReg-6223906445 + ccReg-3032166853 @@ -6623,7 +7026,7 @@ RESPONSE: ABC-12345 - ccReg-8746149187 + ccReg-0266707351 @@ -6669,7 +7072,7 @@ RESPONSE: ABC-12345 - ccReg-7756736893 + ccReg-9904220818 @@ -6681,11 +7084,11 @@ REQUEST: - + domain2.ee - 024bb6c14f1f351ff88bd3bdb24ec907 + 55293c4e006ab91a8bb56ad2c3b542e8 @@ -6713,15 +7116,15 @@ RESPONSE: domain2.ee pending REGDOMAIN2 - 2015-06-16T14:46:03Z + 2015-07-13T08:10:34Z REGDOMAIN1 - 2015-06-16T15:46:03Z - 2016-06-16T14:46:03Z + 2015-07-13T09:10:34Z + 2016-07-13T08:10:34Z ABC-12345 - ccReg-8545188045 + ccReg-4891125991 @@ -6767,7 +7170,7 @@ RESPONSE: ABC-12345 - ccReg-2241555669 + ccReg-6334747073 @@ -6815,7 +7218,7 @@ RESPONSE: ABC-12345 - ccReg-8460295410 + ccReg-8881009763 @@ -6827,11 +7230,11 @@ REQUEST: - + domain3.ee - 836af4fd51fcd5712120b17fe2fa2bb3 + 0eb7555f7484fec80ed502a2b3ba5be9 @@ -6854,15 +7257,15 @@ RESPONSE: domain3.ee serverApproved REGDOMAIN2 - 2015-06-16T14:46:03Z + 2015-07-13T08:10:35Z REGDOMAIN1 - 2015-06-16T14:46:03Z - 2016-06-16T14:46:03Z + 2015-07-13T08:10:35Z + 2016-07-13T08:10:35Z ABC-12345 - ccReg-8076619398 + ccReg-0400376668 @@ -6908,7 +7311,7 @@ RESPONSE: ABC-12345 - ccReg-8851768239 + ccReg-0112443198 @@ -6956,7 +7359,7 @@ RESPONSE: ABC-12345 - ccReg-9101345679 + ccReg-9031704497 @@ -6968,11 +7371,11 @@ REQUEST: - + domain4.ee - c4191d5991d76be69de4c89c7d6332c6 + 04edcd706724ed5d0de9642788995eee @@ -6995,15 +7398,15 @@ RESPONSE: domain4.ee serverApproved REGDOMAIN2 - 2015-06-16T14:46:04Z + 2015-07-13T08:10:35Z REGDOMAIN1 - 2015-06-16T14:46:04Z - 2016-06-16T14:46:04Z + 2015-07-13T08:10:35Z + 2016-07-13T08:10:35Z ABC-12345 - ccReg-1271904293 + ccReg-8391034505 @@ -7049,7 +7452,7 @@ RESPONSE: ABC-12345 - ccReg-3137087761 + ccReg-7638487821 @@ -7097,7 +7500,7 @@ RESPONSE: ABC-12345 - ccReg-7273165678 + ccReg-4526950665 @@ -7109,11 +7512,11 @@ REQUEST: - + domain5.ee - cb2a7321b5cbbbb3dde7a6810c9ed13f + 9d0219c5b0c128c86608c85c44f11e55 @@ -7136,15 +7539,15 @@ RESPONSE: domain5.ee serverApproved REGDOMAIN2 - 2015-06-16T14:46:04Z + 2015-07-13T08:10:36Z REGDOMAIN1 - 2015-06-16T14:46:04Z - 2016-06-16T14:46:04Z + 2015-07-13T08:10:36Z + 2016-07-13T08:10:36Z ABC-12345 - ccReg-6138246266 + ccReg-5537786370 @@ -7190,7 +7593,7 @@ RESPONSE: ABC-12345 - ccReg-0594521940 + ccReg-8635372653 @@ -7238,7 +7641,7 @@ RESPONSE: ABC-12345 - ccReg-3903547157 + ccReg-2387752429 @@ -7250,11 +7653,11 @@ REQUEST: - + domain8.ee - 8ad5a1e3f0f5cfd3ac927eacd377d748 + 97a9ceb244b35347929aa1561ead4c8b @@ -7277,15 +7680,15 @@ RESPONSE: domain8.ee serverApproved REGDOMAIN2 - 2015-06-16T14:46:05Z + 2015-07-13T08:10:36Z REGDOMAIN1 - 2015-06-16T14:46:05Z - 2016-06-16T14:46:05Z + 2015-07-13T08:10:36Z + 2016-07-13T08:10:36Z ABC-12345 - ccReg-6422274553 + ccReg-0632987427 @@ -7331,7 +7734,7 @@ RESPONSE: ABC-12345 - ccReg-8513849853 + ccReg-9801073653 @@ -7379,7 +7782,7 @@ RESPONSE: ABC-12345 - ccReg-0495664550 + ccReg-5308734025 @@ -7391,11 +7794,11 @@ REQUEST: - + domain9.ee - ae0e9f8ad42aa43f5421e7825576d49b + 5a41b6437a25e0d9411403c06c18f33c @@ -7418,15 +7821,15 @@ RESPONSE: domain9.ee serverApproved REGDOMAIN2 - 2015-06-16T14:46:05Z + 2015-07-13T08:10:37Z REGDOMAIN1 - 2015-06-16T14:46:05Z - 2016-06-16T14:46:05Z + 2015-07-13T08:10:37Z + 2016-07-13T08:10:37Z ABC-12345 - ccReg-8327056615 + ccReg-1676191553 @@ -7472,7 +7875,7 @@ RESPONSE: ABC-12345 - ccReg-4617980059 + ccReg-3121793274 @@ -7520,7 +7923,7 @@ RESPONSE: ABC-12345 - ccReg-2829504560 + ccReg-7602205334 @@ -7532,11 +7935,11 @@ REQUEST: - + domain11.ee - 15fd8747240b3b76d7d629fdfb9933c2 + 6a9bfed8e96b212f1de718bd4979b39a @@ -7559,15 +7962,15 @@ RESPONSE: domain11.ee serverApproved REGDOMAIN2 - 2015-06-16T14:46:06Z + 2015-07-13T08:10:37Z REGDOMAIN1 - 2015-06-16T14:46:06Z - 2016-06-16T14:46:06Z + 2015-07-13T08:10:37Z + 2016-07-13T08:10:37Z ABC-12345 - ccReg-4652082139 + ccReg-7258212831 @@ -7613,7 +8016,7 @@ RESPONSE: ABC-12345 - ccReg-7682673588 + ccReg-1615959934 @@ -7661,7 +8064,7 @@ RESPONSE: ABC-12345 - ccReg-2956836704 + ccReg-4400024318 @@ -7673,11 +8076,11 @@ REQUEST: - + domain14.ee - 99528c913bd395947f46b320c600851e + 5d5ba19df5b5411f99236a493ef22a5c @@ -7700,15 +8103,15 @@ RESPONSE: domain14.ee serverApproved REGDOMAIN2 - 2015-06-16T14:46:07Z + 2015-07-13T08:10:38Z REGDOMAIN1 - 2015-06-16T14:46:07Z - 2016-06-16T14:46:06Z + 2015-07-13T08:10:38Z + 2016-07-13T08:10:38Z ABC-12345 - ccReg-2561775032 + ccReg-9169504885 @@ -7754,7 +8157,7 @@ RESPONSE: ABC-12345 - ccReg-8704236801 + ccReg-8687650026 @@ -7802,7 +8205,7 @@ RESPONSE: ABC-12345 - ccReg-5989893103 + ccReg-8275992139 @@ -7814,11 +8217,11 @@ REQUEST: - + domain15.ee - ced325e25352a6d3ae454729c5a5f133 + 0a63b7c0a6d070aba600c1233b74780e @@ -7841,15 +8244,15 @@ RESPONSE: domain15.ee serverApproved REGDOMAIN2 - 2015-06-16T14:46:07Z + 2015-07-13T08:10:39Z REGDOMAIN1 - 2015-06-16T14:46:07Z - 2016-06-16T14:46:07Z + 2015-07-13T08:10:39Z + 2016-07-13T08:10:38Z ABC-12345 - ccReg-3303397389 + ccReg-7177786070 @@ -7895,7 +8298,7 @@ RESPONSE: ABC-12345 - ccReg-3498869771 + ccReg-9291043231 @@ -7943,7 +8346,7 @@ RESPONSE: ABC-12345 - ccReg-3004185742 + ccReg-1485507026 @@ -7955,7 +8358,7 @@ REQUEST: - + domain16.ee @@ -7979,7 +8382,7 @@ RESPONSE: ABC-12345 - ccReg-0738799544 + ccReg-0431836855 @@ -8025,7 +8428,7 @@ RESPONSE: ABC-12345 - ccReg-9100482752 + ccReg-4670728995 @@ -8043,7 +8446,7 @@ REQUEST: domain17.ee - d5649c7d29cea682a55405451a7b3e9f + 78a5ec49ace3acba7d9f00f07b42843b @@ -8071,15 +8474,15 @@ RESPONSE: domain17.ee clientApproved REGDOMAIN2 - 2015-06-16T14:46:08Z + 2015-07-13T08:10:39Z REGDOMAIN1 - 2015-06-16T14:46:08Z - 2016-06-16T14:46:08Z + 2015-07-13T08:10:39Z + 2016-07-13T08:10:39Z ABC-12345 - ccReg-5630988802 + ccReg-7636473741 @@ -8127,7 +8530,7 @@ RESPONSE: ABC-12345 - ccReg-1163667761 + ccReg-6002706539 @@ -8143,7 +8546,7 @@ REQUEST: domain18.ee - fe3d5081d9fa1723fec7ca2d3d197651 + 36db07e5d50c74825a890736522b8ff5 @@ -8168,7 +8571,7 @@ RESPONSE: ABC-12345 - ccReg-6697616444 + ccReg-8962204090 @@ -8214,7 +8617,7 @@ RESPONSE: ABC-12345 - ccReg-2557365838 + ccReg-4895590684 @@ -8230,7 +8633,7 @@ REQUEST: domain18.ee - fe3d5081d9fa1723fec7ca2d3d197651 + 36db07e5d50c74825a890736522b8ff5 @@ -8258,15 +8661,15 @@ RESPONSE: domain18.ee clientRejected REGDOMAIN2 - 2015-06-16T14:46:08Z + 2015-07-13T08:10:39Z REGDOMAIN1 - 2015-06-16T14:46:08Z - 2016-06-16T14:46:08Z + 2015-07-13T08:10:39Z + 2016-07-13T08:10:39Z ABC-12345 - ccReg-9330091112 + ccReg-2744955362 @@ -8314,7 +8717,7 @@ RESPONSE: ABC-12345 - ccReg-4172750491 + ccReg-6291768376 @@ -8330,7 +8733,7 @@ REQUEST: domain19.ee - 0220447ad7d651fac0dace38a5bcb106 + ab440e4d641fdb8309ee06212014f08c @@ -8355,7 +8758,7 @@ RESPONSE: ABC-12345 - ccReg-8617259540 + ccReg-1456367772 @@ -8401,7 +8804,7 @@ RESPONSE: ABC-12345 - ccReg-7168292306 + ccReg-3133112737 @@ -8415,7 +8818,7 @@ REQUEST: - + domain20.ee @@ -8444,13 +8847,13 @@ RESPONSE: ABC-12345 - ccReg-5705380145 + ccReg-9979904031 ``` -### EPP Domain with valid domain ignores transfer wha registrant registrar requests transfer +### EPP Domain with valid domain ignores transfer when domain already belongs to registrar REQUEST: @@ -8458,11 +8861,11 @@ REQUEST: - + domain21.ee - e736e5af0a5e47d84be0a8211eb1e97a + fec6806502193b6797015e58f6720cd6 @@ -8487,7 +8890,7 @@ RESPONSE: ABC-12345 - ccReg-0353546410 + ccReg-8875125353 @@ -8503,7 +8906,7 @@ REQUEST: - example98439991603054778.ee + example59798550307607834.ee 98oiewslkfkd @@ -8520,12 +8923,12 @@ RESPONSE: - - Attribute is invalid: op + + Parameter value range error: op ABC-12345 - ccReg-6980066531 + ccReg-7685901733 @@ -8573,7 +8976,7 @@ RESPONSE: ABC-12345 - ccReg-6843014672 + ccReg-5540138016 @@ -8585,11 +8988,11 @@ REQUEST: - + domain22.ee - 008c062889e1dc19127c0636278263f4 + 5c974420af9eaed0828c12290a1982ad @@ -8617,15 +9020,15 @@ RESPONSE: domain22.ee serverApproved REGDOMAIN2 - 2015-06-16T14:46:13Z + 2015-07-13T08:10:44Z REGDOMAIN1 - 2015-06-16T14:46:13Z - 2016-06-16T14:46:13Z + 2015-07-13T08:10:44Z + 2016-07-13T08:10:44Z ABC-12345 - ccReg-8542599190 + ccReg-4135314212 @@ -8637,11 +9040,11 @@ REQUEST: - + domain22.ee - 008c062889e1dc19127c0636278263f4 + 5c974420af9eaed0828c12290a1982ad @@ -8666,7 +9069,7 @@ RESPONSE: ABC-12345 - ccReg-0772545533 + ccReg-9874991967 @@ -8712,7 +9115,7 @@ RESPONSE: ABC-12345 - ccReg-0922916710 + ccReg-5290054570 @@ -8730,7 +9133,7 @@ REQUEST: domain23.ee - 8b267970556e6d4f52ac0e8cd5ec0533 + f147990f98219469538d22370f6678db @@ -8751,11 +9154,341 @@ RESPONSE: - Pending transfer was not found + No transfers found ABC-12345 - ccReg-0757072773 + ccReg-5805802380 + + + +``` + +### EPP Domain with valid domain should not return transfers when there are none + +REQUEST: + +```xml + + + + + + domain24.ee + + b37a01669b03f47168dc04d231f58e10 + + + + ABC-12345 + + +``` + +RESPONSE: + +```xml + + + + + No transfers found + + + ABC-12345 + ccReg-3524664626 + + + +``` + +### EPP Domain with valid domain should allow querying domain transfer + +REQUEST: + +```xml + + + + + registrar2 + ghyt9e4fu + + 1.0 + en + + + https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd + https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd + urn:ietf:params:xml:ns:host-1.0 + urn:ietf:params:xml:ns:keyrelay-1.0 + + urn:ietf:params:xml:ns:secDNS-1.1 + https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd + + + + ABC-12345 + + +``` + +RESPONSE: + +```xml + + + + + Command completed successfully + + + ABC-12345 + ccReg-5541426382 + + + +``` + +REQUEST: + +```xml + + + + + + domain25.ee + + 51ae1a97a223f79283c466efa66d9f29 + + + + + + dGVzdCBmYWlsCg== + + + ABC-12345 + + +``` + +RESPONSE: + +```xml + + + + + Command completed successfully + + + + domain25.ee + pending + REGDOMAIN2 + 2015-07-13T08:10:47Z + REGDOMAIN1 + 2015-07-13T09:10:47Z + 2016-07-13T08:10:47Z + + + + ABC-12345 + ccReg-7762900615 + + + +``` + +REQUEST: + +```xml + + + + + + domain25.ee + + 51ae1a97a223f79283c466efa66d9f29 + + + + ABC-12345 + + +``` + +RESPONSE: + +```xml + + + + + Command completed successfully + + + + domain25.ee + pending + REGDOMAIN2 + 2015-07-13T08:10:47Z + REGDOMAIN1 + 2015-07-13T09:10:47Z + 2016-07-13T08:10:47Z + + + + ABC-12345 + ccReg-6766932145 + + + +``` + +REQUEST: + +```xml + + + + + registrar1 + ghyt9e4fu + + 1.0 + en + + + https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd + https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd + urn:ietf:params:xml:ns:host-1.0 + urn:ietf:params:xml:ns:keyrelay-1.0 + + urn:ietf:params:xml:ns:secDNS-1.1 + https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd + + + + ABC-12345 + + +``` + +RESPONSE: + +```xml + + + + + Command completed successfully + + + ABC-12345 + ccReg-6659036116 + + + +``` + +REQUEST: + +```xml + + + + + + domain25.ee + + 51ae1a97a223f79283c466efa66d9f29 + + + + + + dGVzdCBmYWlsCg== + + + ABC-12345 + + +``` + +RESPONSE: + +```xml + + + + + Command completed successfully + + + + domain25.ee + clientApproved + REGDOMAIN2 + 2015-07-13T08:10:47Z + REGDOMAIN1 + 2015-07-13T08:10:48Z + 2016-07-13T08:10:47Z + + + + ABC-12345 + ccReg-0997071800 + + + +``` + +REQUEST: + +```xml + + + + + + domain25.ee + + 2b13bca2ffba6d50141100fd2a6d2cfb + + + + ABC-12345 + + +``` + +RESPONSE: + +```xml + + + + + Command completed successfully + + + + domain25.ee + clientApproved + REGDOMAIN2 + 2015-07-13T08:10:47Z + REGDOMAIN1 + 2015-07-13T08:10:48Z + 2016-07-13T08:10:47Z + + + + ABC-12345 + ccReg-0170230306 @@ -8771,7 +9504,7 @@ REQUEST: - domain24.ee + domain26.ee FIXED:CITIZEN_1234 @@ -8799,7 +9532,7 @@ RESPONSE: ABC-12345 - ccReg-1524969701 + ccReg-4927090089 @@ -8809,107 +9542,6 @@ RESPONSE: REQUEST: -```xml - - - - - - domain25.ee - - FIXED:CITIZEN_1234 - - - - - - - dGVzdCBmYWlsCg== - - - ABC-12345 - - -``` - -RESPONSE: - -```xml - - - - - Command completed successfully; action pending - - - ABC-12345 - ccReg-7160661951 - - - -``` - -### EPP Domain with valid domain should not return action pending when changes are invalid - -REQUEST: - -```xml - - - - - - domain26.ee - - - - ns.morissette80.ee - - - ns.turnerwuckert79.ee - - - ns.shanahan78.ee - - - - - FIXED:CITIZEN_1234 - - - - - - - dGVzdCBmYWlsCg== - - - ABC-12345 - - -``` - -RESPONSE: - -```xml - - - - - Nameservers count must be between 2-11 [nameservers] - - - ABC-12345 - ccReg-5838624706 - - - -``` - -### EPP Domain with valid domain should not return action pending when domain itself is already invaid - -REQUEST: - ```xml @@ -8935,6 +9567,63 @@ REQUEST: RESPONSE: +```xml + + + + + Command completed successfully; action pending + + + ABC-12345 + ccReg-5939193255 + + + +``` + +### EPP Domain with valid domain should not return action pending when changes are invalid + +REQUEST: + +```xml + + + + + + domain28.ee + + + + ns.lowe86.ee + + + ns.von85.ee + + + ns.mayert84.ee + + + + + FIXED:CITIZEN_1234 + + + + + + + dGVzdCBmYWlsCg== + + + ABC-12345 + + +``` + +RESPONSE: + ```xml @@ -8944,7 +9633,51 @@ RESPONSE: ABC-12345 - ccReg-5253637768 + ccReg-1902697655 + + + +``` + +### EPP Domain with valid domain should not return action pending when domain itself is already invaid + +REQUEST: + +```xml + + + + + + domain29.ee + + FIXED:CITIZEN_1234 + + + + + + + dGVzdCBmYWlsCg== + + + ABC-12345 + + +``` + +RESPONSE: + +```xml + + + + + Nameservers count must be between 2-11 [nameservers] + + + ABC-12345 + ccReg-3416538565 @@ -8960,7 +9693,7 @@ REQUEST: - domain28.ee + domain30.ee FIXED:CITIZEN_1234 @@ -8988,7 +9721,7 @@ RESPONSE: ABC-12345 - ccReg-6353980879 + ccReg-8628956364 @@ -9004,7 +9737,7 @@ REQUEST: - domain29.ee + domain31.ee @@ -9057,7 +9790,7 @@ RESPONSE: ABC-12345 - ccReg-9385991613 + ccReg-1167119793 @@ -9071,7 +9804,7 @@ REQUEST: - domain29.ee + domain31.ee @@ -9121,7 +9854,7 @@ RESPONSE: ABC-12345 - ccReg-5743092443 + ccReg-2401442001 @@ -9135,7 +9868,7 @@ REQUEST: - domain29.ee + domain31.ee @@ -9212,7 +9945,7 @@ RESPONSE: ABC-12345 - ccReg-8404006394 + ccReg-3219643667 @@ -9228,7 +9961,7 @@ REQUEST: - domain30.ee + domain32.ee @@ -9287,7 +10020,7 @@ RESPONSE: ABC-12345 - ccReg-4710508132 + ccReg-9234642721 @@ -9301,7 +10034,7 @@ REQUEST: - domain30.ee + domain32.ee @@ -9357,7 +10090,7 @@ RESPONSE: ABC-12345 - ccReg-0418760365 + ccReg-1807566212 @@ -9373,7 +10106,7 @@ REQUEST: - domain31.ee + domain33.ee Payment overdue. @@ -9396,7 +10129,7 @@ RESPONSE: ABC-12345 - ccReg-6393659962 + ccReg-7613379343 @@ -9412,7 +10145,7 @@ REQUEST: - domain32.ee + domain34.ee @@ -9462,7 +10195,7 @@ RESPONSE: ABC-12345 - ccReg-5765767170 + ccReg-3729650879 @@ -9476,7 +10209,7 @@ REQUEST: - domain32.ee + domain34.ee @@ -9516,7 +10249,7 @@ RESPONSE: ABC-12345 - ccReg-7916696039 + ccReg-6699726145 @@ -9530,7 +10263,7 @@ REQUEST: - domain32.ee + domain34.ee @@ -9591,7 +10324,7 @@ RESPONSE: ABC-12345 - ccReg-6312761543 + ccReg-8491953228 @@ -9607,7 +10340,7 @@ REQUEST: - domain33.ee + domain35.ee @@ -9632,7 +10365,7 @@ RESPONSE: ABC-12345 - ccReg-4059845175 + ccReg-8239034275 @@ -9648,14 +10381,14 @@ REQUEST: - domain34.ee + domain36.ee - ns.paucekcremin99.ee + ns.lockman105.ee - FIXED:SH2421352279 + FIXED:SH1552152183 @@ -9675,7 +10408,7 @@ RESPONSE: ABC-12345 - ccReg-6215676067 + ccReg-5647276544 @@ -9689,14 +10422,14 @@ REQUEST: - domain34.ee + domain36.ee - ns.paucekcremin99.ee + ns.lockman105.ee - FIXED:SH2421352279 + FIXED:SH1552152183 @@ -9714,18 +10447,18 @@ RESPONSE: Nameserver already exists on this domain [hostname] - ns.paucekcremin99.ee + ns.lockman105.ee Contact already exists on this domain [contact_code_cache] - FIXED:SH2421352279 + FIXED:SH1552152183 ABC-12345 - ccReg-9116884956 + ccReg-7429213220 @@ -9741,7 +10474,7 @@ REQUEST: - domain35.ee + domain37.ee FIXED:CITIZEN_1234 @@ -9763,7 +10496,7 @@ RESPONSE: ABC-12345 - ccReg-7918261747 + ccReg-6346019419 @@ -9779,7 +10512,7 @@ REQUEST: - domain36.ee + domain38.ee @@ -9804,7 +10537,7 @@ RESPONSE: ABC-12345 - ccReg-4823438244 + ccReg-9819005325 @@ -9820,8 +10553,8 @@ REQUEST: - domain37.ee - 2015-06-26 + domain39.ee + 2015-07-23 1 @@ -9841,13 +10574,136 @@ RESPONSE: - domain37.ee - 2016-06-26T00:00:00Z + domain39.ee + 2016-07-23T00:00:00Z ABC-12345 - ccReg-6519525965 + ccReg-7220541028 + + + +``` + +### EPP Domain with valid domain renews a domain with 2 year period + +REQUEST: + +```xml + + + + + + domain40.ee + 2015-07-23 + 730 + + + ABC-12345 + + +``` + +RESPONSE: + +```xml + + + + + Command completed successfully + + + + domain40.ee + 2017-07-23T00:00:00Z + + + + ABC-12345 + ccReg-6857657669 + + + +``` + +### EPP Domain with valid domain renews a domain with 3 year period + +REQUEST: + +```xml + + + + + + domain41.ee + 2015-07-23 + 36 + + + ABC-12345 + + +``` + +RESPONSE: + +```xml + + + + + Command completed successfully + + + + domain41.ee + 2018-07-23T00:00:00Z + + + + ABC-12345 + ccReg-1769374464 + + + +``` + +### EPP Domain with valid domain does not renew a domain if credit balance low + +REQUEST: + +```xml + + + + + + domain42.ee + 2015-07-23 + 1 + + + ABC-12345 + + +``` + +RESPONSE: + +```xml + + + + + Billing failure - credit balance low + + + ABC-12345 + ccReg-4109711014 @@ -9863,7 +10719,7 @@ REQUEST: - domain38.ee + domain43.ee 2200-08-07 1 @@ -9890,7 +10746,7 @@ RESPONSE: ABC-12345 - ccReg-9192582359 + ccReg-2628108471 @@ -9906,8 +10762,8 @@ REQUEST: - domain39.ee - 2015-06-26 + domain44.ee + 2015-07-23 4 @@ -9930,7 +10786,7 @@ RESPONSE: ABC-12345 - ccReg-9034050627 + ccReg-2767217341 @@ -9946,8 +10802,8 @@ REQUEST: - domain40.ee - 2015-09-14 + domain45.ee + 2015-10-11 1 @@ -9967,7 +10823,7 @@ RESPONSE: ABC-12345 - ccReg-0329970059 + ccReg-1810374134 @@ -9981,8 +10837,8 @@ REQUEST: - domain40.ee - 2015-09-13 + domain45.ee + 2015-10-10 1 @@ -10002,13 +10858,13 @@ RESPONSE: - domain40.ee - 2016-09-13T00:00:00Z + domain45.ee + 2016-10-10T00:00:00Z ABC-12345 - ccReg-6696413266 + ccReg-0911571437 @@ -10024,8 +10880,8 @@ REQUEST: - domain41.ee - 2020-06-16 + domain46.ee + 2020-07-13 1 @@ -10045,13 +10901,13 @@ RESPONSE: - domain41.ee - 2021-06-16T00:00:00Z + domain46.ee + 2021-07-13T00:00:00Z ABC-12345 - ccReg-1505326476 + ccReg-2422169680 @@ -10067,8 +10923,8 @@ REQUEST: - domain42.ee - 2015-06-26 + domain47.ee + 2015-07-23 1 @@ -10088,7 +10944,7 @@ RESPONSE: ABC-12345 - ccReg-4127044027 + ccReg-0194027285 @@ -10104,8 +10960,8 @@ REQUEST: - domain43.ee - 2015-04-27 + domain48.ee + 2015-05-24 1 @@ -10125,13 +10981,13 @@ RESPONSE: - domain43.ee - 2016-04-27T14:46:35Z + domain48.ee + 2016-05-24T08:11:10Z ABC-12345 - ccReg-9291103741 + ccReg-2793752469 @@ -10179,7 +11035,7 @@ RESPONSE: ABC-12345 - ccReg-3538502070 + ccReg-9025280022 @@ -10193,8 +11049,8 @@ REQUEST: - domain44.ee - 2016-06-16 + domain49.ee + 2016-07-13 1 @@ -10214,7 +11070,7 @@ RESPONSE: ABC-12345 - ccReg-5006977619 + ccReg-6272603612 @@ -10260,7 +11116,7 @@ RESPONSE: ABC-12345 - ccReg-3666394551 + ccReg-7742341031 @@ -10276,7 +11132,7 @@ REQUEST: - domain45.ee + domain50.ee 2fooBAR @@ -10297,23 +11153,23 @@ RESPONSE: - domain45.ee - EIS-53 + domain50.ee + EIS-61 - FIXED:REGISTRANT5034182443 - FIXED:SH87553047104 - FIXED:SH60451564103 + FIXED:REGISTRANT6482132848 + FIXED:SH09572943114 + FIXED:SH87989459113 - ns.sipeskeeling135.ee + ns.mann150.ee 192.168.1.1 - ns.denesikjaskolski136.ee + ns.gibson151.ee 192.168.1.1 - ns.johns137.ee + ns.bergnaum152.ee 192.168.1.1 @@ -10323,11 +11179,11 @@ RESPONSE: registrar1 - 2015-06-16T14:46:36Z - 2015-06-16T14:46:36Z - 2016-06-16T14:46:36Z + 2015-07-13T08:11:11Z + 2015-07-13T08:11:11Z + 2016-07-13T08:11:11Z - 7fc87d2ceabb4a21969a9a067aa03411 + 5957310332b7a7eecb8ba4514ec2b500 @@ -10360,7 +11216,7 @@ RESPONSE: - ccReg-1180902357 + ccReg-8376341695 @@ -10374,7 +11230,7 @@ REQUEST: - domain45.ee + domain50.ee 2fooBAR @@ -10395,23 +11251,23 @@ RESPONSE: - domain45.ee - EIS-53 + domain50.ee + EIS-61 - FIXED:REGISTRANT5034182443 - FIXED:SH87553047104 - FIXED:SH60451564103 + FIXED:REGISTRANT6482132848 + FIXED:SH09572943114 + FIXED:SH87989459113 - ns.sipeskeeling135.ee + ns.mann150.ee 192.168.1.1 - ns.denesikjaskolski136.ee + ns.gibson151.ee 192.168.1.1 - ns.johns137.ee + ns.bergnaum152.ee 192.168.1.1 @@ -10421,11 +11277,11 @@ RESPONSE: registrar1 - 2015-06-16T14:46:36Z - 2015-06-16T14:46:36Z - 2016-06-16T14:46:36Z + 2015-07-13T08:11:11Z + 2015-07-13T08:11:11Z + 2016-07-13T08:11:11Z - 7fc87d2ceabb4a21969a9a067aa03411 + 5957310332b7a7eecb8ba4514ec2b500 @@ -10458,7 +11314,7 @@ RESPONSE: - ccReg-9928668202 + ccReg-3233264315 @@ -10474,7 +11330,7 @@ REQUEST: - domain46.ee + domain51.ee 2fooBAR @@ -10494,7 +11350,7 @@ RESPONSE: Attribute is invalid: hosts - ccReg-5780540561 + ccReg-8690139061 @@ -10508,7 +11364,7 @@ REQUEST: - domain46.ee + domain51.ee 2fooBAR @@ -10529,35 +11385,35 @@ RESPONSE: - domain46.ee - EIS-54 + domain51.ee + EIS-62 - FIXED:REGISTRANT7386073344 - FIXED:SH70911474106 - FIXED:SH83717810105 + FIXED:REGISTRANT2667536449 + FIXED:SH94654914116 + FIXED:SH61833805115 - ns1.domain46.ee + ns1.domain51.ee 192.168.1.1 1080:0:0:0:8:800:200C:417A - ns2.domain46.ee + ns2.domain51.ee 192.168.1.1 1080:0:0:0:8:800:200C:417A registrar1 - 2015-06-16T14:46:36Z - 2015-06-16T14:46:36Z - 2016-06-16T14:46:36Z + 2015-07-13T08:11:11Z + 2015-07-13T08:11:11Z + 2016-07-13T08:11:11Z - 04319f6bf003ebd8357d77a866f21a1d + 9d30e698ec98687e28804e22d659af30 - ccReg-9817465177 + ccReg-6365400804 @@ -10571,7 +11427,7 @@ REQUEST: - domain46.ee + domain51.ee 2fooBAR @@ -10592,12 +11448,12 @@ RESPONSE: - domain46.ee - EIS-54 + domain51.ee + EIS-62 - FIXED:REGISTRANT7386073344 - FIXED:SH70911474106 - FIXED:SH83717810105 + FIXED:REGISTRANT2667536449 + FIXED:SH94654914116 + FIXED:SH61833805115 ns3.test.ee @@ -10606,16 +11462,16 @@ RESPONSE: registrar1 - 2015-06-16T14:46:36Z - 2015-06-16T14:46:36Z - 2016-06-16T14:46:36Z + 2015-07-13T08:11:11Z + 2015-07-13T08:11:11Z + 2016-07-13T08:11:11Z - 04319f6bf003ebd8357d77a866f21a1d + 9d30e698ec98687e28804e22d659af30 - ccReg-1956126808 + ccReg-9998409461 @@ -10629,7 +11485,7 @@ REQUEST: - domain46.ee + domain51.ee 2fooBAR @@ -10650,23 +11506,23 @@ RESPONSE: - domain46.ee - EIS-54 + domain51.ee + EIS-62 - FIXED:REGISTRANT7386073344 - FIXED:SH70911474106 - FIXED:SH83717810105 + FIXED:REGISTRANT2667536449 + FIXED:SH94654914116 + FIXED:SH61833805115 registrar1 - 2015-06-16T14:46:36Z - 2015-06-16T14:46:36Z - 2016-06-16T14:46:36Z + 2015-07-13T08:11:11Z + 2015-07-13T08:11:11Z + 2016-07-13T08:11:11Z - 04319f6bf003ebd8357d77a866f21a1d + 9d30e698ec98687e28804e22d659af30 - ccReg-4662877023 + ccReg-1755029994 @@ -10680,7 +11536,7 @@ REQUEST: - domain46.ee + domain51.ee 2fooBAR @@ -10701,20 +11557,20 @@ RESPONSE: - domain46.ee - EIS-54 + domain51.ee + EIS-62 - FIXED:REGISTRANT7386073344 - FIXED:SH70911474106 - FIXED:SH83717810105 + FIXED:REGISTRANT2667536449 + FIXED:SH94654914116 + FIXED:SH61833805115 - ns1.domain46.ee + ns1.domain51.ee 192.168.1.1 1080:0:0:0:8:800:200C:417A - ns2.domain46.ee + ns2.domain51.ee 192.168.1.1 1080:0:0:0:8:800:200C:417A @@ -10725,16 +11581,16 @@ RESPONSE: registrar1 - 2015-06-16T14:46:36Z - 2015-06-16T14:46:36Z - 2016-06-16T14:46:36Z + 2015-07-13T08:11:11Z + 2015-07-13T08:11:11Z + 2016-07-13T08:11:11Z - 04319f6bf003ebd8357d77a866f21a1d + 9d30e698ec98687e28804e22d659af30 - ccReg-2430670023 + ccReg-3118580746 @@ -10773,7 +11629,7 @@ RESPONSE: - ccReg-5247973919 + ccReg-1733768523 @@ -10789,7 +11645,7 @@ REQUEST: - domain47.ee + domain52.ee 2fooBAR @@ -10810,37 +11666,37 @@ RESPONSE: - domain47.ee - EIS-55 + domain52.ee + EIS-63 - FIXED:REGISTRANT3737412845 - FIXED:SH49038744108 - FIXED:SH06725299107 + FIXED:REGISTRANT2342249650 + FIXED:SH20249682118 + FIXED:SH18642279117 - ns.sanford141.ee + ns.lakin156.ee 192.168.1.1 - ns.sauer142.ee + ns.hartmann157.ee 192.168.1.1 - ns.veum143.ee + ns.kuhicemmerich158.ee 192.168.1.1 registrar1 - 2015-06-16T14:46:37Z - 2015-06-16T14:46:37Z - 2016-06-16T14:46:37Z + 2015-07-13T08:11:13Z + 2015-07-13T08:11:13Z + 2016-07-13T08:11:13Z - 81c5f0a214cb0756ad4a5c553e80df90 + 1461c4b264196cd03804c940733dc38a - ccReg-6047154535 + ccReg-3963429650 @@ -10888,7 +11744,7 @@ RESPONSE: ABC-12345 - ccReg-1083606006 + ccReg-3669004177 @@ -10902,7 +11758,7 @@ REQUEST: - domain48.ee + domain53.ee 2fooBAR @@ -10922,7 +11778,7 @@ RESPONSE: Authorization error - ccReg-9393465490 + ccReg-7057482646 @@ -10968,7 +11824,7 @@ RESPONSE: ABC-12345 - ccReg-0344532333 + ccReg-3127374780 @@ -11016,7 +11872,7 @@ RESPONSE: ABC-12345 - ccReg-9663838605 + ccReg-0437688297 @@ -11030,7 +11886,7 @@ REQUEST: - domain49.ee + domain54.ee @@ -11048,34 +11904,34 @@ RESPONSE: - domain49.ee - EIS-57 + domain54.ee + EIS-65 - FIXED:REGISTRANT1566943147 - FIXED:SH39124150112 - FIXED:SH43742622111 + FIXED:REGISTRANT3313756852 + FIXED:SH50852734122 + FIXED:SH63024484121 - ns.kreiger147.ee + ns.harber162.ee 192.168.1.1 - ns.hudson148.ee + ns.gutmanngrady163.ee 192.168.1.1 - ns.dare149.ee + ns.block164.ee 192.168.1.1 registrar1 - 2015-06-16T14:46:38Z - 2015-06-16T14:46:38Z - 2016-06-16T14:46:38Z + 2015-07-13T08:11:13Z + 2015-07-13T08:11:13Z + 2016-07-13T08:11:13Z - ccReg-0003863495 + ccReg-5268249056 @@ -11121,7 +11977,7 @@ RESPONSE: ABC-12345 - ccReg-9016819552 + ccReg-2996369133 @@ -11169,7 +12025,7 @@ RESPONSE: ABC-12345 - ccReg-4480505409 + ccReg-2348926042 @@ -11183,9 +12039,9 @@ REQUEST: - domain50.ee + domain55.ee - f44d898ad1b9caa41023a0894a3d0801 + 70fdd52cf30cb84607b091c211508b3e @@ -11204,37 +12060,37 @@ RESPONSE: - domain50.ee - EIS-58 + domain55.ee + EIS-66 - FIXED:REGISTRANT5610043948 - FIXED:SH85839976114 - FIXED:SH72694104113 + FIXED:REGISTRANT4048132253 + FIXED:SH48069556124 + FIXED:SH18507922123 - ns.mann150.ee + ns.kuhlman165.ee 192.168.1.1 - ns.gutkowskibernier151.ee + ns.howe166.ee 192.168.1.1 - ns.schinner152.ee + ns.bradtkehyatt167.ee 192.168.1.1 registrar1 - 2015-06-16T14:46:38Z - 2015-06-16T14:46:38Z - 2016-06-16T14:46:38Z + 2015-07-13T08:11:13Z + 2015-07-13T08:11:13Z + 2016-07-13T08:11:13Z - f44d898ad1b9caa41023a0894a3d0801 + 70fdd52cf30cb84607b091c211508b3e - ccReg-7074882802 + ccReg-1792551087 @@ -11280,7 +12136,7 @@ RESPONSE: ABC-12345 - ccReg-2139213556 + ccReg-6746329954 @@ -11296,7 +12152,7 @@ REQUEST: - domain51.ee + domain56.ee @@ -11315,11 +12171,12 @@ RESPONSE: - - Internal error. + + Command completed successfully; action pending - ccReg-0801639712 + ABC-12345 + ccReg-4342498296 @@ -11335,7 +12192,7 @@ REQUEST: - domain52.ee + domain57.ee @@ -11359,7 +12216,7 @@ RESPONSE: ABC-12345 - ccReg-0908156344 + ccReg-7883262615 @@ -11375,7 +12232,7 @@ REQUEST: - domain53.ee + domain58.ee @@ -11399,7 +12256,7 @@ RESPONSE: ABC-12345 - ccReg-5302487355 + ccReg-0920548662 @@ -11434,7 +12291,7 @@ RESPONSE: ABC-12345 - ccReg-4445302239 + ccReg-0781777028 @@ -11476,7 +12333,7 @@ RESPONSE: ABC-12345 - ccReg-6989281837 + ccReg-3611796311 @@ -11490,7 +12347,7 @@ REQUEST: - domain54.ee + domain59.ee ABC-12345 @@ -11510,14 +12367,14 @@ RESPONSE: - domain54.ee + domain59.ee in use ABC-12345 - ccReg-7241677214 + ccReg-3334019851 @@ -11567,7 +12424,7 @@ RESPONSE: ABC-12345 - ccReg-2988756260 + ccReg-0064719758 @@ -11614,7 +12471,7 @@ RESPONSE: ABC-12345 - ccReg-3861410540 + ccReg-0603882179 @@ -11662,7 +12519,7 @@ RESPONSE: ABC-12345 - ccReg-9350463779 + ccReg-0885284769 @@ -11677,7 +12534,7 @@ REQUEST: - domain55.ee + domain60.ee 256 3 @@ -11685,13 +12542,13 @@ REQUEST: cmlraXN0aGViZXN0 - 606917876743fb9d65eb59fbf175c5bd + fabc7a8ebef505abcb469833f145e84c P1M13D - 1434466003 + 1436775078 ``` @@ -11705,12 +12562,12 @@ RESPONSE: Unimplemented object service - domain55.ee + domain60.ee - 1434466003 - ccReg-7770421771 + 1436775078 + ccReg-9036054194 @@ -11725,20 +12582,20 @@ REQUEST: - domain55.ee + domain60.ee 3 8 cmlraXN0aGViZXN0 - 606917876743fb9d65eb59fbf175c5bd + fabc7a8ebef505abcb469833f145e84c Invalid Expiry - 1434466004 + 1436775079 ``` @@ -11759,8 +12616,8 @@ RESPONSE: - 1434466004 - ccReg-0081075985 + 1436775079 + ccReg-0012228718 @@ -11775,7 +12632,7 @@ REQUEST: - domain55.ee + domain60.ee 256 3 @@ -11783,13 +12640,13 @@ REQUEST: cmlraXN0aGViZXN0 - 606917876743fb9d65eb59fbf175c5bd + fabc7a8ebef505abcb469833f145e84c Invalid Expiry - 1434466005 + 1436775081 ``` @@ -11807,8 +12664,8 @@ RESPONSE: - 1434466005 - ccReg-6676809630 + 1436775081 + ccReg-3299050163 @@ -11823,7 +12680,7 @@ REQUEST: - domain55.ee + domain60.ee 256 3 @@ -11831,13 +12688,13 @@ REQUEST: cmlraXN0aGViZXN0 - 606917876743fb9d65eb59fbf175c5bd + fabc7a8ebef505abcb469833f145e84c Invalid Absolute - 1434466006 + 1436775082 ``` @@ -11855,54 +12712,8 @@ RESPONSE: - 1434466006 - ccReg-8006484799 - - - -``` - -### EPP Keyrelay does not allow both relative and absolute - -REQUEST: - -```xml - - - - - domain55.ee - - 256 - 3 - 8 - cmlraXN0aGViZXN0 - - - 606917876743fb9d65eb59fbf175c5bd - - - P1D - 2014-12-23 - - - 1434466007 - - -``` - -RESPONSE: - -```xml - - - - - Exactly one parameter required: keyrelay > expiry > relative OR keyrelay > expiry > absolute - - - 1434466007 - ccReg-6196744977 + 1436775082 + ccReg-5674703725 @@ -11917,7 +12728,7 @@ REQUEST: - domain55.ee + domain60.ee 256 3 @@ -11925,7 +12736,7 @@ REQUEST: cmlraXN0aGViZXN0 - 606917876743fb9d65eb59fbf175c5bd + fabc7a8ebef505abcb469833f145e84c P1D @@ -11934,7 +12745,7 @@ REQUEST: JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp== - 1434466008 + 1436775083 ``` @@ -11948,12 +12759,12 @@ RESPONSE: Unimplemented object service - domain55.ee + domain60.ee - 1434466008 - ccReg-8880766111 + 1436775083 + ccReg-4889072298 @@ -11968,7 +12779,7 @@ REQUEST: - domain55.ee + domain60.ee 256 3 @@ -11976,7 +12787,7 @@ REQUEST: cmlraXN0aGViZXN0 - 606917876743fb9d65eb59fbf175c5bd + fabc7a8ebef505abcb469833f145e84c P1D @@ -11985,7 +12796,7 @@ REQUEST: JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp== - 1434466009 + 1436775084 ``` @@ -12000,8 +12811,8 @@ RESPONSE: Attribute is invalid: type - 1434466009 - ccReg-5896300316 + 1436775084 + ccReg-3763435235 @@ -12047,7 +12858,7 @@ RESPONSE: ABC-12345 - ccReg-6744406564 + ccReg-8391468842 @@ -12062,7 +12873,7 @@ REQUEST: - 1434466011 + 1436775085 ``` @@ -12077,8 +12888,8 @@ RESPONSE: Command completed successfully; no messages - 1434466011 - ccReg-7079179755 + 1436775085 + ccReg-5223012602 @@ -12126,7 +12937,7 @@ RESPONSE: ABC-12345 - ccReg-5443416105 + ccReg-1644113251 @@ -12139,7 +12950,7 @@ REQUEST: - 1434466011 + 1436775085 ``` @@ -12154,8 +12965,8 @@ RESPONSE: Command completed successfully; no messages - 1434466011 - ccReg-6783686315 + 1436775085 + ccReg-7422031286 @@ -12201,7 +13012,7 @@ RESPONSE: ABC-12345 - ccReg-5004171706 + ccReg-9135374868 @@ -12214,7 +13025,7 @@ REQUEST: - 1434466011 + 1436775085 ``` @@ -12229,12 +13040,12 @@ RESPONSE: Command completed successfully; ack to dequeue - 2015-06-16T14:46:51Z + 2015-07-13T08:11:25Z Balance low. - 1434466011 - ccReg-4253494053 + 1436775085 + ccReg-0576977561 @@ -12280,7 +13091,7 @@ RESPONSE: ABC-12345 - ccReg-4918171501 + ccReg-9969074675 @@ -12293,7 +13104,7 @@ REQUEST: - 1434466011 + 1436775085 ``` @@ -12311,8 +13122,8 @@ RESPONSE: - 1434466011 - ccReg-5948146323 + 1436775085 + ccReg-4944273043 @@ -12358,7 +13169,7 @@ RESPONSE: ABC-12345 - ccReg-0602722237 + ccReg-1529649635 @@ -12371,7 +13182,7 @@ REQUEST: - 1434466011 + 1436775085 ``` @@ -12387,8 +13198,8 @@ RESPONSE: - 1434466011 - ccReg-6653908143 + 1436775085 + ccReg-9499020661 @@ -12401,7 +13212,7 @@ REQUEST: - 1434466011 + 1436775085 ``` @@ -12419,8 +13230,8 @@ RESPONSE: - 1434466011 - ccReg-4030904109 + 1436775085 + ccReg-3165481294 @@ -12435,7 +13246,7 @@ REQUEST: - 1434466013 + 1436775088 ``` @@ -12446,12 +13257,12 @@ RESPONSE: - - Attribute is invalid: op + + Parameter value range error: op - 1434466013 - ccReg-1337274768 + 1436775088 + ccReg-3390618149 @@ -12466,7 +13277,7 @@ REQUEST: - 1434466014 + 1436775089 ``` @@ -12481,12 +13292,12 @@ RESPONSE: Command completed successfully; ack to dequeue - 2015-06-16T14:46:54Z + 2015-07-13T08:11:29Z Smth else. - 1434466014 - ccReg-0133258887 + 1436775089 + ccReg-1784449840 @@ -12499,7 +13310,7 @@ REQUEST: - 1434466014 + 1436775089 ``` @@ -12515,8 +13326,8 @@ RESPONSE: - 1434466014 - ccReg-7865881696 + 1436775089 + ccReg-9604708191 @@ -12529,7 +13340,7 @@ REQUEST: - 1434466014 + 1436775089 ``` @@ -12544,12 +13355,12 @@ RESPONSE: Command completed successfully; ack to dequeue - 2015-06-16T14:46:54Z + 2015-07-13T08:11:29Z Something. - 1434466014 - ccReg-2990701289 + 1436775089 + ccReg-1957177353 @@ -12562,7 +13373,7 @@ REQUEST: - 1434466014 + 1436775089 ``` @@ -12578,8 +13389,8 @@ RESPONSE: - 1434466014 - ccReg-5225046181 + 1436775089 + ccReg-6685502756 @@ -12592,7 +13403,7 @@ REQUEST: - 1434466014 + 1436775089 ``` @@ -12607,12 +13418,12 @@ RESPONSE: Command completed successfully; ack to dequeue - 2015-06-16T14:46:54Z + 2015-07-13T08:11:29Z Balance low. - 1434466014 - ccReg-6707896691 + 1436775089 + ccReg-8768039298 @@ -12625,7 +13436,7 @@ REQUEST: - 1434466014 + 1436775089 ``` @@ -12641,8 +13452,8 @@ RESPONSE: - 1434466014 - ccReg-8174947053 + 1436775089 + ccReg-1482529320 @@ -12655,7 +13466,7 @@ REQUEST: - 1434466015 + 1436775089 ``` @@ -12670,8 +13481,8 @@ RESPONSE: Command completed successfully; no messages - 1434466015 - ccReg-0858483195 + 1436775089 + ccReg-1495533817 @@ -12686,7 +13497,7 @@ RESPONSE: EPP server (EIS) - 2015-06-16T14:46:55Z + 2015-07-13T08:11:30Z 1.0 en @@ -12758,11 +13569,11 @@ RESPONSE: - Authentication error; server closing connection + Authentication error; server closing connection (API user not found) ABC-12345 - ccReg-4597363742 + ccReg-4962773185 @@ -12806,11 +13617,11 @@ RESPONSE: - Authentication error; server closing connection + Authentication error; server closing connection (API user is not active) ABC-12345 - ccReg-1428657257 + ccReg-5095764492 @@ -12845,7 +13656,7 @@ RESPONSE: ABC-12345 - ccReg-3082305327 + ccReg-5738565184 @@ -12888,10 +13699,58 @@ RESPONSE: - Authentication error; server closing connection + Authentication error; server closing connection (API user not found) - ccReg-3565992149 + ccReg-5622270256 + + + +``` + +### EPP Session when connected should return latin only error + +REQUEST: + +```xml + + + + + 你好你好 + ghyt9e4fu + + 1.0 + en + + + https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd + https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd + urn:ietf:params:xml:ns:host-1.0 + urn:ietf:params:xml:ns:keyrelay-1.0 + + urn:ietf:params:xml:ns:secDNS-1.1 + https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd + + + + ABC-12345 + + +``` + +RESPONSE: + +```xml + + + + + Parameter value policy error. Allowed only Latin characters. + + + ABC-12345 + ccReg-0289669237 @@ -12939,7 +13798,7 @@ RESPONSE: ABC-12345 - ccReg-0832089091 + ccReg-0488458615 @@ -12987,7 +13846,7 @@ RESPONSE: ABC-12345 - ccReg-1535717609 + ccReg-3342389163 @@ -13033,7 +13892,7 @@ RESPONSE: ABC-12345 - ccReg-5055971923 + ccReg-0540678286 @@ -13081,7 +13940,7 @@ RESPONSE: ABC-12345 - ccReg-0729496396 + ccReg-6032986990 @@ -13110,7 +13969,7 @@ RESPONSE: ABC-12345 - ccReg-7311985652 + ccReg-1481291484 @@ -13159,7 +14018,7 @@ RESPONSE: ABC-12345 - ccReg-7387239733 + ccReg-3765095362 @@ -13208,56 +14067,7 @@ RESPONSE: ABC-12345 - ccReg-9506918430 - - - -``` - -### EPP Session when connected with valid user fails if new password is not valid - -REQUEST: - -```xml - - - - - gitlab - ghyt9e4fu - - - 1.0 - en - - - https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd - https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd - urn:ietf:params:xml:ns:host-1.0 - urn:ietf:params:xml:ns:keyrelay-1.0 - - urn:ietf:params:xml:ns:secDNS-1.1 - https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd - - - - ABC-12345 - - -``` - -RESPONSE: - -```xml - - - - - Password is missing [password] - - - ABC-12345 - ccReg-0674363838 + ccReg-0096989953 diff --git a/doc/epp/domain.md b/doc/epp/domain.md index 64a6b68c0..4a36731a6 100644 --- a/doc/epp/domain.md +++ b/doc/epp/domain.md @@ -38,9 +38,11 @@ Domain name mapping protocol short version: 1 Attribute: xmlns:eis="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd" 1 Base64 encoded document. Attribute: type="pdf/bdoc/ddoc/zip/rar/gz/tar/7z" + 0-1 + 0-1 Required if registering a reserved domain 0-1 Client transaction id -[EXAMPLE REQUEST AND RESPONSE](/doc/epp-examples.md#epp-domain-with-citizen-as-an-owner-creates-a-domain) +[EXAMPLE REQUEST AND RESPONSE](/doc/epp-examples.md#epp-domain-with-citizen-as-a-registrant-creates-a-domain) ### Domain update @@ -141,7 +143,7 @@ Domain name mapping protocol short version: Field name Min-max Field description ----------------------- ------- ----------------- - 1 + 1 Attribute: op="request/query/approve/reject/cancel" 1 Attribute: xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd" 1 Domain name. Can contain unicode characters. 1 diff --git a/doc/models_brief.svg b/doc/models_brief.svg index f0e13dbea..6cd637e1b 100644 --- a/doc/models_brief.svg +++ b/doc/models_brief.svg @@ -4,418 +4,1490 @@ - - + + models_diagram - + _diagram_info -Models diagram -Date: Dec 15 2014 - 14:23 -Migration version: 20141202114457 -Generated by RailRoady 1.2.0 -http://railroady.prestonlee.com +Models diagram +Date: Jul 08 2015 - 13:41 +Migration version: 20150707103801 +Generated by RailRoady 1.3.0 +http://railroady.prestonlee.com - -Ability - -Ability + +WhoisRecord + +WhoisRecord - -ContactDisclosure - -ContactDisclosure + +RegistrantUser + +RegistrantUser - -DomainStatusVersion - -DomainStatusVersion + +UserVersion + +UserVersion - -DomainContact - -DomainContact - - -Right - -Right - - -Role - -Role - - -Right->Role - - - - - -Contact - -Contact - - -Contact->ContactDisclosure - - - -disclosure - - -Contact->DomainContact - - - - - -ContactVersion - -ContactVersion - - -Contact->ContactVersion - - - -versions - - -Address - -Address - - -Contact->Address - - - - - -Domain - -Domain - - -Contact->Domain - - - - - -DomainVersion - -DomainVersion - - -Setting - -Setting - - -Nameserver - -Nameserver - - -NameserverVersion - -NameserverVersion - - -Nameserver->NameserverVersion - - - -versions - - -EppUser - -EppUser - - -EppUser->Contact - - - - - -Country - -Country - - -ZonefileSetting - -ZonefileSetting - - -CachedNameserver - -CachedNameserver - - -Epp::EppDomain - -Epp::EppDomain - - -Epp::DomainContact - -Epp::DomainContact - - -Epp::EppDomain->Epp::DomainContact - - - - - -Epp::Contact - -Epp::Contact - - -Epp::EppDomain->Epp::Contact - - - -tech_contacts - - -Epp::EppDomain->Epp::Contact - - - -admin_contacts - - -Epp::Nameserver - -Epp::Nameserver - - -Epp::EppDomain->Epp::Nameserver - - - - - -Epp::DomainStatus - -Epp::DomainStatus - - -Epp::EppDomain->Epp::DomainStatus - - - - - -Epp::DomainTransfer - -Epp::DomainTransfer - - -Epp::EppDomain->Epp::DomainTransfer - - - - - -Epp::Dnskey - -Epp::Dnskey - - -Epp::EppDomain->Epp::Dnskey - - - - - -Epp::Keyrelay - -Epp::Keyrelay - - -Epp::EppDomain->Epp::Keyrelay - - - - - -Epp::DomainVersion - -Epp::DomainVersion - - -Epp::EppDomain->Epp::DomainVersion - - - -versions - - -Message - -Message - - -EppSession - -EppSession - - -AddressVersion - -AddressVersion - - -Keyrelay - -Keyrelay + +RegistrantUser->UserVersion + + + +versions -ReservedDomain - -ReservedDomain +ReservedDomain + +ReservedDomain - -Registrar - -Registrar + +ReservedDomainVersion + +ReservedDomainVersion - -Registrar->Contact - - - + +ReservedDomain->ReservedDomainVersion + + + +versions - -Registrar->EppUser - - - + +WhiteIpVersion + +WhiteIpVersion - -Registrar->Message - - - + +VersionAssociation + +VersionAssociation - -User - -User + +WhiteIpVersion->VersionAssociation + + + - -Registrar->User - - - + +NameserverVersion + +NameserverVersion - -Registrar->Domain - - - + +NameserverVersion->VersionAssociation + + + - -Role->User - - - + +DomainStatusVersion + +DomainStatusVersion - -Address->AddressVersion - - - -versions + +DomainStatusVersion->VersionAssociation + + + - -Domain->DomainContact - - - + +ContactStatusVersion + +ContactStatusVersion - -Domain->Contact - - - -tech_contacts + +ContactStatusVersion->VersionAssociation + + + - -Domain->Contact - - - -admin_contacts + +UserVersion->VersionAssociation + + + - -Domain->DomainVersion - - - -versions + +DnskeyVersion + +DnskeyVersion - -Domain->Nameserver - - - + +DnskeyVersion->VersionAssociation + + + - -Domain->Keyrelay - - - + +BlockedDomainVersion + +BlockedDomainVersion + + +BlockedDomainVersion->VersionAssociation + + + + + +SettingVersion + +SettingVersion + + +SettingVersion->VersionAssociation + + + + + +CertificateVersion + +CertificateVersion + + +CertificateVersion->VersionAssociation + + + + + +AccountVersion + +AccountVersion + + +AccountVersion->VersionAssociation + + + + + +PricelistVersion + +PricelistVersion + + +PricelistVersion->VersionAssociation + + + + + +MessageVersion + +MessageVersion + + +MessageVersion->VersionAssociation + + + + + +ReservedDomainVersion->VersionAssociation + + + + + +KeyrelayVersion + +KeyrelayVersion + + +KeyrelayVersion->VersionAssociation + + + + + +AccountActivityVersion + +AccountActivityVersion + + +AccountActivityVersion->VersionAssociation + + + + + +AddressVersion + +AddressVersion + + +AddressVersion->VersionAssociation + + + + + +BankStatementVersion + +BankStatementVersion + + +BankStatementVersion->VersionAssociation + + + + + +DomainContactVersion + +DomainContactVersion + + +DomainContactVersion->VersionAssociation + + + + + +ContactVersion + +ContactVersion + + +ContactVersion->VersionAssociation + + + + + +CountryVersion + +CountryVersion + + +CountryVersion->VersionAssociation + + + + + +DomainTransferVersion + +DomainTransferVersion + + +DomainTransferVersion->VersionAssociation + + + + + +BankTransactionVersion + +BankTransactionVersion + + +BankTransactionVersion->VersionAssociation + + + + + +InvoiceItemVersion + +InvoiceItemVersion + + +InvoiceItemVersion->VersionAssociation + + + + + +LegalDocumentVersion + +LegalDocumentVersion + + +LegalDocumentVersion->VersionAssociation + + + + + +RegistrarVersion + +RegistrarVersion + + +RegistrarVersion->VersionAssociation + + + + + +ApiUserVersion + +ApiUserVersion + + +ApiUserVersion->VersionAssociation + + + + + +ZonefileSettingVersion + +ZonefileSettingVersion + + +ZonefileSettingVersion->VersionAssociation + + + + + +DomainVersion + +DomainVersion + + +DomainVersion->VersionAssociation + + + + + +InvoiceVersion + +InvoiceVersion + + +InvoiceVersion->VersionAssociation + + + + + +ApiUser + +ApiUser + + +ApiUser->UserVersion + + + +versions + + +Certificate + +Certificate + + +ApiUser->Certificate + + + + + +BankTransaction + +BankTransaction + + +BankTransaction->BankTransactionVersion + + + +versions + + +AccountActivity + +AccountActivity + + +BankTransaction->AccountActivity + + + -Dnskey - -Dnskey +Dnskey + +Dnskey + + +Dnskey->DnskeyVersion + + + +versions + + +Dnskey->DnskeyVersion + + + +versions + + +Dnskey->DnskeyVersion + + + +versions + + +AdminDomainContact + +AdminDomainContact + + +AdminDomainContact->DomainContactVersion + + + +versions + + +Setting + +Setting + + +Setting->SettingVersion + + + +versions + + +Message + +Message + + +Message->MessageVersion + + + +versions + + +Contact + +Contact + + +Contact->ContactVersion + + + +versions + + +Contact->ContactVersion + + + +versions + + +Contact->ContactVersion + + + +versions + + +Contact->ContactVersion + + + +versions + + +Domain + +Domain + + +Contact->Domain + + + + + +Contact->Domain + + + +registrant_domains + + +Contact->Domain + + + + + +Contact->Domain + + + +registrant_domains + + +Contact->Domain + + + + + +Contact->Domain + + + +registrant_domains + + +Contact->Domain + + + + + +Contact->Domain + + + +registrant_domains + + +ContactStatus + +ContactStatus + + +Contact->ContactStatus + + + +statuses + + +Contact->ContactStatus + + + +statuses + + +Contact->ContactStatus + + + +statuses + + +Contact->ContactStatus + + + +statuses + + +DomainContact + +DomainContact + + +Contact->DomainContact + + + + + +Contact->DomainContact + + + + + +Contact->DomainContact + + + + + +Contact->DomainContact + + + + + +LegalDocument + +LegalDocument + + +Contact->LegalDocument + + + + + +Contact->LegalDocument + + + + + +Contact->LegalDocument + + + + + +Contact->LegalDocument + + + + + +Domain->WhoisRecord + + + + + +Domain->WhoisRecord + + + + + +Domain->WhoisRecord + + + + + +Domain->WhoisRecord + + + + + +Domain->DomainVersion + + + +versions + + +Domain->DomainVersion + + + +versions + + +Domain->DomainVersion + + + +versions + + +Domain->DomainVersion + + + +versions -Domain->Dnskey - - - +Domain->Dnskey + + + + + +Domain->Dnskey + + + + + +Domain->Dnskey + + + + + +Domain->Dnskey + + + + + +Domain->AdminDomainContact + + + + + +Domain->AdminDomainContact + + + + + +Domain->AdminDomainContact + + + + + +Domain->AdminDomainContact + + + + + +Domain->Contact + + + +admin_contacts + + +Domain->Contact + + + +tech_contacts + + +Domain->Contact + + + +admin_contacts + + +Domain->Contact + + + +tech_contacts + + +Domain->Contact + + + +admin_contacts + + +Domain->Contact + + + +tech_contacts + + +Domain->Contact + + + +admin_contacts + + +Domain->Contact + + + +tech_contacts -DomainTransfer - -DomainTransfer +DomainTransfer + +DomainTransfer -Domain->DomainTransfer - - - +Domain->DomainTransfer + + + + + +Domain->DomainTransfer + + + + + +Domain->DomainTransfer + + + + + +Domain->DomainTransfer + + + + + +TechDomainContact + +TechDomainContact + + +Domain->TechDomainContact + + + + + +Domain->TechDomainContact + + + + + +Domain->TechDomainContact + + + + + +Domain->TechDomainContact + + + + + +Nameserver + +Nameserver + + +Domain->Nameserver + + + + + +Domain->Nameserver + + + + + +Domain->Nameserver + + + + + +Domain->Nameserver + + + + + +Domain->DomainContact + + + + + +Domain->DomainContact + + + + + +Domain->DomainContact + + + + + +Domain->DomainContact + + + -DomainStatus - -DomainStatus +DomainStatus + +DomainStatus -Domain->DomainStatus - - - +Domain->DomainStatus + + + + + +Domain->DomainStatus + + + + + +Domain->DomainStatus + + + + + +Domain->DomainStatus + + + + + +Keyrelay + +Keyrelay + + +Domain->Keyrelay + + + + + +Domain->Keyrelay + + + + + +Domain->Keyrelay + + + + + +Domain->Keyrelay + + + + + +Domain->LegalDocument + + + + + +Domain->LegalDocument + + + + + +Domain->LegalDocument + + + + + +Domain->LegalDocument + + + + + +Ability + +Ability + + +Registrar + +Registrar + + +Registrar->WhoisRecord + + + + + +Registrar->WhoisRecord + + + + + +Registrar->RegistrarVersion + + + +versions + + +Registrar->RegistrarVersion + + + +versions + + +Registrar->ApiUser + + + + + +Registrar->ApiUser + + + + + +Registrar->Message + + + + + +Registrar->Message + + + + + +Registrar->Contact + + + + + +Registrar->Contact + + + +priv_contacts + + +Registrar->Contact + + + + + +Registrar->Contact + + + +priv_contacts + + +Registrar->Domain + + + + + +Registrar->Domain + + + + + +Account + +Account + + +Registrar->Account + + + + + +Registrar->Account + + + + + +Registrar->Nameserver + + + + + +Registrar->Nameserver + + + + + +Invoice + +Invoice + + +Registrar->Invoice + + + + + +Registrar->Invoice + + + + + +WhiteIp + +WhiteIp + + +Registrar->WhiteIp + + + + + +Registrar->WhiteIp + + + + + +BlockedDomain + +BlockedDomain + + +BlockedDomain->BlockedDomainVersion + + + +versions + + +User + +User + + +User->UserVersion + + + +versions + + +User->UserVersion + + + +versions + + +DomainTransfer->DomainTransferVersion + + + +versions + + +ContactStatus->ContactStatusVersion + + + +versions + + +RegistrantVerification + +RegistrantVerification + + +ZonefileSetting + +ZonefileSetting + + +ZonefileSetting->ZonefileSettingVersion + + + +versions + + +TechDomainContact->DomainContactVersion + + + +versions + + +AccountActivity->AccountActivityVersion + + + +versions + + +Account->AccountVersion + + + +versions + + +Account->AccountActivity + + + + + +EppSession + +EppSession + + +Pricelist + +Pricelist + + +Pricelist->PricelistVersion + + + +versions + + +InvoiceItem + +InvoiceItem + + +InvoiceItem->InvoiceItemVersion + + + +versions + + +Nameserver->NameserverVersion + + + +versions + + +Deposit + +Deposit + + +Certificate->CertificateVersion + + + +versions + + +Object + +Object + + +Invoice->InvoiceVersion + + + +versions + + +Invoice->InvoiceVersion + + + +versions + + +Invoice->AccountActivity + + + + + +Invoice->AccountActivity + + + + + +Invoice->InvoiceItem + + + + + +Invoice->InvoiceItem + + + + + +BankStatement + +BankStatement + + +BankStatement->BankStatementVersion + + + +versions + + +BankStatement->BankTransaction + + + + + +DomainContact->DomainContactVersion + + + +versions -DomainStatus->DomainStatusVersion - - - -versions +DomainStatus->DomainStatusVersion + + + +versions + + +Registrant + +Registrant + + +Registrant->ContactVersion + + + +versions + + +Registrant->Domain + + + + + +Registrant->Domain + + + +registrant_domains + + +Registrant->ContactStatus + + + +statuses + + +Registrant->DomainContact + + + + + +Registrant->LegalDocument + + + + + +Keyrelay->KeyrelayVersion + + + +versions + + +Keyrelay->KeyrelayVersion + + + +versions + + +Keyrelay->LegalDocument + + + + + +Keyrelay->LegalDocument + + + + + +WhiteIp->WhiteIpVersion + + + +versions + + +AdminUser + +AdminUser + + +AdminUser->UserVersion + + + +versions + + +Address + +Address + + +Address->AddressVersion + + + +versions + + +LegalDocument->LegalDocumentVersion + + + +versions diff --git a/doc/models_complete.svg b/doc/models_complete.svg index e69de29bb..38d17ab3d 100644 --- a/doc/models_complete.svg +++ b/doc/models_complete.svg @@ -0,0 +1,2381 @@ + + + + + + +models_diagram + + +_diagram_info +Models diagram +Date: Jul 08 2015 - 13:42 +Migration version: 20150707103801 +Generated by RailRoady 1.3.0 +http://railroady.prestonlee.com + + +WhoisRecord + +WhoisRecord + +id :integer +domain_id :integer +name :string +body :text +json :json +created_at :datetime +updated_at :datetime +registrar_id :integer + + +RegistrantUser + +RegistrantUser + +id :integer +username :string +password :string +created_at :datetime +updated_at :datetime +email :string +sign_in_count :integer +current_sign_in_at :datetime +last_sign_in_at :datetime +current_sign_in_ip :inet +last_sign_in_ip :inet +identity_code :string +roles :string +creator_str :string +updator_str :string +country_code :string +registrar_id :integer +active :boolean +csr :text +crt :text +type :string +registrant_ident :string +encrypted_password :string +remember_created_at :datetime +failed_attempts :integer +locked_at :datetime + + +UserVersion + +UserVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +RegistrantUser->UserVersion + + + +versions + + +ReservedDomain + +ReservedDomain + +id :integer +name :string +created_at :datetime +updated_at :datetime +creator_str :string +updator_str :string + + +ReservedDomainVersion + +ReservedDomainVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +ReservedDomain->ReservedDomainVersion + + + +versions + + +WhiteIpVersion + +WhiteIpVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +VersionAssociation + +VersionAssociation + + +WhiteIpVersion->VersionAssociation + + + + + +NameserverVersion + +NameserverVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +NameserverVersion->VersionAssociation + + + + + +DomainStatusVersion + +DomainStatusVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +DomainStatusVersion->VersionAssociation + + + + + +ContactStatusVersion + +ContactStatusVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +ContactStatusVersion->VersionAssociation + + + + + +UserVersion->VersionAssociation + + + + + +DnskeyVersion + +DnskeyVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +DnskeyVersion->VersionAssociation + + + + + +BlockedDomainVersion + +BlockedDomainVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +BlockedDomainVersion->VersionAssociation + + + + + +SettingVersion + +SettingVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +SettingVersion->VersionAssociation + + + + + +CertificateVersion + +CertificateVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +CertificateVersion->VersionAssociation + + + + + +AccountVersion + +AccountVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +AccountVersion->VersionAssociation + + + + + +PricelistVersion + +PricelistVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string + + +PricelistVersion->VersionAssociation + + + + + +MessageVersion + +MessageVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +MessageVersion->VersionAssociation + + + + + +ReservedDomainVersion->VersionAssociation + + + + + +KeyrelayVersion + +KeyrelayVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +KeyrelayVersion->VersionAssociation + + + + + +AccountActivityVersion + +AccountActivityVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +AccountActivityVersion->VersionAssociation + + + + + +AddressVersion + +AddressVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +AddressVersion->VersionAssociation + + + + + +BankStatementVersion + +BankStatementVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +BankStatementVersion->VersionAssociation + + + + + +DomainContactVersion + +DomainContactVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +DomainContactVersion->VersionAssociation + + + + + +ContactVersion + +ContactVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +ContactVersion->VersionAssociation + + + + + +CountryVersion + +CountryVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +CountryVersion->VersionAssociation + + + + + +DomainTransferVersion + +DomainTransferVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +DomainTransferVersion->VersionAssociation + + + + + +BankTransactionVersion + +BankTransactionVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +BankTransactionVersion->VersionAssociation + + + + + +InvoiceItemVersion + +InvoiceItemVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +InvoiceItemVersion->VersionAssociation + + + + + +LegalDocumentVersion + +LegalDocumentVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +LegalDocumentVersion->VersionAssociation + + + + + +RegistrarVersion + +RegistrarVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +RegistrarVersion->VersionAssociation + + + + + +ApiUserVersion + +ApiUserVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +ApiUserVersion->VersionAssociation + + + + + +ZonefileSettingVersion + +ZonefileSettingVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +ZonefileSettingVersion->VersionAssociation + + + + + +DomainVersion + +DomainVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +nameserver_ids :text +tech_contact_ids :text +admin_contact_ids :text +session :string +children :json + + +DomainVersion->VersionAssociation + + + + + +InvoiceVersion + +InvoiceVersion + +id :integer +item_type :string +item_id :integer +event :string +whodunnit :string +object :json +object_changes :json +created_at :datetime +session :string +children :json + + +InvoiceVersion->VersionAssociation + + + + + +ApiUser + +ApiUser + +id :integer +username :string +password :string +created_at :datetime +updated_at :datetime +email :string +sign_in_count :integer +current_sign_in_at :datetime +last_sign_in_at :datetime +current_sign_in_ip :inet +last_sign_in_ip :inet +identity_code :string +roles :string +creator_str :string +updator_str :string +country_code :string +registrar_id :integer +active :boolean +csr :text +crt :text +type :string +registrant_ident :string +encrypted_password :string +remember_created_at :datetime +failed_attempts :integer +locked_at :datetime + + +ApiUser->UserVersion + + + +versions + + +Certificate + +Certificate + +id :integer +api_user_id :integer +csr :text +crt :text +creator_str :string +updator_str :string +created_at :datetime +updated_at :datetime +common_name :string +md5 :string +interface :string + + +ApiUser->Certificate + + + + + +BankTransaction + +BankTransaction + +id :integer +bank_statement_id :integer +bank_reference :string +iban :string +currency :string +buyer_bank_code :string +buyer_iban :string +buyer_name :string +document_no :string +description :string +sum :decimal +reference_no :string +paid_at :datetime +created_at :datetime +updated_at :datetime +creator_str :string +updator_str :string + + +BankTransaction->BankTransactionVersion + + + +versions + + +AccountActivity + +AccountActivity + +id :integer +account_id :integer +invoice_id :integer +sum :decimal +currency :string +bank_transaction_id :integer +created_at :datetime +updated_at :datetime +description :string +creator_str :string +updator_str :string +activity_type :string + + +BankTransaction->AccountActivity + + + + + +Dnskey + +Dnskey + +id :integer +domain_id :integer +flags :integer +protocol :integer +alg :integer +public_key :text +delegation_signer_id :integer +ds_key_tag :string +ds_alg :integer +ds_digest_type :integer +ds_digest :string +creator_str :string +updator_str :string +legacy_domain_id :integer + + +Dnskey->DnskeyVersion + + + +versions + + +Dnskey->DnskeyVersion + + + +versions + + +Dnskey->DnskeyVersion + + + +versions + + +AdminDomainContact + +AdminDomainContact + +id :integer +contact_id :integer +domain_id :integer +contact_type :string +created_at :datetime +updated_at :datetime +contact_code_cache :string +creator_str :string +updator_str :string +type :string +legacy_domain_id :integer +legacy_contact_id :integer + + +AdminDomainContact->DomainContactVersion + + + +versions + + +Setting + +Setting + +id :integer +var :string +value :text +thing_id :integer +thing_type :string +created_at :datetime +updated_at :datetime +creator_str :string +updator_str :string + + +Setting->SettingVersion + + + +versions + + +Message + +Message + +id :integer +registrar_id :integer +body :string +attached_obj_type :string +attached_obj_id :string +queued :boolean +created_at :datetime +updated_at :datetime +creator_str :string +updator_str :string + + +Message->MessageVersion + + + +versions + + +Contact + +Contact + +id :integer +code :string +phone :string +email :string +fax :string +created_at :datetime +updated_at :datetime +ident :string +ident_type :string +auth_info :string +name :string +org_name :string +registrar_id :integer +creator_str :string +updator_str :string +ident_country_code :string +city :string +street :text +zip :string +country_code :string +state :string +legacy_id :integer +statuses :string + + +Contact->ContactVersion + + + +versions + + +Contact->ContactVersion + + + +versions + + +Contact->ContactVersion + + + +versions + + +Contact->ContactVersion + + + +versions + + +Domain + +Domain + +id :integer +name :string +registrar_id :integer +registered_at :datetime +status :string +valid_from :datetime +valid_to :datetime +registrant_id :integer +auth_info :string +created_at :datetime +updated_at :datetime +name_dirty :string +name_puny :string +period :integer +period_unit :string +creator_str :string +updator_str :string +legacy_id :integer +legacy_registrar_id :integer +legacy_registrant_id :integer +outzone_at :datetime +delete_at :datetime +registrant_verification_asked_at :datetime +registrant_verification_token :string +pending_json :json +force_delete_at :datetime +statuses :string + + +Contact->Domain + + + + + +Contact->Domain + + + +registrant_domains + + +Contact->Domain + + + + + +Contact->Domain + + + +registrant_domains + + +Contact->Domain + + + + + +Contact->Domain + + + +registrant_domains + + +Contact->Domain + + + + + +Contact->Domain + + + +registrant_domains + + +ContactStatus + +ContactStatus + +id :integer +value :string +description :string +contact_id :integer +created_at :datetime +updated_at :datetime +creator_str :string +updator_str :string + + +Contact->ContactStatus + + + +statuses + + +Contact->ContactStatus + + + +statuses + + +Contact->ContactStatus + + + +statuses + + +Contact->ContactStatus + + + +statuses + + +DomainContact + +DomainContact + +id :integer +contact_id :integer +domain_id :integer +contact_type :string +created_at :datetime +updated_at :datetime +contact_code_cache :string +creator_str :string +updator_str :string +type :string +legacy_domain_id :integer +legacy_contact_id :integer + + +Contact->DomainContact + + + + + +Contact->DomainContact + + + + + +Contact->DomainContact + + + + + +Contact->DomainContact + + + + + +LegalDocument + +LegalDocument + +id :integer +document_type :string +documentable_id :integer +documentable_type :string +created_at :datetime +updated_at :datetime +creator_str :string +updator_str :string +path :string + + +Contact->LegalDocument + + + + + +Contact->LegalDocument + + + + + +Contact->LegalDocument + + + + + +Contact->LegalDocument + + + + + +Domain->WhoisRecord + + + + + +Domain->WhoisRecord + + + + + +Domain->WhoisRecord + + + + + +Domain->WhoisRecord + + + + + +Domain->DomainVersion + + + +versions + + +Domain->DomainVersion + + + +versions + + +Domain->DomainVersion + + + +versions + + +Domain->DomainVersion + + + +versions + + +Domain->Dnskey + + + + + +Domain->Dnskey + + + + + +Domain->Dnskey + + + + + +Domain->Dnskey + + + + + +Domain->AdminDomainContact + + + + + +Domain->AdminDomainContact + + + + + +Domain->AdminDomainContact + + + + + +Domain->AdminDomainContact + + + + + +Domain->Contact + + + +admin_contacts + + +Domain->Contact + + + +tech_contacts + + +Domain->Contact + + + +admin_contacts + + +Domain->Contact + + + +tech_contacts + + +Domain->Contact + + + +admin_contacts + + +Domain->Contact + + + +tech_contacts + + +Domain->Contact + + + +admin_contacts + + +Domain->Contact + + + +tech_contacts + + +DomainTransfer + +DomainTransfer + +id :integer +domain_id :integer +status :string +transfer_requested_at :datetime +transferred_at :datetime +transfer_from_id :integer +transfer_to_id :integer +created_at :datetime +updated_at :datetime +wait_until :datetime +creator_str :string +updator_str :string + + +Domain->DomainTransfer + + + + + +Domain->DomainTransfer + + + + + +Domain->DomainTransfer + + + + + +Domain->DomainTransfer + + + + + +TechDomainContact + +TechDomainContact + +id :integer +contact_id :integer +domain_id :integer +contact_type :string +created_at :datetime +updated_at :datetime +contact_code_cache :string +creator_str :string +updator_str :string +type :string +legacy_domain_id :integer +legacy_contact_id :integer + + +Domain->TechDomainContact + + + + + +Domain->TechDomainContact + + + + + +Domain->TechDomainContact + + + + + +Domain->TechDomainContact + + + + + +Nameserver + +Nameserver + +id :integer +hostname :string +ipv4 :string +created_at :datetime +updated_at :datetime +ipv6 :string +domain_id :integer +creator_str :string +updator_str :string +legacy_domain_id :integer + + +Domain->Nameserver + + + + + +Domain->Nameserver + + + + + +Domain->Nameserver + + + + + +Domain->Nameserver + + + + + +Domain->DomainContact + + + + + +Domain->DomainContact + + + + + +Domain->DomainContact + + + + + +Domain->DomainContact + + + + + +DomainStatus + +DomainStatus + +id :integer +domain_id :integer +description :string +value :string +creator_str :string +updator_str :string +legacy_domain_id :integer + + +Domain->DomainStatus + + + + + +Domain->DomainStatus + + + + + +Domain->DomainStatus + + + + + +Domain->DomainStatus + + + + + +Keyrelay + +Keyrelay + +id :integer +domain_id :integer +pa_date :datetime +key_data_flags :string +key_data_protocol :string +key_data_alg :string +key_data_public_key :text +auth_info_pw :string +expiry_relative :string +expiry_absolute :datetime +requester_id :integer +accepter_id :integer +created_at :datetime +updated_at :datetime +creator_str :string +updator_str :string + + +Domain->Keyrelay + + + + + +Domain->Keyrelay + + + + + +Domain->Keyrelay + + + + + +Domain->Keyrelay + + + + + +Domain->LegalDocument + + + + + +Domain->LegalDocument + + + + + +Domain->LegalDocument + + + + + +Domain->LegalDocument + + + + + +Ability + +Ability + + + + +Registrar + +Registrar + +id :integer +name :string +reg_no :string +vat_no :string +billing_address :string +created_at :datetime +updated_at :datetime +creator_str :string +updator_str :string +phone :string +email :string +billing_email :string +country_code :string +state :string +city :string +street :string +zip :string +code :string +url :string +directo_handle :string +vat :boolean +legacy_id :integer +reference_no :string + + +Registrar->WhoisRecord + + + + + +Registrar->WhoisRecord + + + + + +Registrar->RegistrarVersion + + + +versions + + +Registrar->RegistrarVersion + + + +versions + + +Registrar->ApiUser + + + + + +Registrar->ApiUser + + + + + +Registrar->Message + + + + + +Registrar->Message + + + + + +Registrar->Contact + + + + + +Registrar->Contact + + + +priv_contacts + + +Registrar->Contact + + + + + +Registrar->Contact + + + +priv_contacts + + +Registrar->Domain + + + + + +Registrar->Domain + + + + + +Account + +Account + +id :integer +registrar_id :integer +account_type :string +balance :decimal +created_at :datetime +updated_at :datetime +currency :string +creator_str :string +updator_str :string + + +Registrar->Account + + + + + +Registrar->Account + + + + + +Registrar->Nameserver + + + + + +Registrar->Nameserver + + + + + +Invoice + +Invoice + +id :integer +created_at :datetime +updated_at :datetime +invoice_type :string +due_date :datetime +payment_term :string +currency :string +description :string +reference_no :string +vat_prc :decimal +paid_at :datetime +seller_id :integer +seller_name :string +seller_reg_no :string +seller_iban :string +seller_bank :string +seller_swift :string +seller_vat_no :string +seller_country_code :string +seller_state :string +seller_street :string +seller_city :string +seller_zip :string +seller_phone :string +seller_url :string +seller_email :string +seller_contact_name :string +buyer_id :integer +buyer_name :string +buyer_reg_no :string +buyer_country_code :string +buyer_state :string +buyer_street :string +buyer_city :string +buyer_zip :string +buyer_phone :string +buyer_url :string +buyer_email :string +creator_str :string +updator_str :string +number :integer +cancelled_at :datetime +sum_cache :decimal + + +Registrar->Invoice + + + + + +Registrar->Invoice + + + + + +WhiteIp + +WhiteIp + +id :integer +registrar_id :integer +ipv4 :string +ipv6 :string +interface :string +created_at :datetime +updated_at :datetime +creator_str :string +updator_str :string + + +Registrar->WhiteIp + + + + + +Registrar->WhiteIp + + + + + +BlockedDomain + +BlockedDomain + +id :integer +names :string +created_at :datetime +updated_at :datetime +creator_str :string +updator_str :string + + +BlockedDomain->BlockedDomainVersion + + + +versions + + +User + +User + +id :integer +username :string +password :string +created_at :datetime +updated_at :datetime +email :string +sign_in_count :integer +current_sign_in_at :datetime +last_sign_in_at :datetime +current_sign_in_ip :inet +last_sign_in_ip :inet +identity_code :string +roles :string +creator_str :string +updator_str :string +country_code :string +registrar_id :integer +active :boolean +csr :text +crt :text +type :string +registrant_ident :string +encrypted_password :string +remember_created_at :datetime +failed_attempts :integer +locked_at :datetime + + +User->UserVersion + + + +versions + + +User->UserVersion + + + +versions + + +DomainTransfer->DomainTransferVersion + + + +versions + + +ContactStatus->ContactStatusVersion + + + +versions + + +RegistrantVerification + +RegistrantVerification + +id :integer +domain_name :string +verification_token :string +created_at :datetime +updated_at :datetime +action :string +domain_id :integer +action_type :string + + +ZonefileSetting + +ZonefileSetting + +id :integer +origin :string +ttl :integer +refresh :integer +retry :integer +expire :integer +minimum_ttl :integer +email :string +master_nameserver :string +created_at :datetime +updated_at :datetime +creator_str :string +updator_str :string + + +ZonefileSetting->ZonefileSettingVersion + + + +versions + + +TechDomainContact->DomainContactVersion + + + +versions + + +AccountActivity->AccountActivityVersion + + + +versions + + +Account->AccountVersion + + + +versions + + +Account->AccountActivity + + + + + +EppSession + +EppSession + +id :integer +session_id :string +data :text +created_at :datetime +updated_at :datetime +registrar_id :integer + + +Pricelist + +Pricelist + +id :integer +desc :string +category :string +price_cents :decimal +price_currency :string +valid_from :datetime +valid_to :datetime +creator_str :string +updator_str :string +created_at :datetime +updated_at :datetime +duration :string +operation_category :string + + +Pricelist->PricelistVersion + + + +versions + + +InvoiceItem + +InvoiceItem + +id :integer +invoice_id :integer +description :string +unit :string +amount :integer +price :decimal +created_at :datetime +updated_at :datetime +creator_str :string +updator_str :string + + +InvoiceItem->InvoiceItemVersion + + + +versions + + +Nameserver->NameserverVersion + + + +versions + + +Deposit + +Deposit + + + + +Certificate->CertificateVersion + + + +versions + + +Object + +Object + + + + +Invoice->InvoiceVersion + + + +versions + + +Invoice->InvoiceVersion + + + +versions + + +Invoice->AccountActivity + + + + + +Invoice->AccountActivity + + + + + +Invoice->InvoiceItem + + + + + +Invoice->InvoiceItem + + + + + +BankStatement + +BankStatement + +id :integer +bank_code :string +iban :string +import_file_path :string +queried_at :datetime +created_at :datetime +updated_at :datetime +creator_str :string +updator_str :string + + +BankStatement->BankStatementVersion + + + +versions + + +BankStatement->BankTransaction + + + + + +DomainContact->DomainContactVersion + + + +versions + + +DomainStatus->DomainStatusVersion + + + +versions + + +Registrant + +Registrant + +id :integer +code :string +phone :string +email :string +fax :string +created_at :datetime +updated_at :datetime +ident :string +ident_type :string +auth_info :string +name :string +org_name :string +registrar_id :integer +creator_str :string +updator_str :string +ident_country_code :string +city :string +street :text +zip :string +country_code :string +state :string +legacy_id :integer +statuses :string + + +Registrant->ContactVersion + + + +versions + + +Registrant->Domain + + + + + +Registrant->Domain + + + +registrant_domains + + +Registrant->ContactStatus + + + +statuses + + +Registrant->DomainContact + + + + + +Registrant->LegalDocument + + + + + +Keyrelay->KeyrelayVersion + + + +versions + + +Keyrelay->KeyrelayVersion + + + +versions + + +Keyrelay->LegalDocument + + + + + +Keyrelay->LegalDocument + + + + + +WhiteIp->WhiteIpVersion + + + +versions + + +AdminUser + +AdminUser + +id :integer +username :string +password :string +created_at :datetime +updated_at :datetime +email :string +sign_in_count :integer +current_sign_in_at :datetime +last_sign_in_at :datetime +current_sign_in_ip :inet +last_sign_in_ip :inet +identity_code :string +roles :string +creator_str :string +updator_str :string +country_code :string +registrar_id :integer +active :boolean +csr :text +crt :text +type :string +registrant_ident :string +encrypted_password :string +remember_created_at :datetime +failed_attempts :integer +locked_at :datetime + + +AdminUser->UserVersion + + + +versions + + +Address + +Address + +id :integer +contact_id :integer +city :string +street :string +zip :string +created_at :datetime +updated_at :datetime +street2 :string +street3 :string +creator_str :string +updator_str :string +country_code :string +state :string +legacy_contact_id :integer + + +Address->AddressVersion + + + +versions + + +LegalDocument->LegalDocumentVersion + + + +versions + + + diff --git a/doc/que/README.md b/doc/que/README.md new file mode 100644 index 000000000..3c34a10ac --- /dev/null +++ b/doc/que/README.md @@ -0,0 +1,46 @@ +Registry que server +=================== + +Que server responsibilites: + +* handle write type of communication between Registrant and Registry +* handle future jobs for Registry +* handle heavy load jobs for Registry + +Installation +------------ + +Que can deploy either separaetly or along to Registry server depends on real load situation. +In both serarious que requires working Registry deployment and full access to Registry databases. + +Installation at deployed server: + + cd /home/registry/registry/current + sudo cp doc/que/que-init-example /etc/init.d/que # and edit it + sudo chmod +x /etc/init.d/que + sudo /etc/init.d/que # for help and other commands + sudo /etc/init.d/que start # for manual start + sudo update-rc.d que defaults # for start in server boot + +# Debugging + +You can run que manually as well: + + cd /home/registry/registry/current + +For all manual que tasks: + + RAILS_ENV=production bundle exec rake -T que # for all que tasks for manual control + rake que:clear # Clear Que's job table + rake que:drop # Drop Que's job table + rake que:migrate # Migrate Que's job table to the most recent version (creating it if it doesn't exist) + rake que:work # Process Que's jobs using a worker pool + +For all que daemon tasks what inist script uses + + RAILS_ENV=production bundle exec rake -T daemon # for all que daemon tasks what init script uses + rake daemon:que # Start que script + rake daemon:que:restart # Restart que daemon + rake daemon:que:start # Start que daemon + rake daemon:que:status # Status que daemon + rake daemon:que:stop # Stop que daemon diff --git a/doc/que/que-init-example b/doc/que/que-init-example new file mode 100644 index 000000000..d36fbf101 --- /dev/null +++ b/doc/que/que-init-example @@ -0,0 +1,51 @@ +#!/bin/bash +### BEGIN INIT INFO +# Provides: Registry que server +# Required-Start: $all +# Required-Stop: $network $local_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Enable Registry que server +### END INIT INFO + +set -u +set -e + +# +# Change these to match your server: +# +# Make sure that all paths are correct. +# +APP_HOME="/home/registry/registry" +APP_ROOT="$APP_HOME/current" +QUE_USER=registry # or use some other unprivileged system user +RAILS_ENV=production +RUBY_BUNDLE_PATH=/home/$QUE_USER/.rbenv/shims/bundle +QUE_INSTANCES=1 # or as many really needed based real load + +cd $APP_ROOT || exit 1 + +case ${1-help} in +status) + cd $APP_ROOT && RAILS_ENV=$RAILS_ENV $RUBY_BUNDLE_PATH exec lib/daemons/que_ctl status + ;; +start) + echo "$1 que monitor and server" + for i in `seq 1 $QUE_INSTANCES`; do + cd $APP_ROOT && QUE_WORKER_COUNT=1 RAILS_ENV=$RAILS_ENV $RUBY_BUNDLE_PATH exec rake daemon:que:start + echo '.' + done + ;; +stop) + echo "$1 que monitor and server" + cd $APP_ROOT && RAILS_ENV=$RAILS_ENV $RUBY_BUNDLE_PATH lib/daemons/que_ctl stop + ;; +restart) + echo "$1 que monitor and server" + cd $APP_ROOT && RAILS_ENV=$RAILS_ENV $RUBY_BUNDLE_PATH exec rake daemon:que:restart + ;; +*) + echo >&2 "Usage: $0 " + exit 1 + ;; +esac diff --git a/doc/repp-doc.md b/doc/repp-doc.md index 9896f34da..8eab257ab 100644 --- a/doc/repp-doc.md +++ b/doc/repp-doc.md @@ -10,7 +10,7 @@ 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: https://testepp.internet.ee/repp/v1 Production API endpoint: TBA Main communication specification through Restful EPP (REPP): diff --git a/doc/schemas/eis-1.0.xsd b/doc/schemas/eis-1.0.xsd index 262d94581..2612b5e57 100644 --- a/doc/schemas/eis-1.0.xsd +++ b/doc/schemas/eis-1.0.xsd @@ -15,22 +15,40 @@ Child elements found in EPP commands. --> - + - + + + + + + + + + + + + + + + + + diff --git a/lib/daemons/daemons b/lib/daemons/daemons new file mode 100755 index 000000000..42722e47c --- /dev/null +++ b/lib/daemons/daemons @@ -0,0 +1,5 @@ +#!/usr/bin/env ruby +results = [] +Dir[File.dirname(__FILE__) + "/*_ctl"].each { |f| results << `ruby #{f} #{ARGV.first}` } +results.delete_if { |result| result.nil? || result.empty? } +puts results.join unless results.empty? diff --git a/lib/daemons/que.rb b/lib/daemons/que.rb new file mode 100755 index 000000000..683024ddd --- /dev/null +++ b/lib/daemons/que.rb @@ -0,0 +1,43 @@ +#!/usr/bin/env ruby + +ENV["RAILS_ENV"] ||= "production" + +root = File.expand_path(File.dirname(__FILE__)) +root = File.dirname(root) until File.exist?(File.join(root, 'config')) +Dir.chdir(root) + +require File.join(root, "config", "environment") + +# from que gem rake task +if defined?(::Rails) && Rails.respond_to?(:application) + # ActiveSupport's dependency autoloading isn't threadsafe, and Que uses + # multiple threads, which means that eager loading is necessary. Rails + # explicitly prevents eager loading when the environment task is invoked, + # so we need to manually eager load the app here. + Rails.application.eager_load! +end + +Que.logger.level = Logger.const_get((ENV['QUE_LOG_LEVEL'] || 'INFO').upcase) +Que.worker_count = 1 +Que.wake_interval = (ENV['QUE_WAKE_INTERVAL'] || 0.1).to_f +Que.mode = :async + +# When changing how signals are caught, be sure to test the behavior with +# the rake task in tasks/safe_shutdown.rb. + +stop = false +%w( INT TERM ).each do |signal| + trap(signal) { stop = true } +end + +at_exit do + $stdout.puts "Finishing Que's current jobs before exiting..." + Que.worker_count = 0 + Que.mode = :off + $stdout.puts "Que's jobs finished, exiting..." +end + +loop do + sleep 0.01 + break if stop +end diff --git a/lib/daemons/que_ctl b/lib/daemons/que_ctl new file mode 100755 index 000000000..446f8eac0 --- /dev/null +++ b/lib/daemons/que_ctl @@ -0,0 +1,6 @@ +#!/usr/bin/env ruby +require 'rubygems' +require 'daemons/rails/config' + +config = Daemons::Rails::Config.for_controller(File.expand_path(__FILE__)) +Daemons::Rails.run config[:script], config.to_hash diff --git a/lib/devise_custom_failure.rb b/lib/devise_custom_failure.rb index b902486d4..a8a947173 100644 --- a/lib/devise_custom_failure.rb +++ b/lib/devise_custom_failure.rb @@ -1,9 +1,9 @@ class DeviseCustomFailure < Devise::FailureApp def redirect_url - 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 registrant_login_url if request.original_fullpath.to_s.match(%r{^\/registrant}) + return registrar_login_url if request.original_fullpath.to_s.match(%r{^\/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(%r{^\/admin}) root_url end diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index cd022bcb1..3d80d0f3b 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -1,12 +1,45 @@ +Rake::Task["db:schema:load"].clear + +Rake::Task["db:migrate"].enhance do + if ActiveRecord::Base.schema_format == :sql + Rake::Task["db:schema:dump"].invoke + end +end + +Rake::Task["db:rollback"].enhance do + if ActiveRecord::Base.schema_format == :sql + Rake::Task["db:schema:dump"].invoke + end +end + +Rake::Task["db:schema:dump"].enhance do + if ActiveRecord::Base.schema_format == :sql + File.rename('db/schema.rb', 'db/schema-read-only.rb') + Rake::Task["db:structure:dump"].invoke # for users who do manually db:schema:dump + end +end + namespace :db do + namespace :schema do + task load: [:environment, :load_config] do + puts 'Only rake db:structure:load is supported and invoked. ' \ + 'Otherwise zonefile generation does not work nor que.' + Rake::Task["db:structure:load"].invoke + end + end + def databases @db ||= [Rails.env, "api_log_#{Rails.env}", "whois_#{Rails.env}"] end + def other_databases + @other_dbs ||= ["api_log_#{Rails.env}", "whois_#{Rails.env}"] + end + def schema_file(db) case db when Rails.env - 'schema.rb' + 'structure.sql' # just in case when "api_log_#{Rails.env}" 'api_log_schema.rb' when "whois_#{Rails.env}" @@ -25,7 +58,7 @@ namespace :db do puts "\n---------------------------- Import seed ----------------------------------------\n" Rake::Task['db:seed'].invoke - Rake::Task['zonefile:replace_procedure'].invoke + # Rake::Task['zonefile:replace_procedure'].invoke # not needed any more puts "\n All done!\n\n" end @@ -73,7 +106,10 @@ namespace :db do namespace :schema do desc 'Schema load for all databases: registry, api_log and whois' task load: [:environment, :load_config] do - databases.each do |name| + puts "\n------------------------ #{Rails.env} structure loading -----------------------------\n" + Rake::Task['db:structure:load'].invoke + + other_databases.each do |name| begin puts "\n------------------------ #{name} schema loading -----------------------------\n" ActiveRecord::Base.clear_all_connections! @@ -89,9 +125,12 @@ namespace :db do end end - desc 'Schema load for all databases: registry, api_log and whois' + desc 'Schema dump for all databases: registry, api_log and whois' task dump: [:environment, :load_config] do - databases.each do |name| + puts "\n---------------------------- #{Rails.env} structure and schema dump--------------\n" + Rake::Task['db:schema:dump'].invoke # dumps both schema and structure + + other_databases.each do |name| begin puts "\n---------------------------- #{name} ----------------------------------------\n" filename = "#{Rails.root}/db/#{schema_file(name)}" @@ -104,6 +143,17 @@ namespace :db do end end end + # alias names + namespace :structure do + desc '(alias) Schema dump for all databases: registry, api_log and whois' + task :dump do + Rake::Task['db:all:schema:dump'].invoke + end + desc '(alias) Schema load for all databases: registry, api_log and whois' + task :load do + Rake::Task['db:all:schema:load'].invoke + end + end end end end diff --git a/lib/tasks/import.rake b/lib/tasks/import.rake index 69cdb603f..9a89d2b72 100644 --- a/lib/tasks/import.rake +++ b/lib/tasks/import.rake @@ -1,3 +1,5 @@ +# rubocop: disable Style/SymbolProc +# rubocop: disable Performance/Detect namespace :import do # README # @@ -712,3 +714,5 @@ namespace :import do puts "-----> Imported EIS domains in #{(Time.zone.now.to_f - start).round(2)} seconds" end end +# rubocop: enable Performance/Detect +# rubocop: enable Style/SymbolProc diff --git a/spec/epp/contact_spec.rb b/spec/epp/contact_spec.rb index ffbb3cd0b..752f017ef 100644 --- a/spec/epp/contact_spec.rb +++ b/spec/epp/contact_spec.rb @@ -151,7 +151,7 @@ describe 'EPP Contact', epp: true do id.text.length.should == 15 # 5 seconds for what-ever weird lag reasons might happen - cr_date.text.to_time.should be_within(5).of(Time.zone.now) + cr_date.text.in_time_zone.utc.should be_within(5).of(Time.zone.now) end it 'should add registrar prefix for code when missing' do @@ -321,7 +321,7 @@ describe 'EPP Contact', epp: true do response[:msg].should == 'Command completed successfully' @contact.reload - @contact.name.should == 'John Doe Edited' + @contact.name.should == 'John Doe Edited' @contact.email.should == 'edited@example.example' end @@ -339,7 +339,7 @@ describe 'EPP Contact', epp: true do response[:msg].should == 'Command completed successfully' @contact.reload - @contact.name.should == 'John Doe Edited' + @contact.name.should == 'John Doe Edited' end it 'should update other contact with correct password' do @@ -365,7 +365,7 @@ describe 'EPP Contact', epp: true do response[:msg].should == 'Authorization error' @contact.reload - @contact.name.should == 'John Doe Edited' + @contact.name.should == 'John Doe Edited' end end diff --git a/spec/epp/domain_spec.rb b/spec/epp/domain_spec.rb index 9161f5cdc..7aece6e9d 100644 --- a/spec/epp/domain_spec.rb +++ b/spec/epp/domain_spec.rb @@ -5,7 +5,9 @@ describe 'EPP Domain', epp: true do @xsd = Nokogiri::XML::Schema(File.read('doc/schemas/domain-eis-1.0.xsd')) @epp_xml = EppXml.new(cl_trid: 'ABC-12345') @registrar1 = Fabricate(:registrar1, code: 'REGDOMAIN1') + @registrar1.credit!({ sum: 10000 }) @registrar2 = Fabricate(:registrar2, code: 'REGDOMAIN2') + @registrar2.credit!({ sum: 10000 }) Fabricate(:api_user, username: 'registrar1', registrar: @registrar1) Fabricate(:api_user, username: 'registrar2', registrar: @registrar2) @@ -16,10 +18,30 @@ describe 'EPP Domain', epp: true do Fabricate(:contact, code: 'FIXED:SH801333') Fabricate(:contact, code: 'FIXED:JURIDICAL_1234', ident_type: 'bic') Fabricate(:reserved_domain) + Fabricate(:blocked_domain) + @pricelist_reg_1_year = Fabricate(:pricelist, valid_to: nil) + @pricelist_reg_2_year = Fabricate(:pricelist, duration: '2years', price: 20, valid_to: nil) + Fabricate(:pricelist, duration: '3years', price: 30, valid_to: nil) + @pricelist_renew_1_year = Fabricate(:pricelist, operation_category: 'renew', price: 15, valid_to: nil) + Fabricate(:pricelist, operation_category: 'renew', duration: '2years', price: 35, valid_to: nil) + Fabricate(:pricelist, operation_category: 'renew', duration: '3years', price: 62, valid_to: nil) @uniq_no = proc { @i ||= 0; @i += 1 } end + it 'should return error if balance low' do + f = Fabricate(:pricelist, valid_to: Time.zone.now + 1.day, price: 100000) + + dn = next_domain_name + response = epp_plain_request(domain_create_xml({ + name: { value: dn } + })) + + response[:msg].should == "Billing failure - credit balance low" + response[:result_code].should == '2104' + f.delete + end + it 'returns error if contact does not exists' do response = epp_plain_request(domain_create_xml({ registrant: { value: 'FIXED:CITIZEN_1234' }, @@ -89,8 +111,8 @@ describe 'EPP Domain', epp: true do cre_data = response[:parsed].css('creData') cre_data.css('name').text.should == dn - cre_data.css('crDate').text.should == d.created_at.to_time.utc.iso8601 - cre_data.css('exDate').text.should == d.valid_to.to_time.utc.iso8601 + cre_data.css('crDate').text.should == d.created_at.in_time_zone.utc.utc.iso8601 + cre_data.css('exDate').text.should == d.valid_to.in_time_zone.utc.utc.iso8601 response[:clTRID].should == 'ABC-12345' @@ -122,6 +144,7 @@ describe 'EPP Domain', epp: true do response[:result_code].should == '1000' d = Domain.last d.legal_documents.count.should == 1 + d.reserved.should == false end # it 'creates ria.ee with valid ds record' do @@ -202,8 +225,56 @@ describe 'EPP Domain', epp: true do xml = domain_create_xml(name: { value: '1162.ee' }) response = epp_plain_request(xml) + response[:msg].should == 'Required parameter missing; reserved>pw element required for reserved domains' + response[:result_code].should == '2003' + response[:clTRID].should == 'ABC-12345' + + xml = domain_create_xml({name: { value: '1162.ee' }}, {}, { + _anonymus: [ + legalDocument: { + value: 'dGVzdCBmYWlsCg==', + attrs: { type: 'pdf' } + }, + reserved: { + pw: { value: 'wrong_pw' } + } + ] + }) + + response = epp_plain_request(xml) + response[:msg].should == 'Invalid authorization information; invalid reserved>pw value' + response[:result_code].should == '2202' + end + + it 'creates a reserved domain with correct auth info' do + xml = domain_create_xml({name: { value: '1162.ee' }}, {}, { + _anonymus: [ + legalDocument: { + value: 'dGVzdCBmYWlsCg==', + attrs: { type: 'pdf' } + }, + reserved: { + pw: { value: 'abc' } + } + ] + }) + + response = epp_plain_request(xml) + response[:msg].should == 'Command completed successfully' + response[:result_code].should == '1000' + + d = Domain.last + d.statuses.should match_array(['ok']) + d.reserved.should == true + end + + it 'does not create blocked domain' do + xml = domain_create_xml(name: { value: 'ftp.ee' }) + + response = epp_plain_request(xml) + response[:msg].should == 'Domain name is blocked [name_dirty]' response[:result_code].should == '2302' - response[:msg].should == 'Domain name is reserved or restricted [name_dirty]' + response[:results][0][:value].should == 'ftp.ee' response[:clTRID].should == 'ABC-12345' end @@ -312,15 +383,61 @@ describe 'EPP Domain', epp: true do end it 'creates a domain with period in days' do - xml = domain_create_xml(period_value: 365, period_unit: 'd') + old_balance = @registrar1.balance + old_activities = @registrar1.cash_account.account_activities.count + xml = domain_create_xml(period: { value: '365', attrs: { unit: 'd' } }) response = epp_plain_request(xml) response[:msg].should == 'Command completed successfully' response[:result_code].should == '1000' - Domain.first.valid_to.should be_within(60).of(1.year.since) + Domain.last.valid_to.should be_within(60).of(1.year.since) + @registrar1.balance.should be < old_balance + @registrar1.cash_account.account_activities.count.should == old_activities + 1 + a = @registrar1.cash_account.account_activities.last + a.description.should == "Create #{Domain.last.name}" + a.sum.should == -BigDecimal.new('10.0') + a.activity_type = AccountActivity::CREATE + a.log_pricelist_id.should == @pricelist_reg_1_year.id + end + + it 'creates a domain with longer periods' do + old_balance = @registrar1.balance + old_activities = @registrar1.cash_account.account_activities.count + xml = domain_create_xml(period: { value: '2', attrs: { unit: 'y' } }) + + response = epp_plain_request(xml) + response[:msg].should == 'Command completed successfully' + response[:result_code].should == '1000' + Domain.last.valid_to.should be_within(60).of(2.years.since) + @registrar1.balance.should be < old_balance + @registrar1.cash_account.account_activities.count.should == old_activities + 1 + a = @registrar1.cash_account.account_activities.last + a.description.should == "Create #{Domain.last.name}" + a.sum.should == -BigDecimal.new('20.0') + a.activity_type = AccountActivity::CREATE + a.log_pricelist_id.should == @pricelist_reg_2_year.id + end + + it 'creates a domain with longer periods' do + old_balance = @registrar1.balance + old_activities = @registrar1.cash_account.account_activities.count + xml = domain_create_xml(period: { value: '36', attrs: { unit: 'm' } }) + + response = epp_plain_request(xml) + response[:msg].should == 'Command completed successfully' + response[:result_code].should == '1000' + Domain.last.valid_to.should be_within(60).of(3.years.since) + @registrar1.balance.should be < old_balance + @registrar1.cash_account.account_activities.count.should == old_activities + 1 + a = @registrar1.cash_account.account_activities.last + a.description.should == "Create #{Domain.last.name}" + a.sum.should == -BigDecimal.new('30.0') + a.activity_type = AccountActivity::CREATE end it 'does not create a domain with invalid period' do + old_balance = @registrar1.balance + old_activities = @registrar1.cash_account.account_activities.count xml = domain_create_xml({ period: { value: '367', attrs: { unit: 'd' } } }) @@ -329,6 +446,8 @@ describe 'EPP Domain', epp: true do response[:results][0][:result_code].should == '2306' response[:results][0][:msg].should == 'Period must add up to 1, 2 or 3 years [period]' response[:results][0][:value].should == '367' + @registrar1.balance.should == old_balance + @registrar1.cash_account.account_activities.count.should == old_activities end it 'creates a domain with multiple dnskeys' do @@ -723,7 +842,7 @@ describe 'EPP Domain', epp: true do xml = domain_transfer_xml({ name: { value: domain.name }, authInfo: { pw: { value: pw } } - }, 'query', { + }, 'request', { _anonymus: [ legalDocument: { value: 'dGVzdCBmYWlsCg==', @@ -746,10 +865,10 @@ describe 'EPP Domain', epp: true do trn_data.css('name').text.should == domain.name trn_data.css('trStatus').text.should == 'serverApproved' trn_data.css('reID').text.should == 'REGDOMAIN2' - trn_data.css('reDate').text.should == dtl.transfer_requested_at.to_time.utc.iso8601 + trn_data.css('reDate').text.should == dtl.transfer_requested_at.in_time_zone.utc.utc.iso8601 trn_data.css('acID').text.should == 'REGDOMAIN1' - trn_data.css('acDate').text.should == dtl.transferred_at.to_time.utc.iso8601 - trn_data.css('exDate').text.should == domain.valid_to.to_time.utc.iso8601 + trn_data.css('acDate').text.should == dtl.transferred_at.in_time_zone.utc.utc.iso8601 + trn_data.css('exDate').text.should == domain.valid_to.in_time_zone.utc.utc.iso8601 domain.registrar.should == @registrar2 @@ -771,7 +890,7 @@ describe 'EPP Domain', epp: true do xml = domain_transfer_xml({ name: { value: domain.name }, authInfo: { pw: { value: pw } } - }, 'query', { + }, 'request', { _anonymus: [ legalDocument: { value: 'dGVzdCBmYWlsCg==', @@ -791,10 +910,10 @@ describe 'EPP Domain', epp: true do trn_data.css('name').text.should == domain.name trn_data.css('trStatus').text.should == 'pending' trn_data.css('reID').text.should == 'REGDOMAIN1' - trn_data.css('reDate').text.should == dtl.transfer_requested_at.to_time.utc.iso8601 - trn_data.css('acDate').text.should == dtl.wait_until.to_time.utc.iso8601 + trn_data.css('reDate').text.should == dtl.transfer_requested_at.in_time_zone.utc.utc.iso8601 + trn_data.css('acDate').text.should == dtl.wait_until.in_time_zone.utc.utc.iso8601 trn_data.css('acID').text.should == 'REGDOMAIN2' - trn_data.css('exDate').text.should == domain.valid_to.to_time.utc.iso8601 + trn_data.css('exDate').text.should == domain.valid_to.in_time_zone.utc.utc.iso8601 domain.registrar.should == @registrar2 @@ -806,10 +925,10 @@ describe 'EPP Domain', epp: true do trn_data.css('name').text.should == domain.name trn_data.css('trStatus').text.should == 'pending' trn_data.css('reID').text.should == 'REGDOMAIN1' - trn_data.css('reDate').text.should == dtl.transfer_requested_at.to_time.utc.iso8601 - trn_data.css('acDate').text.should == dtl.wait_until.to_time.utc.iso8601 + trn_data.css('reDate').text.should == dtl.transfer_requested_at.in_time_zone.utc.utc.iso8601 + trn_data.css('acDate').text.should == dtl.wait_until.in_time_zone.utc.utc.iso8601 trn_data.css('acID').text.should == 'REGDOMAIN2' - trn_data.css('exDate').text.should == domain.valid_to.to_time.utc.iso8601 + trn_data.css('exDate').text.should == domain.valid_to.in_time_zone.utc.utc.iso8601 domain.registrar.should == @registrar2 @@ -849,7 +968,7 @@ describe 'EPP Domain', epp: true do xml = domain_transfer_xml({ name: { value: domain.name }, authInfo: { pw: { value: pw } } - }, 'query', { + }, 'request', { _anonymus: [ legalDocument: { value: 'dGVzdCBmYWlsCg==', @@ -1213,9 +1332,9 @@ describe 'EPP Domain', epp: true do trn_data.css('name').text.should == domain.name trn_data.css('trStatus').text.should == 'clientApproved' trn_data.css('reID').text.should == 'REGDOMAIN2' - trn_data.css('reDate').text.should == dtl.transfer_requested_at.to_time.utc.iso8601 + trn_data.css('reDate').text.should == dtl.transfer_requested_at.in_time_zone.utc.utc.iso8601 trn_data.css('acID').text.should == 'REGDOMAIN1' - trn_data.css('exDate').text.should == domain.valid_to.to_time.utc.iso8601 + trn_data.css('exDate').text.should == domain.valid_to.in_time_zone.utc.utc.iso8601 end it 'rejects a domain transfer' do @@ -1285,7 +1404,7 @@ describe 'EPP Domain', epp: true do xml = domain_transfer_xml({ name: { value: domain.name }, authInfo: { pw: { value: 'test' } } - }, 'query', { + }, 'request', { _anonymus: [ legalDocument: { value: 'dGVzdCBmYWlsCg==', @@ -1299,12 +1418,12 @@ describe 'EPP Domain', epp: true do response[:msg].should == 'Authorization error' end - it 'ignores transfer wha registrant registrar requests transfer' do + it 'ignores transfer when domain already belongs to registrar' do pw = domain.auth_info xml = domain_transfer_xml({ name: { value: domain.name }, authInfo: { pw: { value: pw } } - }, 'query', { + }, 'request', { _anonymus: [ legalDocument: { value: 'dGVzdCBmYWlsCg==', @@ -1321,8 +1440,8 @@ describe 'EPP Domain', epp: true do it 'returns an error for incorrect op attribute' do response = epp_plain_request(domain_transfer_xml({}, 'bla'), validate_input: false) - response[:result_code].should == '2306' - response[:msg].should == 'Attribute is invalid: op' + response[:msg].should == 'Parameter value range error: op' + response[:result_code].should == '2004' end it 'creates new pw after successful transfer' do @@ -1330,7 +1449,7 @@ describe 'EPP Domain', epp: true do xml = domain_transfer_xml({ name: { value: domain.name }, authInfo: { pw: { value: pw } } - }, 'query', { + }, 'request', { _anonymus: [ legalDocument: { value: 'dGVzdCBmYWlsCg==', @@ -1342,8 +1461,8 @@ describe 'EPP Domain', epp: true do login_as :registrar2 do epp_plain_request(xml) # transfer domain response = epp_plain_request(xml) # attempt second transfer - response[:result_code].should == '2201' response[:msg].should == 'Authorization error' + response[:result_code].should == '2201' end end @@ -1362,10 +1481,118 @@ describe 'EPP Domain', epp: true do }) response = epp_plain_request(xml) - response[:msg].should == 'Pending transfer was not found' + response[:msg].should == 'No transfers found' response[:result_code].should == '2303' end + it 'should not return transfers when there are none' do + xml = domain_transfer_xml({ + name: { value: domain.name }, + authInfo: { pw: { value: domain.auth_info } } + }, 'query') + + response = epp_plain_request(xml) + response[:results][0][:msg].should == 'No transfers found' + response[:results][0][:result_code].should == '2303' + end + + it 'should allow querying domain transfer' do + Setting.transfer_wait_time = 1 + pw = domain.auth_info + xml = domain_transfer_xml({ + name: { value: domain.name }, + authInfo: { pw: { value: pw } } + }, 'request', { + _anonymus: [ + legalDocument: { + value: 'dGVzdCBmYWlsCg==', + attrs: { type: 'pdf' } + } + ] + }) + + login_as :registrar2 do + response = epp_plain_request(xml) + response[:results][0][:msg].should == 'Command completed successfully' + response[:results][0][:result_code].should == '1000' + + trn_data = response[:parsed].css('trnData') + + dtl = domain.domain_transfers.last + + trn_data.css('name').text.should == domain.name + trn_data.css('trStatus').text.should == 'pending' + trn_data.css('reID').text.should == 'REGDOMAIN2' + trn_data.css('reDate').text.should == dtl.transfer_requested_at.in_time_zone.utc.utc.iso8601 + trn_data.css('acDate').text.should == dtl.wait_until.in_time_zone.utc.utc.iso8601 + trn_data.css('acID').text.should == 'REGDOMAIN1' + trn_data.css('exDate').text.should == domain.valid_to.in_time_zone.utc.utc.iso8601 + + xml = domain_transfer_xml({ + name: { value: domain.name }, + authInfo: { pw: { value: pw } } + }, 'query') + + response = epp_plain_request(xml) + response[:results][0][:msg].should == 'Command completed successfully' + response[:results][0][:result_code].should == '1000' + + trn_data = response[:parsed].css('trnData') + + dtl = domain.domain_transfers.last + trn_data.css('name').text.should == domain.name + trn_data.css('trStatus').text.should == 'pending' + trn_data.css('reID').text.should == 'REGDOMAIN2' + trn_data.css('reDate').text.should == dtl.transfer_requested_at.in_time_zone.utc.utc.iso8601 + trn_data.css('acDate').text.should == dtl.wait_until.in_time_zone.utc.utc.iso8601 + trn_data.css('acID').text.should == 'REGDOMAIN1' + trn_data.css('exDate').text.should == domain.valid_to.in_time_zone.utc.utc.iso8601 + end + + # approves pending transfer + xml = domain_transfer_xml({ + name: { value: domain.name }, + authInfo: { pw: { value: pw } } + }, 'approve', { + _anonymus: [ + legalDocument: { + value: 'dGVzdCBmYWlsCg==', + attrs: { type: 'pdf' } + } + ] + }) + + response = epp_plain_request(xml) + response[:results][0][:msg].should == 'Command completed successfully' + response[:results][0][:result_code].should == '1000' + + # query should return last completed transfer + domain.reload + pw = domain.auth_info + xml = domain_transfer_xml({ + name: { value: domain.name }, + authInfo: { pw: { value: pw } } + }, 'query') + + response = epp_plain_request(xml) + response[:results][0][:msg].should == 'Command completed successfully' + response[:results][0][:result_code].should == '1000' + + trn_data = response[:parsed].css('trnData') + + dtl = domain.domain_transfers.last + + trn_data.css('name').text.should == domain.name + trn_data.css('trStatus').text.should == 'clientApproved' + trn_data.css('reID').text.should == 'REGDOMAIN2' + trn_data.css('reDate').text.should == dtl.transfer_requested_at.in_time_zone.utc.utc.iso8601 + trn_data.css('acDate').text.should == dtl.transferred_at.in_time_zone.utc.utc.iso8601 + trn_data.css('acID').text.should == 'REGDOMAIN1' + trn_data.css('exDate').text.should == domain.valid_to.in_time_zone.utc.utc.iso8601 + + Setting.transfer_wait_time = 0 + end + ### UPDATE ### it 'should update right away without update pending status' do existing_pw = domain.auth_info @@ -1958,6 +2185,9 @@ describe 'EPP Domain', epp: true do ### RENEW ### it 'renews a domain' do + old_balance = @registrar1.balance + old_activities = @registrar1.cash_account.account_activities.count + domain.valid_to = Time.zone.now.to_date + 10.days domain.save @@ -1976,6 +2206,109 @@ describe 'EPP Domain', epp: true do name = response[:parsed].css('renData name').text ex_date.should == "#{(exp_date + 1.year)}T00:00:00Z" name.should == domain.name + + @registrar1.balance.should == old_balance - 15.0 + @registrar1.cash_account.account_activities.count.should == old_activities + 1 + a = @registrar1.cash_account.account_activities.last + a.description.should == "Renew #{Domain.last.name}" + a.sum.should == -BigDecimal.new('15.0') + a.activity_type = AccountActivity::RENEW + a.log_pricelist_id.should == @pricelist_renew_1_year.id + end + + it 'renews a domain with 2 year period' do + old_balance = @registrar1.balance + old_activities = @registrar1.cash_account.account_activities.count + + domain.valid_to = Time.zone.now.to_date + 10.days + domain.save + + exp_date = domain.valid_to.to_date + xml = @epp_xml.domain.renew( + name: { value: domain.name }, + curExpDate: { value: exp_date.to_s }, + period: { value: '730', attrs: { unit: 'd' } } + ) + + response = epp_plain_request(xml) + response[:results][0][:msg].should == 'Command completed successfully' + response[:results][0][:result_code].should == '1000' + + ex_date = response[:parsed].css('renData exDate').text + name = response[:parsed].css('renData name').text + ex_date.should == "#{(exp_date + 2.year)}T00:00:00Z" + name.should == domain.name + + @registrar1.balance.should == old_balance - 35.0 + @registrar1.cash_account.account_activities.count.should == old_activities + 1 + a = @registrar1.cash_account.account_activities.last + a.description.should == "Renew #{Domain.last.name}" + a.sum.should == -BigDecimal.new('35.0') + a.activity_type = AccountActivity::CREATE + end + + it 'renews a domain with 3 year period' do + old_balance = @registrar1.balance + old_activities = @registrar1.cash_account.account_activities.count + + domain.valid_to = Time.zone.now.to_date + 10.days + domain.save + + exp_date = domain.valid_to.to_date + xml = @epp_xml.domain.renew( + name: { value: domain.name }, + curExpDate: { value: exp_date.to_s }, + period: { value: '36', attrs: { unit: 'm' } } + ) + + response = epp_plain_request(xml) + response[:results][0][:msg].should == 'Command completed successfully' + response[:results][0][:result_code].should == '1000' + + ex_date = response[:parsed].css('renData exDate').text + name = response[:parsed].css('renData name').text + ex_date.should == "#{(exp_date + 3.year)}T00:00:00Z" + name.should == domain.name + + @registrar1.balance.should == old_balance - 62.0 + @registrar1.cash_account.account_activities.count.should == old_activities + 1 + a = @registrar1.cash_account.account_activities.last + a.description.should == "Renew #{Domain.last.name}" + a.sum.should == -BigDecimal.new('62.0') + a.activity_type = AccountActivity::CREATE + end + + it 'does not renew a domain if credit balance low' do + f = Fabricate(:pricelist, { + valid_to: Time.zone.now + 1.day, + operation_category: 'renew', + duration: '1year', + price: 100000 + }) + + old_balance = @registrar1.balance + old_activities = @registrar1.cash_account.account_activities.count + + domain.valid_to = Time.zone.now.to_date + 10.days + domain.save + + exp_date = domain.valid_to.to_date + xml = @epp_xml.domain.renew( + name: { value: domain.name }, + curExpDate: { value: exp_date.to_s }, + period: { value: '1', attrs: { unit: 'y' } } + ) + + response = epp_plain_request(xml) + response[:results][0][:msg].should == 'Billing failure - credit balance low' + response[:results][0][:result_code].should == '2104' + + domain.reload + domain.valid_to.should == exp_date # ensure domain was not renewed + + @registrar1.balance.should == old_balance + @registrar1.cash_account.account_activities.count.should == old_activities + f.delete end it 'returns an error when given and current exp dates do not match' do @@ -2078,6 +2411,7 @@ describe 'EPP Domain', epp: true do end it 'should renew a expired domain' do + pending("Please inspect, somehow SERVER_HOLD is false and test fails") domain.valid_to = Time.zone.now - 50.days new_valid_to = domain.valid_to + 1.year domain.outzone_at = Time.zone.now - 50.days @@ -2187,8 +2521,8 @@ describe 'EPP Domain', epp: true do ns1.css('hostName').last.text.should == 'ns1.example.com' ns1.css('hostAddr').first.text.should == '192.168.1.1' ns1.css('hostAddr').last.text.should == '1080:0:0:0:8:800:200C:417A' - inf_data.css('crDate').text.should == domain.created_at.to_time.utc.iso8601 - inf_data.css('exDate').text.should == domain.valid_to.to_time.utc.iso8601 + inf_data.css('crDate').text.should == domain.created_at.in_time_zone.utc.utc.iso8601 + inf_data.css('exDate').text.should == domain.valid_to.in_time_zone.utc.utc.iso8601 inf_data.css('pw').text.should == domain.auth_info ds_data_1 = response[:parsed].css('dsData')[0] @@ -2217,7 +2551,7 @@ describe 'EPP Domain', epp: true do response = epp_plain_request(domain_info_xml(name: { value: domain.name })) inf_data = response[:parsed].css('resData infData') - inf_data.css('upDate').text.should == domain.updated_at.to_time.utc.iso8601 + inf_data.css('upDate').text.should == domain.updated_at.in_time_zone.utc.utc.iso8601 end it 'returns domain info with different nameservers' do diff --git a/spec/epp/epp_helper_spec.rb b/spec/epp/epp_helper_spec.rb index 65a9fcc8d..7b85a1ab1 100644 --- a/spec/epp/epp_helper_spec.rb +++ b/spec/epp/epp_helper_spec.rb @@ -10,7 +10,7 @@ describe 'EPP Helper', epp: true do expected = Nokogiri::XML(' - + ' + dn + ' diff --git a/spec/epp/keyrelay_spec.rb b/spec/epp/keyrelay_spec.rb index 75bb253ad..b952ab523 100644 --- a/spec/epp/keyrelay_spec.rb +++ b/spec/epp/keyrelay_spec.rb @@ -121,31 +121,32 @@ describe 'EPP Keyrelay', epp: true do @registrar2.messages.queued.count.should == msg_count end - it 'does not allow both relative and absolute' do - msg_count = @registrar2.messages.queued.count - xml = @epp_xml.keyrelay({ - name: { value: @domain.name }, - keyData: { - flags: { value: '256' }, - protocol: { value: '3' }, - alg: { value: '8' }, - pubKey: { value: 'cmlraXN0aGViZXN0' } - }, - authInfo: { - pw: { value: @domain.auth_info } - }, - expiry: { - relative: { value: 'P1D' }, - absolute: { value: '2014-12-23' } - } - }) + # keyrelay not enabled at the moment + # it 'does not allow both relative and absolute' do + # msg_count = @registrar2.messages.queued.count + # xml = @epp_xml.keyrelay({ + # name: { value: @domain.name }, + # keyData: { + # flags: { value: '256' }, + # protocol: { value: '3' }, + # alg: { value: '8' }, + # pubKey: { value: 'cmlraXN0aGViZXN0' } + # }, + # authInfo: { + # pw: { value: @domain.auth_info } + # }, + # expiry: { + # relative: { value: 'P1D' }, + # absolute: { value: '2014-12-23' } + # } + # }) - response = epp_plain_request(xml, :xml) - response[:msg].should == 'Exactly one parameter required: keyrelay > expiry > relative OR '\ - 'keyrelay > expiry > absolute' + # response = epp_plain_request(xml, :xml) + # response[:msg].should == 'Exactly one parameter required: keyrelay > expiry > relative OR '\ + # 'keyrelay > expiry > absolute' - @registrar2.messages.queued.count.should == msg_count - end + # @registrar2.messages.queued.count.should == msg_count + # end it 'saves legal document with keyrelay' do xml = @epp_xml.keyrelay({ diff --git a/spec/epp/poll_spec.rb b/spec/epp/poll_spec.rb index 7442ff21f..aceb22c3b 100644 --- a/spec/epp/poll_spec.rb +++ b/spec/epp/poll_spec.rb @@ -87,7 +87,8 @@ describe 'EPP Poll', epp: true do }) response = epp_plain_request(xml, validate_input: false) - response[:msg].should == 'Attribute is invalid: op' + response[:msg].should == 'Parameter value range error: op' + response[:result_code].should == '2004' end it 'dequeues multiple messages' do diff --git a/spec/epp/session_spec.rb b/spec/epp/session_spec.rb index b1ad5d136..7573ea015 100644 --- a/spec/epp/session_spec.rb +++ b/spec/epp/session_spec.rb @@ -25,7 +25,7 @@ describe 'EPP Session', epp: true do it 'does not log in with invalid user' do wrong_user = @epp_xml.session.login(clID: { value: 'wrong-user' }, pw: { value: 'ghyt9e4fu' }) response = epp_plain_request(wrong_user) - response[:msg].should == 'Authentication error; server closing connection' + response[:msg].should == 'Authentication error; server closing connection (API user not found)' response[:result_code].should == '2501' response[:clTRID].should == 'ABC-12345' end @@ -36,7 +36,7 @@ describe 'EPP Session', epp: true do inactive = @epp_xml.session.login(clID: { value: 'inactive-user' }, pw: { value: 'ghyt9e4fu' }) response = epp_plain_request(inactive) - response[:msg].should == 'Authentication error; server closing connection' + response[:msg].should == 'Authentication error; server closing connection (API user is not active)' response[:result_code].should == '2501' end @@ -133,21 +133,6 @@ describe 'EPP Session', epp: true do @api_user.reload @api_user.password.should == 'ghyt9e4fu' end - - it 'fails if new password is not valid' do - @api_user.update(password: 'ghyt9e4fu') - response = epp_plain_request(@epp_xml.session.login( - clID: { value: 'gitlab' }, - pw: { value: 'ghyt9e4fu' }, - newPW: { value: '' } - ), validate_input: false) - - response[:msg].should == 'Password is missing [password]' - response[:result_code].should == '2306' - - @api_user.reload - @api_user.password.should == 'ghyt9e4fu' - end end end end diff --git a/spec/fabricators/blocked_domain_fabricator.rb b/spec/fabricators/blocked_domain_fabricator.rb new file mode 100644 index 000000000..363cc0526 --- /dev/null +++ b/spec/fabricators/blocked_domain_fabricator.rb @@ -0,0 +1,3 @@ +Fabricator(:blocked_domain) do + names ['ftp.ee', 'cache.ee'] +end diff --git a/spec/fabricators/pricelist_fabricator.rb b/spec/fabricators/pricelist_fabricator.rb index 296c3b5fb..36e24b0c8 100644 --- a/spec/fabricators/pricelist_fabricator.rb +++ b/spec/fabricators/pricelist_fabricator.rb @@ -1,8 +1,8 @@ Fabricator(:pricelist) do valid_from 1.year.ago valid_to 1.year.since - category '.ee' + category 'ee' duration '1year' - operation_category 'new' + operation_category 'create' price 10 end diff --git a/spec/fabricators/reserved_domain_fabricator.rb b/spec/fabricators/reserved_domain_fabricator.rb index f14948902..672fa3e53 100644 --- a/spec/fabricators/reserved_domain_fabricator.rb +++ b/spec/fabricators/reserved_domain_fabricator.rb @@ -1,3 +1,3 @@ Fabricator(:reserved_domain) do - name '1162.ee' + names { { '1162.ee': 'abc' } } end diff --git a/spec/features/admin/bank_statement_spec.rb b/spec/features/admin/bank_statement_spec.rb new file mode 100644 index 000000000..bca3136fb --- /dev/null +++ b/spec/features/admin/bank_statement_spec.rb @@ -0,0 +1,52 @@ +require 'rails_helper' + +feature 'BankStatement', type: :feature do + before :all do + @user = Fabricate(:admin_user) + end + + before do + sign_in @user + end + + it 'should add a bank statement and transactions manually' do + visit admin_bank_statements_url + + click_link 'Add' + fill_in 'Bank code', with: '767' + fill_in 'Iban', with: 'EE557700771000598731' + click_button 'Save' + + page.should have_content('Record created') + page.should have_content('Bank statement ') + page.should have_content('767') + page.should have_content('EE557700771000598731') + page.should have_content('Not binded') + + click_link 'Add' + fill_in 'Description', with: 'Payment 12345' + fill_in 'Sum', with: '120' + fill_in 'Reference no', with: 'RF4663930489' + fill_in 'Document no', with: '123' + fill_in 'Bank reference', with: '767' + fill_in 'Iban', with: 'EE557700771000598731' + fill_in 'Buyer bank code', with: '767' + fill_in 'Buyer iban', with: 'EE557700771000598000' + fill_in 'Buyer name', with: 'Test buyer' + fill_in 'Paid at', with: '2015-01-01' + + click_button 'Save' + + page.should have_content('Record created') + page.should have_content('Bank transaction') + page.should have_content('RF4663930489') + page.should have_content('EE557700771000598000') + page.should have_content('Not binded') + page.should have_content('Bind manually') + + click_link 'Back to bank statement' + + page.should have_content('120.0') + page.should have_content('Test buyer') + end +end diff --git a/spec/features/admin/blocked_domain_spec.rb b/spec/features/admin/blocked_domain_spec.rb new file mode 100644 index 000000000..3c12a298c --- /dev/null +++ b/spec/features/admin/blocked_domain_spec.rb @@ -0,0 +1,30 @@ +require 'rails_helper' + +feature 'BlockedDomain', type: :feature do + before :all do + @user = Fabricate(:admin_user) + end + + before do + sign_in @user + end + + it 'should manage blocked domains' do + visit admin_blocked_domains_url + page.should have_content('Blocked domains') + + d = Fabricate.build(:domain, name: 'ftp.ee') + d.valid? + d.errors.full_messages.should match_array([]) + + fill_in 'blocked_domains', with: "ftp.ee\ncache.ee" + click_button 'Save' + + page.should have_content('Record updated') + page.should have_content('ftp.ee') + page.should have_content('cache.ee') + + d.valid? + d.errors.full_messages.should match_array(["Domain name Domain name is blocked"]) + end +end diff --git a/spec/features/admin/invoice_spec.rb b/spec/features/admin/invoice_spec.rb index dd6fff2f2..91e29afab 100644 --- a/spec/features/admin/invoice_spec.rb +++ b/spec/features/admin/invoice_spec.rb @@ -3,24 +3,60 @@ require 'rails_helper' feature 'Invoice', type: :feature do before :all do @user = Fabricate(:admin_user) - Fabricate(:invoice) + @invoice = Fabricate(:invoice) + end + + before do + sign_in @user end it 'should show index of invoices' do - sign_in @user visit admin_invoices_url - i = Invoice.first - page.should have_link("Invoice no. #{i.id}") + page.should have_link("Invoice no. #{@invoice.id}") end it 'should show invoice' do - sign_in @user visit admin_invoices_url - i = Invoice.first - click_link("Invoice no. #{i.id}") + click_link("Invoice no. #{@invoice.id}") page.should have_content("Seller") page.should have_content("Details") page.should have_content("Paldiski mnt. 123") end + + it 'should issue an invoice' do + Fabricate(:eis) + r = Fabricate(:registrar) + visit admin_invoices_url + click_link('Add') + page.should have_content('Create new invoice') + select r.name, from: 'Registrar' + fill_in 'Amount', with: '100' + fill_in 'Description', with: 'test issue' + click_button 'Save' + page.should have_content('Record created') + page.should have_content('Invoice no.') + page.should have_content('Prepayment') + page.should have_content('120.0') + page.should have_content(r.name) + end + + it 'should forward invoice' do + visit '/admin/invoices' + click_link @invoice.to_s + click_link 'Forward' + click_button 'Forward' + page.should have_text('Failed to forward invoice') + fill_in 'Billing email', with: 'test@test.ee' + click_button 'Forward' + page.should have_text('Invoice forwarded') + end + + it 'should download invoice' do + visit '/admin/invoices' + click_link @invoice.to_s + click_link 'Download' + response_headers['Content-Type'].should == 'application/pdf' + response_headers['Content-Disposition'].should == "attachment; filename=\"#{@invoice.pdf_name}\"" + end end diff --git a/spec/features/admin/reserved_domain_spec.rb b/spec/features/admin/reserved_domain_spec.rb new file mode 100644 index 000000000..9c780285f --- /dev/null +++ b/spec/features/admin/reserved_domain_spec.rb @@ -0,0 +1,43 @@ +require 'rails_helper' + +feature 'ReservedDomain', type: :feature do + before :all do + @user = Fabricate(:admin_user) + end + + before do + sign_in @user + end + + it 'should manage reserved domains' do + visit admin_reserved_domains_url + page.should have_content('Reserved domains') + + d = Fabricate.build(:domain, name: '110.ee') + d.valid? + d.errors.full_messages.should match_array([]) + + fill_in 'reserved_domains', with: "110.ee: testpw" + click_button 'Save' + + page.should have_content('Record updated') + page.should have_content('110.ee: testpw') + + d.valid?.should == false + d.errors.full_messages.should match_array( + ["Required parameter missing; reserved>pw element required for reserved domains"] + ) + + d.reserved_pw = 'wrongpw' + d.valid?.should == false + + d.reserved_pw = 'testpw' + d.valid?.should == true + d.errors.full_messages.should match_array([]) + + d.save + visit admin_reserved_domains_url + page.should have_content('110.ee') + page.should_not have_content('110.ee: testpw') + end +end diff --git a/spec/features/registrar/account_activity_spec.rb b/spec/features/registrar/account_activity_spec.rb index e2bc3be3a..a9cc9c59e 100644 --- a/spec/features/registrar/account_activity_spec.rb +++ b/spec/features/registrar/account_activity_spec.rb @@ -27,5 +27,12 @@ feature 'Account activity', type: :feature do current_path.should == '/registrar/account_activities' page.should have_text('+110.0 EUR') end + + it 'should download csv' do + visit '/registrar/account_activities' + click_link 'Export CSV' + response_headers['Content-Type'].should == 'text/csv' + response_headers['Content-Disposition'].should match(/attachment; filename="account_activities_\d+\.csv"/) + end end end diff --git a/spec/features/registrar/sessions_spec.rb b/spec/features/registrar/sessions_spec.rb index 5d5f3095a..07db0774a 100644 --- a/spec/features/registrar/sessions_spec.rb +++ b/spec/features/registrar/sessions_spec.rb @@ -8,6 +8,14 @@ feature 'Sessions', type: :feature do page.should have_text('Access denied') end + it 'should see login page when whitelist disabled' do + Setting.registrar_ip_whitelist_enabled = false + WhiteIp.destroy_all + visit registrar_login_path + page.should_not have_text('Access denied') + Setting.registrar_ip_whitelist_enabled = true + end + it 'should see log in' do @fixed_registrar.white_ips = [Fabricate(:white_ip_registrar)] visit registrar_login_path @@ -26,6 +34,20 @@ feature 'Sessions', type: :feature do page.should have_text('Access denied') end + it 'should get in with invalid when whitelist disabled' do + Setting.registrar_ip_whitelist_enabled = false + Fabricate(:registrar, white_ips: [Fabricate(:white_ip), Fabricate(:white_ip_registrar)]) + @api_user_invalid_ip = Fabricate( + :api_user, identity_code: '37810013294', registrar: Fabricate(:registrar, white_ips: []) + ) + visit registrar_login_path + fill_in 'depp_user_tag', with: @api_user_invalid_ip.username + fill_in 'depp_user_password', with: @api_user_invalid_ip.password + click_button 'Log in' + page.should have_text('Log out') + Setting.registrar_ip_whitelist_enabled = true + end + it 'should not get in with invalid user' do visit registrar_login_path fill_in 'depp_user_tag', with: 'bla' @@ -114,7 +136,7 @@ feature 'Sessions', type: :feature do fill_in 'user_phone', with: '00007' click_button 'Log in' - page.should have_text('Check your phone for confirmation code') + page.should have_text('Confirmation sms was sent to your phone. Verification code is') page.should have_text('SIM application error') end @@ -143,7 +165,7 @@ feature 'Sessions', type: :feature do fill_in 'user_phone', with: '00007' click_button 'Log in' - page.should have_text('Check your phone for confirmation code') + page.should have_text('Confirmation sms was sent to your phone. Verification code is') page.should have_text('Welcome!') end diff --git a/spec/mailers/domain_mailer_spec.rb b/spec/mailers/domain_mailer_spec.rb index 75c0640cd..ada60a741 100644 --- a/spec/mailers/domain_mailer_spec.rb +++ b/spec/mailers/domain_mailer_spec.rb @@ -54,7 +54,7 @@ describe DomainMailer do end it 'should render verification url' do - @mail.body.encoded.should =~ /registrant\/domain_update_confirms/ + @mail.body.encoded.should =~ %r{registrant\/domain_update_confirms} end end @@ -109,7 +109,32 @@ describe DomainMailer do end it 'should render verification url' do - @mail.body.encoded.should =~ /registrant\/domain_delete_con/ # somehowe delete_confirms not matching + @mail.body.encoded.should =~ %r{registrant\/domain_delete_con} # somehowe delete_confirms not matching + end + end + + describe 'registrant successfully changed confirmation' do + before :all do + @registrant = Fabricate(:registrant, email: 'test@example.com') + @domain = Fabricate(:domain, registrant: @registrant) + @domain.deliver_emails = true + @mail = DomainMailer.registrant_updated(@domain) + end + + it 'should render email subject' do + @mail.subject.should =~ /registreerija vahetus teostatud/ + end + + it 'should have sender email' do + @mail.from.should == ["noreply@internet.ee"] + end + + it 'should send to registrant email' do + @mail.to.should == ["test@example.com"] + end + + it 'should render body' do + @mail.body.encoded.should =~ /registreerija vahetuse taotlus on kinnitatud/ end end end diff --git a/spec/models/bank_statement_spec.rb b/spec/models/bank_statement_spec.rb index ed9a0218e..77ffffd1e 100644 --- a/spec/models/bank_statement_spec.rb +++ b/spec/models/bank_statement_spec.rb @@ -12,8 +12,7 @@ describe BankStatement do @bank_statement.valid? @bank_statement.errors.full_messages.should match_array([ "Bank code is missing", - "Iban is missing", - "Queried at is missing" + "Iban is missing" ]) end @@ -63,6 +62,11 @@ describe BankStatement do AccountActivity.count.should == 1 + a = AccountActivity.last + a.description.should == "Invoice no. #{invoice.number}" + a.sum.should == BigDecimal.new('200.0') + a.activity_type = AccountActivity::ADD_CREDIT + r.cash_account.balance.should == 200.0 bs.bank_transactions.unbinded.count.should == 1 diff --git a/spec/models/blocked_domain_spec.rb b/spec/models/blocked_domain_spec.rb new file mode 100644 index 000000000..58bc1fdd3 --- /dev/null +++ b/spec/models/blocked_domain_spec.rb @@ -0,0 +1,34 @@ +require 'rails_helper' + +describe BlockedDomain do + context 'with no attributes' do + before :all do + @blocked_domain = BlockedDomain.new + end + + it 'should have names array' do + @blocked_domain.names.should == [] + end + end + + context 'with valid attributes' do + before :all do + @blocked_domain = Fabricate(:blocked_domain) + end + + it 'should be valid' do + @blocked_domain.valid? + @blocked_domain.errors.full_messages.should match_array([]) + end + + it 'should have one version' do + with_versioning do + @blocked_domain.versions.should == [] + @blocked_domain.names = ['bla.ee'] + @blocked_domain.save + @blocked_domain.errors.full_messages.should match_array([]) + @blocked_domain.versions.size.should == 1 + end + end + end +end diff --git a/spec/models/dnskey_spec.rb b/spec/models/dnskey_spec.rb index 911713da5..a7ddfece4 100644 --- a/spec/models/dnskey_spec.rb +++ b/spec/models/dnskey_spec.rb @@ -49,7 +49,7 @@ describe Dnskey do dk = d.dnskeys.last dk.generate_digest - dk.ds_digest.should == '0B62D1BC64EFD1EE652FB102BDF1011BF514CCD9A1A0CFB7472AEA3B01F38C92' + dk.ds_digest.should == '0B62D1BC64EFD1EE652FB102BDF1011BF514CCD9A1A0CFB7472AEA3B01F38C92' dk.ds_key_tag.should == '30607' end diff --git a/spec/models/domain_spec.rb b/spec/models/domain_spec.rb index 380b907e5..4546ef580 100644 --- a/spec/models/domain_spec.rb +++ b/spec/models/domain_spec.rb @@ -94,6 +94,30 @@ describe Domain do @domain.registrant_update_confirmable?('123').should == false end + it 'should not find any domain pendings to clean' do + Domain.clean_expired_pendings.should == 0 + end + + it 'should not find any domains with wrong pendings' do + domain = Fabricate(:domain) + domain.registrant_verification_asked!('frame-str', '1') + domain.registrant_verification_asked_at = 30.days.ago + domain.save + + Domain.clean_expired_pendings.should == 0 + end + + it 'should clean domain pendings' do + domain = Fabricate(:domain) + domain.registrant_verification_asked!('frame-str', '1') + domain.registrant_verification_asked_at = 30.days.ago + domain.pending_delete! + + Domain.clean_expired_pendings.should == 1 + domain.reload.pending_delete?.should == false + domain.pending_json.should == {} + end + it 'should expire domains' do Domain.start_expire_period @domain.statuses.include?(DomainStatus::EXPIRED).should == false @@ -182,6 +206,128 @@ describe Domain do @domain.force_delete_at.should be_nil end + it 'should set expired status and update outzone_at and delete_at' do + domain = Fabricate(:domain) + domain.statuses.should == ['ok'] + domain.set_expired + domain.changes.keys.should == ['statuses', 'outzone_at', 'delete_at'] + domain.save + + domain.statuses.should == ['expired'] + end + + it 'should know its create price' do + Fabricate(:pricelist, { + category: 'ee', + operation_category: 'create', + duration: '1year', + price: 1.50, + valid_from: Time.zone.parse('2015-01-01'), + valid_to: nil + }) + + domain = Fabricate(:domain) + domain.pricelist('create').price.amount.should == 1.50 + + domain = Fabricate(:domain, period: 12, period_unit: 'm') + domain.pricelist('create').price.amount.should == 1.50 + + domain = Fabricate(:domain, period: 365, period_unit: 'd') + domain.pricelist('create').price.amount.should == 1.50 + + Fabricate(:pricelist, { + category: 'ee', + operation_category: 'create', + duration: '2years', + price: 3, + valid_from: Time.zone.parse('2015-01-01'), + valid_to: nil + }) + + domain = Fabricate(:domain, period: 2) + domain.pricelist('create').price.amount.should == 3.0 + + domain = Fabricate(:domain, period: 24, period_unit: 'm') + domain.pricelist('create').price.amount.should == 3.0 + + domain = Fabricate(:domain, period: 730, period_unit: 'd') + domain.pricelist('create').price.amount.should == 3.0 + + Fabricate(:pricelist, { + category: 'ee', + operation_category: 'create', + duration: '3years', + price: 6, + valid_from: Time.zone.parse('2015-01-01'), + valid_to: nil + }) + + domain = Fabricate(:domain, period: 3) + domain.pricelist('create').price.amount.should == 6.0 + + domain = Fabricate(:domain, period: 36, period_unit: 'm') + domain.pricelist('create').price.amount.should == 6.0 + + domain = Fabricate(:domain, period: 1095, period_unit: 'd') + domain.pricelist('create').price.amount.should == 6.0 + end + + it 'should know its renew price' do + Fabricate(:pricelist, { + category: 'ee', + operation_category: 'renew', + duration: '1year', + price: 1.30, + valid_from: Time.zone.parse('2015-01-01'), + valid_to: nil + }) + + domain = Fabricate(:domain) + domain.pricelist('renew').price.amount.should == 1.30 + + domain = Fabricate(:domain, period: 12, period_unit: 'm') + domain.pricelist('renew').price.amount.should == 1.30 + + domain = Fabricate(:domain, period: 365, period_unit: 'd') + domain.pricelist('renew').price.amount.should == 1.30 + + Fabricate(:pricelist, { + category: 'ee', + operation_category: 'renew', + duration: '2years', + price: 3.1, + valid_from: Time.zone.parse('2015-01-01'), + valid_to: nil + }) + + domain = Fabricate(:domain, period: 2) + domain.pricelist('renew').price.amount.should == 3.1 + + domain = Fabricate(:domain, period: 24, period_unit: 'm') + domain.pricelist('renew').price.amount.should == 3.1 + + domain = Fabricate(:domain, period: 730, period_unit: 'd') + domain.pricelist('renew').price.amount.should == 3.1 + + Fabricate(:pricelist, { + category: 'ee', + operation_category: 'renew', + duration: '3years', + price: 6.1, + valid_from: Time.zone.parse('2015-01-01'), + valid_to: nil + }) + + domain = Fabricate(:domain, period: 3) + domain.pricelist('renew').price.amount.should == 6.1 + + domain = Fabricate(:domain, period: 36, period_unit: 'm') + domain.pricelist('renew').price.amount.should == 6.1 + + domain = Fabricate(:domain, period: 1095, period_unit: 'd') + domain.pricelist('renew').price.amount.should == 6.1 + end + context 'about registrant update confirm' do before :all do @domain.registrant_verification_token = 123 diff --git a/spec/models/invoice_spec.rb b/spec/models/invoice_spec.rb index 54a640d2d..b4f1d3908 100644 --- a/spec/models/invoice_spec.rb +++ b/spec/models/invoice_spec.rb @@ -71,7 +71,7 @@ describe Invoice do end it 'should cancel overdue invoices' do - Fabricate(:invoice, created_at: Time.zone.now - 35.days, due_date: Time.zone.now - 1.days) + Fabricate(:invoice, created_at: Time.zone.now - 35.days, due_date: Time.zone.now - 30.days) Invoice.cancel_overdue_invoices Invoice.where(cancelled_at: nil).count.should == 1 end diff --git a/spec/models/pricelist_spec.rb b/spec/models/pricelist_spec.rb index f52b1aeeb..f2c155846 100644 --- a/spec/models/pricelist_spec.rb +++ b/spec/models/pricelist_spec.rb @@ -15,8 +15,8 @@ describe Pricelist do it 'should not be valid' do @pricelist.valid? @pricelist.errors.full_messages.should match_array([ - "Category is missing", - "Duration is missing", + "Category is missing", + "Duration is missing", "Operation category is missing" ]) end @@ -36,7 +36,6 @@ describe Pricelist do it 'should not have name' do @pricelist.name.should == ' ' end - end context 'with valid attributes' do @@ -56,7 +55,7 @@ describe Pricelist do end it 'should have name' do - @pricelist.name.should == 'new .ee' + @pricelist.name.should == 'create ee' end it 'should have one version' do @@ -69,4 +68,107 @@ describe Pricelist do end end end + + it 'should return correct price' do + Pricelist.pricelist_for('ee', 'create', '1year').should == nil + + Fabricate(:pricelist, { + category: 'ee', + operation_category: 'create', + duration: '1year', + price: 1.50, + valid_from: Time.zone.parse('2198-01-01'), + valid_to: Time.zone.parse('2199-01-01') + }) + + Pricelist.pricelist_for('ee', 'create', '1year').should == nil + + Fabricate(:pricelist, { + category: 'ee', + operation_category: 'create', + duration: '1year', + price: 1.50, + valid_from: Time.zone.parse('2015-01-01'), + valid_to: nil + }) + + Pricelist.pricelist_for('ee', 'create', '1year').price.amount.should == 1.50 + + Fabricate(:pricelist, { + category: 'ee', + operation_category: 'create', + duration: '1year', + price: 1.30, + valid_from: Time.zone.parse('2015-01-01'), + valid_to: Time.zone.parse('2999-01-01') + }) + + Pricelist.pricelist_for('ee', 'create', '1year').price.amount.should == 1.30 + + Fabricate.create(:pricelist, { + category: 'ee', + operation_category: 'create', + duration: '1year', + price: 1.20, + valid_from: Time.zone.parse('2015-06-01'), + valid_to: Time.zone.parse('2999-01-01') + }) + + Pricelist.pricelist_for('ee', 'create', '1year').price.amount.should == 1.20 + + Fabricate.create(:pricelist, { + category: 'ee', + operation_category: 'create', + duration: '1year', + price: 1.10, + valid_from: Time.zone.parse('2014-01-01'), + valid_to: Time.zone.parse('2999-01-01') + }) + + Pricelist.pricelist_for('ee', 'create', '1year').price.amount.should == 1.20 + + Fabricate.create(:pricelist, { + category: 'ee', + operation_category: 'create', + duration: '1year', + price: 1.10, + valid_from: Time.zone.parse('2999-02-01'), + valid_to: Time.zone.parse('2999-01-01') + }) + + Pricelist.pricelist_for('ee', 'create', '1year').price.amount.should == 1.20 + + Fabricate.create(:pricelist, { + category: 'ee', + operation_category: 'create', + duration: '1year', + price: 1.10, + valid_from: Time.zone.parse('2015-06-02'), + valid_to: nil + }) + + Pricelist.pricelist_for('ee', 'create', '1year').price.amount.should == 1.20 + + Fabricate.create(:pricelist, { + category: 'ee', + operation_category: 'create', + duration: '1year', + price: 1.10, + valid_from: Time.zone.parse('2015-07-01'), + valid_to: Time.zone.parse('2999-01-01') + }) + + Pricelist.pricelist_for('ee', 'create', '1year').price.amount.should == 1.10 + + Fabricate.create(:pricelist, { + category: 'ee', + operation_category: 'create', + duration: '2years', + price: 1.20, + valid_from: Time.zone.parse('2015-07-01'), + valid_to: Time.zone.parse('2999-01-01') + }) + + Pricelist.pricelist_for('ee', 'create', '2years').price.amount.should == 1.20 + end end diff --git a/spec/models/registrar_spec.rb b/spec/models/registrar_spec.rb index c169a5b73..98219bf85 100644 --- a/spec/models/registrar_spec.rb +++ b/spec/models/registrar_spec.rb @@ -144,5 +144,22 @@ describe Registrar do it 'should not have priv contacts' do @registrar.priv_contacts.size.should == 0 end + + it 'should credit and debit registrar cash account' do + @registrar.credit!({ sum: 13.32, description: 'Add money' }) + @registrar.balance.should == BigDecimal.new('13.32') + @registrar.cash_account.account_activities.count.should == 1 + a = @registrar.cash_account.account_activities.last + a.description.should == 'Add money' + a.sum.should == BigDecimal.new('13.32') + a.log_pricelist_id.should == nil + + @registrar.debit!({ sum: 10.31, description: 'Remove money' }) + @registrar.balance.should == BigDecimal.new('3.01') + @registrar.cash_account.account_activities.count.should == 2 + a = @registrar.cash_account.account_activities.last + a.description.should == 'Remove money' + a.sum.should == -BigDecimal.new('10.31') + end end end diff --git a/spec/support/epp.rb b/spec/support/epp.rb index 5e9847d48..698284735 100644 --- a/spec/support/epp.rb +++ b/spec/support/epp.rb @@ -144,7 +144,7 @@ module Epp end # rubocop: disable Metrics/MethodLength - def domain_create_xml(xml_params = {}, dnssec_params = {}) + def domain_create_xml(xml_params = {}, dnssec_params = {}, custom_params = {}) defaults = { name: { value: next_domain_name }, period: { value: '1', attrs: { unit: 'y' } }, @@ -185,7 +185,7 @@ module Epp dnssec_params = dnssec_defaults.deep_merge(dnssec_params) if dnssec_params != false - custom_params = { + custom_defaults = { _anonymus: [ legalDocument: { value: 'dGVzdCBmYWlsCg==', @@ -194,6 +194,8 @@ module Epp ] } + custom_params = custom_defaults.deep_merge(custom_params) if custom_params != false + epp_xml = EppXml::Domain.new(cl_trid: 'ABC-12345') epp_xml.create(xml_params, dnssec_params, custom_params) end @@ -347,7 +349,7 @@ module Epp epp_xml.check(xml_params) end - def domain_transfer_xml(xml_params = {}, op = 'query', custom_params = {}) + def domain_transfer_xml(xml_params = {}, op = 'request', custom_params = {}) defaults = { name: { value: next_domain_name }, authInfo: {