Skip to content

Commit dd86156

Browse files
Merge pull request #210 from getyoti/release/3.4.0
Release 3.4.0
2 parents f4bd972 + 5ccb3c9 commit dd86156

38 files changed

+748
-210
lines changed

.travis.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,22 @@ jobs:
3131
- composer test
3232
- <<: *compatibility
3333
php: "7.4"
34-
name: "PHP: 7.4 / Protobuf C Extension"
34+
name: "PHP: 7.4 / Protobuf C Extension 3.12"
3535
install:
3636
- pecl install protobuf-3.12.2
3737
- travis_retry composer self-update
3838
- travis_retry composer install --no-interaction --prefer-source --dev
3939
script:
4040
- composer test
41+
- <<: *compatibility
42+
php: "7.4"
43+
name: "PHP: 7.4 / Protobuf C Extension 3.13"
44+
install:
45+
- pecl install protobuf-3.13.0
46+
- travis_retry composer self-update
47+
- travis_retry composer install --no-interaction --prefer-source --dev
48+
script:
49+
- composer test
4150
- <<: *test
4251
stage: Analyze
4352
name: Sonarcloud

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "yoti/yoti-php-sdk",
33
"description": "Yoti SDK for quickly integrating your PHP backend with Yoti",
4-
"version": "3.3.1",
4+
"version": "3.4.0",
55
"keywords": [
66
"yoti",
77
"sdk"
@@ -23,7 +23,7 @@
2323
}
2424
},
2525
"require-dev": {
26-
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.2",
26+
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.3",
2727
"squizlabs/php_codesniffer": "^3.4",
2828
"friendsofphp/php-cs-fixer": "^2.15",
2929
"brainmaestro/composer-git-hooks": "^2.8",

examples/aml-check/composer.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,14 @@
1515
}
1616
],
1717
"scripts": {
18-
"pre-install-cmd": "@copy-sdk",
19-
"pre-update-cmd": "@copy-sdk",
20-
"copy-sdk": "grep -q 'yoti-php-sdk' ../../composer.json && rm -fr ./sdk && cd ../../ && git archive --prefix=sdk/ --format=tar HEAD | (cd - && tar xf -) || echo 'Could not install SDK from parent directory'"
18+
"copy-sdk": "grep -q 'yoti-php-sdk' ../../composer.json && rm -fr ./sdk && cd ../../ && git archive --prefix=sdk/ --format=tar HEAD | (cd - && tar xf -) || echo 'Could not install SDK from parent directory'",
19+
"install-local": [
20+
"@copy-sdk",
21+
"composer install"
22+
],
23+
"update-local": [
24+
"@copy-sdk",
25+
"composer update"
26+
]
2127
}
2228
}

examples/doc-scan/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This example requires [Docker](https://docs.docker.com/)
1212
* Copy `.env.example` to `.env`
1313
* Open `.env` file and fill in the environment variables `YOTI_SDK_ID`, `YOTI_KEY_FILE_PATH`
1414
* Set `YOTI_KEY_FILE_PATH` to `./keys/your-application-pem-file.pem`
15-
* Run the `docker-compose up -d --build` command
15+
* Run the `docker-compose up --build` command
1616
* Visit [https://localhost:4003](https://localhost:4003)
1717
* Run the `docker-compose stop` command to stop the containers.
1818

examples/doc-scan/app/Http/Controllers/HomeController.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
use Yoti\DocScan\DocScanClient;
88
use Yoti\DocScan\Session\Create\Check\RequestedDocumentAuthenticityCheckBuilder;
99
use Yoti\DocScan\Session\Create\Check\RequestedFaceMatchCheckBuilder;
10+
use Yoti\DocScan\Session\Create\Check\RequestedIdDocumentComparisonCheckBuilder;
1011
use Yoti\DocScan\Session\Create\Check\RequestedLivenessCheckBuilder;
12+
use Yoti\DocScan\Session\Create\Filters\Orthogonal\OrthogonalRestrictionsFilterBuilder;
13+
use Yoti\DocScan\Session\Create\Filters\RequiredIdDocumentBuilder;
1114
use Yoti\DocScan\Session\Create\SdkConfigBuilder;
1215
use Yoti\DocScan\Session\Create\SessionSpecificationBuilder;
1316
use Yoti\DocScan\Session\Create\Task\RequestedTextExtractionTaskBuilder;
@@ -34,6 +37,10 @@ public function show(Request $request, DocScanClient $client)
3437
->withManualCheckNever()
3538
->build()
3639
)
40+
->withRequestedCheck(
41+
(new RequestedIdDocumentComparisonCheckBuilder())
42+
->build()
43+
)
3744
->withRequestedTask(
3845
(new RequestedTextExtractionTaskBuilder())
3946
->withManualCheckNever()
@@ -52,6 +59,24 @@ public function show(Request $request, DocScanClient $client)
5259
->withErrorUrl(config('app.url') . '/error')
5360
->build()
5461
)
62+
->withRequiredDocument(
63+
(new RequiredIdDocumentBuilder())
64+
->withFilter(
65+
(new OrthogonalRestrictionsFilterBuilder())
66+
->withWhitelistedDocumentTypes(['PASSPORT'])
67+
->build()
68+
)
69+
->build()
70+
)
71+
->withRequiredDocument(
72+
(new RequiredIdDocumentBuilder())
73+
->withFilter(
74+
(new OrthogonalRestrictionsFilterBuilder())
75+
->withWhitelistedDocumentTypes(['DRIVING_LICENCE'])
76+
->build()
77+
)
78+
->build()
79+
)
5580
->build();
5681

5782
$session = $client->createSession($sessionSpec);

examples/doc-scan/app/Http/Controllers/MediaController.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ public function show(string $id, Request $request, DocScanClient $client)
1515
$content = $media->getContent();
1616
$contentType = $media->getMimeType();
1717

18-
if ($request->get('base64') === '1' && $contentType === 'application/octet-stream') {
19-
$content = base64_decode($content, true);
20-
$contentType = (new \finfo(FILEINFO_MIME))->buffer($content);
21-
}
22-
2318
return response($content, 200)->header('Content-Type', $contentType);
2419
}
2520
}

examples/doc-scan/composer.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,16 @@
3636
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
3737
"@php artisan package:discover --ansi"
3838
],
39-
"pre-install-cmd": "@copy-sdk",
40-
"pre-update-cmd": "@copy-sdk",
4139
"post-update-cmd": "@php artisan key:generate --ansi",
42-
"copy-sdk": "grep -q 'yoti-php-sdk' ../../composer.json && rm -fr ./sdk && cd ../../ && git archive --prefix=sdk/ --format=tar HEAD | (cd - && tar xf -) || echo 'Could not install SDK from parent directory'"
40+
"copy-sdk": "grep -q 'yoti-php-sdk' ../../composer.json && rm -fr ./sdk && cd ../../ && git archive --prefix=sdk/ --format=tar HEAD | (cd - && tar xf -) || echo 'Could not install SDK from parent directory'",
41+
"install-local": [
42+
"@copy-sdk",
43+
"composer install"
44+
],
45+
"update-local": [
46+
"@copy-sdk",
47+
"composer update"
48+
]
4349
},
4450
"repositories": [
4551
{

examples/doc-scan/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ services:
2222
volumes:
2323
- ../../:/usr/share/yoti-php-sdk
2424
working_dir: /usr/share/yoti-php-sdk/examples/doc-scan
25-
command: update
25+
command: update-local

examples/doc-scan/resources/views/success.blade.php

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@
3737
<td>User Tracking ID</td>
3838
<td>{{ $sessionResult->getUserTrackingId() }}</td>
3939
</tr>
40+
@if ($sessionResult->getBiometricConsentTimestamp())
41+
<tr>
42+
<td>Biometric Consent Timestamp</td>
43+
<td>
44+
{{ $sessionResult->getBiometricConsentTimestamp()->format('r') }}
45+
</td>
46+
</tr>
47+
@endif
4048
</tbody>
4149
</table>
4250
</div>
@@ -132,6 +140,26 @@
132140
</div>
133141
</div>
134142
@endif
143+
144+
@if (count($sessionResult->getIdDocumentComparisonChecks()) > 0)
145+
<div class="card">
146+
<div class="card-header" id="comparison-checks">
147+
<h3 class="mb-0">
148+
<button class="btn btn-link" type="button" data-toggle="collapse" data-target="#collapse-comparison-checks" aria-expanded="true" aria-controls="collapse-comparison-checks">
149+
ID Document Comparison Checks
150+
</button>
151+
</h3>
152+
</div>
153+
154+
<div id="collapse-comparison-checks" class="collapse" aria-labelledby="comparison-checks">
155+
<div class="card-body">
156+
@foreach($sessionResult->getIdDocumentComparisonChecks() as $check)
157+
@include('partial/check', ['check' => $check])
158+
@endforeach
159+
</div>
160+
</div>
161+
</div>
162+
@endif
135163
</div>
136164
</div>
137165
</div>
@@ -316,37 +344,6 @@
316344

317345
<div class="accordion mt-3">
318346

319-
@if ($livenessResource->getFaceMap())
320-
<div class="card">
321-
<div class="card-header" id="liveness-{{ $livenessNum }}-facemap">
322-
<h3 class="mb-0">
323-
<button class="btn btn-link" type="button" data-toggle="collapse" data-target="#collapse-liveness-{{ $livenessNum }}-facemap" aria-expanded="true" aria-controls="collapse-liveness-{{ $livenessNum }}-facemap">
324-
Face Map
325-
</button>
326-
</h3>
327-
</div>
328-
<div id="collapse-liveness-{{ $livenessNum }}-facemap" class="collapse" aria-labelledby="liveness-{{ $livenessNum }}-facemap">
329-
<div class="card-body">
330-
@if ($livenessResource->getFaceMap()->getMedia())
331-
<h4>Media</h4>
332-
<table class="table table-striped">
333-
<tbody>
334-
<tr>
335-
<td>ID</td>
336-
<td>
337-
<a href="/media/{{ $livenessResource->getFaceMap()->getMedia()->getId() }}?base64=1">
338-
{{ $livenessResource->getFaceMap()->getMedia()->getId() }}
339-
</a>
340-
</td>
341-
</tr>
342-
</tbody>
343-
</table>
344-
@endif
345-
</div>
346-
</div>
347-
</div>
348-
@endif
349-
350347
@if (count($livenessResource->getFrames()) > 0)
351348
<div class="card">
352349
<div class="card-header" id="liveness-{{ $livenessNum }}-frames">

examples/docker/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
FROM nginx:latest
22

3+
COPY openssl.cnf /etc/ssl/openssl.localhost.cnf
34
COPY default.conf /etc/nginx/conf.d/
45

56
RUN rm -rf /usr/share/nginx/html/index.html \
@@ -9,10 +10,11 @@ RUN apt-get update \
910
&& apt-get install php7.0 php-curl openssl -y
1011

1112
RUN openssl req \
13+
-config /etc/ssl/openssl.localhost.cnf \
1214
-x509 \
1315
-nodes \
1416
-days 365 \
17+
-sha256 \
1518
-newkey rsa:2048 \
1619
-keyout /etc/ssl/server.key \
17-
-out /etc/ssl/server.crt \
18-
-subj "/C=UK/ST=London/L=London/O=Yoti/OU=Yoti/CN=localhost"
20+
-out /etc/ssl/server.crt

0 commit comments

Comments
 (0)