epics 2.8.0 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/epics/client.rb +7 -0
- data/lib/epics/hev.rb +19 -0
- data/lib/epics/response.rb +8 -0
- data/lib/epics/signer.rb +3 -3
- data/lib/epics/version.rb +1 -1
- data/lib/epics.rb +1 -0
- data/spec/orders/hev_spec.rb +14 -0
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc38fae79ba6b5ebcbafa535bfd7b4364b708deff8d1d45caa44ed9273a338e1
|
4
|
+
data.tar.gz: 3a54d33face295d3f0718baeb6343d8aff05946b27aaf11f9df0871869e266bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3827df11227abf25613c8b27356cbb45465d2be54b58421725bb9625338be4c1bedab8683c3b0f9e9630bc3a63700bfcc897fff130baae465475e53f5112aa43
|
7
|
+
data.tar.gz: 168a79d4581dcc1053a130081d70bf08741f7d7f96582863963653aab189f866c303b6c582d15584851443d5c65756139b3956ca81c3dfbf0715afc5ba3040ae
|
data/CHANGELOG.md
CHANGED
data/lib/epics/client.rb
CHANGED
@@ -107,6 +107,13 @@ class Epics::Client
|
|
107
107
|
post(url, Epics::INI.new(self).to_xml).body.ok?
|
108
108
|
end
|
109
109
|
|
110
|
+
def HEV
|
111
|
+
res = post(url, Epics::HEV.new(self).to_xml).body
|
112
|
+
res.doc.xpath("//xmlns:VersionNumber", xmlns: 'http://www.ebics.org/H000').each_with_object({}) do |node, versions|
|
113
|
+
versions[node['ProtocolVersion']] = node.content
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
110
117
|
def HPB
|
111
118
|
Nokogiri::XML(download(Epics::HPB)).xpath("//xmlns:PubKeyValue", xmlns: "urn:org:ebics:H004").each do |node|
|
112
119
|
type = node.parent.last_element_child.content
|
data/lib/epics/hev.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
class Epics::HEV < Epics::GenericRequest
|
2
|
+
def root
|
3
|
+
"ebicsHEVRequest"
|
4
|
+
end
|
5
|
+
|
6
|
+
def body
|
7
|
+
Nokogiri::XML::Builder.new do |xml|
|
8
|
+
xml.HostID host_id
|
9
|
+
end.doc.root
|
10
|
+
end
|
11
|
+
|
12
|
+
def to_xml
|
13
|
+
Nokogiri::XML::Builder.new do |xml|
|
14
|
+
xml.send(root, 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation' => 'http://www.ebics.org/H000 http://www.ebics.org/H000/ebics_hev.xsd', 'xmlns' => 'http://www.ebics.org/H000') {
|
15
|
+
xml.parent.add_child(body)
|
16
|
+
}
|
17
|
+
end.to_xml(save_with: Nokogiri::XML::Node::SaveOptions::AS_XML, encoding: 'utf-8')
|
18
|
+
end
|
19
|
+
end
|
data/lib/epics/response.rb
CHANGED
@@ -12,9 +12,17 @@ class Epics::Response
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def technical_code
|
15
|
+
mutable_return_code.empty? ? system_return_code : mutable_return_code
|
16
|
+
end
|
17
|
+
|
18
|
+
def mutable_return_code
|
15
19
|
doc.xpath("//xmlns:header/xmlns:mutable/xmlns:ReturnCode", xmlns: "urn:org:ebics:H004").text
|
16
20
|
end
|
17
21
|
|
22
|
+
def system_return_code
|
23
|
+
doc.xpath("//xmlns:SystemReturnCode/xmlns:ReturnCode", xmlns: 'http://www.ebics.org/H000').text
|
24
|
+
end
|
25
|
+
|
18
26
|
def business_error?
|
19
27
|
!["", "000000"].include?(business_code)
|
20
28
|
end
|
data/lib/epics/signer.rb
CHANGED
@@ -17,7 +17,7 @@ class Epics::Signer
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def sign!
|
20
|
-
signature_value_node = doc.xpath("//ds:SignatureValue").first
|
20
|
+
signature_value_node = doc.xpath("//ds:SignatureValue", ds: "http://www.w3.org/2000/09/xmldsig#").first
|
21
21
|
|
22
22
|
if signature_node
|
23
23
|
signature_value_node.content = Base64.encode64(client.x.key.sign(digester, signature_node.canonicalize)).gsub(/\n/,'')
|
@@ -27,11 +27,11 @@ class Epics::Signer
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def digest_node
|
30
|
-
@d ||= doc.xpath("//ds:DigestValue").first
|
30
|
+
@d ||= doc.xpath("//ds:DigestValue", ds: "http://www.w3.org/2000/09/xmldsig#").first
|
31
31
|
end
|
32
32
|
|
33
33
|
def signature_node
|
34
|
-
@s ||= doc.xpath("//ds:SignedInfo").first
|
34
|
+
@s ||= doc.xpath("//ds:SignedInfo", ds: "http://www.w3.org/2000/09/xmldsig#").first
|
35
35
|
end
|
36
36
|
|
37
37
|
def digester
|
data/lib/epics/version.rb
CHANGED
data/lib/epics.rb
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
RSpec.describe Epics::HEV do
|
2
|
+
|
3
|
+
let(:client) { Epics::Client.new( File.open(File.join( File.dirname(__FILE__), '..', 'fixtures', 'SIZBN001.key')), 'secret' , 'https://194.180.18.30/ebicsweb/ebicsweb', 'SIZBN001', 'EBIX', 'EBICS') }
|
4
|
+
|
5
|
+
let(:xsd) { Nokogiri::XML::Schema(File.open( File.join( File.dirname(__FILE__), '..', 'xsd', 'ebics_hev.xsd') )) }
|
6
|
+
let(:validator) { xsd.valid?(Nokogiri::XML(subject.to_xml)) }
|
7
|
+
|
8
|
+
subject { described_class.new(client) }
|
9
|
+
|
10
|
+
describe '#to_xml' do
|
11
|
+
specify { expect(validator).to be_truthy }
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: epics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lars Brillert
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date: 2025-03-
|
10
|
+
date: 2025-03-24 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: base64
|
@@ -249,6 +248,7 @@ files:
|
|
249
248
|
- lib/epics/haa.rb
|
250
249
|
- lib/epics/hac.rb
|
251
250
|
- lib/epics/header_request.rb
|
251
|
+
- lib/epics/hev.rb
|
252
252
|
- lib/epics/hia.rb
|
253
253
|
- lib/epics/hkd.rb
|
254
254
|
- lib/epics/hpb.rb
|
@@ -340,6 +340,7 @@ files:
|
|
340
340
|
- spec/orders/fdl_spec.rb
|
341
341
|
- spec/orders/haa_spec.rb
|
342
342
|
- spec/orders/hac_spec.rb
|
343
|
+
- spec/orders/hev_spec.rb
|
343
344
|
- spec/orders/hia_spec.rb
|
344
345
|
- spec/orders/hkd_spec.rb
|
345
346
|
- spec/orders/hpb_spec.rb
|
@@ -398,8 +399,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
398
399
|
- !ruby/object:Gem::Version
|
399
400
|
version: '0'
|
400
401
|
requirements: []
|
401
|
-
rubygems_version: 3.
|
402
|
-
signing_key:
|
402
|
+
rubygems_version: 3.6.2
|
403
403
|
specification_version: 4
|
404
404
|
summary: a ruby implementation of the EBICS protocol
|
405
405
|
test_files:
|
@@ -466,6 +466,7 @@ test_files:
|
|
466
466
|
- spec/orders/fdl_spec.rb
|
467
467
|
- spec/orders/haa_spec.rb
|
468
468
|
- spec/orders/hac_spec.rb
|
469
|
+
- spec/orders/hev_spec.rb
|
469
470
|
- spec/orders/hia_spec.rb
|
470
471
|
- spec/orders/hkd_spec.rb
|
471
472
|
- spec/orders/hpb_spec.rb
|