mirror of
https://github.com/internetee/registry.git
synced 2025-07-13 22:45:06 +02:00
Remove auth info changing ability
This commit is contained in:
parent
1bf886a6bf
commit
1ebf7b5e21
3 changed files with 5 additions and 12 deletions
|
@ -43,7 +43,6 @@ module Epp::DomainsHelper
|
||||||
@domain.parse_and_attach_domain_dependencies(@ph, parsed_frame.css('add'))
|
@domain.parse_and_attach_domain_dependencies(@ph, parsed_frame.css('add'))
|
||||||
@domain.parse_and_detach_domain_dependencies(parsed_frame.css('rem'))
|
@domain.parse_and_detach_domain_dependencies(parsed_frame.css('rem'))
|
||||||
@domain.parse_and_update_domain_dependencies(parsed_frame.css('chg'))
|
@domain.parse_and_update_domain_dependencies(parsed_frame.css('chg'))
|
||||||
@domain.parse_and_update_domain_attributes(parsed_frame.css('chg'))
|
|
||||||
|
|
||||||
if @domain.errors.any?
|
if @domain.errors.any?
|
||||||
handle_errors(@domain)
|
handle_errors(@domain)
|
||||||
|
|
|
@ -76,8 +76,10 @@ class Domain < ActiveRecord::Base
|
||||||
errors.empty?
|
errors.empty?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# TODO: Find out if there are any attributes that can be changed
|
||||||
|
# if not, delete this method
|
||||||
def parse_and_update_domain_attributes(parsed_frame)
|
def parse_and_update_domain_attributes(parsed_frame)
|
||||||
assign_attributes(self.class.parse_update_params_from_frame(parsed_frame))
|
#assign_attributes(self.class.parse_update_params_from_frame(parsed_frame))
|
||||||
|
|
||||||
errors.empty?
|
errors.empty?
|
||||||
end
|
end
|
||||||
|
@ -391,15 +393,6 @@ class Domain < ActiveRecord::Base
|
||||||
res
|
res
|
||||||
end
|
end
|
||||||
|
|
||||||
def parse_update_params_from_frame(parsed_frame)
|
|
||||||
ret = {}
|
|
||||||
return ret if parsed_frame.blank?
|
|
||||||
|
|
||||||
ret[:auth_info] = parsed_frame.css('pw').try(:text)
|
|
||||||
|
|
||||||
ret.compact
|
|
||||||
end
|
|
||||||
|
|
||||||
def check_availability(domains)
|
def check_availability(domains)
|
||||||
domains = [domains] if domains.is_a?(String)
|
domains = [domains] if domains.is_a?(String)
|
||||||
|
|
||||||
|
|
|
@ -488,6 +488,7 @@ describe 'EPP Domain', epp: true do
|
||||||
|
|
||||||
it 'updates a domain' do
|
it 'updates a domain' do
|
||||||
Fabricate(:contact, code: 'mak21')
|
Fabricate(:contact, code: 'mak21')
|
||||||
|
existing_pw = Domain.first.auth_info
|
||||||
|
|
||||||
xml_params = {
|
xml_params = {
|
||||||
chg: [
|
chg: [
|
||||||
|
@ -504,7 +505,7 @@ describe 'EPP Domain', epp: true do
|
||||||
d = Domain.last
|
d = Domain.last
|
||||||
|
|
||||||
expect(d.owner_contact_code).to eq('mak21')
|
expect(d.owner_contact_code).to eq('mak21')
|
||||||
expect(d.auth_info).to eq('2BARfoo')
|
expect(d.auth_info).to eq(existing_pw)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'does not assign invalid status to domain' do
|
it 'does not assign invalid status to domain' do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue