class EPPClient::AFNIC
This handles the AFNIC specificities.
Constants
- SCHEMAS_AFNIC
Public Class Methods
Sets the default for AFNIC, that is, server and port, according to AFNIC's documentation. www.afnic.fr/doc/interface/epp
Optional Attributes¶ ↑
:test
-
sets the server to be the test server.
# File lib/epp-client/afnic.rb, line 26 def initialize(args) args[:server] ||= if args.delete(:test) == true 'epp.sandbox.nic.fr' else 'epp.nic.fr' end @services = EPPClient::SCHEMAS_URL.values_at('domain', 'contact') args[:port] ||= 700 super(args) @extensions << EPPClient::SCHEMAS_URL['frnic'] end
Public Instance Methods
Extends the EPPClient::Contact#contact_create so that the specific AFNIC create informations can be sent, the additionnal informations are :
either :
:legalEntityInfos
-
indicating that the contact is an organisation with the following informations :
:idStatus
-
indicates the identification process status.
:legalStatus
-
should be either
company
,association
orother
. :siren
-
contains the SIREN number of the organisation.
:VAT
-
is optional and contains the VAT number of the organisation.
:trademark
-
is optional and contains the trademark number of the organisation.
:DUNS
-
is optional and contains the Data Universal Numbering System number of the organisation.
:local
-
is optional and contains an identifier local to the eligible country.
:asso
-
indicates the organisation is an association and contains either a
waldec
or adecl
and apubl
::waldec
-
contains the waldec id of the association.
:decl
-
optionally indicate the date of the association was declared at the prefecture.
:publ
-
contains informations regarding the publication in the “Journal Officiel” :
:date
-
the date of publication.
:page
-
the page the announce is on.
:announce
-
the announce number on the page (optional).
:individualInfos
-
indicating that the contact is a person with the following informations :
:idStatus
-
indicates the identification process status.
:birthDate
-
the date of birth of the contact.
:birthCity
-
the city of birth of the contact.
:birthPc
-
the postal code of the city of birth.
:birthCc
-
the country code of the place of birth.
Additionnaly, when the contact is a person, there can be the following informations :
:firstName
-
the first name of the person. (The last name being stored in the
name
field in thepostalInfo
.) :list
-
with the value of
restrictedPublication
mean that the element diffusion should be restricted.
Optionnaly, there can be :
:reachable
-
the contact is reachable through the optional
:media
.
The returned information contains new keys :
:idStatus
-
indicates the identification process status. It's only present when the created contact was created with the
:individualInfos
or:legalEntityInfos
extensions. :nhStatus
-
is a boolean indicating wether the contact is really new, or if there was already a contact with the exact same informations in the database, in which case, it has been returned.
# File lib/epp-client/afnic.rb, line 359 def contact_create(contact) super # placeholder so that I can add some doc end
Raises an exception, as contacts are deleted with a garbage collector.
# File lib/epp-client/afnic.rb, line 382 def contact_delete(_args) raise NotImplementedError, 'Contacts are deleted with a garbage collector' end
Extends the EPPClient::Contact#contact_info so that the specific AFNIC check informations are processed, the additionnal informations are :
either :
:legalEntityInfos
-
indicating that the contact is an organisation with the following informations :
:legalStatus
-
should be either
company
,association
orother
. :idStatus
-
indicates the identification process status. Has optional
:when
and:source
attributes. :siren
-
contains the SIREN number of the organisation.
:VAT
-
is optional and contains the VAT number of the organisation.
:trademark
-
is optional and contains the trademark number of the organisation.
:DUNS
-
is optional and contains the Data Universal Numbering System number of the organisation.
:local
-
is optional and contains an identifier local to the eligible country.
:asso
-
indicates the organisation is an association and contains either a
waldec
or adecl
and apubl
::waldec
-
contains the waldec id of the association.
:decl
-
optionally indicate the date of the association was declared at the prefecture.
:publ
-
contains informations regarding the publication in the “Journal Officiel” :
:date
-
the date of publication.
:page
-
the page the announce is on.
:announce
-
the announce number on the page (optional).
:individualInfos
-
indicating that the contact is a person with the following informations :
:idStatus
-
indicates the identification process status. Has optional
:when
and:source
attributes. :birthDate
-
the date of birth of the contact.
:birthCity
-
the city of birth of the contact.
:birthPc
-
the postal code of the city of birth.
:birthCc
-
the country code of the place of birth.
Additionnaly, when the contact is a person, there can be the following informations :
:firstName
-
the first name of the person. (The last name being stored in the
name
field in thepostalInfo
.) :list
-
with the value of
restrictedPublication
mean that the element diffusion should be restricted.
Optionnaly, there can be :
:obsoleted
-
the contact info is obsolete since/from the optional date
:when
. :reachable
-
the contact is reachable through the optional
:media
since/from the optional date:when
. The info having been specified by the:source
.
# File lib/epp-client/afnic.rb, line 179 def contact_info(contact) super # placeholder so that I can add some doc end
Extends the EPPClient::Contact#contact_update so that the specific AFNIC update informations can be sent, the additionnal informations are :
:add
/:rem
-
adds or removes the following datas :
:list
-
with the value of
restrictedPublication
mean that the element diffusion should/should not be restricted. :idStatus
-
indicates the identification process status.
:reachable
-
the contact is reachable through the optional
:media
.
# File lib/epp-client/afnic.rb, line 429 def contact_update(args) super # placeholder so that I can add some doc end
Extends the EPPClient::Domain#domain_check so that the specific AFNIC check informations are processed, the additionnal informations are :
:reserved
-
the domain is a reserved name.
:rsvReason
-
the optional reason why the domain is reserved.
:forbidden
-
the domain is a forbidden name.
:fbdReason
-
the optional reason why the domain is forbidden.
# File lib/epp-client/afnic.rb, line 45 def domain_check(*domains) super # placeholder so that I can add some doc end
Extends the EPPClient::Domain#domain_create to make sure there's no
:ns
, :dsData
or :keyData
records,
AFNIC's servers sends quite a strange error when there is.
# File lib/epp-client/afnic.rb, line 375 def domain_create(args) raise ArgumentError, "You can't create a domain with ns records, you must do an update afterwards" if args.key?(:ns) raise ArgumentError, "You can't create a domain with ds or key records, you must do an update afterwards" if args.key?(:dsData) || args.key?(:keyData) super end
Extends the EPPClient::Domain#domain_info so that the specific AFNIC :status
can be added.
# File lib/epp-client/afnic.rb, line 68 def domain_info(domain) super # placeholder so that I can add some doc end
Extends the EPPClient::Domain#domain_update so that AFNIC's weirdnesses can be taken into account.
AFNIC does not support ns/hostObj, only ns/hostAttr/Host*, so, take care of this here. Also, you can only do one of the following at a time :
-
update contacts
-
update name servers
-
update status & authInfo
# File lib/epp-client/afnic.rb, line 442 def domain_update(args) if args.key?(:chg) && args[:chg].key?(:registrant) raise ArgumentError, 'You need to do a trade or recover operation to change the registrant' end has_contacts = args.key?(:add) && args[:add].key?(:contacts) || args.key?(:add) && args[:add].key?(:contacts) has_ns = args.key?(:add) && args[:add].key?(:ns) || args.key?(:add) && args[:add].key?(:ns) has_other = args.key?(:add) && args[:add].key?(:status) || args.key?(:add) && args[:add].key?(:status) || args.key?(:chg) && args[:chg].key?(:authInfo) if [has_contacts, has_ns, has_other].count { |v| v } > 1 raise ArgumentError, "You can't update all that at one time" end [:add, :rem].each do |ar| if args.key?(ar) && args[ar].key?(:ns) && args[ar][:ns].first.is_a?(String) args[ar][:ns] = args[ar][:ns].map { |ns| { :hostName => ns } } end end super end
Extends the EPPClient::Poll#poll_req to be able to parse quallification response extension.
# File lib/epp-client/afnic.rb, line 462 def poll_req super # placeholder so that I can add some doc end