x_road 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 44143890488ece4d7e79810120b31f1dd7e1bc03
4
- data.tar.gz: 3abfe8277eae7e78a4ffd6dde593db3d6d9b6785
3
+ metadata.gz: d35df71d6e681c90a9b7713bc420d3759e04db24
4
+ data.tar.gz: caff5d342da659300220c4f97f9fe54f4201ee00
5
5
  SHA512:
6
- metadata.gz: 8a894023ff4ef2cd1ea8d2519000724f995766c039d622b61c4f90a4eb678f95f81abd243471475222cb2b2109a85f7186c2c1e445a851ae6841c3de1cde468a
7
- data.tar.gz: 3921bb361688fd9f69ca09e4add7a9ef2f4d45639cf99aefe17dcfd844aceb6fa7283e372bee3c7732d287a39abeffcbb18669c9709a69a875c9ddc21baa4b7e
6
+ metadata.gz: d98f54d17c7f6d0dd529836ddf076a121b2dd3b06daaabfd7e483347b59b79ad261e0f2ac91faee2bbfc9a3c2455711db6444201ba4f6026a1cb987526472759
7
+ data.tar.gz: a2588c35bb758f823d19ba65a124070fe078b63883c51c37d1162e8fc9a8568f917173c1c15af794978af219466018bfbc03f54789cb073e445bc98f53039900
@@ -0,0 +1,44 @@
1
+ module XRoad
2
+ class ActiveXRoad2
3
+ def self.create_header(producer, user_id, service)
4
+ id = UUIDTools::UUID.random_create.to_s
5
+ id.delete! '-'
6
+ {
7
+ "xroad:id" => id,
8
+ "xroad:service" => service,
9
+ "xroad:consumer" => XRoad.configuration.consumer,
10
+ "xroad:producer" => producer,
11
+ "xroad:userId" => user_id
12
+ }
13
+ end
14
+
15
+ def self.request(action, namespace, header, body)
16
+ client = create_client(namespace)
17
+ response = client.call(
18
+ action,
19
+ :soap_header => header,
20
+ :message => body
21
+ )
22
+ response.body
23
+ end
24
+
25
+ def self.create_client(ns)
26
+ config = XRoad.configuration
27
+ Savon.client do
28
+ endpoint config.host
29
+ ssl_cert_file config.client_cert
30
+ ssl_cert_key_file config.client_key
31
+ pretty_print_xml true
32
+ ssl_verify_mode config.ssl_verify
33
+ log true
34
+ log_level config.log_level
35
+ namespace_identifier "prdcr"
36
+ namespace ns
37
+ namespaces(
38
+ "xmlns:xroad" => "http://x-road.ee/xsd/x-road.xsd",
39
+ "xmlns:prdcr" => ns
40
+ )
41
+ end
42
+ end
43
+ end
44
+ end
@@ -1,3 +1,3 @@
1
1
  module XRoad
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: x_road
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janno Siilbek
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-07-30 00:00:00.000000000 Z
11
+ date: 2016-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: uuidtools
@@ -125,6 +125,7 @@ files:
125
125
  - bin/setup
126
126
  - lib/x_road.rb
127
127
  - lib/x_road/active_x_road.rb
128
+ - lib/x_road/active_x_road2.rb
128
129
  - lib/x_road/kpr/laekumised_maksuametist.rb
129
130
  - lib/x_road/version.rb
130
131
  - x_road.gemspec
@@ -148,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
149
  version: '0'
149
150
  requirements: []
150
151
  rubyforge_project:
151
- rubygems_version: 2.4.6
152
+ rubygems_version: 2.4.5.1
152
153
  signing_key:
153
154
  specification_version: 4
154
155
  summary: Communication with X-Road security server