esteid 1.0.3 → 1.0.4
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/esteid/validation.rb +7 -2
- data/lib/esteid/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5b11bc5f34404ba59f40071a6eeae0964d658c42
|
|
4
|
+
data.tar.gz: 0ee911e62c4ae6250b7de86dcf262d9366e491d4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 46a2fea1f0ce5e7c024f3a64752e0b89cb82b3a8f9236b7fb3c57df5f0ad10c80d8132cc7fbaac8e2c35f3560bfd5662439a05df5f528d1464d2f08e1a187921
|
|
7
|
+
data.tar.gz: b217fae6301d02d465dbf2257864ce0318c2b0702f6098a98f3984f1a1e94773a3a9214c572b872e3d87cba0dfa26a649df7e5eba047a84d64c50c4a7e9a9e7b
|
data/lib/esteid/validation.rb
CHANGED
|
@@ -32,6 +32,7 @@ module EstEID
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
def valid?
|
|
35
|
+
return false unless eid_public_key_present?
|
|
35
36
|
status == "GOOD"
|
|
36
37
|
end
|
|
37
38
|
|
|
@@ -42,6 +43,10 @@ module EstEID
|
|
|
42
43
|
|
|
43
44
|
private
|
|
44
45
|
|
|
46
|
+
def eid_public_key_present?
|
|
47
|
+
!@eid_public_key.nil? && !@eid_public_key.empty?
|
|
48
|
+
end
|
|
49
|
+
|
|
45
50
|
def client
|
|
46
51
|
@client ||= ::Savon.client(
|
|
47
52
|
endpoint: EstEID.config.digidoc_endpoint_url,
|
|
@@ -55,7 +60,7 @@ module EstEID
|
|
|
55
60
|
|
|
56
61
|
def response
|
|
57
62
|
@response ||= client.call("CheckCertificate") do |locals|
|
|
58
|
-
locals.message "Certificate" => @
|
|
63
|
+
locals.message "Certificate" => @eid_public_key
|
|
59
64
|
end
|
|
60
65
|
end
|
|
61
66
|
|
|
@@ -64,7 +69,7 @@ module EstEID
|
|
|
64
69
|
end
|
|
65
70
|
|
|
66
71
|
def soap_error_code
|
|
67
|
-
response.body
|
|
72
|
+
response.body.dig(:fault, :faultstring)
|
|
68
73
|
end
|
|
69
74
|
|
|
70
75
|
def error_status(status)
|
data/lib/esteid/version.rb
CHANGED