mobile_id 0.0.14 → 0.0.15

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
  SHA256:
3
- metadata.gz: f6586590b52a7e282042dcc43d8de42c821d1d8b1ccfeb243ef4b9f75f2ac0ad
4
- data.tar.gz: ae6c05b4242a3beadf025c109f0912b5be3f99da2f8ad78c55ea0a58f5a66b0b
3
+ metadata.gz: 471b24920bcc581ae61b62629bf81b1bb9d7714b5a8fb56c35be92da0b1f813f
4
+ data.tar.gz: 4bc0e35fd965c21485113fef8f40cb3607a01c4b5f2ad01d09ef7a934d580e7d
5
5
  SHA512:
6
- metadata.gz: 67a128c840d171f2fc0199c86fea6d2c8cedca2d2efba844649595a156fc6cd29f9b50a442b8273bd1a719f8f26fbc57e66b5aa66c01e5e1204795b89b5d93ad
7
- data.tar.gz: db6c5d6cfd37d16c8fa6c1e826614d0861d5827785183d9e93807ed5ebde7a9f63f1548d9ec1d5d427a0a6210082c53ffdcd85228462e645b0069386e58f7904
6
+ metadata.gz: 7137ef520eddcacc1855dc6dbf4a2e18dddbc35c389d0ff95eac8e4d8832a1fa775db99650ff7ac350044ceef5c09bb789a802610f5c86c7f27cac000768f668
7
+ data.tar.gz: 3f5daa9b2b7fdc2fd97080af483c3a9ab20f5b43222087a8e3bbb109b61af2957501b686ed1032e1dee5156b8a4ff9024788f74ad5bb43ecea0a1983022ed4ef
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ Release 0.0.15
2
+ * Restored older Ruby 2.7 support
3
+
1
4
  Release 0.0.14
2
5
  * Added LT locale with locale init update (thanks Mijora)
3
6
  * Init rubocop (thanks Thales Ribeiro)
@@ -2,7 +2,6 @@
2
2
 
3
3
  module MobileId
4
4
  class Auth
5
-
6
5
  # API documentation https://github.com/SK-EID/MID
7
6
  LIVE_URL = 'https://mid.sk.ee/mid-api'
8
7
  TEST_URL = 'https://tsp.demo.sk.ee/mid-api'
@@ -53,7 +52,7 @@ module MobileId
53
52
  nationalIdentityNumber: personal_code.to_s.strip,
54
53
  hash: Base64.strict_encode64(hash),
55
54
  hashType: 'SHA256',
56
- language:,
55
+ language: language,
57
56
  displayText: display_text,
58
57
  displayTextFormat: 'GSM-7' # or "UCS-2”
59
58
  }.to_json
@@ -64,9 +63,9 @@ module MobileId
64
63
 
65
64
  ActiveSupport::HashWithIndifferentAccess.new(
66
65
  session_id: response['sessionID'],
67
- phone:,
68
- phone_calling_code:,
69
- doc:
66
+ phone: phone,
67
+ phone_calling_code: phone_calling_code,
68
+ doc: doc
70
69
  )
71
70
  end
72
71
 
@@ -74,9 +73,9 @@ module MobileId
74
73
  long_poll!(session_id: auth['session_id'], doc: auth['doc'])
75
74
 
76
75
  ActiveSupport::HashWithIndifferentAccess.new(
77
- personal_code:,
78
- first_name:,
79
- last_name:,
76
+ personal_code: personal_code,
77
+ first_name: first_name,
78
+ last_name: last_name,
80
79
  phone: auth['phone'],
81
80
  phone_calling_code: auth['phone_calling_code'],
82
81
  auth_provider: 'mobileid' # User::MOBILEID
@@ -123,7 +122,7 @@ module MobileId
123
122
  raise Error, message
124
123
  end
125
124
 
126
- @user_cert = MobileId::Cert.new(response['cert'], live:)
125
+ @user_cert = MobileId::Cert.new(response['cert'], live: live)
127
126
  @user_cert.verify_signature!(response['signature']['value'], doc)
128
127
  self.user_cert = @user_cert
129
128
  end
@@ -159,6 +158,5 @@ module MobileId
159
158
  user_cert.serial_number
160
159
  end
161
160
  alias personal_code serial_number
162
-
163
161
  end
164
162
  end
@@ -2,37 +2,39 @@
2
2
 
3
3
  module MobileId
4
4
  class Cert
5
-
6
5
  class << self
7
-
8
6
  def root_path
9
7
  @root_path ||= File.expand_path('certs', __dir__)
10
8
  end
11
9
 
12
10
  def live_store
13
11
  @live_store ||=
14
- build_store([
15
- File.join(root_path, 'EE_Certification_Centre_Root_CA.pem.crt'),
16
- File.join(root_path, 'EE-GovCA2018.pem.crt'),
17
- File.join(root_path, 'EID-SK_2011.pem.crt'),
18
- File.join(root_path, 'EID-SK_2016.pem.crt'),
19
- File.join(root_path, 'esteid2018.pem.crt'),
20
- File.join(root_path, 'ESTEID-SK_2011.pem.crt'),
21
- File.join(root_path, 'ESTEID-SK_2015.pem.crt'),
22
- File.join(root_path, 'KLASS3-SK_2010_EECCRCA.pem.crt'),
23
- File.join(root_path, 'KLASS3-SK_2010_EECCRCA_SHA384.pem.crt'),
24
- File.join(root_path, 'KLASS3-SK_2016_EECCRCA_SHA384.pem.crt'),
25
- File.join(root_path, 'KLASS3-SK.pem.crt'),
26
- File.join(root_path, 'NQ-SK_2016.pem.crt')
27
- ])
12
+ build_store(
13
+ [
14
+ File.join(root_path, 'EE_Certification_Centre_Root_CA.pem.crt'),
15
+ File.join(root_path, 'EE-GovCA2018.pem.crt'),
16
+ File.join(root_path, 'EID-SK_2011.pem.crt'),
17
+ File.join(root_path, 'EID-SK_2016.pem.crt'),
18
+ File.join(root_path, 'esteid2018.pem.crt'),
19
+ File.join(root_path, 'ESTEID-SK_2011.pem.crt'),
20
+ File.join(root_path, 'ESTEID-SK_2015.pem.crt'),
21
+ File.join(root_path, 'KLASS3-SK_2010_EECCRCA.pem.crt'),
22
+ File.join(root_path, 'KLASS3-SK_2010_EECCRCA_SHA384.pem.crt'),
23
+ File.join(root_path, 'KLASS3-SK_2016_EECCRCA_SHA384.pem.crt'),
24
+ File.join(root_path, 'KLASS3-SK.pem.crt'),
25
+ File.join(root_path, 'NQ-SK_2016.pem.crt')
26
+ ]
27
+ )
28
28
  end
29
29
 
30
30
  def test_store
31
31
  @test_store ||=
32
- build_store([
33
- File.join(root_path, 'TEST_of_EE_Certification_Centre_Root_CA.pem.crt'),
34
- File.join(root_path, 'TEST_of_ESTEID-SK_2015.pem.crt')
35
- ])
32
+ build_store(
33
+ [
34
+ File.join(root_path, 'TEST_of_EE_Certification_Centre_Root_CA.pem.crt'),
35
+ File.join(root_path, 'TEST_of_ESTEID-SK_2015.pem.crt')
36
+ ]
37
+ )
36
38
  end
37
39
 
38
40
  def build_store(paths)
@@ -43,14 +45,13 @@ module MobileId
43
45
  end
44
46
  store
45
47
  end
46
-
47
48
  end
48
49
 
49
50
  attr_accessor :cert, :subject
50
51
 
51
52
  def initialize(base64_cert, live:)
52
53
  self.cert = OpenSSL::X509::Certificate.new(Base64.decode64(base64_cert))
53
- verify!(cert, live:)
54
+ verify!(cert, live: live)
54
55
  build_cert_subject
55
56
  end
56
57
 
@@ -131,6 +132,5 @@ module MobileId
131
132
  result[key] = val
132
133
  end
133
134
  end
134
-
135
135
  end
136
136
  end
@@ -4,12 +4,10 @@ require 'rails'
4
4
 
5
5
  module MobileId
6
6
  class Railtie < ::Rails::Railtie # :nodoc:
7
-
8
7
  initializer 'mobile_id' do |_app|
9
8
  MobileId::LOCALES.each do |loc|
10
9
  I18n.load_path << File.expand_path("locales/#{loc}.yml", __dir__)
11
10
  end
12
11
  end
13
-
14
12
  end
15
13
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mobile_id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Priit Tark