mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 12:08:27 +02:00
Merge branch 'master' into 2143-add-an-exception-for-DNSSEC-in-the-registry-lock
This commit is contained in:
commit
4b80ed5699
149 changed files with 550 additions and 593 deletions
|
@ -1,9 +1,7 @@
|
|||
class AuthTokenCreator
|
||||
DEFAULT_VALIDITY = 2.hours
|
||||
|
||||
attr_reader :user
|
||||
attr_reader :key
|
||||
attr_reader :expires_at
|
||||
attr_reader :user, :key, :expires_at
|
||||
|
||||
def self.create_with_defaults(user)
|
||||
new(user, Rails.application.config.secret_key_base, Time.now + DEFAULT_VALIDITY)
|
||||
|
@ -24,7 +22,7 @@ class AuthTokenCreator
|
|||
end
|
||||
|
||||
def encrypted_token
|
||||
encryptor = OpenSSL::Cipher::AES.new(256, :CBC)
|
||||
encryptor = OpenSSL::Cipher.new('aes-256-cbc')
|
||||
encryptor.encrypt
|
||||
|
||||
# OpenSSL used to automatically shrink oversized keys, it does not do that any longer.
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
class AuthTokenDecryptor
|
||||
attr_reader :decrypted_data
|
||||
attr_reader :token
|
||||
attr_reader :key
|
||||
attr_reader :user
|
||||
attr_reader :decrypted_data, :token, :key, :user
|
||||
|
||||
def self.create_with_defaults(token)
|
||||
new(token, Rails.application.config.secret_key_base)
|
||||
|
@ -14,7 +11,7 @@ class AuthTokenDecryptor
|
|||
end
|
||||
|
||||
def decrypt_token
|
||||
decipher = OpenSSL::Cipher::AES.new(256, :CBC)
|
||||
decipher = OpenSSL::Cipher.new('aes-256-cbc')
|
||||
decipher.decrypt
|
||||
|
||||
# OpenSSL used to automatically shrink oversized keys, it does not do that any longer.
|
||||
|
|
|
@ -46,9 +46,7 @@ module Deserializers
|
|||
@ds_data = []
|
||||
|
||||
# schema validation prevents both in the same parent node
|
||||
if frame.css('dsData').present?
|
||||
frame.css('dsData').each { |k| @ds_data << key_from_params(k, dsa: true) }
|
||||
end
|
||||
frame.css('dsData').each { |k| @ds_data << key_from_params(k, dsa: true) } if frame.css('dsData').present?
|
||||
|
||||
if frame.css('all')&.text == 'true'
|
||||
keys_from_domain_name(domain_name)
|
||||
|
|
|
@ -5,8 +5,7 @@ require 'deserializers/xml/dnssec'
|
|||
module Deserializers
|
||||
module Xml
|
||||
class DomainCreate
|
||||
attr_reader :frame
|
||||
attr_reader :registrar
|
||||
attr_reader :frame, :registrar
|
||||
|
||||
def initialize(frame, registrar)
|
||||
@frame = frame
|
||||
|
|
|
@ -6,7 +6,7 @@ module I18n
|
|||
|
||||
def localize(object, options = {})
|
||||
options.merge!({ default: '-' })
|
||||
object.present? ? original_localize(object, options) : ''
|
||||
object.present? ? original_localize(object, **options) : ''
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -81,12 +81,11 @@ module Serializers
|
|||
end
|
||||
|
||||
def contacts(type)
|
||||
contact_pool = begin
|
||||
if type == :tech
|
||||
domain.tech_contacts
|
||||
elsif type == :admin
|
||||
domain.admin_contacts
|
||||
end
|
||||
contact_pool = case type
|
||||
when :tech
|
||||
domain.tech_contacts
|
||||
when :admin
|
||||
domain.admin_contacts
|
||||
end
|
||||
|
||||
array_of_contacts = []
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace :contacts do
|
|||
end
|
||||
|
||||
def log(msg)
|
||||
@log ||= Logger.new(STDOUT)
|
||||
@log ||= Logger.new($stdout)
|
||||
@log.info(msg)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace :dev do
|
|||
http.ca_file = ENV['lhv_ca_file']
|
||||
|
||||
http.start do
|
||||
response = http.post(api_base_uri.path + '/payment', request_body, request_headers)
|
||||
response = http.post("#{api_base_uri.path}/payment", request_body, request_headers)
|
||||
|
||||
if response.is_a?(Net::HTTPSuccess)
|
||||
puts 'Success'
|
||||
|
|
|
@ -10,4 +10,4 @@ namespace :invoices do
|
|||
|
||||
puts "Cancelled total: #{cancelled_invoice_count}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace :invoices do
|
|||
end
|
||||
|
||||
def log(msg)
|
||||
@log ||= Logger.new(STDOUT)
|
||||
@log ||= Logger.new($stdout)
|
||||
@log.info(msg)
|
||||
end
|
||||
|
||||
|
|
|
@ -29,4 +29,4 @@ namespace :registrars do
|
|||
|
||||
puts "Invoiced total: #{invoiced_registrar_count}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
class Iso8601Validator < ActiveModel::EachValidator
|
||||
def validate_each(record, attribute, value)
|
||||
if options[:date_only]
|
||||
record.errors.add(attribute, :invalid_iso8601_date) unless value =~ date_format
|
||||
end
|
||||
record.errors.add(attribute, :invalid_iso8601_date) if options[:date_only] && value !~ date_format
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -6,9 +6,7 @@ class PhoneValidator < ActiveModel::EachValidator
|
|||
country_code = phone_parts.first
|
||||
subscriber_no = phone_parts.second
|
||||
|
||||
if zeros_only?(country_code) || zeros_only?(subscriber_no)
|
||||
record.errors.add(attribute, :invalid)
|
||||
end
|
||||
record.errors.add(attribute, :invalid) if zeros_only?(country_code) || zeros_only?(subscriber_no)
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -3,8 +3,8 @@ module Xsd
|
|||
SCHEMA_PATH = 'lib/schemas/'.freeze
|
||||
BASE_URL = 'https://epp.tld.ee/schema/'.freeze
|
||||
|
||||
REGEX_PREFIX_WITH_DASH = /(?<prefix>\w+-\w+)-(?<version>\w.\w).xsd/.freeze
|
||||
REGEX_PREFIX_WITHOUT_DASH = /(?<prefix>\w+)-(?<version>\w.\w).xsd/.freeze
|
||||
REGEX_PREFIX_WITH_DASH = /(?<prefix>\w+-\w+)-(?<version>\w.\w).xsd/
|
||||
REGEX_PREFIX_WITHOUT_DASH = /(?<prefix>\w+)-(?<version>\w.\w).xsd/
|
||||
|
||||
PREFIXES = %w[
|
||||
domain-ee
|
||||
|
@ -82,8 +82,8 @@ module Xsd
|
|||
end
|
||||
|
||||
def schemas_by_name
|
||||
prefixes.each_with_object({}) do |prefix, hash|
|
||||
hash[prefix] = xsd_schemas.select { |filename| prefix_check(prefix, filename) }.uniq.sort
|
||||
prefixes.index_with do |prefix|
|
||||
xsd_schemas.select { |filename| prefix_check(prefix, filename) }.uniq.sort
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue