epics 2.1.2 → 2.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f91eb25c88880d2a09b23003cffc9601350a5c980e618945186177108917fdcb
4
- data.tar.gz: aea9b65df7b8773a324cc8a8e457b96036e35f5cba7bf2aebc424183d9053b43
3
+ metadata.gz: '0235859714f452d06af25055ba018845fb391e71b95813951422d851b274974e'
4
+ data.tar.gz: 699de0520f011d9755685e222e64a563ef8a7fac3558cc0520b156b0e5232bfd
5
5
  SHA512:
6
- metadata.gz: 2559bbcbb940f957f21ec202d1fd67f766017426868c3413bba616aa438b904bbd8980e6f716274142e72707ca5166c34f8ac5ff23b4b996c4d49accc948ec07
7
- data.tar.gz: '081d8491005d6c146b002d22c0a0f3fc90feb4c09d67cc406383ea8825c47e28d6579012d3e7b4ec754909ba60c65e5fbcdb6f7e145961a545160b89f53f84d9'
6
+ metadata.gz: 8ed0c386749155a12c1b88d1b3fea266a9a2d99dad01fcbc8e5eecefa6af8a2dc0708b7ce9591b23a50d244451c05c456c31774690911dc0c96247a023a90aba
7
+ data.tar.gz: f03bab54f984eaa5ee3515854753f78b2e9c4e5b5347f4c40b762c829e174edfe8139c6f7328d2d703be3864f81c4345d7fb954d3245136d4ab047363d2780b9
@@ -3,7 +3,7 @@ name: Test
3
3
  agent:
4
4
  machine:
5
5
  type: e1-standard-2
6
- os_image: ubuntu1804
6
+ os_image: ubuntu2004
7
7
  blocks:
8
8
  - name: Setup
9
9
  task:
@@ -21,7 +21,7 @@ blocks:
21
21
  - checkout
22
22
  - sem-version ruby 3.0
23
23
  - cache restore
24
- - gem install bundler:2.4.12
24
+ - gem install bundler:2.4.22
25
25
  - bundle install
26
26
  - cache store
27
27
  - bundle exec rspec
@@ -30,7 +30,7 @@ blocks:
30
30
  - checkout
31
31
  - sem-version ruby 3.1
32
32
  - cache restore
33
- - gem install bundler:2.4.12
33
+ - gem install bundler:2.4.22
34
34
  - bundle install
35
35
  - cache store
36
36
  - bundle exec rspec
@@ -39,7 +39,16 @@ blocks:
39
39
  - checkout
40
40
  - sem-version ruby 3.2
41
41
  - cache restore
42
- - gem install bundler:2.4.12
42
+ - gem install bundler:2.4.22
43
+ - bundle install
44
+ - cache store
45
+ - bundle exec rspec
46
+ - name: "3.3"
47
+ commands:
48
+ - checkout
49
+ - sem-version ruby 3.3
50
+ - cache restore
51
+ - gem install bundler:2.4.22
43
52
  - bundle install
44
53
  - cache store
45
54
  - bundle exec rspec
data/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ### Unreleased
2
+
3
+ ### 2.3.0
4
+
5
+ - [ENHANCEMENT] Adds Z52, Z53, Z54 order type (C52, C53, C54 for swiss banks)
6
+
7
+ ### 2.2.0
8
+
9
+ - [ENHANCEMENT] Adds C2S order type
10
+ - [HOUSEKEEPING] updates nokogiri dependency
11
+ - [HOUSEKEEPING] updates rexml dependency
12
+ - [HOUSEKEEPING] adds Ruby 3.3 to CI
13
+
1
14
  ### 2.1.2
2
15
 
3
16
  - [BUGFIX] Fix order data encryption for OpenSSL 3
data/epics.gemspec CHANGED
@@ -41,9 +41,9 @@ Gem::Specification.new do |spec|
41
41
  spec.post_install_message += "\e[32m" + ('*' * 60) + "\n\e[0m"
42
42
 
43
43
  spec.add_dependency 'faraday', '>= 1.10.0'
44
- spec.add_dependency 'nokogiri', '>= 1.14.0'
44
+ spec.add_dependency 'nokogiri', '>= 1.16.5'
45
45
  spec.add_dependency 'rubyzip', '>= 2.3.2'
46
- spec.add_dependency 'rexml', '>= 3.2.5'
46
+ spec.add_dependency 'rexml', '>= 3.2.8'
47
47
 
48
48
  spec.add_development_dependency 'bundler', '>= 2.4.12'
49
49
  spec.add_development_dependency 'equivalent-xml'
data/lib/epics/c2s.rb ADDED
@@ -0,0 +1,9 @@
1
+ class Epics::C2S < Epics::CDB
2
+ def order_attribute
3
+ "DZHNN"
4
+ end
5
+
6
+ def order_type
7
+ 'C2S'
8
+ end
9
+ end
data/lib/epics/cdb.rb CHANGED
@@ -1,4 +1,12 @@
1
1
  class Epics::CDB < Epics::GenericUploadRequest
2
+ def order_attribute
3
+ 'OZHNN'
4
+ end
5
+
6
+ def order_type
7
+ 'CDB'
8
+ end
9
+
2
10
  def header
3
11
  Nokogiri::XML::Builder.new do |xml|
4
12
  xml.header(authenticate: true) {
@@ -10,8 +18,8 @@ class Epics::CDB < Epics::GenericUploadRequest
10
18
  xml.UserID user_id
11
19
  xml.Product("EPICS - a ruby ebics kernel", 'Language' => 'de')
12
20
  xml.OrderDetails {
13
- xml.OrderType 'CDB'
14
- xml.OrderAttribute 'OZHNN'
21
+ xml.OrderType order_type
22
+ xml.OrderAttribute order_attribute
15
23
  xml.StandardOrderParams
16
24
  }
17
25
  xml.BankPubKeyDigests {
data/lib/epics/client.rb CHANGED
@@ -129,6 +129,10 @@ class Epics::Client
129
129
  upload(Epics::CDB, document)
130
130
  end
131
131
 
132
+ def C2S(document)
133
+ upload(Epics::C2S, document)
134
+ end
135
+
132
136
  def CDD(document)
133
137
  upload(Epics::CDD, document)
134
138
  end
@@ -181,6 +185,18 @@ class Epics::Client
181
185
  download_and_unzip(Epics::C54, from, to)
182
186
  end
183
187
 
188
+ def Z52(from, to)
189
+ download_and_unzip(Epics::Z52, from, to)
190
+ end
191
+
192
+ def Z53(from, to)
193
+ download_and_unzip(Epics::Z53, from, to)
194
+ end
195
+
196
+ def Z54(from, to)
197
+ download_and_unzip(Epics::Z54, from, to)
198
+ end
199
+
184
200
  def HAA
185
201
  Nokogiri::XML(download(Epics::HAA)).at_xpath("//xmlns:OrderTypes", xmlns: "urn:org:ebics:H004").content.split(/\s/)
186
202
  end
data/lib/epics/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Epics
4
- VERSION = '2.1.2'
4
+ VERSION = '2.3.0'
5
5
  end
data/lib/epics/z52.rb ADDED
@@ -0,0 +1,42 @@
1
+ class Epics::Z52 < Epics::GenericRequest
2
+ attr_accessor :from, :to
3
+
4
+ def initialize(client, from, to)
5
+ super(client)
6
+ self.from = from
7
+ self.to = to
8
+ end
9
+
10
+ def header
11
+ Nokogiri::XML::Builder.new do |xml|
12
+ xml.header(authenticate: true) {
13
+ xml.static {
14
+ xml.HostID host_id
15
+ xml.Nonce nonce
16
+ xml.Timestamp timestamp
17
+ xml.PartnerID partner_id
18
+ xml.UserID user_id
19
+ xml.Product("EPICS - a ruby ebics kernel", 'Language' => 'de')
20
+ xml.OrderDetails {
21
+ xml.OrderType 'Z52'
22
+ xml.OrderAttribute 'DZHNN'
23
+ xml.StandardOrderParams {
24
+ xml.DateRange {
25
+ xml.Start from
26
+ xml.End to
27
+ }
28
+ }
29
+ }
30
+ xml.BankPubKeyDigests {
31
+ xml.Authentication(client.bank_x.public_digest, Version: 'X002', Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256")
32
+ xml.Encryption(client.bank_e.public_digest, Version: 'E002', Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256" )
33
+ }
34
+ xml.SecurityMedium '0000'
35
+ }
36
+ xml.mutable {
37
+ xml.TransactionPhase 'Initialisation'
38
+ }
39
+ }
40
+ end.doc.root
41
+ end
42
+ end
data/lib/epics/z53.rb ADDED
@@ -0,0 +1,42 @@
1
+ class Epics::Z53 < Epics::GenericRequest
2
+ attr_accessor :from, :to
3
+
4
+ def initialize(client, from, to)
5
+ super(client)
6
+ self.from = from
7
+ self.to = to
8
+ end
9
+
10
+ def header
11
+ Nokogiri::XML::Builder.new do |xml|
12
+ xml.header(authenticate: true) {
13
+ xml.static {
14
+ xml.HostID host_id
15
+ xml.Nonce nonce
16
+ xml.Timestamp timestamp
17
+ xml.PartnerID partner_id
18
+ xml.UserID user_id
19
+ xml.Product("EPICS - a ruby ebics kernel", 'Language' => 'de')
20
+ xml.OrderDetails {
21
+ xml.OrderType 'Z53'
22
+ xml.OrderAttribute 'DZHNN'
23
+ xml.StandardOrderParams {
24
+ xml.DateRange {
25
+ xml.Start from
26
+ xml.End to
27
+ }
28
+ }
29
+ }
30
+ xml.BankPubKeyDigests {
31
+ xml.Authentication(client.bank_x.public_digest, Version: 'X002', Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256")
32
+ xml.Encryption(client.bank_e.public_digest, Version: 'E002', Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256" )
33
+ }
34
+ xml.SecurityMedium '0000'
35
+ }
36
+ xml.mutable {
37
+ xml.TransactionPhase 'Initialisation'
38
+ }
39
+ }
40
+ end.doc.root
41
+ end
42
+ end
data/lib/epics/z54.rb ADDED
@@ -0,0 +1,42 @@
1
+ class Epics::Z54 < Epics::GenericRequest
2
+ attr_accessor :from, :to
3
+
4
+ def initialize(client, from, to)
5
+ super(client)
6
+ self.from = from
7
+ self.to = to
8
+ end
9
+
10
+ def header
11
+ Nokogiri::XML::Builder.new do |xml|
12
+ xml.header(authenticate: true) {
13
+ xml.static {
14
+ xml.HostID host_id
15
+ xml.Nonce nonce
16
+ xml.Timestamp timestamp
17
+ xml.PartnerID partner_id
18
+ xml.UserID user_id
19
+ xml.Product("EPICS - a ruby ebics kernel", 'Language' => 'de')
20
+ xml.OrderDetails {
21
+ xml.OrderType 'Z54'
22
+ xml.OrderAttribute 'DZHNN'
23
+ xml.StandardOrderParams {
24
+ xml.DateRange {
25
+ xml.Start from
26
+ xml.End to
27
+ }
28
+ }
29
+ }
30
+ xml.BankPubKeyDigests {
31
+ xml.Authentication(client.bank_x.public_digest, Version: 'X002', Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256")
32
+ xml.Encryption(client.bank_e.public_digest, Version: 'E002', Algorithm: "http://www.w3.org/2001/04/xmlenc#sha256" )
33
+ }
34
+ xml.SecurityMedium '0000'
35
+ }
36
+ xml.mutable {
37
+ xml.TransactionPhase 'Initialisation'
38
+ }
39
+ }
40
+ end.doc.root
41
+ end
42
+ end
data/lib/epics.rb CHANGED
@@ -26,6 +26,9 @@ require "epics/vmk"
26
26
  require "epics/c52"
27
27
  require "epics/c53"
28
28
  require "epics/c54"
29
+ require "epics/z52"
30
+ require "epics/z53"
31
+ require "epics/z54"
29
32
  require "epics/ptk"
30
33
  require "epics/hac"
31
34
  require "epics/hpd"
@@ -37,6 +40,7 @@ require "epics/cdd"
37
40
  require "epics/b2b"
38
41
  require "epics/xds"
39
42
  require "epics/cds"
43
+ require "epics/c2s"
40
44
  require "epics/cdz"
41
45
  require "epics/crz"
42
46
  require "epics/xct"
data/spec/client_spec.rb CHANGED
@@ -209,25 +209,25 @@ RSpec.describe Epics::Client do
209
209
  end
210
210
  end
211
211
 
212
- describe '#C53/C52/C54 types with zipped data' do
212
+ describe '#C53/C52/C54/Z52/Z53/Z54 types with zipped data' do
213
213
  before do
214
214
  allow(subject).to receive(:download).and_return( File.read(File.join(File.dirname(__FILE__), 'fixtures', 'test.zip') ))
215
215
  end
216
216
 
217
217
  it 'will unzip the returned data' do
218
- %w(C52 C53 C54).each do |c|
218
+ %w(C52 C53 C54 Z52 Z53 Z54).each do |c|
219
219
  expect(subject.send(c, :today, :yesterday)).to eq(["ebics is great\n"])
220
220
  end
221
221
  end
222
222
  end
223
223
 
224
- describe '#C53/C52/C54 types with zipped data with general purpose bit flag 3 set' do
224
+ describe '#C53/C52/C54/Z52/Z53/Z54 types with zipped data with general purpose bit flag 3 set' do
225
225
  before do
226
226
  allow(subject).to receive(:download).and_return( File.read(File.join(File.dirname(__FILE__), 'fixtures', 'test_with_general_purpose_bit_3.zip') ))
227
227
  end
228
228
 
229
229
  it 'will unzip the returned data' do
230
- %w(C52 C53 C54).each do |c|
230
+ %w(C52 C53 C54 Z52 Z53 Z54).each do |c|
231
231
  expect(subject.send(c, :today, :yesterday)).to eq(["ebics is great\n"])
232
232
  end
233
233
  end
@@ -0,0 +1,21 @@
1
+ RSpec.describe Epics::C2S 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
+ let(:document) { File.read( File.join( File.dirname(__FILE__), '..', 'fixtures', 'xml', 'cdb.xml') ) }
5
+ subject { described_class.new(client, document) }
6
+
7
+ describe 'order attributes' do
8
+ it { expect(subject.header.to_s).to include('<OrderAttribute>DZHNN</OrderAttribute>') }
9
+ it { expect(subject.header.to_s).to include('<OrderType>C2S</OrderType>') }
10
+ end
11
+
12
+ describe '#to_xml' do
13
+ specify { expect(subject.to_xml).to be_a_valid_ebics_doc }
14
+ end
15
+
16
+ describe '#to_transfer_xml' do
17
+ before { subject.transaction_id = SecureRandom.hex(16) }
18
+
19
+ specify { expect(subject.to_transfer_xml).to be_a_valid_ebics_doc }
20
+ end
21
+ end
@@ -0,0 +1,11 @@
1
+ RSpec.describe Epics::Z52 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
+ subject { described_class.new(client, "2014-09-01", "2014-09-30") }
6
+
7
+ describe '#to_xml' do
8
+ specify { expect(subject.to_xml).to be_a_valid_ebics_doc }
9
+ end
10
+
11
+ end
@@ -0,0 +1,11 @@
1
+ RSpec.describe Epics::Z53 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
+ subject { described_class.new(client, "2014-09-01", "2014-09-30") }
6
+
7
+ describe '#to_xml' do
8
+ specify { expect(subject.to_xml).to be_a_valid_ebics_doc }
9
+ end
10
+
11
+ end
@@ -0,0 +1,9 @@
1
+ RSpec.describe Epics::Z54 do
2
+ 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') }
3
+
4
+ subject { described_class.new(client, "2014-09-01", "2014-09-30") }
5
+
6
+ describe '#to_xml' do
7
+ specify { expect(subject.to_xml).to be_a_valid_ebics_doc }
8
+ end
9
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epics
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lars Brillert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-01 00:00:00.000000000 Z
11
+ date: 2024-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.14.0
33
+ version: 1.16.5
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 1.14.0
40
+ version: 1.16.5
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rubyzip
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 3.2.5
61
+ version: 3.2.8
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 3.2.5
68
+ version: 3.2.8
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -180,6 +180,7 @@ files:
180
180
  - lib/epics.rb
181
181
  - lib/epics/azv.rb
182
182
  - lib/epics/b2b.rb
183
+ - lib/epics/c2s.rb
183
184
  - lib/epics/c52.rb
184
185
  - lib/epics/c53.rb
185
186
  - lib/epics/c54.rb
@@ -214,6 +215,9 @@ files:
214
215
  - lib/epics/vmk.rb
215
216
  - lib/epics/xct.rb
216
217
  - lib/epics/xds.rb
218
+ - lib/epics/z52.rb
219
+ - lib/epics/z53.rb
220
+ - lib/epics/z54.rb
217
221
  - lib/letter/ini.erb
218
222
  - spec/.DS_Store
219
223
  - spec/client_spec.rb
@@ -258,6 +262,7 @@ files:
258
262
  - spec/middleware/parse_ebics_spec.rb
259
263
  - spec/orders/azv_spec.rb
260
264
  - spec/orders/b2b_spec.rb
265
+ - spec/orders/c2s_spec.rb
261
266
  - spec/orders/c52_spec.rb
262
267
  - spec/orders/c53_spec.rb
263
268
  - spec/orders/c54_spec.rb
@@ -280,6 +285,9 @@ files:
280
285
  - spec/orders/sta_spec.rb
281
286
  - spec/orders/vmk_spec.rb
282
287
  - spec/orders/xds_spec.rb
288
+ - spec/orders/z52_spec.rb
289
+ - spec/orders/z53_spec.rb
290
+ - spec/orders/z54_spec.rb
283
291
  - spec/response_spec.rb
284
292
  - spec/signer_spec.rb
285
293
  - spec/spec_helper.rb
@@ -319,7 +327,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
319
327
  - !ruby/object:Gem::Version
320
328
  version: '0'
321
329
  requirements: []
322
- rubygems_version: 3.4.13
330
+ rubygems_version: 3.5.11
323
331
  signing_key:
324
332
  specification_version: 4
325
333
  summary: a ruby implementation of the EBICS protocol
@@ -367,6 +375,7 @@ test_files:
367
375
  - spec/middleware/parse_ebics_spec.rb
368
376
  - spec/orders/azv_spec.rb
369
377
  - spec/orders/b2b_spec.rb
378
+ - spec/orders/c2s_spec.rb
370
379
  - spec/orders/c52_spec.rb
371
380
  - spec/orders/c53_spec.rb
372
381
  - spec/orders/c54_spec.rb
@@ -389,6 +398,9 @@ test_files:
389
398
  - spec/orders/sta_spec.rb
390
399
  - spec/orders/vmk_spec.rb
391
400
  - spec/orders/xds_spec.rb
401
+ - spec/orders/z52_spec.rb
402
+ - spec/orders/z53_spec.rb
403
+ - spec/orders/z54_spec.rb
392
404
  - spec/response_spec.rb
393
405
  - spec/signer_spec.rb
394
406
  - spec/spec_helper.rb