mirror of
https://github.com/internetee/registry.git
synced 2025-08-06 01:35:10 +02:00
Rubocop upgraded #2711
This commit is contained in:
parent
59c73fca9e
commit
7530d6ecab
33 changed files with 115 additions and 91 deletions
|
@ -20,7 +20,6 @@ module Depp
|
|||
class << self
|
||||
attr_reader :epp_xml, :user
|
||||
|
||||
# rubocop: disable Metrics/MethodLength
|
||||
def new_from_params(params)
|
||||
new(
|
||||
id: params[:code],
|
||||
|
@ -43,8 +42,8 @@ module Depp
|
|||
country_code: params[:country_code]
|
||||
)
|
||||
end
|
||||
# rubocop: enable Metrics/MethodLength
|
||||
|
||||
# rubocop:disable Metrics/AbcSize
|
||||
def find_by_id(id)
|
||||
data = info_xml(id)
|
||||
|
||||
|
@ -77,6 +76,7 @@ module Depp
|
|||
statuses: data.css('status').map { |s| [s['s'], s.text] }
|
||||
)
|
||||
end
|
||||
# rubocop:enable Metrics/AbcSize
|
||||
|
||||
def user=(user)
|
||||
@user = user
|
||||
|
@ -170,7 +170,8 @@ module Depp
|
|||
handle_errors(data)
|
||||
end
|
||||
|
||||
# rubocop: disable Metrics/MethodLength
|
||||
# rubocop:disable Metrics/MethodLength
|
||||
# rubocop:disable Metrics/AbcSize
|
||||
def update_attributes(params)
|
||||
self.ident_country_code = params[:ident_country_code]
|
||||
self.ident_type = params[:ident_type]
|
||||
|
@ -214,7 +215,8 @@ module Depp
|
|||
data = Depp::Contact.user.request(update_xml)
|
||||
handle_errors(data)
|
||||
end
|
||||
# rubocop: enable Metrics/MethodLength
|
||||
# rubocop:enbale Metrics/AbcSize
|
||||
# rubocop:enable Metrics/MethodLength
|
||||
|
||||
def delete
|
||||
delete_xml = Contact.epp_xml.delete(
|
||||
|
|
|
@ -130,7 +130,9 @@ module Depp
|
|||
ret.with_indifferent_access
|
||||
end
|
||||
|
||||
def construct_params_from_server_data(data) # rubocop:disable Metrics/MethodLength
|
||||
# rubocop:disable Metrics/MethodLength
|
||||
# rubocop:disable Metrics/AbcSize
|
||||
def construct_params_from_server_data(data)
|
||||
ret = default_params
|
||||
ret[:name] = data.css('name').text
|
||||
ret[:registrant] = data.css('registrant').text
|
||||
|
@ -176,6 +178,8 @@ module Depp
|
|||
|
||||
ret
|
||||
end
|
||||
# rubocop:enable Metrics/MethodLength
|
||||
# rubocop:enable Metrics/AbcSize
|
||||
|
||||
def construct_custom_params_hash(domain_params)
|
||||
custom_params = {}
|
||||
|
@ -233,7 +237,7 @@ module Depp
|
|||
host_attr << { hostAddr: { value: v['ipv4'], attrs: { ip: 'v4' } } } if v['ipv4'].present?
|
||||
host_attr << { hostAddr: { value: v['ipv6'], attrs: { ip: 'v6' } } } if v['ipv6'].present?
|
||||
|
||||
ret << { hostAttr: host_attr }
|
||||
ret << { hostAttr: host_attr }
|
||||
end
|
||||
|
||||
ret
|
||||
|
@ -256,11 +260,11 @@ module Depp
|
|||
domain_params[:dnskeys_attributes].each do |_k, v|
|
||||
if v['ds_key_tag'].blank?
|
||||
kd = create_key_data_hash(v)
|
||||
ret << {
|
||||
ret << {
|
||||
keyData: kd
|
||||
} if kd
|
||||
else
|
||||
ret << {
|
||||
ret << {
|
||||
dsData: [
|
||||
keyTag: { value: v['ds_key_tag'] },
|
||||
alg: { value: v['ds_alg'] },
|
||||
|
|
|
@ -8,7 +8,7 @@ module Depp
|
|||
self.epp_xml = EppXml::Keyrelay.new(cl_trid_prefix: current_user.tag)
|
||||
end
|
||||
|
||||
def keyrelay(params) # rubocop:disable Metrics/MethodLength
|
||||
def keyrelay(params)
|
||||
custom_params = {}
|
||||
if params[:legal_document].present?
|
||||
type = params[:legal_document].original_filename.split('.').last.downcase
|
||||
|
|
|
@ -36,6 +36,7 @@ module Depp
|
|||
Nokogiri::XML(e.response_xml.to_s).remove_namespaces!
|
||||
end
|
||||
|
||||
# rubocop:disable Metrics/AbcSize
|
||||
def repp_request(path, params = {})
|
||||
client_cert = File.read(ENV['cert_path'])
|
||||
client_key = File.read(ENV['key_path'])
|
||||
|
@ -51,8 +52,7 @@ module Depp
|
|||
use_ssl: (uri.scheme == 'https'),
|
||||
verify_mode: OpenSSL::SSL::VERIFY_NONE,
|
||||
cert: OpenSSL::X509::Certificate.new(client_cert),
|
||||
key: OpenSSL::PKey::RSA.new(client_key)
|
||||
) do |http|
|
||||
key: OpenSSL::PKey::RSA.new(client_key)) do |http|
|
||||
http.request(req)
|
||||
end
|
||||
|
||||
|
@ -67,6 +67,7 @@ module Depp
|
|||
|
||||
ret
|
||||
end
|
||||
# rubocop:enable Metrics/AbcSize
|
||||
|
||||
private
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue