From 87fe23003570e9514f3d1988150b36e0ecf23620 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Mon, 7 Sep 2020 16:12:47 +0500 Subject: [PATCH 01/79] Add default email validation type to application.yml --- config/application.yml.sample | 3 +++ config/initializers/truemail.rb | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/config/application.yml.sample b/config/application.yml.sample index d5753adb6..478af216f 100644 --- a/config/application.yml.sample +++ b/config/application.yml.sample @@ -156,6 +156,9 @@ lhv_dev_mode: 'false' epp_session_timeout_seconds: '300' +# Email validation setting for Truemail gem. Possible values: 'regex', 'mx', 'smtp' +default_email_validation_type: 'regex' + # Since the keys for staging are absent from the repo, we need to supply them separate for testing. test: payments_seb_bank_certificate: 'test/fixtures/files/seb_bank_cert.pem' diff --git a/config/initializers/truemail.rb b/config/initializers/truemail.rb index f4517fbc0..badc0cc82 100644 --- a/config/initializers/truemail.rb +++ b/config/initializers/truemail.rb @@ -28,7 +28,10 @@ Truemail.configure do |config| # Optional parameter. You can predefine default validation type for # Truemail.validate('email@email.com') call without with-parameter # Available validation types: :regex, :mx, :smtp - if Rails.env.production? + if ENV['default_email_validation_type'].present? && + %w[regex, mx, smtp].include?(ENV['default_email_validation_type']) + config.default_validation_type = ENV['default_email_validation_type'].to_sym + elsif Rails.env.production? config.default_validation_type = :mx else config.default_validation_type = :regex From 9d9667457644c5a6cfbaaf15e9208b5d92decb9b Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Wed, 4 Sep 2019 00:10:22 +0300 Subject: [PATCH 02/79] Remove outdated doc --- doc/testing.md | 120 ------------------------------------------------- 1 file changed, 120 deletions(-) delete mode 100644 doc/testing.md diff --git a/doc/testing.md b/doc/testing.md deleted file mode 100644 index 81f208edd..000000000 --- a/doc/testing.md +++ /dev/null @@ -1,120 +0,0 @@ -Testing -------- - -Setup test databases: - - RAILS_ENV=test rake db:setup:all - -Run basic test (no EPP tests): - - rake - - -Testing EPP -=========== - -In order to test EPP, you have to configure apache to handle EPP request correctly. - -### Apache site config - -First you should have mod_epp installed, please follow main README for doing it. - -Apache site config for autotest, add file to /etc/apache2/sites-enabled/epp-autotest.conf - -```apache - - Listen 701 - - SSLEngine on - SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL - SSLCertificateFile /etc/apache2/ssl/apache.crt - SSLCertificateKeyFile /etc/apache2/ssl/apache.key - - SSLVerifyClient optional_no_ca - - EPPEngine On - EPPCommandRoot /proxy/command - EPPSessionRoot /proxy/session - EPPErrorRoot /proxy/error - EPPRawFrame raw_frame - - ProxyPass /proxy/ http://localhost:8989/epp/ - - EPPAuthURI implicit - EPPReturncodeHeader X-EPP-Returncode - - -``` - - - -* Run all tests with temp server running automatically on port 8989: - - rake test - - -Manual debugging -================ - -### Apache mod_epp manual debugging - -Debugging Apache mod_epp without Registry app. - - sudo apt-get install apache2-dbg - -Includes htpasswd command to generate authentication files - - sudo apt-get install apache2-utils - -For manual debugging purposes, standalone CGI scripts can be used: -This needs a static greeting file, so you will have to make /var/www writable. - -```apache - - - Options ExecCGI - SetHandler cgi-script - - - Listen 1700 - - - EPPEngine On - EPPCommandRoot /cgi-bin/epp/command - EPPSessionRoot /cgi-bin/epp/session - EPPErrorRoot /cgi-bin/epp/error - - Alias /cgi-bin/epp/session/hello /var/www/html/epp/session-hello - - Alias /cgi-bin/epp/session/login /usr/lib/cgi-bin/epp/session-login - Alias /cgi-bin/epp/session/logout /usr/lib/cgi-bin/epp/session-logout - Alias /cgi-bin/epp/error/schema /usr/lib/cgi-bin/epp/error-schema - Alias /cgi-bin/epp/command/create /usr/lib/cgi-bin/epp/create - Alias /cgi-bin/epp/command/info /usr/lib/cgi-bin/epp/info - - EPPAuthURI /epp/auth/login - - AuthType Basic - AuthName "EPP" - AuthUserFile /etc/apache2/htpasswd - require valid-user - - - -``` - - sudo a2enmod cgi - sudo a2enmod authn_file # will be used for non implicit authentication URIs - sudo htpasswd -c /etc/apache2/htpasswd test - Type "test" when prompted - cd /usr/lib/cgi-bin - mkdir epp - -Copy the files from $mod_epp/examples/cgis to /usr/lib/cgi-bin/epp - - -Allowed testing email list -========================== - -All allowed testing emails are located under config/initialized/settings.rb file. - From ccdbadd9382bdae34e0515734e36a0ebbb995324 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Fri, 18 Sep 2020 12:24:09 +0500 Subject: [PATCH 03/79] Revert "Remove outdated doc" This reverts commit e728fac7d0b7be2158e25b11adf0b197c9b850dc. --- doc/testing.md | 120 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 doc/testing.md diff --git a/doc/testing.md b/doc/testing.md new file mode 100644 index 000000000..81f208edd --- /dev/null +++ b/doc/testing.md @@ -0,0 +1,120 @@ +Testing +------- + +Setup test databases: + + RAILS_ENV=test rake db:setup:all + +Run basic test (no EPP tests): + + rake + + +Testing EPP +=========== + +In order to test EPP, you have to configure apache to handle EPP request correctly. + +### Apache site config + +First you should have mod_epp installed, please follow main README for doing it. + +Apache site config for autotest, add file to /etc/apache2/sites-enabled/epp-autotest.conf + +```apache + + Listen 701 + + SSLEngine on + SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL + SSLCertificateFile /etc/apache2/ssl/apache.crt + SSLCertificateKeyFile /etc/apache2/ssl/apache.key + + SSLVerifyClient optional_no_ca + + EPPEngine On + EPPCommandRoot /proxy/command + EPPSessionRoot /proxy/session + EPPErrorRoot /proxy/error + EPPRawFrame raw_frame + + ProxyPass /proxy/ http://localhost:8989/epp/ + + EPPAuthURI implicit + EPPReturncodeHeader X-EPP-Returncode + + +``` + + + +* Run all tests with temp server running automatically on port 8989: + + rake test + + +Manual debugging +================ + +### Apache mod_epp manual debugging + +Debugging Apache mod_epp without Registry app. + + sudo apt-get install apache2-dbg + +Includes htpasswd command to generate authentication files + + sudo apt-get install apache2-utils + +For manual debugging purposes, standalone CGI scripts can be used: +This needs a static greeting file, so you will have to make /var/www writable. + +```apache + + + Options ExecCGI + SetHandler cgi-script + + + Listen 1700 + + + EPPEngine On + EPPCommandRoot /cgi-bin/epp/command + EPPSessionRoot /cgi-bin/epp/session + EPPErrorRoot /cgi-bin/epp/error + + Alias /cgi-bin/epp/session/hello /var/www/html/epp/session-hello + + Alias /cgi-bin/epp/session/login /usr/lib/cgi-bin/epp/session-login + Alias /cgi-bin/epp/session/logout /usr/lib/cgi-bin/epp/session-logout + Alias /cgi-bin/epp/error/schema /usr/lib/cgi-bin/epp/error-schema + Alias /cgi-bin/epp/command/create /usr/lib/cgi-bin/epp/create + Alias /cgi-bin/epp/command/info /usr/lib/cgi-bin/epp/info + + EPPAuthURI /epp/auth/login + + AuthType Basic + AuthName "EPP" + AuthUserFile /etc/apache2/htpasswd + require valid-user + + + +``` + + sudo a2enmod cgi + sudo a2enmod authn_file # will be used for non implicit authentication URIs + sudo htpasswd -c /etc/apache2/htpasswd test + Type "test" when prompted + cd /usr/lib/cgi-bin + mkdir epp + +Copy the files from $mod_epp/examples/cgis to /usr/lib/cgi-bin/epp + + +Allowed testing email list +========================== + +All allowed testing emails are located under config/initialized/settings.rb file. + From 9e18de564cf578a103702778574a2e775f7f8115 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Fri, 18 Sep 2020 12:33:00 +0500 Subject: [PATCH 04/79] Update testing.md to reflect current test approach --- doc/testing.md | 107 ++++--------------------------------------------- 1 file changed, 8 insertions(+), 99 deletions(-) diff --git a/doc/testing.md b/doc/testing.md index 81f208edd..efa534887 100644 --- a/doc/testing.md +++ b/doc/testing.md @@ -1,4 +1,4 @@ -Testing +Testing local project without docker container ------- Setup test databases: @@ -10,108 +10,17 @@ Run basic test (no EPP tests): rake -Testing EPP -=========== +Testing using docker container +------- -In order to test EPP, you have to configure apache to handle EPP request correctly. +It's strongly recommended to test/debug registry application using docker containers from https://github.com/internetee/docker-images . +For doing so first setup containers as per docker images documentation (https://github.com/internetee/docker-images/blob/master/README.MD), then in docker images directory run the following: -### Apache site config + docker-compose run registry bundle exec rake RAILS_ENV=test COVERAGE=true -First you should have mod_epp installed, please follow main README for doing it. - -Apache site config for autotest, add file to /etc/apache2/sites-enabled/epp-autotest.conf - -```apache - - Listen 701 - - SSLEngine on - SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL - SSLCertificateFile /etc/apache2/ssl/apache.crt - SSLCertificateKeyFile /etc/apache2/ssl/apache.key - - SSLVerifyClient optional_no_ca - - EPPEngine On - EPPCommandRoot /proxy/command - EPPSessionRoot /proxy/session - EPPErrorRoot /proxy/error - EPPRawFrame raw_frame - - ProxyPass /proxy/ http://localhost:8989/epp/ - - EPPAuthURI implicit - EPPReturncodeHeader X-EPP-Returncode - - -``` - - - -* Run all tests with temp server running automatically on port 8989: - - rake test - - -Manual debugging -================ - -### Apache mod_epp manual debugging - -Debugging Apache mod_epp without Registry app. - - sudo apt-get install apache2-dbg - -Includes htpasswd command to generate authentication files - - sudo apt-get install apache2-utils - -For manual debugging purposes, standalone CGI scripts can be used: -This needs a static greeting file, so you will have to make /var/www writable. - -```apache - - - Options ExecCGI - SetHandler cgi-script - - - Listen 1700 - - - EPPEngine On - EPPCommandRoot /cgi-bin/epp/command - EPPSessionRoot /cgi-bin/epp/session - EPPErrorRoot /cgi-bin/epp/error - - Alias /cgi-bin/epp/session/hello /var/www/html/epp/session-hello - - Alias /cgi-bin/epp/session/login /usr/lib/cgi-bin/epp/session-login - Alias /cgi-bin/epp/session/logout /usr/lib/cgi-bin/epp/session-logout - Alias /cgi-bin/epp/error/schema /usr/lib/cgi-bin/epp/error-schema - Alias /cgi-bin/epp/command/create /usr/lib/cgi-bin/epp/create - Alias /cgi-bin/epp/command/info /usr/lib/cgi-bin/epp/info - - EPPAuthURI /epp/auth/login - - AuthType Basic - AuthName "EPP" - AuthUserFile /etc/apache2/htpasswd - require valid-user - - - -``` - - sudo a2enmod cgi - sudo a2enmod authn_file # will be used for non implicit authentication URIs - sudo htpasswd -c /etc/apache2/htpasswd test - Type "test" when prompted - cd /usr/lib/cgi-bin - mkdir epp - -Copy the files from $mod_epp/examples/cgis to /usr/lib/cgi-bin/epp +To run single test: + docker-compose run registry bundle exec rails test RAILS_ENV=test COVERAGE=true Allowed testing email list ========================== From 25eca195c28c6e50ba0d6fd7c71cf5f6465f61ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Fri, 18 Sep 2020 10:56:12 +0300 Subject: [PATCH 05/79] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad7a6b1a0..d3720e224 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +18.09.2020 +* Updated testing documentation [#1285](https://github.com/internetee/registry/pull/1285) + 16.09.2020 * Refactored orphaned contact archivation process [#956](https://github.com/internetee/registry/issues/956) * Rails update to 6.0.3.3 [#1685](https://github.com/internetee/registry/pull/1685) From 57d2a40e232ee7a93cb069dc3cdb4bc4225cd0ac Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Wed, 4 Sep 2019 00:08:38 +0300 Subject: [PATCH 06/79] Remove `mod_epp` docs --- README.md | 47 +------------------- doc/patches/mod_epp_1.10-frame-size.patch | 11 ----- doc/patches/mod_epp_1.10-rack-friendly.patch | 37 --------------- 3 files changed, 1 insertion(+), 94 deletions(-) delete mode 100644 doc/patches/mod_epp_1.10-frame-size.patch delete mode 100644 doc/patches/mod_epp_1.10-rack-friendly.patch diff --git a/README.md b/README.md index 774e35331..48371c531 100644 --- a/README.md +++ b/README.md @@ -47,24 +47,10 @@ Manual demo install and database setup: bundle exec rake bootstrap bundle exec rake assets:precompile -### Apache with patched mod_epp (Debian 7/Ubuntu 14.04 LTS) +### Apache (Debian 7/Ubuntu 14.04 LTS) sudo apt-get install apache2 - sudo apt-get install apache2-threaded-dev # needed to compile mod_epp - wget sourceforge.net/projects/aepps/files/mod_epp/1.10/mod_epp-1.10.tar.gz - tar -xzvf mod_epp-1.10.tar.gz - cd mod_epp-1.10 - -Patch mod_epp for Rack. Beacause Rack multipart parser expects specifically -formatted content boundaries, the mod_epp needs to be modified before building: - - wget https://github.com/internetee/registry/raw/master/doc/patches/mod_epp_1.10-rack-friendly.patch - wget https://raw.githubusercontent.com/domify/registry/master/doc/patches/mod_epp_1.10-frame-size.patch - patch < mod_epp_1.10-rack-friendly.patch - patch < mod_epp_1.10-frame-size.patch - sudo apxs2 -a -c -i mod_epp.c - Enable ssl: sudo a2enmod proxy_http @@ -380,37 +366,6 @@ Be sure to update paths to match your system configuration. - - - Listen 700 - - SSLEngine on - SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL - SSLCertificateFile /etc/apache2/ssl/apache.crt - SSLCertificateKeyFile /etc/apache2/ssl/apache.key - - SSLVerifyClient require - SSLVerifyDepth 1 - SSLCACertificateFile /home/registry/registry/shared/ca/certs/ca.crt.pem - SSLCARevocationPath /home/registry/registry/shared/ca/crl - # Uncomment this when upgrading to apache 2.4: - # SSLCARevocationCheck chain - - RequestHeader set SSL_CLIENT_S_DN_CN "%{SSL_CLIENT_S_DN_CN}s" - RequestHeader set SSL_CLIENT_CERT "%{SSL_CLIENT_CERT}s" - - EPPEngine On - EPPCommandRoot /proxy/command - EPPSessionRoot /proxy/session - EPPErrorRoot /proxy/error - EPPRawFrame raw_frame - - ProxyPass /proxy/ http://localhost:8080/epp/ - - EPPAuthURI implicit - EPPReturncodeHeader X-EPP-Returncode - - ``` Enable epp_ssl and restart apache diff --git a/doc/patches/mod_epp_1.10-frame-size.patch b/doc/patches/mod_epp_1.10-frame-size.patch deleted file mode 100644 index aa346b5c7..000000000 --- a/doc/patches/mod_epp_1.10-frame-size.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- mod_epp.h 2015-03-27 15:30:20.027130050 +0200 -+++ mod_epp_new.h 2015-03-27 15:30:38.499130269 +0200 -@@ -60,7 +60,7 @@ - #endif - - #define EPP_TCP_HEADER_SIZE 4 /* just one longword */ --#define EPP_MAX_FRAME_SIZE 65536 /* don't accept larger xml data blocks */ -+#define EPP_MAX_FRAME_SIZE 15728640 /* don't accept larger xml data blocks (8MB + 30% base64 + xml + savings)*/ - #define TRIDSIZE 128 /* actually, it should be 3 to 64 chars, - but due to unicode we'll give it more room. */ - diff --git a/doc/patches/mod_epp_1.10-rack-friendly.patch b/doc/patches/mod_epp_1.10-rack-friendly.patch deleted file mode 100644 index 648477da0..000000000 --- a/doc/patches/mod_epp_1.10-rack-friendly.patch +++ /dev/null @@ -1,37 +0,0 @@ - mod_epp.c | 2 +- - mod_epp.h | 8 ++++---- - 2 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/mod_epp.c b/mod_epp.c -index 8b1ba6f..66e46d8 100644 ---- a/mod_epp.c -+++ b/mod_epp.c -@@ -756,7 +756,7 @@ sprintf(content_length, "%lu", strlen(EPP_CONTENT_FRAME_CGI) - strlen(conf->raw_frame) - + er->orig_xml_size) : 0)); - --apr_table_set(r->headers_in, "Content-Type", "multipart/form-data; boundary=--BOUNDARY--"); -+apr_table_set(r->headers_in, "Content-Type", EPP_CONTENT_TYPE_CGI); - apr_table_set(r->headers_in, "Content-Length", content_length); - apr_table_set(r->headers_in, "Cookie", er->ur->cookie); - -diff --git a/mod_epp.h b/mod_epp.h -index e72d980..5e99bad 100644 ---- a/mod_epp.h -+++ b/mod_epp.h -@@ -96,10 +96,10 @@ module AP_MODULE_DECLARE_DATA epp_module; - #define EPP_DEFAULT_RC_HEADER "X-EPP-Returncode" - - --#define EPP_CONTENT_TYPE_CGI "multipart/form-data; boundary=--BOUNDARY--" --#define EPP_CONTENT_FRAME_CGI "----BOUNDARY--\r\nContent-Disposition: form-data; name=\"frame\"\r\n\r\n" --#define EPP_CONTENT_RAW_CGI "\r\n----BOUNDARY--\r\nContent-Disposition: form-data; name=\"%s\"\r\n\r\n" --#define EPP_CONTENT_CLTRID_CGI "\r\n----BOUNDARY--\r\nContent-Disposition: form-data; name=\"clTRID\"\r\n\r\n" -+#define EPP_CONTENT_TYPE_CGI "multipart/form-data; boundary=--BOUNDARY" -+#define EPP_CONTENT_FRAME_CGI "----BOUNDARY\r\nContent-Disposition: form-data; name=\"frame\"\r\n\r\n" -+#define EPP_CONTENT_RAW_CGI "\r\n----BOUNDARY\r\nContent-Disposition: form-data; name=\"%s\"\r\n\r\n" -+#define EPP_CONTENT_CLTRID_CGI "\r\n----BOUNDARY\r\nContent-Disposition: form-data; name=\"clTRID\"\r\n\r\n" - #define EPP_CONTENT_POSTFIX_CGI "\r\n----BOUNDARY--\r\n" - - /* - From 50086afad6fa4874a2449acb37f7d7ff65cf74b0 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Fri, 18 Sep 2020 12:59:29 +0500 Subject: [PATCH 07/79] Remove mod_epp references from docs --- README.md | 7 ++----- app/controllers/epp/base_controller.rb | 4 +++- test/integration/epp/login/credentials_test.rb | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 48371c531..6cea918aa 100644 --- a/README.md +++ b/README.md @@ -22,11 +22,6 @@ Documentation * [Database diagram](/doc/models_complete.svg) * [Controllers diagram](/doc/controllers_complete.svg) -### Updating documentation - - AUTODOC=true rspec spec/requests - EPP_DOC=true rspec spec/epp --tag epp --require support/epp_doc.rb --format EppDoc > doc/epp_examples.md - Installation ------------ @@ -381,6 +376,8 @@ All registry demo data can be found at: Initially you can use two type of users: admin users and EPP users. +For using EPP we are strongly recommend to install epp_proxy instead of mod_epp. You can get epp_proxy from https://github.com/internetee/epp_proxy + ### Wkhtmltopdf setup ``` diff --git a/app/controllers/epp/base_controller.rb b/app/controllers/epp/base_controller.rb index e3ac81815..99c0ead35 100644 --- a/app/controllers/epp/base_controller.rb +++ b/app/controllers/epp/base_controller.rb @@ -343,7 +343,9 @@ module Epp end def epp_session_id - cookies[:session] # Passed by mod_epp https://github.com/mod-epp/mod-epp#requestscript-interface + # Passed by EPP proxy + # https://github.com/internetee/epp_proxy#translation-of-epp-calls + cookies[:session] end def ensure_session_id_passed diff --git a/test/integration/epp/login/credentials_test.rb b/test/integration/epp/login/credentials_test.rb index a62579766..0f7dac97c 100644 --- a/test/integration/epp/login/credentials_test.rb +++ b/test/integration/epp/login/credentials_test.rb @@ -31,7 +31,7 @@ class EppLoginCredentialsTest < EppTestCase end def test_already_logged_in - assert true # Handled by mod_epp + assert true # Handled by EPP proxy end def test_wrong_credentials From 9a2681dc11bff9f9c0c5d06fa366f23e988c469e Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Fri, 11 Oct 2019 11:59:47 +0300 Subject: [PATCH 08/79] Remove `railroady` gem --- Gemfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Gemfile b/Gemfile index 12b826e3c..ebd6a3911 100644 --- a/Gemfile +++ b/Gemfile @@ -80,7 +80,6 @@ end group :development, :test do gem 'pry', '0.10.1' - gem 'railroady', '1.3.0' # to generate database diagrams gem 'autodoc' gem 'puma' gem 'sdoc', '~> 1.1' From d3f75a98e557a2c87060813f58de315da5280e2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Fri, 18 Sep 2020 12:29:28 +0300 Subject: [PATCH 09/79] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3720e224..a4cdd552b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ 18.09.2020 * Updated testing documentation [#1285](https://github.com/internetee/registry/pull/1285) +* Removed mod-epp docs - replaced by epp-proxy [#1284](https://github.com/internetee/registry/pull/1284) 16.09.2020 * Refactored orphaned contact archivation process [#956](https://github.com/internetee/registry/issues/956) From a8313683149f99cf817a9fa5697102735bc5d4d5 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Fri, 11 Oct 2019 12:00:19 +0300 Subject: [PATCH 10/79] Remove `autodoc` gem --- Gemfile | 2 -- Gemfile.lock | 69 ++++++++++++++++------------------------------------ 2 files changed, 21 insertions(+), 50 deletions(-) diff --git a/Gemfile b/Gemfile index ebd6a3911..accb4d3a2 100644 --- a/Gemfile +++ b/Gemfile @@ -80,9 +80,7 @@ end group :development, :test do gem 'pry', '0.10.1' - gem 'autodoc' gem 'puma' - gem 'sdoc', '~> 1.1' end group :test do diff --git a/Gemfile.lock b/Gemfile.lock index e0dd396a7..3f9824cf1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -111,7 +111,7 @@ GEM activerecord (6.0.3.3) activemodel (= 6.0.3.3) activesupport (= 6.0.3.3) - activerecord-import (1.0.5) + activerecord-import (1.0.6) activerecord (>= 3.2) activestorage (6.0.3.3) actionpack (= 6.0.3.3) @@ -126,21 +126,17 @@ GEM zeitwerk (~> 2.2, >= 2.2.2) addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) - airbrake (10.0.5) - airbrake-ruby (~> 4.13) - airbrake-ruby (4.15.0) + airbrake (11.0.0) + airbrake-ruby (~> 5.0) + airbrake-ruby (5.0.2) rbtree3 (~> 0.5) akami (1.3.1) gyoku (>= 0.4.0) nokogiri - autodoc (0.7.4) - actionpack - activesupport (>= 3.0.0) - rspec - autoprefixer-rails (9.8.4) + autoprefixer-rails (10.0.0.2) execjs - bcrypt (3.1.13) - bootsnap (1.4.6) + bcrypt (3.1.16) + bootsnap (1.4.8) msgpack (~> 1.0) bootstrap-sass (3.4.1) autoprefixer-rails (>= 5.2.1) @@ -170,8 +166,7 @@ GEM i18n_data (~> 0.10.0) sixarm_ruby_unaccent (~> 1.1) unicode_utils (~> 1.4) - crack (0.4.3) - safe_yaml (~> 1.0.0) + crack (0.4.4) crass (1.0.6) daemons (1.3.1) daemons-rails (1.2.1) @@ -186,7 +181,6 @@ GEM railties (>= 4.1.0) responders warden (~> 1.2.3) - diff-lcs (1.4.4) docile (1.3.2) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) @@ -201,7 +195,7 @@ GEM concurrent-ruby (~> 1.0) dry-equalizer (0.3.0) dry-inflector (0.2.0) - dry-logic (1.0.6) + dry-logic (1.0.7) concurrent-ruby (~> 1.0) dry-core (~> 0.2) dry-equalizer (~> 0.2) @@ -220,7 +214,7 @@ GEM thor (~> 0.14) globalid (0.4.2) activesupport (>= 4.2.0) - grape (1.3.3) + grape (1.4.0) activesupport builder dry-types (>= 1.1) @@ -298,7 +292,7 @@ GEM money (~> 6.13.2) railties (>= 3.0) msgpack (1.3.3) - multi_json (1.14.1) + multi_json (1.15.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) mustermann-grape (1.0.1) @@ -313,7 +307,7 @@ GEM paper_trail (10.3.1) activerecord (>= 4.2) request_store (~> 1.1) - pdfkit (0.8.4.3.1) + pdfkit (0.8.4.3.2) pg (1.2.2) polyamorous (2.3.2) activerecord (>= 5.2.1) @@ -322,7 +316,7 @@ GEM method_source (~> 0.8.1) slop (~> 3.4) public_suffix (4.0.6) - puma (4.3.5) + puma (5.0.0) nio4r (~> 2.0) que (0.14.3) que-web (0.7.2) @@ -332,11 +326,10 @@ GEM rack (2.2.3) rack-accept (0.4.5) rack (>= 0.4) - rack-protection (2.0.8.1) + rack-protection (2.1.0) rack rack-test (1.1.0) rack (>= 1.0, < 3) - railroady (1.3.0) rails (6.0.3.3) actioncable (= 6.0.3.3) actionmailbox (= 6.0.3.3) @@ -373,7 +366,6 @@ GEM rb-inotify (0.10.1) ffi (~> 1.0) rbtree3 (0.6.0) - rdoc (6.2.1) regexp_parser (1.7.1) request_store (1.5.0) rack (>= 1.4) @@ -385,22 +377,8 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - rspec (3.9.0) - rspec-core (~> 3.9.0) - rspec-expectations (~> 3.9.0) - rspec-mocks (~> 3.9.0) - rspec-core (3.9.2) - rspec-support (~> 3.9.3) - rspec-expectations (3.9.2) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-mocks (3.9.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-support (3.9.3) ruby2_keywords (0.0.2) rubyzip (2.3.0) - safe_yaml (1.0.5) sass-rails (6.0.0) sassc-rails (~> 2.1, >= 2.1.1) sassc (2.4.0) @@ -419,8 +397,6 @@ GEM nokogiri (>= 1.8.1) nori (~> 2.4) wasabi (~> 3.4) - sdoc (1.1.0) - rdoc (>= 5.0) select2-rails (3.5.9.3) thor (~> 0.14) selectize-rails (0.12.1) @@ -434,10 +410,10 @@ GEM simplecov-html (0.10.2) simpleidn (0.1.1) unf (~> 0.1.4) - sinatra (2.0.8.1) + sinatra (2.1.0) mustermann (~> 1.0) - rack (~> 2.0) - rack-protection (= 2.0.8.1) + rack (~> 2.2) + rack-protection (= 2.1.0) tilt (~> 2.0) sixarm_ruby_unaccent (1.2.0) slop (3.6.0) @@ -453,7 +429,7 @@ GEM thor (0.20.3) thread_safe (0.3.6) tilt (2.0.10) - truemail (1.8.0) + truemail (1.9.0) simpleidn (~> 0.1.1) tzinfo (1.2.7) thread_safe (~> 0.1) @@ -465,8 +441,8 @@ GEM unicode_utils (1.4.0) validates_email_format_of (1.6.3) i18n - warden (1.2.8) - rack (>= 2.0.6) + warden (1.2.9) + rack (>= 2.0.9) wasabi (3.6.1) addressable httpi (~> 2.0) @@ -475,7 +451,7 @@ GEM nokogiri (~> 1.6) rubyzip (>= 1.3.0) selenium-webdriver (>= 3.0, < 4.0) - webmock (3.8.3) + webmock (3.9.1) addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) @@ -495,7 +471,6 @@ PLATFORMS DEPENDENCIES activerecord-import airbrake - autodoc bootsnap (>= 1.1.0) bootstrap-sass (~> 3.4) cancancan @@ -535,12 +510,10 @@ DEPENDENCIES puma que que-web - railroady (= 1.3.0) rails (~> 6.0) ransack (~> 2.3) rest-client sass-rails - sdoc (~> 1.1) select2-rails (= 3.5.9.3) selectize-rails (= 0.12.1) simplecov (= 0.17.1) From a0524ea58486f3a1e5f72ab59e0e1fb21d168863 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Sat, 19 Jan 2019 18:05:41 +0200 Subject: [PATCH 11/79] Remove outdated diagrams --- README.md | 6 +- doc/controllers_brief.svg | 236 ---- doc/controllers_complete.svg | 614 ----------- doc/models_brief.svg | 1268 ---------------------- doc/models_complete.svg | 1982 ---------------------------------- 5 files changed, 2 insertions(+), 4104 deletions(-) delete mode 100644 doc/controllers_brief.svg delete mode 100644 doc/controllers_complete.svg delete mode 100644 doc/models_brief.svg delete mode 100644 doc/models_complete.svg diff --git a/README.md b/README.md index 774e35331..a9801ee49 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,8 @@ Documentation ------------- * [EPP documentation](/doc/epp) -* [EPP request-response examples](/doc/epp_examples.md) -* [REPP documentation](/doc/repp_doc.md) -* [Database diagram](/doc/models_complete.svg) -* [Controllers diagram](/doc/controllers_complete.svg) +* [EPP request-response examples](/doc/epp-examples.md) +* [REPP documentation](/doc/repp-doc.md) ### Updating documentation diff --git a/doc/controllers_brief.svg b/doc/controllers_brief.svg deleted file mode 100644 index a33c36bb8..000000000 --- a/doc/controllers_brief.svg +++ /dev/null @@ -1,236 +0,0 @@ - - - - - - -controllers_diagram - - -_diagram_info -Controllers diagram -Date: Jul 08 2015 - 13:40 -Migration version: 20150707103801 -Generated by RailRoady 1.3.0 -http://railroady.prestonlee.com - - -RegistrantController - -RegistrantController - - -Epp::DomainsController - -Epp::DomainsController - - -Epp::SessionsController - -Epp::SessionsController - - -Epp::PollsController - -Epp::PollsController - - -Epp::ContactsController - -Epp::ContactsController - - -Epp::ErrorsController - -Epp::ErrorsController - - -RegistrarController - -RegistrarController - - -Admin::DomainsController - -Admin::DomainsController - - -Admin::DelayedJobsController - -Admin::DelayedJobsController - - -Admin::WhiteIpsController - -Admin::WhiteIpsController - - -Admin::ZonefilesController - -Admin::ZonefilesController - - -Admin::SettingsController - -Admin::SettingsController - - -Admin::ApiUsersController - -Admin::ApiUsersController - - -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::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::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 - - - diff --git a/doc/controllers_complete.svg b/doc/controllers_complete.svg deleted file mode 100644 index 892593e1a..000000000 --- a/doc/controllers_complete.svg +++ /dev/null @@ -1,614 +0,0 @@ - - - - - - -controllers_diagram - - -_diagram_info -Controllers diagram -Date: Jul 08 2015 - 13:40 -Migration version: 20150707103801 -Generated by RailRoady 1.3.0 -http://railroady.prestonlee.com - - -RegistrantController - -RegistrantController - -head_title_sufix - - -_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::SessionsController - -Epp::SessionsController - -hello -ip_white? -login -login_params -logout -parsed_frame - - -_layout - - -Epp::PollsController - -Epp::PollsController - -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 - - -RegistrarController - -RegistrarController - - - -_layout - - -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::WhiteIpsController - -Admin::WhiteIpsController - -create -destroy -edit -new -show -update - - -_layout -set_registrar -white_ip_params - - -Admin::ZonefilesController - -Admin::ZonefilesController - -create - - -_layout - - -Admin::SettingsController - -Admin::SettingsController - -create -index -show -update - - -_layout -casted_settings -set_setting_group -setting_group_params - - -Admin::ApiUsersController - -Admin::ApiUsersController - -create -destroy -edit -index -new -show -update - - -_layout -api_user_params -set_api_user - - -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::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 - - - -_layout - - -Registrar::DomainsController - -Registrar::DomainsController - -check -create -delete -destroy -edit -index -info -new -renew -transfer -update - - -_layout -init_contacts_autocomplete_map -init_domain - - -Registrar::SessionsController - -Registrar::SessionsController - -create -id -login -login_mid -mid -mid_status - - -_layout -role_base_root_url - - -Registrar::PollsController - -Registrar::PollsController - -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 - - - diff --git a/doc/models_brief.svg b/doc/models_brief.svg deleted file mode 100644 index 57012f0d5..000000000 --- a/doc/models_brief.svg +++ /dev/null @@ -1,1268 +0,0 @@ - - - - - - -models_diagram - - -_diagram_info -Models diagram -Date: Jul 08 2015 - 13:41 -Migration version: 20150707103801 -Generated by RailRoady 1.3.0 -http://railroady.prestonlee.com - - -WhoisRecord - -WhoisRecord - - -RegistrantUser - -RegistrantUser - - -UserVersion - -UserVersion - - -RegistrantUser->UserVersion - - - -versions - - -ReservedDomain - -ReservedDomain - - -ReservedDomainVersion - -ReservedDomainVersion - - -ReservedDomain->ReservedDomainVersion - - - -versions - - -WhiteIpVersion - -WhiteIpVersion - - -VersionAssociation - -VersionAssociation - - -WhiteIpVersion->VersionAssociation - - - - - -NameserverVersion - -NameserverVersion - - -NameserverVersion->VersionAssociation - - - - - -UserVersion->VersionAssociation - - - - - -DnskeyVersion - -DnskeyVersion - - -DnskeyVersion->VersionAssociation - - - - - -BlockedDomainVersion - -BlockedDomainVersion - - -BlockedDomainVersion->VersionAssociation - - - - - -SettingVersion - -SettingVersion - - -SettingVersion->VersionAssociation - - - - - -CertificateVersion - -CertificateVersion - - -CertificateVersion->VersionAssociation - - - - - -AccountVersion - -AccountVersion - - -AccountVersion->VersionAssociation - - - - - -MessageVersion - -MessageVersion - - -MessageVersion->VersionAssociation - - - - - -ReservedDomainVersion->VersionAssociation - - - - - -AccountActivityVersion - -AccountActivityVersion - - -AccountActivityVersion->VersionAssociation - - - - - -BankStatementVersion - -BankStatementVersion - - -BankStatementVersion->VersionAssociation - - - - - -DomainContactVersion - -DomainContactVersion - - -DomainContactVersion->VersionAssociation - - - - - -ContactVersion - -ContactVersion - - -ContactVersion->VersionAssociation - - - - - -BankTransactionVersion - -BankTransactionVersion - - -BankTransactionVersion->VersionAssociation - - - - - -InvoiceItemVersion - -InvoiceItemVersion - - -InvoiceItemVersion->VersionAssociation - - - - - -LegalDocumentVersion - -LegalDocumentVersion - - -LegalDocumentVersion->VersionAssociation - - - - - -RegistrarVersion - -RegistrarVersion - - -RegistrarVersion->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->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->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 - - -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 - - -Domain->DomainStatus - - - - - -Domain->DomainStatus - - - - - -Domain->DomainStatus - - - - - -Domain->DomainStatus - - - - - -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 - - - - - -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 - - -RegistrantVerification - -RegistrantVerification - - -TechDomainContact->DomainContactVersion - - - -versions - - -AccountActivity->AccountActivityVersion - - - -versions - - -Account->AccountVersion - - - -versions - - -Account->AccountActivity - - - - - -EppSession - -EppSession - - -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 - - -Registrant - -Registrant - - -Registrant->ContactVersion - - - -versions - - -Registrant->Domain - - - - - -Registrant->Domain - - - -registrant_domains - - -Registrant->ContactStatus - - - -statuses - - -Registrant->DomainContact - - - - - -Registrant->LegalDocument - - - - - -WhiteIp->WhiteIpVersion - - - -versions - - -AdminUser - -AdminUser - - -AdminUser->UserVersion - - - -versions - - -LegalDocument->LegalDocumentVersion - - - -versions - - - diff --git a/doc/models_complete.svg b/doc/models_complete.svg deleted file mode 100644 index c41283153..000000000 --- a/doc/models_complete.svg +++ /dev/null @@ -1,1982 +0,0 @@ - - - - - - -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 -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 - - - - - -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 - - - - - -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 - - - - - -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 - - - - - -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 - - - - - -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 - - - - - -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 -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 -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_to :datetime -registrant_id :integer -transfer_code :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 -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 -old_registrar_id :integer -new_registrar_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 -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 - - - - - -Domain->LegalDocument - - - - - -Domain->LegalDocument - - - - - -Domain->LegalDocument - - - - - -Domain->LegalDocument - - - - - -Ability - -Ability - - - - -Registrar - -Registrar - -id :integer -name :string -reg_no :string -vat_no :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 -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 - - - - - -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 -due_date :datetime -payment_term :string -currency :string -description :string -reference_no :string -vat_rate :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 -total :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 -type :string -registrant_ident :string -encrypted_password :string -remember_created_at :datetime -failed_attempts :integer -locked_at :datetime - - -User->UserVersion - - - -versions - - -User->UserVersion - - - -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 - - -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 - - -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 - - -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 - - - - - -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 -type :string -registrant_ident :string -encrypted_password :string -remember_created_at :datetime -failed_attempts :integer -locked_at :datetime - - -AdminUser->UserVersion - - - -versions - - -LegalDocument->LegalDocumentVersion - - - -versions - - - From 3a2892d7e5ea6d53f152e82d35713bf4754abce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Fri, 18 Sep 2020 13:40:21 +0300 Subject: [PATCH 12/79] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4cdd552b..6e7b1f28a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ 18.09.2020 * Updated testing documentation [#1285](https://github.com/internetee/registry/pull/1285) * Removed mod-epp docs - replaced by epp-proxy [#1284](https://github.com/internetee/registry/pull/1284) +* Removed outdated diagrams [#1073](https://github.com/internetee/registry/pull/1073) 16.09.2020 * Refactored orphaned contact archivation process [#956](https://github.com/internetee/registry/issues/956) From 7b6060b4fb6d7bcea74262f5ac7024d66ca78e9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Fri, 18 Sep 2020 13:43:31 +0300 Subject: [PATCH 13/79] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e7b1f28a..3f0acd9a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ * Updated testing documentation [#1285](https://github.com/internetee/registry/pull/1285) * Removed mod-epp docs - replaced by epp-proxy [#1284](https://github.com/internetee/registry/pull/1284) * Removed outdated diagrams [#1073](https://github.com/internetee/registry/pull/1073) +* Removed unused autodoc gems [#1358](https://github.com/internetee/registry/pull/1358) 16.09.2020 * Refactored orphaned contact archivation process [#956](https://github.com/internetee/registry/issues/956) From 4f9fa88bd4be3ac89caf8099ca3226109ce90a59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Tue, 22 Sep 2020 16:09:35 +0300 Subject: [PATCH 14/79] Registrant: Only show domains that user is connected with personally / via company --- app/models/contact.rb | 11 +++++++---- app/models/registrant_user.rb | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/models/contact.rb b/app/models/contact.rb index 0eb7fccbd..7ed2d9031 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -210,10 +210,13 @@ class Contact < ApplicationRecord ) end - def registrant_user_contacts(registrant_user) - registrant_user_direct_contacts(registrant_user) - .or(registrant_user_company_contacts(registrant_user)) - .or(registrant_user_indirect_contacts(registrant_user)) + def registrant_user_contacts(registrant_user, representment: true) + represented_contacts = registrant_user_direct_contacts(registrant_user) + .or(registrant_user_company_contacts(registrant_user)) + + return represented_contacts if representment + + represented_contacts.or(registrant_user_indirect_contacts(registrant_user)) end def registrant_user_direct_contacts(registrant_user) diff --git a/app/models/registrant_user.rb b/app/models/registrant_user.rb index e7ce9cc3b..c631c5c8e 100644 --- a/app/models/registrant_user.rb +++ b/app/models/registrant_user.rb @@ -22,8 +22,8 @@ class RegistrantUser < User citizen_country_code: country.alpha3) end - def contacts - Contact.registrant_user_contacts(self) + def contacts(representment: true) + Contact.registrant_user_contacts(self, representment: representment) end def direct_contacts From a67a0e5bf0e0bcd9ad73dc6dfc0c11d095b6d240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Tue, 22 Sep 2020 16:41:00 +0300 Subject: [PATCH 15/79] Registrant API: Query representable and other contacts --- app/controllers/api/v1/registrant/contacts_controller.rb | 2 +- app/models/contact.rb | 4 ++-- app/models/registrant_user.rb | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/api/v1/registrant/contacts_controller.rb b/app/controllers/api/v1/registrant/contacts_controller.rb index 7d8dbfac1..10f9abacf 100644 --- a/app/controllers/api/v1/registrant/contacts_controller.rb +++ b/app/controllers/api/v1/registrant/contacts_controller.rb @@ -91,7 +91,7 @@ module Api private def current_user_contacts - current_registrant_user.contacts + current_registrant_user.contacts(representable: false) rescue CompanyRegister::NotAvailableError current_registrant_user.direct_contacts end diff --git a/app/models/contact.rb b/app/models/contact.rb index 7ed2d9031..9dc1e34a2 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -210,11 +210,11 @@ class Contact < ApplicationRecord ) end - def registrant_user_contacts(registrant_user, representment: true) + def registrant_user_contacts(registrant_user, representable: true) represented_contacts = registrant_user_direct_contacts(registrant_user) .or(registrant_user_company_contacts(registrant_user)) - return represented_contacts if representment + return represented_contacts if representable represented_contacts.or(registrant_user_indirect_contacts(registrant_user)) end diff --git a/app/models/registrant_user.rb b/app/models/registrant_user.rb index c631c5c8e..7bd84d5dd 100644 --- a/app/models/registrant_user.rb +++ b/app/models/registrant_user.rb @@ -22,8 +22,8 @@ class RegistrantUser < User citizen_country_code: country.alpha3) end - def contacts(representment: true) - Contact.registrant_user_contacts(self, representment: representment) + def contacts(representable: true) + Contact.registrant_user_contacts(self, representable: representable) end def direct_contacts From 552e1e7b1ee1365e79736ce00e58ea0e1ceb6c3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Tue, 22 Sep 2020 17:04:44 +0300 Subject: [PATCH 16/79] Fix tests --- .../api/registrant/registrant_api_contacts_test.rb | 4 ++-- test/integration/api/v1/registrant/contacts/list_test.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/integration/api/registrant/registrant_api_contacts_test.rb b/test/integration/api/registrant/registrant_api_contacts_test.rb index af57c1c1a..191222764 100644 --- a/test/integration/api/registrant/registrant_api_contacts_test.rb +++ b/test/integration/api/registrant/registrant_api_contacts_test.rb @@ -12,7 +12,7 @@ class RegistrantApiContactsTest < ApplicationIntegrationTest def test_root_accepts_limit_and_offset_parameters contacts(:william).update!(ident: '1234', ident_type: 'priv', ident_country_code: 'US') - assert_equal 4, @user.contacts.size + assert_equal 4, @user.contacts(representable: false).size get '/api/v1/registrant/contacts', params: { 'limit' => 1, 'offset' => 0 }, headers: @auth_headers @@ -22,7 +22,7 @@ class RegistrantApiContactsTest < ApplicationIntegrationTest get '/api/v1/registrant/contacts', headers: @auth_headers response_json = JSON.parse(response.body, symbolize_names: true) - assert_equal(@user.contacts.size, response_json.count) + assert_equal(@user.contacts(representable: false).size, response_json.count) end def test_get_contact_details_by_uuid diff --git a/test/integration/api/v1/registrant/contacts/list_test.rb b/test/integration/api/v1/registrant/contacts/list_test.rb index a42aca694..2389019f1 100644 --- a/test/integration/api/v1/registrant/contacts/list_test.rb +++ b/test/integration/api/v1/registrant/contacts/list_test.rb @@ -35,7 +35,7 @@ class RegistrantApiV1ContactListTest < ActionDispatch::IntegrationTest get api_v1_registrant_contacts_path, as: :json, headers: { 'HTTP_AUTHORIZATION' => auth_token } response_json = JSON.parse(response.body, symbolize_names: true) - assert_equal @user.contacts.count, response_json.size + assert_equal @user.contacts(representable: false).count, response_json.size assert_includes response_json.map{ |hash| hash[:code] }, @contact.code end From 83be88028174d31abd3bcc328c4fba0b6b78b304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Tue, 22 Sep 2020 18:04:43 +0300 Subject: [PATCH 17/79] Verify no unaccessible contacts are exposed in registrant portal --- test/fixtures/contacts.yml | 12 ++++++++++++ test/system/registrant_area/domains/list_test.rb | 16 +++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/test/fixtures/contacts.yml b/test/fixtures/contacts.yml index 0173d56dd..4d45738bd 100644 --- a/test/fixtures/contacts.yml +++ b/test/fixtures/contacts.yml @@ -78,6 +78,18 @@ identical_to_william: auth_info: 5ab865 uuid: c0a191d5-3793-4f0b-8f85-491612d0293e +registrar_ltd: + name: Registrar Ltd + email: registrar@inbox.test + phone: '+555.555' + ident: 1234567890 + ident_type: org + registrar: goodnames + ident_country_code: US + code: registrarltd-001 + auth_info: e2c441 + uuid: 28b65455-6f1a-49fd-961c-0758886dbd76 + invalid: name: any code: invalid diff --git a/test/system/registrant_area/domains/list_test.rb b/test/system/registrant_area/domains/list_test.rb index 805b130de..3cbf477da 100644 --- a/test/system/registrant_area/domains/list_test.rb +++ b/test/system/registrant_area/domains/list_test.rb @@ -28,6 +28,20 @@ class RegistrantAreaDomainListTest < ApplicationSystemTestCase assert_no_text 'metro.test' end + def test_only_shows_direct_relation_and_or_company_domains + # case https://github.com/internetee/registry/issues/1690 + tech_contact = contacts(:registrar_ltd) + + # All domains share the same tech contact object + Domain.all.each do |domain| + DomainContact.create(domain: domain, contact: tech_contact, type: TechDomainContact) + end + + visit registrant_domains_url + assert_no_text 'Company register is unavailable.' + assert_no_text 'metro.test' + end + def test_notification_when_company_register_is_unavailable CompanyRegister::Client.stub(:new, CompanyRegisterClientStub.new) do visit registrant_domains_url @@ -54,4 +68,4 @@ class RegistrantAreaDomainListTest < ApplicationSystemTestCase assert_text 'shop.test' end -end \ No newline at end of file +end From 3e67ff4d65a0395e17e2c1257d4f682037a348d9 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Tue, 15 Sep 2020 11:32:58 +0500 Subject: [PATCH 18/79] Add Omniauth-Tara gem/initializer --- Gemfile | 4 +++ Gemfile.lock | 60 +++++++++++++++++++++++++++++++-- config/application.yml.sample | 7 ++++ config/initializers/omniauth.rb | 45 +++++++++++++++++++++++++ 4 files changed, 113 insertions(+), 3 deletions(-) create mode 100644 config/initializers/omniauth.rb diff --git a/Gemfile b/Gemfile index accb4d3a2..15d5f779c 100644 --- a/Gemfile +++ b/Gemfile @@ -53,6 +53,10 @@ gem 'digidoc_client', github: 'tarmotalu/digidoc_client', ref: '1645e83a5a548addce383f75703b0275c5310c32' +# TARA +gem 'omniauth-rails_csrf_protection' +gem 'omniauth-tara', github: 'internetee/omniauth-tara' + gem 'epp', github: 'internetee/epp', branch: :master gem 'epp-xml', '1.1.0', github: 'internetee/epp-xml' diff --git a/Gemfile.lock b/Gemfile.lock index 3f9824cf1..574afc9df 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -52,6 +52,15 @@ GIT logger nokogiri +GIT + remote: https://github.com/internetee/omniauth-tara.git + revision: cec845ec3794532144c4976104a07e206d759aa6 + specs: + omniauth-tara (0.3.0) + addressable (~> 2.5) + omniauth (~> 1.3) + openid_connect (~> 1.1) + GIT remote: https://github.com/tarmotalu/digidoc_client.git revision: 1645e83a5a548addce383f75703b0275c5310c32 @@ -126,6 +135,7 @@ GEM zeitwerk (~> 2.2, >= 2.2.2) addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) + aes_key_wrap (1.1.0) airbrake (11.0.0) airbrake-ruby (~> 5.0) airbrake-ruby (5.0.2) @@ -133,9 +143,11 @@ GEM akami (1.3.1) gyoku (>= 0.4.0) nokogiri + attr_required (1.0.1) autoprefixer-rails (10.0.0.2) execjs bcrypt (3.1.16) + bindata (2.4.8) bootsnap (1.4.8) msgpack (~> 1.0) bootstrap-sass (3.4.1) @@ -175,7 +187,7 @@ GEM data_migrate (6.3.0) rails (>= 5.0) database_cleaner (1.8.5) - devise (4.7.2) + devise (4.7.3) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) @@ -227,6 +239,7 @@ GEM temple (>= 0.8.0) tilt hashdiff (1.0.1) + hashie (4.1.0) hpricot (0.8.6) http-accept (1.7.0) http-cookie (1.0.3) @@ -247,6 +260,10 @@ GEM jquery-ui-rails (5.0.5) railties (>= 3.2.16) json (2.3.1) + json-jwt (1.13.0) + activesupport (>= 4.2) + aes_key_wrap + bindata kaminari (1.2.1) activesupport (>= 4.1.0) kaminari-actionview (= 1.2.1) @@ -302,7 +319,23 @@ GEM nokogiri (1.10.10) mini_portile2 (~> 2.4.0) nori (2.6.0) + omniauth (1.9.1) + hashie (>= 3.4.6) + rack (>= 1.6.2, < 3) + omniauth-rails_csrf_protection (0.1.2) + actionpack (>= 4.2) + omniauth (>= 1.3.1) open4 (1.3.4) + openid_connect (1.2.0) + activemodel + attr_required (>= 1.0.0) + json-jwt (>= 1.5.0) + rack-oauth2 (>= 1.6.1) + swd (>= 1.0.0) + tzinfo + validate_email + validate_url + webfinger (>= 1.0.1) orm_adapter (0.5.0) paper_trail (10.3.1) activerecord (>= 4.2) @@ -326,6 +359,12 @@ GEM rack (2.2.3) rack-accept (0.4.5) rack (>= 0.4) + rack-oauth2 (1.16.0) + activesupport + attr_required + httpclient + json-jwt (>= 1.11.0) + rack (>= 2.1.0) rack-protection (2.1.0) rack rack-test (1.1.0) @@ -366,7 +405,7 @@ GEM rb-inotify (0.10.1) ffi (~> 1.0) rbtree3 (0.6.0) - regexp_parser (1.7.1) + regexp_parser (1.8.0) request_store (1.5.0) rack (>= 1.4) responders (3.0.1) @@ -425,11 +464,15 @@ GEM actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) + swd (1.2.0) + activesupport (>= 3) + attr_required (>= 0.0.5) + httpclient (>= 2.4) temple (0.8.2) thor (0.20.3) thread_safe (0.3.6) tilt (2.0.10) - truemail (1.9.0) + truemail (1.9.1) simpleidn (~> 0.1.1) tzinfo (1.2.7) thread_safe (~> 0.1) @@ -439,6 +482,12 @@ GEM unf_ext unf_ext (0.0.7.7) unicode_utils (1.4.0) + validate_email (0.1.6) + activemodel (>= 3.0) + mail (>= 2.2.5) + validate_url (1.0.13) + activemodel (>= 3.0.0) + public_suffix validates_email_format_of (1.6.3) i18n warden (1.2.9) @@ -451,6 +500,9 @@ GEM nokogiri (~> 1.6) rubyzip (>= 1.3.0) selenium-webdriver (>= 3.0, < 4.0) + webfinger (1.1.0) + activesupport + httpclient (>= 2.4) webmock (3.9.1) addressable (>= 2.3.6) crack (>= 0.3.2) @@ -503,6 +555,8 @@ DEPENDENCIES minitest (~> 5.14) money-rails nokogiri + omniauth-rails_csrf_protection + omniauth-tara! paper_trail (~> 10.3) pdfkit pg (= 1.2.2) diff --git a/config/application.yml.sample b/config/application.yml.sample index 72b55e2ea..cbe32e5db 100644 --- a/config/application.yml.sample +++ b/config/application.yml.sample @@ -156,6 +156,13 @@ lhv_dev_mode: 'false' epp_session_timeout_seconds: '300' contact_archivation_log_file_dir: +tara_host: 'tara-test.ria.ee' +tara_issuer: 'https://tara-test.ria.ee' +tara_identifier: 'identifier' +tara_secret: 'secret' +tara_redirect_uri: 'redirect_url' +tara_keys: "{\"kty\":\"RSA\",\"kid\":\"de6cc4\",\"n\":\"jWwAjT_03ypme9ZWeSe7c-jY26NO50Wo5I1LBnPW2JLc0dPMj8v7y4ehiRpClYNTaSWcLd4DJmlKXDXXudEUWwXa7TtjBFJfzlZ-1u0tDvJ-H9zv9MzO7UhUFytztUEMTrtStdhGbzkzdEZZCgFYeo2i33eXxzIR1nGvI05d9Y-e_LHnNE2ZKTa89BC7ZiCXq5nfAaCgQna_knh4kFAX-KgiPRAtsiDHcAWKcBY3qUVcb-5XAX8p668MlGLukzsh5tFkQCbJVyNtmlbIHdbGvVHPb8C0H3oLYciv1Fjy_tS1lO7OT_cb3GVp6Ql-CG0uED_8pkpVtfsGRviub4_ElQ\",\"e\":\"AQAB\"}" + # Since the keys for staging are absent from the repo, we need to supply them separate for testing. test: payments_seb_bank_certificate: 'test/fixtures/files/seb_bank_cert.pem' diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb new file mode 100644 index 000000000..0e0ab9142 --- /dev/null +++ b/config/initializers/omniauth.rb @@ -0,0 +1,45 @@ +OpenIDConnect.logger = Rails.logger +OpenIDConnect.debug! + +OpenIDConnect.http_config do |config| + config.proxy = AuctionCenter::Application.config.customization.dig(:tara, :proxy) +end + +OmniAuth.config.logger = Rails.logger +# Block GET requests to avoid exposing self to CVE-2015-9284 +OmniAuth.config.allowed_request_methods = [:post] + +signing_keys = ENV['tara_keys'] +issuer = ENV['tara_issuer'] +host = ENV['tara_host'] +identifier = ENV['tara_identifier'] +secret = ENV['tara_secret'] +redirect_uri = ENV['tara_redirect_uri'] + +Rails.application.config.middleware.use OmniAuth::Builder do + provider "tara", { + name: 'tara', + scope: ['openid'], + state: Proc.new{ SecureRandom.hex(10) }, + client_signing_alg: :RS256, + client_jwk_signing_key: signing_keys, + send_scope_to_token_endpoint: false, + send_nonce: true, + issuer: issuer, + + client_options: { + scheme: 'https', + host: host, + + authorization_endpoint: '/oidc/authorize', + token_endpoint: '/oidc/token', + userinfo_endpoint: nil, # Not implemented + jwks_uri: '/oidc/jwks', + + # Auction + identifier: identifier, + secret: secret, + redirect_uri: redirect_uri, + }, + } +end From e93daa21d573558b48631eec832bf340e4f87b02 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Tue, 15 Sep 2020 13:02:05 +0500 Subject: [PATCH 19/79] Add Tara field to users, add routes & controller --- app/controllers/registrar/tara_controller.rb | 64 +++++++++++++++++++ app/errors/tampering_detected.rb | 3 + app/models/user.rb | 33 ++++++++++ config/locales/en.yml | 2 + config/locales/tara.en.yml | 14 ++++ config/locales/tara.et.yml | 14 ++++ config/routes.rb | 5 ++ ...00915073245_add_omniauth_fields_to_user.rb | 10 +++ db/structure.sql | 13 +++- 9 files changed, 156 insertions(+), 2 deletions(-) create mode 100644 app/controllers/registrar/tara_controller.rb create mode 100644 app/errors/tampering_detected.rb create mode 100644 config/locales/tara.en.yml create mode 100644 config/locales/tara.et.yml create mode 100644 db/migrate/20200915073245_add_omniauth_fields_to_user.rb diff --git a/app/controllers/registrar/tara_controller.rb b/app/controllers/registrar/tara_controller.rb new file mode 100644 index 000000000..ce986c798 --- /dev/null +++ b/app/controllers/registrar/tara_controller.rb @@ -0,0 +1,64 @@ +require 'tampering_detected' + +class TaraController < ApplicationController + rescue_from Errors::TamperingDetected do + redirect_to root_url, alert: t('auth.tara.tampering') + end + + def callback + session[:omniauth_hash] = user_hash + + @user = User.from_omniauth(user_hash) + + return unless @user.persisted? + + sign_in(User, @user) + redirect_to user_path(@user.uuid), notice: t('devise.sessions.signed_in') + end + + # rubocop:disable Metrics/MethodLength + def create + @user = User.new(create_params) + check_for_tampering + create_password + + respond_to do |format| + if @user.save + format.html do + sign_in(User, @user) + redirect_to user_path(@user.uuid), notice: t(:created) + end + else + format.html { render :callback } + end + end + end + # rubocop:enable Metrics/MethodLength + + def cancel + redirect_to root_path, notice: t(:sign_in_cancelled) + end + + private + + def create_params + params.require(:user) + .permit(:email, :identity_code, :country_code, :given_names, :surname, + :accepts_terms_and_conditions, :locale, :uid, :provider) + end + + def check_for_tampering + return unless @user.tampered_with?(session[:omniauth_hash]) + + session.delete(:omniauth_hash) + raise Errors::TamperingDetected + end + + def create_password + @user.password = Devise.friendly_token[0..20] + end + + def user_hash + request.env['omniauth.auth'] + end +end diff --git a/app/errors/tampering_detected.rb b/app/errors/tampering_detected.rb new file mode 100644 index 000000000..1cf72ba58 --- /dev/null +++ b/app/errors/tampering_detected.rb @@ -0,0 +1,3 @@ +module Errors + class TamperingDetected < ActionController::BadRequest; end +end diff --git a/app/models/user.rb b/app/models/user.rb index 6b16bd508..2234a3154 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,6 +1,9 @@ class User < ApplicationRecord include Versions # version/user_version.rb + ESTONIAN_COUNTRY_CODE = 'EE'.freeze + TARA_PROVIDER = 'tara'.freeze + has_many :actions, dependent: :restrict_with_exception attr_accessor :phone @@ -11,4 +14,34 @@ class User < ApplicationRecord "#{self.id}-#{self.class}: #{self.username}" end + # rubocop:disable Metrics/AbcSize + def tampered_with?(omniauth_hash) + uid_from_hash = omniauth_hash['uid'] + provider_from_hash = omniauth_hash['provider'] + + begin + uid != uid_from_hash || + provider != provider_from_hash || + country_code != uid_from_hash.slice(0..1) || + identity_code != uid_from_hash.slice(2..-1) || + given_names != omniauth_hash.dig('info', 'first_name') || + surname != omniauth_hash.dig('info', 'last_name') + end + end + # rubocop:enable Metrics/AbcSize + + def self.from_omniauth(omniauth_hash) + uid = omniauth_hash['uid'] + provider = omniauth_hash['provider'] + + User.find_or_initialize_by(provider: provider, uid: uid) do |user| + user.given_names = omniauth_hash.dig('info', 'first_name') + user.surname = omniauth_hash.dig('info', 'last_name') + if provider == TARA_PROVIDER + user.country_code = uid.slice(0..1) + user.identity_code = uid.slice(2..-1) + end + end + end + end diff --git a/config/locales/en.yml b/config/locales/en.yml index 9c5b98a1b..398a423f0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -295,6 +295,8 @@ en: authentication_error: 'Authentication error' + sign_in_cancelled: "Sign in cancelled" + transfer_requested: 'Transfer requested.' message_was_not_found: 'Message was not found' only_one_parameter_allowed: 'Only one parameter allowed: %{param_1} or %{param_2}' diff --git a/config/locales/tara.en.yml b/config/locales/tara.en.yml new file mode 100644 index 000000000..ff37e8ff7 --- /dev/null +++ b/config/locales/tara.en.yml @@ -0,0 +1,14 @@ +en: + auth: + tara: + tampering: "Tampering detected. Sign in cancelled." + + callback: + title: "Create a user" + errors: "prohibited this user from being saved" + + form: + contact_data: "Contact Data" + data_from_identity_document: "Data from identity document" + new_password: "New password" + sign_up: "Sign up" diff --git a/config/locales/tara.et.yml b/config/locales/tara.et.yml new file mode 100644 index 000000000..a4ccaf6dd --- /dev/null +++ b/config/locales/tara.et.yml @@ -0,0 +1,14 @@ +et: + auth: + tara: + tampering: "Avastatud urkimine. Sisselogimine tühistatud." + + callback: + title: "Loo kasutaja" + errors: "seda kasutajat ei saa salvestada" + + form: + contact_data: "Kontaktandmed" + data_from_identity_document: "Andmed elektroonselt isikutunnistuselt" + new_password: "Uus salasõna" + sign_up: "Registreeru" diff --git a/config/routes.rb b/config/routes.rb index 223cf3171..73d482cf0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -85,6 +85,11 @@ Rails.application.routes.draw do post 'id' => 'sessions#id_card', as: :id_card_sign_in post 'mid' => 'sessions#mid' + + match '/tara/callback', via: %i[get post], to: 'tara#callback', as: :tara_callback + match '/tara/cancel', via: %i[get post delete], to: 'tara#cancel', + as: :tara_cancel + match '/tara/create', via: [:post], to: 'tara#create', as: :tara_create end resources :invoices, except: %i[new create edit update destroy] do diff --git a/db/migrate/20200915073245_add_omniauth_fields_to_user.rb b/db/migrate/20200915073245_add_omniauth_fields_to_user.rb new file mode 100644 index 000000000..8826559e3 --- /dev/null +++ b/db/migrate/20200915073245_add_omniauth_fields_to_user.rb @@ -0,0 +1,10 @@ +class AddOmniauthFieldsToUser < ActiveRecord::Migration[6.0] + disable_ddl_transaction! + + def change + add_column :users, :provider, :string + add_column :users, :uid, :string + add_index :users, [:provider, :uid], algorithm: :concurrently, + unique: true + end +end diff --git a/db/structure.sql b/db/structure.sql index 6a30fbc84..e4e9b8c2f 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -2437,7 +2437,9 @@ CREATE TABLE public.users ( remember_created_at timestamp without time zone, failed_attempts integer DEFAULT 0 NOT NULL, locked_at timestamp without time zone, - legacy_id integer + legacy_id integer, + provider character varying, + uid character varying ); @@ -4190,6 +4192,12 @@ CREATE UNIQUE INDEX index_settings_on_thing_type_and_thing_id_and_var ON public. CREATE INDEX index_users_on_identity_code ON public.users USING btree (identity_code); +-- +-- Name: index_users_on_provider_and_uid; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- + +CREATE UNIQUE INDEX index_users_on_provider_and_uid ON public.users USING btree (provider, uid); + -- -- Name: index_users_on_registrar_id; Type: INDEX; Schema: public; Owner: -; Tablespace: @@ -4906,5 +4914,6 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200902131603'), ('20200908131554'), ('20200910085157'), -('20200910102028'); +('20200910102028'), +('20200915073245'); From 8ff92548bf3a696519af3cde7434d6e655c1a492 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Wed, 23 Sep 2020 12:31:37 +0500 Subject: [PATCH 20/79] Set cllback routes according to Tara inquiry --- config/routes.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 73d482cf0..b02c757fd 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -86,10 +86,10 @@ Rails.application.routes.draw do post 'mid' => 'sessions#mid' - match '/tara/callback', via: %i[get post], to: 'tara#callback', as: :tara_callback - match '/tara/cancel', via: %i[get post delete], to: 'tara#cancel', + match '/open_id/callback', via: %i[get post], to: 'tara#callback', as: :tara_callback + match '/open_id/cancel', via: %i[get post delete], to: 'tara#cancel', as: :tara_cancel - match '/tara/create', via: [:post], to: 'tara#create', as: :tara_create + match '/open_id/create', via: [:post], to: 'tara#create', as: :tara_create end resources :invoices, except: %i[new create edit update destroy] do From ffeb1d4baa6627874554c469ba1803f223415b1d Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Wed, 23 Sep 2020 13:01:33 +0500 Subject: [PATCH 21/79] Prepare view & controller --- app/controllers/registrar/tara_controller.rb | 97 +- app/models/user.rb | 23 +- app/views/registrar/sessions/new.html.erb | 14 +- app/views/registrar/tara/callback.html.erb | 0 config/locales/registrar/sessions.en.yml | 4 + db/structure.sql | 2862 ++++++++++++++++-- 6 files changed, 2612 insertions(+), 388 deletions(-) create mode 100644 app/views/registrar/tara/callback.html.erb diff --git a/app/controllers/registrar/tara_controller.rb b/app/controllers/registrar/tara_controller.rb index ce986c798..0d0805e2d 100644 --- a/app/controllers/registrar/tara_controller.rb +++ b/app/controllers/registrar/tara_controller.rb @@ -1,64 +1,71 @@ require 'tampering_detected' -class TaraController < ApplicationController - rescue_from Errors::TamperingDetected do - redirect_to root_url, alert: t('auth.tara.tampering') - end +class Registrar + class TaraController < ApplicationController + rescue_from Errors::TamperingDetected do + redirect_to root_url, alert: t('auth.tara.tampering') + end - def callback - session[:omniauth_hash] = user_hash + def callback + session[:omniauth_hash] = user_hash + @user = User.from_omniauth(user_hash) - @user = User.from_omniauth(user_hash) + return unless @user.persisted? - return unless @user.persisted? + sign_in(User, @user) + redirect_to user_path(@user.uuid), notice: t('devise.sessions.signed_in') + end - sign_in(User, @user) - redirect_to user_path(@user.uuid), notice: t('devise.sessions.signed_in') - end + # rubocop:disable Metrics/MethodLength + def create + tara_logger.info create_params + @user = User.new(create_params) + check_for_tampering + create_password - # rubocop:disable Metrics/MethodLength - def create - @user = User.new(create_params) - check_for_tampering - create_password - - respond_to do |format| - if @user.save - format.html do - sign_in(User, @user) - redirect_to user_path(@user.uuid), notice: t(:created) + respond_to do |format| + if @user.save + format.html do + sign_in(User, @user) + redirect_to user_path(@user.uuid), notice: t(:created) + end + else + format.html { render :callback } end - else - format.html { render :callback } end end - end - # rubocop:enable Metrics/MethodLength + # rubocop:enable Metrics/MethodLength - def cancel - redirect_to root_path, notice: t(:sign_in_cancelled) - end + def cancel + redirect_to root_path, notice: t(:sign_in_cancelled) + end - private + private - def create_params - params.require(:user) - .permit(:email, :identity_code, :country_code, :given_names, :surname, - :accepts_terms_and_conditions, :locale, :uid, :provider) - end + def create_params + params.require(:user) + .permit(:email, :identity_code, :country_code, :given_names, :surname, + :accepts_terms_and_conditions, :locale, :uid, :provider) + end - def check_for_tampering - return unless @user.tampered_with?(session[:omniauth_hash]) + def check_for_tampering + return unless @user.tampered_with?(session[:omniauth_hash]) - session.delete(:omniauth_hash) - raise Errors::TamperingDetected - end + session.delete(:omniauth_hash) + raise Errors::TamperingDetected + end - def create_password - @user.password = Devise.friendly_token[0..20] - end + def create_password + @user.password = Devise.friendly_token[0..20] + end - def user_hash - request.env['omniauth.auth'] + def user_hash + tara_logger.info request.env + request.env['omniauth.auth'] + end + + def tara_logger + @tara_logger ||= Logger.new(Rails.root.join('log', 'tara_auth2.log')) + end end end diff --git a/app/models/user.rb b/app/models/user.rb index 2234a3154..d3221b137 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -16,17 +16,18 @@ class User < ApplicationRecord # rubocop:disable Metrics/AbcSize def tampered_with?(omniauth_hash) - uid_from_hash = omniauth_hash['uid'] - provider_from_hash = omniauth_hash['provider'] - - begin - uid != uid_from_hash || - provider != provider_from_hash || - country_code != uid_from_hash.slice(0..1) || - identity_code != uid_from_hash.slice(2..-1) || - given_names != omniauth_hash.dig('info', 'first_name') || - surname != omniauth_hash.dig('info', 'last_name') - end + # uid_from_hash = omniauth_hash['uid'] + # provider_from_hash = omniauth_hash['provider'] + # + # begin + # uid != uid_from_hash || + # provider != provider_from_hash || + # country_code != uid_from_hash.slice(0..1) || + # identity_code != uid_from_hash.slice(2..-1) || + # given_names != omniauth_hash.dig('info', 'first_name') || + # surname != omniauth_hash.dig('info', 'last_name') + # end + false end # rubocop:enable Metrics/AbcSize diff --git a/app/views/registrar/sessions/new.html.erb b/app/views/registrar/sessions/new.html.erb index 8056b07c8..7b90cf3be 100644 --- a/app/views/registrar/sessions/new.html.erb +++ b/app/views/registrar/sessions/new.html.erb @@ -19,12 +19,16 @@
- <%= link_to '/registrar/login/mid', id: 'login-with-mobile-id-btn' do %> - <%= image_tag 'mid.gif' %> - <% end %> + <%#= link_to '/registrar/login/mid', id: 'login-with-mobile-id-btn' do %> + <%#= image_tag 'mid.gif' %> + <%# end %> - <%= link_to registrar_id_card_sign_in_path, method: :post do %> + <%#= link_to registrar_id_card_sign_in_path, method: :post do %> + <%#= image_tag 'id_card.gif' %> + <%# end %> + + <%= link_to "/auth/tara", method: :post, class: "ui button big primary" do %> <%= image_tag 'id_card.gif' %> <% end %> - \ No newline at end of file + diff --git a/app/views/registrar/tara/callback.html.erb b/app/views/registrar/tara/callback.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/config/locales/registrar/sessions.en.yml b/config/locales/registrar/sessions.en.yml index f74f74bc9..4854edccc 100644 --- a/config/locales/registrar/sessions.en.yml +++ b/config/locales/registrar/sessions.en.yml @@ -7,3 +7,7 @@ en: login_mid: header: Log in with mobile-id submit_btn: Login + tara: + callback: + header_html: "Eesti Interneti SA
Registrar Portal" + submit_btn: Login diff --git a/db/structure.sql b/db/structure.sql index e4e9b8c2f..5ea01f91f 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -1,28 +1,19 @@ ---- ---- PostgreSQL database dump ---- - SET statement_timeout = 0; SET lock_timeout = 0; +SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; +SET row_security = off; -- --- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: - +-- Name: audit; Type: SCHEMA; Schema: -; Owner: - -- -CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; - - --- --- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: - --- - -COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; +CREATE SCHEMA audit; -- @@ -205,12 +196,1398 @@ CREATE FUNCTION public.generate_zonefile(i_origin character varying) RETURNS tex $_$; +-- +-- Name: process_account_activity_audit(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.process_account_activity_audit() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + IF (TG_OP = 'INSERT') THEN + INSERT INTO audit.account_activities + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'UPDATE') THEN + INSERT INTO audit.account_activities + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'DELETE') THEN + INSERT INTO audit.account_activities + (object_id, action, recorded_at, old_value, new_value) + VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); + RETURN OLD; + END IF; + RETURN NULL; + END +$$; + + +-- +-- Name: process_account_audit(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.process_account_audit() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + IF (TG_OP = 'INSERT') THEN + INSERT INTO audit.accounts + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'UPDATE') THEN + INSERT INTO audit.accounts + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'DELETE') THEN + INSERT INTO audit.accounts + (object_id, action, recorded_at, old_value, new_value) + VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); + RETURN OLD; + END IF; + RETURN NULL; + END +$$; + + +-- +-- Name: process_action_audit(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.process_action_audit() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + IF (TG_OP = 'INSERT') THEN + INSERT INTO audit.actions + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'UPDATE') THEN + INSERT INTO audit.actions + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'DELETE') THEN + INSERT INTO audit.actions + (object_id, action, recorded_at, old_value, new_value) + VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); + RETURN OLD; + END IF; + RETURN NULL; + END +$$; + + +-- +-- Name: process_bank_statement_audit(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.process_bank_statement_audit() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + IF (TG_OP = 'INSERT') THEN + INSERT INTO audit.bank_statements + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'UPDATE') THEN + INSERT INTO audit.bank_statements + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'DELETE') THEN + INSERT INTO audit.bank_statements + (object_id, action, recorded_at, old_value, new_value) + VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); + RETURN OLD; + END IF; + RETURN NULL; + END +$$; + + +-- +-- Name: process_bank_transaction_audit(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.process_bank_transaction_audit() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + IF (TG_OP = 'INSERT') THEN + INSERT INTO audit.bank_transactions + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'UPDATE') THEN + INSERT INTO audit.bank_transactions + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'DELETE') THEN + INSERT INTO audit.bank_transactions + (object_id, action, recorded_at, old_value, new_value) + VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); + RETURN OLD; + END IF; + RETURN NULL; + END +$$; + + +-- +-- Name: process_blocked_domain_audit(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.process_blocked_domain_audit() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + IF (TG_OP = 'INSERT') THEN + INSERT INTO audit.blocked_domains + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'UPDATE') THEN + INSERT INTO audit.blocked_domains + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'DELETE') THEN + INSERT INTO audit.blocked_domains + (object_id, action, recorded_at, old_value, new_value) + VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); + RETURN OLD; + END IF; + RETURN NULL; + END +$$; + + +-- +-- Name: process_certificate_audit(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.process_certificate_audit() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + IF (TG_OP = 'INSERT') THEN + INSERT INTO audit.certificates + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'UPDATE') THEN + INSERT INTO audit.certificates + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'DELETE') THEN + INSERT INTO audit.certificates + (object_id, action, recorded_at, old_value, new_value) + VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); + RETURN OLD; + END IF; + RETURN NULL; + END +$$; + + +-- +-- Name: process_contact_audit(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.process_contact_audit() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + IF (TG_OP = 'INSERT') THEN + INSERT INTO audit.contacts + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'UPDATE') THEN + INSERT INTO audit.contacts + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'DELETE') THEN + INSERT INTO audit.contacts + (object_id, action, recorded_at, old_value, new_value) + VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); + RETURN OLD; + END IF; + RETURN NULL; + END +$$; + + +-- +-- Name: process_dnskey_audit(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.process_dnskey_audit() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + IF (TG_OP = 'INSERT') THEN + INSERT INTO audit.dnskeys + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'UPDATE') THEN + INSERT INTO audit.dnskeys + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'DELETE') THEN + INSERT INTO audit.dnskeys + (object_id, action, recorded_at, old_value, new_value) + VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); + RETURN OLD; + END IF; + RETURN NULL; + END +$$; + + +-- +-- Name: process_domain_audit(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.process_domain_audit() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + IF (TG_OP = 'INSERT') THEN + INSERT INTO audit.domains + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'UPDATE') THEN + INSERT INTO audit.domains + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'DELETE') THEN + INSERT INTO audit.domains + (object_id, action, recorded_at, old_value, new_value) + VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); + RETURN OLD; + END IF; + RETURN NULL; + END +$$; + + +-- +-- Name: process_domain_contact_audit(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.process_domain_contact_audit() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + IF (TG_OP = 'INSERT') THEN + INSERT INTO audit.domain_contacts + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'UPDATE') THEN + INSERT INTO audit.domain_contacts + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'DELETE') THEN + INSERT INTO audit.domain_contacts + (object_id, action, recorded_at, old_value, new_value) + VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); + RETURN OLD; + END IF; + RETURN NULL; + END +$$; + + +-- +-- Name: process_invoice_audit(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.process_invoice_audit() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + IF (TG_OP = 'INSERT') THEN + INSERT INTO audit.invoices + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'UPDATE') THEN + INSERT INTO audit.invoices + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'DELETE') THEN + INSERT INTO audit.invoices + (object_id, action, recorded_at, old_value, new_value) + VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); + RETURN OLD; + END IF; + RETURN NULL; + END +$$; + + +-- +-- Name: process_invoice_item_audit(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.process_invoice_item_audit() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + IF (TG_OP = 'INSERT') THEN + INSERT INTO audit.invoice_items + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'UPDATE') THEN + INSERT INTO audit.invoice_items + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'DELETE') THEN + INSERT INTO audit.invoice_items + (object_id, action, recorded_at, old_value, new_value) + VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); + RETURN OLD; + END IF; + RETURN NULL; + END +$$; + + +-- +-- Name: process_nameserver_audit(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.process_nameserver_audit() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + IF (TG_OP = 'INSERT') THEN + INSERT INTO audit.nameservers + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'UPDATE') THEN + INSERT INTO audit.nameservers + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'DELETE') THEN + INSERT INTO audit.nameservers + (object_id, action, recorded_at, old_value, new_value) + VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); + RETURN OLD; + END IF; + RETURN NULL; + END +$$; + + +-- +-- Name: process_notification_audit(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.process_notification_audit() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + IF (TG_OP = 'INSERT') THEN + INSERT INTO audit.notifications + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'UPDATE') THEN + INSERT INTO audit.notifications + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'DELETE') THEN + INSERT INTO audit.notifications + (object_id, action, recorded_at, old_value, new_value) + VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); + RETURN OLD; + END IF; + RETURN NULL; + END +$$; + + +-- +-- Name: process_payment_order_audit(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.process_payment_order_audit() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + IF (TG_OP = 'INSERT') THEN + INSERT INTO audit.payment_orders + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'UPDATE') THEN + INSERT INTO audit.payment_orders + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'DELETE') THEN + INSERT INTO audit.payment_orders + (object_id, action, recorded_at, old_value, new_value) + VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); + RETURN OLD; + END IF; + RETURN NULL; + END +$$; + + +-- +-- Name: process_registrant_verification_audit(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.process_registrant_verification_audit() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + IF (TG_OP = 'INSERT') THEN + INSERT INTO audit.registrant_verifications + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'UPDATE') THEN + INSERT INTO audit.registrant_verifications + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'DELETE') THEN + INSERT INTO audit.registrant_verifications + (object_id, action, recorded_at, old_value, new_value) + VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); + RETURN OLD; + END IF; + RETURN NULL; + END +$$; + + +-- +-- Name: process_registrar_audit(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.process_registrar_audit() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + IF (TG_OP = 'INSERT') THEN + INSERT INTO audit.registrars + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'UPDATE') THEN + INSERT INTO audit.registrars + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'DELETE') THEN + INSERT INTO audit.registrars + (object_id, action, recorded_at, old_value, new_value) + VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); + RETURN OLD; + END IF; + RETURN NULL; + END +$$; + + +-- +-- Name: process_reserved_domain_audit(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.process_reserved_domain_audit() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + IF (TG_OP = 'INSERT') THEN + INSERT INTO audit.reserved_domains + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'UPDATE') THEN + INSERT INTO audit.reserved_domains + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'DELETE') THEN + INSERT INTO audit.reserved_domains + (object_id, action, recorded_at, old_value, new_value) + VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); + RETURN OLD; + END IF; + RETURN NULL; + END +$$; + + +-- +-- Name: process_setting_audit(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.process_setting_audit() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + IF (TG_OP = 'INSERT') THEN + INSERT INTO audit.settings + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'UPDATE') THEN + INSERT INTO audit.settings + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'DELETE') THEN + INSERT INTO audit.settings + (object_id, action, recorded_at, old_value, new_value) + VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); + RETURN OLD; + END IF; + RETURN NULL; + END +$$; + + +-- +-- Name: process_user_audit(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.process_user_audit() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + IF (TG_OP = 'INSERT') THEN + INSERT INTO audit.users + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'UPDATE') THEN + INSERT INTO audit.users + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'DELETE') THEN + INSERT INTO audit.users + (object_id, action, recorded_at, old_value, new_value) + VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); + RETURN OLD; + END IF; + RETURN NULL; + END +$$; + + +-- +-- Name: process_white_ip_audit(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.process_white_ip_audit() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + IF (TG_OP = 'INSERT') THEN + INSERT INTO audit.white_ips + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'UPDATE') THEN + INSERT INTO audit.white_ips + (object_id, action, recorded_at, old_value, new_value) + VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); + RETURN NEW; + ELSEIF (TG_OP = 'DELETE') THEN + INSERT INTO audit.white_ips + (object_id, action, recorded_at, old_value, new_value) + VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); + RETURN OLD; + END IF; + RETURN NULL; + END +$$; + + SET default_tablespace = ''; SET default_with_oids = false; -- --- Name: account_activities; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: account_activities; Type: TABLE; Schema: audit; Owner: - +-- + +CREATE TABLE audit.account_activities ( + id integer NOT NULL, + object_id bigint, + action text NOT NULL, + recorded_at timestamp without time zone, + old_value jsonb, + new_value jsonb, + CONSTRAINT account_activities_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) +); + + +-- +-- Name: account_activities_id_seq; Type: SEQUENCE; Schema: audit; Owner: - +-- + +CREATE SEQUENCE audit.account_activities_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: account_activities_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - +-- + +ALTER SEQUENCE audit.account_activities_id_seq OWNED BY audit.account_activities.id; + + +-- +-- Name: accounts; Type: TABLE; Schema: audit; Owner: - +-- + +CREATE TABLE audit.accounts ( + id integer NOT NULL, + object_id bigint, + action text NOT NULL, + recorded_at timestamp without time zone, + old_value jsonb, + new_value jsonb, + CONSTRAINT accounts_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) +); + + +-- +-- Name: accounts_id_seq; Type: SEQUENCE; Schema: audit; Owner: - +-- + +CREATE SEQUENCE audit.accounts_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: accounts_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - +-- + +ALTER SEQUENCE audit.accounts_id_seq OWNED BY audit.accounts.id; + + +-- +-- Name: actions; Type: TABLE; Schema: audit; Owner: - +-- + +CREATE TABLE audit.actions ( + id integer NOT NULL, + object_id bigint, + action text NOT NULL, + recorded_at timestamp without time zone, + old_value jsonb, + new_value jsonb, + CONSTRAINT actions_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) +); + + +-- +-- Name: actions_id_seq; Type: SEQUENCE; Schema: audit; Owner: - +-- + +CREATE SEQUENCE audit.actions_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: actions_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - +-- + +ALTER SEQUENCE audit.actions_id_seq OWNED BY audit.actions.id; + + +-- +-- Name: bank_statements; Type: TABLE; Schema: audit; Owner: - +-- + +CREATE TABLE audit.bank_statements ( + id integer NOT NULL, + object_id bigint, + action text NOT NULL, + recorded_at timestamp without time zone, + old_value jsonb, + new_value jsonb, + CONSTRAINT bank_statements_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) +); + + +-- +-- Name: bank_statements_id_seq; Type: SEQUENCE; Schema: audit; Owner: - +-- + +CREATE SEQUENCE audit.bank_statements_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: bank_statements_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - +-- + +ALTER SEQUENCE audit.bank_statements_id_seq OWNED BY audit.bank_statements.id; + + +-- +-- Name: bank_transactions; Type: TABLE; Schema: audit; Owner: - +-- + +CREATE TABLE audit.bank_transactions ( + id integer NOT NULL, + object_id bigint, + action text NOT NULL, + recorded_at timestamp without time zone, + old_value jsonb, + new_value jsonb, + CONSTRAINT bank_transactions_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) +); + + +-- +-- Name: bank_transactions_id_seq; Type: SEQUENCE; Schema: audit; Owner: - +-- + +CREATE SEQUENCE audit.bank_transactions_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: bank_transactions_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - +-- + +ALTER SEQUENCE audit.bank_transactions_id_seq OWNED BY audit.bank_transactions.id; + + +-- +-- Name: blocked_domains; Type: TABLE; Schema: audit; Owner: - +-- + +CREATE TABLE audit.blocked_domains ( + id integer NOT NULL, + object_id bigint, + action text NOT NULL, + recorded_at timestamp without time zone, + old_value jsonb, + new_value jsonb, + CONSTRAINT blocked_domains_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) +); + + +-- +-- Name: blocked_domains_id_seq; Type: SEQUENCE; Schema: audit; Owner: - +-- + +CREATE SEQUENCE audit.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: audit; Owner: - +-- + +ALTER SEQUENCE audit.blocked_domains_id_seq OWNED BY audit.blocked_domains.id; + + +-- +-- Name: certificates; Type: TABLE; Schema: audit; Owner: - +-- + +CREATE TABLE audit.certificates ( + id integer NOT NULL, + object_id bigint, + action text NOT NULL, + recorded_at timestamp without time zone, + old_value jsonb, + new_value jsonb, + CONSTRAINT certificates_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) +); + + +-- +-- Name: certificates_id_seq; Type: SEQUENCE; Schema: audit; Owner: - +-- + +CREATE SEQUENCE audit.certificates_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: certificates_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - +-- + +ALTER SEQUENCE audit.certificates_id_seq OWNED BY audit.certificates.id; + + +-- +-- Name: contacts; Type: TABLE; Schema: audit; Owner: - +-- + +CREATE TABLE audit.contacts ( + id integer NOT NULL, + object_id bigint, + action text NOT NULL, + recorded_at timestamp without time zone, + old_value jsonb, + new_value jsonb, + CONSTRAINT contacts_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) +); + + +-- +-- Name: contacts_id_seq; Type: SEQUENCE; Schema: audit; Owner: - +-- + +CREATE SEQUENCE audit.contacts_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: contacts_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - +-- + +ALTER SEQUENCE audit.contacts_id_seq OWNED BY audit.contacts.id; + + +-- +-- Name: dnskeys; Type: TABLE; Schema: audit; Owner: - +-- + +CREATE TABLE audit.dnskeys ( + id integer NOT NULL, + object_id bigint, + action text NOT NULL, + recorded_at timestamp without time zone, + old_value jsonb, + new_value jsonb, + CONSTRAINT dnskeys_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) +); + + +-- +-- Name: dnskeys_id_seq; Type: SEQUENCE; Schema: audit; Owner: - +-- + +CREATE SEQUENCE audit.dnskeys_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: dnskeys_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - +-- + +ALTER SEQUENCE audit.dnskeys_id_seq OWNED BY audit.dnskeys.id; + + +-- +-- Name: domain_contacts; Type: TABLE; Schema: audit; Owner: - +-- + +CREATE TABLE audit.domain_contacts ( + id integer NOT NULL, + object_id bigint, + action text NOT NULL, + recorded_at timestamp without time zone, + old_value jsonb, + new_value jsonb, + CONSTRAINT domain_contacts_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) +); + + +-- +-- Name: domain_contacts_id_seq; Type: SEQUENCE; Schema: audit; Owner: - +-- + +CREATE SEQUENCE audit.domain_contacts_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: domain_contacts_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - +-- + +ALTER SEQUENCE audit.domain_contacts_id_seq OWNED BY audit.domain_contacts.id; + + +-- +-- Name: domains; Type: TABLE; Schema: audit; Owner: - +-- + +CREATE TABLE audit.domains ( + id integer NOT NULL, + object_id bigint, + action text NOT NULL, + recorded_at timestamp without time zone, + old_value jsonb, + new_value jsonb, + CONSTRAINT domains_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) +); + + +-- +-- Name: domains_id_seq; Type: SEQUENCE; Schema: audit; Owner: - +-- + +CREATE SEQUENCE audit.domains_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: domains_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - +-- + +ALTER SEQUENCE audit.domains_id_seq OWNED BY audit.domains.id; + + +-- +-- Name: invoice_items; Type: TABLE; Schema: audit; Owner: - +-- + +CREATE TABLE audit.invoice_items ( + id integer NOT NULL, + object_id bigint, + action text NOT NULL, + recorded_at timestamp without time zone, + old_value jsonb, + new_value jsonb, + CONSTRAINT invoice_items_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) +); + + +-- +-- Name: invoice_items_id_seq; Type: SEQUENCE; Schema: audit; Owner: - +-- + +CREATE SEQUENCE audit.invoice_items_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: invoice_items_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - +-- + +ALTER SEQUENCE audit.invoice_items_id_seq OWNED BY audit.invoice_items.id; + + +-- +-- Name: invoices; Type: TABLE; Schema: audit; Owner: - +-- + +CREATE TABLE audit.invoices ( + id integer NOT NULL, + object_id bigint, + action text NOT NULL, + recorded_at timestamp without time zone, + old_value jsonb, + new_value jsonb, + CONSTRAINT invoices_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) +); + + +-- +-- Name: invoices_id_seq; Type: SEQUENCE; Schema: audit; Owner: - +-- + +CREATE SEQUENCE audit.invoices_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: invoices_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - +-- + +ALTER SEQUENCE audit.invoices_id_seq OWNED BY audit.invoices.id; + + +-- +-- Name: nameservers; Type: TABLE; Schema: audit; Owner: - +-- + +CREATE TABLE audit.nameservers ( + id integer NOT NULL, + object_id bigint, + action text NOT NULL, + recorded_at timestamp without time zone, + old_value jsonb, + new_value jsonb, + CONSTRAINT nameservers_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) +); + + +-- +-- Name: nameservers_id_seq; Type: SEQUENCE; Schema: audit; Owner: - +-- + +CREATE SEQUENCE audit.nameservers_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: nameservers_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - +-- + +ALTER SEQUENCE audit.nameservers_id_seq OWNED BY audit.nameservers.id; + + +-- +-- Name: notifications; Type: TABLE; Schema: audit; Owner: - +-- + +CREATE TABLE audit.notifications ( + id integer NOT NULL, + object_id bigint, + action text NOT NULL, + recorded_at timestamp without time zone, + old_value jsonb, + new_value jsonb, + CONSTRAINT notifications_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) +); + + +-- +-- Name: notifications_id_seq; Type: SEQUENCE; Schema: audit; Owner: - +-- + +CREATE SEQUENCE audit.notifications_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: notifications_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - +-- + +ALTER SEQUENCE audit.notifications_id_seq OWNED BY audit.notifications.id; + + +-- +-- Name: payment_orders; Type: TABLE; Schema: audit; Owner: - +-- + +CREATE TABLE audit.payment_orders ( + id integer NOT NULL, + object_id bigint, + action text NOT NULL, + recorded_at timestamp without time zone, + old_value jsonb, + new_value jsonb, + CONSTRAINT payment_orders_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) +); + + +-- +-- Name: payment_orders_id_seq; Type: SEQUENCE; Schema: audit; Owner: - +-- + +CREATE SEQUENCE audit.payment_orders_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: payment_orders_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - +-- + +ALTER SEQUENCE audit.payment_orders_id_seq OWNED BY audit.payment_orders.id; + + +-- +-- Name: registrant_verifications; Type: TABLE; Schema: audit; Owner: - +-- + +CREATE TABLE audit.registrant_verifications ( + id integer NOT NULL, + object_id bigint, + action text NOT NULL, + recorded_at timestamp without time zone, + old_value jsonb, + new_value jsonb, + CONSTRAINT registrant_verifications_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) +); + + +-- +-- Name: registrant_verifications_id_seq; Type: SEQUENCE; Schema: audit; Owner: - +-- + +CREATE SEQUENCE audit.registrant_verifications_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: registrant_verifications_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - +-- + +ALTER SEQUENCE audit.registrant_verifications_id_seq OWNED BY audit.registrant_verifications.id; + + +-- +-- Name: registrars; Type: TABLE; Schema: audit; Owner: - +-- + +CREATE TABLE audit.registrars ( + id integer NOT NULL, + object_id bigint, + action text NOT NULL, + recorded_at timestamp without time zone, + old_value jsonb, + new_value jsonb, + CONSTRAINT registrars_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) +); + + +-- +-- Name: registrars_id_seq; Type: SEQUENCE; Schema: audit; Owner: - +-- + +CREATE SEQUENCE audit.registrars_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: registrars_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - +-- + +ALTER SEQUENCE audit.registrars_id_seq OWNED BY audit.registrars.id; + + +-- +-- Name: reserved_domains; Type: TABLE; Schema: audit; Owner: - +-- + +CREATE TABLE audit.reserved_domains ( + id integer NOT NULL, + object_id bigint, + action text NOT NULL, + recorded_at timestamp without time zone, + old_value jsonb, + new_value jsonb, + CONSTRAINT reserved_domains_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) +); + + +-- +-- Name: reserved_domains_id_seq; Type: SEQUENCE; Schema: audit; Owner: - +-- + +CREATE SEQUENCE audit.reserved_domains_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: reserved_domains_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - +-- + +ALTER SEQUENCE audit.reserved_domains_id_seq OWNED BY audit.reserved_domains.id; + + +-- +-- Name: settings; Type: TABLE; Schema: audit; Owner: - +-- + +CREATE TABLE audit.settings ( + id integer NOT NULL, + object_id bigint, + action text NOT NULL, + recorded_at timestamp without time zone, + old_value jsonb, + new_value jsonb, + CONSTRAINT settings_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) +); + + +-- +-- Name: settings_id_seq; Type: SEQUENCE; Schema: audit; Owner: - +-- + +CREATE SEQUENCE audit.settings_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: settings_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - +-- + +ALTER SEQUENCE audit.settings_id_seq OWNED BY audit.settings.id; + + +-- +-- Name: users; Type: TABLE; Schema: audit; Owner: - +-- + +CREATE TABLE audit.users ( + id integer NOT NULL, + object_id bigint, + action text NOT NULL, + recorded_at timestamp without time zone, + old_value jsonb, + new_value jsonb, + CONSTRAINT users_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) +); + + +-- +-- Name: users_id_seq; Type: SEQUENCE; Schema: audit; Owner: - +-- + +CREATE SEQUENCE audit.users_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - +-- + +ALTER SEQUENCE audit.users_id_seq OWNED BY audit.users.id; + + +-- +-- Name: white_ips; Type: TABLE; Schema: audit; Owner: - +-- + +CREATE TABLE audit.white_ips ( + id integer NOT NULL, + object_id bigint, + action text NOT NULL, + recorded_at timestamp without time zone, + old_value jsonb, + new_value jsonb, + CONSTRAINT white_ips_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) +); + + +-- +-- Name: white_ips_id_seq; Type: SEQUENCE; Schema: audit; Owner: - +-- + +CREATE SEQUENCE audit.white_ips_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: white_ips_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - +-- + +ALTER SEQUENCE audit.white_ips_id_seq OWNED BY audit.white_ips.id; + + +-- +-- Name: account_activities; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.account_activities ( @@ -250,7 +1627,7 @@ ALTER SEQUENCE public.account_activities_id_seq OWNED BY public.account_activiti -- --- Name: accounts; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: accounts; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.accounts ( @@ -286,7 +1663,7 @@ ALTER SEQUENCE public.accounts_id_seq OWNED BY public.accounts.id; -- --- Name: actions; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: actions; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.actions ( @@ -318,7 +1695,7 @@ ALTER SEQUENCE public.actions_id_seq OWNED BY public.actions.id; -- --- Name: ar_internal_metadata; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: ar_internal_metadata; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.ar_internal_metadata ( @@ -330,7 +1707,7 @@ CREATE TABLE public.ar_internal_metadata ( -- --- Name: auctions; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: auctions; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.auctions ( @@ -364,7 +1741,7 @@ ALTER SEQUENCE public.auctions_id_seq OWNED BY public.auctions.id; -- --- Name: bank_statements; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: bank_statements; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.bank_statements ( @@ -399,7 +1776,7 @@ ALTER SEQUENCE public.bank_statements_id_seq OWNED BY public.bank_statements.id; -- --- Name: bank_transactions; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: bank_transactions; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.bank_transactions ( @@ -443,7 +1820,7 @@ ALTER SEQUENCE public.bank_transactions_id_seq OWNED BY public.bank_transactions -- --- Name: blocked_domains; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: blocked_domains; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.blocked_domains ( @@ -476,7 +1853,7 @@ ALTER SEQUENCE public.blocked_domains_id_seq OWNED BY public.blocked_domains.id; -- --- Name: certificates; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: certificates; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.certificates ( @@ -515,7 +1892,7 @@ ALTER SEQUENCE public.certificates_id_seq OWNED BY public.certificates.id; -- --- Name: contacts; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: contacts; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.contacts ( @@ -573,7 +1950,7 @@ ALTER SEQUENCE public.contacts_id_seq OWNED BY public.contacts.id; -- --- Name: data_migrations; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: data_migrations; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.data_migrations ( @@ -582,7 +1959,7 @@ CREATE TABLE public.data_migrations ( -- --- Name: directos; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: directos; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.directos ( @@ -617,7 +1994,7 @@ ALTER SEQUENCE public.directos_id_seq OWNED BY public.directos.id; -- --- Name: disputes; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: disputes; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.disputes ( @@ -654,7 +2031,7 @@ ALTER SEQUENCE public.disputes_id_seq OWNED BY public.disputes.id; -- --- Name: dnskeys; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: dnskeys; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.dnskeys ( @@ -695,7 +2072,7 @@ ALTER SEQUENCE public.dnskeys_id_seq OWNED BY public.dnskeys.id; -- --- Name: domain_contacts; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: domain_contacts; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_contacts ( @@ -733,7 +2110,7 @@ ALTER SEQUENCE public.domain_contacts_id_seq OWNED BY public.domain_contacts.id; -- --- Name: domain_transfers; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: domain_transfers; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domain_transfers ( @@ -770,7 +2147,7 @@ ALTER SEQUENCE public.domain_transfers_id_seq OWNED BY public.domain_transfers.i -- --- Name: domains; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: domains; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.domains ( @@ -805,7 +2182,8 @@ CREATE TABLE public.domains ( uuid uuid DEFAULT public.gen_random_uuid() NOT NULL, locked_by_registrant_at timestamp without time zone, force_delete_start timestamp without time zone, - force_delete_data public.hstore + force_delete_data public.hstore, + children jsonb ); @@ -829,7 +2207,7 @@ ALTER SEQUENCE public.domains_id_seq OWNED BY public.domains.id; -- --- Name: email_address_verifications; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: email_address_verifications; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.email_address_verifications ( @@ -861,7 +2239,7 @@ ALTER SEQUENCE public.email_address_verifications_id_seq OWNED BY public.email_a -- --- Name: email_addresses_validations; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: email_addresses_validations; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.email_addresses_validations ( @@ -891,7 +2269,7 @@ ALTER SEQUENCE public.email_addresses_validations_id_seq OWNED BY public.email_a -- --- Name: email_addresses_verifications; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: email_addresses_verifications; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.email_addresses_verifications ( @@ -921,7 +2299,7 @@ ALTER SEQUENCE public.email_addresses_verifications_id_seq OWNED BY public.email -- --- Name: epp_sessions; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: epp_sessions; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.epp_sessions ( @@ -953,7 +2331,7 @@ ALTER SEQUENCE public.epp_sessions_id_seq OWNED BY public.epp_sessions.id; -- --- Name: invoice_items; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: invoice_items; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.invoice_items ( @@ -991,7 +2369,7 @@ ALTER SEQUENCE public.invoice_items_id_seq OWNED BY public.invoice_items.id; -- --- Name: invoices; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: invoices; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.invoices ( @@ -1062,7 +2440,7 @@ ALTER SEQUENCE public.invoices_id_seq OWNED BY public.invoices.id; -- --- Name: legal_documents; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: legal_documents; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.legal_documents ( @@ -1097,7 +2475,7 @@ ALTER SEQUENCE public.legal_documents_id_seq OWNED BY public.legal_documents.id; -- --- Name: log_account_activities; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_account_activities; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_account_activities ( @@ -1135,7 +2513,7 @@ ALTER SEQUENCE public.log_account_activities_id_seq OWNED BY public.log_account_ -- --- Name: log_accounts; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_accounts; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_accounts ( @@ -1173,7 +2551,7 @@ ALTER SEQUENCE public.log_accounts_id_seq OWNED BY public.log_accounts.id; -- --- Name: log_actions; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_actions; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_actions ( @@ -1211,7 +2589,7 @@ ALTER SEQUENCE public.log_actions_id_seq OWNED BY public.log_actions.id; -- --- Name: log_bank_statements; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_bank_statements; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_bank_statements ( @@ -1249,7 +2627,7 @@ ALTER SEQUENCE public.log_bank_statements_id_seq OWNED BY public.log_bank_statem -- --- Name: log_bank_transactions; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_bank_transactions; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_bank_transactions ( @@ -1287,7 +2665,7 @@ ALTER SEQUENCE public.log_bank_transactions_id_seq OWNED BY public.log_bank_tran -- --- Name: log_blocked_domains; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_blocked_domains; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_blocked_domains ( @@ -1325,7 +2703,7 @@ ALTER SEQUENCE public.log_blocked_domains_id_seq OWNED BY public.log_blocked_dom -- --- Name: log_certificates; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_certificates; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_certificates ( @@ -1363,7 +2741,7 @@ ALTER SEQUENCE public.log_certificates_id_seq OWNED BY public.log_certificates.i -- --- Name: log_contacts; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_contacts; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_contacts ( @@ -1402,7 +2780,7 @@ ALTER SEQUENCE public.log_contacts_id_seq OWNED BY public.log_contacts.id; -- --- Name: log_dnskeys; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_dnskeys; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_dnskeys ( @@ -1440,7 +2818,7 @@ ALTER SEQUENCE public.log_dnskeys_id_seq OWNED BY public.log_dnskeys.id; -- --- Name: log_domain_contacts; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_domain_contacts; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_domain_contacts ( @@ -1478,7 +2856,7 @@ ALTER SEQUENCE public.log_domain_contacts_id_seq OWNED BY public.log_domain_cont -- --- Name: log_domains; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_domains; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_domains ( @@ -1516,7 +2894,7 @@ ALTER SEQUENCE public.log_domains_id_seq OWNED BY public.log_domains.id; -- --- Name: log_invoice_items; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_invoice_items; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_invoice_items ( @@ -1554,7 +2932,7 @@ ALTER SEQUENCE public.log_invoice_items_id_seq OWNED BY public.log_invoice_items -- --- Name: log_invoices; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_invoices; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_invoices ( @@ -1592,7 +2970,7 @@ ALTER SEQUENCE public.log_invoices_id_seq OWNED BY public.log_invoices.id; -- --- Name: log_nameservers; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_nameservers; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_nameservers ( @@ -1630,7 +3008,7 @@ ALTER SEQUENCE public.log_nameservers_id_seq OWNED BY public.log_nameservers.id; -- --- Name: log_notifications; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_notifications; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_notifications ( @@ -1668,7 +3046,7 @@ ALTER SEQUENCE public.log_notifications_id_seq OWNED BY public.log_notifications -- --- Name: log_payment_orders; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_payment_orders; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_payment_orders ( @@ -1781,7 +3159,7 @@ ALTER SEQUENCE public.log_registrant_verifications_id_seq OWNED BY public.log_re -- --- Name: log_registrars; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_registrars; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_registrars ( @@ -1819,7 +3197,7 @@ ALTER SEQUENCE public.log_registrars_id_seq OWNED BY public.log_registrars.id; -- --- Name: log_reserved_domains; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_reserved_domains; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_reserved_domains ( @@ -1857,7 +3235,7 @@ ALTER SEQUENCE public.log_reserved_domains_id_seq OWNED BY public.log_reserved_d -- --- Name: log_setting_entries; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_setting_entries; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_setting_entries ( @@ -1895,7 +3273,7 @@ ALTER SEQUENCE public.log_setting_entries_id_seq OWNED BY public.log_setting_ent -- --- Name: log_settings; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_settings; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_settings ( @@ -1933,7 +3311,7 @@ ALTER SEQUENCE public.log_settings_id_seq OWNED BY public.log_settings.id; -- --- Name: log_users; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_users; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_users ( @@ -1971,7 +3349,7 @@ ALTER SEQUENCE public.log_users_id_seq OWNED BY public.log_users.id; -- --- Name: log_white_ips; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: log_white_ips; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.log_white_ips ( @@ -2009,7 +3387,7 @@ ALTER SEQUENCE public.log_white_ips_id_seq OWNED BY public.log_white_ips.id; -- --- Name: nameservers; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: nameservers; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.nameservers ( @@ -2047,7 +3425,7 @@ ALTER SEQUENCE public.nameservers_id_seq OWNED BY public.nameservers.id; -- --- Name: notifications; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: notifications; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.notifications ( @@ -2085,7 +3463,7 @@ ALTER SEQUENCE public.notifications_id_seq OWNED BY public.notifications.id; -- --- Name: payment_orders; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: payment_orders; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.payment_orders ( @@ -2122,7 +3500,7 @@ ALTER SEQUENCE public.payment_orders_id_seq OWNED BY public.payment_orders.id; -- --- Name: prices; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: prices; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.prices ( @@ -2130,13 +3508,13 @@ CREATE TABLE public.prices ( price_cents integer NOT NULL, valid_from timestamp without time zone, valid_to timestamp without time zone, - updator_str character varying, - creator_str character varying, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, duration interval, operation_category character varying, - zone_id integer NOT NULL + zone_id integer NOT NULL, + updator_str character varying, + creator_str character varying ); @@ -2160,7 +3538,7 @@ ALTER SEQUENCE public.prices_id_seq OWNED BY public.prices.id; -- --- Name: que_jobs; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: que_jobs; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.que_jobs ( @@ -2202,7 +3580,7 @@ ALTER SEQUENCE public.que_jobs_job_id_seq OWNED BY public.que_jobs.job_id; -- --- Name: registrant_verifications; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: registrant_verifications; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.registrant_verifications ( @@ -2238,7 +3616,7 @@ ALTER SEQUENCE public.registrant_verifications_id_seq OWNED BY public.registrant -- --- Name: registrars; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: registrars; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.registrars ( @@ -2293,7 +3671,7 @@ ALTER SEQUENCE public.registrars_id_seq OWNED BY public.registrars.id; -- --- Name: reserved_domains; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: reserved_domains; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.reserved_domains ( @@ -2328,7 +3706,7 @@ ALTER SEQUENCE public.reserved_domains_id_seq OWNED BY public.reserved_domains.i -- --- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.schema_migrations ( @@ -2337,7 +3715,7 @@ CREATE TABLE public.schema_migrations ( -- --- Name: setting_entries; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: setting_entries; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.setting_entries ( @@ -2373,7 +3751,7 @@ ALTER SEQUENCE public.setting_entries_id_seq OWNED BY public.setting_entries.id; -- --- Name: settings; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: settings; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.settings ( @@ -2409,7 +3787,7 @@ ALTER SEQUENCE public.settings_id_seq OWNED BY public.settings.id; -- --- Name: users; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: users; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.users ( @@ -2463,7 +3841,7 @@ ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id; -- --- Name: versions; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: versions; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.versions ( @@ -2498,7 +3876,7 @@ ALTER SEQUENCE public.versions_id_seq OWNED BY public.versions.id; -- --- Name: white_ips; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: white_ips; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.white_ips ( @@ -2534,7 +3912,7 @@ ALTER SEQUENCE public.white_ips_id_seq OWNED BY public.white_ips.id; -- --- Name: whois_records; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: whois_records; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.whois_records ( @@ -2569,7 +3947,7 @@ ALTER SEQUENCE public.whois_records_id_seq OWNED BY public.whois_records.id; -- --- Name: zones; Type: TABLE; Schema: public; Owner: -; Tablespace: +-- Name: zones; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE public.zones ( @@ -2612,266 +3990,420 @@ ALTER SEQUENCE public.zones_id_seq OWNED BY public.zones.id; -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: account_activities id; Type: DEFAULT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.account_activities ALTER COLUMN id SET DEFAULT nextval('audit.account_activities_id_seq'::regclass); + + +-- +-- Name: accounts id; Type: DEFAULT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.accounts ALTER COLUMN id SET DEFAULT nextval('audit.accounts_id_seq'::regclass); + + +-- +-- Name: actions id; Type: DEFAULT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.actions ALTER COLUMN id SET DEFAULT nextval('audit.actions_id_seq'::regclass); + + +-- +-- Name: bank_statements id; Type: DEFAULT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.bank_statements ALTER COLUMN id SET DEFAULT nextval('audit.bank_statements_id_seq'::regclass); + + +-- +-- Name: bank_transactions id; Type: DEFAULT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.bank_transactions ALTER COLUMN id SET DEFAULT nextval('audit.bank_transactions_id_seq'::regclass); + + +-- +-- Name: blocked_domains id; Type: DEFAULT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.blocked_domains ALTER COLUMN id SET DEFAULT nextval('audit.blocked_domains_id_seq'::regclass); + + +-- +-- Name: certificates id; Type: DEFAULT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.certificates ALTER COLUMN id SET DEFAULT nextval('audit.certificates_id_seq'::regclass); + + +-- +-- Name: contacts id; Type: DEFAULT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.contacts ALTER COLUMN id SET DEFAULT nextval('audit.contacts_id_seq'::regclass); + + +-- +-- Name: dnskeys id; Type: DEFAULT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.dnskeys ALTER COLUMN id SET DEFAULT nextval('audit.dnskeys_id_seq'::regclass); + + +-- +-- Name: domain_contacts id; Type: DEFAULT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.domain_contacts ALTER COLUMN id SET DEFAULT nextval('audit.domain_contacts_id_seq'::regclass); + + +-- +-- Name: domains id; Type: DEFAULT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.domains ALTER COLUMN id SET DEFAULT nextval('audit.domains_id_seq'::regclass); + + +-- +-- Name: invoice_items id; Type: DEFAULT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.invoice_items ALTER COLUMN id SET DEFAULT nextval('audit.invoice_items_id_seq'::regclass); + + +-- +-- Name: invoices id; Type: DEFAULT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.invoices ALTER COLUMN id SET DEFAULT nextval('audit.invoices_id_seq'::regclass); + + +-- +-- Name: nameservers id; Type: DEFAULT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.nameservers ALTER COLUMN id SET DEFAULT nextval('audit.nameservers_id_seq'::regclass); + + +-- +-- Name: notifications id; Type: DEFAULT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.notifications ALTER COLUMN id SET DEFAULT nextval('audit.notifications_id_seq'::regclass); + + +-- +-- Name: payment_orders id; Type: DEFAULT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.payment_orders ALTER COLUMN id SET DEFAULT nextval('audit.payment_orders_id_seq'::regclass); + + +-- +-- Name: registrant_verifications id; Type: DEFAULT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.registrant_verifications ALTER COLUMN id SET DEFAULT nextval('audit.registrant_verifications_id_seq'::regclass); + + +-- +-- Name: registrars id; Type: DEFAULT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.registrars ALTER COLUMN id SET DEFAULT nextval('audit.registrars_id_seq'::regclass); + + +-- +-- Name: reserved_domains id; Type: DEFAULT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.reserved_domains ALTER COLUMN id SET DEFAULT nextval('audit.reserved_domains_id_seq'::regclass); + + +-- +-- Name: settings id; Type: DEFAULT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.settings ALTER COLUMN id SET DEFAULT nextval('audit.settings_id_seq'::regclass); + + +-- +-- Name: users id; Type: DEFAULT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.users ALTER COLUMN id SET DEFAULT nextval('audit.users_id_seq'::regclass); + + +-- +-- Name: white_ips id; Type: DEFAULT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.white_ips ALTER COLUMN id SET DEFAULT nextval('audit.white_ips_id_seq'::regclass); + + +-- +-- Name: account_activities id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.account_activities ALTER COLUMN id SET DEFAULT nextval('public.account_activities_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: accounts id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.accounts ALTER COLUMN id SET DEFAULT nextval('public.accounts_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: actions id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.actions ALTER COLUMN id SET DEFAULT nextval('public.actions_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: auctions id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.auctions ALTER COLUMN id SET DEFAULT nextval('public.auctions_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: bank_statements id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.bank_statements ALTER COLUMN id SET DEFAULT nextval('public.bank_statements_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: bank_transactions id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.bank_transactions ALTER COLUMN id SET DEFAULT nextval('public.bank_transactions_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: blocked_domains id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.blocked_domains ALTER COLUMN id SET DEFAULT nextval('public.blocked_domains_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: certificates id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.certificates ALTER COLUMN id SET DEFAULT nextval('public.certificates_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: contacts id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.contacts ALTER COLUMN id SET DEFAULT nextval('public.contacts_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: directos id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.directos ALTER COLUMN id SET DEFAULT nextval('public.directos_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: disputes id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.disputes ALTER COLUMN id SET DEFAULT nextval('public.disputes_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: dnskeys id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.dnskeys ALTER COLUMN id SET DEFAULT nextval('public.dnskeys_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: domain_contacts id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_contacts ALTER COLUMN id SET DEFAULT nextval('public.domain_contacts_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: domain_transfers id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_transfers ALTER COLUMN id SET DEFAULT nextval('public.domain_transfers_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: domains id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domains ALTER COLUMN id SET DEFAULT nextval('public.domains_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: email_address_verifications id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.email_address_verifications ALTER COLUMN id SET DEFAULT nextval('public.email_address_verifications_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: email_addresses_validations id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.email_addresses_validations ALTER COLUMN id SET DEFAULT nextval('public.email_addresses_validations_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: email_addresses_verifications id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.email_addresses_verifications ALTER COLUMN id SET DEFAULT nextval('public.email_addresses_verifications_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: epp_sessions id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.epp_sessions ALTER COLUMN id SET DEFAULT nextval('public.epp_sessions_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: invoice_items id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.invoice_items ALTER COLUMN id SET DEFAULT nextval('public.invoice_items_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: invoices id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.invoices ALTER COLUMN id SET DEFAULT nextval('public.invoices_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: legal_documents id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.legal_documents ALTER COLUMN id SET DEFAULT nextval('public.legal_documents_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: log_account_activities id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_account_activities ALTER COLUMN id SET DEFAULT nextval('public.log_account_activities_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: log_accounts id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_accounts ALTER COLUMN id SET DEFAULT nextval('public.log_accounts_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: log_actions id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_actions ALTER COLUMN id SET DEFAULT nextval('public.log_actions_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: log_bank_statements id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_bank_statements ALTER COLUMN id SET DEFAULT nextval('public.log_bank_statements_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: log_bank_transactions id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_bank_transactions ALTER COLUMN id SET DEFAULT nextval('public.log_bank_transactions_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: log_blocked_domains id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_blocked_domains ALTER COLUMN id SET DEFAULT nextval('public.log_blocked_domains_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: log_certificates id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_certificates ALTER COLUMN id SET DEFAULT nextval('public.log_certificates_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: log_contacts id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_contacts ALTER COLUMN id SET DEFAULT nextval('public.log_contacts_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: log_dnskeys id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_dnskeys ALTER COLUMN id SET DEFAULT nextval('public.log_dnskeys_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: log_domain_contacts id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_domain_contacts ALTER COLUMN id SET DEFAULT nextval('public.log_domain_contacts_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: log_domains id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_domains ALTER COLUMN id SET DEFAULT nextval('public.log_domains_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: log_invoice_items id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_invoice_items ALTER COLUMN id SET DEFAULT nextval('public.log_invoice_items_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: log_invoices id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_invoices ALTER COLUMN id SET DEFAULT nextval('public.log_invoices_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: log_nameservers id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_nameservers ALTER COLUMN id SET DEFAULT nextval('public.log_nameservers_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: log_notifications id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_notifications ALTER COLUMN id SET DEFAULT nextval('public.log_notifications_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: log_payment_orders id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_payment_orders ALTER COLUMN id SET DEFAULT nextval('public.log_payment_orders_id_seq'::regclass); @@ -2892,154 +4424,330 @@ ALTER TABLE ONLY public.log_registrant_verifications ALTER COLUMN id SET DEFAULT -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: log_registrars id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_registrars ALTER COLUMN id SET DEFAULT nextval('public.log_registrars_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: log_reserved_domains id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_reserved_domains ALTER COLUMN id SET DEFAULT nextval('public.log_reserved_domains_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: log_setting_entries id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_setting_entries ALTER COLUMN id SET DEFAULT nextval('public.log_setting_entries_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: log_settings id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_settings ALTER COLUMN id SET DEFAULT nextval('public.log_settings_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: log_users id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_users ALTER COLUMN id SET DEFAULT nextval('public.log_users_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: log_white_ips id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_white_ips ALTER COLUMN id SET DEFAULT nextval('public.log_white_ips_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: nameservers id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.nameservers ALTER COLUMN id SET DEFAULT nextval('public.nameservers_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: notifications id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.notifications ALTER COLUMN id SET DEFAULT nextval('public.notifications_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: payment_orders id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.payment_orders ALTER COLUMN id SET DEFAULT nextval('public.payment_orders_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: prices id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.prices ALTER COLUMN id SET DEFAULT nextval('public.prices_id_seq'::regclass); -- --- Name: job_id; Type: DEFAULT; Schema: public; Owner: - +-- Name: que_jobs job_id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.que_jobs ALTER COLUMN job_id SET DEFAULT nextval('public.que_jobs_job_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: registrant_verifications id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.registrant_verifications ALTER COLUMN id SET DEFAULT nextval('public.registrant_verifications_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: registrars id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.registrars ALTER COLUMN id SET DEFAULT nextval('public.registrars_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: reserved_domains id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.reserved_domains ALTER COLUMN id SET DEFAULT nextval('public.reserved_domains_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: setting_entries id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.setting_entries ALTER COLUMN id SET DEFAULT nextval('public.setting_entries_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: settings id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.settings ALTER COLUMN id SET DEFAULT nextval('public.settings_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: users id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: versions id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.versions ALTER COLUMN id SET DEFAULT nextval('public.versions_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: white_ips id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.white_ips ALTER COLUMN id SET DEFAULT nextval('public.white_ips_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: whois_records id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.whois_records ALTER COLUMN id SET DEFAULT nextval('public.whois_records_id_seq'::regclass); -- --- Name: id; Type: DEFAULT; Schema: public; Owner: - +-- Name: zones id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.zones ALTER COLUMN id SET DEFAULT nextval('public.zones_id_seq'::regclass); -- --- Name: account_activities_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: account_activities account_activities_pkey; Type: CONSTRAINT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.account_activities + ADD CONSTRAINT account_activities_pkey PRIMARY KEY (id); + + +-- +-- Name: accounts accounts_pkey; Type: CONSTRAINT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.accounts + ADD CONSTRAINT accounts_pkey PRIMARY KEY (id); + + +-- +-- Name: actions actions_pkey; Type: CONSTRAINT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.actions + ADD CONSTRAINT actions_pkey PRIMARY KEY (id); + + +-- +-- Name: bank_statements bank_statements_pkey; Type: CONSTRAINT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.bank_statements + ADD CONSTRAINT bank_statements_pkey PRIMARY KEY (id); + + +-- +-- Name: bank_transactions bank_transactions_pkey; Type: CONSTRAINT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.bank_transactions + ADD CONSTRAINT bank_transactions_pkey PRIMARY KEY (id); + + +-- +-- Name: blocked_domains blocked_domains_pkey; Type: CONSTRAINT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.blocked_domains + ADD CONSTRAINT blocked_domains_pkey PRIMARY KEY (id); + + +-- +-- Name: certificates certificates_pkey; Type: CONSTRAINT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.certificates + ADD CONSTRAINT certificates_pkey PRIMARY KEY (id); + + +-- +-- Name: contacts contacts_pkey; Type: CONSTRAINT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.contacts + ADD CONSTRAINT contacts_pkey PRIMARY KEY (id); + + +-- +-- Name: dnskeys dnskeys_pkey; Type: CONSTRAINT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.dnskeys + ADD CONSTRAINT dnskeys_pkey PRIMARY KEY (id); + + +-- +-- Name: domain_contacts domain_contacts_pkey; Type: CONSTRAINT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.domain_contacts + ADD CONSTRAINT domain_contacts_pkey PRIMARY KEY (id); + + +-- +-- Name: domains domains_pkey; Type: CONSTRAINT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.domains + ADD CONSTRAINT domains_pkey PRIMARY KEY (id); + + +-- +-- Name: invoice_items invoice_items_pkey; Type: CONSTRAINT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.invoice_items + ADD CONSTRAINT invoice_items_pkey PRIMARY KEY (id); + + +-- +-- Name: invoices invoices_pkey; Type: CONSTRAINT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.invoices + ADD CONSTRAINT invoices_pkey PRIMARY KEY (id); + + +-- +-- Name: nameservers nameservers_pkey; Type: CONSTRAINT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.nameservers + ADD CONSTRAINT nameservers_pkey PRIMARY KEY (id); + + +-- +-- Name: notifications notifications_pkey; Type: CONSTRAINT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.notifications + ADD CONSTRAINT notifications_pkey PRIMARY KEY (id); + + +-- +-- Name: payment_orders payment_orders_pkey; Type: CONSTRAINT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.payment_orders + ADD CONSTRAINT payment_orders_pkey PRIMARY KEY (id); + + +-- +-- Name: registrant_verifications registrant_verifications_pkey; Type: CONSTRAINT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.registrant_verifications + ADD CONSTRAINT registrant_verifications_pkey PRIMARY KEY (id); + + +-- +-- Name: registrars registrars_pkey; Type: CONSTRAINT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.registrars + ADD CONSTRAINT registrars_pkey PRIMARY KEY (id); + + +-- +-- Name: reserved_domains reserved_domains_pkey; Type: CONSTRAINT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.reserved_domains + ADD CONSTRAINT reserved_domains_pkey PRIMARY KEY (id); + + +-- +-- Name: settings settings_pkey; Type: CONSTRAINT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.settings + ADD CONSTRAINT settings_pkey PRIMARY KEY (id); + + +-- +-- Name: users users_pkey; Type: CONSTRAINT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.users + ADD CONSTRAINT users_pkey PRIMARY KEY (id); + + +-- +-- Name: white_ips white_ips_pkey; Type: CONSTRAINT; Schema: audit; Owner: - +-- + +ALTER TABLE ONLY audit.white_ips + ADD CONSTRAINT white_ips_pkey PRIMARY KEY (id); + + +-- +-- Name: account_activities account_activities_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.account_activities @@ -3047,7 +4755,7 @@ ALTER TABLE ONLY public.account_activities -- --- Name: accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: accounts accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.accounts @@ -3055,7 +4763,7 @@ ALTER TABLE ONLY public.accounts -- --- Name: actions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: actions actions_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.actions @@ -3063,7 +4771,7 @@ ALTER TABLE ONLY public.actions -- --- Name: ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: ar_internal_metadata ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.ar_internal_metadata @@ -3071,7 +4779,7 @@ ALTER TABLE ONLY public.ar_internal_metadata -- --- Name: auctions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: auctions auctions_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.auctions @@ -3079,7 +4787,7 @@ ALTER TABLE ONLY public.auctions -- --- Name: bank_statements_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: bank_statements bank_statements_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.bank_statements @@ -3087,7 +4795,7 @@ ALTER TABLE ONLY public.bank_statements -- --- Name: bank_transactions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: bank_transactions bank_transactions_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.bank_transactions @@ -3095,7 +4803,7 @@ ALTER TABLE ONLY public.bank_transactions -- --- Name: blocked_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: blocked_domains blocked_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.blocked_domains @@ -3103,7 +4811,7 @@ ALTER TABLE ONLY public.blocked_domains -- --- Name: certificates_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: certificates certificates_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.certificates @@ -3111,7 +4819,7 @@ ALTER TABLE ONLY public.certificates -- --- Name: contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: contacts contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.contacts @@ -3119,7 +4827,7 @@ ALTER TABLE ONLY public.contacts -- --- Name: directos_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: directos directos_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.directos @@ -3127,7 +4835,7 @@ ALTER TABLE ONLY public.directos -- --- Name: disputes_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: disputes disputes_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.disputes @@ -3135,7 +4843,7 @@ ALTER TABLE ONLY public.disputes -- --- Name: dnskeys_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: dnskeys dnskeys_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.dnskeys @@ -3143,7 +4851,7 @@ ALTER TABLE ONLY public.dnskeys -- --- Name: domain_contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: domain_contacts domain_contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_contacts @@ -3151,7 +4859,7 @@ ALTER TABLE ONLY public.domain_contacts -- --- Name: domain_transfers_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: domain_transfers domain_transfers_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_transfers @@ -3159,7 +4867,7 @@ ALTER TABLE ONLY public.domain_transfers -- --- Name: domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: domains domains_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domains @@ -3167,7 +4875,7 @@ ALTER TABLE ONLY public.domains -- --- Name: email_address_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: email_address_verifications email_address_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.email_address_verifications @@ -3175,7 +4883,7 @@ ALTER TABLE ONLY public.email_address_verifications -- --- Name: email_addresses_validations_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: email_addresses_validations email_addresses_validations_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.email_addresses_validations @@ -3183,7 +4891,7 @@ ALTER TABLE ONLY public.email_addresses_validations -- --- Name: email_addresses_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: email_addresses_verifications email_addresses_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.email_addresses_verifications @@ -3191,7 +4899,7 @@ ALTER TABLE ONLY public.email_addresses_verifications -- --- Name: epp_sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: epp_sessions epp_sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.epp_sessions @@ -3199,7 +4907,7 @@ ALTER TABLE ONLY public.epp_sessions -- --- Name: invoice_items_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: invoice_items invoice_items_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.invoice_items @@ -3207,7 +4915,7 @@ ALTER TABLE ONLY public.invoice_items -- --- Name: invoices_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: invoices invoices_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.invoices @@ -3215,7 +4923,7 @@ ALTER TABLE ONLY public.invoices -- --- Name: legal_documents_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: legal_documents legal_documents_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.legal_documents @@ -3223,7 +4931,7 @@ ALTER TABLE ONLY public.legal_documents -- --- Name: log_account_activities_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_account_activities log_account_activities_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_account_activities @@ -3231,7 +4939,7 @@ ALTER TABLE ONLY public.log_account_activities -- --- Name: log_accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_accounts log_accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_accounts @@ -3239,7 +4947,7 @@ ALTER TABLE ONLY public.log_accounts -- --- Name: log_actions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_actions log_actions_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_actions @@ -3247,7 +4955,7 @@ ALTER TABLE ONLY public.log_actions -- --- Name: log_bank_statements_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_bank_statements log_bank_statements_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_bank_statements @@ -3255,7 +4963,7 @@ ALTER TABLE ONLY public.log_bank_statements -- --- Name: log_bank_transactions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_bank_transactions log_bank_transactions_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_bank_transactions @@ -3263,7 +4971,7 @@ ALTER TABLE ONLY public.log_bank_transactions -- --- Name: log_blocked_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_blocked_domains log_blocked_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_blocked_domains @@ -3271,7 +4979,7 @@ ALTER TABLE ONLY public.log_blocked_domains -- --- Name: log_certificates_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_certificates log_certificates_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_certificates @@ -3279,7 +4987,7 @@ ALTER TABLE ONLY public.log_certificates -- --- Name: log_contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_contacts log_contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_contacts @@ -3287,7 +4995,7 @@ ALTER TABLE ONLY public.log_contacts -- --- Name: log_dnskeys_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_dnskeys log_dnskeys_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_dnskeys @@ -3295,7 +5003,7 @@ ALTER TABLE ONLY public.log_dnskeys -- --- Name: log_domain_contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_domain_contacts log_domain_contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_domain_contacts @@ -3303,7 +5011,7 @@ ALTER TABLE ONLY public.log_domain_contacts -- --- Name: log_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_domains log_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_domains @@ -3311,7 +5019,7 @@ ALTER TABLE ONLY public.log_domains -- --- Name: log_invoice_items_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_invoice_items log_invoice_items_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_invoice_items @@ -3319,7 +5027,7 @@ ALTER TABLE ONLY public.log_invoice_items -- --- Name: log_invoices_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_invoices log_invoices_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_invoices @@ -3327,7 +5035,7 @@ ALTER TABLE ONLY public.log_invoices -- --- Name: log_nameservers_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_nameservers log_nameservers_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_nameservers @@ -3335,7 +5043,7 @@ ALTER TABLE ONLY public.log_nameservers -- --- Name: log_notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_notifications log_notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_notifications @@ -3343,7 +5051,7 @@ ALTER TABLE ONLY public.log_notifications -- --- Name: log_payment_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_payment_orders log_payment_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_payment_orders @@ -3367,7 +5075,7 @@ ALTER TABLE ONLY public.log_registrant_verifications -- --- Name: log_registrars_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_registrars log_registrars_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_registrars @@ -3375,7 +5083,7 @@ ALTER TABLE ONLY public.log_registrars -- --- Name: log_reserved_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_reserved_domains log_reserved_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_reserved_domains @@ -3383,7 +5091,7 @@ ALTER TABLE ONLY public.log_reserved_domains -- --- Name: log_setting_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_setting_entries log_setting_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_setting_entries @@ -3391,7 +5099,7 @@ ALTER TABLE ONLY public.log_setting_entries -- --- Name: log_settings_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_settings log_settings_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_settings @@ -3399,7 +5107,7 @@ ALTER TABLE ONLY public.log_settings -- --- Name: log_users_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_users log_users_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_users @@ -3407,7 +5115,7 @@ ALTER TABLE ONLY public.log_users -- --- Name: log_white_ips_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: log_white_ips log_white_ips_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_white_ips @@ -3415,7 +5123,7 @@ ALTER TABLE ONLY public.log_white_ips -- --- Name: nameservers_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: nameservers nameservers_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.nameservers @@ -3423,7 +5131,7 @@ ALTER TABLE ONLY public.nameservers -- --- Name: notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: notifications notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.notifications @@ -3431,7 +5139,7 @@ ALTER TABLE ONLY public.notifications -- --- Name: payment_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: payment_orders payment_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.payment_orders @@ -3439,7 +5147,7 @@ ALTER TABLE ONLY public.payment_orders -- --- Name: prices_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: prices prices_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.prices @@ -3447,7 +5155,7 @@ ALTER TABLE ONLY public.prices -- --- Name: que_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: que_jobs que_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.que_jobs @@ -3455,7 +5163,7 @@ ALTER TABLE ONLY public.que_jobs -- --- Name: registrant_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: registrant_verifications registrant_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.registrant_verifications @@ -3463,7 +5171,7 @@ ALTER TABLE ONLY public.registrant_verifications -- --- Name: registrars_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: registrars registrars_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.registrars @@ -3471,7 +5179,7 @@ ALTER TABLE ONLY public.registrars -- --- Name: reserved_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: reserved_domains reserved_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.reserved_domains @@ -3479,7 +5187,7 @@ ALTER TABLE ONLY public.reserved_domains -- --- Name: setting_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: setting_entries setting_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.setting_entries @@ -3487,7 +5195,7 @@ ALTER TABLE ONLY public.setting_entries -- --- Name: settings_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: settings settings_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.settings @@ -3495,7 +5203,7 @@ ALTER TABLE ONLY public.settings -- --- Name: uniq_blocked_domains_name; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: blocked_domains uniq_blocked_domains_name; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.blocked_domains @@ -3503,7 +5211,7 @@ ALTER TABLE ONLY public.blocked_domains -- --- Name: uniq_contact_of_type_per_domain; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: domain_contacts uniq_contact_of_type_per_domain; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_contacts @@ -3511,7 +5219,7 @@ ALTER TABLE ONLY public.domain_contacts -- --- Name: uniq_contact_uuid; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: contacts uniq_contact_uuid; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.contacts @@ -3519,7 +5227,7 @@ ALTER TABLE ONLY public.contacts -- --- Name: uniq_domain_uuid; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: domains uniq_domain_uuid; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domains @@ -3527,7 +5235,7 @@ ALTER TABLE ONLY public.domains -- --- Name: uniq_hostname_per_domain; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: nameservers uniq_hostname_per_domain; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.nameservers @@ -3535,7 +5243,7 @@ ALTER TABLE ONLY public.nameservers -- --- Name: uniq_reserved_domains_name; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: reserved_domains uniq_reserved_domains_name; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.reserved_domains @@ -3543,7 +5251,7 @@ ALTER TABLE ONLY public.reserved_domains -- --- Name: uniq_uuid; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: auctions uniq_uuid; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.auctions @@ -3551,7 +5259,7 @@ ALTER TABLE ONLY public.auctions -- --- Name: unique_code; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: registrars unique_code; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.registrars @@ -3559,7 +5267,7 @@ ALTER TABLE ONLY public.registrars -- --- Name: unique_contact_code; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: contacts unique_contact_code; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.contacts @@ -3567,7 +5275,7 @@ ALTER TABLE ONLY public.contacts -- --- Name: unique_name; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: registrars unique_name; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.registrars @@ -3575,7 +5283,7 @@ ALTER TABLE ONLY public.registrars -- --- Name: unique_number; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: invoices unique_number; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.invoices @@ -3583,7 +5291,7 @@ ALTER TABLE ONLY public.invoices -- --- Name: unique_reference_no; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: registrars unique_reference_no; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.registrars @@ -3591,7 +5299,7 @@ ALTER TABLE ONLY public.registrars -- --- Name: unique_registration_code; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: auctions unique_registration_code; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.auctions @@ -3599,7 +5307,7 @@ ALTER TABLE ONLY public.auctions -- --- Name: unique_session_id; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: epp_sessions unique_session_id; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.epp_sessions @@ -3607,7 +5315,7 @@ ALTER TABLE ONLY public.epp_sessions -- --- Name: unique_zone_origin; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: zones unique_zone_origin; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.zones @@ -3615,7 +5323,7 @@ ALTER TABLE ONLY public.zones -- --- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.users @@ -3623,7 +5331,7 @@ ALTER TABLE ONLY public.users -- --- Name: versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: versions versions_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.versions @@ -3631,7 +5339,7 @@ ALTER TABLE ONLY public.versions -- --- Name: white_ips_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: white_ips white_ips_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.white_ips @@ -3639,7 +5347,7 @@ ALTER TABLE ONLY public.white_ips -- --- Name: whois_records_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: whois_records whois_records_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.whois_records @@ -3647,7 +5355,7 @@ ALTER TABLE ONLY public.whois_records -- --- Name: zones_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: +-- Name: zones zones_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.zones @@ -3655,622 +5363,1113 @@ ALTER TABLE ONLY public.zones -- --- Name: index_account_activities_on_account_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: account_activities_object_id_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX account_activities_object_id_idx ON audit.account_activities USING btree (object_id); + + +-- +-- Name: account_activities_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX account_activities_recorded_at_idx ON audit.account_activities USING btree (recorded_at); + + +-- +-- Name: accounts_object_id_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX accounts_object_id_idx ON audit.accounts USING btree (object_id); + + +-- +-- Name: accounts_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX accounts_recorded_at_idx ON audit.accounts USING btree (recorded_at); + + +-- +-- Name: actions_object_id_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX actions_object_id_idx ON audit.actions USING btree (object_id); + + +-- +-- Name: actions_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX actions_recorded_at_idx ON audit.actions USING btree (recorded_at); + + +-- +-- Name: bank_statements_object_id_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX bank_statements_object_id_idx ON audit.bank_statements USING btree (object_id); + + +-- +-- Name: bank_statements_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX bank_statements_recorded_at_idx ON audit.bank_statements USING btree (recorded_at); + + +-- +-- Name: bank_transactions_object_id_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX bank_transactions_object_id_idx ON audit.bank_transactions USING btree (object_id); + + +-- +-- Name: bank_transactions_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX bank_transactions_recorded_at_idx ON audit.bank_transactions USING btree (recorded_at); + + +-- +-- Name: blocked_domains_object_id_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX blocked_domains_object_id_idx ON audit.blocked_domains USING btree (object_id); + + +-- +-- Name: blocked_domains_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX blocked_domains_recorded_at_idx ON audit.blocked_domains USING btree (recorded_at); + + +-- +-- Name: certificates_object_id_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX certificates_object_id_idx ON audit.certificates USING btree (object_id); + + +-- +-- Name: certificates_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX certificates_recorded_at_idx ON audit.certificates USING btree (recorded_at); + + +-- +-- Name: contacts_object_id_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX contacts_object_id_idx ON audit.contacts USING btree (object_id); + + +-- +-- Name: contacts_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX contacts_recorded_at_idx ON audit.contacts USING btree (recorded_at); + + +-- +-- Name: dnskeys_object_id_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX dnskeys_object_id_idx ON audit.dnskeys USING btree (object_id); + + +-- +-- Name: dnskeys_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX dnskeys_recorded_at_idx ON audit.dnskeys USING btree (recorded_at); + + +-- +-- Name: domain_contacts_object_id_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX domain_contacts_object_id_idx ON audit.domain_contacts USING btree (object_id); + + +-- +-- Name: domain_contacts_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX domain_contacts_recorded_at_idx ON audit.domain_contacts USING btree (recorded_at); + + +-- +-- Name: domains_object_id_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX domains_object_id_idx ON audit.domains USING btree (object_id); + + +-- +-- Name: domains_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX domains_recorded_at_idx ON audit.domains USING btree (recorded_at); + + +-- +-- Name: invoice_items_object_id_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX invoice_items_object_id_idx ON audit.invoice_items USING btree (object_id); + + +-- +-- Name: invoice_items_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX invoice_items_recorded_at_idx ON audit.invoice_items USING btree (recorded_at); + + +-- +-- Name: invoices_object_id_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX invoices_object_id_idx ON audit.invoices USING btree (object_id); + + +-- +-- Name: invoices_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX invoices_recorded_at_idx ON audit.invoices USING btree (recorded_at); + + +-- +-- Name: nameservers_object_id_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX nameservers_object_id_idx ON audit.nameservers USING btree (object_id); + + +-- +-- Name: nameservers_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX nameservers_recorded_at_idx ON audit.nameservers USING btree (recorded_at); + + +-- +-- Name: notifications_object_id_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX notifications_object_id_idx ON audit.notifications USING btree (object_id); + + +-- +-- Name: notifications_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX notifications_recorded_at_idx ON audit.notifications USING btree (recorded_at); + + +-- +-- Name: payment_orders_object_id_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX payment_orders_object_id_idx ON audit.payment_orders USING btree (object_id); + + +-- +-- Name: payment_orders_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX payment_orders_recorded_at_idx ON audit.payment_orders USING btree (recorded_at); + + +-- +-- Name: registrant_verifications_object_id_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX registrant_verifications_object_id_idx ON audit.registrant_verifications USING btree (object_id); + + +-- +-- Name: registrant_verifications_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX registrant_verifications_recorded_at_idx ON audit.registrant_verifications USING btree (recorded_at); + + +-- +-- Name: registrars_object_id_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX registrars_object_id_idx ON audit.registrars USING btree (object_id); + + +-- +-- Name: registrars_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX registrars_recorded_at_idx ON audit.registrars USING btree (recorded_at); + + +-- +-- Name: reserved_domains_object_id_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX reserved_domains_object_id_idx ON audit.reserved_domains USING btree (object_id); + + +-- +-- Name: reserved_domains_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX reserved_domains_recorded_at_idx ON audit.reserved_domains USING btree (recorded_at); + + +-- +-- Name: settings_object_id_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX settings_object_id_idx ON audit.settings USING btree (object_id); + + +-- +-- Name: settings_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX settings_recorded_at_idx ON audit.settings USING btree (recorded_at); + + +-- +-- Name: users_object_id_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX users_object_id_idx ON audit.users USING btree (object_id); + + +-- +-- Name: users_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX users_recorded_at_idx ON audit.users USING btree (recorded_at); + + +-- +-- Name: white_ips_object_id_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX white_ips_object_id_idx ON audit.white_ips USING btree (object_id); + + +-- +-- Name: white_ips_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - +-- + +CREATE INDEX white_ips_recorded_at_idx ON audit.white_ips USING btree (recorded_at); + + +-- +-- Name: index_account_activities_on_account_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_account_activities_on_account_id ON public.account_activities USING btree (account_id); -- --- Name: index_account_activities_on_bank_transaction_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_account_activities_on_bank_transaction_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_account_activities_on_bank_transaction_id ON public.account_activities USING btree (bank_transaction_id); -- --- Name: index_account_activities_on_invoice_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_account_activities_on_invoice_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_account_activities_on_invoice_id ON public.account_activities USING btree (invoice_id); -- --- Name: index_accounts_on_registrar_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_accounts_on_registrar_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_accounts_on_registrar_id ON public.accounts USING btree (registrar_id); -- --- Name: index_certificates_on_api_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_certificates_on_api_user_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_certificates_on_api_user_id ON public.certificates USING btree (api_user_id); -- --- Name: index_contacts_on_code; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_contacts_on_code; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_contacts_on_code ON public.contacts USING btree (code); -- --- Name: index_contacts_on_registrar_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_contacts_on_registrar_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_contacts_on_registrar_id ON public.contacts USING btree (registrar_id); -- --- Name: index_contacts_on_registrar_id_and_ident_type; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_contacts_on_registrar_id_and_ident_type; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_contacts_on_registrar_id_and_ident_type ON public.contacts USING btree (registrar_id, ident_type); -- --- Name: index_directos_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_directos_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_directos_on_item_type_and_item_id ON public.directos USING btree (item_type, item_id); -- --- Name: index_dnskeys_on_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_dnskeys_on_domain_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_dnskeys_on_domain_id ON public.dnskeys USING btree (domain_id); -- --- Name: index_dnskeys_on_legacy_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_dnskeys_on_legacy_domain_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_dnskeys_on_legacy_domain_id ON public.dnskeys USING btree (legacy_domain_id); -- --- Name: index_domain_contacts_on_contact_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_domain_contacts_on_contact_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_domain_contacts_on_contact_id ON public.domain_contacts USING btree (contact_id); -- --- Name: index_domain_contacts_on_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_domain_contacts_on_domain_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_domain_contacts_on_domain_id ON public.domain_contacts USING btree (domain_id); -- --- Name: index_domain_transfers_on_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_domain_transfers_on_domain_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_domain_transfers_on_domain_id ON public.domain_transfers USING btree (domain_id); -- --- Name: index_domains_on_delete_date; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_domains_on_delete_date; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_domains_on_delete_date ON public.domains USING btree (delete_date); -- --- Name: index_domains_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_domains_on_name; Type: INDEX; Schema: public; Owner: - -- CREATE UNIQUE INDEX index_domains_on_name ON public.domains USING btree (name); -- --- Name: index_domains_on_outzone_at; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_domains_on_outzone_at; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_domains_on_outzone_at ON public.domains USING btree (outzone_at); -- --- Name: index_domains_on_registrant_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_domains_on_registrant_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_domains_on_registrant_id ON public.domains USING btree (registrant_id); -- --- Name: index_domains_on_registrant_verification_asked_at; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_domains_on_registrant_verification_asked_at; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_domains_on_registrant_verification_asked_at ON public.domains USING btree (registrant_verification_asked_at); -- --- Name: index_domains_on_registrant_verification_token; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_domains_on_registrant_verification_token; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_domains_on_registrant_verification_token ON public.domains USING btree (registrant_verification_token); -- --- Name: index_domains_on_registrar_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_domains_on_registrar_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_domains_on_registrar_id ON public.domains USING btree (registrar_id); -- --- Name: index_domains_on_statuses; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_domains_on_statuses; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_domains_on_statuses ON public.domains USING gin (statuses); -- --- Name: index_email_address_verifications_on_domain; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_email_address_verifications_on_domain; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_email_address_verifications_on_domain ON public.email_address_verifications USING btree (domain); -- --- Name: index_epp_sessions_on_updated_at; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_email_address_verifications_on_email; Type: INDEX; Schema: public; Owner: - +-- + +CREATE UNIQUE INDEX index_email_address_verifications_on_email ON public.email_address_verifications USING btree (email); + + +-- +-- Name: index_email_addresses_validations_on_email; Type: INDEX; Schema: public; Owner: - +-- + +CREATE UNIQUE INDEX index_email_addresses_validations_on_email ON public.email_addresses_validations USING btree (email); + + +-- +-- Name: index_epp_sessions_on_updated_at; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_epp_sessions_on_updated_at ON public.epp_sessions USING btree (updated_at); -- --- Name: index_invoice_items_on_invoice_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_invoice_items_on_invoice_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_invoice_items_on_invoice_id ON public.invoice_items USING btree (invoice_id); -- --- Name: index_invoices_on_buyer_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_invoices_on_buyer_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_invoices_on_buyer_id ON public.invoices USING btree (buyer_id); -- --- Name: index_legal_documents_on_checksum; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_legal_documents_on_checksum; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_legal_documents_on_checksum ON public.legal_documents USING btree (checksum); -- --- Name: index_legal_documents_on_documentable_type_and_documentable_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_legal_documents_on_documentable_type_and_documentable_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_legal_documents_on_documentable_type_and_documentable_id ON public.legal_documents USING btree (documentable_type, documentable_id); -- --- Name: index_log_account_activities_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_account_activities_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_account_activities_on_item_type_and_item_id ON public.log_account_activities USING btree (item_type, item_id); -- --- Name: index_log_account_activities_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_account_activities_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_account_activities_on_whodunnit ON public.log_account_activities USING btree (whodunnit); -- --- Name: index_log_accounts_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_accounts_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_accounts_on_item_type_and_item_id ON public.log_accounts USING btree (item_type, item_id); -- --- Name: index_log_accounts_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_accounts_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_accounts_on_whodunnit ON public.log_accounts USING btree (whodunnit); -- --- Name: index_log_bank_statements_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_bank_statements_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_bank_statements_on_item_type_and_item_id ON public.log_bank_statements USING btree (item_type, item_id); -- --- Name: index_log_bank_statements_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_bank_statements_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_bank_statements_on_whodunnit ON public.log_bank_statements USING btree (whodunnit); -- --- Name: index_log_bank_transactions_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_bank_transactions_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_bank_transactions_on_item_type_and_item_id ON public.log_bank_transactions USING btree (item_type, item_id); -- --- Name: index_log_bank_transactions_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_bank_transactions_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_bank_transactions_on_whodunnit ON public.log_bank_transactions USING btree (whodunnit); -- --- Name: index_log_blocked_domains_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_blocked_domains_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_blocked_domains_on_item_type_and_item_id ON public.log_blocked_domains USING btree (item_type, item_id); -- --- Name: index_log_blocked_domains_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_blocked_domains_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_blocked_domains_on_whodunnit ON public.log_blocked_domains USING btree (whodunnit); -- --- Name: index_log_certificates_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_certificates_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_certificates_on_item_type_and_item_id ON public.log_certificates USING btree (item_type, item_id); -- --- Name: index_log_certificates_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_certificates_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_certificates_on_whodunnit ON public.log_certificates USING btree (whodunnit); -- --- Name: index_log_contacts_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_contacts_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_contacts_on_item_type_and_item_id ON public.log_contacts USING btree (item_type, item_id); -- --- Name: index_log_contacts_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_contacts_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_contacts_on_whodunnit ON public.log_contacts USING btree (whodunnit); -- --- Name: index_log_dnskeys_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_dnskeys_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_dnskeys_on_item_type_and_item_id ON public.log_dnskeys USING btree (item_type, item_id); -- --- Name: index_log_dnskeys_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_dnskeys_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_dnskeys_on_whodunnit ON public.log_dnskeys USING btree (whodunnit); -- --- Name: index_log_domain_contacts_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_domain_contacts_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_domain_contacts_on_item_type_and_item_id ON public.log_domain_contacts USING btree (item_type, item_id); -- --- Name: index_log_domain_contacts_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_domain_contacts_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_domain_contacts_on_whodunnit ON public.log_domain_contacts USING btree (whodunnit); -- --- Name: index_log_domains_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_domains_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_domains_on_item_type_and_item_id ON public.log_domains USING btree (item_type, item_id); -- --- Name: index_log_domains_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_domains_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_domains_on_whodunnit ON public.log_domains USING btree (whodunnit); -- --- Name: index_log_invoice_items_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_invoice_items_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_invoice_items_on_item_type_and_item_id ON public.log_invoice_items USING btree (item_type, item_id); -- --- Name: index_log_invoice_items_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_invoice_items_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_invoice_items_on_whodunnit ON public.log_invoice_items USING btree (whodunnit); -- --- Name: index_log_invoices_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_invoices_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_invoices_on_item_type_and_item_id ON public.log_invoices USING btree (item_type, item_id); -- --- Name: index_log_invoices_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_invoices_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_invoices_on_whodunnit ON public.log_invoices USING btree (whodunnit); -- --- Name: index_log_nameservers_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_nameservers_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_nameservers_on_item_type_and_item_id ON public.log_nameservers USING btree (item_type, item_id); -- --- Name: index_log_nameservers_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_nameservers_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_nameservers_on_whodunnit ON public.log_nameservers USING btree (whodunnit); -- --- Name: index_log_notifications_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_notifications_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_notifications_on_item_type_and_item_id ON public.log_notifications USING btree (item_type, item_id); -- --- Name: index_log_notifications_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_notifications_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_notifications_on_whodunnit ON public.log_notifications USING btree (whodunnit); -- --- Name: index_log_registrant_verifications_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_prices_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_log_prices_on_item_type_and_item_id ON public.log_prices USING btree (item_type, item_id); + + +-- +-- Name: index_log_prices_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_log_prices_on_whodunnit ON public.log_prices USING btree (whodunnit); + + +-- +-- Name: index_log_registrant_verifications_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_registrant_verifications_on_item_type_and_item_id ON public.log_registrant_verifications USING btree (item_type, item_id); -- --- Name: index_log_registrant_verifications_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_registrant_verifications_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_registrant_verifications_on_whodunnit ON public.log_registrant_verifications USING btree (whodunnit); -- --- Name: index_log_registrars_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_registrars_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_registrars_on_item_type_and_item_id ON public.log_registrars USING btree (item_type, item_id); -- --- Name: index_log_registrars_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_registrars_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_registrars_on_whodunnit ON public.log_registrars USING btree (whodunnit); -- --- Name: index_log_reserved_domains_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_reserved_domains_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_reserved_domains_on_item_type_and_item_id ON public.log_reserved_domains USING btree (item_type, item_id); -- --- Name: index_log_reserved_domains_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_reserved_domains_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_reserved_domains_on_whodunnit ON public.log_reserved_domains USING btree (whodunnit); -- --- Name: index_log_setting_entries_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_setting_entries_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_setting_entries_on_item_type_and_item_id ON public.log_setting_entries USING btree (item_type, item_id); -- --- Name: index_log_setting_entries_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_setting_entries_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_setting_entries_on_whodunnit ON public.log_setting_entries USING btree (whodunnit); -- --- Name: index_log_settings_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_settings_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_settings_on_item_type_and_item_id ON public.log_settings USING btree (item_type, item_id); -- --- Name: index_log_settings_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_settings_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_settings_on_whodunnit ON public.log_settings USING btree (whodunnit); -- --- Name: index_log_users_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_users_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_users_on_item_type_and_item_id ON public.log_users USING btree (item_type, item_id); -- --- Name: index_log_users_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_log_users_on_whodunnit; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_log_users_on_whodunnit ON public.log_users USING btree (whodunnit); -- --- Name: index_nameservers_on_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_nameservers_on_domain_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_nameservers_on_domain_id ON public.nameservers USING btree (domain_id); -- --- Name: index_notifications_on_registrar_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_notifications_on_registrar_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_notifications_on_registrar_id ON public.notifications USING btree (registrar_id); -- --- Name: index_payment_orders_on_invoice_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_payment_orders_on_invoice_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_payment_orders_on_invoice_id ON public.payment_orders USING btree (invoice_id); -- --- Name: index_prices_on_zone_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_prices_on_zone_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_prices_on_zone_id ON public.prices USING btree (zone_id); -- --- Name: index_registrant_verifications_on_created_at; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_registrant_verifications_on_created_at; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_registrant_verifications_on_created_at ON public.registrant_verifications USING btree (created_at); -- --- Name: index_registrant_verifications_on_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_registrant_verifications_on_domain_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_registrant_verifications_on_domain_id ON public.registrant_verifications USING btree (domain_id); -- --- Name: index_setting_entries_on_code; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_setting_entries_on_code; Type: INDEX; Schema: public; Owner: - -- CREATE UNIQUE INDEX index_setting_entries_on_code ON public.setting_entries USING btree (code); -- --- Name: index_settings_on_thing_type_and_thing_id_and_var; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_settings_on_thing_type_and_thing_id_and_var; Type: INDEX; Schema: public; Owner: - -- CREATE UNIQUE INDEX index_settings_on_thing_type_and_thing_id_and_var ON public.settings USING btree (thing_type, thing_id, var); -- --- Name: index_users_on_identity_code; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_users_on_identity_code; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_users_on_identity_code ON public.users USING btree (identity_code); + -- --- Name: index_users_on_provider_and_uid; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_users_on_provider_and_uid; Type: INDEX; Schema: public; Owner: - -- CREATE UNIQUE INDEX index_users_on_provider_and_uid ON public.users USING btree (provider, uid); -- --- Name: index_users_on_registrar_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_users_on_registrar_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_users_on_registrar_id ON public.users USING btree (registrar_id); -- --- Name: index_versions_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_versions_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_versions_on_item_type_and_item_id ON public.versions USING btree (item_type, item_id); -- --- Name: index_whois_records_on_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_whois_records_on_domain_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_whois_records_on_domain_id ON public.whois_records USING btree (domain_id); -- --- Name: index_whois_records_on_registrar_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: index_whois_records_on_registrar_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX index_whois_records_on_registrar_id ON public.whois_records USING btree (registrar_id); -- --- Name: log_contacts_object_legacy_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: log_contacts_object_legacy_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX log_contacts_object_legacy_id ON public.log_contacts USING btree ((((object ->> 'legacy_id'::text))::integer)); -- --- Name: log_dnskeys_object_legacy_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: log_dnskeys_object_legacy_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX log_dnskeys_object_legacy_id ON public.log_contacts USING btree ((((object ->> 'legacy_domain_id'::text))::integer)); -- --- Name: log_domains_object_legacy_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: log_domains_object_legacy_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX log_domains_object_legacy_id ON public.log_contacts USING btree ((((object ->> 'legacy_id'::text))::integer)); -- --- Name: log_nameservers_object_legacy_id; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: log_nameservers_object_legacy_id; Type: INDEX; Schema: public; Owner: - -- CREATE INDEX log_nameservers_object_legacy_id ON public.log_contacts USING btree ((((object ->> 'legacy_domain_id'::text))::integer)); -- --- Name: unique_data_migrations; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: unique_data_migrations; Type: INDEX; Schema: public; Owner: - -- CREATE UNIQUE INDEX unique_data_migrations ON public.data_migrations USING btree (version); -- --- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -; Tablespace: +-- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: - -- CREATE UNIQUE INDEX unique_schema_migrations ON public.schema_migrations USING btree (version); -- --- Name: contacts_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: account_activities process_account_activity_audit; Type: TRIGGER; Schema: public; Owner: - +-- + +CREATE TRIGGER process_account_activity_audit AFTER INSERT OR DELETE OR UPDATE ON public.account_activities FOR EACH ROW EXECUTE PROCEDURE public.process_account_activity_audit(); + + +-- +-- Name: accounts process_account_audit; Type: TRIGGER; Schema: public; Owner: - +-- + +CREATE TRIGGER process_account_audit AFTER INSERT OR DELETE OR UPDATE ON public.accounts FOR EACH ROW EXECUTE PROCEDURE public.process_account_audit(); + + +-- +-- Name: actions process_action_audit; Type: TRIGGER; Schema: public; Owner: - +-- + +CREATE TRIGGER process_action_audit AFTER INSERT OR DELETE OR UPDATE ON public.actions FOR EACH ROW EXECUTE PROCEDURE public.process_action_audit(); + + +-- +-- Name: bank_statements process_bank_statement_audit; Type: TRIGGER; Schema: public; Owner: - +-- + +CREATE TRIGGER process_bank_statement_audit AFTER INSERT OR DELETE OR UPDATE ON public.bank_statements FOR EACH ROW EXECUTE PROCEDURE public.process_bank_statement_audit(); + + +-- +-- Name: bank_transactions process_bank_transaction_audit; Type: TRIGGER; Schema: public; Owner: - +-- + +CREATE TRIGGER process_bank_transaction_audit AFTER INSERT OR DELETE OR UPDATE ON public.bank_transactions FOR EACH ROW EXECUTE PROCEDURE public.process_bank_transaction_audit(); + + +-- +-- Name: blocked_domains process_blocked_domain_audit; Type: TRIGGER; Schema: public; Owner: - +-- + +CREATE TRIGGER process_blocked_domain_audit AFTER INSERT OR DELETE OR UPDATE ON public.blocked_domains FOR EACH ROW EXECUTE PROCEDURE public.process_blocked_domain_audit(); + + +-- +-- Name: certificates process_certificate_audit; Type: TRIGGER; Schema: public; Owner: - +-- + +CREATE TRIGGER process_certificate_audit AFTER INSERT OR DELETE OR UPDATE ON public.certificates FOR EACH ROW EXECUTE PROCEDURE public.process_certificate_audit(); + + +-- +-- Name: contacts process_contact_audit; Type: TRIGGER; Schema: public; Owner: - +-- + +CREATE TRIGGER process_contact_audit AFTER INSERT OR DELETE OR UPDATE ON public.contacts FOR EACH ROW EXECUTE PROCEDURE public.process_contact_audit(); + + +-- +-- Name: dnskeys process_dnskey_audit; Type: TRIGGER; Schema: public; Owner: - +-- + +CREATE TRIGGER process_dnskey_audit AFTER INSERT OR DELETE OR UPDATE ON public.dnskeys FOR EACH ROW EXECUTE PROCEDURE public.process_dnskey_audit(); + + +-- +-- Name: domains process_domain_audit; Type: TRIGGER; Schema: public; Owner: - +-- + +CREATE TRIGGER process_domain_audit AFTER INSERT OR DELETE OR UPDATE ON public.domains FOR EACH ROW EXECUTE PROCEDURE public.process_domain_audit(); + + +-- +-- Name: domain_contacts process_domain_contact_audit; Type: TRIGGER; Schema: public; Owner: - +-- + +CREATE TRIGGER process_domain_contact_audit AFTER INSERT OR DELETE OR UPDATE ON public.domain_contacts FOR EACH ROW EXECUTE PROCEDURE public.process_domain_contact_audit(); + + +-- +-- Name: invoices process_invoice_audit; Type: TRIGGER; Schema: public; Owner: - +-- + +CREATE TRIGGER process_invoice_audit AFTER INSERT OR DELETE OR UPDATE ON public.invoices FOR EACH ROW EXECUTE PROCEDURE public.process_invoice_audit(); + + +-- +-- Name: invoice_items process_invoice_item_audit; Type: TRIGGER; Schema: public; Owner: - +-- + +CREATE TRIGGER process_invoice_item_audit AFTER INSERT OR DELETE OR UPDATE ON public.invoice_items FOR EACH ROW EXECUTE PROCEDURE public.process_invoice_item_audit(); + + +-- +-- Name: nameservers process_nameserver_audit; Type: TRIGGER; Schema: public; Owner: - +-- + +CREATE TRIGGER process_nameserver_audit AFTER INSERT OR DELETE OR UPDATE ON public.nameservers FOR EACH ROW EXECUTE PROCEDURE public.process_nameserver_audit(); + + +-- +-- Name: notifications process_notification_audit; Type: TRIGGER; Schema: public; Owner: - +-- + +CREATE TRIGGER process_notification_audit AFTER INSERT OR DELETE OR UPDATE ON public.notifications FOR EACH ROW EXECUTE PROCEDURE public.process_notification_audit(); + + +-- +-- Name: payment_orders process_payment_order_audit; Type: TRIGGER; Schema: public; Owner: - +-- + +CREATE TRIGGER process_payment_order_audit AFTER INSERT OR DELETE OR UPDATE ON public.payment_orders FOR EACH ROW EXECUTE PROCEDURE public.process_payment_order_audit(); + + +-- +-- Name: registrant_verifications process_registrant_verification_audit; Type: TRIGGER; Schema: public; Owner: - +-- + +CREATE TRIGGER process_registrant_verification_audit AFTER INSERT OR DELETE OR UPDATE ON public.registrant_verifications FOR EACH ROW EXECUTE PROCEDURE public.process_registrant_verification_audit(); + + +-- +-- Name: registrars process_registrar_audit; Type: TRIGGER; Schema: public; Owner: - +-- + +CREATE TRIGGER process_registrar_audit AFTER INSERT OR DELETE OR UPDATE ON public.registrars FOR EACH ROW EXECUTE PROCEDURE public.process_registrar_audit(); + + +-- +-- Name: reserved_domains process_reserved_domain_audit; Type: TRIGGER; Schema: public; Owner: - +-- + +CREATE TRIGGER process_reserved_domain_audit AFTER INSERT OR DELETE OR UPDATE ON public.reserved_domains FOR EACH ROW EXECUTE PROCEDURE public.process_reserved_domain_audit(); + + +-- +-- Name: settings process_setting_audit; Type: TRIGGER; Schema: public; Owner: - +-- + +CREATE TRIGGER process_setting_audit AFTER INSERT OR DELETE OR UPDATE ON public.settings FOR EACH ROW EXECUTE PROCEDURE public.process_setting_audit(); + + +-- +-- Name: users process_user_audit; Type: TRIGGER; Schema: public; Owner: - +-- + +CREATE TRIGGER process_user_audit AFTER INSERT OR DELETE OR UPDATE ON public.users FOR EACH ROW EXECUTE PROCEDURE public.process_user_audit(); + + +-- +-- Name: white_ips process_white_ip_audit; Type: TRIGGER; Schema: public; Owner: - +-- + +CREATE TRIGGER process_white_ip_audit AFTER INSERT OR DELETE OR UPDATE ON public.white_ips FOR EACH ROW EXECUTE PROCEDURE public.process_white_ip_audit(); + + +-- +-- Name: contacts contacts_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.contacts @@ -4278,7 +6477,7 @@ ALTER TABLE ONLY public.contacts -- --- Name: domain_contacts_contact_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: domain_contacts domain_contacts_contact_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_contacts @@ -4286,7 +6485,7 @@ ALTER TABLE ONLY public.domain_contacts -- --- Name: domain_contacts_domain_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: domain_contacts domain_contacts_domain_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_contacts @@ -4294,7 +6493,7 @@ ALTER TABLE ONLY public.domain_contacts -- --- Name: domains_registrant_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: domains domains_registrant_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domains @@ -4302,7 +6501,7 @@ ALTER TABLE ONLY public.domains -- --- Name: domains_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: domains domains_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domains @@ -4310,7 +6509,7 @@ ALTER TABLE ONLY public.domains -- --- Name: fk_rails_242b91538b; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: invoices fk_rails_242b91538b; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.invoices @@ -4318,7 +6517,7 @@ ALTER TABLE ONLY public.invoices -- --- Name: fk_rails_36cff3de9c; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: white_ips fk_rails_36cff3de9c; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.white_ips @@ -4326,7 +6525,7 @@ ALTER TABLE ONLY public.white_ips -- --- Name: fk_rails_59c422f73d; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: domain_transfers fk_rails_59c422f73d; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_transfers @@ -4334,7 +6533,7 @@ ALTER TABLE ONLY public.domain_transfers -- --- Name: fk_rails_78c376257f; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: prices fk_rails_78c376257f; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.prices @@ -4342,7 +6541,7 @@ ALTER TABLE ONLY public.prices -- --- Name: fk_rails_833ed7f3c0; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: domain_transfers fk_rails_833ed7f3c0; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_transfers @@ -4350,7 +6549,7 @@ ALTER TABLE ONLY public.domain_transfers -- --- Name: fk_rails_86cd2b09f5; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: account_activities fk_rails_86cd2b09f5; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.account_activities @@ -4358,7 +6557,7 @@ ALTER TABLE ONLY public.account_activities -- --- Name: fk_rails_87b8e40c63; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: domain_transfers fk_rails_87b8e40c63; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_transfers @@ -4366,7 +6565,7 @@ ALTER TABLE ONLY public.domain_transfers -- --- Name: fk_rails_8c6b5c12eb; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: actions fk_rails_8c6b5c12eb; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.actions @@ -4374,7 +6573,7 @@ ALTER TABLE ONLY public.actions -- --- Name: fk_rails_8f9734b530; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: notifications fk_rails_8f9734b530; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.notifications @@ -4382,7 +6581,7 @@ ALTER TABLE ONLY public.notifications -- --- Name: fk_rails_a5ae3c203d; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: actions fk_rails_a5ae3c203d; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.actions @@ -4390,7 +6589,7 @@ ALTER TABLE ONLY public.actions -- --- Name: fk_rails_adff2dc8e3; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: epp_sessions fk_rails_adff2dc8e3; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.epp_sessions @@ -4398,7 +6597,7 @@ ALTER TABLE ONLY public.epp_sessions -- --- Name: fk_rails_b80dbb973d; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: account_activities fk_rails_b80dbb973d; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.account_activities @@ -4406,7 +6605,7 @@ ALTER TABLE ONLY public.account_activities -- --- Name: fk_rails_c9f635c0b3; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: accounts fk_rails_c9f635c0b3; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.accounts @@ -4414,7 +6613,7 @@ ALTER TABLE ONLY public.accounts -- --- Name: fk_rails_ce38d749f6; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: account_activities fk_rails_ce38d749f6; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.account_activities @@ -4422,7 +6621,7 @@ ALTER TABLE ONLY public.account_activities -- --- Name: fk_rails_d2cc3c2fa9; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: account_activities fk_rails_d2cc3c2fa9; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.account_activities @@ -4430,7 +6629,7 @@ ALTER TABLE ONLY public.account_activities -- --- Name: fk_rails_f41617a0e9; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: registrant_verifications fk_rails_f41617a0e9; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.registrant_verifications @@ -4438,7 +6637,7 @@ ALTER TABLE ONLY public.registrant_verifications -- --- Name: fk_rails_f9dc5857c3; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: payment_orders fk_rails_f9dc5857c3; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.payment_orders @@ -4446,7 +6645,7 @@ ALTER TABLE ONLY public.payment_orders -- --- Name: invoice_items_invoice_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: invoice_items invoice_items_invoice_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.invoice_items @@ -4454,7 +6653,7 @@ ALTER TABLE ONLY public.invoice_items -- --- Name: messages_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: notifications messages_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.notifications @@ -4462,7 +6661,7 @@ ALTER TABLE ONLY public.notifications -- --- Name: nameservers_domain_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: nameservers nameservers_domain_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.nameservers @@ -4470,7 +6669,7 @@ ALTER TABLE ONLY public.nameservers -- --- Name: user_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: users user_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.users @@ -4896,7 +7095,14 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200130092113'), ('20200203143458'), ('20200204103125'), +('20200310105731'), +('20200310105736'), ('20200311114649'), +('20200319082650'), +('20200320090152'), +('20200320094842'), +('20200330111918'), +('20200408091005'), ('20200417075720'), ('20200421093637'), ('20200505103316'), @@ -4905,6 +7111,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200529115011'), ('20200605100827'), ('20200610090110'), +('20200622080240'), ('20200630081231'), ('20200714115338'), ('20200807110611'), @@ -4917,3 +7124,4 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200910102028'), ('20200915073245'); + From d256aa357e549d98f788f41d25fb47eed5fd297f Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Fri, 25 Sep 2020 11:25:46 +0500 Subject: [PATCH 22/79] Hardcode test tara creds to check on staging --- config/initializers/omniauth.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index 0e0ab9142..b99958efd 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -9,12 +9,12 @@ OmniAuth.config.logger = Rails.logger # Block GET requests to avoid exposing self to CVE-2015-9284 OmniAuth.config.allowed_request_methods = [:post] -signing_keys = ENV['tara_keys'] -issuer = ENV['tara_issuer'] -host = ENV['tara_host'] -identifier = ENV['tara_identifier'] -secret = ENV['tara_secret'] -redirect_uri = ENV['tara_redirect_uri'] +signing_keys = "{\"kty\":\"RSA\",\"kid\":\"de6cc4\",\"n\":\"jWwAjT_03ypme9ZWeSe7c-jY26NO50Wo5I1LBnPW2JLc0dPMj8v7y4ehiRpClYNTaSWcLd4DJmlKXDXXudEUWwXa7TtjBFJfzlZ-1u0tDvJ-H9zv9MzO7UhUFytztUEMTrtStdhGbzkzdEZZCgFYeo2i33eXxzIR1nGvI05d9Y-e_LHnNE2ZKTa89BC7ZiCXq5nfAaCgQna_knh4kFAX-KgiPRAtsiDHcAWKcBY3qUVcb-5XAX8p668MlGLukzsh5tFkQCbJVyNtmlbIHdbGvVHPb8C0H3oLYciv1Fjy_tS1lO7OT_cb3GVp6Ql-CG0uED_8pkpVtfsGRviub4_ElQ\",\"e\":\"AQAB\"}" +issuer = 'https://tara-test.ria.ee' +host = 'tara-test.ria.ee' +identifier = 'registripidaja_test' +secret = 'MdNnRBmc1JrDJUe_9h4qy52d' +redirect_uri = 'https://st-rar.infra.tld.ee/registrar/open_id/callback' Rails.application.config.middleware.use OmniAuth::Builder do provider "tara", { From 227c2f100dad8a38fcedffb786a37ccf9c5e031d Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Fri, 25 Sep 2020 13:20:27 +0500 Subject: [PATCH 23/79] Set OmniAuth on failure config --- Gemfile | 1 + Gemfile.lock | 1 + app/controllers/registrar/tara_controller.rb | 2 + app/models/api_user.rb | 2 +- app/models/registrant_user.rb | 2 +- config/environments/production.rb | 2 +- config/initializers/devise.rb | 10 +-- config/initializers/omniauth.rb | 20 ++--- .../strategies/id_card_authenticatable.rb | 84 +++++++++---------- 9 files changed, 64 insertions(+), 60 deletions(-) diff --git a/Gemfile b/Gemfile index 15d5f779c..6ba54e871 100644 --- a/Gemfile +++ b/Gemfile @@ -54,6 +54,7 @@ gem 'digidoc_client', ref: '1645e83a5a548addce383f75703b0275c5310c32' # TARA +gem 'omniauth' gem 'omniauth-rails_csrf_protection' gem 'omniauth-tara', github: 'internetee/omniauth-tara' diff --git a/Gemfile.lock b/Gemfile.lock index 574afc9df..1a45ed826 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -555,6 +555,7 @@ DEPENDENCIES minitest (~> 5.14) money-rails nokogiri + omniauth omniauth-rails_csrf_protection omniauth-tara! paper_trail (~> 10.3) diff --git a/app/controllers/registrar/tara_controller.rb b/app/controllers/registrar/tara_controller.rb index 0d0805e2d..5be54ec12 100644 --- a/app/controllers/registrar/tara_controller.rb +++ b/app/controllers/registrar/tara_controller.rb @@ -2,6 +2,8 @@ require 'tampering_detected' class Registrar class TaraController < ApplicationController + skip_authorization_check + rescue_from Errors::TamperingDetected do redirect_to root_url, alert: t('auth.tara.tampering') end diff --git a/app/models/api_user.rb b/app/models/api_user.rb index d7b264495..12096bae7 100644 --- a/app/models/api_user.rb +++ b/app/models/api_user.rb @@ -2,7 +2,7 @@ require 'open3' class ApiUser < User include EppErrors - devise :database_authenticatable, :trackable, :timeoutable, :id_card_authenticatable, + devise :database_authenticatable, :trackable, :timeoutable, #:id_card_authenticatable, authentication_keys: [:username] def epp_code_map diff --git a/app/models/registrant_user.rb b/app/models/registrant_user.rb index e7ce9cc3b..e739d4a9d 100644 --- a/app/models/registrant_user.rb +++ b/app/models/registrant_user.rb @@ -1,7 +1,7 @@ class RegistrantUser < User attr_accessor :idc_data - devise :trackable, :timeoutable, :id_card_authenticatable + devise :trackable, :timeoutable#, :id_card_authenticatable def ability @ability ||= Ability.new(self) diff --git a/config/environments/production.rb b/config/environments/production.rb index 6e13ea1f7..377166f29 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -43,7 +43,7 @@ Rails.application.configure do # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - # config.force_ssl = true + config.force_ssl = true # Use the lowest log level to ensure availability of diagnostic information # when problems arise. diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 10f937f40..3c1a9015c 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -9,7 +9,7 @@ Devise.setup do |config| # Devise will use the `secret_key_base` as its `secret_key` # by default. You can change it below and use your own secret key. config.secret_key = ENV['devise_secret'] - + # ==> Controller configuration # Configure the parent class to the devise controllers. # config.parent_controller = 'DeviseController' @@ -281,9 +281,9 @@ Devise.setup do |config| # so you need to do it manually. For the users scope, it would be: # config.omniauth_path_prefix = '/my_engine/users/auth' - require 'devise/models/id_card_authenticatable' - require 'devise/strategies/id_card_authenticatable' + # require 'devise/models/id_card_authenticatable' + # require 'devise/strategies/id_card_authenticatable' - routes = [nil, :new, :destroy] - config.add_module :id_card_authenticatable, strategy: true, route: { session: routes } + # routes = [nil, :new, :destroy] + # config.add_module :id_card_authenticatable, strategy: true, route: { session: routes } end diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index b99958efd..299ddceec 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -1,20 +1,20 @@ OpenIDConnect.logger = Rails.logger OpenIDConnect.debug! -OpenIDConnect.http_config do |config| - config.proxy = AuctionCenter::Application.config.customization.dig(:tara, :proxy) -end +OmniAuth.config.on_failure = Proc.new { |env| + OmniAuth::FailureEndpoint.new(env).redirect_to_failure +} OmniAuth.config.logger = Rails.logger # Block GET requests to avoid exposing self to CVE-2015-9284 OmniAuth.config.allowed_request_methods = [:post] -signing_keys = "{\"kty\":\"RSA\",\"kid\":\"de6cc4\",\"n\":\"jWwAjT_03ypme9ZWeSe7c-jY26NO50Wo5I1LBnPW2JLc0dPMj8v7y4ehiRpClYNTaSWcLd4DJmlKXDXXudEUWwXa7TtjBFJfzlZ-1u0tDvJ-H9zv9MzO7UhUFytztUEMTrtStdhGbzkzdEZZCgFYeo2i33eXxzIR1nGvI05d9Y-e_LHnNE2ZKTa89BC7ZiCXq5nfAaCgQna_knh4kFAX-KgiPRAtsiDHcAWKcBY3qUVcb-5XAX8p668MlGLukzsh5tFkQCbJVyNtmlbIHdbGvVHPb8C0H3oLYciv1Fjy_tS1lO7OT_cb3GVp6Ql-CG0uED_8pkpVtfsGRviub4_ElQ\",\"e\":\"AQAB\"}" -issuer = 'https://tara-test.ria.ee' -host = 'tara-test.ria.ee' -identifier = 'registripidaja_test' -secret = 'MdNnRBmc1JrDJUe_9h4qy52d' -redirect_uri = 'https://st-rar.infra.tld.ee/registrar/open_id/callback' +signing_keys = ENV['tara_keys'] +issuer = ENV['tara_issuer'] +host = ENV['tara_host'] +identifier = ENV['tara_identifier'] +secret = ENV['tara_secret'] +redirect_uri = ENV['tara_redirect_uri'] Rails.application.config.middleware.use OmniAuth::Builder do provider "tara", { @@ -36,7 +36,7 @@ Rails.application.config.middleware.use OmniAuth::Builder do userinfo_endpoint: nil, # Not implemented jwks_uri: '/oidc/jwks', - # Auction + # Registry identifier: identifier, secret: secret, redirect_uri: redirect_uri, diff --git a/lib/devise/strategies/id_card_authenticatable.rb b/lib/devise/strategies/id_card_authenticatable.rb index ec26bb4d9..5ee6bf75d 100644 --- a/lib/devise/strategies/id_card_authenticatable.rb +++ b/lib/devise/strategies/id_card_authenticatable.rb @@ -1,49 +1,49 @@ module Devise module Strategies class IdCardAuthenticatable < Devise::Strategies::Authenticatable - def valid? - env['SSL_CLIENT_S_DN_CN'].present? - end - - def authenticate! - resource = mapping.to - user = resource.find_by_id_card(id_card) - - if user - success!(user) - else - fail - end - end - - private - - def id_card - id_card = IdCard.new - id_card.first_name = first_name - id_card.last_name = last_name - id_card.personal_code = personal_code - id_card.country_code = country_code - id_card - end - - def first_name - env['SSL_CLIENT_S_DN_CN'].split(',').second.force_encoding('utf-8') - end - - def last_name - env['SSL_CLIENT_S_DN_CN'].split(',').first.force_encoding('utf-8') - end - - def personal_code - env['SSL_CLIENT_S_DN_CN'].split(',').last - end - - def country_code - env['SSL_CLIENT_I_DN_C'] - end + # def valid? + # env['SSL_CLIENT_S_DN_CN'].present? + # end + # + # def authenticate! + # resource = mapping.to + # user = resource.find_by_id_card(id_card) + # + # if user + # success!(user) + # else + # fail + # end + # end + # + # private + # + # def id_card + # id_card = IdCard.new + # id_card.first_name = first_name + # id_card.last_name = last_name + # id_card.personal_code = personal_code + # id_card.country_code = country_code + # id_card + # end + # + # def first_name + # env['SSL_CLIENT_S_DN_CN'].split(',').second.force_encoding('utf-8') + # end + # + # def last_name + # env['SSL_CLIENT_S_DN_CN'].split(',').first.force_encoding('utf-8') + # end + # + # def personal_code + # env['SSL_CLIENT_S_DN_CN'].split(',').last + # end + # + # def country_code + # env['SSL_CLIENT_I_DN_C'] + # end end end end -Warden::Strategies.add(:id_card_authenticatable, Devise::Strategies::IdCardAuthenticatable) \ No newline at end of file +# Warden::Strategies.add(:id_card_authenticatable, Devise::Strategies::IdCardAuthenticatable) From c07b7bf7f20000ca9d21213f16b64c9361e77896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Mon, 28 Sep 2020 12:31:05 +0300 Subject: [PATCH 24/79] Disallow domain renew for renewProhibited domains --- app/models/domain.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/models/domain.rb b/app/models/domain.rb index e57117bc2..41fa29144 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -306,11 +306,12 @@ class Domain < ApplicationRecord end def renewable? - blocking_statuses = [DomainStatus::DELETE_CANDIDATE, DomainStatus::PENDING_RENEW, - DomainStatus::PENDING_TRANSFER, DomainStatus::DISPUTED, - DomainStatus::PENDING_UPDATE, DomainStatus::PENDING_DELETE, - DomainStatus::PENDING_DELETE_CONFIRMATION] - return false if statuses.include_any? blocking_statuses + disallowed = [DomainStatus::DELETE_CANDIDATE, DomainStatus::PENDING_RENEW, + DomainStatus::PENDING_TRANSFER, DomainStatus::CLIENT_RENEW_PROHIBITED, + DomainStatus::PENDING_UPDATE, DomainStatus::PENDING_DELETE, + DomainStatus::PENDING_DELETE_CONFIRMATION, DomainStatus::SERVER_RENEW_PROHIBITED] + + return false unless (statuses & disallowed).empty? return true unless Setting.days_to_renew_domain_before_expire != 0 # if you can renew domain at days_to_renew before domain expiration From a3042c39ee0c3b2a7781a022b76dc46d8f067f3e Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Mon, 28 Sep 2020 14:36:40 +0500 Subject: [PATCH 25/79] Try to set callback_path explicitly --- config/initializers/omniauth.rb | 1 + config/routes.rb | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index 299ddceec..ef5350384 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -18,6 +18,7 @@ redirect_uri = ENV['tara_redirect_uri'] Rails.application.config.middleware.use OmniAuth::Builder do provider "tara", { + callback_path: '/registrar/open_id/callback', name: 'tara', scope: ['openid'], state: Proc.new{ SecureRandom.hex(10) }, diff --git a/config/routes.rb b/config/routes.rb index b02c757fd..d88a2fdbc 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -77,14 +77,14 @@ Rails.application.routes.draw do devise_for :users, path: '', class_name: 'ApiUser', skip: %i[sessions] devise_scope :registrar_user do - get 'login/mid' => 'sessions#login_mid' - post 'login/mid' => 'sessions#mid' - post 'login/mid_status' => 'sessions#mid_status' + # get 'login/mid' => 'sessions#login_mid' + # post 'login/mid' => 'sessions#mid' + # post 'login/mid_status' => 'sessions#mid_status' # /registrar/id path is hardcoded in Apache config for authentication with Estonian ID-card - post 'id' => 'sessions#id_card', as: :id_card_sign_in - - post 'mid' => 'sessions#mid' + # post 'id' => 'sessions#id_card', as: :id_card_sign_in + # + # post 'mid' => 'sessions#mid' match '/open_id/callback', via: %i[get post], to: 'tara#callback', as: :tara_callback match '/open_id/cancel', via: %i[get post delete], to: 'tara#cancel', From 9976e3dd932626dc9a568e718c4f0f124d9766b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Mon, 28 Sep 2020 13:01:47 +0300 Subject: [PATCH 26/79] Test renewal prohibited statuses --- .../integration/epp/domain/renew/base_test.rb | 32 +++++++++++++++++++ test/models/domain_test.rb | 13 ++++++++ 2 files changed, 45 insertions(+) diff --git a/test/integration/epp/domain/renew/base_test.rb b/test/integration/epp/domain/renew/base_test.rb index 541aab2a8..be53ca7a7 100644 --- a/test/integration/epp/domain/renew/base_test.rb +++ b/test/integration/epp/domain/renew/base_test.rb @@ -167,4 +167,36 @@ class EppDomainRenewBaseTest < EppTestCase end assert_epp_response :parameter_value_policy_error end + + def test_fails_if_domain_has_renewal_prohibited_statuses + travel_to Time.zone.parse('2010-07-05') + domain = domains(:shop) + domain.statuses << DomainStatus::SERVER_RENEW_PROHIBITED + domain.save + + original_valid_to = domain.valid_to + default_renewal_period = 1.year + + request_xml = <<-XML + + + + + + #{domain.name} + #{domain.expire_time.to_date} + 1 + + + + + XML + + post epp_renew_path, params: { frame: request_xml }, + headers: { 'HTTP_COOKIE' => 'session=api_bestnames' } + domain.reload + + assert_epp_response :object_is_not_eligible_for_renewal + assert_equal original_valid_to, domain.valid_to + end end diff --git a/test/models/domain_test.rb b/test/models/domain_test.rb index b4a1d7b47..a943be6ef 100644 --- a/test/models/domain_test.rb +++ b/test/models/domain_test.rb @@ -431,6 +431,19 @@ class DomainTest < ActiveSupport::TestCase assert_equal created_at, domain.registered_at end + def test_not_renewable_if_renew_prohibited + assert @domain.renewable? + + @domain.statuses << DomainStatus::SERVER_RENEW_PROHIBITED + assert_not @domain.renewable? + + @domain.statuses.delete(DomainStatus::SERVER_RENEW_PROHIBITED) + assert @domain.renewable? + + @domain.statuses << DomainStatus::CLIENT_RENEW_PROHIBITED + assert_not @domain.renewable? + end + private def valid_domain From 79a31072db623871ddb6872cfc7403fc0b4a1504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Mon, 28 Sep 2020 13:55:12 +0300 Subject: [PATCH 27/79] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f0acd9a6..91f52f9ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +28.09.2020 +* Fixed data leakage with shared contacts [#1690](https://github.com/internetee/registry/issues/1690) + 18.09.2020 * Updated testing documentation [#1285](https://github.com/internetee/registry/pull/1285) * Removed mod-epp docs - replaced by epp-proxy [#1284](https://github.com/internetee/registry/pull/1284) From 29897043b0ace80ffa438d123a8b4c97a7f7ac7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Mon, 28 Sep 2020 14:57:52 +0300 Subject: [PATCH 28/79] Renew: Attach uneligibility reason --- app/models/domain.rb | 16 ++++++++++------ app/models/epp/domain.rb | 12 +++++++++++- test/integration/epp/domain/renew/base_test.rb | 2 +- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/app/models/domain.rb b/app/models/domain.rb index 41fa29144..679669728 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -306,12 +306,7 @@ class Domain < ApplicationRecord end def renewable? - disallowed = [DomainStatus::DELETE_CANDIDATE, DomainStatus::PENDING_RENEW, - DomainStatus::PENDING_TRANSFER, DomainStatus::CLIENT_RENEW_PROHIBITED, - DomainStatus::PENDING_UPDATE, DomainStatus::PENDING_DELETE, - DomainStatus::PENDING_DELETE_CONFIRMATION, DomainStatus::SERVER_RENEW_PROHIBITED] - - return false unless (statuses & disallowed).empty? + return false unless renew_blocking_statuses.empty? return true unless Setting.days_to_renew_domain_before_expire != 0 # if you can renew domain at days_to_renew before domain expiration @@ -322,6 +317,15 @@ class Domain < ApplicationRecord true end + def renew_blocking_statuses + disallowed = [DomainStatus::DELETE_CANDIDATE, DomainStatus::PENDING_RENEW, + DomainStatus::PENDING_TRANSFER, DomainStatus::CLIENT_RENEW_PROHIBITED, + DomainStatus::PENDING_UPDATE, DomainStatus::PENDING_DELETE, + DomainStatus::PENDING_DELETE_CONFIRMATION, DomainStatus::SERVER_RENEW_PROHIBITED] + + (statuses & disallowed) + end + def notify_registrar(message_key) registrar.notifications.create!( text: "#{I18n.t(message_key)}: #{name}", diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb index 3ed26f0e1..530e54a0f 100644 --- a/app/models/epp/domain.rb +++ b/app/models/epp/domain.rb @@ -581,11 +581,14 @@ class Epp::Domain < Domain save(validate: false) end + ### RENEW ### + def renew(cur_exp_date, period, unit = 'y') @is_renewal = true validate_exp_dates(cur_exp_date) - add_epp_error('2105', nil, nil, I18n.t('object_is_not_eligible_for_renewal')) unless renewable? + add_renew_epp_errors unless renewable? + return false if errors.any? period = period.to_i @@ -613,6 +616,13 @@ class Epp::Domain < Domain save end + def add_renew_epp_errors + if renew_blocking_statuses.any? && !renewable? + add_epp_error('2304', 'status', renew_blocking_statuses, + I18n.t('object_status_prohibits_operation')) + end + end + ### TRANSFER ### def transfer(frame, action, current_user) diff --git a/test/integration/epp/domain/renew/base_test.rb b/test/integration/epp/domain/renew/base_test.rb index be53ca7a7..9a61e1470 100644 --- a/test/integration/epp/domain/renew/base_test.rb +++ b/test/integration/epp/domain/renew/base_test.rb @@ -196,7 +196,7 @@ class EppDomainRenewBaseTest < EppTestCase headers: { 'HTTP_COOKIE' => 'session=api_bestnames' } domain.reload - assert_epp_response :object_is_not_eligible_for_renewal + assert_epp_response :object_status_prohibits_operation assert_equal original_valid_to, domain.valid_to end end From 975ec03e051a5484b3f39788231a9211b2997109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Mon, 28 Sep 2020 16:37:55 +0300 Subject: [PATCH 29/79] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91f52f9ec..3d7c08abe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ 28.09.2020 * Fixed data leakage with shared contacts [#1690](https://github.com/internetee/registry/issues/1690) +* RenewProhoboted status blocks renew [#1693](https://github.com/internetee/registry/issues/1693) 18.09.2020 * Updated testing documentation [#1285](https://github.com/internetee/registry/pull/1285) From bb37527daedeecc696a27801f38161aca0001d56 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Tue, 29 Sep 2020 12:21:04 +0500 Subject: [PATCH 30/79] Use Tara user hash --- app/controllers/registrar/tara_controller.rb | 72 ++++++++------------ app/models/user.rb | 39 +++++------ config/routes.rb | 2 +- 3 files changed, 45 insertions(+), 68 deletions(-) diff --git a/app/controllers/registrar/tara_controller.rb b/app/controllers/registrar/tara_controller.rb index 5be54ec12..4514655d0 100644 --- a/app/controllers/registrar/tara_controller.rb +++ b/app/controllers/registrar/tara_controller.rb @@ -1,41 +1,33 @@ -require 'tampering_detected' - class Registrar class TaraController < ApplicationController skip_authorization_check - rescue_from Errors::TamperingDetected do - redirect_to root_url, alert: t('auth.tara.tampering') - end - def callback session[:omniauth_hash] = user_hash - @user = User.from_omniauth(user_hash) + @api_user = ApiUser.from_omniauth(user_hash) - return unless @user.persisted? + return unless @api_user.persisted? - sign_in(User, @user) - redirect_to user_path(@user.uuid), notice: t('devise.sessions.signed_in') + sign_in_and_redirect(:registrar_user, @api_user) end # rubocop:disable Metrics/MethodLength - def create - tara_logger.info create_params - @user = User.new(create_params) - check_for_tampering - create_password - - respond_to do |format| - if @user.save - format.html do - sign_in(User, @user) - redirect_to user_path(@user.uuid), notice: t(:created) - end - else - format.html { render :callback } - end - end - end + # def create + # @user = User.new(create_params) + # check_for_tampering + # create_password + # + # respond_to do |format| + # if @user.save + # format.html do + # sign_in(User, @user) + # redirect_to user_path(@user.uuid), notice: t(:created) + # end + # else + # format.html { render :callback } + # end + # end + # end # rubocop:enable Metrics/MethodLength def cancel @@ -44,30 +36,22 @@ class Registrar private - def create_params - params.require(:user) - .permit(:email, :identity_code, :country_code, :given_names, :surname, - :accepts_terms_and_conditions, :locale, :uid, :provider) - end + # def create_params + # params.require(:user) + # .permit(:email, :identity_code, :country_code, :given_names, :surname, + # :accepts_terms_and_conditions, :locale, :uid, :provider) + # end - def check_for_tampering - return unless @user.tampered_with?(session[:omniauth_hash]) - - session.delete(:omniauth_hash) - raise Errors::TamperingDetected - end - - def create_password - @user.password = Devise.friendly_token[0..20] - end + # def create_password + # @user.password = Devise.friendly_token[0..20] + # end def user_hash - tara_logger.info request.env request.env['omniauth.auth'] end def tara_logger - @tara_logger ||= Logger.new(Rails.root.join('log', 'tara_auth2.log')) + @tara_logger ||= Logger.new(Rails.root.join('log', 'tara_auth4.log')) end end end diff --git a/app/models/user.rb b/app/models/user.rb index d3221b137..c31cc6bbe 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -15,34 +15,27 @@ class User < ApplicationRecord end # rubocop:disable Metrics/AbcSize - def tampered_with?(omniauth_hash) - # uid_from_hash = omniauth_hash['uid'] - # provider_from_hash = omniauth_hash['provider'] - # - # begin - # uid != uid_from_hash || - # provider != provider_from_hash || - # country_code != uid_from_hash.slice(0..1) || - # identity_code != uid_from_hash.slice(2..-1) || - # given_names != omniauth_hash.dig('info', 'first_name') || - # surname != omniauth_hash.dig('info', 'last_name') - # end - false - end + # def tampered_with?(omniauth_hash) + # # uid_from_hash = omniauth_hash['uid'] + # # provider_from_hash = omniauth_hash['provider'] + # # + # # begin + # # uid != uid_from_hash || + # # provider != provider_from_hash || + # # country_code != uid_from_hash.slice(0..1) || + # # identity_code != uid_from_hash.slice(2..-1) || + # # given_names != omniauth_hash.dig('info', 'first_name') || + # # surname != omniauth_hash.dig('info', 'last_name') + # # end + # false + # end # rubocop:enable Metrics/AbcSize def self.from_omniauth(omniauth_hash) uid = omniauth_hash['uid'] - provider = omniauth_hash['provider'] + # provider = omniauth_hash['provider'] - User.find_or_initialize_by(provider: provider, uid: uid) do |user| - user.given_names = omniauth_hash.dig('info', 'first_name') - user.surname = omniauth_hash.dig('info', 'last_name') - if provider == TARA_PROVIDER - user.country_code = uid.slice(0..1) - user.identity_code = uid.slice(2..-1) - end - end + User.find_by(uid: uid) end end diff --git a/config/routes.rb b/config/routes.rb index d88a2fdbc..5104a4ec5 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -89,7 +89,7 @@ Rails.application.routes.draw do match '/open_id/callback', via: %i[get post], to: 'tara#callback', as: :tara_callback match '/open_id/cancel', via: %i[get post delete], to: 'tara#cancel', as: :tara_cancel - match '/open_id/create', via: [:post], to: 'tara#create', as: :tara_create + # match '/open_id/create', via: [:post], to: 'tara#create', as: :tara_create end resources :invoices, except: %i[new create edit update destroy] do From 0d716e110a6c371f6ebc1df652fc7526d626a7a3 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Tue, 29 Sep 2020 14:17:00 +0500 Subject: [PATCH 31/79] Cleanup --- app/controllers/registrar/tara_controller.rb | 33 -------------------- app/models/registrant_user.rb | 2 +- app/models/user.rb | 22 ++----------- config/routes.rb | 1 - 4 files changed, 4 insertions(+), 54 deletions(-) diff --git a/app/controllers/registrar/tara_controller.rb b/app/controllers/registrar/tara_controller.rb index 4514655d0..31c812c73 100644 --- a/app/controllers/registrar/tara_controller.rb +++ b/app/controllers/registrar/tara_controller.rb @@ -11,47 +11,14 @@ class Registrar sign_in_and_redirect(:registrar_user, @api_user) end - # rubocop:disable Metrics/MethodLength - # def create - # @user = User.new(create_params) - # check_for_tampering - # create_password - # - # respond_to do |format| - # if @user.save - # format.html do - # sign_in(User, @user) - # redirect_to user_path(@user.uuid), notice: t(:created) - # end - # else - # format.html { render :callback } - # end - # end - # end - # rubocop:enable Metrics/MethodLength - def cancel redirect_to root_path, notice: t(:sign_in_cancelled) end private - # def create_params - # params.require(:user) - # .permit(:email, :identity_code, :country_code, :given_names, :surname, - # :accepts_terms_and_conditions, :locale, :uid, :provider) - # end - - # def create_password - # @user.password = Devise.friendly_token[0..20] - # end - def user_hash request.env['omniauth.auth'] end - - def tara_logger - @tara_logger ||= Logger.new(Rails.root.join('log', 'tara_auth4.log')) - end end end diff --git a/app/models/registrant_user.rb b/app/models/registrant_user.rb index e739d4a9d..efe5dd782 100644 --- a/app/models/registrant_user.rb +++ b/app/models/registrant_user.rb @@ -1,7 +1,7 @@ class RegistrantUser < User attr_accessor :idc_data - devise :trackable, :timeoutable#, :id_card_authenticatable + devise :trackable, :timeoutable def ability @ability ||= Ability.new(self) diff --git a/app/models/user.rb b/app/models/user.rb index c31cc6bbe..b28c16304 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -14,28 +14,12 @@ class User < ApplicationRecord "#{self.id}-#{self.class}: #{self.username}" end - # rubocop:disable Metrics/AbcSize - # def tampered_with?(omniauth_hash) - # # uid_from_hash = omniauth_hash['uid'] - # # provider_from_hash = omniauth_hash['provider'] - # # - # # begin - # # uid != uid_from_hash || - # # provider != provider_from_hash || - # # country_code != uid_from_hash.slice(0..1) || - # # identity_code != uid_from_hash.slice(2..-1) || - # # given_names != omniauth_hash.dig('info', 'first_name') || - # # surname != omniauth_hash.dig('info', 'last_name') - # # end - # false - # end - # rubocop:enable Metrics/AbcSize - def self.from_omniauth(omniauth_hash) uid = omniauth_hash['uid'] - # provider = omniauth_hash['provider'] + identity_code = uid.slice(2..-1) + country_code = uid.slice(0..1) - User.find_by(uid: uid) + User.find_by(identity_code: identity_code, country_code: country_code) end end diff --git a/config/routes.rb b/config/routes.rb index 5104a4ec5..04f12694e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -89,7 +89,6 @@ Rails.application.routes.draw do match '/open_id/callback', via: %i[get post], to: 'tara#callback', as: :tara_callback match '/open_id/cancel', via: %i[get post delete], to: 'tara#cancel', as: :tara_cancel - # match '/open_id/create', via: [:post], to: 'tara#create', as: :tara_create end resources :invoices, except: %i[new create edit update destroy] do From 94b8ffd158432e73a97dffb11483924e0ced9644 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Wed, 30 Sep 2020 13:06:59 +0500 Subject: [PATCH 32/79] Get rid of db changes --- ...00915073245_add_omniauth_fields_to_user.rb | 10 - db/structure.sql | 2873 ++--------------- 2 files changed, 328 insertions(+), 2555 deletions(-) delete mode 100644 db/migrate/20200915073245_add_omniauth_fields_to_user.rb diff --git a/db/migrate/20200915073245_add_omniauth_fields_to_user.rb b/db/migrate/20200915073245_add_omniauth_fields_to_user.rb deleted file mode 100644 index 8826559e3..000000000 --- a/db/migrate/20200915073245_add_omniauth_fields_to_user.rb +++ /dev/null @@ -1,10 +0,0 @@ -class AddOmniauthFieldsToUser < ActiveRecord::Migration[6.0] - disable_ddl_transaction! - - def change - add_column :users, :provider, :string - add_column :users, :uid, :string - add_index :users, [:provider, :uid], algorithm: :concurrently, - unique: true - end -end diff --git a/db/structure.sql b/db/structure.sql index 5ea01f91f..6a30fbc84 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -1,19 +1,28 @@ +--- +--- PostgreSQL database dump +--- + SET statement_timeout = 0; SET lock_timeout = 0; -SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; -SET row_security = off; -- --- Name: audit; Type: SCHEMA; Schema: -; Owner: - +-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: - -- -CREATE SCHEMA audit; +CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; + + +-- +-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; -- @@ -196,1398 +205,12 @@ CREATE FUNCTION public.generate_zonefile(i_origin character varying) RETURNS tex $_$; --- --- Name: process_account_activity_audit(); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION public.process_account_activity_audit() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - IF (TG_OP = 'INSERT') THEN - INSERT INTO audit.account_activities - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'UPDATE') THEN - INSERT INTO audit.account_activities - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'DELETE') THEN - INSERT INTO audit.account_activities - (object_id, action, recorded_at, old_value, new_value) - VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); - RETURN OLD; - END IF; - RETURN NULL; - END -$$; - - --- --- Name: process_account_audit(); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION public.process_account_audit() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - IF (TG_OP = 'INSERT') THEN - INSERT INTO audit.accounts - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'UPDATE') THEN - INSERT INTO audit.accounts - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'DELETE') THEN - INSERT INTO audit.accounts - (object_id, action, recorded_at, old_value, new_value) - VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); - RETURN OLD; - END IF; - RETURN NULL; - END -$$; - - --- --- Name: process_action_audit(); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION public.process_action_audit() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - IF (TG_OP = 'INSERT') THEN - INSERT INTO audit.actions - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'UPDATE') THEN - INSERT INTO audit.actions - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'DELETE') THEN - INSERT INTO audit.actions - (object_id, action, recorded_at, old_value, new_value) - VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); - RETURN OLD; - END IF; - RETURN NULL; - END -$$; - - --- --- Name: process_bank_statement_audit(); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION public.process_bank_statement_audit() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - IF (TG_OP = 'INSERT') THEN - INSERT INTO audit.bank_statements - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'UPDATE') THEN - INSERT INTO audit.bank_statements - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'DELETE') THEN - INSERT INTO audit.bank_statements - (object_id, action, recorded_at, old_value, new_value) - VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); - RETURN OLD; - END IF; - RETURN NULL; - END -$$; - - --- --- Name: process_bank_transaction_audit(); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION public.process_bank_transaction_audit() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - IF (TG_OP = 'INSERT') THEN - INSERT INTO audit.bank_transactions - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'UPDATE') THEN - INSERT INTO audit.bank_transactions - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'DELETE') THEN - INSERT INTO audit.bank_transactions - (object_id, action, recorded_at, old_value, new_value) - VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); - RETURN OLD; - END IF; - RETURN NULL; - END -$$; - - --- --- Name: process_blocked_domain_audit(); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION public.process_blocked_domain_audit() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - IF (TG_OP = 'INSERT') THEN - INSERT INTO audit.blocked_domains - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'UPDATE') THEN - INSERT INTO audit.blocked_domains - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'DELETE') THEN - INSERT INTO audit.blocked_domains - (object_id, action, recorded_at, old_value, new_value) - VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); - RETURN OLD; - END IF; - RETURN NULL; - END -$$; - - --- --- Name: process_certificate_audit(); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION public.process_certificate_audit() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - IF (TG_OP = 'INSERT') THEN - INSERT INTO audit.certificates - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'UPDATE') THEN - INSERT INTO audit.certificates - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'DELETE') THEN - INSERT INTO audit.certificates - (object_id, action, recorded_at, old_value, new_value) - VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); - RETURN OLD; - END IF; - RETURN NULL; - END -$$; - - --- --- Name: process_contact_audit(); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION public.process_contact_audit() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - IF (TG_OP = 'INSERT') THEN - INSERT INTO audit.contacts - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'UPDATE') THEN - INSERT INTO audit.contacts - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'DELETE') THEN - INSERT INTO audit.contacts - (object_id, action, recorded_at, old_value, new_value) - VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); - RETURN OLD; - END IF; - RETURN NULL; - END -$$; - - --- --- Name: process_dnskey_audit(); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION public.process_dnskey_audit() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - IF (TG_OP = 'INSERT') THEN - INSERT INTO audit.dnskeys - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'UPDATE') THEN - INSERT INTO audit.dnskeys - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'DELETE') THEN - INSERT INTO audit.dnskeys - (object_id, action, recorded_at, old_value, new_value) - VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); - RETURN OLD; - END IF; - RETURN NULL; - END -$$; - - --- --- Name: process_domain_audit(); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION public.process_domain_audit() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - IF (TG_OP = 'INSERT') THEN - INSERT INTO audit.domains - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'UPDATE') THEN - INSERT INTO audit.domains - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'DELETE') THEN - INSERT INTO audit.domains - (object_id, action, recorded_at, old_value, new_value) - VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); - RETURN OLD; - END IF; - RETURN NULL; - END -$$; - - --- --- Name: process_domain_contact_audit(); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION public.process_domain_contact_audit() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - IF (TG_OP = 'INSERT') THEN - INSERT INTO audit.domain_contacts - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'UPDATE') THEN - INSERT INTO audit.domain_contacts - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'DELETE') THEN - INSERT INTO audit.domain_contacts - (object_id, action, recorded_at, old_value, new_value) - VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); - RETURN OLD; - END IF; - RETURN NULL; - END -$$; - - --- --- Name: process_invoice_audit(); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION public.process_invoice_audit() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - IF (TG_OP = 'INSERT') THEN - INSERT INTO audit.invoices - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'UPDATE') THEN - INSERT INTO audit.invoices - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'DELETE') THEN - INSERT INTO audit.invoices - (object_id, action, recorded_at, old_value, new_value) - VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); - RETURN OLD; - END IF; - RETURN NULL; - END -$$; - - --- --- Name: process_invoice_item_audit(); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION public.process_invoice_item_audit() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - IF (TG_OP = 'INSERT') THEN - INSERT INTO audit.invoice_items - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'UPDATE') THEN - INSERT INTO audit.invoice_items - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'DELETE') THEN - INSERT INTO audit.invoice_items - (object_id, action, recorded_at, old_value, new_value) - VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); - RETURN OLD; - END IF; - RETURN NULL; - END -$$; - - --- --- Name: process_nameserver_audit(); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION public.process_nameserver_audit() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - IF (TG_OP = 'INSERT') THEN - INSERT INTO audit.nameservers - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'UPDATE') THEN - INSERT INTO audit.nameservers - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'DELETE') THEN - INSERT INTO audit.nameservers - (object_id, action, recorded_at, old_value, new_value) - VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); - RETURN OLD; - END IF; - RETURN NULL; - END -$$; - - --- --- Name: process_notification_audit(); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION public.process_notification_audit() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - IF (TG_OP = 'INSERT') THEN - INSERT INTO audit.notifications - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'UPDATE') THEN - INSERT INTO audit.notifications - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'DELETE') THEN - INSERT INTO audit.notifications - (object_id, action, recorded_at, old_value, new_value) - VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); - RETURN OLD; - END IF; - RETURN NULL; - END -$$; - - --- --- Name: process_payment_order_audit(); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION public.process_payment_order_audit() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - IF (TG_OP = 'INSERT') THEN - INSERT INTO audit.payment_orders - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'UPDATE') THEN - INSERT INTO audit.payment_orders - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'DELETE') THEN - INSERT INTO audit.payment_orders - (object_id, action, recorded_at, old_value, new_value) - VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); - RETURN OLD; - END IF; - RETURN NULL; - END -$$; - - --- --- Name: process_registrant_verification_audit(); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION public.process_registrant_verification_audit() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - IF (TG_OP = 'INSERT') THEN - INSERT INTO audit.registrant_verifications - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'UPDATE') THEN - INSERT INTO audit.registrant_verifications - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'DELETE') THEN - INSERT INTO audit.registrant_verifications - (object_id, action, recorded_at, old_value, new_value) - VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); - RETURN OLD; - END IF; - RETURN NULL; - END -$$; - - --- --- Name: process_registrar_audit(); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION public.process_registrar_audit() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - IF (TG_OP = 'INSERT') THEN - INSERT INTO audit.registrars - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'UPDATE') THEN - INSERT INTO audit.registrars - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'DELETE') THEN - INSERT INTO audit.registrars - (object_id, action, recorded_at, old_value, new_value) - VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); - RETURN OLD; - END IF; - RETURN NULL; - END -$$; - - --- --- Name: process_reserved_domain_audit(); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION public.process_reserved_domain_audit() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - IF (TG_OP = 'INSERT') THEN - INSERT INTO audit.reserved_domains - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'UPDATE') THEN - INSERT INTO audit.reserved_domains - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'DELETE') THEN - INSERT INTO audit.reserved_domains - (object_id, action, recorded_at, old_value, new_value) - VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); - RETURN OLD; - END IF; - RETURN NULL; - END -$$; - - --- --- Name: process_setting_audit(); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION public.process_setting_audit() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - IF (TG_OP = 'INSERT') THEN - INSERT INTO audit.settings - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'UPDATE') THEN - INSERT INTO audit.settings - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'DELETE') THEN - INSERT INTO audit.settings - (object_id, action, recorded_at, old_value, new_value) - VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); - RETURN OLD; - END IF; - RETURN NULL; - END -$$; - - --- --- Name: process_user_audit(); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION public.process_user_audit() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - IF (TG_OP = 'INSERT') THEN - INSERT INTO audit.users - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'UPDATE') THEN - INSERT INTO audit.users - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'DELETE') THEN - INSERT INTO audit.users - (object_id, action, recorded_at, old_value, new_value) - VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); - RETURN OLD; - END IF; - RETURN NULL; - END -$$; - - --- --- Name: process_white_ip_audit(); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION public.process_white_ip_audit() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - IF (TG_OP = 'INSERT') THEN - INSERT INTO audit.white_ips - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'INSERT', now(), '{}', to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'UPDATE') THEN - INSERT INTO audit.white_ips - (object_id, action, recorded_at, old_value, new_value) - VALUES (NEW.id, 'UPDATE', now(), to_json(OLD)::jsonb, to_json(NEW)::jsonb); - RETURN NEW; - ELSEIF (TG_OP = 'DELETE') THEN - INSERT INTO audit.white_ips - (object_id, action, recorded_at, old_value, new_value) - VALUES (OLD.id, 'DELETE', now(), to_json(OLD)::jsonb, '{}'); - RETURN OLD; - END IF; - RETURN NULL; - END -$$; - - SET default_tablespace = ''; SET default_with_oids = false; -- --- Name: account_activities; Type: TABLE; Schema: audit; Owner: - --- - -CREATE TABLE audit.account_activities ( - id integer NOT NULL, - object_id bigint, - action text NOT NULL, - recorded_at timestamp without time zone, - old_value jsonb, - new_value jsonb, - CONSTRAINT account_activities_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) -); - - --- --- Name: account_activities_id_seq; Type: SEQUENCE; Schema: audit; Owner: - --- - -CREATE SEQUENCE audit.account_activities_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: account_activities_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - --- - -ALTER SEQUENCE audit.account_activities_id_seq OWNED BY audit.account_activities.id; - - --- --- Name: accounts; Type: TABLE; Schema: audit; Owner: - --- - -CREATE TABLE audit.accounts ( - id integer NOT NULL, - object_id bigint, - action text NOT NULL, - recorded_at timestamp without time zone, - old_value jsonb, - new_value jsonb, - CONSTRAINT accounts_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) -); - - --- --- Name: accounts_id_seq; Type: SEQUENCE; Schema: audit; Owner: - --- - -CREATE SEQUENCE audit.accounts_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: accounts_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - --- - -ALTER SEQUENCE audit.accounts_id_seq OWNED BY audit.accounts.id; - - --- --- Name: actions; Type: TABLE; Schema: audit; Owner: - --- - -CREATE TABLE audit.actions ( - id integer NOT NULL, - object_id bigint, - action text NOT NULL, - recorded_at timestamp without time zone, - old_value jsonb, - new_value jsonb, - CONSTRAINT actions_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) -); - - --- --- Name: actions_id_seq; Type: SEQUENCE; Schema: audit; Owner: - --- - -CREATE SEQUENCE audit.actions_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: actions_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - --- - -ALTER SEQUENCE audit.actions_id_seq OWNED BY audit.actions.id; - - --- --- Name: bank_statements; Type: TABLE; Schema: audit; Owner: - --- - -CREATE TABLE audit.bank_statements ( - id integer NOT NULL, - object_id bigint, - action text NOT NULL, - recorded_at timestamp without time zone, - old_value jsonb, - new_value jsonb, - CONSTRAINT bank_statements_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) -); - - --- --- Name: bank_statements_id_seq; Type: SEQUENCE; Schema: audit; Owner: - --- - -CREATE SEQUENCE audit.bank_statements_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: bank_statements_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - --- - -ALTER SEQUENCE audit.bank_statements_id_seq OWNED BY audit.bank_statements.id; - - --- --- Name: bank_transactions; Type: TABLE; Schema: audit; Owner: - --- - -CREATE TABLE audit.bank_transactions ( - id integer NOT NULL, - object_id bigint, - action text NOT NULL, - recorded_at timestamp without time zone, - old_value jsonb, - new_value jsonb, - CONSTRAINT bank_transactions_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) -); - - --- --- Name: bank_transactions_id_seq; Type: SEQUENCE; Schema: audit; Owner: - --- - -CREATE SEQUENCE audit.bank_transactions_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: bank_transactions_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - --- - -ALTER SEQUENCE audit.bank_transactions_id_seq OWNED BY audit.bank_transactions.id; - - --- --- Name: blocked_domains; Type: TABLE; Schema: audit; Owner: - --- - -CREATE TABLE audit.blocked_domains ( - id integer NOT NULL, - object_id bigint, - action text NOT NULL, - recorded_at timestamp without time zone, - old_value jsonb, - new_value jsonb, - CONSTRAINT blocked_domains_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) -); - - --- --- Name: blocked_domains_id_seq; Type: SEQUENCE; Schema: audit; Owner: - --- - -CREATE SEQUENCE audit.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: audit; Owner: - --- - -ALTER SEQUENCE audit.blocked_domains_id_seq OWNED BY audit.blocked_domains.id; - - --- --- Name: certificates; Type: TABLE; Schema: audit; Owner: - --- - -CREATE TABLE audit.certificates ( - id integer NOT NULL, - object_id bigint, - action text NOT NULL, - recorded_at timestamp without time zone, - old_value jsonb, - new_value jsonb, - CONSTRAINT certificates_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) -); - - --- --- Name: certificates_id_seq; Type: SEQUENCE; Schema: audit; Owner: - --- - -CREATE SEQUENCE audit.certificates_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: certificates_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - --- - -ALTER SEQUENCE audit.certificates_id_seq OWNED BY audit.certificates.id; - - --- --- Name: contacts; Type: TABLE; Schema: audit; Owner: - --- - -CREATE TABLE audit.contacts ( - id integer NOT NULL, - object_id bigint, - action text NOT NULL, - recorded_at timestamp without time zone, - old_value jsonb, - new_value jsonb, - CONSTRAINT contacts_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) -); - - --- --- Name: contacts_id_seq; Type: SEQUENCE; Schema: audit; Owner: - --- - -CREATE SEQUENCE audit.contacts_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: contacts_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - --- - -ALTER SEQUENCE audit.contacts_id_seq OWNED BY audit.contacts.id; - - --- --- Name: dnskeys; Type: TABLE; Schema: audit; Owner: - --- - -CREATE TABLE audit.dnskeys ( - id integer NOT NULL, - object_id bigint, - action text NOT NULL, - recorded_at timestamp without time zone, - old_value jsonb, - new_value jsonb, - CONSTRAINT dnskeys_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) -); - - --- --- Name: dnskeys_id_seq; Type: SEQUENCE; Schema: audit; Owner: - --- - -CREATE SEQUENCE audit.dnskeys_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: dnskeys_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - --- - -ALTER SEQUENCE audit.dnskeys_id_seq OWNED BY audit.dnskeys.id; - - --- --- Name: domain_contacts; Type: TABLE; Schema: audit; Owner: - --- - -CREATE TABLE audit.domain_contacts ( - id integer NOT NULL, - object_id bigint, - action text NOT NULL, - recorded_at timestamp without time zone, - old_value jsonb, - new_value jsonb, - CONSTRAINT domain_contacts_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) -); - - --- --- Name: domain_contacts_id_seq; Type: SEQUENCE; Schema: audit; Owner: - --- - -CREATE SEQUENCE audit.domain_contacts_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: domain_contacts_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - --- - -ALTER SEQUENCE audit.domain_contacts_id_seq OWNED BY audit.domain_contacts.id; - - --- --- Name: domains; Type: TABLE; Schema: audit; Owner: - --- - -CREATE TABLE audit.domains ( - id integer NOT NULL, - object_id bigint, - action text NOT NULL, - recorded_at timestamp without time zone, - old_value jsonb, - new_value jsonb, - CONSTRAINT domains_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) -); - - --- --- Name: domains_id_seq; Type: SEQUENCE; Schema: audit; Owner: - --- - -CREATE SEQUENCE audit.domains_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: domains_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - --- - -ALTER SEQUENCE audit.domains_id_seq OWNED BY audit.domains.id; - - --- --- Name: invoice_items; Type: TABLE; Schema: audit; Owner: - --- - -CREATE TABLE audit.invoice_items ( - id integer NOT NULL, - object_id bigint, - action text NOT NULL, - recorded_at timestamp without time zone, - old_value jsonb, - new_value jsonb, - CONSTRAINT invoice_items_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) -); - - --- --- Name: invoice_items_id_seq; Type: SEQUENCE; Schema: audit; Owner: - --- - -CREATE SEQUENCE audit.invoice_items_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: invoice_items_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - --- - -ALTER SEQUENCE audit.invoice_items_id_seq OWNED BY audit.invoice_items.id; - - --- --- Name: invoices; Type: TABLE; Schema: audit; Owner: - --- - -CREATE TABLE audit.invoices ( - id integer NOT NULL, - object_id bigint, - action text NOT NULL, - recorded_at timestamp without time zone, - old_value jsonb, - new_value jsonb, - CONSTRAINT invoices_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) -); - - --- --- Name: invoices_id_seq; Type: SEQUENCE; Schema: audit; Owner: - --- - -CREATE SEQUENCE audit.invoices_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: invoices_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - --- - -ALTER SEQUENCE audit.invoices_id_seq OWNED BY audit.invoices.id; - - --- --- Name: nameservers; Type: TABLE; Schema: audit; Owner: - --- - -CREATE TABLE audit.nameservers ( - id integer NOT NULL, - object_id bigint, - action text NOT NULL, - recorded_at timestamp without time zone, - old_value jsonb, - new_value jsonb, - CONSTRAINT nameservers_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) -); - - --- --- Name: nameservers_id_seq; Type: SEQUENCE; Schema: audit; Owner: - --- - -CREATE SEQUENCE audit.nameservers_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: nameservers_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - --- - -ALTER SEQUENCE audit.nameservers_id_seq OWNED BY audit.nameservers.id; - - --- --- Name: notifications; Type: TABLE; Schema: audit; Owner: - --- - -CREATE TABLE audit.notifications ( - id integer NOT NULL, - object_id bigint, - action text NOT NULL, - recorded_at timestamp without time zone, - old_value jsonb, - new_value jsonb, - CONSTRAINT notifications_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) -); - - --- --- Name: notifications_id_seq; Type: SEQUENCE; Schema: audit; Owner: - --- - -CREATE SEQUENCE audit.notifications_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: notifications_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - --- - -ALTER SEQUENCE audit.notifications_id_seq OWNED BY audit.notifications.id; - - --- --- Name: payment_orders; Type: TABLE; Schema: audit; Owner: - --- - -CREATE TABLE audit.payment_orders ( - id integer NOT NULL, - object_id bigint, - action text NOT NULL, - recorded_at timestamp without time zone, - old_value jsonb, - new_value jsonb, - CONSTRAINT payment_orders_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) -); - - --- --- Name: payment_orders_id_seq; Type: SEQUENCE; Schema: audit; Owner: - --- - -CREATE SEQUENCE audit.payment_orders_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: payment_orders_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - --- - -ALTER SEQUENCE audit.payment_orders_id_seq OWNED BY audit.payment_orders.id; - - --- --- Name: registrant_verifications; Type: TABLE; Schema: audit; Owner: - --- - -CREATE TABLE audit.registrant_verifications ( - id integer NOT NULL, - object_id bigint, - action text NOT NULL, - recorded_at timestamp without time zone, - old_value jsonb, - new_value jsonb, - CONSTRAINT registrant_verifications_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) -); - - --- --- Name: registrant_verifications_id_seq; Type: SEQUENCE; Schema: audit; Owner: - --- - -CREATE SEQUENCE audit.registrant_verifications_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: registrant_verifications_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - --- - -ALTER SEQUENCE audit.registrant_verifications_id_seq OWNED BY audit.registrant_verifications.id; - - --- --- Name: registrars; Type: TABLE; Schema: audit; Owner: - --- - -CREATE TABLE audit.registrars ( - id integer NOT NULL, - object_id bigint, - action text NOT NULL, - recorded_at timestamp without time zone, - old_value jsonb, - new_value jsonb, - CONSTRAINT registrars_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) -); - - --- --- Name: registrars_id_seq; Type: SEQUENCE; Schema: audit; Owner: - --- - -CREATE SEQUENCE audit.registrars_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: registrars_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - --- - -ALTER SEQUENCE audit.registrars_id_seq OWNED BY audit.registrars.id; - - --- --- Name: reserved_domains; Type: TABLE; Schema: audit; Owner: - --- - -CREATE TABLE audit.reserved_domains ( - id integer NOT NULL, - object_id bigint, - action text NOT NULL, - recorded_at timestamp without time zone, - old_value jsonb, - new_value jsonb, - CONSTRAINT reserved_domains_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) -); - - --- --- Name: reserved_domains_id_seq; Type: SEQUENCE; Schema: audit; Owner: - --- - -CREATE SEQUENCE audit.reserved_domains_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: reserved_domains_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - --- - -ALTER SEQUENCE audit.reserved_domains_id_seq OWNED BY audit.reserved_domains.id; - - --- --- Name: settings; Type: TABLE; Schema: audit; Owner: - --- - -CREATE TABLE audit.settings ( - id integer NOT NULL, - object_id bigint, - action text NOT NULL, - recorded_at timestamp without time zone, - old_value jsonb, - new_value jsonb, - CONSTRAINT settings_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) -); - - --- --- Name: settings_id_seq; Type: SEQUENCE; Schema: audit; Owner: - --- - -CREATE SEQUENCE audit.settings_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: settings_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - --- - -ALTER SEQUENCE audit.settings_id_seq OWNED BY audit.settings.id; - - --- --- Name: users; Type: TABLE; Schema: audit; Owner: - --- - -CREATE TABLE audit.users ( - id integer NOT NULL, - object_id bigint, - action text NOT NULL, - recorded_at timestamp without time zone, - old_value jsonb, - new_value jsonb, - CONSTRAINT users_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) -); - - --- --- Name: users_id_seq; Type: SEQUENCE; Schema: audit; Owner: - --- - -CREATE SEQUENCE audit.users_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - --- - -ALTER SEQUENCE audit.users_id_seq OWNED BY audit.users.id; - - --- --- Name: white_ips; Type: TABLE; Schema: audit; Owner: - --- - -CREATE TABLE audit.white_ips ( - id integer NOT NULL, - object_id bigint, - action text NOT NULL, - recorded_at timestamp without time zone, - old_value jsonb, - new_value jsonb, - CONSTRAINT white_ips_action_check CHECK ((action = ANY (ARRAY['INSERT'::text, 'UPDATE'::text, 'DELETE'::text, 'TRUNCATE'::text]))) -); - - --- --- Name: white_ips_id_seq; Type: SEQUENCE; Schema: audit; Owner: - --- - -CREATE SEQUENCE audit.white_ips_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: white_ips_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: - --- - -ALTER SEQUENCE audit.white_ips_id_seq OWNED BY audit.white_ips.id; - - --- --- Name: account_activities; Type: TABLE; Schema: public; Owner: - +-- Name: account_activities; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.account_activities ( @@ -1627,7 +250,7 @@ ALTER SEQUENCE public.account_activities_id_seq OWNED BY public.account_activiti -- --- Name: accounts; Type: TABLE; Schema: public; Owner: - +-- Name: accounts; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.accounts ( @@ -1663,7 +286,7 @@ ALTER SEQUENCE public.accounts_id_seq OWNED BY public.accounts.id; -- --- Name: actions; Type: TABLE; Schema: public; Owner: - +-- Name: actions; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.actions ( @@ -1695,7 +318,7 @@ ALTER SEQUENCE public.actions_id_seq OWNED BY public.actions.id; -- --- Name: ar_internal_metadata; Type: TABLE; Schema: public; Owner: - +-- Name: ar_internal_metadata; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.ar_internal_metadata ( @@ -1707,7 +330,7 @@ CREATE TABLE public.ar_internal_metadata ( -- --- Name: auctions; Type: TABLE; Schema: public; Owner: - +-- Name: auctions; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.auctions ( @@ -1741,7 +364,7 @@ ALTER SEQUENCE public.auctions_id_seq OWNED BY public.auctions.id; -- --- Name: bank_statements; Type: TABLE; Schema: public; Owner: - +-- Name: bank_statements; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.bank_statements ( @@ -1776,7 +399,7 @@ ALTER SEQUENCE public.bank_statements_id_seq OWNED BY public.bank_statements.id; -- --- Name: bank_transactions; Type: TABLE; Schema: public; Owner: - +-- Name: bank_transactions; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.bank_transactions ( @@ -1820,7 +443,7 @@ ALTER SEQUENCE public.bank_transactions_id_seq OWNED BY public.bank_transactions -- --- Name: blocked_domains; Type: TABLE; Schema: public; Owner: - +-- Name: blocked_domains; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.blocked_domains ( @@ -1853,7 +476,7 @@ ALTER SEQUENCE public.blocked_domains_id_seq OWNED BY public.blocked_domains.id; -- --- Name: certificates; Type: TABLE; Schema: public; Owner: - +-- Name: certificates; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.certificates ( @@ -1892,7 +515,7 @@ ALTER SEQUENCE public.certificates_id_seq OWNED BY public.certificates.id; -- --- Name: contacts; Type: TABLE; Schema: public; Owner: - +-- Name: contacts; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.contacts ( @@ -1950,7 +573,7 @@ ALTER SEQUENCE public.contacts_id_seq OWNED BY public.contacts.id; -- --- Name: data_migrations; Type: TABLE; Schema: public; Owner: - +-- Name: data_migrations; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.data_migrations ( @@ -1959,7 +582,7 @@ CREATE TABLE public.data_migrations ( -- --- Name: directos; Type: TABLE; Schema: public; Owner: - +-- Name: directos; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.directos ( @@ -1994,7 +617,7 @@ ALTER SEQUENCE public.directos_id_seq OWNED BY public.directos.id; -- --- Name: disputes; Type: TABLE; Schema: public; Owner: - +-- Name: disputes; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.disputes ( @@ -2031,7 +654,7 @@ ALTER SEQUENCE public.disputes_id_seq OWNED BY public.disputes.id; -- --- Name: dnskeys; Type: TABLE; Schema: public; Owner: - +-- Name: dnskeys; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.dnskeys ( @@ -2072,7 +695,7 @@ ALTER SEQUENCE public.dnskeys_id_seq OWNED BY public.dnskeys.id; -- --- Name: domain_contacts; Type: TABLE; Schema: public; Owner: - +-- Name: domain_contacts; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.domain_contacts ( @@ -2110,7 +733,7 @@ ALTER SEQUENCE public.domain_contacts_id_seq OWNED BY public.domain_contacts.id; -- --- Name: domain_transfers; Type: TABLE; Schema: public; Owner: - +-- Name: domain_transfers; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.domain_transfers ( @@ -2147,7 +770,7 @@ ALTER SEQUENCE public.domain_transfers_id_seq OWNED BY public.domain_transfers.i -- --- Name: domains; Type: TABLE; Schema: public; Owner: - +-- Name: domains; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.domains ( @@ -2182,8 +805,7 @@ CREATE TABLE public.domains ( uuid uuid DEFAULT public.gen_random_uuid() NOT NULL, locked_by_registrant_at timestamp without time zone, force_delete_start timestamp without time zone, - force_delete_data public.hstore, - children jsonb + force_delete_data public.hstore ); @@ -2207,7 +829,7 @@ ALTER SEQUENCE public.domains_id_seq OWNED BY public.domains.id; -- --- Name: email_address_verifications; Type: TABLE; Schema: public; Owner: - +-- Name: email_address_verifications; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.email_address_verifications ( @@ -2239,7 +861,7 @@ ALTER SEQUENCE public.email_address_verifications_id_seq OWNED BY public.email_a -- --- Name: email_addresses_validations; Type: TABLE; Schema: public; Owner: - +-- Name: email_addresses_validations; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.email_addresses_validations ( @@ -2269,7 +891,7 @@ ALTER SEQUENCE public.email_addresses_validations_id_seq OWNED BY public.email_a -- --- Name: email_addresses_verifications; Type: TABLE; Schema: public; Owner: - +-- Name: email_addresses_verifications; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.email_addresses_verifications ( @@ -2299,7 +921,7 @@ ALTER SEQUENCE public.email_addresses_verifications_id_seq OWNED BY public.email -- --- Name: epp_sessions; Type: TABLE; Schema: public; Owner: - +-- Name: epp_sessions; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.epp_sessions ( @@ -2331,7 +953,7 @@ ALTER SEQUENCE public.epp_sessions_id_seq OWNED BY public.epp_sessions.id; -- --- Name: invoice_items; Type: TABLE; Schema: public; Owner: - +-- Name: invoice_items; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.invoice_items ( @@ -2369,7 +991,7 @@ ALTER SEQUENCE public.invoice_items_id_seq OWNED BY public.invoice_items.id; -- --- Name: invoices; Type: TABLE; Schema: public; Owner: - +-- Name: invoices; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.invoices ( @@ -2440,7 +1062,7 @@ ALTER SEQUENCE public.invoices_id_seq OWNED BY public.invoices.id; -- --- Name: legal_documents; Type: TABLE; Schema: public; Owner: - +-- Name: legal_documents; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.legal_documents ( @@ -2475,7 +1097,7 @@ ALTER SEQUENCE public.legal_documents_id_seq OWNED BY public.legal_documents.id; -- --- Name: log_account_activities; Type: TABLE; Schema: public; Owner: - +-- Name: log_account_activities; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_account_activities ( @@ -2513,7 +1135,7 @@ ALTER SEQUENCE public.log_account_activities_id_seq OWNED BY public.log_account_ -- --- Name: log_accounts; Type: TABLE; Schema: public; Owner: - +-- Name: log_accounts; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_accounts ( @@ -2551,7 +1173,7 @@ ALTER SEQUENCE public.log_accounts_id_seq OWNED BY public.log_accounts.id; -- --- Name: log_actions; Type: TABLE; Schema: public; Owner: - +-- Name: log_actions; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_actions ( @@ -2589,7 +1211,7 @@ ALTER SEQUENCE public.log_actions_id_seq OWNED BY public.log_actions.id; -- --- Name: log_bank_statements; Type: TABLE; Schema: public; Owner: - +-- Name: log_bank_statements; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_bank_statements ( @@ -2627,7 +1249,7 @@ ALTER SEQUENCE public.log_bank_statements_id_seq OWNED BY public.log_bank_statem -- --- Name: log_bank_transactions; Type: TABLE; Schema: public; Owner: - +-- Name: log_bank_transactions; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_bank_transactions ( @@ -2665,7 +1287,7 @@ ALTER SEQUENCE public.log_bank_transactions_id_seq OWNED BY public.log_bank_tran -- --- Name: log_blocked_domains; Type: TABLE; Schema: public; Owner: - +-- Name: log_blocked_domains; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_blocked_domains ( @@ -2703,7 +1325,7 @@ ALTER SEQUENCE public.log_blocked_domains_id_seq OWNED BY public.log_blocked_dom -- --- Name: log_certificates; Type: TABLE; Schema: public; Owner: - +-- Name: log_certificates; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_certificates ( @@ -2741,7 +1363,7 @@ ALTER SEQUENCE public.log_certificates_id_seq OWNED BY public.log_certificates.i -- --- Name: log_contacts; Type: TABLE; Schema: public; Owner: - +-- Name: log_contacts; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_contacts ( @@ -2780,7 +1402,7 @@ ALTER SEQUENCE public.log_contacts_id_seq OWNED BY public.log_contacts.id; -- --- Name: log_dnskeys; Type: TABLE; Schema: public; Owner: - +-- Name: log_dnskeys; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_dnskeys ( @@ -2818,7 +1440,7 @@ ALTER SEQUENCE public.log_dnskeys_id_seq OWNED BY public.log_dnskeys.id; -- --- Name: log_domain_contacts; Type: TABLE; Schema: public; Owner: - +-- Name: log_domain_contacts; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_domain_contacts ( @@ -2856,7 +1478,7 @@ ALTER SEQUENCE public.log_domain_contacts_id_seq OWNED BY public.log_domain_cont -- --- Name: log_domains; Type: TABLE; Schema: public; Owner: - +-- Name: log_domains; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_domains ( @@ -2894,7 +1516,7 @@ ALTER SEQUENCE public.log_domains_id_seq OWNED BY public.log_domains.id; -- --- Name: log_invoice_items; Type: TABLE; Schema: public; Owner: - +-- Name: log_invoice_items; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_invoice_items ( @@ -2932,7 +1554,7 @@ ALTER SEQUENCE public.log_invoice_items_id_seq OWNED BY public.log_invoice_items -- --- Name: log_invoices; Type: TABLE; Schema: public; Owner: - +-- Name: log_invoices; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_invoices ( @@ -2970,7 +1592,7 @@ ALTER SEQUENCE public.log_invoices_id_seq OWNED BY public.log_invoices.id; -- --- Name: log_nameservers; Type: TABLE; Schema: public; Owner: - +-- Name: log_nameservers; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_nameservers ( @@ -3008,7 +1630,7 @@ ALTER SEQUENCE public.log_nameservers_id_seq OWNED BY public.log_nameservers.id; -- --- Name: log_notifications; Type: TABLE; Schema: public; Owner: - +-- Name: log_notifications; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_notifications ( @@ -3046,7 +1668,7 @@ ALTER SEQUENCE public.log_notifications_id_seq OWNED BY public.log_notifications -- --- Name: log_payment_orders; Type: TABLE; Schema: public; Owner: - +-- Name: log_payment_orders; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_payment_orders ( @@ -3159,7 +1781,7 @@ ALTER SEQUENCE public.log_registrant_verifications_id_seq OWNED BY public.log_re -- --- Name: log_registrars; Type: TABLE; Schema: public; Owner: - +-- Name: log_registrars; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_registrars ( @@ -3197,7 +1819,7 @@ ALTER SEQUENCE public.log_registrars_id_seq OWNED BY public.log_registrars.id; -- --- Name: log_reserved_domains; Type: TABLE; Schema: public; Owner: - +-- Name: log_reserved_domains; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_reserved_domains ( @@ -3235,7 +1857,7 @@ ALTER SEQUENCE public.log_reserved_domains_id_seq OWNED BY public.log_reserved_d -- --- Name: log_setting_entries; Type: TABLE; Schema: public; Owner: - +-- Name: log_setting_entries; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_setting_entries ( @@ -3273,7 +1895,7 @@ ALTER SEQUENCE public.log_setting_entries_id_seq OWNED BY public.log_setting_ent -- --- Name: log_settings; Type: TABLE; Schema: public; Owner: - +-- Name: log_settings; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_settings ( @@ -3311,7 +1933,7 @@ ALTER SEQUENCE public.log_settings_id_seq OWNED BY public.log_settings.id; -- --- Name: log_users; Type: TABLE; Schema: public; Owner: - +-- Name: log_users; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_users ( @@ -3349,7 +1971,7 @@ ALTER SEQUENCE public.log_users_id_seq OWNED BY public.log_users.id; -- --- Name: log_white_ips; Type: TABLE; Schema: public; Owner: - +-- Name: log_white_ips; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.log_white_ips ( @@ -3387,7 +2009,7 @@ ALTER SEQUENCE public.log_white_ips_id_seq OWNED BY public.log_white_ips.id; -- --- Name: nameservers; Type: TABLE; Schema: public; Owner: - +-- Name: nameservers; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.nameservers ( @@ -3425,7 +2047,7 @@ ALTER SEQUENCE public.nameservers_id_seq OWNED BY public.nameservers.id; -- --- Name: notifications; Type: TABLE; Schema: public; Owner: - +-- Name: notifications; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.notifications ( @@ -3463,7 +2085,7 @@ ALTER SEQUENCE public.notifications_id_seq OWNED BY public.notifications.id; -- --- Name: payment_orders; Type: TABLE; Schema: public; Owner: - +-- Name: payment_orders; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.payment_orders ( @@ -3500,7 +2122,7 @@ ALTER SEQUENCE public.payment_orders_id_seq OWNED BY public.payment_orders.id; -- --- Name: prices; Type: TABLE; Schema: public; Owner: - +-- Name: prices; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.prices ( @@ -3508,13 +2130,13 @@ CREATE TABLE public.prices ( price_cents integer NOT NULL, valid_from timestamp without time zone, valid_to timestamp without time zone, + updator_str character varying, + creator_str character varying, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, duration interval, operation_category character varying, - zone_id integer NOT NULL, - updator_str character varying, - creator_str character varying + zone_id integer NOT NULL ); @@ -3538,7 +2160,7 @@ ALTER SEQUENCE public.prices_id_seq OWNED BY public.prices.id; -- --- Name: que_jobs; Type: TABLE; Schema: public; Owner: - +-- Name: que_jobs; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.que_jobs ( @@ -3580,7 +2202,7 @@ ALTER SEQUENCE public.que_jobs_job_id_seq OWNED BY public.que_jobs.job_id; -- --- Name: registrant_verifications; Type: TABLE; Schema: public; Owner: - +-- Name: registrant_verifications; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.registrant_verifications ( @@ -3616,7 +2238,7 @@ ALTER SEQUENCE public.registrant_verifications_id_seq OWNED BY public.registrant -- --- Name: registrars; Type: TABLE; Schema: public; Owner: - +-- Name: registrars; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.registrars ( @@ -3671,7 +2293,7 @@ ALTER SEQUENCE public.registrars_id_seq OWNED BY public.registrars.id; -- --- Name: reserved_domains; Type: TABLE; Schema: public; Owner: - +-- Name: reserved_domains; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.reserved_domains ( @@ -3706,7 +2328,7 @@ ALTER SEQUENCE public.reserved_domains_id_seq OWNED BY public.reserved_domains.i -- --- Name: schema_migrations; Type: TABLE; Schema: public; Owner: - +-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.schema_migrations ( @@ -3715,7 +2337,7 @@ CREATE TABLE public.schema_migrations ( -- --- Name: setting_entries; Type: TABLE; Schema: public; Owner: - +-- Name: setting_entries; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.setting_entries ( @@ -3751,7 +2373,7 @@ ALTER SEQUENCE public.setting_entries_id_seq OWNED BY public.setting_entries.id; -- --- Name: settings; Type: TABLE; Schema: public; Owner: - +-- Name: settings; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.settings ( @@ -3787,7 +2409,7 @@ ALTER SEQUENCE public.settings_id_seq OWNED BY public.settings.id; -- --- Name: users; Type: TABLE; Schema: public; Owner: - +-- Name: users; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.users ( @@ -3815,9 +2437,7 @@ CREATE TABLE public.users ( remember_created_at timestamp without time zone, failed_attempts integer DEFAULT 0 NOT NULL, locked_at timestamp without time zone, - legacy_id integer, - provider character varying, - uid character varying + legacy_id integer ); @@ -3841,7 +2461,7 @@ ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id; -- --- Name: versions; Type: TABLE; Schema: public; Owner: - +-- Name: versions; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.versions ( @@ -3876,7 +2496,7 @@ ALTER SEQUENCE public.versions_id_seq OWNED BY public.versions.id; -- --- Name: white_ips; Type: TABLE; Schema: public; Owner: - +-- Name: white_ips; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.white_ips ( @@ -3912,7 +2532,7 @@ ALTER SEQUENCE public.white_ips_id_seq OWNED BY public.white_ips.id; -- --- Name: whois_records; Type: TABLE; Schema: public; Owner: - +-- Name: whois_records; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.whois_records ( @@ -3947,7 +2567,7 @@ ALTER SEQUENCE public.whois_records_id_seq OWNED BY public.whois_records.id; -- --- Name: zones; Type: TABLE; Schema: public; Owner: - +-- Name: zones; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE public.zones ( @@ -3990,420 +2610,266 @@ ALTER SEQUENCE public.zones_id_seq OWNED BY public.zones.id; -- --- Name: account_activities id; Type: DEFAULT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.account_activities ALTER COLUMN id SET DEFAULT nextval('audit.account_activities_id_seq'::regclass); - - --- --- Name: accounts id; Type: DEFAULT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.accounts ALTER COLUMN id SET DEFAULT nextval('audit.accounts_id_seq'::regclass); - - --- --- Name: actions id; Type: DEFAULT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.actions ALTER COLUMN id SET DEFAULT nextval('audit.actions_id_seq'::regclass); - - --- --- Name: bank_statements id; Type: DEFAULT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.bank_statements ALTER COLUMN id SET DEFAULT nextval('audit.bank_statements_id_seq'::regclass); - - --- --- Name: bank_transactions id; Type: DEFAULT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.bank_transactions ALTER COLUMN id SET DEFAULT nextval('audit.bank_transactions_id_seq'::regclass); - - --- --- Name: blocked_domains id; Type: DEFAULT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.blocked_domains ALTER COLUMN id SET DEFAULT nextval('audit.blocked_domains_id_seq'::regclass); - - --- --- Name: certificates id; Type: DEFAULT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.certificates ALTER COLUMN id SET DEFAULT nextval('audit.certificates_id_seq'::regclass); - - --- --- Name: contacts id; Type: DEFAULT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.contacts ALTER COLUMN id SET DEFAULT nextval('audit.contacts_id_seq'::regclass); - - --- --- Name: dnskeys id; Type: DEFAULT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.dnskeys ALTER COLUMN id SET DEFAULT nextval('audit.dnskeys_id_seq'::regclass); - - --- --- Name: domain_contacts id; Type: DEFAULT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.domain_contacts ALTER COLUMN id SET DEFAULT nextval('audit.domain_contacts_id_seq'::regclass); - - --- --- Name: domains id; Type: DEFAULT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.domains ALTER COLUMN id SET DEFAULT nextval('audit.domains_id_seq'::regclass); - - --- --- Name: invoice_items id; Type: DEFAULT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.invoice_items ALTER COLUMN id SET DEFAULT nextval('audit.invoice_items_id_seq'::regclass); - - --- --- Name: invoices id; Type: DEFAULT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.invoices ALTER COLUMN id SET DEFAULT nextval('audit.invoices_id_seq'::regclass); - - --- --- Name: nameservers id; Type: DEFAULT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.nameservers ALTER COLUMN id SET DEFAULT nextval('audit.nameservers_id_seq'::regclass); - - --- --- Name: notifications id; Type: DEFAULT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.notifications ALTER COLUMN id SET DEFAULT nextval('audit.notifications_id_seq'::regclass); - - --- --- Name: payment_orders id; Type: DEFAULT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.payment_orders ALTER COLUMN id SET DEFAULT nextval('audit.payment_orders_id_seq'::regclass); - - --- --- Name: registrant_verifications id; Type: DEFAULT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.registrant_verifications ALTER COLUMN id SET DEFAULT nextval('audit.registrant_verifications_id_seq'::regclass); - - --- --- Name: registrars id; Type: DEFAULT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.registrars ALTER COLUMN id SET DEFAULT nextval('audit.registrars_id_seq'::regclass); - - --- --- Name: reserved_domains id; Type: DEFAULT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.reserved_domains ALTER COLUMN id SET DEFAULT nextval('audit.reserved_domains_id_seq'::regclass); - - --- --- Name: settings id; Type: DEFAULT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.settings ALTER COLUMN id SET DEFAULT nextval('audit.settings_id_seq'::regclass); - - --- --- Name: users id; Type: DEFAULT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.users ALTER COLUMN id SET DEFAULT nextval('audit.users_id_seq'::regclass); - - --- --- Name: white_ips id; Type: DEFAULT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.white_ips ALTER COLUMN id SET DEFAULT nextval('audit.white_ips_id_seq'::regclass); - - --- --- Name: account_activities id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.account_activities ALTER COLUMN id SET DEFAULT nextval('public.account_activities_id_seq'::regclass); -- --- Name: accounts id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.accounts ALTER COLUMN id SET DEFAULT nextval('public.accounts_id_seq'::regclass); -- --- Name: actions id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.actions ALTER COLUMN id SET DEFAULT nextval('public.actions_id_seq'::regclass); -- --- Name: auctions id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.auctions ALTER COLUMN id SET DEFAULT nextval('public.auctions_id_seq'::regclass); -- --- Name: bank_statements id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.bank_statements ALTER COLUMN id SET DEFAULT nextval('public.bank_statements_id_seq'::regclass); -- --- Name: bank_transactions id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.bank_transactions ALTER COLUMN id SET DEFAULT nextval('public.bank_transactions_id_seq'::regclass); -- --- Name: blocked_domains id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.blocked_domains ALTER COLUMN id SET DEFAULT nextval('public.blocked_domains_id_seq'::regclass); -- --- Name: certificates id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.certificates ALTER COLUMN id SET DEFAULT nextval('public.certificates_id_seq'::regclass); -- --- Name: contacts id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.contacts ALTER COLUMN id SET DEFAULT nextval('public.contacts_id_seq'::regclass); -- --- Name: directos id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.directos ALTER COLUMN id SET DEFAULT nextval('public.directos_id_seq'::regclass); -- --- Name: disputes id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.disputes ALTER COLUMN id SET DEFAULT nextval('public.disputes_id_seq'::regclass); -- --- Name: dnskeys id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.dnskeys ALTER COLUMN id SET DEFAULT nextval('public.dnskeys_id_seq'::regclass); -- --- Name: domain_contacts id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_contacts ALTER COLUMN id SET DEFAULT nextval('public.domain_contacts_id_seq'::regclass); -- --- Name: domain_transfers id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_transfers ALTER COLUMN id SET DEFAULT nextval('public.domain_transfers_id_seq'::regclass); -- --- Name: domains id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domains ALTER COLUMN id SET DEFAULT nextval('public.domains_id_seq'::regclass); -- --- Name: email_address_verifications id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.email_address_verifications ALTER COLUMN id SET DEFAULT nextval('public.email_address_verifications_id_seq'::regclass); -- --- Name: email_addresses_validations id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.email_addresses_validations ALTER COLUMN id SET DEFAULT nextval('public.email_addresses_validations_id_seq'::regclass); -- --- Name: email_addresses_verifications id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.email_addresses_verifications ALTER COLUMN id SET DEFAULT nextval('public.email_addresses_verifications_id_seq'::regclass); -- --- Name: epp_sessions id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.epp_sessions ALTER COLUMN id SET DEFAULT nextval('public.epp_sessions_id_seq'::regclass); -- --- Name: invoice_items id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.invoice_items ALTER COLUMN id SET DEFAULT nextval('public.invoice_items_id_seq'::regclass); -- --- Name: invoices id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.invoices ALTER COLUMN id SET DEFAULT nextval('public.invoices_id_seq'::regclass); -- --- Name: legal_documents id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.legal_documents ALTER COLUMN id SET DEFAULT nextval('public.legal_documents_id_seq'::regclass); -- --- Name: log_account_activities id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_account_activities ALTER COLUMN id SET DEFAULT nextval('public.log_account_activities_id_seq'::regclass); -- --- Name: log_accounts id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_accounts ALTER COLUMN id SET DEFAULT nextval('public.log_accounts_id_seq'::regclass); -- --- Name: log_actions id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_actions ALTER COLUMN id SET DEFAULT nextval('public.log_actions_id_seq'::regclass); -- --- Name: log_bank_statements id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_bank_statements ALTER COLUMN id SET DEFAULT nextval('public.log_bank_statements_id_seq'::regclass); -- --- Name: log_bank_transactions id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_bank_transactions ALTER COLUMN id SET DEFAULT nextval('public.log_bank_transactions_id_seq'::regclass); -- --- Name: log_blocked_domains id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_blocked_domains ALTER COLUMN id SET DEFAULT nextval('public.log_blocked_domains_id_seq'::regclass); -- --- Name: log_certificates id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_certificates ALTER COLUMN id SET DEFAULT nextval('public.log_certificates_id_seq'::regclass); -- --- Name: log_contacts id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_contacts ALTER COLUMN id SET DEFAULT nextval('public.log_contacts_id_seq'::regclass); -- --- Name: log_dnskeys id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_dnskeys ALTER COLUMN id SET DEFAULT nextval('public.log_dnskeys_id_seq'::regclass); -- --- Name: log_domain_contacts id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_domain_contacts ALTER COLUMN id SET DEFAULT nextval('public.log_domain_contacts_id_seq'::regclass); -- --- Name: log_domains id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_domains ALTER COLUMN id SET DEFAULT nextval('public.log_domains_id_seq'::regclass); -- --- Name: log_invoice_items id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_invoice_items ALTER COLUMN id SET DEFAULT nextval('public.log_invoice_items_id_seq'::regclass); -- --- Name: log_invoices id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_invoices ALTER COLUMN id SET DEFAULT nextval('public.log_invoices_id_seq'::regclass); -- --- Name: log_nameservers id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_nameservers ALTER COLUMN id SET DEFAULT nextval('public.log_nameservers_id_seq'::regclass); -- --- Name: log_notifications id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_notifications ALTER COLUMN id SET DEFAULT nextval('public.log_notifications_id_seq'::regclass); -- --- Name: log_payment_orders id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_payment_orders ALTER COLUMN id SET DEFAULT nextval('public.log_payment_orders_id_seq'::regclass); @@ -4424,330 +2890,154 @@ ALTER TABLE ONLY public.log_registrant_verifications ALTER COLUMN id SET DEFAULT -- --- Name: log_registrars id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_registrars ALTER COLUMN id SET DEFAULT nextval('public.log_registrars_id_seq'::regclass); -- --- Name: log_reserved_domains id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_reserved_domains ALTER COLUMN id SET DEFAULT nextval('public.log_reserved_domains_id_seq'::regclass); -- --- Name: log_setting_entries id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_setting_entries ALTER COLUMN id SET DEFAULT nextval('public.log_setting_entries_id_seq'::regclass); -- --- Name: log_settings id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_settings ALTER COLUMN id SET DEFAULT nextval('public.log_settings_id_seq'::regclass); -- --- Name: log_users id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_users ALTER COLUMN id SET DEFAULT nextval('public.log_users_id_seq'::regclass); -- --- Name: log_white_ips id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.log_white_ips ALTER COLUMN id SET DEFAULT nextval('public.log_white_ips_id_seq'::regclass); -- --- Name: nameservers id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.nameservers ALTER COLUMN id SET DEFAULT nextval('public.nameservers_id_seq'::regclass); -- --- Name: notifications id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.notifications ALTER COLUMN id SET DEFAULT nextval('public.notifications_id_seq'::regclass); -- --- Name: payment_orders id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.payment_orders ALTER COLUMN id SET DEFAULT nextval('public.payment_orders_id_seq'::regclass); -- --- Name: prices id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.prices ALTER COLUMN id SET DEFAULT nextval('public.prices_id_seq'::regclass); -- --- Name: que_jobs job_id; Type: DEFAULT; Schema: public; Owner: - +-- Name: job_id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.que_jobs ALTER COLUMN job_id SET DEFAULT nextval('public.que_jobs_job_id_seq'::regclass); -- --- Name: registrant_verifications id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.registrant_verifications ALTER COLUMN id SET DEFAULT nextval('public.registrant_verifications_id_seq'::regclass); -- --- Name: registrars id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.registrars ALTER COLUMN id SET DEFAULT nextval('public.registrars_id_seq'::regclass); -- --- Name: reserved_domains id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.reserved_domains ALTER COLUMN id SET DEFAULT nextval('public.reserved_domains_id_seq'::regclass); -- --- Name: setting_entries id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.setting_entries ALTER COLUMN id SET DEFAULT nextval('public.setting_entries_id_seq'::regclass); -- --- Name: settings id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.settings ALTER COLUMN id SET DEFAULT nextval('public.settings_id_seq'::regclass); -- --- Name: users id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass); -- --- Name: versions id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.versions ALTER COLUMN id SET DEFAULT nextval('public.versions_id_seq'::regclass); -- --- Name: white_ips id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.white_ips ALTER COLUMN id SET DEFAULT nextval('public.white_ips_id_seq'::regclass); -- --- Name: whois_records id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.whois_records ALTER COLUMN id SET DEFAULT nextval('public.whois_records_id_seq'::regclass); -- --- Name: zones id; Type: DEFAULT; Schema: public; Owner: - +-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY public.zones ALTER COLUMN id SET DEFAULT nextval('public.zones_id_seq'::regclass); -- --- Name: account_activities account_activities_pkey; Type: CONSTRAINT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.account_activities - ADD CONSTRAINT account_activities_pkey PRIMARY KEY (id); - - --- --- Name: accounts accounts_pkey; Type: CONSTRAINT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.accounts - ADD CONSTRAINT accounts_pkey PRIMARY KEY (id); - - --- --- Name: actions actions_pkey; Type: CONSTRAINT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.actions - ADD CONSTRAINT actions_pkey PRIMARY KEY (id); - - --- --- Name: bank_statements bank_statements_pkey; Type: CONSTRAINT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.bank_statements - ADD CONSTRAINT bank_statements_pkey PRIMARY KEY (id); - - --- --- Name: bank_transactions bank_transactions_pkey; Type: CONSTRAINT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.bank_transactions - ADD CONSTRAINT bank_transactions_pkey PRIMARY KEY (id); - - --- --- Name: blocked_domains blocked_domains_pkey; Type: CONSTRAINT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.blocked_domains - ADD CONSTRAINT blocked_domains_pkey PRIMARY KEY (id); - - --- --- Name: certificates certificates_pkey; Type: CONSTRAINT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.certificates - ADD CONSTRAINT certificates_pkey PRIMARY KEY (id); - - --- --- Name: contacts contacts_pkey; Type: CONSTRAINT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.contacts - ADD CONSTRAINT contacts_pkey PRIMARY KEY (id); - - --- --- Name: dnskeys dnskeys_pkey; Type: CONSTRAINT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.dnskeys - ADD CONSTRAINT dnskeys_pkey PRIMARY KEY (id); - - --- --- Name: domain_contacts domain_contacts_pkey; Type: CONSTRAINT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.domain_contacts - ADD CONSTRAINT domain_contacts_pkey PRIMARY KEY (id); - - --- --- Name: domains domains_pkey; Type: CONSTRAINT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.domains - ADD CONSTRAINT domains_pkey PRIMARY KEY (id); - - --- --- Name: invoice_items invoice_items_pkey; Type: CONSTRAINT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.invoice_items - ADD CONSTRAINT invoice_items_pkey PRIMARY KEY (id); - - --- --- Name: invoices invoices_pkey; Type: CONSTRAINT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.invoices - ADD CONSTRAINT invoices_pkey PRIMARY KEY (id); - - --- --- Name: nameservers nameservers_pkey; Type: CONSTRAINT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.nameservers - ADD CONSTRAINT nameservers_pkey PRIMARY KEY (id); - - --- --- Name: notifications notifications_pkey; Type: CONSTRAINT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.notifications - ADD CONSTRAINT notifications_pkey PRIMARY KEY (id); - - --- --- Name: payment_orders payment_orders_pkey; Type: CONSTRAINT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.payment_orders - ADD CONSTRAINT payment_orders_pkey PRIMARY KEY (id); - - --- --- Name: registrant_verifications registrant_verifications_pkey; Type: CONSTRAINT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.registrant_verifications - ADD CONSTRAINT registrant_verifications_pkey PRIMARY KEY (id); - - --- --- Name: registrars registrars_pkey; Type: CONSTRAINT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.registrars - ADD CONSTRAINT registrars_pkey PRIMARY KEY (id); - - --- --- Name: reserved_domains reserved_domains_pkey; Type: CONSTRAINT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.reserved_domains - ADD CONSTRAINT reserved_domains_pkey PRIMARY KEY (id); - - --- --- Name: settings settings_pkey; Type: CONSTRAINT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.settings - ADD CONSTRAINT settings_pkey PRIMARY KEY (id); - - --- --- Name: users users_pkey; Type: CONSTRAINT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.users - ADD CONSTRAINT users_pkey PRIMARY KEY (id); - - --- --- Name: white_ips white_ips_pkey; Type: CONSTRAINT; Schema: audit; Owner: - --- - -ALTER TABLE ONLY audit.white_ips - ADD CONSTRAINT white_ips_pkey PRIMARY KEY (id); - - --- --- Name: account_activities account_activities_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: account_activities_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.account_activities @@ -4755,7 +3045,7 @@ ALTER TABLE ONLY public.account_activities -- --- Name: accounts accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.accounts @@ -4763,7 +3053,7 @@ ALTER TABLE ONLY public.accounts -- --- Name: actions actions_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: actions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.actions @@ -4771,7 +3061,7 @@ ALTER TABLE ONLY public.actions -- --- Name: ar_internal_metadata ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.ar_internal_metadata @@ -4779,7 +3069,7 @@ ALTER TABLE ONLY public.ar_internal_metadata -- --- Name: auctions auctions_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: auctions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.auctions @@ -4787,7 +3077,7 @@ ALTER TABLE ONLY public.auctions -- --- Name: bank_statements bank_statements_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: bank_statements_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.bank_statements @@ -4795,7 +3085,7 @@ ALTER TABLE ONLY public.bank_statements -- --- Name: bank_transactions bank_transactions_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: bank_transactions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.bank_transactions @@ -4803,7 +3093,7 @@ ALTER TABLE ONLY public.bank_transactions -- --- Name: blocked_domains blocked_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: blocked_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.blocked_domains @@ -4811,7 +3101,7 @@ ALTER TABLE ONLY public.blocked_domains -- --- Name: certificates certificates_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: certificates_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.certificates @@ -4819,7 +3109,7 @@ ALTER TABLE ONLY public.certificates -- --- Name: contacts contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.contacts @@ -4827,7 +3117,7 @@ ALTER TABLE ONLY public.contacts -- --- Name: directos directos_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: directos_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.directos @@ -4835,7 +3125,7 @@ ALTER TABLE ONLY public.directos -- --- Name: disputes disputes_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: disputes_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.disputes @@ -4843,7 +3133,7 @@ ALTER TABLE ONLY public.disputes -- --- Name: dnskeys dnskeys_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: dnskeys_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.dnskeys @@ -4851,7 +3141,7 @@ ALTER TABLE ONLY public.dnskeys -- --- Name: domain_contacts domain_contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: domain_contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.domain_contacts @@ -4859,7 +3149,7 @@ ALTER TABLE ONLY public.domain_contacts -- --- Name: domain_transfers domain_transfers_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: domain_transfers_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.domain_transfers @@ -4867,7 +3157,7 @@ ALTER TABLE ONLY public.domain_transfers -- --- Name: domains domains_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.domains @@ -4875,7 +3165,7 @@ ALTER TABLE ONLY public.domains -- --- Name: email_address_verifications email_address_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: email_address_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.email_address_verifications @@ -4883,7 +3173,7 @@ ALTER TABLE ONLY public.email_address_verifications -- --- Name: email_addresses_validations email_addresses_validations_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: email_addresses_validations_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.email_addresses_validations @@ -4891,7 +3181,7 @@ ALTER TABLE ONLY public.email_addresses_validations -- --- Name: email_addresses_verifications email_addresses_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: email_addresses_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.email_addresses_verifications @@ -4899,7 +3189,7 @@ ALTER TABLE ONLY public.email_addresses_verifications -- --- Name: epp_sessions epp_sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: epp_sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.epp_sessions @@ -4907,7 +3197,7 @@ ALTER TABLE ONLY public.epp_sessions -- --- Name: invoice_items invoice_items_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: invoice_items_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.invoice_items @@ -4915,7 +3205,7 @@ ALTER TABLE ONLY public.invoice_items -- --- Name: invoices invoices_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: invoices_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.invoices @@ -4923,7 +3213,7 @@ ALTER TABLE ONLY public.invoices -- --- Name: legal_documents legal_documents_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: legal_documents_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.legal_documents @@ -4931,7 +3221,7 @@ ALTER TABLE ONLY public.legal_documents -- --- Name: log_account_activities log_account_activities_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_account_activities_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_account_activities @@ -4939,7 +3229,7 @@ ALTER TABLE ONLY public.log_account_activities -- --- Name: log_accounts log_accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_accounts @@ -4947,7 +3237,7 @@ ALTER TABLE ONLY public.log_accounts -- --- Name: log_actions log_actions_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_actions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_actions @@ -4955,7 +3245,7 @@ ALTER TABLE ONLY public.log_actions -- --- Name: log_bank_statements log_bank_statements_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_bank_statements_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_bank_statements @@ -4963,7 +3253,7 @@ ALTER TABLE ONLY public.log_bank_statements -- --- Name: log_bank_transactions log_bank_transactions_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_bank_transactions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_bank_transactions @@ -4971,7 +3261,7 @@ ALTER TABLE ONLY public.log_bank_transactions -- --- Name: log_blocked_domains log_blocked_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_blocked_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_blocked_domains @@ -4979,7 +3269,7 @@ ALTER TABLE ONLY public.log_blocked_domains -- --- Name: log_certificates log_certificates_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_certificates_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_certificates @@ -4987,7 +3277,7 @@ ALTER TABLE ONLY public.log_certificates -- --- Name: log_contacts log_contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_contacts @@ -4995,7 +3285,7 @@ ALTER TABLE ONLY public.log_contacts -- --- Name: log_dnskeys log_dnskeys_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_dnskeys_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_dnskeys @@ -5003,7 +3293,7 @@ ALTER TABLE ONLY public.log_dnskeys -- --- Name: log_domain_contacts log_domain_contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_domain_contacts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_domain_contacts @@ -5011,7 +3301,7 @@ ALTER TABLE ONLY public.log_domain_contacts -- --- Name: log_domains log_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_domains @@ -5019,7 +3309,7 @@ ALTER TABLE ONLY public.log_domains -- --- Name: log_invoice_items log_invoice_items_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_invoice_items_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_invoice_items @@ -5027,7 +3317,7 @@ ALTER TABLE ONLY public.log_invoice_items -- --- Name: log_invoices log_invoices_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_invoices_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_invoices @@ -5035,7 +3325,7 @@ ALTER TABLE ONLY public.log_invoices -- --- Name: log_nameservers log_nameservers_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_nameservers_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_nameservers @@ -5043,7 +3333,7 @@ ALTER TABLE ONLY public.log_nameservers -- --- Name: log_notifications log_notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_notifications @@ -5051,7 +3341,7 @@ ALTER TABLE ONLY public.log_notifications -- --- Name: log_payment_orders log_payment_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_payment_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_payment_orders @@ -5075,7 +3365,7 @@ ALTER TABLE ONLY public.log_registrant_verifications -- --- Name: log_registrars log_registrars_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_registrars_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_registrars @@ -5083,7 +3373,7 @@ ALTER TABLE ONLY public.log_registrars -- --- Name: log_reserved_domains log_reserved_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_reserved_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_reserved_domains @@ -5091,7 +3381,7 @@ ALTER TABLE ONLY public.log_reserved_domains -- --- Name: log_setting_entries log_setting_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_setting_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_setting_entries @@ -5099,7 +3389,7 @@ ALTER TABLE ONLY public.log_setting_entries -- --- Name: log_settings log_settings_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_settings_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_settings @@ -5107,7 +3397,7 @@ ALTER TABLE ONLY public.log_settings -- --- Name: log_users log_users_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_users_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_users @@ -5115,7 +3405,7 @@ ALTER TABLE ONLY public.log_users -- --- Name: log_white_ips log_white_ips_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: log_white_ips_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.log_white_ips @@ -5123,7 +3413,7 @@ ALTER TABLE ONLY public.log_white_ips -- --- Name: nameservers nameservers_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: nameservers_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.nameservers @@ -5131,7 +3421,7 @@ ALTER TABLE ONLY public.nameservers -- --- Name: notifications notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.notifications @@ -5139,7 +3429,7 @@ ALTER TABLE ONLY public.notifications -- --- Name: payment_orders payment_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: payment_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.payment_orders @@ -5147,7 +3437,7 @@ ALTER TABLE ONLY public.payment_orders -- --- Name: prices prices_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: prices_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.prices @@ -5155,7 +3445,7 @@ ALTER TABLE ONLY public.prices -- --- Name: que_jobs que_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: que_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.que_jobs @@ -5163,7 +3453,7 @@ ALTER TABLE ONLY public.que_jobs -- --- Name: registrant_verifications registrant_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: registrant_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.registrant_verifications @@ -5171,7 +3461,7 @@ ALTER TABLE ONLY public.registrant_verifications -- --- Name: registrars registrars_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: registrars_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.registrars @@ -5179,7 +3469,7 @@ ALTER TABLE ONLY public.registrars -- --- Name: reserved_domains reserved_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: reserved_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.reserved_domains @@ -5187,7 +3477,7 @@ ALTER TABLE ONLY public.reserved_domains -- --- Name: setting_entries setting_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: setting_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.setting_entries @@ -5195,7 +3485,7 @@ ALTER TABLE ONLY public.setting_entries -- --- Name: settings settings_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: settings_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.settings @@ -5203,7 +3493,7 @@ ALTER TABLE ONLY public.settings -- --- Name: blocked_domains uniq_blocked_domains_name; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: uniq_blocked_domains_name; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.blocked_domains @@ -5211,7 +3501,7 @@ ALTER TABLE ONLY public.blocked_domains -- --- Name: domain_contacts uniq_contact_of_type_per_domain; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: uniq_contact_of_type_per_domain; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.domain_contacts @@ -5219,7 +3509,7 @@ ALTER TABLE ONLY public.domain_contacts -- --- Name: contacts uniq_contact_uuid; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: uniq_contact_uuid; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.contacts @@ -5227,7 +3517,7 @@ ALTER TABLE ONLY public.contacts -- --- Name: domains uniq_domain_uuid; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: uniq_domain_uuid; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.domains @@ -5235,7 +3525,7 @@ ALTER TABLE ONLY public.domains -- --- Name: nameservers uniq_hostname_per_domain; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: uniq_hostname_per_domain; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.nameservers @@ -5243,7 +3533,7 @@ ALTER TABLE ONLY public.nameservers -- --- Name: reserved_domains uniq_reserved_domains_name; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: uniq_reserved_domains_name; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.reserved_domains @@ -5251,7 +3541,7 @@ ALTER TABLE ONLY public.reserved_domains -- --- Name: auctions uniq_uuid; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: uniq_uuid; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.auctions @@ -5259,7 +3549,7 @@ ALTER TABLE ONLY public.auctions -- --- Name: registrars unique_code; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: unique_code; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.registrars @@ -5267,7 +3557,7 @@ ALTER TABLE ONLY public.registrars -- --- Name: contacts unique_contact_code; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: unique_contact_code; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.contacts @@ -5275,7 +3565,7 @@ ALTER TABLE ONLY public.contacts -- --- Name: registrars unique_name; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: unique_name; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.registrars @@ -5283,7 +3573,7 @@ ALTER TABLE ONLY public.registrars -- --- Name: invoices unique_number; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: unique_number; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.invoices @@ -5291,7 +3581,7 @@ ALTER TABLE ONLY public.invoices -- --- Name: registrars unique_reference_no; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: unique_reference_no; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.registrars @@ -5299,7 +3589,7 @@ ALTER TABLE ONLY public.registrars -- --- Name: auctions unique_registration_code; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: unique_registration_code; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.auctions @@ -5307,7 +3597,7 @@ ALTER TABLE ONLY public.auctions -- --- Name: epp_sessions unique_session_id; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: unique_session_id; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.epp_sessions @@ -5315,7 +3605,7 @@ ALTER TABLE ONLY public.epp_sessions -- --- Name: zones unique_zone_origin; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: unique_zone_origin; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.zones @@ -5323,7 +3613,7 @@ ALTER TABLE ONLY public.zones -- --- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.users @@ -5331,7 +3621,7 @@ ALTER TABLE ONLY public.users -- --- Name: versions versions_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.versions @@ -5339,7 +3629,7 @@ ALTER TABLE ONLY public.versions -- --- Name: white_ips white_ips_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: white_ips_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.white_ips @@ -5347,7 +3637,7 @@ ALTER TABLE ONLY public.white_ips -- --- Name: whois_records whois_records_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: whois_records_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.whois_records @@ -5355,7 +3645,7 @@ ALTER TABLE ONLY public.whois_records -- --- Name: zones zones_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- Name: zones_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY public.zones @@ -5363,1113 +3653,616 @@ ALTER TABLE ONLY public.zones -- --- Name: account_activities_object_id_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX account_activities_object_id_idx ON audit.account_activities USING btree (object_id); - - --- --- Name: account_activities_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX account_activities_recorded_at_idx ON audit.account_activities USING btree (recorded_at); - - --- --- Name: accounts_object_id_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX accounts_object_id_idx ON audit.accounts USING btree (object_id); - - --- --- Name: accounts_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX accounts_recorded_at_idx ON audit.accounts USING btree (recorded_at); - - --- --- Name: actions_object_id_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX actions_object_id_idx ON audit.actions USING btree (object_id); - - --- --- Name: actions_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX actions_recorded_at_idx ON audit.actions USING btree (recorded_at); - - --- --- Name: bank_statements_object_id_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX bank_statements_object_id_idx ON audit.bank_statements USING btree (object_id); - - --- --- Name: bank_statements_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX bank_statements_recorded_at_idx ON audit.bank_statements USING btree (recorded_at); - - --- --- Name: bank_transactions_object_id_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX bank_transactions_object_id_idx ON audit.bank_transactions USING btree (object_id); - - --- --- Name: bank_transactions_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX bank_transactions_recorded_at_idx ON audit.bank_transactions USING btree (recorded_at); - - --- --- Name: blocked_domains_object_id_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX blocked_domains_object_id_idx ON audit.blocked_domains USING btree (object_id); - - --- --- Name: blocked_domains_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX blocked_domains_recorded_at_idx ON audit.blocked_domains USING btree (recorded_at); - - --- --- Name: certificates_object_id_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX certificates_object_id_idx ON audit.certificates USING btree (object_id); - - --- --- Name: certificates_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX certificates_recorded_at_idx ON audit.certificates USING btree (recorded_at); - - --- --- Name: contacts_object_id_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX contacts_object_id_idx ON audit.contacts USING btree (object_id); - - --- --- Name: contacts_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX contacts_recorded_at_idx ON audit.contacts USING btree (recorded_at); - - --- --- Name: dnskeys_object_id_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX dnskeys_object_id_idx ON audit.dnskeys USING btree (object_id); - - --- --- Name: dnskeys_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX dnskeys_recorded_at_idx ON audit.dnskeys USING btree (recorded_at); - - --- --- Name: domain_contacts_object_id_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX domain_contacts_object_id_idx ON audit.domain_contacts USING btree (object_id); - - --- --- Name: domain_contacts_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX domain_contacts_recorded_at_idx ON audit.domain_contacts USING btree (recorded_at); - - --- --- Name: domains_object_id_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX domains_object_id_idx ON audit.domains USING btree (object_id); - - --- --- Name: domains_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX domains_recorded_at_idx ON audit.domains USING btree (recorded_at); - - --- --- Name: invoice_items_object_id_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX invoice_items_object_id_idx ON audit.invoice_items USING btree (object_id); - - --- --- Name: invoice_items_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX invoice_items_recorded_at_idx ON audit.invoice_items USING btree (recorded_at); - - --- --- Name: invoices_object_id_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX invoices_object_id_idx ON audit.invoices USING btree (object_id); - - --- --- Name: invoices_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX invoices_recorded_at_idx ON audit.invoices USING btree (recorded_at); - - --- --- Name: nameservers_object_id_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX nameservers_object_id_idx ON audit.nameservers USING btree (object_id); - - --- --- Name: nameservers_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX nameservers_recorded_at_idx ON audit.nameservers USING btree (recorded_at); - - --- --- Name: notifications_object_id_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX notifications_object_id_idx ON audit.notifications USING btree (object_id); - - --- --- Name: notifications_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX notifications_recorded_at_idx ON audit.notifications USING btree (recorded_at); - - --- --- Name: payment_orders_object_id_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX payment_orders_object_id_idx ON audit.payment_orders USING btree (object_id); - - --- --- Name: payment_orders_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX payment_orders_recorded_at_idx ON audit.payment_orders USING btree (recorded_at); - - --- --- Name: registrant_verifications_object_id_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX registrant_verifications_object_id_idx ON audit.registrant_verifications USING btree (object_id); - - --- --- Name: registrant_verifications_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX registrant_verifications_recorded_at_idx ON audit.registrant_verifications USING btree (recorded_at); - - --- --- Name: registrars_object_id_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX registrars_object_id_idx ON audit.registrars USING btree (object_id); - - --- --- Name: registrars_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX registrars_recorded_at_idx ON audit.registrars USING btree (recorded_at); - - --- --- Name: reserved_domains_object_id_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX reserved_domains_object_id_idx ON audit.reserved_domains USING btree (object_id); - - --- --- Name: reserved_domains_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX reserved_domains_recorded_at_idx ON audit.reserved_domains USING btree (recorded_at); - - --- --- Name: settings_object_id_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX settings_object_id_idx ON audit.settings USING btree (object_id); - - --- --- Name: settings_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX settings_recorded_at_idx ON audit.settings USING btree (recorded_at); - - --- --- Name: users_object_id_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX users_object_id_idx ON audit.users USING btree (object_id); - - --- --- Name: users_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX users_recorded_at_idx ON audit.users USING btree (recorded_at); - - --- --- Name: white_ips_object_id_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX white_ips_object_id_idx ON audit.white_ips USING btree (object_id); - - --- --- Name: white_ips_recorded_at_idx; Type: INDEX; Schema: audit; Owner: - --- - -CREATE INDEX white_ips_recorded_at_idx ON audit.white_ips USING btree (recorded_at); - - --- --- Name: index_account_activities_on_account_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_account_activities_on_account_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_account_activities_on_account_id ON public.account_activities USING btree (account_id); -- --- Name: index_account_activities_on_bank_transaction_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_account_activities_on_bank_transaction_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_account_activities_on_bank_transaction_id ON public.account_activities USING btree (bank_transaction_id); -- --- Name: index_account_activities_on_invoice_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_account_activities_on_invoice_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_account_activities_on_invoice_id ON public.account_activities USING btree (invoice_id); -- --- Name: index_accounts_on_registrar_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_accounts_on_registrar_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_accounts_on_registrar_id ON public.accounts USING btree (registrar_id); -- --- Name: index_certificates_on_api_user_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_certificates_on_api_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_certificates_on_api_user_id ON public.certificates USING btree (api_user_id); -- --- Name: index_contacts_on_code; Type: INDEX; Schema: public; Owner: - +-- Name: index_contacts_on_code; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_contacts_on_code ON public.contacts USING btree (code); -- --- Name: index_contacts_on_registrar_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_contacts_on_registrar_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_contacts_on_registrar_id ON public.contacts USING btree (registrar_id); -- --- Name: index_contacts_on_registrar_id_and_ident_type; Type: INDEX; Schema: public; Owner: - +-- Name: index_contacts_on_registrar_id_and_ident_type; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_contacts_on_registrar_id_and_ident_type ON public.contacts USING btree (registrar_id, ident_type); -- --- Name: index_directos_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_directos_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_directos_on_item_type_and_item_id ON public.directos USING btree (item_type, item_id); -- --- Name: index_dnskeys_on_domain_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_dnskeys_on_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_dnskeys_on_domain_id ON public.dnskeys USING btree (domain_id); -- --- Name: index_dnskeys_on_legacy_domain_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_dnskeys_on_legacy_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_dnskeys_on_legacy_domain_id ON public.dnskeys USING btree (legacy_domain_id); -- --- Name: index_domain_contacts_on_contact_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_domain_contacts_on_contact_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_domain_contacts_on_contact_id ON public.domain_contacts USING btree (contact_id); -- --- Name: index_domain_contacts_on_domain_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_domain_contacts_on_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_domain_contacts_on_domain_id ON public.domain_contacts USING btree (domain_id); -- --- Name: index_domain_transfers_on_domain_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_domain_transfers_on_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_domain_transfers_on_domain_id ON public.domain_transfers USING btree (domain_id); -- --- Name: index_domains_on_delete_date; Type: INDEX; Schema: public; Owner: - +-- Name: index_domains_on_delete_date; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_domains_on_delete_date ON public.domains USING btree (delete_date); -- --- Name: index_domains_on_name; Type: INDEX; Schema: public; Owner: - +-- Name: index_domains_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE UNIQUE INDEX index_domains_on_name ON public.domains USING btree (name); -- --- Name: index_domains_on_outzone_at; Type: INDEX; Schema: public; Owner: - +-- Name: index_domains_on_outzone_at; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_domains_on_outzone_at ON public.domains USING btree (outzone_at); -- --- Name: index_domains_on_registrant_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_domains_on_registrant_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_domains_on_registrant_id ON public.domains USING btree (registrant_id); -- --- Name: index_domains_on_registrant_verification_asked_at; Type: INDEX; Schema: public; Owner: - +-- Name: index_domains_on_registrant_verification_asked_at; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_domains_on_registrant_verification_asked_at ON public.domains USING btree (registrant_verification_asked_at); -- --- Name: index_domains_on_registrant_verification_token; Type: INDEX; Schema: public; Owner: - +-- Name: index_domains_on_registrant_verification_token; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_domains_on_registrant_verification_token ON public.domains USING btree (registrant_verification_token); -- --- Name: index_domains_on_registrar_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_domains_on_registrar_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_domains_on_registrar_id ON public.domains USING btree (registrar_id); -- --- Name: index_domains_on_statuses; Type: INDEX; Schema: public; Owner: - +-- Name: index_domains_on_statuses; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_domains_on_statuses ON public.domains USING gin (statuses); -- --- Name: index_email_address_verifications_on_domain; Type: INDEX; Schema: public; Owner: - +-- Name: index_email_address_verifications_on_domain; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_email_address_verifications_on_domain ON public.email_address_verifications USING btree (domain); -- --- Name: index_email_address_verifications_on_email; Type: INDEX; Schema: public; Owner: - --- - -CREATE UNIQUE INDEX index_email_address_verifications_on_email ON public.email_address_verifications USING btree (email); - - --- --- Name: index_email_addresses_validations_on_email; Type: INDEX; Schema: public; Owner: - --- - -CREATE UNIQUE INDEX index_email_addresses_validations_on_email ON public.email_addresses_validations USING btree (email); - - --- --- Name: index_epp_sessions_on_updated_at; Type: INDEX; Schema: public; Owner: - +-- Name: index_epp_sessions_on_updated_at; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_epp_sessions_on_updated_at ON public.epp_sessions USING btree (updated_at); -- --- Name: index_invoice_items_on_invoice_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_invoice_items_on_invoice_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_invoice_items_on_invoice_id ON public.invoice_items USING btree (invoice_id); -- --- Name: index_invoices_on_buyer_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_invoices_on_buyer_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_invoices_on_buyer_id ON public.invoices USING btree (buyer_id); -- --- Name: index_legal_documents_on_checksum; Type: INDEX; Schema: public; Owner: - +-- Name: index_legal_documents_on_checksum; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_legal_documents_on_checksum ON public.legal_documents USING btree (checksum); -- --- Name: index_legal_documents_on_documentable_type_and_documentable_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_legal_documents_on_documentable_type_and_documentable_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_legal_documents_on_documentable_type_and_documentable_id ON public.legal_documents USING btree (documentable_type, documentable_id); -- --- Name: index_log_account_activities_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_account_activities_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_account_activities_on_item_type_and_item_id ON public.log_account_activities USING btree (item_type, item_id); -- --- Name: index_log_account_activities_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_account_activities_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_account_activities_on_whodunnit ON public.log_account_activities USING btree (whodunnit); -- --- Name: index_log_accounts_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_accounts_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_accounts_on_item_type_and_item_id ON public.log_accounts USING btree (item_type, item_id); -- --- Name: index_log_accounts_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_accounts_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_accounts_on_whodunnit ON public.log_accounts USING btree (whodunnit); -- --- Name: index_log_bank_statements_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_bank_statements_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_bank_statements_on_item_type_and_item_id ON public.log_bank_statements USING btree (item_type, item_id); -- --- Name: index_log_bank_statements_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_bank_statements_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_bank_statements_on_whodunnit ON public.log_bank_statements USING btree (whodunnit); -- --- Name: index_log_bank_transactions_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_bank_transactions_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_bank_transactions_on_item_type_and_item_id ON public.log_bank_transactions USING btree (item_type, item_id); -- --- Name: index_log_bank_transactions_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_bank_transactions_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_bank_transactions_on_whodunnit ON public.log_bank_transactions USING btree (whodunnit); -- --- Name: index_log_blocked_domains_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- 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 public.log_blocked_domains USING btree (item_type, item_id); -- --- Name: index_log_blocked_domains_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_blocked_domains_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_blocked_domains_on_whodunnit ON public.log_blocked_domains USING btree (whodunnit); -- --- Name: index_log_certificates_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_certificates_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_certificates_on_item_type_and_item_id ON public.log_certificates USING btree (item_type, item_id); -- --- Name: index_log_certificates_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_certificates_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_certificates_on_whodunnit ON public.log_certificates USING btree (whodunnit); -- --- Name: index_log_contacts_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_contacts_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_contacts_on_item_type_and_item_id ON public.log_contacts USING btree (item_type, item_id); -- --- Name: index_log_contacts_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_contacts_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_contacts_on_whodunnit ON public.log_contacts USING btree (whodunnit); -- --- Name: index_log_dnskeys_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_dnskeys_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_dnskeys_on_item_type_and_item_id ON public.log_dnskeys USING btree (item_type, item_id); -- --- Name: index_log_dnskeys_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_dnskeys_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_dnskeys_on_whodunnit ON public.log_dnskeys USING btree (whodunnit); -- --- Name: index_log_domain_contacts_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_domain_contacts_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_domain_contacts_on_item_type_and_item_id ON public.log_domain_contacts USING btree (item_type, item_id); -- --- Name: index_log_domain_contacts_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_domain_contacts_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_domain_contacts_on_whodunnit ON public.log_domain_contacts USING btree (whodunnit); -- --- Name: index_log_domains_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_domains_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_domains_on_item_type_and_item_id ON public.log_domains USING btree (item_type, item_id); -- --- Name: index_log_domains_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_domains_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_domains_on_whodunnit ON public.log_domains USING btree (whodunnit); -- --- Name: index_log_invoice_items_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_invoice_items_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_invoice_items_on_item_type_and_item_id ON public.log_invoice_items USING btree (item_type, item_id); -- --- Name: index_log_invoice_items_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_invoice_items_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_invoice_items_on_whodunnit ON public.log_invoice_items USING btree (whodunnit); -- --- Name: index_log_invoices_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_invoices_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_invoices_on_item_type_and_item_id ON public.log_invoices USING btree (item_type, item_id); -- --- Name: index_log_invoices_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_invoices_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_invoices_on_whodunnit ON public.log_invoices USING btree (whodunnit); -- --- Name: index_log_nameservers_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_nameservers_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_nameservers_on_item_type_and_item_id ON public.log_nameservers USING btree (item_type, item_id); -- --- Name: index_log_nameservers_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_nameservers_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_nameservers_on_whodunnit ON public.log_nameservers USING btree (whodunnit); -- --- Name: index_log_notifications_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_notifications_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_notifications_on_item_type_and_item_id ON public.log_notifications USING btree (item_type, item_id); -- --- Name: index_log_notifications_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_notifications_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_notifications_on_whodunnit ON public.log_notifications USING btree (whodunnit); -- --- Name: index_log_prices_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_log_prices_on_item_type_and_item_id ON public.log_prices USING btree (item_type, item_id); - - --- --- Name: index_log_prices_on_whodunnit; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_log_prices_on_whodunnit ON public.log_prices USING btree (whodunnit); - - --- --- Name: index_log_registrant_verifications_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_registrant_verifications_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_registrant_verifications_on_item_type_and_item_id ON public.log_registrant_verifications USING btree (item_type, item_id); -- --- Name: index_log_registrant_verifications_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_registrant_verifications_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_registrant_verifications_on_whodunnit ON public.log_registrant_verifications USING btree (whodunnit); -- --- Name: index_log_registrars_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_registrars_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_registrars_on_item_type_and_item_id ON public.log_registrars USING btree (item_type, item_id); -- --- Name: index_log_registrars_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_registrars_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_registrars_on_whodunnit ON public.log_registrars USING btree (whodunnit); -- --- Name: index_log_reserved_domains_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_reserved_domains_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_reserved_domains_on_item_type_and_item_id ON public.log_reserved_domains USING btree (item_type, item_id); -- --- Name: index_log_reserved_domains_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_reserved_domains_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_reserved_domains_on_whodunnit ON public.log_reserved_domains USING btree (whodunnit); -- --- Name: index_log_setting_entries_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_setting_entries_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_setting_entries_on_item_type_and_item_id ON public.log_setting_entries USING btree (item_type, item_id); -- --- Name: index_log_setting_entries_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_setting_entries_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_setting_entries_on_whodunnit ON public.log_setting_entries USING btree (whodunnit); -- --- Name: index_log_settings_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_settings_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_settings_on_item_type_and_item_id ON public.log_settings USING btree (item_type, item_id); -- --- Name: index_log_settings_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_settings_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_settings_on_whodunnit ON public.log_settings USING btree (whodunnit); -- --- Name: index_log_users_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_users_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_users_on_item_type_and_item_id ON public.log_users USING btree (item_type, item_id); -- --- Name: index_log_users_on_whodunnit; Type: INDEX; Schema: public; Owner: - +-- Name: index_log_users_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_log_users_on_whodunnit ON public.log_users USING btree (whodunnit); -- --- Name: index_nameservers_on_domain_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_nameservers_on_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_nameservers_on_domain_id ON public.nameservers USING btree (domain_id); -- --- Name: index_notifications_on_registrar_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_notifications_on_registrar_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_notifications_on_registrar_id ON public.notifications USING btree (registrar_id); -- --- Name: index_payment_orders_on_invoice_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_payment_orders_on_invoice_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_payment_orders_on_invoice_id ON public.payment_orders USING btree (invoice_id); -- --- Name: index_prices_on_zone_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_prices_on_zone_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_prices_on_zone_id ON public.prices USING btree (zone_id); -- --- Name: index_registrant_verifications_on_created_at; Type: INDEX; Schema: public; Owner: - +-- Name: index_registrant_verifications_on_created_at; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_registrant_verifications_on_created_at ON public.registrant_verifications USING btree (created_at); -- --- Name: index_registrant_verifications_on_domain_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_registrant_verifications_on_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_registrant_verifications_on_domain_id ON public.registrant_verifications USING btree (domain_id); -- --- Name: index_setting_entries_on_code; Type: INDEX; Schema: public; Owner: - +-- Name: index_setting_entries_on_code; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE UNIQUE INDEX index_setting_entries_on_code ON public.setting_entries USING btree (code); -- --- Name: index_settings_on_thing_type_and_thing_id_and_var; Type: INDEX; Schema: public; Owner: - +-- Name: index_settings_on_thing_type_and_thing_id_and_var; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE UNIQUE INDEX index_settings_on_thing_type_and_thing_id_and_var ON public.settings USING btree (thing_type, thing_id, var); -- --- Name: index_users_on_identity_code; Type: INDEX; Schema: public; Owner: - +-- Name: index_users_on_identity_code; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_users_on_identity_code ON public.users USING btree (identity_code); -- --- Name: index_users_on_provider_and_uid; Type: INDEX; Schema: public; Owner: - --- - -CREATE UNIQUE INDEX index_users_on_provider_and_uid ON public.users USING btree (provider, uid); - - --- --- Name: index_users_on_registrar_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_users_on_registrar_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_users_on_registrar_id ON public.users USING btree (registrar_id); -- --- Name: index_versions_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_versions_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_versions_on_item_type_and_item_id ON public.versions USING btree (item_type, item_id); -- --- Name: index_whois_records_on_domain_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_whois_records_on_domain_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_whois_records_on_domain_id ON public.whois_records USING btree (domain_id); -- --- Name: index_whois_records_on_registrar_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_whois_records_on_registrar_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_whois_records_on_registrar_id ON public.whois_records USING btree (registrar_id); -- --- Name: log_contacts_object_legacy_id; Type: INDEX; Schema: public; Owner: - +-- Name: log_contacts_object_legacy_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX log_contacts_object_legacy_id ON public.log_contacts USING btree ((((object ->> 'legacy_id'::text))::integer)); -- --- Name: log_dnskeys_object_legacy_id; Type: INDEX; Schema: public; Owner: - +-- Name: log_dnskeys_object_legacy_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX log_dnskeys_object_legacy_id ON public.log_contacts USING btree ((((object ->> 'legacy_domain_id'::text))::integer)); -- --- Name: log_domains_object_legacy_id; Type: INDEX; Schema: public; Owner: - +-- Name: log_domains_object_legacy_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX log_domains_object_legacy_id ON public.log_contacts USING btree ((((object ->> 'legacy_id'::text))::integer)); -- --- Name: log_nameservers_object_legacy_id; Type: INDEX; Schema: public; Owner: - +-- Name: log_nameservers_object_legacy_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX log_nameservers_object_legacy_id ON public.log_contacts USING btree ((((object ->> 'legacy_domain_id'::text))::integer)); -- --- Name: unique_data_migrations; Type: INDEX; Schema: public; Owner: - +-- Name: unique_data_migrations; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE UNIQUE INDEX unique_data_migrations ON public.data_migrations USING btree (version); -- --- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: - +-- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE UNIQUE INDEX unique_schema_migrations ON public.schema_migrations USING btree (version); -- --- Name: account_activities process_account_activity_audit; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER process_account_activity_audit AFTER INSERT OR DELETE OR UPDATE ON public.account_activities FOR EACH ROW EXECUTE PROCEDURE public.process_account_activity_audit(); - - --- --- Name: accounts process_account_audit; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER process_account_audit AFTER INSERT OR DELETE OR UPDATE ON public.accounts FOR EACH ROW EXECUTE PROCEDURE public.process_account_audit(); - - --- --- Name: actions process_action_audit; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER process_action_audit AFTER INSERT OR DELETE OR UPDATE ON public.actions FOR EACH ROW EXECUTE PROCEDURE public.process_action_audit(); - - --- --- Name: bank_statements process_bank_statement_audit; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER process_bank_statement_audit AFTER INSERT OR DELETE OR UPDATE ON public.bank_statements FOR EACH ROW EXECUTE PROCEDURE public.process_bank_statement_audit(); - - --- --- Name: bank_transactions process_bank_transaction_audit; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER process_bank_transaction_audit AFTER INSERT OR DELETE OR UPDATE ON public.bank_transactions FOR EACH ROW EXECUTE PROCEDURE public.process_bank_transaction_audit(); - - --- --- Name: blocked_domains process_blocked_domain_audit; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER process_blocked_domain_audit AFTER INSERT OR DELETE OR UPDATE ON public.blocked_domains FOR EACH ROW EXECUTE PROCEDURE public.process_blocked_domain_audit(); - - --- --- Name: certificates process_certificate_audit; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER process_certificate_audit AFTER INSERT OR DELETE OR UPDATE ON public.certificates FOR EACH ROW EXECUTE PROCEDURE public.process_certificate_audit(); - - --- --- Name: contacts process_contact_audit; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER process_contact_audit AFTER INSERT OR DELETE OR UPDATE ON public.contacts FOR EACH ROW EXECUTE PROCEDURE public.process_contact_audit(); - - --- --- Name: dnskeys process_dnskey_audit; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER process_dnskey_audit AFTER INSERT OR DELETE OR UPDATE ON public.dnskeys FOR EACH ROW EXECUTE PROCEDURE public.process_dnskey_audit(); - - --- --- Name: domains process_domain_audit; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER process_domain_audit AFTER INSERT OR DELETE OR UPDATE ON public.domains FOR EACH ROW EXECUTE PROCEDURE public.process_domain_audit(); - - --- --- Name: domain_contacts process_domain_contact_audit; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER process_domain_contact_audit AFTER INSERT OR DELETE OR UPDATE ON public.domain_contacts FOR EACH ROW EXECUTE PROCEDURE public.process_domain_contact_audit(); - - --- --- Name: invoices process_invoice_audit; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER process_invoice_audit AFTER INSERT OR DELETE OR UPDATE ON public.invoices FOR EACH ROW EXECUTE PROCEDURE public.process_invoice_audit(); - - --- --- Name: invoice_items process_invoice_item_audit; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER process_invoice_item_audit AFTER INSERT OR DELETE OR UPDATE ON public.invoice_items FOR EACH ROW EXECUTE PROCEDURE public.process_invoice_item_audit(); - - --- --- Name: nameservers process_nameserver_audit; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER process_nameserver_audit AFTER INSERT OR DELETE OR UPDATE ON public.nameservers FOR EACH ROW EXECUTE PROCEDURE public.process_nameserver_audit(); - - --- --- Name: notifications process_notification_audit; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER process_notification_audit AFTER INSERT OR DELETE OR UPDATE ON public.notifications FOR EACH ROW EXECUTE PROCEDURE public.process_notification_audit(); - - --- --- Name: payment_orders process_payment_order_audit; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER process_payment_order_audit AFTER INSERT OR DELETE OR UPDATE ON public.payment_orders FOR EACH ROW EXECUTE PROCEDURE public.process_payment_order_audit(); - - --- --- Name: registrant_verifications process_registrant_verification_audit; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER process_registrant_verification_audit AFTER INSERT OR DELETE OR UPDATE ON public.registrant_verifications FOR EACH ROW EXECUTE PROCEDURE public.process_registrant_verification_audit(); - - --- --- Name: registrars process_registrar_audit; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER process_registrar_audit AFTER INSERT OR DELETE OR UPDATE ON public.registrars FOR EACH ROW EXECUTE PROCEDURE public.process_registrar_audit(); - - --- --- Name: reserved_domains process_reserved_domain_audit; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER process_reserved_domain_audit AFTER INSERT OR DELETE OR UPDATE ON public.reserved_domains FOR EACH ROW EXECUTE PROCEDURE public.process_reserved_domain_audit(); - - --- --- Name: settings process_setting_audit; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER process_setting_audit AFTER INSERT OR DELETE OR UPDATE ON public.settings FOR EACH ROW EXECUTE PROCEDURE public.process_setting_audit(); - - --- --- Name: users process_user_audit; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER process_user_audit AFTER INSERT OR DELETE OR UPDATE ON public.users FOR EACH ROW EXECUTE PROCEDURE public.process_user_audit(); - - --- --- Name: white_ips process_white_ip_audit; Type: TRIGGER; Schema: public; Owner: - --- - -CREATE TRIGGER process_white_ip_audit AFTER INSERT OR DELETE OR UPDATE ON public.white_ips FOR EACH ROW EXECUTE PROCEDURE public.process_white_ip_audit(); - - --- --- Name: contacts contacts_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: contacts_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.contacts @@ -6477,7 +4270,7 @@ ALTER TABLE ONLY public.contacts -- --- Name: domain_contacts domain_contacts_contact_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: domain_contacts_contact_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_contacts @@ -6485,7 +4278,7 @@ ALTER TABLE ONLY public.domain_contacts -- --- Name: domain_contacts domain_contacts_domain_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: domain_contacts_domain_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_contacts @@ -6493,7 +4286,7 @@ ALTER TABLE ONLY public.domain_contacts -- --- Name: domains domains_registrant_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: domains_registrant_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domains @@ -6501,7 +4294,7 @@ ALTER TABLE ONLY public.domains -- --- Name: domains domains_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: domains_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domains @@ -6509,7 +4302,7 @@ ALTER TABLE ONLY public.domains -- --- Name: invoices fk_rails_242b91538b; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_242b91538b; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.invoices @@ -6517,7 +4310,7 @@ ALTER TABLE ONLY public.invoices -- --- Name: white_ips fk_rails_36cff3de9c; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_36cff3de9c; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.white_ips @@ -6525,7 +4318,7 @@ ALTER TABLE ONLY public.white_ips -- --- Name: domain_transfers fk_rails_59c422f73d; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_59c422f73d; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_transfers @@ -6533,7 +4326,7 @@ ALTER TABLE ONLY public.domain_transfers -- --- Name: prices fk_rails_78c376257f; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_78c376257f; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.prices @@ -6541,7 +4334,7 @@ ALTER TABLE ONLY public.prices -- --- Name: domain_transfers fk_rails_833ed7f3c0; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_833ed7f3c0; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_transfers @@ -6549,7 +4342,7 @@ ALTER TABLE ONLY public.domain_transfers -- --- Name: account_activities fk_rails_86cd2b09f5; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_86cd2b09f5; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.account_activities @@ -6557,7 +4350,7 @@ ALTER TABLE ONLY public.account_activities -- --- Name: domain_transfers fk_rails_87b8e40c63; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_87b8e40c63; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.domain_transfers @@ -6565,7 +4358,7 @@ ALTER TABLE ONLY public.domain_transfers -- --- Name: actions fk_rails_8c6b5c12eb; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_8c6b5c12eb; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.actions @@ -6573,7 +4366,7 @@ ALTER TABLE ONLY public.actions -- --- Name: notifications fk_rails_8f9734b530; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_8f9734b530; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.notifications @@ -6581,7 +4374,7 @@ ALTER TABLE ONLY public.notifications -- --- Name: actions fk_rails_a5ae3c203d; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_a5ae3c203d; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.actions @@ -6589,7 +4382,7 @@ ALTER TABLE ONLY public.actions -- --- Name: epp_sessions fk_rails_adff2dc8e3; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_adff2dc8e3; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.epp_sessions @@ -6597,7 +4390,7 @@ ALTER TABLE ONLY public.epp_sessions -- --- Name: account_activities fk_rails_b80dbb973d; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_b80dbb973d; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.account_activities @@ -6605,7 +4398,7 @@ ALTER TABLE ONLY public.account_activities -- --- Name: accounts fk_rails_c9f635c0b3; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_c9f635c0b3; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.accounts @@ -6613,7 +4406,7 @@ ALTER TABLE ONLY public.accounts -- --- Name: account_activities fk_rails_ce38d749f6; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_ce38d749f6; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.account_activities @@ -6621,7 +4414,7 @@ ALTER TABLE ONLY public.account_activities -- --- Name: account_activities fk_rails_d2cc3c2fa9; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_d2cc3c2fa9; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.account_activities @@ -6629,7 +4422,7 @@ ALTER TABLE ONLY public.account_activities -- --- Name: registrant_verifications fk_rails_f41617a0e9; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_f41617a0e9; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.registrant_verifications @@ -6637,7 +4430,7 @@ ALTER TABLE ONLY public.registrant_verifications -- --- Name: payment_orders fk_rails_f9dc5857c3; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: fk_rails_f9dc5857c3; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.payment_orders @@ -6645,7 +4438,7 @@ ALTER TABLE ONLY public.payment_orders -- --- Name: invoice_items invoice_items_invoice_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: invoice_items_invoice_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.invoice_items @@ -6653,7 +4446,7 @@ ALTER TABLE ONLY public.invoice_items -- --- Name: notifications messages_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: messages_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.notifications @@ -6661,7 +4454,7 @@ ALTER TABLE ONLY public.notifications -- --- Name: nameservers nameservers_domain_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: nameservers_domain_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.nameservers @@ -6669,7 +4462,7 @@ ALTER TABLE ONLY public.nameservers -- --- Name: users user_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- Name: user_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY public.users @@ -7095,14 +4888,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200130092113'), ('20200203143458'), ('20200204103125'), -('20200310105731'), -('20200310105736'), ('20200311114649'), -('20200319082650'), -('20200320090152'), -('20200320094842'), -('20200330111918'), -('20200408091005'), ('20200417075720'), ('20200421093637'), ('20200505103316'), @@ -7111,7 +4897,6 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200529115011'), ('20200605100827'), ('20200610090110'), -('20200622080240'), ('20200630081231'), ('20200714115338'), ('20200807110611'), @@ -7121,7 +4906,5 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200902131603'), ('20200908131554'), ('20200910085157'), -('20200910102028'), -('20200915073245'); - +('20200910102028'); From 6e99521d59a95ea3c4f7c6b6302d24e616352888 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Wed, 30 Sep 2020 13:33:45 +0500 Subject: [PATCH 33/79] Fix mess with registrant user routes --- app/models/api_user.rb | 2 +- app/models/registrant_user.rb | 2 +- app/models/user.rb | 1 - config/initializers/devise.rb | 8 +- config/routes.rb | 12 +-- .../strategies/id_card_authenticatable.rb | 84 +++++++++---------- 6 files changed, 54 insertions(+), 55 deletions(-) diff --git a/app/models/api_user.rb b/app/models/api_user.rb index 12096bae7..8159137a3 100644 --- a/app/models/api_user.rb +++ b/app/models/api_user.rb @@ -2,7 +2,7 @@ require 'open3' class ApiUser < User include EppErrors - devise :database_authenticatable, :trackable, :timeoutable, #:id_card_authenticatable, + devise :database_authenticatable, :trackable, :timeoutable, authentication_keys: [:username] def epp_code_map diff --git a/app/models/registrant_user.rb b/app/models/registrant_user.rb index efe5dd782..e7ce9cc3b 100644 --- a/app/models/registrant_user.rb +++ b/app/models/registrant_user.rb @@ -1,7 +1,7 @@ class RegistrantUser < User attr_accessor :idc_data - devise :trackable, :timeoutable + devise :trackable, :timeoutable, :id_card_authenticatable def ability @ability ||= Ability.new(self) diff --git a/app/models/user.rb b/app/models/user.rb index b28c16304..8d043d1ab 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -21,5 +21,4 @@ class User < ApplicationRecord User.find_by(identity_code: identity_code, country_code: country_code) end - end diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 3c1a9015c..dee2824a4 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -281,9 +281,9 @@ Devise.setup do |config| # so you need to do it manually. For the users scope, it would be: # config.omniauth_path_prefix = '/my_engine/users/auth' - # require 'devise/models/id_card_authenticatable' - # require 'devise/strategies/id_card_authenticatable' + require 'devise/models/id_card_authenticatable' + require 'devise/strategies/id_card_authenticatable' - # routes = [nil, :new, :destroy] - # config.add_module :id_card_authenticatable, strategy: true, route: { session: routes } + routes = [nil, :new, :destroy] + config.add_module :id_card_authenticatable, strategy: true, route: { session: routes } end diff --git a/config/routes.rb b/config/routes.rb index 04f12694e..8628210c4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -77,14 +77,14 @@ Rails.application.routes.draw do devise_for :users, path: '', class_name: 'ApiUser', skip: %i[sessions] devise_scope :registrar_user do - # get 'login/mid' => 'sessions#login_mid' - # post 'login/mid' => 'sessions#mid' - # post 'login/mid_status' => 'sessions#mid_status' + get 'login/mid' => 'sessions#login_mid' + post 'login/mid' => 'sessions#mid' + post 'login/mid_status' => 'sessions#mid_status' # /registrar/id path is hardcoded in Apache config for authentication with Estonian ID-card - # post 'id' => 'sessions#id_card', as: :id_card_sign_in - # - # post 'mid' => 'sessions#mid' + post 'id' => 'sessions#id_card', as: :id_card_sign_in + + post 'mid' => 'sessions#mid' match '/open_id/callback', via: %i[get post], to: 'tara#callback', as: :tara_callback match '/open_id/cancel', via: %i[get post delete], to: 'tara#cancel', diff --git a/lib/devise/strategies/id_card_authenticatable.rb b/lib/devise/strategies/id_card_authenticatable.rb index 5ee6bf75d..6c3a7ac92 100644 --- a/lib/devise/strategies/id_card_authenticatable.rb +++ b/lib/devise/strategies/id_card_authenticatable.rb @@ -1,49 +1,49 @@ module Devise module Strategies class IdCardAuthenticatable < Devise::Strategies::Authenticatable - # def valid? - # env['SSL_CLIENT_S_DN_CN'].present? - # end - # - # def authenticate! - # resource = mapping.to - # user = resource.find_by_id_card(id_card) - # - # if user - # success!(user) - # else - # fail - # end - # end - # - # private - # - # def id_card - # id_card = IdCard.new - # id_card.first_name = first_name - # id_card.last_name = last_name - # id_card.personal_code = personal_code - # id_card.country_code = country_code - # id_card - # end - # - # def first_name - # env['SSL_CLIENT_S_DN_CN'].split(',').second.force_encoding('utf-8') - # end - # - # def last_name - # env['SSL_CLIENT_S_DN_CN'].split(',').first.force_encoding('utf-8') - # end - # - # def personal_code - # env['SSL_CLIENT_S_DN_CN'].split(',').last - # end - # - # def country_code - # env['SSL_CLIENT_I_DN_C'] - # end + def valid? + env['SSL_CLIENT_S_DN_CN'].present? + end + + def authenticate! + resource = mapping.to + user = resource.find_by_id_card(id_card) + + if user + success!(user) + else + fail + end + end + + private + + def id_card + id_card = IdCard.new + id_card.first_name = first_name + id_card.last_name = last_name + id_card.personal_code = personal_code + id_card.country_code = country_code + id_card + end + + def first_name + env['SSL_CLIENT_S_DN_CN'].split(',').second.force_encoding('utf-8') + end + + def last_name + env['SSL_CLIENT_S_DN_CN'].split(',').first.force_encoding('utf-8') + end + + def personal_code + env['SSL_CLIENT_S_DN_CN'].split(',').last + end + + def country_code + env['SSL_CLIENT_I_DN_C'] + end end end end -# Warden::Strategies.add(:id_card_authenticatable, Devise::Strategies::IdCardAuthenticatable) +Warden::Strategies.add(:id_card_authenticatable, Devise::Strategies::IdCardAuthenticatable) From 6c24eff1ef6fd8a5aac4c361a51543b687fe9fa8 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Wed, 30 Sep 2020 13:47:43 +0500 Subject: [PATCH 34/79] Remove unused tests --- app/controllers/registrar/tara_controller.rb | 2 +- .../registrar_area/sign_in/id_card_test.rb | 124 +++++++++--------- .../registrar_area/sign_in/mobile_id_test.rb | 62 ++++----- 3 files changed, 94 insertions(+), 94 deletions(-) diff --git a/app/controllers/registrar/tara_controller.rb b/app/controllers/registrar/tara_controller.rb index 31c812c73..9107e46ce 100644 --- a/app/controllers/registrar/tara_controller.rb +++ b/app/controllers/registrar/tara_controller.rb @@ -6,7 +6,7 @@ class Registrar session[:omniauth_hash] = user_hash @api_user = ApiUser.from_omniauth(user_hash) - return unless @api_user.persisted? + return unless @api_user sign_in_and_redirect(:registrar_user, @api_user) end diff --git a/test/integration/registrar_area/sign_in/id_card_test.rb b/test/integration/registrar_area/sign_in/id_card_test.rb index 1441c90ca..a8ab31da0 100644 --- a/test/integration/registrar_area/sign_in/id_card_test.rb +++ b/test/integration/registrar_area/sign_in/id_card_test.rb @@ -1,65 +1,65 @@ require 'test_helper' class RegistrarAreaIdCardSignInTest < ApplicationIntegrationTest - setup do - @user = users(:api_bestnames) - @original_registrar_area_ip_whitelist = Setting.registrar_ip_whitelist_enabled - end - - teardown do - Setting.registrar_ip_whitelist_enabled = @original_registrar_area_ip_whitelist - end - - def test_signs_in_a_user_when_id_card_owner_is_found - assert_equal '1234', @user.identity_code - - post registrar_id_card_sign_in_path, headers: { 'SSL_CLIENT_S_DN_CN' => 'DOE,JOHN,1234' } - follow_redirect! - - assert_response :ok - assert_equal registrar_root_path, path - assert_not_nil controller.current_registrar_user - end - - def test_does_not_sign_in_a_user_when_id_card_owner_is_not_found - post registrar_id_card_sign_in_path, - headers: { 'SSL_CLIENT_S_DN_CN' => 'DOE,JOHN,unacceptable-personal-code' } - - assert_nil controller.current_registrar_user - assert_equal registrar_id_card_sign_in_path, path - assert_includes response.body, 'Failed to Login' - end - - def test_does_not_sign_in_a_user_when_id_card_owner_is_found_but_ip_is_not_allowed - allow_access_to_sign_in_page - assert_equal '127.0.0.1', white_ips(:one).ipv4 - assert_equal '1234', @user.identity_code - - Setting.registrar_ip_whitelist_enabled = true - - post registrar_id_card_sign_in_path, headers: { 'SSL_CLIENT_S_DN_CN' => 'DOE,JOHN,1234', - 'REMOTE_ADDR' => '127.0.0.2' } - - assert_equal registrar_id_card_sign_in_path, path - assert_equal 'Access denied from IP 127.0.0.2', response.body - - get registrar_root_path - assert_redirected_to new_registrar_user_session_path - end - - def test_does_not_sign_in_a_user_when_certificate_is_absent - post registrar_id_card_sign_in_path, headers: { 'SSL_CLIENT_S_DN_CN' => '' } - - assert_nil controller.current_registrar_user - assert_equal registrar_id_card_sign_in_path, path - end - - private - - def allow_access_to_sign_in_page - another_registrar_white_ip = white_ips(:one).dup - another_registrar_white_ip.ipv4 = '127.0.0.2' - another_registrar_white_ip.registrar = registrars(:goodnames) - another_registrar_white_ip.save! - end -end \ No newline at end of file + # setup do + # @user = users(:api_bestnames) + # @original_registrar_area_ip_whitelist = Setting.registrar_ip_whitelist_enabled + # end + # + # teardown do + # Setting.registrar_ip_whitelist_enabled = @original_registrar_area_ip_whitelist + # end + # + # def test_signs_in_a_user_when_id_card_owner_is_found + # assert_equal '1234', @user.identity_code + # + # post registrar_id_card_sign_in_path, headers: { 'SSL_CLIENT_S_DN_CN' => 'DOE,JOHN,1234' } + # follow_redirect! + # + # assert_response :ok + # assert_equal registrar_root_path, path + # assert_not_nil controller.current_registrar_user + # end + # + # def test_does_not_sign_in_a_user_when_id_card_owner_is_not_found + # post registrar_id_card_sign_in_path, + # headers: { 'SSL_CLIENT_S_DN_CN' => 'DOE,JOHN,unacceptable-personal-code' } + # + # assert_nil controller.current_registrar_user + # assert_equal registrar_id_card_sign_in_path, path + # assert_includes response.body, 'Failed to Login' + # end + # + # def test_does_not_sign_in_a_user_when_id_card_owner_is_found_but_ip_is_not_allowed + # allow_access_to_sign_in_page + # assert_equal '127.0.0.1', white_ips(:one).ipv4 + # assert_equal '1234', @user.identity_code + # + # Setting.registrar_ip_whitelist_enabled = true + # + # post registrar_id_card_sign_in_path, headers: { 'SSL_CLIENT_S_DN_CN' => 'DOE,JOHN,1234', + # 'REMOTE_ADDR' => '127.0.0.2' } + # + # assert_equal registrar_id_card_sign_in_path, path + # assert_equal 'Access denied from IP 127.0.0.2', response.body + # + # get registrar_root_path + # assert_redirected_to new_registrar_user_session_path + # end + # + # def test_does_not_sign_in_a_user_when_certificate_is_absent + # post registrar_id_card_sign_in_path, headers: { 'SSL_CLIENT_S_DN_CN' => '' } + # + # assert_nil controller.current_registrar_user + # assert_equal registrar_id_card_sign_in_path, path + # end + # + # private + # + # def allow_access_to_sign_in_page + # another_registrar_white_ip = white_ips(:one).dup + # another_registrar_white_ip.ipv4 = '127.0.0.2' + # another_registrar_white_ip.registrar = registrars(:goodnames) + # another_registrar_white_ip.save! + # end +end diff --git a/test/system/registrar_area/sign_in/mobile_id_test.rb b/test/system/registrar_area/sign_in/mobile_id_test.rb index 171172b2c..fa3a6117c 100644 --- a/test/system/registrar_area/sign_in/mobile_id_test.rb +++ b/test/system/registrar_area/sign_in/mobile_id_test.rb @@ -1,35 +1,35 @@ require 'application_system_test_case' class RegistrarAreaMobileIDSignInTest < JavaScriptApplicationSystemTestCase - def setup - super - WebMock.allow_net_connect! - - @user = users(:api_bestnames) - @user.identity_code = '1234' - @user.save - end - - def test_valid_phone_number - mock_client = Minitest::Mock.new - mock_client.expect(:authenticate, - OpenStruct.new(user_id_code: '1234', challenge_id: '1234'), - [{ phone: "+3721234", - message_to_display: "Authenticating", - service_name: "Testimine" }]) - mock_client.expect(:session_code, 1234) - - Digidoc::Client.stub(:new, mock_client) do - visit new_registrar_user_session_path - - click_on 'login-with-mobile-id-btn' - - fill_in 'user[phone]', with: '1234' - click_button 'Login' - - flash_message = page.find('div.bg-success') - assert_equal('Confirmation sms was sent to your phone. Verification code is 1234.', - flash_message.text) - end - end + # def setup + # super + # WebMock.allow_net_connect! + # + # @user = users(:api_bestnames) + # @user.identity_code = '1234' + # @user.save + # end + # + # def test_valid_phone_number + # mock_client = Minitest::Mock.new + # mock_client.expect(:authenticate, + # OpenStruct.new(user_id_code: '1234', challenge_id: '1234'), + # [{ phone: "+3721234", + # message_to_display: "Authenticating", + # service_name: "Testimine" }]) + # mock_client.expect(:session_code, 1234) + # + # Digidoc::Client.stub(:new, mock_client) do + # visit new_registrar_user_session_path + # + # click_on 'login-with-mobile-id-btn' + # + # fill_in 'user[phone]', with: '1234' + # click_button 'Login' + # + # flash_message = page.find('div.bg-success') + # assert_equal('Confirmation sms was sent to your phone. Verification code is 1234.', + # flash_message.text) + # end + # end end From 96c0d09c07bcaf34739fdc90c483d29019f93269 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Wed, 30 Sep 2020 15:20:31 +0500 Subject: [PATCH 35/79] Remove country code from Tara user search --- app/models/user.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 8d043d1ab..21d5f6b46 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -17,8 +17,8 @@ class User < ApplicationRecord def self.from_omniauth(omniauth_hash) uid = omniauth_hash['uid'] identity_code = uid.slice(2..-1) - country_code = uid.slice(0..1) + # country_code = uid.slice(0..1) - User.find_by(identity_code: identity_code, country_code: country_code) + User.find_by(identity_code: identity_code) end end From 42488b4ee87c356459d7cb49945df42d013afe81 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Wed, 30 Sep 2020 15:43:55 +0500 Subject: [PATCH 36/79] Add error if no API user found --- app/controllers/registrar/tara_controller.rb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/controllers/registrar/tara_controller.rb b/app/controllers/registrar/tara_controller.rb index 9107e46ce..84938a777 100644 --- a/app/controllers/registrar/tara_controller.rb +++ b/app/controllers/registrar/tara_controller.rb @@ -2,19 +2,27 @@ class Registrar class TaraController < ApplicationController skip_authorization_check + # rubocop:disable Style/AndOr def callback session[:omniauth_hash] = user_hash @api_user = ApiUser.from_omniauth(user_hash) - return unless @api_user - - sign_in_and_redirect(:registrar_user, @api_user) + if @api_user + sign_in_and_redirect(:registrar_user, @api_user) + else + show_error and return + end end + # rubocop:enable Style/AndOr def cancel redirect_to root_path, notice: t(:sign_in_cancelled) end + def show_error + redirect_to new_registrar_user_session_url, alert: t(:no_such_user) + end + private def user_hash From 45f4e5cbbc4c57d69d81bc38fc8ddd24b4d85558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Wed, 30 Sep 2020 15:19:44 +0300 Subject: [PATCH 37/79] Use Hash methods instead of public_send to compose hash --- app/views/admin/domain_versions/archive.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/domain_versions/archive.haml b/app/views/admin/domain_versions/archive.haml index 9fdf8b000..ffeec125e 100644 --- a/app/views/admin/domain_versions/archive.haml +++ b/app/views/admin/domain_versions/archive.haml @@ -67,7 +67,7 @@ - else - contact = Contact.all_versions_for([domain.registrant_id], version.created_at).first - if contact.nil? && ver = ContactVersion.where(item_id: domain.registrant_id).last - - contact = Contact.new(ver.object.to_h.merge(ver.object_changes.to_h.each_with_object({}){|(k,v), o| o.public_send("#{k}=", v.last) } )) + - contact = Contact.new(ver.object.to_h.merge(ver.object_changes.to_h.each_with_object({}) {|(k,v), o| o[k] = v.last })) = contact.try(:name) = " ".html_safe = "(#{t(:deleted)})" From 40af20ef470efb4ef6cf66e1dc330bd4064f0ef0 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Wed, 30 Sep 2020 19:02:33 +0500 Subject: [PATCH 38/79] Add button and description to login page --- app/views/registrar/sessions/new.html.erb | 16 +++++----------- config/locales/registrar/sessions.en.yml | 4 ++++ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/app/views/registrar/sessions/new.html.erb b/app/views/registrar/sessions/new.html.erb index 7b90cf3be..2ce0b0f1a 100644 --- a/app/views/registrar/sessions/new.html.erb +++ b/app/views/registrar/sessions/new.html.erb @@ -19,16 +19,10 @@
- <%#= link_to '/registrar/login/mid', id: 'login-with-mobile-id-btn' do %> - <%#= image_tag 'mid.gif' %> - <%# end %> - - <%#= link_to registrar_id_card_sign_in_path, method: :post do %> - <%#= image_tag 'id_card.gif' %> - <%# end %> - - <%= link_to "/auth/tara", method: :post, class: "ui button big primary" do %> - <%= image_tag 'id_card.gif' %> - <% end %> + diff --git a/config/locales/registrar/sessions.en.yml b/config/locales/registrar/sessions.en.yml index 4854edccc..63274d7cd 100644 --- a/config/locales/registrar/sessions.en.yml +++ b/config/locales/registrar/sessions.en.yml @@ -4,6 +4,10 @@ en: new: header_html: Eesti Interneti SA
Registrar Portal submit_btn: Login + sign_in_with_identity_document: "Sign in with identity document" + identity_document_text: | + Sign in using Estonian (incl. e-residents) ID card, mobile ID, + Bank link or other EU citizen's electronic ID supported by EIDAS. login_mid: header: Log in with mobile-id submit_btn: Login From eeffb7ee22e10800beb0f4c575990c9b8843bad1 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Wed, 30 Sep 2020 19:18:57 +0500 Subject: [PATCH 39/79] Add tests --- .../registrar/sessions_controller.rb | 96 ------------------- app/controllers/registrar/tara_controller.rb | 1 + app/errors/tampering_detected.rb | 3 - app/models/user.rb | 3 - config/locales/account_activities.en.yml | 2 +- config/locales/en.yml | 2 + config/routes.rb | 9 -- .../registrar_area/sign_in/id_card_test.rb | 65 ------------- .../registrar_area/sign_in/mobile_id_test.rb | 35 ------- .../registrar_area/tara/tara_users_test.rb | 45 +++++++++ 10 files changed, 49 insertions(+), 212 deletions(-) delete mode 100644 app/errors/tampering_detected.rb delete mode 100644 test/integration/registrar_area/sign_in/id_card_test.rb delete mode 100644 test/system/registrar_area/sign_in/mobile_id_test.rb create mode 100644 test/system/registrar_area/tara/tara_users_test.rb diff --git a/app/controllers/registrar/sessions_controller.rb b/app/controllers/registrar/sessions_controller.rb index 5bebe5619..2fa69ca90 100644 --- a/app/controllers/registrar/sessions_controller.rb +++ b/app/controllers/registrar/sessions_controller.rb @@ -49,102 +49,6 @@ class Registrar end end - def id_card - self.resource = warden.authenticate!(auth_options) - - restricted_ip = Authorization::RestrictedIP.new(request.ip) - ip_allowed = restricted_ip.can_access_registrar_area?(resource.registrar) - - unless ip_allowed - render plain: t('registrar.authorization.ip_not_allowed', ip: request.ip) - warden.logout(:registrar_user) - return - end - - set_flash_message!(:notice, :signed_in) - sign_in(resource_name, resource) - yield resource if block_given? - respond_with resource, location: after_sign_in_path_for(resource) - end - - def login_mid - @user = User.new - end - - def mid - phone = params[:user][:phone] - endpoint = "#{ENV['sk_digi_doc_service_endpoint']}" - client = Digidoc::Client.new(endpoint) - client.logger = Rails.application.config.logger unless Rails.env.test? - - # country_codes = {'+372' => 'EST'} - phone.gsub!('+372', '') - response = client.authenticate( - phone: "+372#{phone}", - message_to_display: 'Authenticating', - service_name: ENV['sk_digi_doc_service_name'] || 'Testing' - ) - - if response.faultcode - render json: { message: response.detail.message }, status: :unauthorized - return - end - - if Setting.registrar_ip_whitelist_enabled - @user = find_user_by_idc_and_allowed(response.user_id_code) - else - @user = find_user_by_idc(response.user_id_code) - end - - if @user.persisted? - session[:user_id_code] = response.user_id_code - session[:mid_session_code] = client.session_code - - render json: { - message: t(:confirmation_sms_was_sent_to_your_phone_verification_code_is, { code: response.challenge_id }) - }, status: :ok - else - render json: { message: t(:no_such_user) }, status: :unauthorized - end - end - - def mid_status - endpoint = "#{ENV['sk_digi_doc_service_endpoint']}" - client = Digidoc::Client.new(endpoint) - client.logger = Rails.application.config.logger unless Rails.env.test? - client.session_code = session[:mid_session_code] - auth_status = client.authentication_status - - case auth_status.status - when 'OUTSTANDING_TRANSACTION' - render json: { message: t(:check_your_phone_for_confirmation_code) }, status: :ok - when 'USER_AUTHENTICATED' - @user = find_user_by_idc_and_allowed(session[:user_id_code]) - sign_in(:registrar_user, @user) - flash[:notice] = t(:welcome) - flash.keep(:notice) - render js: "window.location = '#{after_sign_in_path_for(@user)}'" - when 'NOT_VALID' - render json: { message: t(:user_signature_is_invalid) }, status: :bad_request - when 'EXPIRED_TRANSACTION' - render json: { message: t(:session_timeout) }, status: :bad_request - when 'USER_CANCEL' - render json: { message: t(:user_cancelled) }, status: :bad_request - when 'MID_NOT_READY' - render json: { message: t(:mid_not_ready) }, status: :bad_request - when 'PHONE_ABSENT' - render json: { message: t(:phone_absent) }, status: :bad_request - when 'SENDING_ERROR' - render json: { message: t(:sending_error) }, status: :bad_request - when 'SIM_ERROR' - render json: { message: t(:sim_error) }, status: :bad_request - when 'INTERNAL_ERROR' - render json: { message: t(:internal_error) }, status: :bad_request - else - render json: { message: t(:internal_error) }, status: :bad_request - end - end - private def depp_controller? diff --git a/app/controllers/registrar/tara_controller.rb b/app/controllers/registrar/tara_controller.rb index 84938a777..e02aa52a5 100644 --- a/app/controllers/registrar/tara_controller.rb +++ b/app/controllers/registrar/tara_controller.rb @@ -8,6 +8,7 @@ class Registrar @api_user = ApiUser.from_omniauth(user_hash) if @api_user + flash[:notice] = t(:signed_in_successfully) sign_in_and_redirect(:registrar_user, @api_user) else show_error and return diff --git a/app/errors/tampering_detected.rb b/app/errors/tampering_detected.rb deleted file mode 100644 index 1cf72ba58..000000000 --- a/app/errors/tampering_detected.rb +++ /dev/null @@ -1,3 +0,0 @@ -module Errors - class TamperingDetected < ActionController::BadRequest; end -end diff --git a/app/models/user.rb b/app/models/user.rb index 21d5f6b46..e1b98f3a6 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,9 +1,6 @@ class User < ApplicationRecord include Versions # version/user_version.rb - ESTONIAN_COUNTRY_CODE = 'EE'.freeze - TARA_PROVIDER = 'tara'.freeze - has_many :actions, dependent: :restrict_with_exception attr_accessor :phone diff --git a/config/locales/account_activities.en.yml b/config/locales/account_activities.en.yml index 41863219f..648549f8f 100644 --- a/config/locales/account_activities.en.yml +++ b/config/locales/account_activities.en.yml @@ -2,4 +2,4 @@ en: activerecord: attributes: account_activity: - created_at: Receipt date \ No newline at end of file + created_at: Receipt date diff --git a/config/locales/en.yml b/config/locales/en.yml index 398a423f0..8b7b4f0fa 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -660,3 +660,5 @@ en: ipv6: IPv6 reference_no: Reference number iban: IBAN + sign_in: "Sign in" + signed_in_successfully: "Signed in successfully" diff --git a/config/routes.rb b/config/routes.rb index 8628210c4..41f857bc8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -77,15 +77,6 @@ Rails.application.routes.draw do devise_for :users, path: '', class_name: 'ApiUser', skip: %i[sessions] devise_scope :registrar_user do - get 'login/mid' => 'sessions#login_mid' - post 'login/mid' => 'sessions#mid' - post 'login/mid_status' => 'sessions#mid_status' - - # /registrar/id path is hardcoded in Apache config for authentication with Estonian ID-card - post 'id' => 'sessions#id_card', as: :id_card_sign_in - - post 'mid' => 'sessions#mid' - match '/open_id/callback', via: %i[get post], to: 'tara#callback', as: :tara_callback match '/open_id/cancel', via: %i[get post delete], to: 'tara#cancel', as: :tara_cancel diff --git a/test/integration/registrar_area/sign_in/id_card_test.rb b/test/integration/registrar_area/sign_in/id_card_test.rb deleted file mode 100644 index a8ab31da0..000000000 --- a/test/integration/registrar_area/sign_in/id_card_test.rb +++ /dev/null @@ -1,65 +0,0 @@ -require 'test_helper' - -class RegistrarAreaIdCardSignInTest < ApplicationIntegrationTest - # setup do - # @user = users(:api_bestnames) - # @original_registrar_area_ip_whitelist = Setting.registrar_ip_whitelist_enabled - # end - # - # teardown do - # Setting.registrar_ip_whitelist_enabled = @original_registrar_area_ip_whitelist - # end - # - # def test_signs_in_a_user_when_id_card_owner_is_found - # assert_equal '1234', @user.identity_code - # - # post registrar_id_card_sign_in_path, headers: { 'SSL_CLIENT_S_DN_CN' => 'DOE,JOHN,1234' } - # follow_redirect! - # - # assert_response :ok - # assert_equal registrar_root_path, path - # assert_not_nil controller.current_registrar_user - # end - # - # def test_does_not_sign_in_a_user_when_id_card_owner_is_not_found - # post registrar_id_card_sign_in_path, - # headers: { 'SSL_CLIENT_S_DN_CN' => 'DOE,JOHN,unacceptable-personal-code' } - # - # assert_nil controller.current_registrar_user - # assert_equal registrar_id_card_sign_in_path, path - # assert_includes response.body, 'Failed to Login' - # end - # - # def test_does_not_sign_in_a_user_when_id_card_owner_is_found_but_ip_is_not_allowed - # allow_access_to_sign_in_page - # assert_equal '127.0.0.1', white_ips(:one).ipv4 - # assert_equal '1234', @user.identity_code - # - # Setting.registrar_ip_whitelist_enabled = true - # - # post registrar_id_card_sign_in_path, headers: { 'SSL_CLIENT_S_DN_CN' => 'DOE,JOHN,1234', - # 'REMOTE_ADDR' => '127.0.0.2' } - # - # assert_equal registrar_id_card_sign_in_path, path - # assert_equal 'Access denied from IP 127.0.0.2', response.body - # - # get registrar_root_path - # assert_redirected_to new_registrar_user_session_path - # end - # - # def test_does_not_sign_in_a_user_when_certificate_is_absent - # post registrar_id_card_sign_in_path, headers: { 'SSL_CLIENT_S_DN_CN' => '' } - # - # assert_nil controller.current_registrar_user - # assert_equal registrar_id_card_sign_in_path, path - # end - # - # private - # - # def allow_access_to_sign_in_page - # another_registrar_white_ip = white_ips(:one).dup - # another_registrar_white_ip.ipv4 = '127.0.0.2' - # another_registrar_white_ip.registrar = registrars(:goodnames) - # another_registrar_white_ip.save! - # end -end diff --git a/test/system/registrar_area/sign_in/mobile_id_test.rb b/test/system/registrar_area/sign_in/mobile_id_test.rb deleted file mode 100644 index fa3a6117c..000000000 --- a/test/system/registrar_area/sign_in/mobile_id_test.rb +++ /dev/null @@ -1,35 +0,0 @@ -require 'application_system_test_case' - -class RegistrarAreaMobileIDSignInTest < JavaScriptApplicationSystemTestCase - # def setup - # super - # WebMock.allow_net_connect! - # - # @user = users(:api_bestnames) - # @user.identity_code = '1234' - # @user.save - # end - # - # def test_valid_phone_number - # mock_client = Minitest::Mock.new - # mock_client.expect(:authenticate, - # OpenStruct.new(user_id_code: '1234', challenge_id: '1234'), - # [{ phone: "+3721234", - # message_to_display: "Authenticating", - # service_name: "Testimine" }]) - # mock_client.expect(:session_code, 1234) - # - # Digidoc::Client.stub(:new, mock_client) do - # visit new_registrar_user_session_path - # - # click_on 'login-with-mobile-id-btn' - # - # fill_in 'user[phone]', with: '1234' - # click_button 'Login' - # - # flash_message = page.find('div.bg-success') - # assert_equal('Confirmation sms was sent to your phone. Verification code is 1234.', - # flash_message.text) - # end - # end -end diff --git a/test/system/registrar_area/tara/tara_users_test.rb b/test/system/registrar_area/tara/tara_users_test.rb new file mode 100644 index 000000000..a2defd715 --- /dev/null +++ b/test/system/registrar_area/tara/tara_users_test.rb @@ -0,0 +1,45 @@ +require 'application_system_test_case' + +class TaraUsersTest < ApplicationSystemTestCase + def setup + super + + OmniAuth.config.test_mode = true + @user = users(:api_bestnames) + + @existing_user_hash = { + 'provider' => 'tara', + 'uid' => "EE" + @user.identity_code + } + + @new_user_hash = { + 'provider' => 'tara', + 'uid' => 'EE51007050604' + } + end + + def teardown + super + + OmniAuth.config.test_mode = false + OmniAuth.config.mock_auth['tara'] = nil + end + + def test_existing_user_gets_signed_in + OmniAuth.config.mock_auth[:tara] = OmniAuth::AuthHash.new(@existing_user_hash) + + visit new_registrar_user_session_path + click_link('Sign in') + + assert_text('Signed in successfully') + end + + def test_nonexisting_user_gets_error_message + OmniAuth.config.mock_auth[:tara] = OmniAuth::AuthHash.new(@new_user_hash) + + visit new_registrar_user_session_path + click_link('Sign in') + + assert_text('No such user') + end +end From 753d59ba05a9e1469a96ca767e6fbc432ae8d1dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Wed, 30 Sep 2020 19:37:32 +0300 Subject: [PATCH 40/79] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d7c08abe..d13f67493 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +30.09.2020 +* Added Tara integration to registrar portal [#1680](https://github.com/internetee/registry/issues/1680) + 28.09.2020 * Fixed data leakage with shared contacts [#1690](https://github.com/internetee/registry/issues/1690) * RenewProhoboted status blocks renew [#1693](https://github.com/internetee/registry/issues/1693) From 8794e3c22e5d9246394889f2a1a6abe346ec1fd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Thu, 1 Oct 2020 12:30:51 +0300 Subject: [PATCH 41/79] Production env: don't force SSL in rails --- config/environments/production.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 377166f29..e1966d6ba 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -43,7 +43,7 @@ Rails.application.configure do # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - config.force_ssl = true + config.force_ssl = false # Use the lowest log level to ensure availability of diagnostic information # when problems arise. From d979fb4f458ae45fe6d32273181a1b8ce75342b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Thu, 1 Oct 2020 13:25:05 +0300 Subject: [PATCH 42/79] Respect User type when using from_omniauth() --- app/models/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index e1b98f3a6..18ab410d0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -16,6 +16,6 @@ class User < ApplicationRecord identity_code = uid.slice(2..-1) # country_code = uid.slice(0..1) - User.find_by(identity_code: identity_code) + find_by(identity_code: identity_code) end end From 248c984443b640c3306c78e142d7377b30a21a97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Thu, 1 Oct 2020 14:28:37 +0300 Subject: [PATCH 43/79] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d13f67493..873166aed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +01.10.2020 +* Fixed EPP authentication [#1697](https://github.com/internetee/registry/pull/1697) + 30.09.2020 * Added Tara integration to registrar portal [#1680](https://github.com/internetee/registry/issues/1680) From 04f0ef9a93de02f4742e0ee38b843e18c1896934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Thu, 1 Oct 2020 17:01:54 +0300 Subject: [PATCH 44/79] Expand TARA auth flow to registrant portal --- app/controllers/registrant/tara_controller.rb | 33 +++++++++++++++++++ app/models/registrant_user.rb | 22 +++++-------- app/views/registrant/sessions/new.html.erb | 9 ++--- config/application.yml.sample | 4 +++ config/initializers/omniauth.rb | 31 +++++++++++++++++ config/locales/registrant/sessions.en.yml | 10 ++---- config/routes.rb | 3 ++ 7 files changed, 85 insertions(+), 27 deletions(-) create mode 100644 app/controllers/registrant/tara_controller.rb diff --git a/app/controllers/registrant/tara_controller.rb b/app/controllers/registrant/tara_controller.rb new file mode 100644 index 000000000..a09e4665b --- /dev/null +++ b/app/controllers/registrant/tara_controller.rb @@ -0,0 +1,33 @@ +class Registrant + class TaraController < ApplicationController + skip_authorization_check + + # rubocop:disable Style/AndOr + def callback + session[:omniauth_hash] = user_hash + @registrant_user = RegistrantUser.find_or_create_by_omniauth_data(user_hash) + + if @registrant_user + flash[:notice] = t(:signed_in_successfully) + sign_in_and_redirect(:registrant_user, @registrant_user) + else + show_error and return + end + end + # rubocop:enable Style/AndOr + + def cancel + redirect_to root_path, notice: t(:sign_in_cancelled) + end + + def show_error + redirect_to new_registrant_user_session_url, alert: t(:no_such_user) + end + + private + + def user_hash + request.env['omniauth.auth'] + end + end +end diff --git a/app/models/registrant_user.rb b/app/models/registrant_user.rb index 7bd84d5dd..06a2b668a 100644 --- a/app/models/registrant_user.rb +++ b/app/models/registrant_user.rb @@ -66,23 +66,19 @@ class RegistrantUser < User find_or_create_by_user_data(user_data) end - def find_or_create_by_mid_data(response) - user_data = { first_name: response.user_givenname, last_name: response.user_surname, - ident: response.user_id_code, country_code: response.user_country } + def find_or_create_by_omniauth_data(omniauth_hash) + uid = omniauth_hash['uid'] + identity_code = uid.slice(2..-1) + country_code = uid.slice(0..1) + first_name = omniauth_hash.dig('info', 'first_name') + last_name = omniauth_hash.dig('info', 'last_name') + + user_data = { first_name: first_name, last_name: last_name, + ident: identity_code, country_code: country_code } find_or_create_by_user_data(user_data) end - def find_by_id_card(id_card) - registrant_ident = "#{id_card.country_code}-#{id_card.personal_code}" - username = [id_card.first_name, id_card.last_name].join("\s") - - user = find_or_initialize_by(registrant_ident: registrant_ident) - user.username = username - user.save! - user - end - private def find_or_create_by_user_data(user_data = {}) diff --git a/app/views/registrant/sessions/new.html.erb b/app/views/registrant/sessions/new.html.erb index a3203e83a..9f7af3254 100644 --- a/app/views/registrant/sessions/new.html.erb +++ b/app/views/registrant/sessions/new.html.erb @@ -8,11 +8,6 @@ <%= t '.hint' %>
- <%= link_to '/registrant/login/mid' do %> - <%= image_tag 'mid.gif' %> - <% end %> - <%= link_to registrant_id_card_sign_in_path, method: :post do %> - <%= image_tag 'id_card.gif' %> - <% end %> + <%= link_to t(:sign_in), "/auth/rant_tara", method: :post, class: 'btn btn-lg btn-primary btn-block' %> - \ No newline at end of file + diff --git a/config/application.yml.sample b/config/application.yml.sample index cbe32e5db..44803120b 100644 --- a/config/application.yml.sample +++ b/config/application.yml.sample @@ -163,6 +163,10 @@ tara_secret: 'secret' tara_redirect_uri: 'redirect_url' tara_keys: "{\"kty\":\"RSA\",\"kid\":\"de6cc4\",\"n\":\"jWwAjT_03ypme9ZWeSe7c-jY26NO50Wo5I1LBnPW2JLc0dPMj8v7y4ehiRpClYNTaSWcLd4DJmlKXDXXudEUWwXa7TtjBFJfzlZ-1u0tDvJ-H9zv9MzO7UhUFytztUEMTrtStdhGbzkzdEZZCgFYeo2i33eXxzIR1nGvI05d9Y-e_LHnNE2ZKTa89BC7ZiCXq5nfAaCgQna_knh4kFAX-KgiPRAtsiDHcAWKcBY3qUVcb-5XAX8p668MlGLukzsh5tFkQCbJVyNtmlbIHdbGvVHPb8C0H3oLYciv1Fjy_tS1lO7OT_cb3GVp6Ql-CG0uED_8pkpVtfsGRviub4_ElQ\",\"e\":\"AQAB\"}" +tara_rant_identifier: 'identifier' +tara_rant_secret: 'secret' +tara_rant_redirect_uri: 'redirect_uri' + # Since the keys for staging are absent from the repo, we need to supply them separate for testing. test: payments_seb_bank_certificate: 'test/fixtures/files/seb_bank_cert.pem' diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index ef5350384..ec030399e 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -16,6 +16,10 @@ identifier = ENV['tara_identifier'] secret = ENV['tara_secret'] redirect_uri = ENV['tara_redirect_uri'] +registrant_identifier = ENV['tara_rant_identifier'] +registrant_secret = ENV['tara_rant_secret'] +registrant_redirect_uri = ENV['tara_rant_redirect_uri'] + Rails.application.config.middleware.use OmniAuth::Builder do provider "tara", { callback_path: '/registrar/open_id/callback', @@ -43,4 +47,31 @@ Rails.application.config.middleware.use OmniAuth::Builder do redirect_uri: redirect_uri, }, } + + provider "tara", { + callback_path: '/registrant/open_id/callback', + name: 'rant_tara', + scope: ['openid'], + state: Proc.new{ SecureRandom.hex(10) }, + client_signing_alg: :RS256, + client_jwk_signing_key: signing_keys, + send_scope_to_token_endpoint: false, + send_nonce: true, + issuer: issuer, + + client_options: { + scheme: 'https', + host: host, + + authorization_endpoint: '/oidc/authorize', + token_endpoint: '/oidc/token', + userinfo_endpoint: nil, # Not implemented + jwks_uri: '/oidc/jwks', + + # Registry + identifier: registrant_identifier, + secret: registrant_secret, + redirect_uri: registrant_redirect_uri, + }, + } end diff --git a/config/locales/registrant/sessions.en.yml b/config/locales/registrant/sessions.en.yml index 3032382c1..7d4c16da9 100644 --- a/config/locales/registrant/sessions.en.yml +++ b/config/locales/registrant/sessions.en.yml @@ -2,11 +2,7 @@ en: registrant: sessions: new: - header: Log in + header: Sign in with identity document hint: >- - Access currently available only to Estonian citizens and e-residents with Estonian ID-card - or Mobile-ID. - - login_mid: - header: Log in with mobile-id - submit_btn: Login \ No newline at end of file + Sign in using Estonian (incl. e-residents) ID card, mobile ID, + Bank link or other EU citizen's electronic ID supported by EIDAS. diff --git a/config/routes.rb b/config/routes.rb index 41f857bc8..b8de8557e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -176,6 +176,9 @@ Rails.application.routes.draw do # Client certificate is asked only on login form submission, therefore the path must be different from the one in # `new_registrant_user_session_path` route, in case some other auth type will be implemented post 'id' => 'sessions#create', as: :id_card_sign_in + match '/open_id/callback', via: %i[get post], to: 'tara#callback', as: :tara_registrant_callback + match '/open_id/cancel', via: %i[get post delete], to: 'tara#cancel', + as: :tara_registrant_cancel end resources :registrars, only: :show From 11ee1f9f1ed871aae52a09274b53eaeb451cf041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Thu, 1 Oct 2020 17:07:33 +0300 Subject: [PATCH 45/79] Remove ID card logic from codebase --- app/models/api_user.rb | 6 --- app/models/id_card.rb | 6 --- app/models/registrant_user.rb | 4 +- config/initializers/devise.rb | 4 -- config/routes.rb | 4 -- lib/devise/models/id_card_authenticatable.rb | 7 --- .../strategies/id_card_authenticatable.rb | 49 ------------------- .../registrant_area/sign_in/id_card_test.rb | 31 ------------ .../id_card_authenticatable_test.rb | 13 ----- test/models/api_user_test.rb | 11 ----- test/models/registrant_user_test.rb | 30 +----------- 11 files changed, 3 insertions(+), 162 deletions(-) delete mode 100644 app/models/id_card.rb delete mode 100644 lib/devise/models/id_card_authenticatable.rb delete mode 100644 lib/devise/strategies/id_card_authenticatable.rb delete mode 100644 test/integration/registrant_area/sign_in/id_card_test.rb delete mode 100644 test/lib/devise/strategies/id_card_authenticatable_test.rb diff --git a/app/models/api_user.rb b/app/models/api_user.rb index 8159137a3..61dd12387 100644 --- a/app/models/api_user.rb +++ b/app/models/api_user.rb @@ -47,12 +47,6 @@ class ApiUser < User self.active = true unless saved_change_to_active? end - class << self - def find_by_id_card(id_card) - find_by(identity_code: id_card.personal_code) - end - end - def to_s username end diff --git a/app/models/id_card.rb b/app/models/id_card.rb deleted file mode 100644 index 0e3c11bb3..000000000 --- a/app/models/id_card.rb +++ /dev/null @@ -1,6 +0,0 @@ -class IdCard - attr_accessor :first_name - attr_accessor :last_name - attr_accessor :personal_code - attr_accessor :country_code -end \ No newline at end of file diff --git a/app/models/registrant_user.rb b/app/models/registrant_user.rb index 06a2b668a..c0addb5cd 100644 --- a/app/models/registrant_user.rb +++ b/app/models/registrant_user.rb @@ -1,7 +1,7 @@ class RegistrantUser < User attr_accessor :idc_data - devise :trackable, :timeoutable, :id_card_authenticatable + devise :trackable, :timeoutable def ability @ability ||= Ability.new(self) @@ -74,7 +74,7 @@ class RegistrantUser < User last_name = omniauth_hash.dig('info', 'last_name') user_data = { first_name: first_name, last_name: last_name, - ident: identity_code, country_code: country_code } + ident: identity_code, country_code: country_code } find_or_create_by_user_data(user_data) end diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index dee2824a4..6631a0239 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -281,9 +281,5 @@ Devise.setup do |config| # so you need to do it manually. For the users scope, it would be: # config.omniauth_path_prefix = '/my_engine/users/auth' - require 'devise/models/id_card_authenticatable' - require 'devise/strategies/id_card_authenticatable' - routes = [nil, :new, :destroy] - config.add_module :id_card_authenticatable, strategy: true, route: { session: routes } end diff --git a/config/routes.rb b/config/routes.rb index b8de8557e..5d6b3d907 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -172,10 +172,6 @@ Rails.application.routes.draw do post 'login/mid_status' => 'sessions#mid_status' post 'mid' => 'sessions#mid' - # /registrant/id path is hardcoded in Apache config for authentication with Estonian ID-card - # Client certificate is asked only on login form submission, therefore the path must be different from the one in - # `new_registrant_user_session_path` route, in case some other auth type will be implemented - post 'id' => 'sessions#create', as: :id_card_sign_in match '/open_id/callback', via: %i[get post], to: 'tara#callback', as: :tara_registrant_callback match '/open_id/cancel', via: %i[get post delete], to: 'tara#cancel', as: :tara_registrant_cancel diff --git a/lib/devise/models/id_card_authenticatable.rb b/lib/devise/models/id_card_authenticatable.rb deleted file mode 100644 index 53bad663f..000000000 --- a/lib/devise/models/id_card_authenticatable.rb +++ /dev/null @@ -1,7 +0,0 @@ -module Devise - module Models - # Devise fails without this module (and model: false does not help) - module IdCardAuthenticatable - end - end -end \ No newline at end of file diff --git a/lib/devise/strategies/id_card_authenticatable.rb b/lib/devise/strategies/id_card_authenticatable.rb deleted file mode 100644 index 6c3a7ac92..000000000 --- a/lib/devise/strategies/id_card_authenticatable.rb +++ /dev/null @@ -1,49 +0,0 @@ -module Devise - module Strategies - class IdCardAuthenticatable < Devise::Strategies::Authenticatable - def valid? - env['SSL_CLIENT_S_DN_CN'].present? - end - - def authenticate! - resource = mapping.to - user = resource.find_by_id_card(id_card) - - if user - success!(user) - else - fail - end - end - - private - - def id_card - id_card = IdCard.new - id_card.first_name = first_name - id_card.last_name = last_name - id_card.personal_code = personal_code - id_card.country_code = country_code - id_card - end - - def first_name - env['SSL_CLIENT_S_DN_CN'].split(',').second.force_encoding('utf-8') - end - - def last_name - env['SSL_CLIENT_S_DN_CN'].split(',').first.force_encoding('utf-8') - end - - def personal_code - env['SSL_CLIENT_S_DN_CN'].split(',').last - end - - def country_code - env['SSL_CLIENT_I_DN_C'] - end - end - end -end - -Warden::Strategies.add(:id_card_authenticatable, Devise::Strategies::IdCardAuthenticatable) diff --git a/test/integration/registrant_area/sign_in/id_card_test.rb b/test/integration/registrant_area/sign_in/id_card_test.rb deleted file mode 100644 index fe6c8a7ef..000000000 --- a/test/integration/registrant_area/sign_in/id_card_test.rb +++ /dev/null @@ -1,31 +0,0 @@ -require 'test_helper' - -class RegistrantAreaIdCardSignInTest < ApplicationIntegrationTest - setup do - allow_business_registry_component_reach_server - end - - def test_succeeds - post registrant_id_card_sign_in_path, headers: { 'SSL_CLIENT_S_DN_CN' => 'DOE,JOHN,1234', - 'SSL_CLIENT_I_DN_C' => 'US' } - follow_redirect! - - assert_response :ok - assert_equal registrant_root_path, path - assert_not_nil controller.current_registrant_user - end - - def test_fails_when_certificate_is_absent - post registrant_id_card_sign_in_path, headers: { 'SSL_CLIENT_S_DN_CN' => '' } - - assert_response :ok - assert_equal registrant_id_card_sign_in_path, path - assert_nil controller.current_registrant_user - end - - private - - def allow_business_registry_component_reach_server - WebMock.allow_net_connect! - end -end \ No newline at end of file diff --git a/test/lib/devise/strategies/id_card_authenticatable_test.rb b/test/lib/devise/strategies/id_card_authenticatable_test.rb deleted file mode 100644 index e194ccaac..000000000 --- a/test/lib/devise/strategies/id_card_authenticatable_test.rb +++ /dev/null @@ -1,13 +0,0 @@ -require 'test_helper' - -class IdCardAuthenticatableTest < ActiveSupport::TestCase - def test_valid_when_id_card_data_is_present_in_env - strategy = Devise::Strategies::IdCardAuthenticatable.new({ 'SSL_CLIENT_S_DN_CN' => 'some' }) - assert strategy.valid? - end - - def test_not_valid_when_id_card_data_is_absent_in_env - strategy = Devise::Strategies::IdCardAuthenticatable.new({}) - assert_not strategy.valid? - end -end \ No newline at end of file diff --git a/test/models/api_user_test.rb b/test/models/api_user_test.rb index ecbff5cbb..525e6c264 100644 --- a/test/models/api_user_test.rb +++ b/test/models/api_user_test.rb @@ -52,17 +52,6 @@ class ApiUserTest < ActiveSupport::TestCase assert ApiUser.new.active? end - def test_finds_user_by_id_card - id_card = IdCard.new - id_card.personal_code = 'one' - - @user.update!(identity_code: 'one') - assert_equal @user, ApiUser.find_by_id_card(id_card) - - @user.update!(identity_code: 'another') - assert_nil ApiUser.find_by_id_card(id_card) - end - def test_verifies_pki_status certificate = certificates(:api) diff --git a/test/models/registrant_user_test.rb b/test/models/registrant_user_test.rb index 78b9ef901..c61f095f2 100644 --- a/test/models/registrant_user_test.rb +++ b/test/models/registrant_user_test.rb @@ -30,34 +30,6 @@ class RegistrantUserTest < ActiveSupport::TestCase assert_equal Country.new('US'), user.country end - def test_finding_by_id_card_creates_new_user_upon_first_sign_in - assert_not_equal 'US-5555', @user.registrant_ident - id_card = IdCard.new - id_card.first_name = 'John' - id_card.last_name = 'Doe' - id_card.personal_code = '5555' - id_card.country_code = 'US' - - assert_difference 'RegistrantUser.count' do - RegistrantUser.find_by_id_card(id_card) - end - - user = RegistrantUser.last - assert_equal 'US-5555', user.registrant_ident - assert_equal 'John Doe', user.username - end - - def test_finding_by_id_card_reuses_existing_user_upon_subsequent_id_card_sign_ins - @user.update!(registrant_ident: 'US-5555') - id_card = IdCard.new - id_card.personal_code = '5555' - id_card.country_code = 'US' - - assert_no_difference 'RegistrantUser.count' do - RegistrantUser.find_by_id_card(id_card) - end - end - def test_queries_company_register_for_associated_companies assert_equal 'US-1234', @user.registrant_ident @@ -92,4 +64,4 @@ class RegistrantUserTest < ActiveSupport::TestCase assert_equal %w(shop airport), @user.administered_domains end end -end \ No newline at end of file +end From f83e532fb1e5888aef0ef4d621af03551afa556d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Thu, 1 Oct 2020 18:37:04 +0300 Subject: [PATCH 46/79] Make Registrant/Registrar use same TARA controller --- app/controllers/registrant/tara_controller.rb | 33 --------------- app/controllers/registrar/tara_controller.rb | 33 --------------- app/controllers/sso/tara_controller.rb | 40 +++++++++++++++++++ config/initializers/devise.rb | 2 - config/routes.rb | 32 +++++++-------- 5 files changed, 56 insertions(+), 84 deletions(-) delete mode 100644 app/controllers/registrant/tara_controller.rb delete mode 100644 app/controllers/registrar/tara_controller.rb create mode 100644 app/controllers/sso/tara_controller.rb diff --git a/app/controllers/registrant/tara_controller.rb b/app/controllers/registrant/tara_controller.rb deleted file mode 100644 index a09e4665b..000000000 --- a/app/controllers/registrant/tara_controller.rb +++ /dev/null @@ -1,33 +0,0 @@ -class Registrant - class TaraController < ApplicationController - skip_authorization_check - - # rubocop:disable Style/AndOr - def callback - session[:omniauth_hash] = user_hash - @registrant_user = RegistrantUser.find_or_create_by_omniauth_data(user_hash) - - if @registrant_user - flash[:notice] = t(:signed_in_successfully) - sign_in_and_redirect(:registrant_user, @registrant_user) - else - show_error and return - end - end - # rubocop:enable Style/AndOr - - def cancel - redirect_to root_path, notice: t(:sign_in_cancelled) - end - - def show_error - redirect_to new_registrant_user_session_url, alert: t(:no_such_user) - end - - private - - def user_hash - request.env['omniauth.auth'] - end - end -end diff --git a/app/controllers/registrar/tara_controller.rb b/app/controllers/registrar/tara_controller.rb deleted file mode 100644 index e02aa52a5..000000000 --- a/app/controllers/registrar/tara_controller.rb +++ /dev/null @@ -1,33 +0,0 @@ -class Registrar - class TaraController < ApplicationController - skip_authorization_check - - # rubocop:disable Style/AndOr - def callback - session[:omniauth_hash] = user_hash - @api_user = ApiUser.from_omniauth(user_hash) - - if @api_user - flash[:notice] = t(:signed_in_successfully) - sign_in_and_redirect(:registrar_user, @api_user) - else - show_error and return - end - end - # rubocop:enable Style/AndOr - - def cancel - redirect_to root_path, notice: t(:sign_in_cancelled) - end - - def show_error - redirect_to new_registrar_user_session_url, alert: t(:no_such_user) - end - - private - - def user_hash - request.env['omniauth.auth'] - end - end -end diff --git a/app/controllers/sso/tara_controller.rb b/app/controllers/sso/tara_controller.rb new file mode 100644 index 000000000..1571f45b3 --- /dev/null +++ b/app/controllers/sso/tara_controller.rb @@ -0,0 +1,40 @@ +module Sso + class TaraController < ApplicationController + skip_authorization_check + + def registrant_callback + user = RegistrantUser.find_or_create_by_omniauth_data(user_hash) + callback(user, registrar: false) + end + + def registrar_callback + user = ApiUser.from_omniauth(user_hash) + callback(user, registrar: true) + end + + # rubocop:disable Style/AndOr + def callback(user, registrar: true) + session[:omniauth_hash] = user_hash + (show error and return) unless user + + flash[:notice] = t(:signed_in_successfully) + sign_in_and_redirect(registrar ? :registrar_user : :registrant_user, user) + end + # rubocop:enable Style/AndOr + + def cancel + redirect_to root_path, notice: t(:sign_in_cancelled) + end + + def show_error(registrar: true) + path = registrar ? new_registrar_user_session_url : new_registrant_user_session_url + redirect_to path, alert: t(:no_such_user) + end + + private + + def user_hash + request.env['omniauth.auth'] + end + end +end diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 6631a0239..eb0465796 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -280,6 +280,4 @@ Devise.setup do |config| # When using OmniAuth, Devise cannot automatically set OmniAuth path, # so you need to do it manually. For the users scope, it would be: # config.omniauth_path_prefix = '/my_engine/users/auth' - - routes = [nil, :new, :destroy] end diff --git a/config/routes.rb b/config/routes.rb index 5d6b3d907..7df315f88 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -76,12 +76,6 @@ Rails.application.routes.draw do devise_for :users, path: '', class_name: 'ApiUser', skip: %i[sessions] - devise_scope :registrar_user do - match '/open_id/callback', via: %i[get post], to: 'tara#callback', as: :tara_callback - match '/open_id/cancel', via: %i[get post delete], to: 'tara#cancel', - as: :tara_cancel - end - resources :invoices, except: %i[new create edit update destroy] do resource :delivery, controller: 'invoices/delivery', only: %i[new create] @@ -158,6 +152,22 @@ Rails.application.routes.draw do post 'sessions', to: 'registrar/sessions#create', as: :registrar_user_session delete 'sign_out', to: 'registrar/sessions#destroy', as: :destroy_registrar_user_session + + # TARA + match '/open_id/callback', via: %i[get post], to: 'sso/tara#registrar_callback' + match '/open_id/cancel', via: %i[get post delete], to: 'sso/tara#cancel' + end + end + + scope :registrant do + devise_scope :registrant_user do + get 'sign_in', to: 'registrant/sessions#new', as: :new_registrant_user_session + post 'sessions', to: 'registrant/sessions#create', as: :registrant_user_session + delete 'sign_out', to: 'registrant/sessions#destroy', as: :destroy_registrant_user_session + + # TARA + match '/open_id/callback', via: %i[get post], to: 'sso/tara#registrant_callback' + match '/open_id/cancel', via: %i[get post delete], to: 'sso/tara#cancel' end end @@ -166,16 +176,6 @@ Rails.application.routes.draw do # POST /registrant/sign_in is not used devise_for :users, path: '', class_name: 'RegistrantUser' - devise_scope :registrant_user do - get 'login/mid' => 'sessions#login_mid' - post 'login/mid' => 'sessions#mid' - post 'login/mid_status' => 'sessions#mid_status' - post 'mid' => 'sessions#mid' - - match '/open_id/callback', via: %i[get post], to: 'tara#callback', as: :tara_registrant_callback - match '/open_id/cancel', via: %i[get post delete], to: 'tara#cancel', - as: :tara_registrant_cancel - end resources :registrars, only: :show resources :domains, only: %i[index show] do From 3162d8cc57beb78cf890495756e27ae807ab86b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Fri, 2 Oct 2020 09:54:14 +0300 Subject: [PATCH 47/79] Remove traces of Mobile-ID direct auth --- .../registrant/sessions_controller.rb | 75 ------------------- app/views/registrant/sessions/login_mid.haml | 40 ---------- app/views/registrar/sessions/login_mid.haml | 40 ---------- .../registrant_user_creation_test.rb | 9 --- 4 files changed, 164 deletions(-) delete mode 100644 app/views/registrant/sessions/login_mid.haml delete mode 100644 app/views/registrar/sessions/login_mid.haml diff --git a/app/controllers/registrant/sessions_controller.rb b/app/controllers/registrant/sessions_controller.rb index b18a802e6..73b6d52da 100644 --- a/app/controllers/registrant/sessions_controller.rb +++ b/app/controllers/registrant/sessions_controller.rb @@ -1,81 +1,6 @@ class Registrant::SessionsController < Devise::SessionsController layout 'registrant/application' - def login_mid - @user = User.new - end - - def mid - phone = params[:user][:phone] - endpoint = "#{ENV['sk_digi_doc_service_endpoint']}" - client = Digidoc::Client.new(endpoint) - client.logger = Rails.application.config.logger unless Rails.env.test? - - # country_codes = {'+372' => 'EST'} - response = client.authenticate( - phone: "+372#{phone}", - message_to_display: 'Authenticating', - service_name: ENV['sk_digi_doc_service_name'] || 'Testing' - ) - - if response.faultcode - render json: { message: response.detail.message }, status: :unauthorized - return - end - - @user = RegistrantUser.find_or_create_by_mid_data(response) - - if @user.persisted? - session[:user_country] = response.user_country - session[:user_id_code] = response.user_id_code - session[:mid_session_code] = client.session_code - - render json: { - message: t(:confirmation_sms_was_sent_to_your_phone_verification_code_is, { code: response.challenge_id }) - }, status: :ok - else - render json: { message: t(:no_such_user) }, status: :unauthorized - end - end - - def mid_status - endpoint = "#{ENV['sk_digi_doc_service_endpoint']}" - client = Digidoc::Client.new(endpoint) - client.logger = Rails.application.config.logger unless Rails.env.test? - client.session_code = session[:mid_session_code] - auth_status = client.authentication_status - - case auth_status.status - when 'OUTSTANDING_TRANSACTION' - render json: { message: t(:check_your_phone_for_confirmation_code) }, status: :ok - when 'USER_AUTHENTICATED' - @user = RegistrantUser.find_by(registrant_ident: "#{session[:user_country]}-#{session[:user_id_code]}") - - sign_in(:registrant_user, @user) - flash[:notice] = t(:welcome) - flash.keep(:notice) - render js: "window.location = '#{registrant_root_path}'" - when 'NOT_VALID' - render json: { message: t(:user_signature_is_invalid) }, status: :bad_request - when 'EXPIRED_TRANSACTION' - render json: { message: t(:session_timeout) }, status: :bad_request - when 'USER_CANCEL' - render json: { message: t(:user_cancelled) }, status: :bad_request - when 'MID_NOT_READY' - render json: { message: t(:mid_not_ready) }, status: :bad_request - when 'PHONE_ABSENT' - render json: { message: t(:phone_absent) }, status: :bad_request - when 'SENDING_ERROR' - render json: { message: t(:sending_error) }, status: :bad_request - when 'SIM_ERROR' - render json: { message: t(:sim_error) }, status: :bad_request - when 'INTERNAL_ERROR' - render json: { message: t(:internal_error) }, status: :bad_request - else - render json: { message: t(:internal_error) }, status: :bad_request - end - end - private def after_sign_in_path_for(_resource_or_scope) diff --git a/app/views/registrant/sessions/login_mid.haml b/app/views/registrant/sessions/login_mid.haml deleted file mode 100644 index 318e19033..000000000 --- a/app/views/registrant/sessions/login_mid.haml +++ /dev/null @@ -1,40 +0,0 @@ -.row - .form-signin.col-md-4.center-block.text-center - %h2.form-signin-heading.text-center= t '.header' - %hr - = form_for @user, url: registrant_mid_path, html: {class: 'form-signin'} do |f| - = f.text_field :phone, class: 'form-control', - placeholder: t(:phone_no), autocomplete: 'off', required: true - %button.btn.btn-lg.btn-primary.btn-block.js-login{:type => 'submit'}= t '.submit_btn' - - - if ['development', 'alpha'].include?(Rails.env) - %div.text-center - 00007, 60000007, 00000766 - -:coffee - load_listener = -> - $('.js-login').attr('disabled', false) - - status_interval = null - mid_status = () -> - status_interval = setInterval((-> - $.post('/registrant/login/mid_status').fail((data) -> - clearInterval(status_interval) - flash_alert(data.responseJSON.message) - $('.js-login').attr('disabled', false) - ) - ), 1000) - - $('.js-login').on 'click', (e) -> - e.preventDefault(); - $(this).attr('disabled', true) - - $.post($('form').attr('action'), $('form').serialize()).done((data) -> - if data.message - flash_notice(data.message) - mid_status() - ).fail((data) -> - flash_alert(data.responseJSON.message) - $('.js-login').attr('disabled', false) - ) - window.addEventListener 'load', load_listener diff --git a/app/views/registrar/sessions/login_mid.haml b/app/views/registrar/sessions/login_mid.haml deleted file mode 100644 index 7ee604209..000000000 --- a/app/views/registrar/sessions/login_mid.haml +++ /dev/null @@ -1,40 +0,0 @@ -.row - .form-signin.col-md-4.center-block.text-center - %h2.form-signin-heading.text-center= t '.header' - %hr - = form_for @user, url: registrar_mid_path, html: {class: 'form-signin'} do |f| - = f.text_field :phone, class: 'form-control', - placeholder: t(:phone_no), autocomplete: 'off', required: true - %button.btn.btn-lg.btn-primary.btn-block.js-login{:type => 'submit'}= t '.submit_btn' - - - if ['development', 'alpha'].include?(Rails.env) - %div.text-center - 00007, 60000007, 00000766 - -:coffee - load_listener = -> - $('.js-login').attr('disabled', false) - - status_interval = null - mid_status = () -> - status_interval = setInterval((-> - $.post('/registrar/login/mid_status').fail((data) -> - clearInterval(status_interval) - flash_alert(data.responseJSON.message) - $('.js-login').attr('disabled', false) - ) - ), 1000) - - $('.js-login').on 'click', (e) -> - e.preventDefault(); - $(this).attr('disabled', true) - - $.post($('form').attr('action'), $('form').serialize()).done((data) -> - if data.message - flash_notice(data.message) - mid_status() - ).fail((data) -> - flash_alert(data.responseJSON.message) - $('.js-login').attr('disabled', false) - ) - window.addEventListener 'load', load_listener diff --git a/test/models/registrant_user/registrant_user_creation_test.rb b/test/models/registrant_user/registrant_user_creation_test.rb index 42fb0e0f6..5ed680795 100644 --- a/test/models/registrant_user/registrant_user_creation_test.rb +++ b/test/models/registrant_user/registrant_user_creation_test.rb @@ -26,13 +26,4 @@ class RegistrantUserCreationTest < ActiveSupport::TestCase user = User.find_by(registrant_ident: 'EE-37710100070') assert_equal('JOHN SMITH', user.username) end - - def test_find_or_create_by_mid_data_creates_a_user - user_data = OpenStruct.new(user_country: 'EE', user_id_code: '37710100070', - user_givenname: 'JOHN', user_surname: 'SMITH') - - RegistrantUser.find_or_create_by_mid_data(user_data) - user = User.find_by(registrant_ident: 'EE-37710100070') - assert_equal('JOHN SMITH', user.username) - end end From f892302e935323ac45c409995e74e7b9b236dce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Fri, 2 Oct 2020 09:57:49 +0300 Subject: [PATCH 48/79] Fix error rendering on TARA controller --- app/controllers/sso/tara_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/sso/tara_controller.rb b/app/controllers/sso/tara_controller.rb index 1571f45b3..37c8ab608 100644 --- a/app/controllers/sso/tara_controller.rb +++ b/app/controllers/sso/tara_controller.rb @@ -15,7 +15,7 @@ module Sso # rubocop:disable Style/AndOr def callback(user, registrar: true) session[:omniauth_hash] = user_hash - (show error and return) unless user + (show_error(registrar: registrar) and return) unless user flash[:notice] = t(:signed_in_successfully) sign_in_and_redirect(registrar ? :registrar_user : :registrant_user, user) From ed29bef7f1863b84b7a681363e678f7b19a99a0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Fri, 2 Oct 2020 10:21:38 +0300 Subject: [PATCH 49/79] Add test for registrant TARA integration --- .../registrant_user/tara/tara_users_test.rb | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 test/models/registrant_user/tara/tara_users_test.rb diff --git a/test/models/registrant_user/tara/tara_users_test.rb b/test/models/registrant_user/tara/tara_users_test.rb new file mode 100644 index 000000000..105baac5b --- /dev/null +++ b/test/models/registrant_user/tara/tara_users_test.rb @@ -0,0 +1,49 @@ +require 'application_system_test_case' + +class RegistrantAreaTaraUsersTest < ApplicationSystemTestCase + def setup + super + + OmniAuth.config.test_mode = true + @registrant = users(:registrant) + + @existing_user_hash = { + 'provider' => 'rant_tara', + 'uid' => "US1234", + 'info': { 'first_name': 'Registrant', 'last_name': 'User' } + } + + @new_user_hash = { + 'provider' => 'rant_tara', + 'uid' => 'EE51007050604', + 'info': { 'first_name': 'New Registrant', 'last_name': 'User'} + } + end + + def teardown + super + + OmniAuth.config.test_mode = false + OmniAuth.config.mock_auth['rant_tara'] = nil + end + + def test_existing_user_gets_signed_in + OmniAuth.config.mock_auth[:rant_tara] = OmniAuth::AuthHash.new(@existing_user_hash) + + visit new_registrant_user_session_path + click_link('Sign in') + + assert_text('Signed in successfully') + end + + def test_new_user_is_created_and_signed_in + OmniAuth.config.mock_auth[:tara] = OmniAuth::AuthHash.new(@new_user_hash) + + visit new_registrant_user_session_path + click_link('Sign in') + + assert_text('Signed in successfully') + assert 'New Registrant User', RegistrantUser.last.username + assert 'EE-51007050604', RegistrantUser.last.registrant_ident + end +end From b6b036f37f108537cb60c5f29fb8fc6423c0e218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Fri, 2 Oct 2020 10:52:45 +0300 Subject: [PATCH 50/79] Move tara test to system cases --- .../registrant_area}/tara/tara_users_test.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) rename test/{models/registrant_user => system/registrant_area}/tara/tara_users_test.rb (70%) diff --git a/test/models/registrant_user/tara/tara_users_test.rb b/test/system/registrant_area/tara/tara_users_test.rb similarity index 70% rename from test/models/registrant_user/tara/tara_users_test.rb rename to test/system/registrant_area/tara/tara_users_test.rb index 105baac5b..5020616d4 100644 --- a/test/models/registrant_user/tara/tara_users_test.rb +++ b/test/system/registrant_area/tara/tara_users_test.rb @@ -37,13 +37,15 @@ class RegistrantAreaTaraUsersTest < ApplicationSystemTestCase end def test_new_user_is_created_and_signed_in - OmniAuth.config.mock_auth[:tara] = OmniAuth::AuthHash.new(@new_user_hash) + OmniAuth.config.mock_auth[:rant_tara] = OmniAuth::AuthHash.new(@new_user_hash) - visit new_registrant_user_session_path - click_link('Sign in') + assert_difference 'RegistrantUser.count' do + visit new_registrant_user_session_path + click_link('Sign in') - assert_text('Signed in successfully') - assert 'New Registrant User', RegistrantUser.last.username - assert 'EE-51007050604', RegistrantUser.last.registrant_ident + assert_equal 'New Registrant User', RegistrantUser.last.username + assert_equal 'EE-51007050604', RegistrantUser.last.registrant_ident + assert_text('Signed in successfully') + end end end From 5db69a62ee823db40df5fdb4d715bd778d1dfac8 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Fri, 2 Oct 2020 17:26:49 +0500 Subject: [PATCH 51/79] Raise directo gem version to test --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 6ba54e871..88c7d4be0 100644 --- a/Gemfile +++ b/Gemfile @@ -75,7 +75,7 @@ gem 'domain_name' gem 'haml', '~> 5.0' gem 'wkhtmltopdf-binary', '~> 0.12.5.1' -gem 'directo', github: 'internetee/directo', branch: 'master' +gem 'directo', github: 'internetee/directo', branch: '10-fix-vat-vat-code-if-reverse-charge-vat' group :development do # deploy diff --git a/Gemfile.lock b/Gemfile.lock index 1a45ed826..25a182f20 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,8 +9,8 @@ GIT GIT remote: https://github.com/internetee/directo.git - revision: e4ba54f601d1815fd8782a196788730d47861e86 - branch: master + revision: 9193bd9bcd3ab48a2e25543270b62fb8cb9ff1b2 + branch: 10-fix-vat-vat-code-if-reverse-charge-vat specs: directo (1.0.1) money (~> 6.13) From 2b3dd801cc395f9e1a57c8744cebe3f3bfe20523 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Tue, 6 Oct 2020 12:48:56 +0500 Subject: [PATCH 52/79] Renew directo gem version --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 88c7d4be0..6ba54e871 100644 --- a/Gemfile +++ b/Gemfile @@ -75,7 +75,7 @@ gem 'domain_name' gem 'haml', '~> 5.0' gem 'wkhtmltopdf-binary', '~> 0.12.5.1' -gem 'directo', github: 'internetee/directo', branch: '10-fix-vat-vat-code-if-reverse-charge-vat' +gem 'directo', github: 'internetee/directo', branch: 'master' group :development do # deploy diff --git a/Gemfile.lock b/Gemfile.lock index 25a182f20..4ebedc95c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,8 +9,8 @@ GIT GIT remote: https://github.com/internetee/directo.git - revision: 9193bd9bcd3ab48a2e25543270b62fb8cb9ff1b2 - branch: 10-fix-vat-vat-code-if-reverse-charge-vat + revision: 711ce2d942456ee830b649b03b7141e903a1d86b + branch: master specs: directo (1.0.1) money (~> 6.13) From 44d9edacbb26b42d8ceea1fbfa1cc3c7ee482446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Tue, 6 Oct 2020 12:02:11 +0300 Subject: [PATCH 53/79] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 873166aed..ec99de6e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +06.10.2020 +* Updated Directo gem to fix vat codes for EU and non-EU clients [#1699](https://github.com/internetee/registry/pull/1699) + 01.10.2020 * Fixed EPP authentication [#1697](https://github.com/internetee/registry/pull/1697) From 285be463da9f00a8724b9569cefec111486e01f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Tue, 6 Oct 2020 16:20:22 +0300 Subject: [PATCH 54/79] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec99de6e4..853a50604 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ 06.10.2020 * Updated Directo gem to fix vat codes for EU and non-EU clients [#1699](https://github.com/internetee/registry/pull/1699) +* Email validation level is now configurable [#1675](https://github.com/internetee/registry/pull/1675) 01.10.2020 * Fixed EPP authentication [#1697](https://github.com/internetee/registry/pull/1697) From a92c1dfb746f7bfdf2f10b7fe2ef2a6230e2580a Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Thu, 8 Oct 2020 12:34:10 +0500 Subject: [PATCH 55/79] Quickfix truemail init file --- config/initializers/truemail.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/truemail.rb b/config/initializers/truemail.rb index badc0cc82..ecab32ced 100644 --- a/config/initializers/truemail.rb +++ b/config/initializers/truemail.rb @@ -29,7 +29,7 @@ Truemail.configure do |config| # Truemail.validate('email@email.com') call without with-parameter # Available validation types: :regex, :mx, :smtp if ENV['default_email_validation_type'].present? && - %w[regex, mx, smtp].include?(ENV['default_email_validation_type']) + %w[regex mx smtp].include?(ENV['default_email_validation_type']) config.default_validation_type = ENV['default_email_validation_type'].to_sym elsif Rails.env.production? config.default_validation_type = :mx From 4ebbc37ae296ffc11e4ebf0a6949b10b0e8dd293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Thu, 8 Oct 2020 14:18:16 +0300 Subject: [PATCH 56/79] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 853a50604..a46a454db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +08.10.2020 +* Fixed serach in admin history [#1695](https://github.com/internetee/registry/issues/1695) + 06.10.2020 * Updated Directo gem to fix vat codes for EU and non-EU clients [#1699](https://github.com/internetee/registry/pull/1699) * Email validation level is now configurable [#1675](https://github.com/internetee/registry/pull/1675) From 4917539a7d5d6ffa75e044c3d048e7f9741e9f89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Fri, 9 Oct 2020 14:57:03 +0300 Subject: [PATCH 57/79] Return pending_update? value based on status, regardless of force delete state --- app/models/domain.rb | 2 +- test/models/domain/force_delete_test.rb | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/models/domain.rb b/app/models/domain.rb index 679669728..391c9c030 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -489,7 +489,7 @@ class Domain < ApplicationRecord end def pending_update? - statuses.include?(DomainStatus::PENDING_UPDATE) && !statuses.include?(DomainStatus::FORCE_DELETE) + statuses.include?(DomainStatus::PENDING_UPDATE) end # depricated not used, not valid diff --git a/test/models/domain/force_delete_test.rb b/test/models/domain/force_delete_test.rb index e3818c484..83cb57b13 100644 --- a/test/models/domain/force_delete_test.rb +++ b/test/models/domain/force_delete_test.rb @@ -242,4 +242,14 @@ class NewDomainForceDeleteTest < ActiveSupport::TestCase assert_not_includes(@domain.statuses, asserted_status) end + + def test_does_force_delete_does_not_affect_pending_update_check + @domain.schedule_force_delete(type: :soft) + @domain.reload + + @domain.statuses << DomainStatus::PENDING_DELETE + + assert @domain.force_delete_scheduled? + assert @domain.pending_update? + end end From 3808c8cd9e2fdf150397adda69cddbe5cd99330e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Fri, 9 Oct 2020 15:32:03 +0300 Subject: [PATCH 58/79] DomainCron: Test expire pending with forceDelete --- test/models/domain/force_delete_test.rb | 4 ++-- test/models/domain_cron_test.rb | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/test/models/domain/force_delete_test.rb b/test/models/domain/force_delete_test.rb index 83cb57b13..ad91ccfec 100644 --- a/test/models/domain/force_delete_test.rb +++ b/test/models/domain/force_delete_test.rb @@ -243,11 +243,11 @@ class NewDomainForceDeleteTest < ActiveSupport::TestCase assert_not_includes(@domain.statuses, asserted_status) end - def test_does_force_delete_does_not_affect_pending_update_check + def test_force_delete_does_not_affect_pending_update_check @domain.schedule_force_delete(type: :soft) @domain.reload - @domain.statuses << DomainStatus::PENDING_DELETE + @domain.statuses << DomainStatus::PENDING_UPDATE assert @domain.force_delete_scheduled? assert @domain.pending_update? diff --git a/test/models/domain_cron_test.rb b/test/models/domain_cron_test.rb index 5b3b0120e..3bf36b9e2 100644 --- a/test/models/domain_cron_test.rb +++ b/test/models/domain_cron_test.rb @@ -52,4 +52,26 @@ class DomainCronTest < ActiveSupport::TestCase assert_emails 0 end + + def test_cleans_expired_pendings_when_force_delete_active + Setting.expire_pending_confirmation = 0 + + # Set force delete + @domain.schedule_force_delete(type: :soft) + @domain.reload + + @domain.statuses << DomainStatus::PENDING_UPDATE + # Set domain registrant change that's expired + @domain.update!(registrant_verification_asked_at: Time.zone.now, + registrant_verification_token: 'test', + statuses: @domain.statuses) + + assert @domain.pending_update? + @domain.reload + + DomainCron.clean_expired_pendings + @domain.reload + + assert_not @domain.pending_update? + end end From 497ba6514d8b5c18abb5dabe1aec20ef05168cb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Fri, 9 Oct 2020 18:49:59 +0300 Subject: [PATCH 59/79] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a46a454db..c472d75b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +09.10.2020 +* Fixed pendingUpdate release while forceDelete is set [#1705](https://github.com/internetee/registry/issues/1705) + 08.10.2020 * Fixed serach in admin history [#1695](https://github.com/internetee/registry/issues/1695) From c79042f7890eccb9a60d761f132ac34c83c1fee4 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Mon, 12 Oct 2020 16:25:10 +0500 Subject: [PATCH 60/79] Add registrant api companies endpoint --- .codeclimate.yml | 1 + Gemfile | 2 +- Gemfile.lock | 4 +- .../api/v1/registrant/companies_controller.rb | 41 +++++++++++++++++++ config/routes.rb | 3 ++ lib/serializers/registrant_api/company.rb | 20 +++++++++ .../registrant_api_companies_test.rb | 35 ++++++++++++++++ test/test_helper.rb | 4 +- 8 files changed, 105 insertions(+), 5 deletions(-) create mode 100644 app/controllers/api/v1/registrant/companies_controller.rb create mode 100644 lib/serializers/registrant_api/company.rb create mode 100644 test/integration/api/registrant/registrant_api_companies_test.rb diff --git a/.codeclimate.yml b/.codeclimate.yml index 2bc90b200..f7ff3bab1 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -32,6 +32,7 @@ exclude_patterns: - "bin/" - "config/" - "db/" + - "app/controllers/api/v1/registrant/companies_controller.rb" - "lib/core_monkey_patches/" - "lib/daemons/" - "lib/gem_monkey_patches/" diff --git a/Gemfile b/Gemfile index 6ba54e871..04ec5f13b 100644 --- a/Gemfile +++ b/Gemfile @@ -68,7 +68,7 @@ gem 'pdfkit' gem 'jquery-ui-rails', '5.0.5' gem 'airbrake' -gem 'company_register', github: 'internetee/company_register', branch: :master +gem 'company_register', github: 'internetee/company_register', branch: '1708-registrant-companies-endpoint' gem 'e_invoice', github: 'internetee/e_invoice', branch: :master gem 'lhv', github: 'internetee/lhv', branch: 'master' gem 'domain_name' diff --git a/Gemfile.lock b/Gemfile.lock index 4ebedc95c..c79ac1e93 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GIT remote: https://github.com/internetee/company_register.git - revision: 86d691997aa7def9f86d88f6c92cabb86cd65487 - branch: master + revision: 13c5cfdf2dea8e13bf52628b566c0fecc2ad1c6a + branch: 1708-registrant-companies-endpoint specs: company_register (0.1.0) activesupport diff --git a/app/controllers/api/v1/registrant/companies_controller.rb b/app/controllers/api/v1/registrant/companies_controller.rb new file mode 100644 index 000000000..f8f2554c0 --- /dev/null +++ b/app/controllers/api/v1/registrant/companies_controller.rb @@ -0,0 +1,41 @@ +require 'serializers/registrant_api/company' + +module Api + module V1 + module Registrant + class CompaniesController < ::Api::V1::Registrant::BaseController + def index + limit = params[:limit] || 200 + offset = params[:offset] || 0 + + if limit.to_i > 200 || limit.to_i < 1 + render(json: { errors: [{ limit: ['parameter is out of range'] }] }, + status: :bad_request) && return + end + + if offset.to_i.negative? + render(json: { errors: [{ offset: ['parameter is out of range'] }] }, + status: :bad_request) && return + end + + @companies = current_user_companies.drop(offset.to_i).first(limit.to_i) + + serialized_companies = @companies.map do |item| + country_code = current_registrant_user.country.alpha3 + serializer = ::Serializers::RegistrantApi::Company.new(company: item, + country_code: country_code) + serializer.to_json + end + + render json: serialized_companies + end + + def current_user_companies + current_registrant_user.companies + rescue CompanyRegister::NotAvailableError + nil + end + end + end + end +end diff --git a/config/routes.rb b/config/routes.rb index 41f857bc8..4a996bfbb 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -61,9 +61,11 @@ Rails.application.routes.draw do resource :registry_lock, only: %i[create destroy] end resources :contacts, only: %i[index show update], param: :uuid + resources :companies, only: %i[index] end resources :auctions, only: %i[index show update], param: :uuid + end match '*all', controller: 'cors', action: 'cors_preflight_check', via: [:options], @@ -179,6 +181,7 @@ Rails.application.routes.draw do end resources :registrars, only: :show + # resources :companies, only: :index resources :domains, only: %i[index show] do resources :contacts, only: %i[show edit update] member do diff --git a/lib/serializers/registrant_api/company.rb b/lib/serializers/registrant_api/company.rb new file mode 100644 index 000000000..d0d914cd7 --- /dev/null +++ b/lib/serializers/registrant_api/company.rb @@ -0,0 +1,20 @@ +module Serializers + module RegistrantApi + class Company + attr_reader :company, :country_code + + def initialize(company:, country_code:) + @company = company + @country_code = country_code + end + + def to_json(*_args) + { + name: company.company_name, + registry_no: company.registration_number, + country_code: @country_code, + } + end + end + end +end diff --git a/test/integration/api/registrant/registrant_api_companies_test.rb b/test/integration/api/registrant/registrant_api_companies_test.rb new file mode 100644 index 000000000..20b9f3896 --- /dev/null +++ b/test/integration/api/registrant/registrant_api_companies_test.rb @@ -0,0 +1,35 @@ +require 'test_helper' +require 'auth_token/auth_token_creator' + +class RegistrantApiCompaniesTest < ApplicationIntegrationTest + def setup + super + + @contact = contacts(:john) + @user = users(:registrant) + @auth_headers = { 'HTTP_AUTHORIZATION' => auth_token } + end + + def test_root_accepts_limit_and_offset_parameters + contacts(:william).update!(ident: '1234', ident_type: 'priv', ident_country_code: 'US') + assert_equal 4, @user.contacts(representable: false).size + + get '/api/v1/registrant/companies', params: { 'limit' => 1, 'offset' => 0 }, + headers: @auth_headers + response_json = JSON.parse(response.body, symbolize_names: true) + assert_equal(200, response.status) + assert_equal(1, response_json.count) + + get '/api/v1/registrant/companies', headers: @auth_headers + response_json = JSON.parse(response.body, symbolize_names: true) + assert_equal(@user.companies.size, response_json.count) + end + + private + + def auth_token + token_creator = AuthTokenCreator.create_with_defaults(@user) + hash = token_creator.token_in_hash + "Bearer #{hash[:access_token]}" + end +end diff --git a/test/test_helper.rb b/test/test_helper.rb index 6e1b10c88..459d4f8f5 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -27,10 +27,10 @@ Rake::Task.clear Rails.application.load_tasks class CompanyRegisterClientStub - Company = Struct.new(:registration_number) + Company = Struct.new(:registration_number, :company_name) def representation_rights(citizen_personal_code:, citizen_country_code:) - [Company.new('1234567')] + [Company.new('1234567', 'ACME Ltd')] end end From c43ae63521a6ff800a2894d51652c85e8cf42fa3 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Tue, 13 Oct 2020 12:52:40 +0500 Subject: [PATCH 61/79] Fix output format & format test --- .codeclimate.yml | 1 - Gemfile | 3 +- .../api/v1/registrant/companies_controller.rb | 49 ++++++++++++------- .../registrant_api_companies_test.rb | 14 ++++-- 4 files changed, 43 insertions(+), 24 deletions(-) diff --git a/.codeclimate.yml b/.codeclimate.yml index f7ff3bab1..2bc90b200 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -32,7 +32,6 @@ exclude_patterns: - "bin/" - "config/" - "db/" - - "app/controllers/api/v1/registrant/companies_controller.rb" - "lib/core_monkey_patches/" - "lib/daemons/" - "lib/gem_monkey_patches/" diff --git a/Gemfile b/Gemfile index 04ec5f13b..5b4091f4b 100644 --- a/Gemfile +++ b/Gemfile @@ -68,7 +68,8 @@ gem 'pdfkit' gem 'jquery-ui-rails', '5.0.5' gem 'airbrake' -gem 'company_register', github: 'internetee/company_register', branch: '1708-registrant-companies-endpoint' +gem 'company_register', github: 'internetee/company_register', + branch: '1708-registrant-companies-endpoint' gem 'e_invoice', github: 'internetee/e_invoice', branch: :master gem 'lhv', github: 'internetee/lhv', branch: 'master' gem 'domain_name' diff --git a/app/controllers/api/v1/registrant/companies_controller.rb b/app/controllers/api/v1/registrant/companies_controller.rb index f8f2554c0..b11c06909 100644 --- a/app/controllers/api/v1/registrant/companies_controller.rb +++ b/app/controllers/api/v1/registrant/companies_controller.rb @@ -4,21 +4,39 @@ module Api module V1 module Registrant class CompaniesController < ::Api::V1::Registrant::BaseController + MAX_LIMIT = 200 + MIN_OFFSET = 0 + def index - limit = params[:limit] || 200 - offset = params[:offset] || 0 + result = error_result('limit') if limit > MAX_LIMIT || limit < 1 + result = error_result('offset') if offset < MIN_OFFSET + result ||= companies_result(limit, offset) - if limit.to_i > 200 || limit.to_i < 1 - render(json: { errors: [{ limit: ['parameter is out of range'] }] }, - status: :bad_request) && return - end + render result + end - if offset.to_i.negative? - render(json: { errors: [{ offset: ['parameter is out of range'] }] }, - status: :bad_request) && return - end + def current_user_companies + current_registrant_user.companies + rescue CompanyRegister::NotAvailableError + [] + end - @companies = current_user_companies.drop(offset.to_i).first(limit.to_i) + def limit + (params[:limit] || MAX_LIMIT).to_i + end + + def offset + (params[:offset] || MIN_OFFSET).to_i + end + + def error_result(attr_name) + { json: { errors: [{ attr_name.to_sym => ['parameter is out of range'] }] }, + status: :bad_request } + end + + def companies_result(limit, offset) + @companies = current_user_companies.drop(offset).first(limit) + status = @companies.present? ? :ok : :not_found serialized_companies = @companies.map do |item| country_code = current_registrant_user.country.alpha3 @@ -26,14 +44,7 @@ module Api country_code: country_code) serializer.to_json end - - render json: serialized_companies - end - - def current_user_companies - current_registrant_user.companies - rescue CompanyRegister::NotAvailableError - nil + { json: { companies: serialized_companies }, status: status } end end end diff --git a/test/integration/api/registrant/registrant_api_companies_test.rb b/test/integration/api/registrant/registrant_api_companies_test.rb index 20b9f3896..b08383796 100644 --- a/test/integration/api/registrant/registrant_api_companies_test.rb +++ b/test/integration/api/registrant/registrant_api_companies_test.rb @@ -10,21 +10,29 @@ class RegistrantApiCompaniesTest < ApplicationIntegrationTest @auth_headers = { 'HTTP_AUTHORIZATION' => auth_token } end - def test_root_accepts_limit_and_offset_parameters + def test_accepts_limit_and_offset_parameters contacts(:william).update!(ident: '1234', ident_type: 'priv', ident_country_code: 'US') - assert_equal 4, @user.contacts(representable: false).size get '/api/v1/registrant/companies', params: { 'limit' => 1, 'offset' => 0 }, headers: @auth_headers response_json = JSON.parse(response.body, symbolize_names: true) assert_equal(200, response.status) - assert_equal(1, response_json.count) + assert_equal(1, response_json.values.flatten.count) get '/api/v1/registrant/companies', headers: @auth_headers response_json = JSON.parse(response.body, symbolize_names: true) assert_equal(@user.companies.size, response_json.count) end + def test_format + contacts(:william).update!(ident: '1234', ident_type: 'priv', ident_country_code: 'US') + get '/api/v1/registrant/companies', headers: @auth_headers + response_json = JSON.parse(response.body, symbolize_names: true) + assert_equal(1, response_json.count) + assert response_json.is_a?(Hash) + assert_equal(:companies, response_json.keys.first) + end + private def auth_token From c59211239d78a6589ec55e669f4cfae8bf7a8150 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Wed, 14 Oct 2020 11:31:17 +0500 Subject: [PATCH 62/79] Update API documentation --- doc/registrant-api/v1/companies.md | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 doc/registrant-api/v1/companies.md diff --git a/doc/registrant-api/v1/companies.md b/doc/registrant-api/v1/companies.md new file mode 100644 index 000000000..2804a63c8 --- /dev/null +++ b/doc/registrant-api/v1/companies.md @@ -0,0 +1,34 @@ +## GET /api/v1/registrant/companies +Returns list of companies registered in business register for the current registrant. + + +#### Parameters + +| Field name | Required | Type | Allowed values | Description | +| ---------- | -------- | ---- | -------------- | ----------- | +| limit | false | Integer | [1..200] | How many companies to show | +| offset | false | Integer | | Company number to start at | + +#### Request +``` +GET /api/v1/registrant/companies?limit=1 HTTP/1.1 +Accept: application/json +Authorization: Bearer Z2l0bGFiOmdoeXQ5ZTRmdQ== +Content-Type: application/json +``` + +#### Response +``` +HTTP/1.1 200 +Content-Type: application/json + +{ + "companies":[ + { + "name":"ACME Ltd", + "registry_no":"37605030299", + "country_code":"EE" + } + ] +} +``` From b3ceb625a3f54ab46ab3df66993a733d5b75652e Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Wed, 14 Oct 2020 16:56:21 +0500 Subject: [PATCH 63/79] fix new version fields for deleted domains --- app/views/admin/domain_versions/archive.haml | 2 +- app/views/admin/domain_versions/show.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/admin/domain_versions/archive.haml b/app/views/admin/domain_versions/archive.haml index ffeec125e..f813f5eb3 100644 --- a/app/views/admin/domain_versions/archive.haml +++ b/app/views/admin/domain_versions/archive.haml @@ -57,7 +57,7 @@ - if version - attributes = only_present_fields(version, Domain) - domain = Domain.new(attributes) - - attach_existing_fields(version, domain) + - attach_existing_fields(version, domain) unless version.event == 'destroy' %tr %td= link_to(domain.name, admin_domain_version_path(version.id)) diff --git a/app/views/admin/domain_versions/show.haml b/app/views/admin/domain_versions/show.haml index cb95f231c..11f70599f 100644 --- a/app/views/admin/domain_versions/show.haml +++ b/app/views/admin/domain_versions/show.haml @@ -1,6 +1,6 @@ - present_fields = only_present_fields(@version, Domain) - domain = Domain.new(present_fields) -- attach_existing_fields(@version, domain) +- attach_existing_fields(@version, domain) unless @version.event == 'destroy' - if @version - children = HashWithIndifferentAccess.new(@version.children) From ecaf8fc43d232d5aaddadf678cb92af3dc20b0e4 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Wed, 14 Oct 2020 18:43:47 +0500 Subject: [PATCH 64/79] Update company_register gem version --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 5b4091f4b..25c3eafff 100644 --- a/Gemfile +++ b/Gemfile @@ -69,7 +69,7 @@ gem 'jquery-ui-rails', '5.0.5' gem 'airbrake' gem 'company_register', github: 'internetee/company_register', - branch: '1708-registrant-companies-endpoint' + branch: 'master' gem 'e_invoice', github: 'internetee/e_invoice', branch: :master gem 'lhv', github: 'internetee/lhv', branch: 'master' gem 'domain_name' diff --git a/Gemfile.lock b/Gemfile.lock index c79ac1e93..6c94dc56f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GIT remote: https://github.com/internetee/company_register.git - revision: 13c5cfdf2dea8e13bf52628b566c0fecc2ad1c6a - branch: 1708-registrant-companies-endpoint + revision: 4181b2fff9080e2d87d15612561131f9e3fdfb4c + branch: master specs: company_register (0.1.0) activesupport From ce93425ad8599b492fb757502709b3070d80a5f7 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Wed, 14 Oct 2020 18:58:59 +0500 Subject: [PATCH 65/79] Fix array comparison in tests --- test/mailers/domain_delete_mailer_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/mailers/domain_delete_mailer_test.rb b/test/mailers/domain_delete_mailer_test.rb index ae060921f..b65ba5d2e 100644 --- a/test/mailers/domain_delete_mailer_test.rb +++ b/test/mailers/domain_delete_mailer_test.rb @@ -73,7 +73,7 @@ class DomainDeleteMailerTest < ActionMailer::TestCase assert_emails 1 assert_equal ['legal@registry.test'], email.from - assert_equal @domain.force_delete_contact_emails, email.to + assert @domain.force_delete_contact_emails.sort == email.to.sort assert_equal 'Domeen shop.test on kustutusmenetluses' \ ' / Domain shop.test is in deletion process' \ ' / Домен shop.test в процессе удаления', email.subject From 30959132a6a5201681b9f21f646027a0464297b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Wed, 14 Oct 2020 17:03:29 +0300 Subject: [PATCH 66/79] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c472d75b1..e9a4761a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +14.10.2020 +* Fixed domain delete history records in admin [#1710](https://github.com/internetee/registry/issues/1710) + 09.10.2020 * Fixed pendingUpdate release while forceDelete is set [#1705](https://github.com/internetee/registry/issues/1705) From 0e55f413a50b7c2563d95213484643c000cc0db7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Wed, 14 Oct 2020 17:06:58 +0300 Subject: [PATCH 67/79] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9a4761a9..9cbcaacc4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ 14.10.2020 +* Added company registration data query to regisrant API [#1708](https://github.com/internetee/registry/issues/1708) * Fixed domain delete history records in admin [#1710](https://github.com/internetee/registry/issues/1710) 09.10.2020 From a154b0599ff2c7b9228321c0f6d58a9afd7c0c41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Thu, 15 Oct 2020 11:32:52 +0300 Subject: [PATCH 68/79] Registrant: Generate TARA state via gem --- config/initializers/omniauth.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index ec030399e..e3e0d644b 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -52,7 +52,6 @@ Rails.application.config.middleware.use OmniAuth::Builder do callback_path: '/registrant/open_id/callback', name: 'rant_tara', scope: ['openid'], - state: Proc.new{ SecureRandom.hex(10) }, client_signing_alg: :RS256, client_jwk_signing_key: signing_keys, send_scope_to_token_endpoint: false, From 0357cfc29ece156c17a0a2ea176e1e0d53c0a4f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Thu, 15 Oct 2020 12:54:38 +0300 Subject: [PATCH 69/79] Provide logging for tara state handler --- Gemfile | 2 +- Gemfile.lock | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 6ba54e871..e346eb3ea 100644 --- a/Gemfile +++ b/Gemfile @@ -56,7 +56,7 @@ gem 'digidoc_client', # TARA gem 'omniauth' gem 'omniauth-rails_csrf_protection' -gem 'omniauth-tara', github: 'internetee/omniauth-tara' +gem 'omniauth-tara', github: 'internetee/omniauth-tara', branch: 'extended-logging' gem 'epp', github: 'internetee/epp', branch: :master diff --git a/Gemfile.lock b/Gemfile.lock index 1a45ed826..59922042b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -54,7 +54,8 @@ GIT GIT remote: https://github.com/internetee/omniauth-tara.git - revision: cec845ec3794532144c4976104a07e206d759aa6 + revision: 75c369dd86a5fe1a2ee4c2a6246252d79431071c + branch: extended-logging specs: omniauth-tara (0.3.0) addressable (~> 2.5) From c09e08c61e85874832e911669d4b6c767062e68e Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Thu, 15 Oct 2020 16:01:01 +0500 Subject: [PATCH 70/79] Change error handling to more humane --- .../api/v1/registrant/companies_controller.rb | 8 +++---- .../registrant_api_companies_test.rb | 22 +++++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/app/controllers/api/v1/registrant/companies_controller.rb b/app/controllers/api/v1/registrant/companies_controller.rb index b11c06909..d2060276d 100644 --- a/app/controllers/api/v1/registrant/companies_controller.rb +++ b/app/controllers/api/v1/registrant/companies_controller.rb @@ -16,9 +16,9 @@ module Api end def current_user_companies - current_registrant_user.companies + [:ok, current_registrant_user.companies] rescue CompanyRegister::NotAvailableError - [] + [:service_unavailable, []] end def limit @@ -35,8 +35,8 @@ module Api end def companies_result(limit, offset) - @companies = current_user_companies.drop(offset).first(limit) - status = @companies.present? ? :ok : :not_found + status, all_companies = current_user_companies + @companies = all_companies.drop(offset).first(limit) serialized_companies = @companies.map do |item| country_code = current_registrant_user.country.alpha3 diff --git a/test/integration/api/registrant/registrant_api_companies_test.rb b/test/integration/api/registrant/registrant_api_companies_test.rb index b08383796..97e2fd3c2 100644 --- a/test/integration/api/registrant/registrant_api_companies_test.rb +++ b/test/integration/api/registrant/registrant_api_companies_test.rb @@ -1,3 +1,4 @@ +$VERBOSE=nil require 'test_helper' require 'auth_token/auth_token_creator' @@ -33,6 +34,18 @@ class RegistrantApiCompaniesTest < ApplicationIntegrationTest assert_equal(:companies, response_json.keys.first) end + def test_status_if_nil_result + contacts(:john).update!(ident: '12344321', ident_type: 'priv', ident_country_code: 'US') + + CompanyRegister.const_set(:Client, CompanyRegisterClientZeroStub) + + get '/api/v1/registrant/companies', headers: @auth_headers + response_json = JSON.parse(response.body, symbolize_names: true) + assert_equal(1, response_json.count) + assert_equal(200, response.status) + assert_equal(:companies, response_json.keys.first) + end + private def auth_token @@ -41,3 +54,12 @@ class RegistrantApiCompaniesTest < ApplicationIntegrationTest "Bearer #{hash[:access_token]}" end end + +class CompanyRegisterClientZeroStub + Company = Struct.new(:registration_number, :company_name) + + def representation_rights(citizen_personal_code:, citizen_country_code:) + [] + end +end + From a8a985b9d3a9099bb527d42eeff67067e19017b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Thu, 15 Oct 2020 16:05:36 +0300 Subject: [PATCH 71/79] Go back to master branch of omniauth-tara --- Gemfile | 2 +- Gemfile.lock | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index e346eb3ea..6ba54e871 100644 --- a/Gemfile +++ b/Gemfile @@ -56,7 +56,7 @@ gem 'digidoc_client', # TARA gem 'omniauth' gem 'omniauth-rails_csrf_protection' -gem 'omniauth-tara', github: 'internetee/omniauth-tara', branch: 'extended-logging' +gem 'omniauth-tara', github: 'internetee/omniauth-tara' gem 'epp', github: 'internetee/epp', branch: :master diff --git a/Gemfile.lock b/Gemfile.lock index 389682373..4ebedc95c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -54,8 +54,7 @@ GIT GIT remote: https://github.com/internetee/omniauth-tara.git - revision: 35c93a072e844b7a79a7d4a81b1de1ed9426dcd8 - branch: extended-logging + revision: cec845ec3794532144c4976104a07e206d759aa6 specs: omniauth-tara (0.3.0) addressable (~> 2.5) From 25a7f7168f89c36ad2c680c44790309194f09897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Thu, 15 Oct 2020 17:01:35 +0300 Subject: [PATCH 72/79] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cbcaacc4..8b2f2de6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +15.10.2020 +* Tara integration for registrant portal [#1698](https://github.com/internetee/registry/pull/1698) + 14.10.2020 * Added company registration data query to regisrant API [#1708](https://github.com/internetee/registry/issues/1708) * Fixed domain delete history records in admin [#1710](https://github.com/internetee/registry/issues/1710) From f87b51ebe8fb5541a261221172272cd4d6232d89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Fri, 16 Oct 2020 12:45:49 +0300 Subject: [PATCH 73/79] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b2f2de6f..af19f4ad6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +16.10.2020 +* Improved error handling for registrant API comapnies endpoint [#1713](https://github.com/internetee/registry/pull/1713) + 15.10.2020 * Tara integration for registrant portal [#1698](https://github.com/internetee/registry/pull/1698) From c744a81e4cf321cdfa1c578e2f6bf34a17951d56 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Fri, 16 Oct 2020 14:53:54 +0500 Subject: [PATCH 74/79] Improve invoice processing logging --- Gemfile | 2 +- Gemfile.lock | 4 ++-- lib/tasks/invoices/process_payments.rake | 10 ++++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 25c3eafff..af8ce8ecd 100644 --- a/Gemfile +++ b/Gemfile @@ -71,7 +71,7 @@ gem 'airbrake' gem 'company_register', github: 'internetee/company_register', branch: 'master' gem 'e_invoice', github: 'internetee/e_invoice', branch: :master -gem 'lhv', github: 'internetee/lhv', branch: 'master' +gem 'lhv', github: 'internetee/lhv', branch: '1712-improve-logging-autotopup-fix' gem 'domain_name' gem 'haml', '~> 5.0' gem 'wkhtmltopdf-binary', '~> 0.12.5.1' diff --git a/Gemfile.lock b/Gemfile.lock index 6c94dc56f..8f22a94a1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -45,8 +45,8 @@ GIT GIT remote: https://github.com/internetee/lhv.git - revision: 1825240b3bf8b262418cc6c8ef7ed1aba386dd7d - branch: master + revision: 3f27d87dddd16b7ef9fc6502f048f1a6718750dc + branch: 1712-improve-logging-autotopup-fix specs: lhv (0.1.0) logger diff --git a/lib/tasks/invoices/process_payments.rake b/lib/tasks/invoices/process_payments.rake index 3e02a8838..edf6609b9 100644 --- a/lib/tasks/invoices/process_payments.rake +++ b/lib/tasks/invoices/process_payments.rake @@ -23,6 +23,9 @@ namespace :invoices do end if incoming_transactions.any? + log 'Got incoming transactions' + log incoming_transactions + bank_statement = BankStatement.new(bank_code: Setting.registry_bank_code, iban: Setting.registry_iban) @@ -41,8 +44,15 @@ namespace :invoices do transaction.autobind_invoice end end + else + log 'Got no incoming transactions parsed, aborting' end puts "Transactions processed: #{incoming_transactions.size}" end + + def log(msg) + @log ||= Logger.new(STDOUT) + @log.info(msg) + end end From cac3fa6cb4cb7c1fa7fb0c12fcb0503fdcc263de Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Mon, 19 Oct 2020 13:08:16 +0500 Subject: [PATCH 75/79] Renew lhv gem version --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index af8ce8ecd..25c3eafff 100644 --- a/Gemfile +++ b/Gemfile @@ -71,7 +71,7 @@ gem 'airbrake' gem 'company_register', github: 'internetee/company_register', branch: 'master' gem 'e_invoice', github: 'internetee/e_invoice', branch: :master -gem 'lhv', github: 'internetee/lhv', branch: '1712-improve-logging-autotopup-fix' +gem 'lhv', github: 'internetee/lhv', branch: 'master' gem 'domain_name' gem 'haml', '~> 5.0' gem 'wkhtmltopdf-binary', '~> 0.12.5.1' diff --git a/Gemfile.lock b/Gemfile.lock index 8f22a94a1..c628257a2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -45,8 +45,8 @@ GIT GIT remote: https://github.com/internetee/lhv.git - revision: 3f27d87dddd16b7ef9fc6502f048f1a6718750dc - branch: 1712-improve-logging-autotopup-fix + revision: 1fb07818369425510a0172ad53bc86e85b6f83cc + branch: master specs: lhv (0.1.0) logger From 3b46367dbcdb5ed694b38a5a8a9613bdd039f750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Mon, 19 Oct 2020 13:46:04 +0300 Subject: [PATCH 76/79] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index af19f4ad6..2ef45bf81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +19.10.2020 +* Improved logging for LHV-connect messages [#1712](https://github.com/internetee/registry/issues/1712) +* LHV-connect gem update to handle blank descriptions [#1714](https://github.com/internetee/registry/issues/1714) + 16.10.2020 * Improved error handling for registrant API comapnies endpoint [#1713](https://github.com/internetee/registry/pull/1713) From f58659041d148370e2bc2b12acbcec849e8a04b0 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Mon, 19 Oct 2020 17:43:49 +0500 Subject: [PATCH 77/79] Fix company contacts stub --- .../registrant_api_companies_test.rb | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/test/integration/api/registrant/registrant_api_companies_test.rb b/test/integration/api/registrant/registrant_api_companies_test.rb index 97e2fd3c2..4f23aeac1 100644 --- a/test/integration/api/registrant/registrant_api_companies_test.rb +++ b/test/integration/api/registrant/registrant_api_companies_test.rb @@ -34,18 +34,6 @@ class RegistrantApiCompaniesTest < ApplicationIntegrationTest assert_equal(:companies, response_json.keys.first) end - def test_status_if_nil_result - contacts(:john).update!(ident: '12344321', ident_type: 'priv', ident_country_code: 'US') - - CompanyRegister.const_set(:Client, CompanyRegisterClientZeroStub) - - get '/api/v1/registrant/companies', headers: @auth_headers - response_json = JSON.parse(response.body, symbolize_names: true) - assert_equal(1, response_json.count) - assert_equal(200, response.status) - assert_equal(:companies, response_json.keys.first) - end - private def auth_token @@ -54,12 +42,3 @@ class RegistrantApiCompaniesTest < ApplicationIntegrationTest "Bearer #{hash[:access_token]}" end end - -class CompanyRegisterClientZeroStub - Company = Struct.new(:registration_number, :company_name) - - def representation_rights(citizen_personal_code:, citizen_country_code:) - [] - end -end - From 6e72bb03b38d395cf70138f80508c8034cc02840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Tue, 20 Oct 2020 15:48:35 +0300 Subject: [PATCH 78/79] DomainCron: Don't send force delete mail if template empty --- app/models/concerns/job/force_delete_notify.rb | 2 +- test/models/domain_cron_test.rb | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/app/models/concerns/job/force_delete_notify.rb b/app/models/concerns/job/force_delete_notify.rb index 658c7a315..bc291354e 100644 --- a/app/models/concerns/job/force_delete_notify.rb +++ b/app/models/concerns/job/force_delete_notify.rb @@ -15,7 +15,7 @@ module Concerns domain.registrar.notifications.create!(text: I18n.t('grace_period_started_domain', domain_name: domain.name, date: domain.force_delete_start)) - send_mail(domain) + send_mail(domain) if domain.template_name.present? domain.update(contact_notification_sent_date: Time.zone.today) end diff --git a/test/models/domain_cron_test.rb b/test/models/domain_cron_test.rb index 3bf36b9e2..0224b1a61 100644 --- a/test/models/domain_cron_test.rb +++ b/test/models/domain_cron_test.rb @@ -39,6 +39,21 @@ class DomainCronTest < ActiveSupport::TestCase assert_emails 1 end + def does_not_deliver_forced_email_if_template_empty + Setting.redemption_grace_period = 30 + + @domain.update(valid_to: Time.zone.parse('2012-08-05')) + assert_not @domain.force_delete_scheduled? + travel_to Time.zone.parse('2010-07-05') + @domain.schedule_force_delete(type: :soft) + @domain.reload + @domain.update(template_name: nil) + travel_to Time.zone.parse('2010-08-06') + DomainCron.start_client_hold + + assert_emails 0 + end + def test_does_not_sets_hold_if_already_set Setting.redemption_grace_period = 30 From a7587b9c4faf36dd540088d1b06ef66a775e8565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Tue, 20 Oct 2020 17:08:29 +0300 Subject: [PATCH 79/79] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ef45bf81..90e2523dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +20.10.2020 +* ForceDelete mailer now respects option to not notify registrant [#1719](https://github.com/internetee/registry/pull/1719) + 19.10.2020 * Improved logging for LHV-connect messages [#1712](https://github.com/internetee/registry/issues/1712) * LHV-connect gem update to handle blank descriptions [#1714](https://github.com/internetee/registry/issues/1714)