isds 0.1.0 → 0.2.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/lib/isds/client.rb +2 -2
- data/lib/isds/connection.rb +3 -2
- data/lib/isds/message.rb +4 -4
- data/lib/isds/search.rb +2 -0
- data/lib/isds/version.rb +1 -1
- data/lib/isds.rb +19 -11
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6a549b22ca1e5aef6f07e20818ef5ec3ec4b6054a94ce6a0ef4dd92f59b0392e
|
|
4
|
+
data.tar.gz: 3cfe176c0bb61cc168fff4651f0f71631e15dd9d0216a5bdbff28db00d9e2a90
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f5e511ae1094d0e454a8dfb7b71aa4190ef2de0026eb0631f6184ca2e10bbf7f24ffb039c8284b7b74a2b8cde7ee718ece719c51d2fa44f4ab67fe583bb71e6c
|
|
7
|
+
data.tar.gz: 02e69bab0a6041ed0ed63fca6c05ea16be5b48952a81115f9b48340091487f2adcd197c6f792902fc7a80f70041464a4fe6e127085ffeb2f48a54ac4458acd3c
|
data/lib/isds/client.rb
CHANGED
|
@@ -13,7 +13,7 @@ module ISDS
|
|
|
13
13
|
def authenticate!
|
|
14
14
|
configuration.validate!
|
|
15
15
|
# Perform a simple operation to verify credentials
|
|
16
|
-
connection.call(:
|
|
16
|
+
connection.call(:access, :get_owner_info_from_login)
|
|
17
17
|
@authenticated = true
|
|
18
18
|
rescue ISDS::Error
|
|
19
19
|
@authenticated = false
|
|
@@ -71,7 +71,7 @@ module ISDS
|
|
|
71
71
|
# --- Info operations ---
|
|
72
72
|
|
|
73
73
|
def owner_info
|
|
74
|
-
connection.call(:
|
|
74
|
+
connection.call(:access, :get_owner_info_from_login)
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
def password_info
|
data/lib/isds/connection.rb
CHANGED
|
@@ -12,7 +12,8 @@ module ISDS
|
|
|
12
12
|
|
|
13
13
|
def call(service, operation, message = {})
|
|
14
14
|
client = soap_client_for(service)
|
|
15
|
-
|
|
15
|
+
pascal_tag = operation.to_s.split('_').map(&:capitalize).join
|
|
16
|
+
response = client.call(operation, message_tag: pascal_tag, message: message)
|
|
16
17
|
parse_response(response)
|
|
17
18
|
rescue Savon::SOAPFault => e
|
|
18
19
|
handle_soap_fault(e)
|
|
@@ -49,7 +50,7 @@ module ISDS
|
|
|
49
50
|
ssl_verify_mode: configuration.ssl_verify_peer ? :peer : :none,
|
|
50
51
|
log: configuration.enable_request_logging,
|
|
51
52
|
pretty_print_xml: configuration.test?,
|
|
52
|
-
convert_response_tags_to: ->(tag) {
|
|
53
|
+
convert_response_tags_to: ->(tag) { Savon::StringUtils.snakecase(tag).to_sym }
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
options[:ssl_ca_cert_file] = configuration.ssl_ca_file if configuration.ssl_ca_file
|
data/lib/isds/message.rb
CHANGED
|
@@ -63,23 +63,23 @@ module ISDS
|
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
def download_attachment(attachment_id, path = nil)
|
|
66
|
-
response = @connection.call(:
|
|
66
|
+
response = @connection.call(:operations, :message_download, { 'isds:dmID' => id })
|
|
67
67
|
extract_attachment(response, attachment_id, path)
|
|
68
68
|
end
|
|
69
69
|
|
|
70
70
|
def download_all_attachments(directory)
|
|
71
|
-
response = @connection.call(:
|
|
71
|
+
response = @connection.call(:operations, :message_download, { 'isds:dmID' => id })
|
|
72
72
|
extract_all_attachments(response, directory)
|
|
73
73
|
end
|
|
74
74
|
|
|
75
75
|
def signed_content
|
|
76
|
-
response = @connection.call(:
|
|
76
|
+
response = @connection.call(:operations, :signed_message_download, { 'isds:dmID' => id })
|
|
77
77
|
response.dig(:signed_message_download_response, :dm_signature)
|
|
78
78
|
end
|
|
79
79
|
|
|
80
80
|
class << self
|
|
81
81
|
def find(message_id, connection:)
|
|
82
|
-
response = connection.call(:
|
|
82
|
+
response = connection.call(:operations, :message_download, { 'isds:dmID' => message_id })
|
|
83
83
|
from_response(response, connection: connection)
|
|
84
84
|
end
|
|
85
85
|
|
data/lib/isds/search.rb
CHANGED
|
@@ -13,6 +13,8 @@ module ISDS
|
|
|
13
13
|
criteria = build_search_criteria(query, **options)
|
|
14
14
|
response = connection.call(:search, :find_data_box, criteria)
|
|
15
15
|
parse_search_response(response)
|
|
16
|
+
rescue PermissionDeniedError
|
|
17
|
+
[]
|
|
16
18
|
end
|
|
17
19
|
|
|
18
20
|
def self.by_name(name, connection:, exact: false)
|
data/lib/isds/version.rb
CHANGED
data/lib/isds.rb
CHANGED
|
@@ -21,24 +21,32 @@ module ISDS
|
|
|
21
21
|
ENDPOINTS = {
|
|
22
22
|
production: {
|
|
23
23
|
base_url: 'https://ws1.mojedatovaschranka.cz/',
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
operations: 'https://ws1.mojedatovaschranka.cz/DS/dz',
|
|
25
|
+
info: 'https://ws1.mojedatovaschranka.cz/DS/dx',
|
|
26
|
+
search: 'https://ws1.mojedatovaschranka.cz/DS/df',
|
|
27
|
+
access: 'https://ws1.mojedatovaschranka.cz/DS/DsManage',
|
|
28
|
+
supplementary: 'https://ws1.mojedatovaschranka.cz/DS/dx',
|
|
29
|
+
large_messages: 'https://ws1.mojedatovaschranka.cz/DS/dz'
|
|
26
30
|
},
|
|
27
31
|
test: {
|
|
28
|
-
base_url: 'https://
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
base_url: 'https://ws1.czebox.cz/',
|
|
33
|
+
operations: 'https://ws1.czebox.cz/DS/dz',
|
|
34
|
+
info: 'https://ws1.czebox.cz/DS/dx',
|
|
35
|
+
search: 'https://ws1.czebox.cz/DS/df',
|
|
36
|
+
access: 'https://ws1.czebox.cz/DS/DsManage',
|
|
37
|
+
supplementary: 'https://ws1.czebox.cz/DS/dx',
|
|
38
|
+
large_messages: 'https://ws1.czebox.cz/DS/dz',
|
|
31
39
|
wsdl_base: 'https://www.czebox.cz/static/wsdl/v20/'
|
|
32
40
|
}
|
|
33
41
|
}.freeze
|
|
34
42
|
|
|
35
43
|
SERVICE_ENDPOINT_MAP = {
|
|
36
|
-
operations: :
|
|
37
|
-
info: :
|
|
38
|
-
search: :
|
|
39
|
-
access: :
|
|
40
|
-
supplementary: :
|
|
41
|
-
large_messages: :
|
|
44
|
+
operations: :operations,
|
|
45
|
+
info: :info,
|
|
46
|
+
search: :search,
|
|
47
|
+
access: :access,
|
|
48
|
+
supplementary: :supplementary,
|
|
49
|
+
large_messages: :large_messages
|
|
42
50
|
}.freeze
|
|
43
51
|
|
|
44
52
|
class << self
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: isds
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Segfault Labs
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-02-
|
|
10
|
+
date: 2026-02-03 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: nokogiri
|