usesmileid 12.0.0 → 12.1.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/CHANGELOG.md +32 -33
- data/README.md +20 -0
- data/lib/usesmileid/client/resources.rb +25 -1
- data/lib/usesmileid/generated/operations.rb +5 -0
- data/lib/usesmileid/helpers/multipart.rb +5 -3
- data/lib/usesmileid/version.rb +1 -1
- 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: 896bc049c137997c9de0181582b1bb2564e96fbba5bbbac64b640363e7f472b2
|
|
4
|
+
data.tar.gz: 7f8bda781a38427a40550e95af93dc0286523b2b41e30a0cc37ef482b6752b8b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e0e6772c8b7f6466b8807943dbda2cc72e8e52564ffe745faf9b9bc5cb2623dd43ecae662fab88974ecb98ae780fd713cacc11014bd23157e458b10c5709f17f
|
|
7
|
+
data.tar.gz: 94a7ac44229e2d2e43c722a2113a72d589db9a8242ca5f4ec7b1febd7828f35841d15fe1183c713bd91468e45d569f1403a6f392d7f96b13d82e8f00a6ee7fc8
|
data/CHANGELOG.md
CHANGED
|
@@ -7,41 +7,40 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
- Renamed the gem from `smile-identity-core` to `smileid`. The require path
|
|
13
|
-
(`require "smileid"`) and the `SmileID` module are unchanged.
|
|
14
|
-
- Set the version to 12.0.0, aligning the server SDKs with the V12 mobile
|
|
15
|
-
SDKs.
|
|
16
|
-
- `base_url` must now be an absolute https URL with no query or fragment,
|
|
17
|
-
validated at construction. There is no allow-insecure option.
|
|
18
|
-
- `default_callback_url` (at construction) and per-request `callback_url`
|
|
19
|
-
values (entry operations and replay) must be https; insecure values raise
|
|
20
|
-
a validation error before any request is sent.
|
|
21
|
-
- `job_id` and `user_id` path parameters are URL-encoded as single path
|
|
22
|
-
segments before interpolation.
|
|
23
|
-
- Multipart filenames and content types are sanitized against header
|
|
24
|
-
injection on every input path, including caller-supplied content types.
|
|
25
|
-
Filenames have control characters stripped and quotes encoded; content
|
|
26
|
-
types must be a valid media type.
|
|
10
|
+
## [12.1.0] - 2026-10-01
|
|
27
11
|
|
|
28
12
|
### Added
|
|
29
13
|
|
|
30
|
-
-
|
|
31
|
-
response body is not the expected JSON object.
|
|
14
|
+
- Residency Document Verification: `documents.verify_residency`.
|
|
32
15
|
|
|
33
|
-
|
|
16
|
+
## [12.0.0] - 2026-08-20
|
|
17
|
+
|
|
18
|
+
First public release.
|
|
19
|
+
|
|
20
|
+
### Products
|
|
21
|
+
|
|
22
|
+
- Enhanced KYC, Biometric KYC, Document Verification and Enhanced Document
|
|
23
|
+
Verification.
|
|
24
|
+
- SmartSelfie enrollment, authentication and compare.
|
|
25
|
+
|
|
26
|
+
### Verifications
|
|
27
|
+
|
|
28
|
+
- Job status retrieval, plus a `wait_until_complete` helper that polls until
|
|
29
|
+
a job reaches a terminal decision.
|
|
30
|
+
- Callback replay.
|
|
31
|
+
- User fraud reporting, with `flag_fraud` / `clear_fraud` convenience
|
|
32
|
+
wrappers.
|
|
33
|
+
|
|
34
|
+
### Client
|
|
35
|
+
|
|
36
|
+
- Sandbox and production environments, with a `base_url` override for other
|
|
37
|
+
hosts. `base_url` and callback URLs must be https, checked before any
|
|
38
|
+
request is sent.
|
|
39
|
+
- Internal JWT authentication, cached and refreshed automatically on 401.
|
|
40
|
+
- Automatic retries with backoff for idempotent calls.
|
|
41
|
+
- Typed errors under `SmileID::Errors`, keyed on HTTP status.
|
|
42
|
+
- Bank codes, supported ID types and supported documents lookups.
|
|
34
43
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
replay, fraud reporting (with `flag_fraud` / `clear_fraud` wrappers), and the
|
|
39
|
-
four services endpoints.
|
|
40
|
-
- Internal JWT authentication with a thread-safe cache and a single automatic
|
|
41
|
-
refresh on 401.
|
|
42
|
-
- Typed error hierarchy under `SmileID::Errors`, covering both API error body
|
|
43
|
-
shapes.
|
|
44
|
-
- Automatic retries with exponential backoff and `Retry-After` support for
|
|
45
|
-
idempotent calls only.
|
|
46
|
-
- Consent builder and client-side validation for user details and fraud
|
|
47
|
-
reports.
|
|
44
|
+
[Unreleased]: https://github.com/smileidentity/smileid-sdk-ruby/compare/v12.1.0...HEAD
|
|
45
|
+
[12.1.0]: https://github.com/smileidentity/smileid-sdk-ruby/compare/v12.0.0...v12.1.0
|
|
46
|
+
[12.0.0]: https://github.com/smileidentity/smileid-sdk-ruby/releases/tag/v12.0.0
|
data/README.md
CHANGED
|
@@ -142,6 +142,26 @@ accepted = smile.documents.verify_enhanced(
|
|
|
142
142
|
)
|
|
143
143
|
```
|
|
144
144
|
|
|
145
|
+
### Residency document verification
|
|
146
|
+
|
|
147
|
+
Same shape as enhanced document verification, plus the `visa` endorsed in the
|
|
148
|
+
passport (JPEG or PNG). `id_type` is optional and defaults to `PASSPORT`, the
|
|
149
|
+
only value accepted. The visa details arrive in
|
|
150
|
+
`additional_documents` on the callback.
|
|
151
|
+
|
|
152
|
+
```ruby
|
|
153
|
+
accepted = smile.documents.verify_residency(
|
|
154
|
+
selfie_image: "selfie.jpg",
|
|
155
|
+
liveness_images: ["live1.jpg", "live2.jpg", "live3.jpg",
|
|
156
|
+
"live4.jpg", "live5.jpg", "live6.jpg"],
|
|
157
|
+
document: "passport.jpg",
|
|
158
|
+
visa: "visa.jpg",
|
|
159
|
+
country: "ZA",
|
|
160
|
+
user_details: user_details,
|
|
161
|
+
consent: consent
|
|
162
|
+
)
|
|
163
|
+
```
|
|
164
|
+
|
|
145
165
|
### Biometric KYC
|
|
146
166
|
|
|
147
167
|
```ruby
|
|
@@ -55,7 +55,8 @@ module SmileID
|
|
|
55
55
|
end
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
-
# POST /v3/document_verification
|
|
58
|
+
# POST /v3/document_verification, /v3/enhanced_document_verification and
|
|
59
|
+
# /v3/residency_document_verification
|
|
59
60
|
class Documents < Base
|
|
60
61
|
def verify(selfie_image:, liveness_images:, document:, consent:, country:, user_details:,
|
|
61
62
|
document_back: nil, id_type: nil, callback_url: nil,
|
|
@@ -87,6 +88,29 @@ module SmileID
|
|
|
87
88
|
user_id_header: user_id, timeout: timeout))
|
|
88
89
|
end
|
|
89
90
|
|
|
91
|
+
# POST /v3/residency_document_verification. The document is a passport
|
|
92
|
+
# and the visa endorsed in it is read as well, so id_type defaults to, and must be, PASSPORT.
|
|
93
|
+
def verify_residency(selfie_image:, liveness_images:, document:, visa:, consent:,
|
|
94
|
+
country:, user_details:, id_type: 'PASSPORT', document_back: nil,
|
|
95
|
+
callback_url: nil, partner_params: nil, metadata: nil, user_id: nil, timeout: nil)
|
|
96
|
+
id_type = 'PASSPORT' if id_type.to_s.empty?
|
|
97
|
+
unless id_type.to_s == 'PASSPORT'
|
|
98
|
+
raise Errors::ValidationError.new('id_type must be PASSPORT for residency document verification')
|
|
99
|
+
end
|
|
100
|
+
if visa.nil? || (visa.respond_to?(:empty?) && visa.empty?)
|
|
101
|
+
raise Errors::ValidationError.new('visa is required for residency document verification')
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
form = document_form(
|
|
105
|
+
selfie_image: selfie_image, liveness_images: liveness_images, document: document,
|
|
106
|
+
document_back: document_back, consent: consent, country: country, id_type: id_type,
|
|
107
|
+
user_details: user_details, callback_url: callback_url,
|
|
108
|
+
partner_params: partner_params, metadata: metadata
|
|
109
|
+
).merge('visa' => visa)
|
|
110
|
+
accepted(@client.call(:residency_document_verification, form: form,
|
|
111
|
+
user_id_header: user_id, timeout: timeout))
|
|
112
|
+
end
|
|
113
|
+
|
|
90
114
|
private
|
|
91
115
|
|
|
92
116
|
def document_form(selfie_image:, liveness_images:, document:, document_back:, consent:,
|
|
@@ -33,6 +33,11 @@ module SmileID
|
|
|
33
33
|
partner_id_header: true, body_kind: :multipart, idempotent: false,
|
|
34
34
|
success_statuses: [202]
|
|
35
35
|
),
|
|
36
|
+
residency_document_verification: Operation.new(
|
|
37
|
+
http_method: :post, path: '/v3/residency_document_verification', authenticated: true,
|
|
38
|
+
partner_id_header: true, body_kind: :multipart, idempotent: false,
|
|
39
|
+
success_statuses: [202]
|
|
40
|
+
),
|
|
36
41
|
biometric_kyc: Operation.new(
|
|
37
42
|
http_method: :post, path: '/v3/biometric_kyc', authenticated: true,
|
|
38
43
|
partner_id_header: true, body_kind: :multipart, idempotent: false,
|
|
@@ -21,7 +21,7 @@ module SmileID
|
|
|
21
21
|
# Fields serialized as JSON parts.
|
|
22
22
|
JSON_PART_FIELDS = %w[consent user_details partner_params metadata].freeze
|
|
23
23
|
# Single binary fields.
|
|
24
|
-
BINARY_FIELDS = %w[selfie_image document document_back comparison_image].freeze
|
|
24
|
+
BINARY_FIELDS = %w[selfie_image document document_back visa comparison_image].freeze
|
|
25
25
|
# Repeated binary fields.
|
|
26
26
|
BINARY_ARRAY_FIELDS = %w[liveness_images].freeze
|
|
27
27
|
|
|
@@ -29,13 +29,14 @@ module SmileID
|
|
|
29
29
|
'selfie_image' => 'image/jpeg',
|
|
30
30
|
'document' => 'image/jpeg',
|
|
31
31
|
'document_back' => 'image/jpeg',
|
|
32
|
+
'visa' => 'image/jpeg',
|
|
32
33
|
'comparison_image' => 'image/jpeg',
|
|
33
34
|
'liveness_images' => 'image/jpeg'
|
|
34
35
|
}.freeze
|
|
35
36
|
|
|
36
|
-
# Only document and
|
|
37
|
+
# Only document, document_back and visa may be PNG (spec section 5.3 rule 3);
|
|
37
38
|
# selfie, liveness and comparison images are always image/jpeg.
|
|
38
|
-
PNG_CAPABLE_FIELDS = %w[document document_back].freeze
|
|
39
|
+
PNG_CAPABLE_FIELDS = %w[document document_back visa].freeze
|
|
39
40
|
PNG_MAGIC = "\x89PNG".b.freeze
|
|
40
41
|
|
|
41
42
|
# RFC 6838 type/subtype tokens — anything else is rejected before send.
|
|
@@ -45,6 +46,7 @@ module SmileID
|
|
|
45
46
|
'selfie_image' => 'selfie.jpg',
|
|
46
47
|
'document' => 'document.jpg',
|
|
47
48
|
'document_back' => 'document_back.jpg',
|
|
49
|
+
'visa' => 'visa.jpg',
|
|
48
50
|
'comparison_image' => 'comparison.jpg'
|
|
49
51
|
}.freeze
|
|
50
52
|
|
data/lib/usesmileid/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: usesmileid
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 12.
|
|
4
|
+
version: 12.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Smile Identity
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-10-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|