mirror of
https://github.com/internetee/registry.git
synced 2025-08-02 16:02:03 +02:00
Add registrant phone to whois record json
This commit is contained in:
parent
3401a9fc47
commit
5c70e9f38b
5 changed files with 21 additions and 17 deletions
|
@ -47,7 +47,7 @@ module Zone::WhoisQueryable
|
|||
def registrant_vars
|
||||
{ registrant: Setting.registry_juridical_name, registrant_reg_no: Setting.registry_reg_no,
|
||||
registrant_ident_country_code: Setting.registry_country_code, registrant_kind: 'org',
|
||||
registrant_disclosed_attributes: %w[name email] }
|
||||
registrant_disclosed_attributes: %w[name email phone] }
|
||||
end
|
||||
|
||||
def contact_vars
|
||||
|
|
|
@ -15,15 +15,6 @@ class ContactRequest < ApplicationRecord
|
|||
attr_readonly :secret,
|
||||
:valid_to
|
||||
|
||||
def self.save_record(params)
|
||||
contact_request = new(params)
|
||||
contact_request.secret = create_random_secret
|
||||
contact_request.valid_to = set_valid_to_24_hours_from_now
|
||||
contact_request.status = STATUS_NEW
|
||||
contact_request.save!
|
||||
contact_request
|
||||
end
|
||||
|
||||
def update_record(params)
|
||||
self.status = params['status'] if params['status']
|
||||
self.ip_address = params['ip'] if params['ip']
|
||||
|
@ -31,11 +22,22 @@ class ContactRequest < ApplicationRecord
|
|||
save!
|
||||
end
|
||||
|
||||
def self.create_random_secret
|
||||
SecureRandom.hex(64)
|
||||
end
|
||||
class << self
|
||||
def save_record(params)
|
||||
contact_request = new(params)
|
||||
contact_request.secret = create_random_secret
|
||||
contact_request.valid_to = set_valid_to_24_hours_from_now
|
||||
contact_request.status = STATUS_NEW
|
||||
contact_request.save!
|
||||
contact_request
|
||||
end
|
||||
|
||||
def self.set_valid_to_24_hours_from_now
|
||||
(Time.zone.now + 24.hours)
|
||||
def create_random_secret
|
||||
SecureRandom.hex(64)
|
||||
end
|
||||
|
||||
def set_valid_to_24_hours_from_now
|
||||
(Time.zone.now + 24.hours)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -51,6 +51,7 @@ class WhoisRecord < ApplicationRecord
|
|||
end
|
||||
|
||||
h[:email] = registrant.email
|
||||
h[:phone] = registrant.phone
|
||||
h[:registrant_changed] = registrant.updated_at.try(:to_s, :iso8601)
|
||||
h[:registrant_disclosed_attributes] = registrant.disclosed_attributes
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue