diff --git a/.codeclimate.yml b/.codeclimate.yml index e33254023..9df308022 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -1,12 +1,12 @@ +version: "2" +prepare: + fetch: + - "https://raw.githubusercontent.com/internetee/style-guide/master/ruby/.rubocop.yml" plugins: brakeman: enabled: true bundler-audit: enabled: true - csslint: - enabled: true - coffeelint: - enabled: true duplication: enabled: true config: @@ -17,22 +17,12 @@ plugins: enabled: true fixme: enabled: true - config: - strings: - - FIXME - - TODO - - HACK rubocop: enabled: true - channel: rubocop-0-51 - reek: - enabled: true - checks: - IrresponsibleModule: - enabled: false exclude_patterns: -- "config/" -- "db/" -- "vendor/" -- "spec/" -- "test/" + - "bin/" + - "config/" + - "db/" + - "vendor/" + - "test/" + - "spec/" diff --git a/.csslintrc b/.csslintrc deleted file mode 100644 index aacba956e..000000000 --- a/.csslintrc +++ /dev/null @@ -1,2 +0,0 @@ ---exclude-exts=.min.css ---ignore=adjoining-classes,box-model,ids,order-alphabetical,unqualified-attributes diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 96212a359..000000000 --- a/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -**/*{.,-}min.js diff --git a/.eslintrc.yml b/.eslintrc.yml deleted file mode 100644 index be7b1250d..000000000 --- a/.eslintrc.yml +++ /dev/null @@ -1,7 +0,0 @@ -env: - browser: true - es6: true - jquery: true -extends: google -rules: - require-jsdoc: off diff --git a/.gitignore b/.gitignore index be64af3ba..af512c5b6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,25 +1,13 @@ -*.rbc -capybara-*.html -.rspec /log /tmp -/db/*.sqlite3 /public/system -/public/assets /coverage/ -/spec/tmp -**.orig -config/initializers/secret_token.rb -config/deploy.rb -config/database.yml -config/application.yml -config/environments/development.rb -misc -/export -/import -/ca /.bundle /vendor/bundle +/config/database.yml +/config/application.yml +/config/environments/development.rb +/config/deploy.rb -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc +# Do not commit one. Instead, download the latest from https://github.com/internetee/style-guide. +.rubocop.yml diff --git a/.reek b/.reek deleted file mode 100644 index a511bdb43..000000000 --- a/.reek +++ /dev/null @@ -1,1136 +0,0 @@ -exclude_paths: - - db/migrate/ - - db/data/ -UncommunicativeModuleName: - exclude: - - Repp::AccountV1 - - Repp::ContactV1 - - Repp::DomainV1 -UncommunicativeVariableName: - exclude: - - Repp::DomainV1 - - Admin::AccountActivitiesController - - Admin::AdminUsersController - - Admin::ApiUsersController - - Admin::BankStatementsController - - Admin::Billing::PricesController - - Admin::BlockedDomainsController - - Admin::ContactVersionsController - - Admin::ContactVersionsController#index - - Admin::ContactsController - - Admin::DomainVersionsController - - Admin::DomainVersionsController#index - - Admin::DomainsController - - Admin::DomainsController#build_associations - - Admin::EppLogsController - - Admin::InvoicesController - - Admin::InvoicesController#create - - Admin::KeyrelaysController - - Admin::MailTemplatesController - - Admin::RegistrarsController - - Admin::ReppLogsController - - Admin::ReservedDomainsController - - Admin::SettingsController#casted_settings - - Admin::SettingsController#create - - Epp::DomainsController#renew - - Epp::DomainsController#update - - Epp::SessionsController#login - - EppController - - EppController#create_full_selectors - - EppController#optional - - EppController#xml_attrs_present? - - Registrant::DomainsController - - Registrar::AccountActivitiesController - - Registrar::ContactsController - - Registrar::ContactsController#download_list - - Registrar::ContactsController#index - - Registrar::DeppController#response_ok? - - Registrar::DomainsController - - Registrar::DomainsController#index - - Registrar::DomainsController#search_contacts - - Registrar::InvoicesController - - ContactMailer#email_updated - - Ability#billing - - Ability#epp - - AccountActivity#to_csv - - AccountActivity#types_for_select - - ApiUser#api_pki_ok? - - ApiUser#registrar_pki_ok? - - BankLink::Request#calc_mac - - BankLink::Response#validate_cancel - - BankLink::Response#validate_success - - BankStatement#import_th6_file - - BlockedDomain#generate_json - - Concerns::Domain::ForceDelete#cancel_force_delete - - EppErrors#add_epp_error - - EppErrors#collect_child_errors - - EppErrors#find_epp_code_and_value - - Versions::ClassMethods#all_versions_for - - Contact - - Contact#all_domains - - Contact#all_registrant_domains - - Contact#manage_emails - - Contact#search_by_query - - Contact#status_notes_array= - - Depp::Contact#construct_create_disclosure_xml - - Depp::Contact#extract_disclosure_hash - - Depp::Contact#extract_info_disclosure - - Depp::Contact#find_by_id - - Depp::Contact#handle_errors - - Depp::Contact#type_string - - Depp::Domain#construct_params_from_server_data - - Depp::Domain#create_contacts_hash - - Depp::Domain#create_dnskeys_hash - - Depp::Domain#create_nameservers_hash - - Depp::Domain#default_params - - Depp::User#initialize - - Depp::User#request - - Depp::User#validate_existance_in_server - - Directo#self.send_monthly_invoices - - DNS::Zone#self.generate_zonefile - - Dnskey#bin_to_hex - - Dnskey#generate_ds_key_tag - - Dnskey#int_to_hex - - Domain#admin_status_update - - Domain#delegated_nameservers - - Domain#name_in_wire_format - - Domain#parent_valid? - - Domain#status_notes_array= - - Domain#subordinate_nameservers - - DomainCron#self.destroy_delete_candidates - - DomainMailModel#admins - - Epp::Contact#attrs_from - - Epp::Contact#check_availability - - Epp::Domain#check_availability - - Epp::Domain#domain_contact_attrs_from - - Epp::Domain#domain_status_list_from - - Epp::Domain#domain_statuses_attrs - - Epp::Domain#nameservers_from - - Epp::Domain#parse_period_unit_from_frame - - Epp::Domain#validate_contacts - - Invoice#cancel_overdue_invoices - - Legacy::Db - - LegalDocument#save_to_filesystem - - RegistrantUser#find_or_create_by_idc_data - - RegistrantUser#find_or_create_by_mid_data - - Registrar - - Registrar#search_by_query - - ReservedDomain#generate_json - - WhoisRecord#generate_json - - UniquenessMultiValidator#validate_each - - Registry::Application - - ActiveRecord::Base - - Ransack::Adapters::ActiveRecord::Context#evaluate - - EppConstraint#matches? - - Iptable#counter_update -DuplicateMethodCall: - exclude: - - Admin::AccountActivitiesController#index - - Admin::AccountActivitiesController#set_default_dates - - Admin::AdminUsersController#update - - Admin::ApiUsersController#update - - Admin::BankStatementsController#download_import_file - - Admin::Billing::PricesController#index - - Admin::BlockedDomainsController#delete - - Admin::BlockedDomainsController#index - - Admin::CertificatesController#create - - Admin::CertificatesController#set_certificate - - Admin::ContactVersionsController#index - - Admin::ContactVersionsController#show - - Admin::ContactsController#index - - Admin::ContactsController#normalize_search_parameters - - Admin::DomainVersionsController#index - - Admin::DomainVersionsController#show - - Admin::DomainsController#build_associations - - Admin::DomainsController#index - - Admin::DomainsController#normalize_search_parameters - - Admin::EppLogsController#index - - Admin::EppLogsController#set_default_dates - - Admin::LegalDocumentsController#show - - Admin::PendingDeletesController#destroy - - Admin::PendingDeletesController#update - - Admin::PendingUpdatesController#destroy - - Admin::PendingUpdatesController#update - - Admin::ReppLogsController#index - - Admin::ReppLogsController#set_default_dates - - Admin::ReservedDomainsController#delete - - Admin::ReservedDomainsController#index - - Admin::SessionsController#create - - Admin::SettingsController#casted_settings - - Admin::ZonefilesController#create - - ApplicationController#comma_support_for - - Epp::ContactsController#validate_create - - Epp::DomainsController#create - - Epp::DomainsController#delete - - Epp::DomainsController#renew - - Epp::DomainsController#transfer - - Epp::DomainsController#update - - Epp::KeyrelaysController#keyrelay - - Epp::PollsController#ack_poll - - Epp::PollsController#poll - - Epp::PollsController#req_poll - - Epp::SessionsController#ip_white? - - Epp::SessionsController#login - - Epp::SessionsController#login_params - - EppController#current_user - - EppController#handle_errors - - EppController#iptables_counter_update - - EppController#latin_only - - EppController#optional - - EppController#update_epp_session - - EppController#write_to_epp_log - - Registrant::DomainDeleteConfirmsController#update - - Registrant::DomainUpdateConfirmsController#update - - Registrant::DomainsController#domain_verification_url - - Registrant::DomainsController#download_list - - Registrant::DomainsController#get_confirm_path - - Registrant::DomainsController#index - - Registrant::DomainsController#normalize_search_parameters - - Registrant::SessionsController#id - - Registrant::SessionsController#mid - - Registrant::SessionsController#mid_status - - Registrant::WhoisController#index - - Registrar::AccountActivitiesController#index - - Registrar::ContactsController#download_list - - Registrar::ContactsController#index - - Registrar::ContactsController#normalize_search_parameters - - Registrar::ContactsController#update - - Registrar::DomainsController#check - - Registrar::DomainsController#destroy - - Registrar::DomainsController#index - - Registrar::DomainsController#info - - Registrar::DomainsController#normalize_search_parameters - - Registrar::DomainsController#renew - - Registrar::DomainsController#search_contacts - - Registrar::DomainsController#update - - Registrar::InvoicesController#index - - Registrar::InvoicesController#normalize_search_parameters - - Registrar::PaymentsController#back - - Registrar::SessionsController#create - - Registrar::SessionsController#mid - - Registrar::SessionsController#mid_status - - ApplicationHelper#changing_css_class - - ApplicationHelper#creator_link - - ApplicationHelper#custom_sort_link - - ApplicationHelper#unstable_env - - ApplicationHelper#updator_link - - Registrant::ApplicationHelper#pagination_details - - Registrar::ApplicationHelper#pagination_details - - DomainDeleteConfirmJob#raise_errors! - - DomainDeleteConfirmJob#run - - DomainUpdateConfirmJob#raise_errors! - - DomainUpdateConfirmJob#run - - UpdateWhoisRecordJob#update_domain - - ApplicationMailer#whitelist_blocked? - - DomainExpireMailer#expired - - DomainMailer#compose_from - - DomainMailer#delete_confirmation - - DomainMailer#pending_delete_expired_notification - - DomainMailer#pending_delete_rejected_notification - - InvoiceMailer#invoice_email - - Ability#epp - - Ability#initialize - - BankLink::Request#fields - - BankLink::Response#initialize - - BankStatement#import_th6_file - - BankStatement#parse_th6_row - - BankStatement#status - - Billing::Price#self.effective - - Billing::Price#self.valid - - BusinessRegistryCache#fetch_by_ident_and_cc - - Certificate#parse_metadata - - Certificate#reload_apache - - Certificate#revoke! - - Certificate#status - - Certificate#update_id_crl - - Certificate#update_registry_crl - - EppErrors#add_epp_error - - UserEvents#cr_id - - Versions#user_from_id_role_username - - Versions::ClassMethods#all_versions_for - - Contact#all_domains - - Contact#all_registrant_domains - - Contact#destroy_orphans - - Contact#domain_names_with_roles - - Contact#generate_code - - Contact#related_domain_descriptions - - Contact#val_ident_valid_format? - - Deposit#validate_amount - - Depp::Contact#construct_check_hash_from_data - - Depp::Contact#construct_create_disclosure_xml - - Depp::Contact#extension_xml - - Depp::Contact#extract_info_disclosure - - Depp::Contact#find_by_id - - Depp::Contact#new_from_params - - Depp::Contact#update_attributes - - Depp::Domain#confirm_transfer - - Depp::Domain#construct_custom_params_hash - - Depp::Domain#construct_edit_hash - - Depp::Domain#construct_ext_edit_hash - - Depp::Domain#construct_params_from_server_data - - Depp::Domain#create - - Depp::Domain#create_contacts_hash - - Depp::Domain#create_dnskeys_hash - - Depp::Domain#create_key_data_hash - - Depp::Domain#create_nameservers_hash - - Depp::Domain#default_params - - Depp::Domain#renew - - Depp::Keyrelay#keyrelay - - Depp::User#validate_existance_in_server - - Directo#self.dump_result_to_db - - Directo#self.load_price - - Directo#self.send_monthly_invoices - - Directo#self.send_receipts - - DNS::Zone#self.generate_zonefile - - Dnskey#generate_digest - - Domain#manage_automatic_statuses - - Domain#parent_valid? - - Domain#pending_registrant - - Domain#renewable? - - Domain#set_graceful_expired - - DomainCron#self.clean_expired_pendings - - DomainCron#self.destroy_delete_candidates - - DomainCron#self.start_expire_period - - DomainCron#self.start_redemption_grace_period - - DomainMailModel#registrant_pending - - DomainMailModel#subject - - DomainMailModel#verification_token - - Epp::Contact#attrs_from - - Epp::Contact#legal_document_attrs - - Epp::Contact#status_list_from - - Epp::Contact#update_attributes - - Epp::Domain#apply_pending_update! - - Epp::Domain#attrs_from - - Epp::Domain#dnskeys_attrs - - Epp::Domain#domain_contact_attrs_from - - Epp::Domain#domain_status_list_from - - Epp::Domain#new_from_epp - - Epp::Domain#parse_legal_document_from_frame - - Epp::Domain#query_transfer - - Epp::Domain#renew - - Epp::Domain#update - - Epp::Domain#validate_contacts - - Epp::Domain#validate_exp_dates - - Invoice#cancel_overdue_invoices - - Invoice#set_invoice_number - - LegalDocument#save_to_filesystem - - LegalDocument#self.remove_duplicates - - Setting#self.params_errors - - Setting#self.reload_settings! - - Soap::Arireg#associated_businesses - - Soap::Arireg#body - - Soap::Arireg#debug - - Soap::Arireg#initialize - - WhoisRecord#generate_json - - DomainPresenter#delete_date - - DomainPresenter#force_delete_date - - DomainPresenter#on_hold_date - - DomainNameValidator#validate_each - - DomainNameValidator#validate_format - - DurationIso8601Validator#validate_each - - UniquenessMultiValidator#validate_each - - ActionView::Helpers::FormBuilder#label - - ActionDispatch::Flash#call - - Rack::Request#trusted_proxy? - - Ransack::Adapters::ActiveRecord::Context#evaluate - - DeviseCustomFailure#redirect_url - - EppConstraint#matches? - - PhoneValidator#validate_each -InstanceVariableAssumption: - exclude: - - Admin::AccountActivitiesController - - Admin::AdminUsersController - - Admin::ApiUsersController - - Admin::BankStatementsController - - Admin::BankTransactionsController - - Admin::Billing::PricesController - - Admin::BlockedDomainsController - - Admin::CertificatesController - - Admin::ContactVersionsController - - Admin::ContactsController - - Admin::DNS::ZonesController - - Admin::DomainVersionsController - - Admin::DomainsController - - Admin::EppLogsController - - Admin::InvoicesController - - Admin::KeyrelaysController - - Admin::LegalDocumentsController - - Admin::MailTemplatesController - - Admin::PendingDeletesController - - Admin::PendingUpdatesController - - Admin::RegistrarsController - - Admin::ReppLogsController - - Admin::ReservedDomainsController - - Admin::SessionsController - - Admin::SettingsController - - Admin::WhiteIpsController - - Admin::ZonefilesController - - Epp::ContactsController - - Epp::DomainsController - - Epp::KeyrelaysController - - Epp::PollsController - - Epp::SessionsController - - EppController - - Registrant::ContactsController - - Registrant::DomainDeleteConfirmsController - - Registrant::DomainUpdateConfirmsController - - Registrant::DomainsController - - Registrant::RegistrarsController - - Registrant::SessionsController - - Registrar::AccountActivitiesController - - Registrar::ContactsController - - Registrar::DepositsController - - Registrar::DeppController - - Registrar::DomainsController - - Registrar::InvoicesController - - Registrar::PaymentsController - - Registrar::PollsController - - Registrar::SessionsController - - DefaultFormBuilder - - ContactMailer - - DomainMailer - - InvoiceMailer - - ApiUser - - BankTransaction - - Certificate - - Contact - - Deposit - - Depp::Contact - - Domain - - DomainContact - - WhoisRecord - - ActiveModel::Errors - - ActionDispatch::Flash - - Ransack::Adapters::ActiveRecord::Context -IrresponsibleModule: - exclude: - - Admin::AccountActivitiesController - - Admin::AdminUsersController - - Admin::ApiUsersController - - Admin::BankStatementsController - - Admin::BankTransactionsController - - Admin::Billing::PricesController - - Admin::BlockedDomainsController - - Admin::CertificatesController - - Admin::ContactVersionsController - - Admin::ContactsController - - Admin::DashboardsController - - Admin::DelayedJobsController - - Admin::DNS::ZonesController - - Admin::DomainVersionsController - - Admin::DomainsController - - Admin::EppLogsController - - Admin::InvoicesController - - Admin::KeyrelaysController - - Admin::LegalDocumentsController - - Admin::MailTemplatesController - - Admin::PendingDeletesController - - Admin::PendingUpdatesController - - Admin::RegistrarsController - - Admin::ReppLogsController - - Admin::ReservedDomainsController - - Admin::SessionsController - - Admin::SettingsController - - Admin::WhiteIpsController - - Admin::ZonefilesController - - AdminController - - ApplicationController - - Epp::ContactsController - - Epp::DomainsController - - Epp::ErrorsController - - Epp::KeyrelaysController - - Epp::PollsController - - Epp::SessionsController - - EppController - - Registrant::ContactsController - - Registrant::DomainDeleteConfirmsController - - Registrant::DomainUpdateConfirmsController - - Registrant::DomainsController - - Registrant::RegistrarsController - - Registrant::SessionsController - - Registrant::WhoisController - - RegistrantController - - Registrar::AccountActivitiesController - - Registrar::BaseController - - Registrar::ContactsController - - Registrar::DashboardController - - Registrar::DepositsController - - Registrar::DeppController - - Registrar::DomainsController - - Registrar::InvoicesController - - Registrar::KeyrelaysController - - Registrar::PaymentsController - - Registrar::PollsController - - Registrar::SessionsController - - Registrar::XmlConsolesController - - ApplicationHelper - - DefaultFormBuilder - - FormHelper - - FormTagHelper - - Registrant::ApplicationHelper - - Registrar::ApplicationHelper - - DomainDeleteConfirmEmailJob - - DomainDeleteConfirmJob - - DomainDeleteJob - - DomainExpireEmailJob - - DomainUpdateConfirmJob - - RegenerateRegistrarWhoisesJob - - RegistrantChangeConfirmEmailJob - - RegistrantChangeExpiredEmailJob - - RegistrantChangeNoticeEmailJob - - UpdateWhoisRecordJob - - ApplicationMailer - - ContactMailer - - DomainDeleteMailer - - DomainExpireMailer - - DomainMailer - - InvoiceMailer - - RegistrantChangeMailer - - Ability - - Account - - AccountActivity - - AdminDomainContact - - AdminUser - - ApiLog::EppLog - - ApiLog::ReppLog - - ApiUser - - BankLink::Base - - BankLink::Request - - BankLink::Response - - BankStatement - - BankTransaction - - Billing::Price - - Billing - - BlockedDomain - - Certificate - - Concerns::Billing::Price::Expirable - - DisableHtml5Validation - - Concerns::Domain::Activatable - - Concerns::Domain::Deletable - - Concerns::Domain::Expirable - - Concerns::Domain::ForceDelete - - EppErrors - - UserEvents - - VersionSession - - Versions::ClassMethods - - Contact - - Counter - - Deposit - - Depp::Contact - - Depp::Domain - - Depp::Keyrelay - - Depp::User - - Directo - - DNS::Zone - - DNS - - Dnskey - - DomainContact - - DomainCron - - DomainMailModel - - DomainStatus - - DomainTransfer - - Epp::Contact - - Invoice - - InvoiceItem - - Keyrelay - - Legacy::Db - - Legacy::Object - - Legacy::ObjectHistory - - Legacy::ObjectState - - Legacy::Registrar - - LegalDocument - - Message - - Nameserver - - Registrant - - RegistrantUser - - Registrar - - ReservedDomain - - Setting - - Soap::Arireg - - Soap::Arireg::NotAvailableError - - TechDomainContact - - User - - WhiteIp - - WhoisRecord - - DomainPresenter - - RegistrantPresenter - - Registrar::DomainListCSVPresenter - - RegistrarPresenter - - RegistrantChange - - DateTimeIso8601Validator - - DomainNameValidator - - DomainNameserverValidator - - DurationIso8601Validator - - ObjectCountValidator - - UniquenessMultiValidator - - PaperSession - - Array - - ActionView::Helpers::FormBuilder - - ActiveModel::Errors - - ActionDispatch::Flash - - Rack::Request - - Ransack::Adapters::ActiveRecord::Context - - DeviseCustomFailure - - EppConstraint - - Builder::XmlMarkup - - VersionGenerator - - Iptable - - SortedCountry - - EmailValidator - - PhoneValidator - - FakeDeppContact - - Features::SessionHelpers - - CapybaraViewMacros - - Matchers::EPP::Code - - Requests::EPPHelpers - - Requests::SessionHelpers -NilCheck: - exclude: - - Admin::AccountActivitiesController#set_default_dates - - Admin::EppLogsController#set_default_dates - - Admin::ReppLogsController#set_default_dates - - ApplicationController#user_log_str - - EppController#requires - - ApplicationHelper#env_style - - Registrant::ApplicationHelper#env_style - - Registrar::ApplicationHelper#env_style - - UserEvents#cr_id - - Depp::Contact#handle_errors - - Directo#self.send_receipts - - DomainMailModel#format - - LegalDocument#val_body_length - - Soap::Arireg#body - - Soap::Arireg#country_code_3 - - Soap::Arireg#initialize - - ActionDispatch::Flash#call -TooManyStatements: - exclude: - - initialize - - Admin::AccountActivitiesController#index - - Admin::AdminUsersController#update - - Admin::BankTransactionsController#create - - Admin::Billing::PricesController#index - - Admin::CertificatesController#create - - Admin::ContactVersionsController#index - - Admin::ContactVersionsController#show - - Admin::ContactsController#index - - Admin::ContactsController#normalize_search_parameters - - Admin::DomainVersionsController#index - - Admin::DomainVersionsController#show - - Admin::DomainsController#index - - Admin::DomainsController#normalize_search_parameters - - Admin::DomainsController#update - - Admin::EppLogsController#index - - Admin::InvoicesController#create - - Admin::InvoicesController#forward - - Admin::RegistrarsController#create - - Admin::ReppLogsController#index - - Admin::SessionsController#create - - Admin::SettingsController#casted_settings - - Admin::SettingsController#create - - Admin::WhiteIpsController#create - - Epp::ContactsController#create - - Epp::ContactsController#update - - Epp::ContactsController#validate_create - - Epp::ContactsController#validate_update - - Epp::DomainsController#balance_ok? - - Epp::DomainsController#create - - Epp::DomainsController#delete - - Epp::DomainsController#info - - Epp::DomainsController#renew - - Epp::DomainsController#transfer - - Epp::DomainsController#update - - Epp::DomainsController#validate_create - - Epp::DomainsController#validate_transfer - - Epp::PollsController#req_poll - - Epp::SessionsController#login - - EppController#catch_epp_errors - - EppController#element_count - - EppController#handle_errors - - EppController#optional - - EppController#optional_attribute - - EppController#requires - - EppController#requires_attribute - - EppController#update_epp_session - - EppController#validate_request - - EppController#write_to_epp_log - - Registrant::DomainDeleteConfirmsController#update - - Registrant::DomainUpdateConfirmsController#update - - Registrant::DomainsController#domain_verification_url - - Registrant::DomainsController#domains - - Registrant::DomainsController#download_list - - Registrant::DomainsController#index - - Registrant::DomainsController#normalize_search_parameters - - Registrant::SessionsController#id - - Registrant::SessionsController#mid - - Registrant::SessionsController#mid_status - - Registrar::AccountActivitiesController#index - - Registrar::ContactsController#download_list - - Registrar::ContactsController#index - - Registrar::ContactsController#normalize_search_parameters - - Registrar::DepositsController#create - - Registrar::DomainsController#destroy - - Registrar::DomainsController#index - - Registrar::DomainsController#normalize_search_parameters - - Registrar::DomainsController#search_contacts - - Registrar::DomainsController#update - - Registrar::InvoicesController#forward - - Registrar::InvoicesController#index - - Registrar::InvoicesController#normalize_search_parameters - - Registrar::KeyrelaysController#create - - Registrar::PaymentsController#back - - Registrar::SessionsController#create - - Registrar::SessionsController#mid - - Registrar::SessionsController#mid_status - - ApplicationHelper#ident_for - - DomainDeleteConfirmJob#run - - DomainDeleteJob#run - - DomainUpdateConfirmJob#run - - UpdateWhoisRecordJob#run - - ApplicationMailer#whitelist_blocked? - - ContactMailer#email_updated - - DomainDeleteMailer#forced - - DomainExpireMailer#expired - - DomainMailer#compose_from - - DomainMailer#pending_delete_rejected_notification - - InvoiceMailer#invoice_email - - RegistrantChangeMailer#confirm - - RegistrantChangeMailer#notice - - Ability#admin - - Ability#epp - - AccountActivity#to_csv - - ApiUser#api_pki_ok? - - ApiUser#registrar_pki_ok? - - BankLink::Request#fields - - BankLink::Response#complete_payment - - BankStatement#import_th6_file - - BankTransaction#autobind_invoice - - BankTransaction#bind_invoice - - BusinessRegistryCache#fetch_by_ident_and_cc - - Certificate#parse_md_from_string - - Certificate#parse_metadata - - Certificate#revoke! - - Certificate#sign! - - Certificate#status - - Concerns::Domain::ForceDelete#cancel_force_delete - - Concerns::Domain::ForceDelete#schedule_force_delete - - EppErrors#add_epp_error - - EppErrors#collect_child_errors - - EppErrors#collect_parent_errors - - EppErrors#construct_epp_errors - - EppErrors#construct_msg_args_and_value - - EppErrors#find_epp_code_and_value - - UserEvents#cr_id - - Versions::ClassMethods#all_versions_for - - Contact#all_domains - - Contact#all_registrant_domains - - Contact#destroy_and_clean - - Contact#destroy_orphans - - Contact#domain_names_with_roles - - Contact#filter_by_states - - Contact#generate_code - - Contact#manage_emails - - Contact#related_domain_descriptions - - Contact#statuses - - Contact#validate_html - - Depp::Contact#construct_check_hash_from_data - - Depp::Contact#construct_create_disclosure_xml - - Depp::Contact#extension_xml - - Depp::Contact#extract_info_disclosure - - Depp::Contact#handle_errors - - Depp::Contact#save - - Depp::Contact#update_attributes - - Depp::Domain#construct_edit_hash - - Depp::Domain#construct_ext_edit_hash - - Depp::Domain#construct_params_from_server_data - - Depp::Domain#create - - Depp::Domain#create_dnskeys_hash - - Depp::Domain#create_nameservers_hash - - Depp::Domain#default_params - - Depp::Domain#transfer - - Depp::User#validate_existance_in_server - - Directo#self.send_monthly_invoices - - Directo#self.send_receipts - - DNS::Zone#self.generate_zonefile - - Dnskey#generate_digest - - Dnskey#generate_ds_key_tag - - Domain#children_log - - Domain#clean_pendings! - - Domain#clean_pendings_lowlevel - - Domain#manage_automatic_statuses - - Domain#name_in_wire_format - - Domain#pending_delete! - - Domain#pending_update! - - Domain#pricelist - - DomainCron#self.clean_expired_pendings - - DomainCron#self.destroy_delete_candidates - - DomainCron#self.start_expire_period - - DomainCron#self.start_redemption_grace_period - - DomainMailModel#domain_info - - Epp::Contact#add_legal_file_to_new - - Epp::Contact#attrs_from - - Epp::Contact#check_availability - - Epp::Contact#status_list_from - - Epp::Contact#statuses_attrs - - Epp::Contact#update_attributes - - Epp::Domain#add_legal_file_to_new - - Epp::Domain#apply_pending_delete! - - Epp::Domain#apply_pending_update! - - Epp::Domain#approve_transfer - - Epp::Domain#attrs_from - - Epp::Domain#check_availability - - Epp::Domain#destroy_attrs - - Epp::Domain#dnskeys_attrs - - Epp::Domain#domain_contact_attrs_from - - Epp::Domain#domain_status_list_from - - Epp::Domain#domain_statuses_attrs - - Epp::Domain#epp_destroy - - Epp::Domain#keyrelay - - Epp::Domain#manage_permissions - - Epp::Domain#nameservers_attrs - - Epp::Domain#nameservers_from - - Epp::Domain#new_from_epp - - Epp::Domain#query_transfer - - Epp::Domain#reject_transfer - - Epp::Domain#renew - - Epp::Domain#transfer - - Epp::Domain#update - - Epp::Domain#validate_contacts - - Invoice#cancel - - Invoice#cancel_overdue_invoices - - Invoice#set_invoice_number - - LegalDocument#save_to_filesystem - - LegalDocument#self.remove_duplicates - - RegistrantUser#find_or_create_by_idc_data - - Registrar#generate_iso_11649_reference_no - - Soap::Arireg#associated_businesses - - WhoisRecord#generate_json - - Registrar::DomainListCSVPresenter#domain_to_row - - DomainNameValidator#validate_format - - DomainNameserverValidator#validate_each - - DurationIso8601Validator#validate - - UniquenessMultiValidator#validate_each - - ActionDispatch::Flash#call - - Ransack::Adapters::ActiveRecord::Context#evaluate - - EppConstraint#matches? - - Iptable#counter_update - - fill_form -TooManyInstanceVariables: - exclude: - - Admin::BankStatementsController - - Admin::DomainsController - - Admin::MailTemplatesController - - Epp::ContactsController - - Epp::DomainsController - - EppController - - Registrar::DomainsController - - DomainDeleteMailer - - RegistrantChangeMailer -UtilityFunction: - exclude: - - Admin::Billing::PricesController#durations - - Admin::Billing::PricesController#operation_categories - - Admin::Billing::PricesController#statuses - - Admin::Billing::PricesController#zones - - ApplicationController#user_log_str - - Epp::ContactsController#address_processing? - - EppController#has_attribute - - Registrant::DomainsController#get_confirm_path - - Registrant::SessionsController#find_user_by_idc - - Registrar::ContactsController#address_processing? - - Registrar::PaymentsController#banks - - Registrar::SessionsController#find_user_by_idc - - ApplicationHelper#changing_css_class - - ApplicationHelper#ident_for - - ApplicationHelper#legal_document_types - - ApplicationHelper#plain_username - - ApplicationHelper#unstable_env - - DomainDeleteConfirmEmailJob#logger - - DomainExpireEmailJob#run - - RegenerateRegistrarWhoisesJob#run - - RegistrantChangeConfirmEmailJob#logger - - RegistrantChangeExpiredEmailJob#logger - - RegistrantChangeNoticeEmailJob#logger - - UpdateWhoisRecordJob#delete_domain - - UpdateWhoisRecordJob#delete_reserved - - UpdateWhoisRecordJob#update_domain - - UpdateWhoisRecordJob#update_reserved - - ApplicationMailer#format - - ContactMailer#address_processing - - RegistrantChangeMailer#address_processing - - EppErrors#construct_msg_args_and_value - - Versions#user_from_id_role_username - - Depp::Keyrelay#expiry - - Epp::Domain#nameservers_from - - Epp::Domain::DnsSecKeys#mark - - Epp::Domain::DnsSecKeys#xm_copy - - Invoice#pdf - - Soap::Arireg#extract - - Soap::Arireg#items - - Registrar::DomainListCSVPresenter#domain_to_row - - Rack::Request#trusted_proxy? - - PhoneValidator#zeros_only? - - Requests::EPPHelpers#have_code_of - - Requests::EPPHelpers#valid_legal_document -FeatureEnvy: - exclude: - - Admin::SettingsController#casted_settings - - ApplicationHelper#creator_link - - ApplicationHelper#updator_link - - FormHelper#legal_document_field - - FormHelper#money_field - - FormTagHelper#legal_document_field_tag - - DomainDeleteConfirmEmailJob#log - - DomainDeleteConfirmEmailJob#run - - DomainDeleteConfirmJob#raise_errors! - - DomainDeleteConfirmJob#run - - DomainDeleteJob#run - - DomainUpdateConfirmJob#raise_errors! - - DomainUpdateConfirmJob#run - - RegistrantChangeConfirmEmailJob#log - - RegistrantChangeConfirmEmailJob#run - - RegistrantChangeExpiredEmailJob#log - - RegistrantChangeExpiredEmailJob#run - - RegistrantChangeNoticeEmailJob#log - - RegistrantChangeNoticeEmailJob#run - - ApplicationMailer#whitelist_blocked? - - DomainExpireMailer#filter_invalid_emails - - AccountActivity#to_csv - - ApiUser#api_pki_ok? - - ApiUser#find_by_idc_data - - ApiUser#registrar_pki_ok? - - BankLink::Base#prepend_size - - BankLink::Request#fields - - BankStatement#parse_th6_row - - BusinessRegistryCache#fetch_by_ident_and_cc - - EppErrors#collect_parent_errors - - Contact#all_domains - - Contact#all_registrant_domains - - Contact#destroy_orphans - - Contact#domain_names_with_roles - - Contact#filter_by_states - - Contact#search_by_query - - Contact#statuses - - Depp::Contact#construct_check_hash_from_data - - Depp::Contact#find_by_id - - Depp::Contact#handle_errors - - Depp::Contact#new_from_params - - Depp::Domain#construct_params_from_server_data - - Depp::Domain#create - - Depp::Domain#create_dnskeys_hash - - Depp::Domain#renew - - Depp::Domain#transfer - - Depp::Keyrelay#keyrelay - - DomainMailModel#format - - Epp::Contact#attach_legal_document - - Epp::Contact#attrs_from - - Epp::Contact#check_availability - - Epp::Contact#ident_attrs - - Epp::Contact#status_list_from - - Epp::Domain#attach_legal_document - - Epp::Domain#attrs_from - - Epp::Domain#destroy_attrs - - Epp::Domain#domain_contact_attrs_from - - Epp::Domain#domain_status_list_from - - LegalDocument#calc_checksum - - Nameserver#find_by_hash_params - - RegistrantUser#find_or_create_by_idc_data - - RegistrantUser#find_or_create_by_mid_data - - Registrar#debit! - - Registrar#search_by_query - - ReservedDomain#new_password_for - - Soap::Arireg#country_code_3 - - WhoisRecord#generate_json - - RegistrantPresenter#domain_names_with_roles - - ActionDispatch::Flash#call - - Ransack::Adapters::ActiveRecord::Context#evaluate - - EppConstraint#matches? -TooManyMethods: - exclude: - - Epp::ContactsController - - Epp::DomainsController - - EppController - - Contact - - Depp::Contact - - Depp::Domain - - Domain - - DomainMailModel - - Epp::Domain - - Invoice - - Registrar -RepeatedConditional: - exclude: - - Epp::DomainsController - - EppController - - Registrar::DomainsController - - DomainMailer - - BankTransaction - - Certificate - - Contact - - Depp::Contact - - Domain - - DomainCron - - Epp::Domain - - Invoice - - RegistrantVerification -ManualDispatch: - exclude: - - EppController#has_attribute - - EppController#validate_request - - ActionView::Helpers::FormBuilder#label - - ActionDispatch::Flash#call - - Ransack::Adapters::ActiveRecord::Context#evaluate -NestedIterators: - exclude: - - Registrar::DomainsController#index - - AccountActivity#to_csv - - EppErrors#collect_child_errors - - EppErrors#find_epp_code_and_value - - Versions::ClassMethods#all_versions_for - - Contact#destroy_orphans - - Contact#to_csv - - Depp::Contact#extract_info_disclosure - - Depp::Domain#create_nameservers_hash - - Directo#self.send_monthly_invoices - - Directo#self.send_receipts - - Domain#name_in_wire_format - - Domain#self.to_csv - - Epp::Domain#nameservers_from - - LegalDocument#self.remove_duplicates - - RegistrantPresenter#domain_names_with_roles - - UniquenessMultiValidator#validate_each -UnusedParameters: - exclude: - - Registrar::PollsController#show#@data.css -PrimaDonnaMethod: - exclude: - - DomainDeleteConfirmJob - - DomainUpdateConfirmJob - - Certificate - - Contact - - Domain - - Epp::Domain - - RegistrantVerification - - Registrar -BooleanParameter: - exclude: - - ApplicationMailer#delivery_off? - - Directo#self.send_monthly_invoices - - Epp::Contact#attrs_from - - Epp::Domain#update -ControlParameter: - exclude: - - ApplicationMailer#delivery_off? - - Ability#initialize - - EppErrors#find_epp_code_and_value - - Depp::Contact#extension_xml - - Directo#self.send_monthly_invoices - - Domain#registrant_delete_confirmable? - - Domain#registrant_update_confirmable? - - Epp::Contact#attrs_from - - Epp::Contact#statuses_attrs - - Epp::Domain#authenticate - - Epp::Domain#dnskeys_attrs - - Epp::Domain#domain_contact_attrs_from - - Epp::Domain#domain_statuses_attrs - - Epp::Domain#nameservers_attrs - - Epp::Domain#transfer - - Epp::Domain#update - - Legacy::Object#self.instance_method_already_implemented? - - Legacy::ObjectHistory#self.instance_method_already_implemented? - - RegistrantUser#find_or_create_by_idc_data -LongParameterList: - exclude: - - ContactMailer#email_updated - - DomainDeleteMailer#forced - - RegistrantChangeMailer#confirm - - RegistrantChangeMailer#notice - - EppErrors#add_epp_error - - Contact#all_registrant_domains -DataClump: - exclude: - - DomainMailer - - Epp::Domain -Attribute: - exclude: - - ApiUser#registrar_typeahead - - BankLink::Request#controller - - BankLink::Request#invoice - - BankLink::Request#type - - BankLink::Response#invoice - - BankLink::Response#params - - BankLink::Response#type - - BankStatement#th6_file - - Versions#version_loader - - Contact#deliver_emails - - Contact#legal_document_id - - Counter#value - - Deposit#amount - - Deposit#description - - Deposit#registrar - - Deposit#registrar_id - - Depp::Contact#city - - Depp::Contact#code - - Depp::Contact#country_code - - Depp::Contact#email - - Depp::Contact#id - - Depp::Contact#ident - - Depp::Contact#ident_country_code - - Depp::Contact#ident_type - - Depp::Contact#legal_document - - Depp::Contact#name - - Depp::Contact#org_name - - Depp::Contact#password - - Depp::Contact#phone - - Depp::Contact#state - - Depp::Contact#statuses - - Depp::Contact#street - - Depp::Contact#zip - - Depp::Domain#current_user - - Depp::Domain#epp_xml - - Depp::Domain#name - - Depp::Keyrelay#current_user - - Depp::Keyrelay#epp_xml - - Depp::User#password - - Depp::User#pki - - Depp::User#tag - - Domain#deliver_emails - - Domain#epp_pending_delete - - Domain#epp_pending_update - - Domain#is_admin - - Domain#legal_document_id - - Domain#registrant_typeahead - - Domain#reserved_pw - - Domain#roles - - Domain#update_me - - DomainContact#value_typeahead - - Epp::Domain#is_renewal - - Epp::Domain#is_transfer - - Invoice#billing_email - - LegalDocument#body - - RegistrantUser#idc_data - - Soap::Arireg#host - - Soap::Arireg#password - - Soap::Arireg#username - - Soap::Arireg#wsdl - - Soap::Arireg::NotAvailableError#json - - User#phone - - PaperSession#session -TooManyConstants: - exclude: - - Certificate - - Contact - - DomainStatus - - DomainTransfer -UncommunicativeParameterName: - exclude: - - Counter#next - - Counter#prev - - Depp::Domain#array_difference - - Dnskey#bin_to_hex - - Dnskey#hex_to_bin - - Dnskey#int_to_hex -UncommunicativeMethodName: - exclude: - - Soap::Arireg#country_code_3 - - WhiteIp#validate_ipv4_and_ipv6 diff --git a/.rubocop.yml b/.rubocop.yml deleted file mode 100644 index 3d8fd0b90..000000000 --- a/.rubocop.yml +++ /dev/null @@ -1,4 +0,0 @@ -inherit_from: .rubocop_todo.yml - -Style/Alias: - EnforcedStyle: prefer_alias_method diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml deleted file mode 100644 index 7acf2bd1b..000000000 --- a/.rubocop_todo.yml +++ /dev/null @@ -1,1282 +0,0 @@ -# This configuration was generated by -# `rubocop --auto-gen-config` -# on 2017-08-23 18:09:30 +0300 using RuboCop version 0.49.1. -# The point is for the user to remove these configuration records -# one by one as the offenses are removed from the code base. -# Note that changes in the inspected code, or installation of new -# versions of RuboCop, may require this file to be generated again. - -# Offense count: 16 -# Cop supports --auto-correct. -# Configuration parameters: Include, TreatCommentsAsGroupSeparators. -# Include: **/Gemfile, **/gems.rb -Bundler/OrderedGems: - Exclude: - - 'Gemfile' - -Lint/UnneededDisable: - Enabled: false -Style/ConditionalAssignment: - Enabled: false - -# Offense count: 11 -# Cop supports --auto-correct. -Layout/AlignArray: - Exclude: - - 'app/models/bank_link.rb' - - 'db/migrate/20150110113257_add_json_based_versions.rb' - - 'db/migrate/20150129144652_add_creator_and_updater.rb' - - 'db/migrate/20150130191056_add_session_id_to_log.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedHashRocketStyle, SupportedHashRocketStyles, EnforcedColonStyle, SupportedColonStyles, EnforcedLastArgumentHashStyle, SupportedLastArgumentHashStyles. -# SupportedHashRocketStyles: key, separator, table -# SupportedColonStyles: key, separator, table -# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit -Layout/AlignHash: - Exclude: - - 'app/models/soap/arireg.rb' - -# Offense count: 16 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. -# SupportedStyles: with_first_parameter, with_fixed_indentation -Layout/AlignParameters: - Exclude: - - 'Gemfile' - - 'app/controllers/admin/admin_users_controller.rb' - - 'app/mailers/domain_mailer.rb' - - 'app/models/contact.rb' - - 'app/models/depp/contact.rb' - - 'app/models/depp/domain.rb' - - 'app/models/domain.rb' - - 'app/models/registrar.rb' - - 'spec/models/domain_spec.rb' - -# Offense count: 3 -# Cop supports --auto-correct. -Layout/BlockEndNewline: - Exclude: - - 'app/models/invoice.rb' - - 'spec/requests/epp/contact/info_spec.rb' - -# Offense count: 34 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, IndentOneStep, IndentationWidth. -# SupportedStyles: case, end -Layout/CaseIndentation: - Exclude: - - 'app/controllers/admin/contact_versions_controller.rb' - - 'app/controllers/admin/domain_versions_controller.rb' - - 'app/controllers/registrar/sessions_controller.rb' - - 'app/jobs/update_whois_record_job.rb' - - 'app/models/ability.rb' - - 'app/models/bank_link.rb' - - 'app/models/contact.rb' - - 'app/models/domain.rb' - - 'app/models/legal_document.rb' - - 'lib/tasks/db.rake' - - 'lib/tasks/documents.rake' - -# Offense count: 1 -# Cop supports --auto-correct. -Layout/ClosingParenthesisIndentation: - Exclude: - - 'app/presenters/domain_presenter.rb' - -# Offense count: 48 -# Cop supports --auto-correct. -Layout/CommentIndentation: - Enabled: false - -# Offense count: 8 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: leading, trailing -Layout/DotPosition: - Exclude: - - 'app/models/concerns/versions.rb' - - 'app/models/legal_document.rb' - -# Offense count: 2 -# Cop supports --auto-correct. -Layout/ElseAlignment: - Exclude: - - 'app/controllers/admin/domain_versions_controller.rb' - - 'app/helpers/application_helper.rb' - -# Offense count: 3 -# Cop supports --auto-correct. -Layout/EmptyLineAfterMagicComment: - Exclude: - - 'app/models/soap/arireg.rb' - - 'db/api_log_schema.rb' - - 'db/whois_schema.rb' - -# Offense count: 26 -# Cop supports --auto-correct. -# Configuration parameters: AllowAdjacentOneLineDefs, NumberOfEmptyLines. -Layout/EmptyLineBetweenDefs: - Enabled: false - -# Offense count: 64 -# Cop supports --auto-correct. -Layout/EmptyLines: - Enabled: false - -# Offense count: 3 -# Cop supports --auto-correct. -Layout/EmptyLinesAroundAccessModifier: - Exclude: - - 'app/controllers/epp/sessions_controller.rb' - - 'app/mailers/domain_mailer.rb' - - 'app/models/bank_link.rb' - -# Offense count: 31 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: empty_lines, no_empty_lines -Layout/EmptyLinesAroundBlockBody: - Enabled: false - -# Offense count: 20 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines -Layout/EmptyLinesAroundClassBody: - Enabled: false - -# Offense count: 1 -# Cop supports --auto-correct. -Layout/EmptyLinesAroundExceptionHandlingKeywords: - Exclude: - - 'app/models/depp/user.rb' - -# Offense count: 32 -# Cop supports --auto-correct. -Layout/EmptyLinesAroundMethodBody: - Enabled: false - -# Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines -Layout/EmptyLinesAroundModuleBody: - Exclude: - - 'app/models/concerns/user_events.rb' - - 'app/models/soap/arireg.rb' - -# Offense count: 39 -# Cop supports --auto-correct. -# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment. -Layout/ExtraSpacing: - Enabled: false - -# Offense count: 16 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. -# SupportedStyles: consistent, special_for_inner_method_call, special_for_inner_method_call_in_parentheses -Layout/FirstParameterIndentation: - Exclude: - - 'app/jobs/domain_delete_job.rb' - - 'app/models/bank_link.rb' - - 'app/models/contact.rb' - - 'app/models/depp/domain.rb' - - 'app/models/directo.rb' - - 'app/models/domain_cron.rb' - - 'app/models/epp/contact.rb' - - 'app/models/epp/domain.rb' - - 'lib/tasks/bootstrap.rake' - - 'lib/tasks/import.rake' - - 'spec/jobs/domain_delete_confirm_email_job_spec.rb' - - 'spec/jobs/domain_delete_forced_email_job_spec.rb' - - 'spec/jobs/domain_expire_email_job_spec.rb' - - 'spec/jobs/registrant_change_confirm_email_job_spec.rb' - -# Offense count: 56 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. -# SupportedStyles: special_inside_parentheses, consistent, align_brackets -Layout/IndentArray: - Enabled: false - -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: IndentationWidth. -Layout/IndentAssignment: - Exclude: - - 'app/models/epp/domain.rb' - -# Offense count: 81 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. -# SupportedStyles: special_inside_parentheses, consistent, align_braces -Layout/IndentHash: - Enabled: false - -# Offense count: 17 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: normal, rails -Layout/IndentationConsistency: - Exclude: - - 'app/models/bank_link.rb' - - 'lib/tasks/convert.rake' - -# Offense count: 18 -# Cop supports --auto-correct. -# Configuration parameters: Width, IgnoredPatterns. -Layout/IndentationWidth: - Exclude: - - 'app/controllers/admin/domain_versions_controller.rb' - - 'app/controllers/registrant/domains_controller.rb' - - 'app/helpers/application_helper.rb' - - 'app/models/ability.rb' - - 'app/models/contact.rb' - - 'app/models/domain.rb' - - 'app/models/legal_document.rb' - - 'app/views/epp/contacts/info.xml.builder' - - 'app/views/epp/contacts/save.xml.builder' - - 'db/migrate/20161004101419_adduuid_index_to_epp_logs.rb' - - 'lib/tasks/convert.rake' - -# Offense count: 12 -# Cop supports --auto-correct. -Layout/LeadingCommentSpace: - Exclude: - - 'app/models/directo.rb' - - 'app/models/domain_cron.rb' - - 'app/models/domain_status.rb' - - 'app/models/epp/domain.rb' - - 'app/models/registrant_user.rb' - - 'app/views/epp/domains/info.xml.builder' - - 'app/views/epp/sessions/greeting.xml.builder' - - 'db/migrate/20150407145943_add_invoice_columns.rb' - - 'db/migrate/20150413080832_create_bank_transactions.rb' - -# Offense count: 8 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: symmetrical, new_line, same_line -Layout/MultilineArrayBraceLayout: - Exclude: - - 'app/models/domain_mail_model.rb' - - 'app/models/epp/domain.rb' - - 'db/migrate/20150110113257_add_json_based_versions.rb' - - 'db/migrate/20150129144652_add_creator_and_updater.rb' - - 'db/migrate/20150130191056_add_session_id_to_log.rb' - -# Offense count: 80 -# Cop supports --auto-correct. -Layout/MultilineBlockLayout: - Enabled: false - -# Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: symmetrical, new_line, same_line -Layout/MultilineHashBraceLayout: - Exclude: - - 'app/models/depp/domain.rb' - - 'app/models/epp/domain.rb' - -# Offense count: 5 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: symmetrical, new_line, same_line -Layout/MultilineMethodCallBraceLayout: - Exclude: - - 'app/presenters/domain_presenter.rb' - - 'spec/jobs/domain_delete_confirm_email_job_spec.rb' - - 'spec/jobs/domain_delete_forced_email_job_spec.rb' - - 'spec/jobs/domain_expire_email_job_spec.rb' - - 'spec/jobs/registrant_change_confirm_email_job_spec.rb' - -# Offense count: 28 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. -# SupportedStyles: aligned, indented, indented_relative_to_receiver -Layout/MultilineMethodCallIndentation: - Enabled: false - -# Offense count: 7 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. -# SupportedStyles: aligned, indented -Layout/MultilineOperationIndentation: - Exclude: - - 'app/controllers/epp_controller.rb' - - 'app/controllers/registrant/domains_controller.rb' - - 'app/models/directo.rb' - - 'lib/tasks/convert.rake' - - 'lib/tasks/documents.rake' - -# Offense count: 4 -# Cop supports --auto-correct. -Layout/RescueEnsureAlignment: - Exclude: - - 'app/models/certificate.rb' - - 'app/models/depp/keyrelay.rb' - - 'app/models/depp/user.rb' - -# Offense count: 10 -# Cop supports --auto-correct. -Layout/SpaceAfterComma: - Exclude: - - 'app/api/repp/domain_v1.rb' - - 'app/controllers/epp_controller.rb' - - 'app/models/directo.rb' - - 'app/models/dnskey.rb' - - 'app/models/domain_mail_model.rb' - - 'app/views/epp/contacts/_disclosure_policy.xml.builder' - - 'app/views/epp/error.xml.builder' - -# Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyleInsidePipes, SupportedStylesInsidePipes. -# SupportedStylesInsidePipes: space, no_space -Layout/SpaceAroundBlockParameters: - Exclude: - - 'lib/tasks/convert.rake' - -# Offense count: 300 -# Cop supports --auto-correct. -# Configuration parameters: AllowForAlignment. -Layout/SpaceAroundOperators: - Enabled: false - -# Offense count: 36 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: space, no_space -Layout/SpaceBeforeBlockBraces: - Exclude: - - 'app/api/repp/domain_v1.rb' - - 'app/models/bank_link.rb' - - 'app/models/contact.rb' - - 'app/models/directo.rb' - - 'app/models/invoice.rb' - - 'app/models/legal_document.rb' - - 'app/models/soap/arireg.rb' - - 'app/models/whois_record.rb' - - 'app/views/epp/domains/info.xml.builder' - - 'config/routes.rb' - - 'lib/tasks/convert.rake' - - 'lib/tasks/import.rake' - -# Offense count: 1 -# Cop supports --auto-correct. -Layout/SpaceBeforeComment: - Exclude: - - 'app/models/contact.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: AllowForAlignment. -Layout/SpaceBeforeFirstArg: - Exclude: - - 'db/migrate/20150422092514_add_whois_body_to_registry.rb' - -# Offense count: 48 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SupportedStylesForEmptyBraces, SpaceBeforeBlockParameters. -# SupportedStyles: space, no_space -# SupportedStylesForEmptyBraces: space, no_space -Layout/SpaceInsideBlockBraces: - Exclude: - - 'app/api/repp/domain_v1.rb' - - 'app/models/bank_link.rb' - - 'app/models/contact.rb' - - 'app/models/dnskey.rb' - - 'app/models/invoice.rb' - - 'app/models/legal_document.rb' - - 'app/models/soap/arireg.rb' - - 'app/models/whois_record.rb' - - 'app/views/epp/domains/info.xml.builder' - - 'config/routes.rb' - - 'lib/epp_constraint.rb' - - 'lib/tasks/convert.rake' - - 'lib/tasks/import.rake' - -# Offense count: 3 -# Cop supports --auto-correct. -Layout/SpaceInsideBrackets: - Exclude: - - 'db/migrate/20140926121409_domain_related_archives.rb' - - 'db/migrate/20141015135255_create_settings.rb' - -# Offense count: 64 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SupportedStylesForEmptyBraces. -# SupportedStyles: space, no_space, compact -# SupportedStylesForEmptyBraces: space, no_space -Layout/SpaceInsideHashLiteralBraces: - Exclude: - - 'app/controllers/admin/domains_controller.rb' - - 'app/helpers/application_helper.rb' - - 'app/models/contact.rb' - - 'app/models/depp/domain.rb' - - 'app/models/directo.rb' - - 'app/models/domain_mail_model.rb' - - 'app/models/epp/contact.rb' - - 'app/models/epp/domain.rb' - - 'app/models/nameserver.rb' - - 'app/models/soap/arireg.rb' - - 'config/routes.rb' - - 'lib/tasks/import.rake' - -# Offense count: 3 -# Cop supports --auto-correct. -Layout/SpaceInsideParens: - Exclude: - - 'db/migrate/20160414110443_add_time_indexing_to_epp_log.rb' - - 'db/migrate/20161004101419_adduuid_index_to_epp_logs.rb' - -# Offense count: 8 -# Cop supports --auto-correct. -Layout/SpaceInsidePercentLiteralDelimiters: - Exclude: - - 'app/models/depp/contact.rb' - - 'config/initializers/assets.rb' - - 'lib/daemons/que.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: space, no_space -Layout/SpaceInsideStringInterpolation: - Exclude: - - 'app/models/soap/arireg.rb' - -# Offense count: 22 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: final_newline, final_blank_line -Layout/TrailingBlankLines: - Enabled: false - -# Offense count: 41 -# Cop supports --auto-correct. -Layout/TrailingWhitespace: - Enabled: false - -# Offense count: 18 -Lint/AmbiguousBlockAssociation: - Exclude: - - 'spec/models/dns/zone_spec.rb' - - 'spec/requests/epp/contact/delete/used_spec.rb' - - 'spec/requests/epp/domain/create/account_balance_spec.rb' - - 'spec/requests/epp/domain/create/optional_nameserver_spec.rb' - - 'spec/requests/epp/domain/create/price_spec.rb' - - 'spec/requests/epp/domain/create/required_nameserver_spec.rb' - - 'spec/requests/epp/domain/renew/expire_time_spec.rb' - - 'spec/requests/epp/domain/renew/price_spec.rb' - - 'spec/requests/epp/domain/update/registrant_change/same_as_current_spec.rb' - - 'spec/requests/epp/domain/update/registrant_change/verified_spec.rb' - -# Offense count: 6 -# Configuration parameters: AllowSafeAssignment. -Lint/AssignmentInCondition: - Exclude: - - 'app/models/epp/contact.rb' - - 'app/models/epp/domain.rb' - - 'bin/spring' - - 'lib/tasks/convert.rake' - -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyleAlignWith, SupportedStylesAlignWith. -# SupportedStylesAlignWith: either, start_of_block, start_of_line -Lint/BlockAlignment: - Exclude: - - 'lib/tasks/convert.rake' - -# Offense count: 3 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyleAlignWith, SupportedStylesAlignWith, AutoCorrect. -# SupportedStylesAlignWith: start_of_line, def -Lint/DefEndAlignment: - Exclude: - - 'app/models/epp/domain.rb' - - 'db/migrate/20161004101419_adduuid_index_to_epp_logs.rb' - -# Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyleAlignWith, SupportedStylesAlignWith, AutoCorrect. -# SupportedStylesAlignWith: keyword, variable, start_of_line -Lint/EndAlignment: - Exclude: - - 'app/jobs/update_whois_record_job.rb' - - 'app/models/contact.rb' - -# Offense count: 1 -Lint/HandleExceptions: - Exclude: - - 'bin/rspec' - -# Offense count: 1 -Lint/ImplicitStringConcatenation: - Exclude: - - 'spec/models/contact_spec.rb' - -# Offense count: 1 -Lint/NestedMethodDefinition: - Exclude: - - 'app/controllers/registrar/polls_controller.rb' - -# Offense count: 2 -Lint/NonLocalExitFromIterator: - Exclude: - - 'app/mailers/domain_mailer.rb' - - 'app/models/contact.rb' - -# Offense count: 2 -Lint/RandOne: - Exclude: - - 'lib/tasks/dev.rake' - -# Offense count: 1 -Lint/ShadowedException: - Exclude: - - 'app/mailers/contact_mailer.rb' - -# Offense count: 5 -# Cop supports --auto-correct. -Lint/StringConversionInInterpolation: - Exclude: - - 'app/controllers/admin/domain_versions_controller.rb' - - 'app/controllers/registrant/contacts_controller.rb' - - 'app/controllers/registrant/domains_controller.rb' - - 'app/models/domain_mail_model.rb' - -# Offense count: 3 -# Cop supports --auto-correct. -# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments. -Lint/UnusedBlockArgument: - Exclude: - - 'app/models/depp/domain.rb' - - 'lib/tasks/dev.rake' - -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods. -Lint/UnusedMethodArgument: - Exclude: - - 'app/controllers/registrar/polls_controller.rb' - -# Offense count: 6 -Lint/UselessAssignment: - Exclude: - - 'app/controllers/epp/domains_controller.rb' - - 'lib/tasks/import.rake' - - 'spec/jobs/domain_update_confirm_job_spec.rb' - - 'spec/models/legal_document_spec.rb' - -# Offense count: 104 -Lint/Void: - Enabled: false - -# Offense count: 155 -Metrics/AbcSize: - Max: 155 - -# Offense count: 215 -# Configuration parameters: CountComments, ExcludedMethods. -Metrics/BlockLength: - Max: 618 - -# Offense count: 3 -# Configuration parameters: CountBlocks. -Metrics/BlockNesting: - Max: 4 - -# Offense count: 32 -# Configuration parameters: CountComments. -Metrics/ClassLength: - Max: 5794 - -# Offense count: 22 -Metrics/CyclomaticComplexity: - Max: 23 - -# Offense count: 1337 -# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. -# URISchemes: http, https -Metrics/LineLength: - Max: 7122 - -# Offense count: 179 -# Configuration parameters: CountComments. -Metrics/MethodLength: - Max: 5789 - -# Offense count: 1 -# Configuration parameters: CountKeywordArgs. -Metrics/ParameterLists: - Max: 6 - -# Offense count: 18 -Metrics/PerceivedComplexity: - Max: 25 - -# Offense count: 2 -# Cop supports --auto-correct. -Performance/Casecmp: - Exclude: - - 'app/models/epp/domain.rb' - -# Offense count: 7 -# Cop supports --auto-correct. -Performance/RedundantMatch: - Exclude: - - 'app/controllers/epp_controller.rb' - - 'app/models/certificate.rb' - - 'lib/devise_custom_failure.rb' - -# Offense count: 6 -# Cop supports --auto-correct. -# Configuration parameters: MaxKeyValuePairs. -Performance/RedundantMerge: - Exclude: - - 'app/models/epp/contact.rb' - -# Offense count: 2 -# Cop supports --auto-correct. -Performance/Sample: - Exclude: - - 'lib/tasks/import.rake' - -# Offense count: 5 -# Cop supports --auto-correct. -Performance/StringReplacement: - Exclude: - - 'app/controllers/registrar/invoices_controller.rb' - - 'app/models/directo.rb' - - 'app/models/dnskey.rb' - -# Offense count: 4 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: prefer_alias, prefer_alias_method -Style/Alias: - Exclude: - - 'app/models/blocked_domain.rb' - - 'app/models/reserved_domain.rb' - - 'config/initializers/autolabel.rb' - - 'config/initializers/relaxed_i18n.rb' - -# Offense count: 32 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: always, conditionals -Style/AndOr: - Exclude: - - 'app/controllers/admin/domains_controller.rb' - - 'app/controllers/epp/domains_controller.rb' - - 'app/controllers/epp/keyrelays_controller.rb' - - 'app/controllers/epp/polls_controller.rb' - - 'app/controllers/epp/sessions_controller.rb' - - 'app/controllers/epp_controller.rb' - - 'app/controllers/registrar/base_controller.rb' - - 'app/controllers/registrar/dashboard_controller.rb' - - 'app/controllers/registrar/depp_controller.rb' - - 'app/controllers/registrar/domains_controller.rb' - - 'app/controllers/registrar/sessions_controller.rb' - - 'app/models/business_registry_cache.rb' - - 'app/models/domain_cron.rb' - - 'app/models/domain_mail_model.rb' - - 'app/models/epp/domain.rb' - -# Offense count: 2 -Style/AsciiComments: - Exclude: - - 'app/validators/domain_name_validator.rb' - - 'config/initializers/money.rb' - -# Offense count: 4 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: percent_q, bare_percent -Style/BarePercentLiterals: - Exclude: - - 'app/models/contact.rb' - - 'app/models/invoice.rb' - -# Offense count: 3 -# Cop supports --auto-correct. -Style/BlockComments: - Exclude: - - 'app/models/business_registry_cache.rb' - - 'app/models/soap/arireg.rb' - - 'spec/spec_helper.rb' - -# Offense count: 83 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, ProceduralMethods, FunctionalMethods, IgnoredMethods. -# SupportedStyles: line_count_based, semantic, braces_for_chaining -# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object -# FunctionalMethods: let, let!, subject, watch -# IgnoredMethods: lambda, proc, it -Style/BlockDelimiters: - Enabled: false - -# Offense count: 72 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: braces, no_braces, context_dependent -Style/BracesAroundHashParameters: - Enabled: false - -# Offense count: 54 -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: nested, compact -Style/ClassAndModuleChildren: - Enabled: false - -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: is_a?, kind_of? -Style/ClassCheck: - Exclude: - - 'app/views/epp/error.xml.builder' - -# Offense count: 3 -# Cop supports --auto-correct. -Style/ColonMethodCall: - Exclude: - - 'app/controllers/admin/billing/prices_controller.rb' - - 'lib/validators/email_validator.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerBackticks. -# SupportedStyles: backticks, percent_x, mixed -Style/CommandLiteral: - Exclude: - - 'config/initializers/pdfkit.rb' - -# Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: Keywords. -# Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW -Style/CommentAnnotation: - Exclude: - - 'app/models/contact.rb' - - 'app/views/epp/domains/info.xml.builder' - -# Offense count: 467 -Style/Documentation: - Enabled: false - -# Offense count: 2 -Style/DoubleNegation: - Exclude: - - 'app/models/bank_link.rb' - - 'app/models/setting.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -Style/EmptyLiteral: - Exclude: - - 'app/models/legal_document.rb' - -# Offense count: 8 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: compact, expanded -Style/EmptyMethod: - Exclude: - - 'app/controllers/admin/billing/prices_controller.rb' - - 'app/controllers/admin/contacts_controller.rb' - - 'app/controllers/admin/reserved_domains_controller.rb' - - 'app/controllers/registrant/sessions_controller.rb' - - 'app/controllers/registrar/invoices_controller.rb' - - 'app/controllers/registrar/xml_consoles_controller.rb' - - 'db/migrate/20151202123506_name_and_password_for_reserved_domain.rb' - - 'db/migrate/20160108135436_name_and_password_for_blocked_domain.rb' - -# Offense count: 3 -# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms. -# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS -Style/FileName: - Exclude: - - 'config/deploy-example.rb' - - 'config/environments/development-example.rb' - - 'config/environments/staging-example.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: format, sprintf, percent -Style/FormatString: - Exclude: - - 'app/models/bank_link.rb' - -# Offense count: 13 -# Configuration parameters: MinBodyLength. -Style/GuardClause: - Exclude: - - 'app/controllers/admin/account_activities_controller.rb' - - 'app/controllers/admin/epp_logs_controller.rb' - - 'app/controllers/admin/repp_logs_controller.rb' - - 'app/controllers/registrant/whois_controller.rb' - - 'app/models/bank_link.rb' - - 'app/models/contact.rb' - - 'app/models/epp/contact.rb' - - 'app/models/epp/domain.rb' - - 'app/models/invoice.rb' - - 'app/models/keyrelay.rb' - - 'lib/validators/phone_validator.rb' - -# Offense count: 40 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. -# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys -Style/HashSyntax: - Exclude: - - 'Gemfile' - - 'app/models/bank_link.rb' - - 'app/models/domain.rb' - - 'config/routes.rb' - - 'db/migrate/20140926081324_create_versions.rb' - - 'db/migrate/20140926082627_contact_and_version_archiving.rb' - - 'db/migrate/20140926121409_domain_related_archives.rb' - - 'db/migrate/20141015135255_create_settings.rb' - - 'db/migrate/20141111105931_create_delayed_jobs.rb' - - 'db/migrate/20141127091027_remove_defaults_from_disclosure.rb' - - 'db/migrate/20150122091556_create_version_associations.rb' - - 'db/migrate/20150611124920_add_que.rb' - - 'lib/tasks/convert.rake' - -# Offense count: 8 -Style/IdenticalConditionalBranches: - Exclude: - - 'app/controllers/admin/blocked_domains_controller.rb' - - 'app/controllers/admin/reserved_domains_controller.rb' - - 'lib/tasks/import.rake' - -# Offense count: 5 -# Cop supports --auto-correct. -# Configuration parameters: MaxLineLength. -Style/IfUnlessModifier: - Exclude: - - 'app/controllers/admin/account_activities_controller.rb' - - 'app/controllers/admin/billing/prices_controller.rb' - - 'app/models/invoice.rb' - - 'config/initializers/pdfkit.rb' - - 'lib/tasks/import.rake' - -# Offense count: 1 -Style/IfUnlessModifierOfIfUnless: - Exclude: - - 'app/models/epp/domain.rb' - -# Offense count: 5 -# Cop supports --auto-correct. -# Configuration parameters: InverseMethods, InverseBlocks. -Style/InverseMethods: - Exclude: - - 'app/controllers/admin/domains_controller.rb' - - 'app/models/contact.rb' - - 'app/models/domain.rb' - - 'app/models/epp/domain.rb' - -# Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: line_count_dependent, lambda, literal -Style/Lambda: - Exclude: - - 'app/models/invoice.rb' - -# Offense count: 17 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: require_parentheses, require_no_parentheses, require_no_parentheses_except_multiline -Style/MethodDefParentheses: - Exclude: - - 'app/models/blocked_domain.rb' - - 'app/models/contact.rb' - - 'app/models/counter.rb' - - 'app/models/directo.rb' - - 'app/models/epp/contact.rb' - - 'app/models/epp/domain.rb' - - 'app/models/nameserver.rb' - - 'app/models/reserved_domain.rb' - - 'config/initializers/array.rb' - -# Offense count: 1 -Style/MethodMissing: - Exclude: - - 'app/models/counter.rb' - -# Offense count: 18 -# Cop supports --auto-correct. -Style/MultilineIfModifier: - Exclude: - - 'Gemfile' - - 'app/controllers/admin/bank_statements_controller.rb' - - 'app/controllers/admin/billing/prices_controller.rb' - - 'app/controllers/epp_controller.rb' - - 'app/models/concerns/epp_errors.rb' - - 'app/models/depp/domain.rb' - - 'app/models/epp/domain.rb' - - 'app/views/epp/domains/info.xml.builder' - - 'app/views/epp/error.xml.builder' - - 'app/views/epp/poll/poll_req.xml.builder' - - 'config/schedule.rb' - - 'lib/tasks/import.rake' - -# Offense count: 1 -# Cop supports --auto-correct. -Style/MultilineIfThen: - Exclude: - - 'config/initializers/pdfkit.rb' - -# Offense count: 3 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: keyword, braces -Style/MultilineMemoization: - Exclude: - - 'app/models/bank_link.rb' - -# Offense count: 102 -# Cop supports --auto-correct. -Style/MutableConstant: - Enabled: false - -# Offense count: 7 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: both, prefix, postfix -Style/NegatedIf: - Exclude: - - 'app/controllers/admin/account_activities_controller.rb' - - 'app/controllers/admin/epp_logs_controller.rb' - - 'app/controllers/admin/repp_logs_controller.rb' - - 'app/models/contact.rb' - - 'app/models/depp/domain.rb' - - 'app/models/domain.rb' - - 'app/models/legal_document.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -Style/NestedParenthesizedCalls: - Exclude: - - 'app/models/epp/domain.rb' - -# Offense count: 6 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, MinBodyLength, SupportedStyles. -# SupportedStyles: skip_modifier_ifs, always -Style/Next: - Exclude: - - 'app/controllers/epp_controller.rb' - - 'app/models/domain.rb' - - 'app/models/domain_cron.rb' - - 'app/models/legal_document.rb' - - 'lib/tasks/import.rake' - -# Offense count: 15 -# Cop supports --auto-correct. -Style/NilComparison: - Exclude: - - 'spec/models/contact_spec.rb' - - 'spec/models/domain_contact_spec.rb' - - 'spec/models/domain_spec.rb' - - 'spec/models/legal_document_spec.rb' - - 'spec/models/registrar_spec.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedOctalStyle, SupportedOctalStyles. -# SupportedOctalStyles: zero_with_o, zero_only -Style/NumericLiteralPrefix: - Exclude: - - 'app/models/legal_document.rb' - -# Offense count: 40 -# Cop supports --auto-correct. -# Configuration parameters: Strict. -Style/NumericLiterals: - MinDigits: 15 - -# Offense count: 14 -# Cop supports --auto-correct. -# Configuration parameters: AutoCorrect, EnforcedStyle, SupportedStyles. -# SupportedStyles: predicate, comparison -Style/NumericPredicate: - Exclude: - - 'spec/**/*' - - 'app/controllers/admin/domains_controller.rb' - - 'app/controllers/epp/domains_controller.rb' - - 'app/controllers/registrar/domains_controller.rb' - - 'app/models/bank_statement.rb' - - 'app/models/domain_transfer.rb' - - 'app/models/epp/domain.rb' - - 'app/models/legal_document.rb' - - 'db/migrate/20150429135339_add_missing_data.rb' - - 'lib/tasks/convert.rake' - - 'lib/tasks/import.rake' - -# Offense count: 12 -# Cop supports --auto-correct. -Style/ParallelAssignment: - Exclude: - - 'app/controllers/epp_controller.rb' - - 'app/controllers/registrant/sessions_controller.rb' - - 'app/models/bank_link.rb' - - 'app/models/nameserver.rb' - - 'app/validators/domain_nameserver_validator.rb' - - 'app/validators/object_count_validator.rb' - - 'lib/tasks/import.rake' - - 'spec/models/domain_cron_spec.rb' - - 'spec/models/domain_spec.rb' - -# Offense count: 79 -# Cop supports --auto-correct. -# Configuration parameters: PreferredDelimiters. -Style/PercentLiteralDelimiters: - Enabled: false - -# Offense count: 2 -# Cop supports --auto-correct. -Style/PerlBackrefs: - Exclude: - - 'app/models/concerns/versions.rb' - -# Offense count: 3 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: short, verbose -Style/PreferredHashMethods: - Exclude: - - 'app/models/directo.rb' - -# Offense count: 2 -# Cop supports --auto-correct. -Style/Proc: - Exclude: - - 'app/models/billing/price.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: compact, exploded -Style/RaiseArgs: - Exclude: - - 'app/controllers/registrar/payments_controller.rb' - -# Offense count: 2 -# Cop supports --auto-correct. -Style/RedundantBegin: - Exclude: - - 'app/controllers/registrant/contacts_controller.rb' - - 'app/models/soap/arireg.rb' - -# Offense count: 3 -# Cop supports --auto-correct. -Style/RedundantParentheses: - Exclude: - - 'app/models/invoice.rb' - - 'lib/tasks/convert.rake' - -# Offense count: 3 -# Cop supports --auto-correct. -# Configuration parameters: AllowMultipleReturnValues. -Style/RedundantReturn: - Exclude: - - 'app/models/keyrelay.rb' - - 'app/models/setting.rb' - -# Offense count: 20 -# Cop supports --auto-correct. -Style/RedundantSelf: - Exclude: - - 'app/models/blocked_domain.rb' - - 'app/models/concerns/user_events.rb' - - 'app/models/contact.rb' - - 'app/models/dnskey.rb' - - 'app/models/domain.rb' - - 'app/models/epp/domain.rb' - - 'app/models/reserved_domain.rb' - - 'app/models/user.rb' - - 'lib/ext/xml_builder.rb' - -# Offense count: 15 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes. -# SupportedStyles: slashes, percent_r, mixed -Style/RegexpLiteral: - Exclude: - - 'app/controllers/application_controller.rb' - - 'app/controllers/epp_controller.rb' - - 'app/models/certificate.rb' - - 'app/models/registrant_user.rb' - - 'config/initializers/filter_parameter_logging.rb' - - 'config/routes.rb' - - 'db/data/20150601083516_add_cert_common_name.rb' - - 'db/data/20150601083800_add_cert_md5.rb' - -# Offense count: 3 -# Cop supports --auto-correct. -Style/RescueModifier: - Exclude: - - 'app/models/epp/contact.rb' - - 'app/models/legal_document.rb' - - 'app/models/whois_record.rb' - -# Offense count: 16 -# Cop supports --auto-correct. -# Configuration parameters: AllowAsExpressionSeparator. -Style/Semicolon: - Exclude: - - 'app/controllers/registrant/whois_controller.rb' - - 'app/controllers/registrar/invoices_controller.rb' - - 'app/controllers/registrar/polls_controller.rb' - - 'app/models/domain.rb' - - 'spec/requests/admin/billing/prices/expire_spec.rb' - - 'spec/requests/epp/domain/renew/expire_time_spec.rb' - - 'spec/requests/epp/domain/renew/price_spec.rb' - - 'spec/requests/epp/domain/update/registrant_change/same_as_current_spec.rb' - - 'spec/requests/epp/domain/update/registrant_change/verified_spec.rb' - -# Offense count: 3 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: only_raise, only_fail, semantic -Style/SignalException: - Exclude: - - 'app/controllers/epp/contacts_controller.rb' - - 'app/controllers/epp/domains_controller.rb' - -# Offense count: 1199 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline. -# SupportedStyles: single_quotes, double_quotes -Style/StringLiterals: - Enabled: false - -# Offense count: 4 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: single_quotes, double_quotes -Style/StringLiteralsInInterpolation: - Exclude: - - 'app/models/contact.rb' - - 'app/models/directo.rb' - -# Offense count: 110 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, MinSize, SupportedStyles. -# SupportedStyles: percent, brackets -Style/SymbolArray: - Enabled: false - -# Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: IgnoredMethods. -# IgnoredMethods: respond_to, define_method -Style/SymbolProc: - Exclude: - - 'lib/epp_constraint.rb' - - 'lib/tasks/dev.rake' - -# Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, AllowSafeAssignment. -# SupportedStyles: require_parentheses, require_no_parentheses, require_parentheses_when_complex -Style/TernaryParentheses: - Exclude: - - 'app/controllers/epp/domains_controller.rb' - - 'app/models/epp/domain.rb' - -# Offense count: 14 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyleForMultiline, SupportedStylesForMultiline. -# SupportedStylesForMultiline: comma, consistent_comma, no_comma -Style/TrailingCommaInLiteral: - Exclude: - - 'app/controllers/epp/contacts_controller.rb' - - 'app/models/billing/price.rb' - - 'app/models/depp/contact.rb' - - 'app/models/depp/domain.rb' - - 'app/models/directo.rb' - - 'app/models/epp/domain.rb' - - 'app/presenters/domain_presenter.rb' - - 'lib/tasks/dev.rake' - - 'lib/tasks/import.rake' - - 'spec/models/billing/price_spec.rb' - - 'spec/presenters/domain_presenter_spec.rb' - -# Offense count: 9 -# Cop supports --auto-correct. -Style/UnneededInterpolation: - Exclude: - - 'app/controllers/registrant/sessions_controller.rb' - - 'app/controllers/registrar/sessions_controller.rb' - - 'app/models/soap/arireg.rb' - - 'lib/epp_constraint.rb' - - 'spec/models/contact_spec.rb' - -# Offense count: 4 -# Cop supports --auto-correct. -Style/UnneededPercentQ: - Exclude: - - 'app/models/contact.rb' - - 'app/models/invoice.rb' - -# Offense count: 15 -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: snake_case, camelCase -Style/VariableName: - Exclude: - - 'app/controllers/admin/contact_versions_controller.rb' - - 'app/controllers/admin/domain_versions_controller.rb' - - 'app/views/epp/contacts/info.xml.builder' - - 'app/views/epp/domains/info.xml.builder' - -# Offense count: 5 -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: snake_case, normalcase, non_integer -Style/VariableNumber: - Exclude: - - 'spec/models/contact_spec.rb' - - 'spec/models/nameserver_spec.rb' - -# Offense count: 59 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, MinSize, WordRegex. -# SupportedStyles: percent, brackets -Style/WordArray: - Exclude: - - 'app/controllers/admin/account_activities_controller.rb' - - 'app/controllers/admin/epp_logs_controller.rb' - - 'app/controllers/admin/repp_logs_controller.rb' - - 'app/controllers/epp_controller.rb' - - 'app/models/contact.rb' - - 'app/models/depp/contact.rb' - - 'db/migrate/20150417082723_create_versions_for_billing.rb' - - 'db/migrate/20150603141549_add_decimal_type.rb' - - 'db/migrate/20150701074344_create_blocked_domains.rb' - - 'lib/sorted_country.rb' - - 'lib/tasks/import.rake' - - 'lib/tasks/statuses.rake' - - 'spec/models/concerns/domain/force_delete_spec.rb' - - 'spec/models/contact_spec.rb' - - 'spec/models/domain_spec.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -Style/YodaCondition: - Exclude: - - 'lib/tasks/import.rake' - -# Offense count: 1 -# Cop supports --auto-correct. -Style/ZeroLengthPredicate: - Exclude: - - 'app/controllers/epp/contacts_controller.rb' diff --git a/.ruby-version b/.ruby-version index 5bc1cc43d..00355e29d 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.2.7 +2.3.7 diff --git a/CHANGELOG.md b/CHANGELOG.md index 66e29f9f7..8fe8f891a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,31 @@ +25.05.2018 +* GDPR: updated whois templates with configurable disclaimer [#795](https://github.com/internetee/registry/issues/795) +* GDPR: email forwarding solution to contact private domain registrants without revealing their email addresses [#824](https://github.com/internetee/registry/issues/824) +* EPP: added support for additional digitally signed doc formats like asice, sce, asics, scs, edoc, adoc [#840](https://github.com/internetee/registry/issues/840) +* Registrar: removed handling of newlines from contact form street field [#836](https://github.com/internetee/registry/issues/836) +* Ruby upgrade to version 2.3.7 [#546](https://github.com/internetee/registry/issues/546) +* Devise upgrade to version 4.4.3 [#847](https://github.com/internetee/registry/pull/847) +* Added extra logging to debug Directo integration [#848](https://github.com/internetee/registry/pull/848) + +30.04.2018 +* Upgrade Ruby on Rails to version 4.2.10 [#826](https://github.com/internetee/registry/issues/826) +* BUG: Admin - fixed internal error in domain_versions and contact_versions views caused by removed db column [#830](https://github.com/internetee/registry/issues/830) + +23.04.2018 +* WHOIS: domains with deleteCandidate status do not return registration details as domains waiting to be deleted [#789](https://github.com/internetee/registry/issues/789) +* Security: Nokigiri gem update to version 1.8.2 [#823](https://github.com/internetee/registry/pull/823) +* Bug: fixed missing translation error in admin mail templates page [#818](https://github.com/internetee/registry/pull/818) +* Admin: VAT percentage info to registrar profile for setting tax rate for foreign non vat liable registrars [#623](https://github.com/internetee/registry/issues/623) +* Admin: deleteCandidate status is now stressed in domain details view [#792](https://github.com/internetee/registry/issues/792) +* Removed invoice_type from invoice db data as unused [#772](https://github.com/internetee/registry/issues/772) +* Removed valid_from from domain db data as duplicated and unused [#787](https://github.com/internetee/registry/issues/787) +* Set Not null constraint to valid_ti domain db data [#800](https://github.com/internetee/registry/issues/800) +* Removed unused methods [#797](https://github.com/internetee/registry/issues/797) +* Removed unused cron tasks [#782](https://github.com/internetee/registry/issues/782) +* Removed some monkey-patching for flash message logging [#231](https://github.com/internetee/registry/issues/231) +* Added Docker container support for dev and test environments [#821](https://github.com/internetee/registry/issues/821) +* Fix for Travis CI random test failures [#809](https://github.com/internetee/registry/pull/809) + 03.04.2018 * BUG: Fixed bug with sometimes failing bank-link payments [#642](https://github.com/internetee/registry/issues/642) * EPP: Domain and associated objects are now validated on domain renew [#678](https://github.com/internetee/registry/issues/678) diff --git a/Dockerfile b/Dockerfile index 0c2c51e25..480231fc2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.2 +FROM ruby:2.3 MAINTAINER maciej.szlosarczyk@internet.ee RUN apt-get update > /dev/null && apt-get install -y > /dev/null \ diff --git a/Gemfile b/Gemfile index 9b6f97dad..0af80fddf 100644 --- a/Gemfile +++ b/Gemfile @@ -11,7 +11,7 @@ source 'https://rubygems.org' gem 'SyslogLogger', '2.0', require: 'syslog/logger' gem 'iso8601', '0.8.6' # for dates and times -gem 'rails', '4.2.7.1' # when update, all initializers eis_custom files needs check/update +gem 'rails', '4.2.10' # when update, all initializers eis_custom files needs check/update gem 'rest-client' # load env @@ -52,7 +52,7 @@ gem 'liquid', '3.0.6' # for email templates # rights gem 'cancancan', '1.11.0' # autharization -gem 'devise', '3.5.4' # authenitcation +gem 'devise', '4.4.3' # authenitcation # rest api gem 'grape', '0.12.0' diff --git a/Gemfile.lock b/Gemfile.lock index efa504d8e..b12b28a2d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -60,43 +60,42 @@ GEM remote: https://rubygems.org/ specs: SyslogLogger (2.0) - actionmailer (4.2.7.1) - actionpack (= 4.2.7.1) - actionview (= 4.2.7.1) - activejob (= 4.2.7.1) + actionmailer (4.2.10) + actionpack (= 4.2.10) + actionview (= 4.2.10) + activejob (= 4.2.10) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.7.1) - actionview (= 4.2.7.1) - activesupport (= 4.2.7.1) + actionpack (4.2.10) + actionview (= 4.2.10) + activesupport (= 4.2.10) rack (~> 1.6) rack-test (~> 0.6.2) rails-dom-testing (~> 1.0, >= 1.0.5) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (4.2.7.1) - activesupport (= 4.2.7.1) + actionview (4.2.10) + activesupport (= 4.2.10) builder (~> 3.1) erubis (~> 2.7.0) rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.2) + rails-html-sanitizer (~> 1.0, >= 1.0.3) active_model-errors_details (1.3.1) activemodel (>= 3.2.13, < 5.0.0) activesupport - activejob (4.2.7.1) - activesupport (= 4.2.7.1) + activejob (4.2.10) + activesupport (= 4.2.10) globalid (>= 0.3.0) - activemodel (4.2.7.1) - activesupport (= 4.2.7.1) + activemodel (4.2.10) + activesupport (= 4.2.10) builder (~> 3.1) - activerecord (4.2.7.1) - activemodel (= 4.2.7.1) - activesupport (= 4.2.7.1) + activerecord (4.2.10) + activemodel (= 4.2.10) + activesupport (= 4.2.10) arel (~> 6.0) activerecord-import (0.7.0) activerecord (>= 3.0) - activesupport (4.2.7.1) + activesupport (4.2.10) i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) @@ -160,7 +159,7 @@ GEM unicode_utils (~> 1.4) crack (0.4.3) safe_yaml (~> 1.0.0) - crass (1.0.3) + crass (1.0.4) daemons (1.2.4) daemons-rails (1.2.1) daemons @@ -168,12 +167,11 @@ GEM database_cleaner (1.6.1) descendants_tracker (0.0.4) thread_safe (~> 0.3, >= 0.3.1) - devise (3.5.4) + devise (4.4.3) bcrypt (~> 3.0) orm_adapter (~> 0.1) - railties (>= 3.2.6, < 5) + railties (>= 4.1.0, < 6.0) responders - thread_safe (~> 0.1) warden (~> 1.2.3) diff-lcs (1.3) docile (1.1.5) @@ -189,8 +187,8 @@ GEM railties (>= 3.0.0) figaro (1.1.1) thor (~> 0.14) - globalid (0.3.7) - activesupport (>= 4.1.0) + globalid (0.4.1) + activesupport (>= 4.2.0) grape (0.12.0) activesupport builder @@ -228,7 +226,7 @@ GEM httpi (2.4.2) rack socksify - i18n (0.8.4) + i18n (0.8.6) i18n_data (0.7.0) ice_nine (0.11.2) isikukood (0.1.2) @@ -251,8 +249,8 @@ GEM loofah (2.2.2) crass (~> 1.0.2) nokogiri (>= 1.5.9) - mail (2.6.6) - mime-types (>= 1.16, < 4) + mail (2.7.0) + mini_mime (>= 0.1.1) method_source (0.8.2) mime-types (3.1) mime-types-data (~> 3.2015) @@ -260,8 +258,9 @@ GEM mina (0.3.1) open4 (~> 1.3.4) rake + mini_mime (1.0.0) mini_portile2 (2.3.0) - minitest (5.10.3) + minitest (5.11.3) monetize (1.6.0) money (~> 6.8) money (6.8.3) @@ -313,35 +312,35 @@ GEM rack-test (0.6.3) rack (>= 1.0) railroady (1.3.0) - rails (4.2.7.1) - actionmailer (= 4.2.7.1) - actionpack (= 4.2.7.1) - actionview (= 4.2.7.1) - activejob (= 4.2.7.1) - activemodel (= 4.2.7.1) - activerecord (= 4.2.7.1) - activesupport (= 4.2.7.1) + rails (4.2.10) + actionmailer (= 4.2.10) + actionpack (= 4.2.10) + actionview (= 4.2.10) + activejob (= 4.2.10) + activemodel (= 4.2.10) + activerecord (= 4.2.10) + activesupport (= 4.2.10) bundler (>= 1.3.0, < 2.0) - railties (= 4.2.7.1) + railties (= 4.2.10) sprockets-rails rails-deprecated_sanitizer (1.0.3) activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.8) - activesupport (>= 4.2.0.beta, < 5.0) + rails-dom-testing (1.0.9) + activesupport (>= 4.2.0, < 5.0) nokogiri (~> 1.6) rails-deprecated_sanitizer (>= 1.0.1) - rails-html-sanitizer (1.0.3) - loofah (~> 2.0) + rails-html-sanitizer (1.0.4) + loofah (~> 2.2, >= 2.2.2) rails-settings-cached (0.4.1) rails (>= 4.0.0) - railties (4.2.7.1) - actionpack (= 4.2.7.1) - activesupport (= 4.2.7.1) + railties (4.2.10) + actionpack (= 4.2.10) + activesupport (= 4.2.10) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rainbow (2.2.2) rake - rake (12.0.0) + rake (12.3.1) ransack (1.5.1) actionpack (>= 3.0) activerecord (>= 3.0) @@ -350,8 +349,9 @@ GEM polyamorous (~> 1.1) rdoc (4.3.0) request_store (1.1.0) - responders (2.3.0) - railties (>= 4.2.0, < 5.1) + responders (2.4.0) + actionpack (>= 4.2.0, < 5.3) + railties (>= 4.2.0, < 5.3) rest-client (2.0.1) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) @@ -430,14 +430,14 @@ GEM sprockets (3.7.1) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.2.0) + sprockets-rails (3.2.1) actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - thor (0.19.4) + thor (0.20.0) thread_safe (0.3.6) tilt (1.4.1) - tzinfo (1.2.3) + tzinfo (1.2.5) thread_safe (~> 0.1) unf (0.1.4) unf_ext @@ -491,7 +491,7 @@ DEPENDENCIES daemons-rails (= 1.2.1) data_migrate! database_cleaner - devise (= 3.5.4) + devise (= 4.4.3) digidoc_client! epp (= 1.5.0)! epp-xml (= 1.1.0)! @@ -522,7 +522,7 @@ DEPENDENCIES que-web (= 0.4.0) que_mailer! railroady (= 1.3.0) - rails (= 4.2.7.1) + rails (= 4.2.10) rails-settings-cached (= 0.4.1) ransack (= 1.5.1) rest-client @@ -542,4 +542,4 @@ DEPENDENCIES whenever (= 0.9.4) BUNDLED WITH - 1.14.6 + 1.16.1 diff --git a/app/api/repp/api.rb b/app/api/repp/api.rb index 9c12470a0..7858cd625 100644 --- a/app/api/repp/api.rb +++ b/app/api/repp/api.rb @@ -59,5 +59,6 @@ module Repp mount Repp::AccountV1 mount Repp::DomainTransfersV1 mount Repp::NameserversV1 + mount Repp::DomainContactsV1 end end diff --git a/app/api/repp/domain_contacts_v1.rb b/app/api/repp/domain_contacts_v1.rb new file mode 100644 index 000000000..7f3e323ac --- /dev/null +++ b/app/api/repp/domain_contacts_v1.rb @@ -0,0 +1,47 @@ +module Repp + class DomainContactsV1 < Grape::API + version 'v1', using: :path + + resource :domains do + resource :contacts do + patch '/' do + current_contact = current_user.registrar.contacts + .find_by(code: params[:current_contact_id]) + new_contact = current_user.registrar.contacts.find_by(code: params[:new_contact_id]) + + unless current_contact + error!({ error: { type: 'invalid_request_error', + param: 'current_contact_id', + message: "No such contact: #{params[:current_contact_id]}"} }, + :bad_request) + end + + unless new_contact + error!({ error: { type: 'invalid_request_error', + param: 'new_contact_id', + message: "No such contact: #{params[:new_contact_id]}" } }, + :bad_request) + end + + if new_contact.invalid? + error!({ error: { type: 'invalid_request_error', + param: 'new_contact_id', + message: 'New contact must be valid' } }, + :bad_request) + end + + if current_contact == new_contact + error!({ error: { type: 'invalid_request_error', + message: 'New contact ID must be different from current' \ + ' contact ID' } }, + :bad_request) + end + + affected_domains, skipped_domains = TechDomainContact + .replace(current_contact, new_contact) + @response = { affected_domains: affected_domains, skipped_domains: skipped_domains } + end + end + end + end +end diff --git a/app/assets/images/every_pay.png b/app/assets/images/every_pay.png new file mode 100644 index 000000000..fcd4a2c67 Binary files /dev/null and b/app/assets/images/every_pay.png differ diff --git a/app/assets/javascripts/popover.js b/app/assets/javascripts/popover.js new file mode 100644 index 000000000..2f8ed57b5 --- /dev/null +++ b/app/assets/javascripts/popover.js @@ -0,0 +1,9 @@ +(function() { + function initPopover() { + $(function () { + $('[data-toggle="popover"]').popover(); + }) + } + + initPopover(); +})(); diff --git a/app/assets/javascripts/registrar-manifest.coffee b/app/assets/javascripts/registrar-manifest.coffee index 5c4a58df6..f83d9f76e 100644 --- a/app/assets/javascripts/registrar-manifest.coffee +++ b/app/assets/javascripts/registrar-manifest.coffee @@ -7,6 +7,8 @@ #= require select2 #= require datepicker #= require spell_check +#= require popover +#= require text_field_trimmer #= require shared/general #= require registrar/autocomplete #= require registrar/application diff --git a/app/assets/javascripts/text_field_trimmer.js b/app/assets/javascripts/text_field_trimmer.js new file mode 100644 index 000000000..71cbc5295 --- /dev/null +++ b/app/assets/javascripts/text_field_trimmer.js @@ -0,0 +1,15 @@ +(function () { + function trimTextFields() { + let selector = 'input[type=text], input[type=search], input[type=email], textarea'; + let textFields = document.querySelectorAll(selector); + let listener = function () { + this.value = this.value.trim(); + }; + + for (let field of textFields) { + field.addEventListener('change', listener); + } + } + + trimTextFields(); +})(); diff --git a/app/controllers/admin/blocked_domains_controller.rb b/app/controllers/admin/blocked_domains_controller.rb index d9227d773..bf5359b82 100644 --- a/app/controllers/admin/blocked_domains_controller.rb +++ b/app/controllers/admin/blocked_domains_controller.rb @@ -3,13 +3,11 @@ module Admin load_and_authorize_resource def index - params[:q] ||= {} domains = BlockedDomain.all.order(:name) @q = domains.search(params[:q]) @domains = @q.result.page(params[:page]) - @domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i > 0 - + @domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i.positive? end def new diff --git a/app/controllers/admin/contact_versions_controller.rb b/app/controllers/admin/contact_versions_controller.rb index d066f698e..834353cf4 100644 --- a/app/controllers/admin/contact_versions_controller.rb +++ b/app/controllers/admin/contact_versions_controller.rb @@ -1,5 +1,7 @@ module Admin class ContactVersionsController < BaseController + include ObjectVersionsHelper + load_and_authorize_resource def index @@ -24,7 +26,7 @@ module Admin versions = ContactVersion.includes(:item).where(whereS).order(created_at: :desc, id: :desc) @q = versions.search(params[:q]) @versions = @q.result.page(params[:page]) - @versions = @versions.per(params[:results_per_page]) if params[:results_per_page].to_i > 0 + @versions = @versions.per(params[:results_per_page]) if params[:results_per_page].to_i.positive? end diff --git a/app/controllers/admin/contacts_controller.rb b/app/controllers/admin/contacts_controller.rb index 6402d09ae..b53d366ab 100644 --- a/app/controllers/admin/contacts_controller.rb +++ b/app/controllers/admin/contacts_controller.rb @@ -22,7 +22,7 @@ module Admin @contacts = @q.result.uniq.page(params[:page]) end - @contacts = @contacts.per(params[:results_per_page]) if params[:results_per_page].to_i > 0 + @contacts = @contacts.per(params[:results_per_page]) if params[:results_per_page].to_i.positive? end def search diff --git a/app/controllers/admin/domain_versions_controller.rb b/app/controllers/admin/domain_versions_controller.rb index 283c84f97..b6245f6ea 100644 --- a/app/controllers/admin/domain_versions_controller.rb +++ b/app/controllers/admin/domain_versions_controller.rb @@ -1,5 +1,7 @@ module Admin class DomainVersionsController < BaseController + include ObjectVersionsHelper + load_and_authorize_resource def index @@ -41,7 +43,7 @@ module Admin versions = DomainVersion.includes(:item).where(whereS).order(created_at: :desc, id: :desc) @q = versions.search(params[:q]) @versions = @q.result.page(params[:page]) - @versions = @versions.per(params[:results_per_page]) if params[:results_per_page].to_i > 0 + @versions = @versions.per(params[:results_per_page]) if params[:results_per_page].to_i.positive? render "admin/domain_versions/archive" end diff --git a/app/controllers/admin/domains_controller.rb b/app/controllers/admin/domains_controller.rb index 576b5f8e1..71d49a2ab 100644 --- a/app/controllers/admin/domains_controller.rb +++ b/app/controllers/admin/domains_controller.rb @@ -32,7 +32,7 @@ module Admin end end - @domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i > 0 + @domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i.positive? end # rubocop: enable Metrics/PerceivedComplexity diff --git a/app/controllers/admin/invoices_controller.rb b/app/controllers/admin/invoices_controller.rb index 9b97d0903..39bf06152 100644 --- a/app/controllers/admin/invoices_controller.rb +++ b/app/controllers/admin/invoices_controller.rb @@ -13,7 +13,7 @@ module Admin @deposit = Deposit.new(deposit_params.merge(registrar: r)) @invoice = @deposit.issue_prepayment_invoice - if @invoice && @invoice.persisted? + if @invoice&.persisted? flash[:notice] = t(:record_created) redirect_to [:admin, @invoice] else diff --git a/app/controllers/admin/reserved_domains_controller.rb b/app/controllers/admin/reserved_domains_controller.rb index 52a74f345..78d752866 100644 --- a/app/controllers/admin/reserved_domains_controller.rb +++ b/app/controllers/admin/reserved_domains_controller.rb @@ -4,13 +4,11 @@ module Admin before_action :set_domain, only: [:edit, :update] def index - params[:q] ||= {} domains = ReservedDomain.all.order(:name) @q = domains.search(params[:q]) @domains = @q.result.page(params[:page]) - @domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i > 0 - + @domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i.positive? end def new diff --git a/app/controllers/epp_controller.rb b/app/controllers/epp_controller.rb index 36bdcd6cc..3eba05777 100644 --- a/app/controllers/epp_controller.rb +++ b/app/controllers/epp_controller.rb @@ -168,7 +168,7 @@ class EppController < ApplicationController # validate legal document's type here because it may be in most of the requests @prefix = nil - if element_count('extdata > legalDocument') > 0 + if element_count('extdata > legalDocument').positive? requires_attribute('extdata > legalDocument', 'type', values: LegalDocument::TYPES, policy: true) end @@ -279,7 +279,7 @@ class EppController < ApplicationController def optional(selector, *validations) full_selector = [@prefix, selector].compact.join(' ') el = params[:parsed_frame].css(full_selector).first - return unless el && el.text.present? + return unless el&.text.present? value = el.text validations.each do |x| diff --git a/app/controllers/registrant/domains_controller.rb b/app/controllers/registrant/domains_controller.rb index 7cde44a86..0e2f6eeaf 100644 --- a/app/controllers/registrant/domains_controller.rb +++ b/app/controllers/registrant/domains_controller.rb @@ -6,7 +6,7 @@ class Registrant::DomainsController < RegistrantController @q = domains.search(params[:q]) @domains = @q.result.page(params[:page]) end - @domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i > 0 + @domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i.positive? end def show diff --git a/app/controllers/registrant/whois_controller.rb b/app/controllers/registrant/whois_controller.rb index b44a0bb67..2936477eb 100644 --- a/app/controllers/registrant/whois_controller.rb +++ b/app/controllers/registrant/whois_controller.rb @@ -1,3 +1,5 @@ +# As non-GDPR compliant, this controller is deprecated. Needs to be replaced with one that relies +# on the REST WHOIS API. class Registrant::WhoisController < RegistrantController def index authorize! :view, :registrant_whois diff --git a/app/controllers/registrar/bulk_change_controller.rb b/app/controllers/registrar/bulk_change_controller.rb new file mode 100644 index 000000000..562344a46 --- /dev/null +++ b/app/controllers/registrar/bulk_change_controller.rb @@ -0,0 +1,20 @@ +class Registrar + class BulkChangeController < DeppController + helper_method :available_contacts + + def new + authorize! :manage, :repp + render file: 'registrar/bulk_change/new', locals: { active_tab: default_tab } + end + + private + + def available_contacts + current_user.registrar.contacts.order(:name).pluck(:name, :code) + end + + def default_tab + :technical_contact + end + end +end diff --git a/app/controllers/registrar/contacts_controller.rb b/app/controllers/registrar/contacts_controller.rb index f5f527e1f..cb059641e 100644 --- a/app/controllers/registrar/contacts_controller.rb +++ b/app/controllers/registrar/contacts_controller.rb @@ -33,7 +33,7 @@ class Registrar @contacts = @q.result(distinct: :true).page(params[:page]) end - @contacts = @contacts.per(params[:results_per_page]) if params[:results_per_page].to_i > 0 + @contacts = @contacts.per(params[:results_per_page]) if params[:results_per_page].to_i.positive? end def download_list diff --git a/app/controllers/registrar/deposits_controller.rb b/app/controllers/registrar/deposits_controller.rb index 856b22553..ec6d13977 100644 --- a/app/controllers/registrar/deposits_controller.rb +++ b/app/controllers/registrar/deposits_controller.rb @@ -10,7 +10,7 @@ class Registrar @deposit = Deposit.new(deposit_params.merge(registrar: current_user.registrar)) @invoice = @deposit.issue_prepayment_invoice - if @invoice && @invoice.persisted? + if @invoice&.persisted? flash[:notice] = t(:please_pay_the_following_invoice) redirect_to [:registrar, @invoice] else diff --git a/app/controllers/registrar/domain_transfers_controller.rb b/app/controllers/registrar/domain_transfers_controller.rb index 65127155e..7c0925f03 100644 --- a/app/controllers/registrar/domain_transfers_controller.rb +++ b/app/controllers/registrar/domain_transfers_controller.rb @@ -1,5 +1,5 @@ class Registrar - class DomainTransfersController < DeppController + class DomainTransfersController < BulkChangeController before_action do authorize! :transfer, Depp::Domain end @@ -58,7 +58,7 @@ class Registrar redirect_to registrar_domains_url else @api_errors = parsed_response[:errors] - render :new + render file: 'registrar/bulk_change/new', locals: { active_tab: :bulk_transfer } end else params[:request] = true # EPP domain:transfer "op" attribute diff --git a/app/controllers/registrar/domains_controller.rb b/app/controllers/registrar/domains_controller.rb index b85923a02..774ec2e44 100644 --- a/app/controllers/registrar/domains_controller.rb +++ b/app/controllers/registrar/domains_controller.rb @@ -40,7 +40,7 @@ class Registrar end end - @domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i > 0 + @domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i.positive? respond_to do |format| format.html diff --git a/app/controllers/registrar/registrar_nameservers_controller.rb b/app/controllers/registrar/nameservers_controller.rb similarity index 94% rename from app/controllers/registrar/registrar_nameservers_controller.rb rename to app/controllers/registrar/nameservers_controller.rb index 1af3cde64..b6f7af829 100644 --- a/app/controllers/registrar/registrar_nameservers_controller.rb +++ b/app/controllers/registrar/nameservers_controller.rb @@ -1,9 +1,5 @@ class Registrar - class RegistrarNameserversController < DeppController - def edit - authorize! :manage, :repp - end - + class NameserversController < BulkChangeController def update authorize! :manage, :repp @@ -52,7 +48,7 @@ class Registrar redirect_to registrar_domains_url else @api_errors = parsed_response[:errors] - render :edit + render file: 'registrar/bulk_change/new', locals: { active_tab: :nameserver } end end end diff --git a/app/controllers/registrar/payments_controller.rb b/app/controllers/registrar/payments_controller.rb index 18c892ea7..57565b9c2 100644 --- a/app/controllers/registrar/payments_controller.rb +++ b/app/controllers/registrar/payments_controller.rb @@ -1,30 +1,34 @@ class Registrar class PaymentsController < BaseController - protect_from_forgery except: :back + protect_from_forgery except: [:back, :callback] skip_authorization_check # actually anyone can pay, no problems at all - skip_before_action :authenticate_user!, :check_ip_restriction, only: [:back] - before_action :check_bank + skip_before_action :authenticate_user!, :check_ip_restriction, only: [:back, :callback] + before_action :check_supported_payment_method - # to handle existing model we should - # get invoice_id and then get number - # build BankTransaction without connection with right reference number - # do not connect transaction and invoice def pay invoice = Invoice.find(params[:invoice_id]) - @bank_link = BankLink::Request.new(params[:bank], invoice, self) - @bank_link.make_transaction + bank = params[:bank] + opts = { + return_url: registrar_return_payment_with_url( + bank, invoice_id: invoice + ), + response_url: registrar_response_payment_with_url( + bank, invoice_id: invoice + ) + } + @payment = ::PaymentOrders.create_with_type(bank, invoice, opts) + @payment.create_transaction end - - # connect invoice and transaction - # both back and IPN def back - @bank_link = BankLink::Response.new(params[:bank], params) - if @bank_link.valid? && @bank_link.ok? - @bank_link.complete_payment + invoice = Invoice.find(params[:invoice_id]) + opts = { response: params } + @payment = ::PaymentOrders.create_with_type(params[:bank], invoice, opts) + if @payment.valid_response_from_intermediary? && @payment.settled_payment? + @payment.complete_transaction - if @bank_link.invoice.binded? + if invoice.binded? flash[:notice] = t(:pending_applied) else flash[:alert] = t(:something_wrong) @@ -32,17 +36,31 @@ class Registrar else flash[:alert] = t(:something_wrong) end - redirect_to registrar_invoice_path(@bank_link.invoice) + redirect_to registrar_invoice_path(invoice) + end + + def callback + invoice = Invoice.find(params[:invoice_id]) + opts = { response: params } + @payment = ::PaymentOrders.create_with_type(params[:bank], invoice, opts) + + if @payment.valid_response_from_intermediary? && @payment.settled_payment? + @payment.complete_transaction + end + + render status: 200, json: { status: 'ok' } end private - def banks - ENV['payments_banks'].split(",").map(&:strip) + def check_supported_payment_method + return if supported_payment_method? + raise StandardError.new("Not supported payment method") end - def check_bank - raise StandardError.new("Not Implemented bank") unless banks.include?(params[:bank]) + + def supported_payment_method? + PaymentOrders::PAYMENT_METHODS.include?(params[:bank]) end end end diff --git a/app/controllers/registrar/tech_contacts_controller.rb b/app/controllers/registrar/tech_contacts_controller.rb new file mode 100644 index 000000000..9d4568ad6 --- /dev/null +++ b/app/controllers/registrar/tech_contacts_controller.rb @@ -0,0 +1,59 @@ +class Registrar + class TechContactsController < BulkChangeController + def update + authorize! :manage, :repp + + uri = URI.parse("#{ENV['repp_url']}domains/contacts") + + request = Net::HTTP::Patch.new(uri) + request.set_form_data(current_contact_id: params[:current_contact_id], + new_contact_id: params[:new_contact_id]) + request.basic_auth(current_user.username, current_user.password) + + if Rails.env.test? + response = Net::HTTP.start(uri.hostname, uri.port, + use_ssl: (uri.scheme == 'https'), + verify_mode: OpenSSL::SSL::VERIFY_NONE) do |http| + http.request(request) + end + elsif Rails.env.development? + client_cert = File.read(ENV['cert_path']) + client_key = File.read(ENV['key_path']) + response = Net::HTTP.start(uri.hostname, uri.port, + use_ssl: (uri.scheme == 'https'), + verify_mode: OpenSSL::SSL::VERIFY_NONE, + cert: OpenSSL::X509::Certificate.new(client_cert), + key: OpenSSL::PKey::RSA.new(client_key)) do |http| + http.request(request) + end + else + client_cert = File.read(ENV['cert_path']) + client_key = File.read(ENV['key_path']) + response = Net::HTTP.start(uri.hostname, uri.port, + use_ssl: (uri.scheme == 'https'), + cert: OpenSSL::X509::Certificate.new(client_cert), + key: OpenSSL::PKey::RSA.new(client_key)) do |http| + http.request(request) + end + end + + parsed_response = JSON.parse(response.body, symbolize_names: true) + + if response.code == '200' + notices = [t('.replaced')] + + notices << "#{t('.affected_domains')}: #{parsed_response[:affected_domains].join(', ')}" + + if parsed_response[:skipped_domains] + notices << "#{t('.skipped_domains')}: #{parsed_response[:skipped_domains].join(', ')}" + end + + flash[:notice] = notices + redirect_to registrar_domains_url + else + @error = parsed_response[:error] + render file: 'registrar/bulk_change/new', locals: { active_tab: :technical_contact } + end + end + end +end diff --git a/app/helpers/object_versions_helper.rb b/app/helpers/object_versions_helper.rb new file mode 100644 index 000000000..d8e00abbe --- /dev/null +++ b/app/helpers/object_versions_helper.rb @@ -0,0 +1,15 @@ +module ObjectVersionsHelper + def attach_existing_fields(version, new_object) + version.object_changes.to_h.each do |key, value| + method_name = "#{key}=".to_sym + if new_object.respond_to?(method_name) + new_object.public_send(method_name, value.last) + end + end + end + + def only_present_fields(version, model) + field_names = model.column_names + version.object.to_h.select { |key, _value| field_names.include?(key) } + end +end diff --git a/app/jobs/update_whois_record_job.rb b/app/jobs/update_whois_record_job.rb index acfafa3d4..bee0e032c 100644 --- a/app/jobs/update_whois_record_job.rb +++ b/app/jobs/update_whois_record_job.rb @@ -51,4 +51,4 @@ class UpdateWhoisRecordJob < Que::Job def delete_blocked(name) delete_reserved(name) end -end \ No newline at end of file +end diff --git a/app/models/ability.rb b/app/models/ability.rb index 3883bbabf..6083d700f 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -13,9 +13,9 @@ class Ability case @user.class.to_s when 'AdminUser' - @user.roles.each { |role| send(role) } if @user.roles + @user.roles&.each { |role| send(role) } when 'ApiUser' - @user.roles.each { |role| send(role) } if @user.roles + @user.roles&.each { |role| send(role) } when 'RegistrantUser' static_registrant end diff --git a/app/models/bank_link.rb b/app/models/bank_link.rb deleted file mode 100644 index e388a0f8b..000000000 --- a/app/models/bank_link.rb +++ /dev/null @@ -1,158 +0,0 @@ -class BankLink - module Base - def prepend_size(value) - value = (value || "").to_s.strip - string = "" - string << sprintf("%03i", value.size) - string << value - end - end - - class Request - include Base - include ActionView::Helpers::NumberHelper - - # need controller here in order to handle random ports and domains - # I don't want to do it but has to - attr_accessor :type, :invoice, :controller - def initialize(type, invoice, controller) - @type, @invoice, @controller = type, invoice, controller - end - - def url - ENV["payments_#{type}_url"] - end - - def fields - @fields ||= (hash = {} - hash["VK_SERVICE"] = "1012" - hash["VK_VERSION"] = "008" - hash["VK_SND_ID"] = ENV["payments_#{type}_seller_account"] - hash["VK_STAMP"] = invoice.number - hash["VK_AMOUNT"] = number_with_precision(invoice.total, :precision => 2, :separator => ".") - hash["VK_CURR"] = invoice.currency - hash["VK_REF"] = "" - hash["VK_MSG"] = invoice.order - hash["VK_RETURN"] = controller.registrar_return_payment_with_url(type) - hash["VK_CANCEL"] = controller.registrar_return_payment_with_url(type) - hash["VK_DATETIME"] = Time.now.strftime("%Y-%m-%dT%H:%M:%S%z") - hash["VK_MAC"] = calc_mac(hash) - hash["VK_ENCODING"] = "UTF-8" - hash["VK_LANG"] = "ENG" - hash) - end - - def calc_mac(fields) - pars = %w(VK_SERVICE VK_VERSION VK_SND_ID VK_STAMP VK_AMOUNT VK_CURR VK_REF - VK_MSG VK_RETURN VK_CANCEL VK_DATETIME).freeze - data = pars.map{|e| prepend_size(fields[e]) }.join - - sign(data) - end - - def make_transaction - transaction = BankTransaction.where(description: fields["VK_MSG"]).first_or_initialize( - reference_no: invoice.reference_no, - currency: invoice.currency, - iban: invoice.seller_iban - ) - - transaction.save! - end - - private - def sign(data) - private_key = OpenSSL::PKey::RSA.new(File.read(ENV["payments_#{type}_seller_private"])) - - signed_data = private_key.sign(OpenSSL::Digest::SHA1.new, data) - signed_data = Base64.encode64(signed_data).gsub(/\n|\r/, '') - signed_data - end - end - - - - - class Response - include Base - include ActionView::Helpers::NumberHelper - - attr_accessor :type, :params, :invoice - def initialize(type, params) - @type, @params = type, params - - @invoice = Invoice.find_by(number: params["VK_STAMP"]) if params["VK_STAMP"].present? - end - - def valid? - !!validate - end - - def ok? - params["VK_SERVICE"] == "1111" - end - - def complete_payment - if valid? - transaction = BankTransaction.find_by(description: params["VK_MSG"]) - transaction.sum = BigDecimal.new(params["VK_AMOUNT"].to_s) - transaction.bank_reference = params['VK_T_NO'] - transaction.buyer_bank_code = params["VK_SND_ID"] - transaction.buyer_iban = params["VK_SND_ACC"] - transaction.buyer_name = params["VK_SND_NAME"] - transaction.paid_at = Time.parse(params["VK_T_DATETIME"]) - transaction.save! - - transaction.autobind_invoice - end - end - - - - def validate - case params["VK_SERVICE"] - when "1111" - validate_success && validate_amount && validate_currency - when "1911" - validate_cancel - else - false - end - end - - def validate_success - pars = %w(VK_SERVICE VK_VERSION VK_SND_ID VK_REC_ID VK_STAMP VK_T_NO VK_AMOUNT VK_CURR - VK_REC_ACC VK_REC_NAME VK_SND_ACC VK_SND_NAME VK_REF VK_MSG VK_T_DATETIME).freeze - - @validate_success ||= ( - data = pars.map{|e| prepend_size(params[e]) }.join - verify_mac(data, params["VK_MAC"]) - ) - end - - def validate_cancel - pars = %w(VK_SERVICE VK_VERSION VK_SND_ID VK_REC_ID VK_STAMP VK_REF VK_MSG).freeze - @validate_cancel ||= ( - data = pars.map{|e| prepend_size(params[e]) }.join - verify_mac(data, params["VK_MAC"]) - ) - end - - def validate_amount - source = number_with_precision(BigDecimal.new(params["VK_AMOUNT"].to_s), precision: 2, separator: ".") - target = number_with_precision(invoice.total, precision: 2, separator: ".") - - source == target - end - - def validate_currency - invoice.currency == params["VK_CURR"] - end - - - def verify_mac(data, mac) - bank_public_key = OpenSSL::X509::Certificate.new(File.read(ENV["payments_#{type}_bank_certificate"])).public_key - bank_public_key.verify(OpenSSL::Digest::SHA1.new, Base64.decode64(mac), data) - end - end -end diff --git a/app/models/directo.rb b/app/models/directo.rb index 9352c9356..3e4e93e2c 100644 --- a/app/models/directo.rb +++ b/app/models/directo.rb @@ -45,8 +45,10 @@ class Directo < ActiveRecord::Base end data = builder.to_xml.gsub("\n",'') - response = RestClient::Request.execute(url: ENV['directo_invoice_url'], method: :post, payload: {put: "1", what: "invoice", xmldata: data}, verify_ssl: false).to_s - dump_result_to_db(mappers, response) + Rails.logger.info("[Directo] XML request: #{data}") + response = RestClient::Request.execute(url: ENV['directo_invoice_url'], method: :post, payload: {put: "1", what: "invoice", xmldata: data}, verify_ssl: false) + Rails.logger.info("[Directo] Directo responded with code: #{response.code}, body: #{response.body}") + dump_result_to_db(mappers, response.to_s) end STDOUT << "#{Time.zone.now.utc} - Directo receipts sending finished. #{counter} of #{total} are sent\n" @@ -165,11 +167,15 @@ class Directo < ActiveRecord::Base end data = builder.to_xml.gsub("\n",'') + Rails.logger.info("[Directo] XML request: #{data}") if debug STDOUT << "#{Time.zone.now.utc} - Directo xml had to be sent #{data}\n" else - response = RestClient::Request.execute(url: ENV['directo_invoice_url'], method: :post, payload: {put: "1", what: "invoice", xmldata: data}, verify_ssl: false).to_s + response = RestClient::Request.execute(url: ENV['directo_invoice_url'], method: :post, payload: {put: "1", what: "invoice", xmldata: data}, verify_ssl: false) + Rails.logger.info("[Directo] Directo responded with code: #{response.code}, body: #{response.body}") + response = response.to_s + Setting.directo_monthly_number_last = directo_next Nokogiri::XML(response).css("Result").each do |res| Directo.create!(request: data, response: res.as_json.to_h, invoice_number: directo_next) @@ -190,4 +196,3 @@ class Directo < ActiveRecord::Base @pricelists[account_activity.price_id] = account_activity.price end end - diff --git a/app/models/epp/contact.rb b/app/models/epp/contact.rb index b280ceea6..699c07ab0 100644 --- a/app/models/epp/contact.rb +++ b/app/models/epp/contact.rb @@ -147,7 +147,7 @@ class Epp::Contact < Contact end if doc = attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame)) - frame.css("legalDocument").first.content = doc.path if doc && doc.persisted? + frame.css("legalDocument").first.content = doc.path if doc&.persisted? self.legal_document_id = doc.id end @@ -238,7 +238,7 @@ class Epp::Contact < Contact ) self.legal_documents = [doc] - frame.css("legalDocument").first.content = doc.path if doc && doc.persisted? + frame.css("legalDocument").first.content = doc.path if doc&.persisted? self.legal_document_id = doc.id end diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb index 4e0e7d44c..dcf61ddcf 100644 --- a/app/models/epp/domain.rb +++ b/app/models/epp/domain.rb @@ -197,7 +197,7 @@ class Epp::Domain < Domain ) self.legal_documents = [doc] - frame.css("legalDocument").first.content = doc.path if doc && doc.persisted? + frame.css("legalDocument").first.content = doc.path if doc&.persisted? self.legal_document_id = doc.id end # rubocop: enable Metrics/PerceivedComplexity @@ -472,7 +472,7 @@ class Epp::Domain < Domain at.deep_merge!(attrs_from(frame.css('rem'), current_user, 'rem')) if doc = attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame)) - frame.css("legalDocument").first.content = doc.path if doc && doc.persisted? + frame.css("legalDocument").first.content = doc.path if doc&.persisted? self.legal_document_id = doc.id end @@ -547,7 +547,7 @@ class Epp::Domain < Domain check_discarded if doc = attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame)) - frame.css("legalDocument").first.content = doc.path if doc && doc.persisted? + frame.css("legalDocument").first.content = doc.path if doc&.persisted? end if Setting.request_confirmation_on_domain_deletion_enabled && diff --git a/app/models/legal_document.rb b/app/models/legal_document.rb index c1f9243e3..4d75d272d 100644 --- a/app/models/legal_document.rb +++ b/app/models/legal_document.rb @@ -6,7 +6,8 @@ class LegalDocument < ActiveRecord::Base if ENV['legal_document_types'].present? TYPES = ENV['legal_document_types'].split(',').map(&:strip) else - TYPES = %w(pdf bdoc ddoc zip rar gz tar 7z odt doc docx).freeze + TYPES = %w(pdf asice asics sce scs adoc edoc bdoc ddoc zip rar gz tar 7z odt + doc docx).freeze end attr_accessor :body diff --git a/app/models/payment_orders.rb b/app/models/payment_orders.rb new file mode 100644 index 000000000..921af0cd4 --- /dev/null +++ b/app/models/payment_orders.rb @@ -0,0 +1,15 @@ +module PaymentOrders + PAYMENT_INTERMEDIARIES = ENV['payments_intermediaries'].to_s.strip.split(', ').freeze + PAYMENT_BANKLINK_BANKS = ENV['payments_banks'].to_s.strip.split(', ').freeze + PAYMENT_METHODS = [PAYMENT_INTERMEDIARIES, PAYMENT_BANKLINK_BANKS].flatten.freeze + + def self.create_with_type(type, invoice, opts = {}) + raise ArgumentError unless PAYMENT_METHODS.include?(type) + + if PAYMENT_BANKLINK_BANKS.include?(type) + BankLink.new(type, invoice, opts) + elsif type == 'every_pay' + EveryPay.new(type, invoice, opts) + end + end +end diff --git a/app/models/payment_orders/bank_link.rb b/app/models/payment_orders/bank_link.rb new file mode 100644 index 000000000..e568da0df --- /dev/null +++ b/app/models/payment_orders/bank_link.rb @@ -0,0 +1,146 @@ +module PaymentOrders + class BankLink < Base + BANK_LINK_VERSION = '008' + + NEW_TRANSACTION_SERVICE_NUMBER = '1012' + SUCCESSFUL_PAYMENT_SERVICE_NUMBER = '1111' + CANCELLED_PAYMENT_SERVICE_NUMBER = '1911' + + NEW_MESSAGE_KEYS = %w(VK_SERVICE VK_VERSION VK_SND_ID VK_STAMP VK_AMOUNT + VK_CURR VK_REF VK_MSG VK_RETURN VK_CANCEL + VK_DATETIME).freeze + SUCCESS_MESSAGE_KEYS = %w(VK_SERVICE VK_VERSION VK_SND_ID VK_REC_ID VK_STAMP + VK_T_NO VK_AMOUNT VK_CURR VK_REC_ACC VK_REC_NAME + VK_SND_ACC VK_SND_NAME VK_REF VK_MSG + VK_T_DATETIME).freeze + CANCEL_MESSAGE_KEYS = %w(VK_SERVICE VK_VERSION VK_SND_ID VK_REC_ID VK_STAMP + VK_REF VK_MSG).freeze + + def form_fields + hash = {} + hash["VK_SERVICE"] = NEW_TRANSACTION_SERVICE_NUMBER + hash["VK_VERSION"] = BANK_LINK_VERSION + hash["VK_SND_ID"] = seller_account + hash["VK_STAMP"] = invoice.number + hash["VK_AMOUNT"] = number_with_precision(invoice.total, precision: 2, separator: ".") + hash["VK_CURR"] = invoice.currency + hash["VK_REF"] = "" + hash["VK_MSG"] = invoice.order + hash["VK_RETURN"] = return_url + hash["VK_CANCEL"] = return_url + hash["VK_DATETIME"] = Time.zone.now.strftime("%Y-%m-%dT%H:%M:%S%z") + hash["VK_MAC"] = calc_mac(hash) + hash["VK_ENCODING"] = "UTF-8" + hash["VK_LANG"] = "ENG" + hash + end + + def valid_response_from_intermediary? + return false unless response + + case response["VK_SERVICE"] + when SUCCESSFUL_PAYMENT_SERVICE_NUMBER + valid_successful_transaction? + when CANCELLED_PAYMENT_SERVICE_NUMBER + valid_cancel_notice? + else + false + end + end + + def complete_transaction + return unless valid_successful_transaction? + + transaction = BankTransaction.find_by( + description: invoice.order, + currency: invoice.currency, + iban: invoice.seller_iban + ) + + transaction.sum = response['VK_AMOUNT'] + transaction.bank_reference = response['VK_T_NO'] + transaction.buyer_bank_code = response["VK_SND_ID"] + transaction.buyer_iban = response["VK_SND_ACC"] + transaction.buyer_name = response["VK_SND_NAME"] + transaction.paid_at = Time.parse(response["VK_T_DATETIME"]) + + transaction.save! + transaction.autobind_invoice + end + + def settled_payment? + response["VK_SERVICE"] == SUCCESSFUL_PAYMENT_SERVICE_NUMBER + end + + private + + def valid_successful_transaction? + valid_success_notice? && valid_amount? && valid_currency? + end + + def valid_cancel_notice? + valid_mac?(response, CANCEL_MESSAGE_KEYS) + end + + def valid_success_notice? + valid_mac?(response, SUCCESS_MESSAGE_KEYS) + end + + def valid_amount? + source = number_with_precision( + BigDecimal.new(response["VK_AMOUNT"]), precision: 2, separator: "." + ) + target = number_with_precision( + invoice.total, precision: 2, separator: "." + ) + + source == target + end + + def valid_currency? + invoice.currency == response["VK_CURR"] + end + + def sign(data) + private_key = OpenSSL::PKey::RSA.new(File.read(seller_certificate)) + signed_data = private_key.sign(OpenSSL::Digest::SHA1.new, data) + signed_data = Base64.encode64(signed_data).gsub(/\n|\r/, '') + signed_data + end + + def calc_mac(fields) + pars = NEW_MESSAGE_KEYS + data = pars.map { |element| prepend_size(fields[element]) }.join + sign(data) + end + + def valid_mac?(hash, keys) + data = keys.map { |element| prepend_size(hash[element]) }.join + verify_mac(data, hash["VK_MAC"]) + end + + def verify_mac(data, mac) + bank_public_key = OpenSSL::X509::Certificate.new(File.read(bank_certificate)).public_key + bank_public_key.verify(OpenSSL::Digest::SHA1.new, Base64.decode64(mac), data) + end + + def prepend_size(value) + value = (value || "").to_s.strip + string = "" + string << format("%03i", value.size) + string << value + end + + def seller_account + ENV["payments_#{type}_seller_account"] + end + + def seller_certificate + ENV["payments_#{type}_seller_private"] + end + + def bank_certificate + ENV["payments_#{type}_bank_certificate"] + end + end +end diff --git a/app/models/payment_orders/base.rb b/app/models/payment_orders/base.rb new file mode 100644 index 000000000..cf0293025 --- /dev/null +++ b/app/models/payment_orders/base.rb @@ -0,0 +1,33 @@ +module PaymentOrders + class Base + include ActionView::Helpers::NumberHelper + + attr_reader :type, + :invoice, + :return_url, + :response_url, + :response + + def initialize(type, invoice, opts = {}) + @type = type + @invoice = invoice + @return_url = opts[:return_url] + @response_url = opts[:response_url] + @response = opts[:response] + end + + def create_transaction + transaction = BankTransaction.where(description: invoice.order).first_or_initialize( + reference_no: invoice.reference_no, + currency: invoice.currency, + iban: invoice.seller_iban + ) + + transaction.save! + end + + def form_url + ENV["payments_#{type}_url"] + end + end +end diff --git a/app/models/payment_orders/every_pay.rb b/app/models/payment_orders/every_pay.rb new file mode 100644 index 000000000..b4ddcdf29 --- /dev/null +++ b/app/models/payment_orders/every_pay.rb @@ -0,0 +1,84 @@ +module PaymentOrders + class EveryPay < Base + USER = ENV['payments_every_pay_api_user'].freeze + KEY = ENV['payments_every_pay_api_key'].freeze + ACCOUNT_ID = ENV['payments_every_pay_seller_account'].freeze + SUCCESSFUL_PAYMENT = %w(settled authorized).freeze + + def form_fields + base_json = base_params + base_json[:nonce] = SecureRandom.hex(15) + hmac_fields = (base_json.keys + ['hmac_fields']).sort.uniq! + + base_json[:hmac_fields] = hmac_fields.join(',') + hmac_string = hmac_fields.map { |key, _v| "#{key}=#{base_json[key]}" }.join('&') + hmac = OpenSSL::HMAC.hexdigest('sha1', KEY, hmac_string) + base_json[:hmac] = hmac + + base_json + end + + def valid_response_from_intermediary? + return false unless response + valid_hmac? && valid_amount? && valid_account? + end + + def settled_payment? + SUCCESSFUL_PAYMENT.include?(response[:payment_state]) + end + + def complete_transaction + return unless valid_response_from_intermediary? && settled_payment? + + transaction = BankTransaction.find_by( + description: invoice.order, + currency: invoice.currency, + iban: invoice.seller_iban + ) + + transaction.sum = response[:amount] + transaction.paid_at = Date.strptime(response[:timestamp], '%s') + transaction.buyer_name = response[:cc_holder_name] + + transaction.save! + transaction.autobind_invoice + end + + private + + def base_params + { + api_username: USER, + account_id: ACCOUNT_ID, + timestamp: Time.now.to_i.to_s, + callback_url: response_url, + customer_url: return_url, + amount: number_with_precision(invoice.total, precision: 2), + order_reference: SecureRandom.hex(15), + transaction_type: 'charge', + hmac_fields: '' + }.with_indifferent_access + end + + def valid_hmac? + hmac_fields = response[:hmac_fields].split(',') + hmac_hash = {} + hmac_fields.map do |field| + symbol = field.to_sym + hmac_hash[symbol] = response[symbol] + end + + hmac_string = hmac_hash.map { |key, _v| "#{key}=#{hmac_hash[key]}" }.join('&') + expected_hmac = OpenSSL::HMAC.hexdigest('sha1', KEY, hmac_string) + expected_hmac == response[:hmac] + end + + def valid_amount? + invoice.total == BigDecimal.new(response[:amount]) + end + + def valid_account? + response[:account_id] == ACCOUNT_ID + end + end +end diff --git a/app/models/tech_domain_contact.rb b/app/models/tech_domain_contact.rb index 68ae35dde..04f36c4e4 100644 --- a/app/models/tech_domain_contact.rb +++ b/app/models/tech_domain_contact.rb @@ -1,2 +1,23 @@ class TechDomainContact < DomainContact + # Audit log is needed, therefore no raw SQL + def self.replace(current_contact, new_contact) + affected_domains = [] + skipped_domains = [] + tech_contacts = where(contact: current_contact) + + transaction do + tech_contacts.each do |tech_contact| + if tech_contact.domain.discarded? + skipped_domains << tech_contact.domain.name + next + end + + tech_contact.contact = new_contact + tech_contact.save! + affected_domains << tech_contact.domain.name + end + end + + return affected_domains.sort, skipped_domains.sort + end end diff --git a/app/models/whois_record.rb b/app/models/whois_record.rb index 3ff0e9023..e4ccec22f 100644 --- a/app/models/whois_record.rb +++ b/app/models/whois_record.rb @@ -36,6 +36,7 @@ class WhoisRecord < ActiveRecord::Base registrant = domain.registrant @disclosed = [] + h[:disclaimer] = disclaimer_text if disclaimer_text.present? h[:name] = domain.name h[:status] = domain.statuses.map { |x| status_map[x] || x } h[:registered] = domain.registered_at.try(:to_s, :iso8601) @@ -120,4 +121,10 @@ class WhoisRecord < ActiveRecord::Base def destroy_whois_record Whois::Record.where(name: name).delete_all end + + private + + def disclaimer_text + Setting.registry_whois_disclaimer + end end diff --git a/app/validators/domain_name_validator.rb b/app/validators/domain_name_validator.rb index 49939087c..26db4dda9 100644 --- a/app/validators/domain_name_validator.rb +++ b/app/validators/domain_name_validator.rb @@ -37,7 +37,7 @@ class DomainNameValidator < ActiveModel::EachValidator def validate_blocked(value) return true unless value - return false if BlockedDomain.where(name: value).count > 0 + return false if BlockedDomain.where(name: value).count.positive? DNS::Zone.where(origin: value).count.zero? end end diff --git a/app/views/admin/contact_versions/index.haml b/app/views/admin/contact_versions/index.haml index 0367db3be..8f293ba5d 100644 --- a/app/views/admin/contact_versions/index.haml +++ b/app/views/admin/contact_versions/index.haml @@ -57,8 +57,9 @@ %tbody - @versions.each do |version| - if version - - contact = Contact.new(version.object.to_h) - - version.object_changes.to_h.each { |k,v| contact.public_send("#{k}=", v.last) } + - attributes = only_present_fields(version, Contact) + - contact = Contact.new(attributes) + - attach_existing_fields(version, contact) %tr %td= link_to(contact.name, admin_contact_version_path(version.id)) diff --git a/app/views/admin/contact_versions/show.haml b/app/views/admin/contact_versions/show.haml index e19326fca..a412b4312 100644 --- a/app/views/admin/contact_versions/show.haml +++ b/app/views/admin/contact_versions/show.haml @@ -1,5 +1,6 @@ -- contact = Contact.new(@version.object.to_h) -- @version.object_changes.to_h.each { |k,v| contact.public_send("#{k}=", v.last ) } +- attributes = only_present_fields(@version, Contact) +- contact = Contact.new(attributes) +- attach_existing_fields(@version, contact) = render 'shared/title', name: contact.name .row @@ -41,11 +42,11 @@ %br - %dt= t(:created) + %dt= t(:created_at) %dd{class: changing_css_class(@version,"created_at")} = l(contact.created_at, format: :short) - %dt= t(:updated) + %dt= t(:updated_at) %dd{class: changing_css_class(@version,"updated_at")} = l(contact.updated_at, format: :short) @@ -61,7 +62,7 @@ - if contact.street.present? %dt= t(:street) - %dd{class: changing_css_class(@version,"street")}= contact.street.to_s.gsub("\n", '
').html_safe + %dd{class: changing_css_class(@version,"street")}= contact.street - if contact.city.present? %dt= t(:city) diff --git a/app/views/admin/domain_versions/archive.haml b/app/views/admin/domain_versions/archive.haml index 5e6d8eaa9..9fdf8b000 100644 --- a/app/views/admin/domain_versions/archive.haml +++ b/app/views/admin/domain_versions/archive.haml @@ -55,8 +55,9 @@ %tbody - @versions.each do |version| - if version - - domain = Domain.new(version.object.to_h) - - version.object_changes.to_h.each{|k,v| domain.public_send("#{k}=", v.last) } + - attributes = only_present_fields(version, Domain) + - domain = Domain.new(attributes) + - attach_existing_fields(version, domain) %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 1a17ba3f9..9a38150be 100644 --- a/app/views/admin/domain_versions/show.haml +++ b/app/views/admin/domain_versions/show.haml @@ -1,5 +1,6 @@ -- domain = Domain.new(@version.object.to_h) -- @version.object_changes.to_h.each{|k,v| domain.public_send("#{k}=", v.last) } +- present_fields = only_present_fields(@version, Domain) +- domain = Domain.new(present_fields) +- attach_existing_fields(@version, domain) - if @version - children = HashWithIndifferentAccess.new(@version.children) diff --git a/app/views/admin/settings/index.haml b/app/views/admin/settings/index.haml index c41f5cd6b..14e158ec0 100644 --- a/app/views/admin/settings/index.haml +++ b/app/views/admin/settings/index.haml @@ -99,6 +99,7 @@ = render 'setting_row', var: :registry_state = render 'setting_row', var: :registry_zip = render 'setting_row', var: :registry_country_code + = render 'setting_row', var: :registry_whois_disclaimer .row .col-md-12.text-right diff --git a/app/views/admin/base/_flash_messages.html.erb b/app/views/application/_flash_messages.html.erb similarity index 77% rename from app/views/admin/base/_flash_messages.html.erb rename to app/views/application/_flash_messages.html.erb index 4a10df304..9b31f0d3f 100644 --- a/app/views/admin/base/_flash_messages.html.erb +++ b/app/views/application/_flash_messages.html.erb @@ -1,7 +1,11 @@ <% if flash[:notice] %>
-

<%= flash[:notice] %>

+ <% if flash[:notice].respond_to?(:join) %> +

<%= flash[:notice].join('
').html_safe %>

+ <% else %> +

<%= flash[:notice] %>

+ <% end %>
<% end %> diff --git a/app/views/epp/domains/info.xml.builder b/app/views/epp/domains/info.xml.builder index 2d10f8baf..850334955 100644 --- a/app/views/epp/domains/info.xml.builder +++ b/app/views/epp/domains/info.xml.builder @@ -22,7 +22,7 @@ xml.epp_head do xml.tag!('domain:contact', ac.code, 'type' => 'admin') end - if @nameservers && @nameservers.any? + if @nameservers&.any? xml.tag!('domain:ns') do @nameservers.each do |x| xml.tag!('domain:hostAttr') do diff --git a/app/views/for_models/whois.erb b/app/views/for_models/whois.erb index 390511031..02b9b1398 100644 --- a/app/views/for_models/whois.erb +++ b/app/views/for_models/whois.erb @@ -1,3 +1,6 @@ +<%- if json['disclaimer'].present? -%> +<%= json['disclaimer'].scan(/\S.{0,72}\S(?=\s|$)|\S+/).join("\n") %> +<%- end -%> Estonia .ee Top Level Domain WHOIS server Domain: @@ -23,18 +26,18 @@ changed: <%= json['registrant_changed'].to_s.tr('T',' ').sub('+', ' +') %> <%- if json['admin_contacts'].present? -%> Administrative contact: <%- for contact in json['admin_contacts'] -%> -name: <%= contact['name'] %> +name: Not Disclosed email: Not Disclosed - Visit www.internet.ee for webbased WHOIS -changed: <%= contact['changed'].to_s.tr('T',' ').sub('+', ' +') %> +changed: Not Disclosed <%- end -%> <%- end -%> <% if json['tech_contacts'].present? %> Technical contact: <%- for contact in json['tech_contacts'] -%> -name: <%= contact['name'] %> +name: Not Disclosed email: Not Disclosed - Visit www.internet.ee for webbased WHOIS -changed: <%= contact['changed'].to_s.tr('T',' ').sub('+', ' +') %> +changed: Not Disclosed <%- end -%> <%- end -%> diff --git a/app/views/layouts/registrant/application.haml b/app/views/layouts/registrant/application.haml deleted file mode 100644 index 12d161c94..000000000 --- a/app/views/layouts/registrant/application.haml +++ /dev/null @@ -1,54 +0,0 @@ -!!! 5 -%html{lang: I18n.locale.to_s} - %head - %meta{charset: "utf-8"}/ - %meta{content: "width=device-width, initial-scale=1", name: "viewport"}/ - - if content_for? :head_title - = yield :head_title - - else - %title= t(:registrant_head_title) - = csrf_meta_tags - = stylesheet_link_tag 'registrant-manifest', media: 'all' - = favicon_link_tag 'favicon.ico' - %body - / Fixed navbar - %nav.navbar.navbar-default.navbar-fixed-top - .container - .navbar-header - %button.navbar-toggle.collapsed{"aria-controls" => "navbar", "aria-expanded" => "false", "data-target" => "#navbar", "data-toggle" => "collapse", :type => "button"} - %span.sr-only Toggle navigation - %span.icon-bar - %span.icon-bar - %span.icon-bar - = link_to registrant_root_path, class: 'navbar-brand' do - = t(:registrant_head_title) - - if unstable_env.present? - .text-center - %small{style: 'color: #0074B3;'}= unstable_env - - if current_user - .navbar-collapse.collapse - %ul.nav.navbar-nav.public-nav - - if can? :view, Depp::Domain - - active_class = %w(registrant/domains registrant/check registrant/renew registrant/tranfer registrant/keyrelays).include?(params[:controller]) ? 'active' :nil - %li{class: active_class}= link_to t(:domains), registrant_domains_path - - - active_class = %w(registrant/whois).include?(params[:controller]) ? 'active' :nil - %li{class: active_class}= link_to t(:whois), registrant_whois_path - - %ul.nav.navbar-nav.navbar-right - - if user_signed_in? - %li= link_to t(:log_out, user: current_user), '/registrant/logout' - - .container - = render 'shared/flash' - = yield - - %footer.footer - .container - .row - .col-md-6 - = image_tag 'eis-logo-et.png' - .col-md-6.text-right - Version - = CURRENT_COMMIT_HASH - = javascript_include_tag 'registrant-manifest', async: true diff --git a/app/views/layouts/registrant/application.html.erb b/app/views/layouts/registrant/application.html.erb new file mode 100644 index 000000000..f38f8fcea --- /dev/null +++ b/app/views/layouts/registrant/application.html.erb @@ -0,0 +1,84 @@ + + + + + + <% if content_for? :head_title %> + <%= yield :head_title %> + <% else %> + + <%= t(:registrant_head_title) %> + + <% end %> + <%= csrf_meta_tags %> + <%= stylesheet_link_tag 'registrant-manifest', media: 'all' %> + <%= favicon_link_tag 'favicon.ico' %> + + + + +
+ <%= render 'shared/flash' %> + <%= yield %> +
+ + <%= javascript_include_tag 'registrant-manifest', async: true %> + + diff --git a/app/views/layouts/registrar/base.html.erb b/app/views/layouts/registrar/base.html.erb index 6116c7a26..3bc1c5b0f 100644 --- a/app/views/layouts/registrar/base.html.erb +++ b/app/views/layouts/registrar/base.html.erb @@ -18,7 +18,7 @@
- <%= render 'shared/flash' %> + <%= render 'flash_messages' %> <% if depp_controller? %> <%= render 'registrar/shared/epp_results' %> <% end %> diff --git a/app/views/layouts/registrar/sessions.haml b/app/views/layouts/registrar/sessions.haml deleted file mode 100644 index 49c71ab2c..000000000 --- a/app/views/layouts/registrar/sessions.haml +++ /dev/null @@ -1,45 +0,0 @@ -!!! 5 -%html{lang: I18n.locale.to_s} - %head - %meta{charset: "utf-8"}/ - %meta{content: "IE=edge", "http-equiv" => "X-UA-Compatible"}/ - %meta{content: "width=device-width, initial-scale=1", name: "viewport"}/ - - if content_for? :head_title - = yield :head_title - - else - %title= t(:registrar_head_title) - = csrf_meta_tags - = stylesheet_link_tag 'registrar-manifest', media: 'all' - = javascript_include_tag 'registrar-manifest' - = favicon_link_tag 'favicon.ico' - %body - %nav.navbar.navbar-default.navbar-fixed-top - .container - .navbar-header - %button.navbar-toggle.collapsed{"aria-controls" => "navbar", "aria-expanded" => "false", "data-target" => "#navbar", "data-toggle" => "collapse", :type => "button"} - %span.sr-only Toggle navigation - %span.icon-bar - %span.icon-bar - %span.icon-bar - = link_to registrar_root_path, class: 'navbar-brand', id: 'registrar-home-btn' do - = t(:registrar_head_title) - - if unstable_env.present? - .text-center - %small{style: 'color: #0074B3;'}= unstable_env - - if current_user - = render 'navbar' - - .container - = render 'shared/flash' - - if depp_controller? - = render 'registrar/shared/epp_results' - = yield - - %footer.footer - .container - .row - .col-md-6 - = image_tag 'eis-logo-et.png' - .col-md-6.text-right - Version - = CURRENT_COMMIT_HASH diff --git a/app/views/layouts/registrar/sessions.html.erb b/app/views/layouts/registrar/sessions.html.erb new file mode 100644 index 000000000..904388155 --- /dev/null +++ b/app/views/layouts/registrar/sessions.html.erb @@ -0,0 +1,54 @@ + + + + + <% if content_for? :head_title %> + <%= yield :head_title %> + <% else %> + + <%= t(:registrar_head_title) %> + + <% end %> + <%= csrf_meta_tags %> + <%= stylesheet_link_tag 'registrar-manifest', media: 'all' %> + <%= javascript_include_tag 'registrar-manifest' %> + + + + +
+ <%= render 'flash_messages' %> + <%= yield %> +
+ + + + \ No newline at end of file diff --git a/app/views/registrant/contacts/partials/_address.haml b/app/views/registrant/contacts/partials/_address.haml index 9c0f548e3..fe57bd393 100644 --- a/app/views/registrant/contacts/partials/_address.haml +++ b/app/views/registrant/contacts/partials/_address.haml @@ -8,7 +8,7 @@ %dd= @contact.org_name %dt= t(:street) - %dd= @contact.street.to_s.gsub("\n", '
').html_safe + %dd= @contact.street %dt= t(:city) %dd= @contact.city diff --git a/app/views/registrar/bulk_change/_bulk_transfer_form.html.erb b/app/views/registrar/bulk_change/_bulk_transfer_form.html.erb new file mode 100644 index 000000000..0a953845b --- /dev/null +++ b/app/views/registrar/bulk_change/_bulk_transfer_form.html.erb @@ -0,0 +1,34 @@ +<%= form_tag registrar_domain_transfers_path, multipart: true, class: 'form-horizontal' do %> + <%= render 'registrar/domain_transfers/form/api_errors' %> + +
+
+ <%= label_tag :batch_file %> +
+
+ <%= file_field_tag :batch_file, required: true %> + <%= t '.file_field_hint' %> +
+
+ +
+
+ +
+
+ +
+
+ <%= t '.help_btn' %> + +
+
+ <%= t '.help' %> +
+
+
+
+<% end %> diff --git a/app/views/registrar/registrar_nameservers/_form.html.erb b/app/views/registrar/bulk_change/_nameserver_form.html.erb similarity index 61% rename from app/views/registrar/registrar_nameservers/_form.html.erb rename to app/views/registrar/bulk_change/_nameserver_form.html.erb index 3aca3e0e1..e3f4a0214 100644 --- a/app/views/registrar/registrar_nameservers/_form.html.erb +++ b/app/views/registrar/bulk_change/_nameserver_form.html.erb @@ -1,12 +1,13 @@ -<%= form_tag registrar_update_registrar_nameserver_path, method: :put, class: 'form-horizontal' do %> +<%= form_tag registrar_nameservers_path, method: :patch, class: 'form-horizontal' do %> + <%= render 'registrar/domain_transfers/form/api_errors' %> +
<%= label_tag :old_hostname %>
-
- <%= text_field_tag :old_hostname, params[:old_hostname], autofocus: true, - required: true, +
+ <%= text_field_tag :old_hostname, params[:old_hostname], required: true, class: 'form-control' %>
@@ -16,7 +17,7 @@ <%= label_tag :new_hostname %>
-
+
<%= text_field_tag :new_hostname, params[:new_hostname], required: true, class: 'form-control' %>
@@ -27,7 +28,7 @@ <%= label_tag :ipv4 %>
-
+
<%= text_area_tag :ipv4, params[:ipv4], class: 'form-control' %>
@@ -37,17 +38,30 @@ <%= label_tag :ipv6 %>
-
+
<%= text_area_tag :ipv6, params[:ipv6], class: 'form-control' %> <%= t '.ip_hint' %>
-
+
+ +
+
+ <%= t '.help_btn' %> + +
+
+ <%= t '.help' %> +
+
+
+
<% end %> diff --git a/app/views/registrar/bulk_change/_tech_contact_form.html.erb b/app/views/registrar/bulk_change/_tech_contact_form.html.erb new file mode 100644 index 000000000..dc0693599 --- /dev/null +++ b/app/views/registrar/bulk_change/_tech_contact_form.html.erb @@ -0,0 +1,60 @@ +<%= form_tag registrar_tech_contacts_path, method: :patch, class: 'form-horizontal' do %> + <% if @error %> +
+ <%= @error[:message] %> +
+ <% end %> + +
+
+ <%= label_tag :current_contact_id, t('.current_contact_id') %> +
+ +
+ <%= text_field_tag :current_contact_id, params[:current_contact_id], + list: :contacts, + required: true, + autofocus: true, + class: 'form-control' %> +
+
+ +
+
+ <%= label_tag :new_contact_id, t('.new_contact_id') %> +
+ +
+ <%= text_field_tag :new_contact_id, params[:new_contact_id], + list: :contacts, + required: true, + class: 'form-control' %> +
+
+ +
+
+ +
+
+ +
+
+ <%= t '.help_btn' %> +
+
+ <%= t '.help' %> +
+
+
+
+<% end %> + + + <% available_contacts.each do |data| %> + + <% end %> + diff --git a/app/views/registrar/bulk_change/new.html.erb b/app/views/registrar/bulk_change/new.html.erb new file mode 100644 index 000000000..da85899ff --- /dev/null +++ b/app/views/registrar/bulk_change/new.html.erb @@ -0,0 +1,37 @@ + + + + + + + +
+
+ <%= render 'tech_contact_form', available_contacts: available_contacts %> +
+ +
+ <%= render 'nameserver_form' %> +
+ +
+ <%= render 'bulk_transfer_form' %> +
+
diff --git a/app/views/registrar/domain_transfers/form/_single.html.erb b/app/views/registrar/domain_transfers/_form.html.erb similarity index 92% rename from app/views/registrar/domain_transfers/form/_single.html.erb rename to app/views/registrar/domain_transfers/_form.html.erb index 8a9488580..52dcca468 100644 --- a/app/views/registrar/domain_transfers/form/_single.html.erb +++ b/app/views/registrar/domain_transfers/_form.html.erb @@ -1,4 +1,6 @@ <%= form_tag registrar_domain_transfers_path, multipart: true, class: 'form-horizontal' do %> + <%= render 'registrar/domain_transfers/form/api_errors' %> +
<%= label_tag :domain_name, nil, class: 'required' %> @@ -30,7 +32,7 @@
diff --git a/app/views/registrar/domain_transfers/form/_batch.html.erb b/app/views/registrar/domain_transfers/form/_batch.html.erb deleted file mode 100644 index 6effa8a86..000000000 --- a/app/views/registrar/domain_transfers/form/_batch.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<%= form_tag registrar_domain_transfers_path, multipart: true, class: 'form-horizontal' do %> -
-
- <%= label_tag :batch_file %> -
-
- <%= file_field_tag :batch_file, required: true %> - <%= t '.batch_file_help' %> -
-
- -
-
- -
-
-<% end %> diff --git a/app/views/registrar/domain_transfers/new.html.erb b/app/views/registrar/domain_transfers/new.html.erb index 8ba658023..52dd3f900 100644 --- a/app/views/registrar/domain_transfers/new.html.erb +++ b/app/views/registrar/domain_transfers/new.html.erb @@ -6,24 +6,6 @@
- - -
-
- <%= render 'registrar/domain_transfers/form/single' %> -
- -
- <%= render 'registrar/domain_transfers/form/batch' %> -
-
+ <%= render 'form' %>
diff --git a/app/views/registrar/domains/index.html.erb b/app/views/registrar/domains/index.html.erb index 319f0d04f..cbc048697 100644 --- a/app/views/registrar/domains/index.html.erb +++ b/app/views/registrar/domains/index.html.erb @@ -1,13 +1,13 @@