smile-identity-core 0.2.2 → 0.2.3

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
  SHA256:
3
- metadata.gz: 7d2e4ae32072d12b1eb24a22ce28b92a44589766dad915f0a93ee05a863d0701
4
- data.tar.gz: dc47c5848cfeb9238d130bdb56360c128eb0365f2fdb05c086d29aba8a4462ae
3
+ metadata.gz: 21c2a5a3b5e5f424a1c496debe16bab3a3950123b734c1a35e43035da2f7c622
4
+ data.tar.gz: a8cebcd27f35a24ae3bdcd61c692dae4523d8cf80e2f7adaf2e021dfe150a30e
5
5
  SHA512:
6
- metadata.gz: cc3d73bed752d90b3dbe60397c34a01a2e042956ffdb9ee9786caf34cb21c43fcf93bb7eb62c234f998672b9fb0fe3748a0b650bf98649798975aba2ef10e6ef
7
- data.tar.gz: 69a462097f0354646d1e94cc3598884c16ad52d13d2bf5da6b2f51926b48156adb5df07dd2585d3743e78d30653c08025fb4ca13fe1e5312aebd83e213f6dcbd
6
+ metadata.gz: f30735bd2481bd6baecad7b0c37c4aa6ca239e3c00ef61e96aa4f4346b732a2641fc2bcf34898e68de766835ec94aa759d481e014350936a4a6d40b2086b46a5
7
+ data.tar.gz: fd8bfef72649e53477633ed2bcd3d2235295b06b78ee418fecdfbe06466da244c1b0afd19ed5e79b9fb526bef191ce90b272e7fb658f48c22bdc214d53ddc015
data/.gitignore CHANGED
@@ -6,6 +6,7 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ /*.gem
9
10
 
10
11
  # rspec failure tracking
11
12
  .rspec_status
data/CHANGELOG.md CHANGED
@@ -24,3 +24,11 @@ Fix the loss of optional_callback
24
24
  Ensure that we allow nil inputs or empty hashes for options and id_info
25
25
  Confirm the signature when querying the job status
26
26
  Add a Utilities class with get_job_status that we use internally to expose a public get_job_status method on WebApi
27
+
28
+ ## [0.2.2] - 2019-09-17
29
+ ### Updated
30
+ Add the language to the package information
31
+
32
+ ## [0.2.3] - 2019-09-17
33
+ ### Updated
34
+ Lenient Decoding of the api key
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- smile-identity-core (0.2.2)
4
+ smile-identity-core (0.2.3)
5
5
  rubyzip (~> 1.2, >= 1.2.3)
6
6
  typhoeus (~> 1.0, >= 1.0.1)
7
7
 
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # SmileIdentityCore
2
2
 
3
- The official Smile Identity gem exposes two classes namely, the Web API and Signature class.
3
+ The official Smile Identity gem exposes three classes namely, the Web API and Signature class.
4
4
 
5
5
  The **Web API Class** allows you as the Partner to validate a user’s identity against the relevant Identity Authorities/Third Party databases that Smile Identity has access to using ID information provided by your customer/user (including photo for compare). It has the following public methods:
6
6
  - submit_job
@@ -10,8 +10,8 @@ The **Signature Class** allows you as the Partner to generate a sec key to inter
10
10
  - generate_sec_key
11
11
  - confirm_sec_key
12
12
 
13
- <!-- The **Utilities Class** allows you as the Partner to have access to our general Utility functions to gain access to your data. It has the following public methods:
14
- - get_job_status -->
13
+ The **Utilities Class** allows you as the Partner to have access to our general Utility functions to gain access to your data. It has the following public methods:
14
+ - get_job_status
15
15
 
16
16
  ## Documentation
17
17
 
@@ -150,7 +150,7 @@ $ connection = SmileIdentityCore::Signature.new(partner_id, api_key)
150
150
  $ sec_key = connection.confirm_sec_key(sec_key, timestamp)
151
151
  ```
152
152
 
153
- <!-- #### Utilities Class
153
+ #### Utilities Class
154
154
 
155
155
  You may want to receive more information about a job. This is built into Web Api if you choose to set return_job_status as true in the options hash. However, you also have the option to build the functionality yourself by using the Utilities class. Please note that if you are querying a job immediately after submitting it, you will need to poll it for the duration of the job.
156
156
 
@@ -161,7 +161,7 @@ utilities_connection = SmileIdentityCore::Utilities.new('partner_id', 'api_key'
161
161
 
162
162
  utilities_connection.get_job_status('user_id', 'job_id', options)
163
163
  where options is {return_history: true | false, return_image_links: true | false}
164
- ``` -->
164
+ ```
165
165
 
166
166
  ## Development
167
167
 
@@ -10,9 +10,9 @@ module SmileIdentityCore
10
10
  begin
11
11
  @timestamp = timestamp
12
12
 
13
- hash_signature = Digest::SHA256.hexdigest([@partner_id, @timestamp].join(":"))
14
- public_key = OpenSSL::PKey::RSA.new(Base64.strict_decode64(@api_key))
15
- @sec_key = [Base64.strict_encode64(public_key.public_encrypt(hash_signature)), hash_signature].join('|')
13
+ hash_signature = Digest::SHA256.hexdigest([@partner_id.to_i, @timestamp].join(":"))
14
+ public_key = OpenSSL::PKey::RSA.new(Base64.decode64(@api_key))
15
+ @sec_key = [Base64.encode64(public_key.public_encrypt(hash_signature)), hash_signature].join('|')
16
16
 
17
17
  return {
18
18
  sec_key: @sec_key,
@@ -25,11 +25,11 @@ module SmileIdentityCore
25
25
 
26
26
  def confirm_sec_key(timestamp, sec_key)
27
27
  begin
28
- hash_signature = Digest::SHA256.hexdigest([@partner_id, timestamp].join(":"))
28
+ hash_signature = Digest::SHA256.hexdigest([@partner_id.to_i, timestamp].join(":"))
29
29
  encrypted = sec_key.split('|')[0]
30
30
 
31
- public_key = OpenSSL::PKey::RSA.new(Base64.strict_decode64(@api_key))
32
- decrypted = public_key.public_decrypt(Base64.strict_decode64(encrypted))
31
+ public_key = OpenSSL::PKey::RSA.new(Base64.decode64(@api_key))
32
+ decrypted = public_key.public_decrypt(Base64.decode64(encrypted))
33
33
 
34
34
  return decrypted == hash_signature
35
35
  rescue => e
@@ -1,3 +1,3 @@
1
1
  module SmileIdentityCore
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smile-identity-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ridhwana