This commit is contained in:
Martin Lensment 2015-07-23 12:21:53 +03:00
parent c79fee5a49
commit 2148cc57e5
16 changed files with 935 additions and 24 deletions

View file

@ -9,13 +9,9 @@ class EppController < ApplicationController
before_action :validate_against_schema
def validate_against_schema
# filename =
# if params[:epp_object_type] == :domain
return if params[:action] == 'hello'
params[:schema] = 'epp-1.0.xsd' unless params[:schema]
xsd = Nokogiri::XML::Schema(File.read("doc/schemas/#{params[:schema]}"))
xsd = Nokogiri::XML::Schema(File.read("lib/schemas/#{params[:schema]}"))
xsd.validate(Nokogiri::XML(params[:raw_frame])).each do |error|
epp_errors << {
code: 2001,
@ -23,7 +19,6 @@ class EppController < ApplicationController
}
end
# end
handle_errors and return if epp_errors.any?
end

View file

@ -2,8 +2,8 @@ require 'epp_constraint'
Rails.application.routes.draw do
namespace(:epp, defaults: { format: :xml }) do
match 'session/:action', controller: 'sessions', via: :all
match 'session/pki/:action', controller: 'sessions', via: :all
match 'session/:action', controller: 'sessions', via: :all, constraints: EppConstraint.new(:session)
match 'session/pki/:action', controller: 'sessions', via: :all, constraints: EppConstraint.new(:session)
post 'command/:action', controller: 'domains', constraints: EppConstraint.new(:domain)
post 'command/:action', controller: 'contacts', constraints: EppConstraint.new(:contact)

View file

@ -16,15 +16,11 @@ Our implementation supports following protocols:
[RFC5910 - DNSSEC Mapping](http://tools.ietf.org/html/rfc5910)
[RFC3735 - Guidelines for Extending the EPP](http://tools.ietf.org/html/rfc3735)
Related XML Schema Definitions (may differ from policies applied to registry):
EIS specific XML Schema Definitions (may differ from policies applied to registry):
[contact-eis-1.0.xsd](schemas/contact-eis-1.0.xsd)
[domain-eis-1.0.xsd](schemas/domain-eis-1.0.xsd)
[eis-1.0.xsd](schemas/eis-1.0.xsd)
[epp-1.0.xsd](schemas/epp-1.0.xsd)
[eppcom-1.0.xsd](schemas/eppcom-1.0.xsd)
[host-1.0.xsd](schemas/host-1.0.xsd)
[secDNS-1.1.xsd](schemas/secDNS-1.1.xsd)
More info about The Extensible Provisioning Protocol (EPP):<br>
http://en.wikipedia.org/wiki/Extensible_Provisioning_Protocol

View file

@ -11,10 +11,10 @@
<!--
Import common element types.
-->
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0" schemaLocation="doc/schemas/eppcom-1.0.xsd"/>
<import namespace="urn:ietf:params:xml:ns:epp-1.0" schemaLocation="doc/schemas/epp-1.0.xsd"/>
<import namespace="urn:ietf:params:xml:ns:host-1.0" schemaLocation="doc/schemas/host-1.0.xsd"/>
<import namespace="urn:ietf:params:xml:ns:secDNS-1.1" schemaLocation="doc/schemas/secDNS-1.1.xsd"/>
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0" schemaLocation="http://www.iana.org/assignments/xml-registry/schema/eppcom-1.0.xsd"/>
<import namespace="urn:ietf:params:xml:ns:epp-1.0" schemaLocation="http://www.iana.org/assignments/xml-registry/schema/epp-1.0.xsd"/>
<import namespace="urn:ietf:params:xml:ns:host-1.0" schemaLocation="http://www.iana.org/assignments/xml-registry/schema/host-1.0.xsd"/>
<import namespace="urn:ietf:params:xml:ns:secDNS-1.1" schemaLocation="http://www.iana.org/assignments/xml-registry/schema/secDNS-1.1.xsd"/>
<import namespace="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd" schemaLocation="doc/schemas/eis-1.0.xsd"/>
<annotation>

View file

@ -12,9 +12,10 @@ class EppConstraint
def matches?(request)
parsed_frame = Nokogiri::XML(request.params[:raw_frame])
unless [:keyrelay, :poll].include?(@type)
unless [:keyrelay, :poll, :session].include?(@type)
element = "//#{@type}:#{request.params[:action]}"
return false if parsed_frame.xpath("#{element}", OBJECT_TYPES[@type]).none?
# TODO: Support multiple schemas
request.params[:schema] = OBJECT_TYPES[@type][@type].split('/').last
end

View file

@ -0,0 +1,366 @@
<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd"
xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd"
xmlns:epp="urn:ietf:params:xml:ns:epp-1.0"
xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"
xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<!--
Import common element types.
-->
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0" schemaLocation="lib/schemas/eppcom-1.0.xsd"/>
<import namespace="urn:ietf:params:xml:ns:epp-1.0" schemaLocation="lib/schemas/epp-1.0.xsd"/>
<import namespace="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd" schemaLocation="lib/schemas/eis-1.0.xsd"/>
<annotation>
<documentation>
Extensible Provisioning Protocol v1.0
contact provisioning schema.
</documentation>
</annotation>
<!--
Child elements found in EPP commands.
-->
<element name="check" type="contact:mIDType"/>
<element name="create" type="contact:createType"/>
<element name="delete" type="contact:authIDType"/>
<element name="info" type="contact:authIDType"/>
<element name="transfer" type="contact:authIDType"/>
<element name="update" type="contact:updateType"/>
<!--
Utility types.
-->
<simpleType name="ccType">
<restriction base="token">
<length value="2"/>
</restriction>
</simpleType>
<complexType name="e164Type">
<simpleContent>
<extension base="contact:e164StringType">
<attribute name="x" type="token"/>
</extension>
</simpleContent>
</complexType>
<simpleType name="e164StringType">
<restriction base="token">
<!--<pattern value="(\+[0-9]{1,3}\.[0-9]{1,14})?"/> -->
<maxLength value="17"/>
</restriction>
</simpleType>
<simpleType name="pcType">
<restriction base="token">
<maxLength value="16"/>
</restriction>
</simpleType>
<simpleType name="postalLineType">
<restriction base="normalizedString">
<minLength value="1"/>
<maxLength value="255"/>
</restriction>
</simpleType>
<simpleType name="optPostalLineType">
<restriction base="normalizedString">
<maxLength value="255"/>
</restriction>
</simpleType>
<!--
Child elements of the <create> command.
-->
<complexType name="createType">
<sequence>
<element name="id" type="eppcom:clIDType" minOccurs="0"/>
<element name="postalInfo" type="contact:postalInfoType"
maxOccurs="2"/>
<element name="voice" type="contact:e164Type"
minOccurs="0"/>
<element name="fax" type="contact:e164Type"
minOccurs="0"/>
<element name="email" type="eppcom:minTokenType"/>
<element name="authInfo" type="contact:authInfoType" minOccurs="0"/>
</sequence>
</complexType>
<complexType name="postalInfoType">
<sequence>
<element name="name" type="contact:postalLineType"/>
<element name="org" type="contact:optPostalLineType"
minOccurs="0"/>
<element name="addr" type="contact:addrType"/>
</sequence>
<attribute name="type" type="contact:postalInfoEnumType"/>
</complexType>
<simpleType name="postalInfoEnumType">
<restriction base="token">
<enumeration value="loc"/>
<enumeration value="int"/>
</restriction>
</simpleType>
<complexType name="addrType">
<sequence>
<element name="street" type="contact:optPostalLineType"
minOccurs="0" maxOccurs="3"/>
<element name="city" type="contact:postalLineType"/>
<element name="sp" type="contact:optPostalLineType"
minOccurs="0"/>
<element name="pc" type="contact:pcType"
minOccurs="0"/>
<element name="cc" type="contact:ccType"/>
</sequence>
</complexType>
<complexType name="authInfoType">
<choice>
<element name="pw" type="eppcom:pwAuthInfoType"/>
<element name="ext" type="eppcom:extAuthInfoType"/>
</choice>
</complexType>
<complexType name="intLocType">
<attribute name="type" type="contact:postalInfoEnumType"
use="required"/>
</complexType>
<!--
Child element of commands that require only an identifier.
-->
<complexType name="sIDType">
<sequence>
<element name="id" type="eppcom:clIDType"/>
</sequence>
</complexType>
<!--
Child element of commands that accept multiple identifiers.
-->
<complexType name="mIDType">
<sequence>
<element name="id" type="eppcom:clIDType"
maxOccurs="unbounded"/>
</sequence>
</complexType>
<!--
Child elements of the <info> and <transfer> commands.
-->
<complexType name="authIDType">
<sequence>
<element name="id" type="eppcom:clIDType"/>
<element name="authInfo" type="contact:authInfoType"
minOccurs="0"/>
</sequence>
</complexType>
<!--
Child elements of the <update> command.
-->
<complexType name="updateType">
<sequence>
<element name="id" type="eppcom:clIDType"/>
<element name="add" type="contact:addRemType"
minOccurs="0"/>
<element name="rem" type="contact:addRemType"
minOccurs="0"/>
<element name="chg" type="contact:chgType"
minOccurs="0"/>
</sequence>
</complexType>
<!--
Data elements that can be added or removed.
-->
<complexType name="addRemType">
<sequence>
<element name="status" type="contact:statusType"
maxOccurs="7"/>
</sequence>
</complexType>
<!--
Data elements that can be changed.
-->
<complexType name="chgType">
<sequence>
<element name="postalInfo" type="contact:chgPostalInfoType"
minOccurs="0" maxOccurs="2"/>
<element name="voice" type="contact:e164Type"
minOccurs="0"/>
<element name="fax" type="contact:e164Type"
minOccurs="0"/>
<element name="email" type="eppcom:minTokenType"
minOccurs="0"/>
<element name="authInfo" type="contact:authInfoType"
minOccurs="0"/>
</sequence>
</complexType>
<complexType name="chgPostalInfoType">
<sequence>
<element name="name" type="contact:postalLineType"
minOccurs="0"/>
<element name="org" type="contact:optPostalLineType"
minOccurs="0"/>
<element name="addr" type="contact:addrType"
minOccurs="0"/>
</sequence>
<attribute name="type" type="contact:postalInfoEnumType"/>
</complexType>
<!--
Child response elements.
-->
<element name="chkData" type="contact:chkDataType"/>
<element name="creData" type="contact:creDataType"/>
<element name="infData" type="contact:infDataType"/>
<element name="panData" type="contact:panDataType"/>
<element name="trnData" type="contact:trnDataType"/>
<!--
<check> response elements.
-->
<complexType name="chkDataType">
<sequence>
<element name="cd" type="contact:checkType"
maxOccurs="unbounded"/>
</sequence>
</complexType>
<complexType name="checkType">
<sequence>
<element name="id" type="contact:checkIDType"/>
<element name="reason" type="eppcom:reasonType"
minOccurs="0"/>
</sequence>
</complexType>
<complexType name="checkIDType">
<simpleContent>
<extension base="eppcom:clIDType">
<attribute name="avail" type="boolean"
use="required"/>
</extension>
</simpleContent>
</complexType>
<!--
<create> response elements.
-->
<complexType name="creDataType">
<sequence>
<element name="id" type="eppcom:clIDType"/>
<element name="crDate" type="dateTime"/>
</sequence>
</complexType>
<!--
<info> response elements.
-->
<complexType name="infDataType">
<sequence>
<element name="id" type="eppcom:clIDType"/>
<element name="roid" type="eppcom:roidType"/>
<element name="status" type="contact:statusType"
maxOccurs="7"/>
<element name="postalInfo" type="contact:postalInfoType"
maxOccurs="2"/>
<element name="voice" type="contact:e164Type"
minOccurs="0"/>
<element name="fax" type="contact:e164Type"
minOccurs="0"/>
<element name="email" type="eppcom:minTokenType"/>
<element name="clID" type="eppcom:clIDType"/>
<element name="crID" type="eppcom:clIDType"/>
<element name="crDate" type="dateTime"/>
<element name="upID" type="eppcom:clIDType"
minOccurs="0"/>
<element name="upDate" type="dateTime"
minOccurs="0"/>
<element name="trDate" type="dateTime"
minOccurs="0"/>
<element name="authInfo" type="contact:authInfoType"
minOccurs="0"/>
</sequence>
</complexType>
<!--
Status is a combination of attributes and an optional human-readable
message that may be expressed in languages other than English.
-->
<complexType name="statusType">
<simpleContent>
<extension base="normalizedString">
<attribute name="s" type="contact:statusValueType"
use="required"/>
<attribute name="lang" type="language"
default="en"/>
</extension>
</simpleContent>
</complexType>
<simpleType name="statusValueType">
<restriction base="token">
<enumeration value="clientDeleteProhibited"/>
<enumeration value="clientTransferProhibited"/>
<enumeration value="clientUpdateProhibited"/>
<enumeration value="linked"/>
<enumeration value="ok"/>
<enumeration value="pendingCreate"/>
<enumeration value="pendingDelete"/>
<enumeration value="pendingTransfer"/>
<enumeration value="pendingUpdate"/>
<enumeration value="serverDeleteProhibited"/>
<enumeration value="serverTransferProhibited"/>
<enumeration value="serverUpdateProhibited"/>
</restriction>
</simpleType>
<!--
Pending action notification response elements.
-->
<complexType name="panDataType">
<sequence>
<element name="id" type="contact:paCLIDType"/>
<element name="paTRID" type="epp:trIDType"/>
<element name="paDate" type="dateTime"/>
</sequence>
</complexType>
<complexType name="paCLIDType">
<simpleContent>
<extension base="eppcom:clIDType">
<attribute name="paResult" type="boolean"
use="required"/>
</extension>
</simpleContent>
</complexType>
<!--
<transfer> response elements.
-->
<complexType name="trnDataType">
<sequence>
<element name="id" type="eppcom:clIDType"/>
<element name="trStatus" type="eppcom:trStatusType"/>
<element name="reID" type="eppcom:clIDType"/>
<element name="reDate" type="dateTime"/>
<element name="acID" type="eppcom:clIDType"/>
<element name="acDate" type="dateTime"/>
</sequence>
</complexType>
<!--
End of schema.
-->
</schema>

View file

@ -0,0 +1,451 @@
<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd"
xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd"
xmlns:host="urn:ietf:params:xml:ns:host-1.0"
xmlns:epp="urn:ietf:params:xml:ns:epp-1.0"
xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"
xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<!--
Import common element types.
-->
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0" schemaLocation="lib/schemas/eppcom-1.0.xsd"/>
<import namespace="urn:ietf:params:xml:ns:epp-1.0" schemaLocation="lib/schemas/epp-1.0.xsd"/>
<import namespace="urn:ietf:params:xml:ns:host-1.0" schemaLocation="lib/schemas/host-1.0.xsd"/>
<import namespace="urn:ietf:params:xml:ns:secDNS-1.1" schemaLocation="lib/schemas/secDNS-1.1.xsd"/>
<import namespace="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd" schemaLocation="lib/schemas/eis-1.0.xsd"/>
<annotation>
<documentation>
Extensible Provisioning Protocol v1.0
domain provisioning schema.
</documentation>
</annotation>
<!--
Child elements found in EPP commands.
-->
<element name="check" type="domain:mNameType"/>
<element name="create" type="domain:createType"/>
<element name="delete" type="domain:sNameType"/>
<element name="info" type="domain:infoType"/>
<element name="renew" type="domain:renewType"/>
<element name="transfer" type="domain:transferType"/>
<element name="update" type="domain:updateType"/>
<!--
Child elements of the <create> command.
-->
<complexType name="createType">
<sequence>
<element name="name" type="eppcom:labelType"/>
<element name="period" type="domain:periodType"
minOccurs="0"/>
<element name="ns" type="domain:nsType"
minOccurs="0"/>
<element name="registrant" type="eppcom:clIDType"
minOccurs="0"/>
<element name="contact" type="domain:contactType"
minOccurs="0" maxOccurs="unbounded"/>
<element name="authInfo" type="domain:authInfoType" minOccurs="0"/>
</sequence>
</complexType>
<complexType name="periodType">
<simpleContent>
<extension base="domain:pLimitType">
<attribute name="unit" type="domain:pUnitType"
use="required"/>
</extension>
</simpleContent>
</complexType>
<simpleType name="pLimitType">
<restriction base="unsignedShort">
<minInclusive value="1"/>
<maxInclusive value="1095"/>
</restriction>
</simpleType>
<simpleType name="pUnitType">
<restriction base="token">
<enumeration value="y"/>
<enumeration value="m"/>
<enumeration value="d"/>
</restriction>
</simpleType>
<complexType name="nsType">
<choice>
<element name="hostObj" type="eppcom:labelType"
maxOccurs="unbounded"/>
<element name="hostAttr" type="domain:hostAttrType"
maxOccurs="unbounded"/>
</choice>
</complexType>
<!--
Name servers are either host objects or attributes.
-->
<complexType name="hostAttrType">
<sequence>
<element name="hostName" type="eppcom:labelType"/>
<element name="hostAddr" type="host:addrType"
minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</complexType>
<!--
If attributes, addresses are optional and follow the
structure defined in the host mapping.
-->
<complexType name="contactType">
<simpleContent>
<extension base="eppcom:clIDType">
<attribute name="type" type="domain:contactAttrType"/>
</extension>
</simpleContent>
</complexType>
<simpleType name="contactAttrType">
<restriction base="token">
<enumeration value="admin"/>
<enumeration value="billing"/>
<enumeration value="tech"/>
</restriction>
</simpleType>
<complexType name="authInfoType">
<choice>
<element name="pw" type="eppcom:pwAuthInfoType"/>
<element name="ext" type="eppcom:extAuthInfoType"/>
</choice>
</complexType>
<!--
Child element of commands that require a single name.
-->
<complexType name="sNameType">
<sequence>
<element name="name" type="eppcom:labelType"/>
</sequence>
</complexType>
<!--
Child element of commands that accept multiple names.
-->
<complexType name="mNameType">
<sequence>
<element name="name" type="eppcom:labelType"
maxOccurs="unbounded"/>
</sequence>
</complexType>
<!--
Child elements of the <info> command.
-->
<complexType name="infoType">
<sequence>
<element name="name" type="domain:infoNameType"/>
<element name="authInfo" type="domain:authInfoType"
minOccurs="0"/>
</sequence>
</complexType>
<complexType name="infoNameType">
<simpleContent>
<extension base = "eppcom:labelType">
<attribute name="hosts" type="domain:hostsType"
default="all"/>
</extension>
</simpleContent>
</complexType>
<simpleType name="hostsType">
<restriction base="token">
<enumeration value="all"/>
<enumeration value="del"/>
<enumeration value="none"/>
<enumeration value="sub"/>
</restriction>
</simpleType>
<!--
Child elements of the <renew> command.
-->
<complexType name="renewType">
<sequence>
<element name="name" type="eppcom:labelType"/>
<element name="curExpDate" type="date"/>
<element name="period" type="domain:periodType"
minOccurs="0"/>
</sequence>
</complexType>
<!--
Child elements of the <transfer> command.
-->
<complexType name="transferType">
<sequence>
<element name="name" type="eppcom:labelType"/>
<element name="period" type="domain:periodType"
minOccurs="0"/>
<element name="authInfo" type="domain:authInfoType"
minOccurs="0"/>
</sequence>
</complexType>
<!--
Child elements of the <update> command.
-->
<complexType name="updateType">
<sequence>
<element name="name" type="eppcom:labelType"/>
<element name="add" type="domain:addRemType"
minOccurs="0"/>
<element name="rem" type="domain:addRemType"
minOccurs="0"/>
<element name="chg" type="domain:chgType"
minOccurs="0"/>
</sequence>
</complexType>
<!--
Data elements that can be added or removed.
-->
<complexType name="addRemType">
<sequence>
<element name="ns" type="domain:nsType"
minOccurs="0"/>
<element name="contact" type="domain:contactType"
minOccurs="0" maxOccurs="unbounded"/>
<element name="status" type="domain:statusType"
minOccurs="0" maxOccurs="11"/>
</sequence>
</complexType>
<!--
Data elements that can be changed.
-->
<complexType name="chgType">
<sequence>
<element name="registrant" type="domain:clIDChgType"
minOccurs="0"/>
<element name="authInfo" type="domain:authInfoChgType"
minOccurs="0"/>
</sequence>
</complexType>
<!--
Allow the registrant value to be nullified by changing the
minLength restriction to "0".
-->
<complexType name="clIDChgType">
<simpleContent>
<extension base="domain:clIDChgSimpleType">
<attribute name="verified" type="domain:verifiedType"/>
</extension>
</simpleContent>
</complexType>
<simpleType name="clIDChgSimpleType">
<restriction base="token">
<minLength value="0"/>
</restriction>
</simpleType>
<simpleType name="verifiedType">
<restriction base="token">
<enumeration value="yes"/>
<enumeration value="no"/>
</restriction>
</simpleType>
<!--
Allow the authInfo value to be nullified by including an
empty element within the choice.
-->
<complexType name="authInfoChgType">
<choice>
<element name="pw" type="eppcom:pwAuthInfoType"/>
<element name="ext" type="eppcom:extAuthInfoType"/>
<element name="null"/>
</choice>
</complexType>
<!--
Child response elements.
-->
<element name="chkData" type="domain:chkDataType"/>
<element name="creData" type="domain:creDataType"/>
<element name="infData" type="domain:infDataType"/>
<element name="panData" type="domain:panDataType"/>
<element name="renData" type="domain:renDataType"/>
<element name="trnData" type="domain:trnDataType"/>
<!--
<check> response elements.
-->
<complexType name="chkDataType">
<sequence>
<element name="cd" type="domain:checkType"
maxOccurs="unbounded"/>
</sequence>
</complexType>
<complexType name="checkType">
<sequence>
<element name="name" type="domain:checkNameType"/>
<element name="reason" type="eppcom:reasonType"
minOccurs="0"/>
</sequence>
</complexType>
<complexType name="checkNameType">
<simpleContent>
<extension base="eppcom:labelType">
<attribute name="avail" type="boolean"
use="required"/>
</extension>
</simpleContent>
</complexType>
<!--
<create> response elements.
-->
<complexType name="creDataType">
<sequence>
<element name="name" type="eppcom:labelType"/>
<element name="crDate" type="dateTime"/>
<element name="exDate" type="dateTime"
minOccurs="0"/>
</sequence>
</complexType>
<!--
<info> response elements.
-->
<complexType name="infDataType">
<sequence>
<element name="name" type="eppcom:labelType"/>
<element name="roid" type="eppcom:roidType"/>
<element name="status" type="domain:statusType"
minOccurs="0" maxOccurs="11"/>
<element name="registrant" type="eppcom:clIDType"
minOccurs="0"/>
<element name="contact" type="domain:contactType"
minOccurs="0" maxOccurs="unbounded"/>
<element name="ns" type="domain:nsType"
minOccurs="0"/>
<element name="host" type="eppcom:labelType"
minOccurs="0" maxOccurs="unbounded"/>
<element name="clID" type="eppcom:clIDType"/>
<element name="crID" type="eppcom:clIDType"
minOccurs="0"/>
<element name="crDate" type="dateTime"
minOccurs="0"/>
<element name="upID" type="eppcom:clIDType"
minOccurs="0"/>
<element name="upDate" type="dateTime"
minOccurs="0"/>
<element name="exDate" type="dateTime"
minOccurs="0"/>
<element name="trDate" type="dateTime"
minOccurs="0"/>
<element name="authInfo" type="domain:authInfoType"
minOccurs="0"/>
</sequence>
</complexType>
<!--
Status is a combination of attributes and an optional
human-readable message that may be expressed in languages other
than English.
-->
<complexType name="statusType">
<simpleContent>
<extension base="normalizedString">
<attribute name="s" type="domain:statusValueType"
use="required"/>
<attribute name="lang" type="language"
default="en"/>
</extension>
</simpleContent>
</complexType>
<simpleType name="statusValueType">
<restriction base="token">
<enumeration value="clientDeleteProhibited"/>
<enumeration value="clientHold"/>
<enumeration value="clientRenewProhibited"/>
<enumeration value="clientTransferProhibited"/>
<enumeration value="clientUpdateProhibited"/>
<enumeration value="inactive"/>
<enumeration value="ok"/>
<enumeration value="pendingCreate"/>
<enumeration value="pendingDelete"/>
<enumeration value="pendingRenew"/>
<enumeration value="pendingTransfer"/>
<enumeration value="pendingUpdate"/>
<enumeration value="serverDeleteProhibited"/>
<enumeration value="serverHold"/>
<enumeration value="serverRenewProhibited"/>
<enumeration value="serverTransferProhibited"/>
<enumeration value="serverUpdateProhibited"/>
</restriction>
</simpleType>
<!--
Pending action notification response elements.
-->
<complexType name="panDataType">
<sequence>
<element name="name" type="domain:paNameType"/>
<element name="paTRID" type="epp:trIDType"/>
<element name="paDate" type="dateTime"/>
</sequence>
</complexType>
<complexType name="paNameType">
<simpleContent>
<extension base="eppcom:labelType">
<attribute name="paResult" type="boolean"
use="required"/>
</extension>
</simpleContent>
</complexType>
<!--
<renew> response elements.
-->
<complexType name="renDataType">
<sequence>
<element name="name" type="eppcom:labelType"/>
<element name="exDate" type="dateTime"
minOccurs="0"/>
</sequence>
</complexType>
<!--
<transfer> response elements.
-->
<complexType name="trnDataType">
<sequence>
<element name="name" type="eppcom:labelType"/>
<element name="trStatus" type="eppcom:trStatusType"/>
<element name="reID" type="eppcom:clIDType"/>
<element name="reDate" type="dateTime"/>
<element name="acID" type="eppcom:clIDType"/>
<element name="acDate" type="dateTime"/>
<element name="exDate" type="dateTime"
minOccurs="0"/>
</sequence>
</complexType>
<!--
End of schema.
-->
</schema>

102
lib/schemas/eis-1.0.xsd Normal file
View file

@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8"?>
<schema
targetNamespace="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd"
xmlns:eis="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd"
xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<annotation>
<documentation>
EIS Extensible Provisioning Protocol v1.0 extension schema.
</documentation>
</annotation>
<!--
Child elements found in EPP commands.
-->
<element name="extdata" type="eis:eisExtType"/>
<!--
Child elements supporting EIS specific values.
-->
<complexType name="eisExtType">
<sequence>
<element name="ident" type="eis:identType" minOccurs="0" maxOccurs="1"/>
<element name="legalDocument" type="eis:legalDocType" minOccurs="0" maxOccurs="1"/>
<element name="reserved" type="eis:reservedType" minOccurs="0" maxOccurs="1"/>
</sequence>
</complexType>
<!--
Child elements of extdata
-->
<!--
Reserved for providing passwords for reserved domains
-->
<complexType name="reservedType">
<sequence>
<element name="pw" type="eis:pwType" minOccurs="0" maxOccurs="1"/>
</sequence>
</complexType>
<simpleType name="pwType">
<restriction base="normalizedString">
<minLength value="1"/>
<maxLength value="255"/>
</restriction>
</simpleType>
<!--
Legal document, encoded in base64
-->
<complexType name="legalDocType">
<simpleContent>
<extension base="base64Binary">
<attribute name="type" type="eis:legalDocEnumType" use="required"/>
</extension>
</simpleContent>
</complexType>
<simpleType name="legalDocEnumType">
<restriction base="token">
<enumeration value="pdf"/>
<enumeration value="bdoc"/>
<enumeration value="ddoc"/>
<enumeration value="zip"/>
<enumeration value="rar"/>
<enumeration value="gz"/>
<enumeration value="tar"/>
<enumeration value="7z"/>
</restriction>
</simpleType>
<!--
Ident with type and country code
-->
<complexType name="identType">
<simpleContent>
<extension base="normalizedString">
<attribute name="type" type="eis:identEnumType" use="required"/>
<attribute name="cc" type="eis:ccType" use="required"/>
</extension>
</simpleContent>
</complexType>
<simpleType name="identEnumType">
<restriction base="token">
<enumeration value="bic"/>
<enumeration value="priv"/>
<enumeration value="birthday"/>
</restriction>
</simpleType>
<simpleType name="ccType">
<restriction base="normalizedString">
<minLength value="2"/>
<maxLength value="2"/>
</restriction>
</simpleType>
</schema>

View file

@ -9,7 +9,7 @@
<!--
Import common element types.
-->
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0" schemaLocation="doc/schemas/eppcom-1.0.xsd" />
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0" schemaLocation="lib/schemas/eppcom-1.0.xsd" />
<annotation>
<documentation>

View file

@ -2,7 +2,7 @@ require 'rails_helper'
describe 'EPP Contact', epp: true do
before :all do
@xsd = Nokogiri::XML::Schema(File.read('doc/schemas/contact-eis-1.0.xsd'))
@xsd = Nokogiri::XML::Schema(File.read('lib/schemas/contact-eis-1.0.xsd'))
@registrar1 = Fabricate(:registrar1)
@registrar2 = Fabricate(:registrar2)
@epp_xml = EppXml::Contact.new(cl_trid: 'ABC-12345')

View file

@ -2,7 +2,7 @@ require 'rails_helper'
describe 'EPP Domain', epp: true do
before(:all) do
@xsd = Nokogiri::XML::Schema(File.read('doc/schemas/domain-eis-1.0.xsd'))
@xsd = Nokogiri::XML::Schema(File.read('lib/schemas/domain-eis-1.0.xsd'))
@epp_xml = EppXml.new(cl_trid: 'ABC-12345')
@registrar1 = Fabricate(:registrar1, code: 'REGDOMAIN1')
@registrar1.credit!({ sum: 10000 })

View file

@ -12,7 +12,7 @@ describe 'EPP Poll', epp: true do
end
before(:all) do
@xsd = Nokogiri::XML::Schema(File.read('doc/schemas/epp-1.0.xsd'))
@xsd = Nokogiri::XML::Schema(File.read('lib/schemas/epp-1.0.xsd'))
Fabricate(:api_user, username: 'registrar1', registrar: registrar1)
Fabricate(:api_user, username: 'registrar2', registrar: registrar2)

View file

@ -5,7 +5,7 @@ describe 'EPP Session', epp: true do
@api_user = Fabricate(:gitlab_api_user)
@epp_xml = EppXml.new(cl_trid: 'ABC-12345')
@login_xml_cache = @epp_xml.session.login(clID: { value: 'gitlab' }, pw: { value: 'ghyt9e4fu' })
@xsd = Nokogiri::XML::Schema(File.read('doc/schemas/epp-1.0.xsd'))
@xsd = Nokogiri::XML::Schema(File.read('lib/schemas/epp-1.0.xsd'))
end
context 'when not connected' do
@ -51,7 +51,7 @@ describe 'EPP Session', epp: true do
end
it 'prohibits further actions unless logged in' do
@xsd = Nokogiri::XML::Schema(File.read('doc/schemas/domain-eis-1.0.xsd'))
@xsd = Nokogiri::XML::Schema(File.read('lib/schemas/domain-eis-1.0.xsd'))
response = epp_plain_request(@epp_xml.domain.info(name: { value: 'test.ee' }))
response[:msg].should == 'You need to login first.'
response[:result_code].should == '2002'