mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 09:57:23 +02:00
New epp examples, legal doc type validations fix
This commit is contained in:
parent
efad36929e
commit
7130533d43
4 changed files with 2381 additions and 1287 deletions
|
@ -62,8 +62,8 @@ class EppController < ApplicationController
|
|||
|
||||
# validate legal document's type here because it may be in most of the requests
|
||||
@prefix = nil
|
||||
if element_count('extension > extdata > legalDocument') > 0
|
||||
requires_attribute('extension > extdata > legalDocument', 'type', values: LegalDocument::TYPES)
|
||||
if element_count('extdata > legalDocument') > 0
|
||||
requires_attribute('extdata > legalDocument', 'type', values: LegalDocument::TYPES)
|
||||
end
|
||||
|
||||
handle_errors and return if epp_errors.any?
|
||||
|
|
|
@ -45,3 +45,20 @@
|
|||
|
||||
%dt= t('accepter')
|
||||
%dd= link_to(@keyrelay.accepter, [:admin, @keyrelay.accepter])
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
.panel.panel-default
|
||||
.panel-heading.clearfix
|
||||
= t('legal_documents')
|
||||
.table-responsive
|
||||
%table.table.table-hover.table-bordered.table-condensed
|
||||
%thead
|
||||
%tr
|
||||
%th{class: 'col-xs-8'}= t('created_at')
|
||||
%th{class: 'col-xs-4'}= t('type')
|
||||
%tbody
|
||||
- @keyrelay.legal_documents.each do |x|
|
||||
%tr
|
||||
%td= link_to(x.created_at, [:admin, x])
|
||||
%td= x.document_type
|
||||
|
|
3618
doc/epp-examples.md
3618
doc/epp-examples.md
File diff suppressed because it is too large
Load diff
|
@ -182,7 +182,7 @@ describe 'EPP Keyrelay', epp: true do
|
|||
pw: { value: domain.auth_info }
|
||||
},
|
||||
expiry: {
|
||||
relative: { value: 'P1D' },
|
||||
relative: { value: 'P1D' }
|
||||
}
|
||||
}, {
|
||||
_anonymus: [
|
||||
|
@ -200,6 +200,33 @@ describe 'EPP Keyrelay', epp: true do
|
|||
docs.count.should == 1
|
||||
docs.first.body.should == 'JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp=='
|
||||
docs.first.document_type.should == 'pdf'
|
||||
end
|
||||
|
||||
it 'validates legal document types' do
|
||||
xml = epp_xml.keyrelay({
|
||||
name: { value: domain.name },
|
||||
keyData: {
|
||||
flags: { value: '256' },
|
||||
protocol: { value: '3' },
|
||||
alg: { value: '8' },
|
||||
pubKey: { value: 'cmlraXN0aGViZXN0' }
|
||||
},
|
||||
authInfo: {
|
||||
pw: { value: domain.auth_info }
|
||||
},
|
||||
expiry: {
|
||||
relative: { value: 'P1D' }
|
||||
}
|
||||
}, {
|
||||
_anonymus: [
|
||||
legalDocument: {
|
||||
value: 'JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp==',
|
||||
attrs: { type: 'jpg' }
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
response = epp_request(xml, :xml, :elkdata)
|
||||
response[:msg].should == 'Attribute is invalid: type'
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue