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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fbb4a4c40badbfdb6a038a81afec01a1a1e214b3
4
- data.tar.gz: 99fedb381bf95c531142edff6a3c74d7a00edd4c
3
+ metadata.gz: 5b11bc5f34404ba59f40071a6eeae0964d658c42
4
+ data.tar.gz: 0ee911e62c4ae6250b7de86dcf262d9366e491d4
5
5
  SHA512:
6
- metadata.gz: 2996ce97e8353af523743f8961a3c00d374606ac414752d4c4d9f85f65aba596a2240636824ccb2bad88e0e17636463739a544056bc51d2cb68673eaff7c0684
7
- data.tar.gz: 6e5e1482780f1004855f4edd293a381ae25ca2e0e1c88ed2a67cb349c3818e64923ec7d36248d959425cb760b705631fdecdb5bc6942153edc5712eacb96c2f7
6
+ metadata.gz: 46a2fea1f0ce5e7c024f3a64752e0b89cb82b3a8f9236b7fb3c57df5f0ad10c80d8132cc7fbaac8e2c35f3560bfd5662439a05df5f528d1464d2f08e1a187921
7
+ data.tar.gz: b217fae6301d02d465dbf2257864ce0318c2b0702f6098a98f3984f1a1e94773a3a9214c572b872e3d87cba0dfa26a649df7e5eba047a84d64c50c4a7e9a9e7b
@@ -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" => @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[:fault][:faultstring]
72
+ response.body.dig(:fault, :faultstring)
68
73
  end
69
74
 
70
75
  def error_status(status)
@@ -1,3 +1,3 @@
1
1
  module EstEID
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: esteid
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artem Pakk