From 11aee0dce07586682362f5a625401cdbeea9df93 Mon Sep 17 00:00:00 2001 From: Rodion Liuborets Date: Mon, 17 Oct 2022 15:40:43 +0300 Subject: [PATCH 01/45] Release 4.1.0 --- composer.json | 2 +- src/Constants.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 6c851e36..53ce4f66 100755 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "yoti/yoti-php-sdk", "description": "Yoti SDK for quickly integrating your PHP backend with Yoti", - "version": "4.0.0", + "version": "4.1.0", "keywords": [ "yoti", "sdk" diff --git a/src/Constants.php b/src/Constants.php index b3a77422..6933f0d9 100644 --- a/src/Constants.php +++ b/src/Constants.php @@ -25,7 +25,7 @@ class Constants public const SDK_IDENTIFIER = 'PHP'; /** Default SDK version */ - public const SDK_VERSION = '4.0.0'; + public const SDK_VERSION = '4.1.0'; /** Base url for connect page (user will be redirected to this page eg. baseurl/app-id) */ public const CONNECT_BASE_URL = 'https://www.yoti.com/connect'; From d7819cc076c8893c07f28128e201cd1e7c2aadc0 Mon Sep 17 00:00:00 2001 From: Rodion Liuborets Date: Thu, 20 Oct 2022 17:39:40 +0300 Subject: [PATCH 02/45] Add helper method to GetSessionResult getFaceComparisonChecks --- .../Session/Retrieve/FaceComparisonCheckResponse.php | 9 +++++++++ src/DocScan/Session/Retrieve/GetSessionResult.php | 10 ++++++++++ .../DocScan/Session/Retrieve/GetSessionResultTest.php | 11 ++++++++++- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 src/DocScan/Session/Retrieve/FaceComparisonCheckResponse.php diff --git a/src/DocScan/Session/Retrieve/FaceComparisonCheckResponse.php b/src/DocScan/Session/Retrieve/FaceComparisonCheckResponse.php new file mode 100644 index 00000000..965fbce5 --- /dev/null +++ b/src/DocScan/Session/Retrieve/FaceComparisonCheckResponse.php @@ -0,0 +1,9 @@ +filterCheckByType(FaceMatchCheckResponse::class); } + /** + * @return FaceComparisonCheckResponse[] + */ + public function getFaceComparisonChecks(): array + { + return $this->filterCheckByType(FaceComparisonCheckResponse::class); + } + /** * @deprecated replaced by ::getIdDocumentTextDataChecks() * @@ -255,6 +263,8 @@ private function createCheckFromArray(array $check): CheckResponse return new IdDocumentComparisonCheckResponse($check); case Constants::ID_DOCUMENT_FACE_MATCH: return new FaceMatchCheckResponse($check); + case Constants::FACE_COMPARISON: + return new FaceComparisonCheckResponse($check); case Constants::ID_DOCUMENT_TEXT_DATA_CHECK: return new TextDataCheckResponse($check); case Constants::SUPPLEMENTARY_DOCUMENT_TEXT_DATA_CHECK: diff --git a/tests/DocScan/Session/Retrieve/GetSessionResultTest.php b/tests/DocScan/Session/Retrieve/GetSessionResultTest.php index 4fae33b8..cbd2cc0d 100644 --- a/tests/DocScan/Session/Retrieve/GetSessionResultTest.php +++ b/tests/DocScan/Session/Retrieve/GetSessionResultTest.php @@ -27,6 +27,7 @@ class GetSessionResultTest extends TestCase private const WATCHLIST_ADVANCED_CA = 'WATCHLIST_ADVANCED_CA'; private const SUPPLEMENTARY_DOCUMENT_TEXT_DATA_CHECK = 'SUPPLEMENTARY_DOCUMENT_TEXT_DATA_CHECK'; private const LIVENESS = 'LIVENESS'; + private const FACE_COMPARISON = 'FACE_COMPARISON'; private const SOME_UNKNOWN_TYPE = 'someUnknownType'; private const SOME_STATE = 'someState'; private const SOME_SESSION_ID = 'someSessionId'; @@ -125,6 +126,7 @@ public function shouldParseUnknownCheck() * @covers ::getLivenessChecks * @covers ::getWatchlistAdvancedCaChecks * @covers ::getThirdPartyIdentityFraudOneChecks + * @covers ::getFaceComparisonChecks * @covers ::createCheckFromArray * @covers ::filterCheckByType */ @@ -142,12 +144,13 @@ public function shouldFilterChecks(): void ['type' => self::LIVENESS], ['type' => self::WATCHLIST_ADVANCED_CA], ['type' => self::THIRD_PARTY_IDENTITY_FRAUD_1], + ['type' => self::FACE_COMPARISON], ], ]; $result = new GetSessionResult($input); - $this->assertCount(10, $result->getChecks()); + $this->assertCount(11, $result->getChecks()); $this->assertCount(1, $result->getAuthenticityChecks()); $this->assertCount(1, $result->getFaceMatchChecks()); $this->assertCount(1, $result->getTextDataChecks()); @@ -159,6 +162,7 @@ public function shouldFilterChecks(): void $this->assertCount(1, $result->getLivenessChecks()); $this->assertCount(1, $result->getWatchlistAdvancedCaChecks()); $this->assertCount(1, $result->getThirdPartyIdentityFraudOneChecks()); + $this->assertCount(1, $result->getFaceComparisonChecks()); $this->assertEquals( self::ID_DOCUMENT_AUTHENTICITY, @@ -205,6 +209,11 @@ public function shouldFilterChecks(): void ThirdPartyIdentityFraudOneCheckResponse::class, $result->getThirdPartyIdentityFraudOneChecks()[0] ); + + $this->assertEquals( + self::FACE_COMPARISON, + $result->getFaceComparisonChecks()[0]->getType() + ); } /** From 4b445a078fdc4224915b839a84962472544b3096 Mon Sep 17 00:00:00 2001 From: Rodion Liuborets Date: Fri, 28 Oct 2022 13:28:52 +0300 Subject: [PATCH 03/45] Add several fixes, update php8.0 -> 8.1, guzzlehttp/guzzle -> 7.0, guzzlehttp/psr7 -> 2.4 --- .php_cs.dist => .php-cs-fixer.dist.php | 6 ++- CONTRIBUTING.md | 2 +- composer.json | 12 ++--- .../Document/DocumentRestrictionsFilter.php | 2 +- .../Retrieve/FaceCaptureImageResponse.php | 19 +++++-- .../Retrieve/FaceCaptureResourceResponse.php | 16 ++++++ .../Session/Retrieve/ResourceResponse.php | 26 +++++++++ .../FaceCaptureResourceResponseTest.php | 54 +++++++++++++++++++ .../Session/Retrieve/ResourceResponseTest.php | 20 +++++++ 9 files changed, 145 insertions(+), 12 deletions(-) rename .php_cs.dist => .php-cs-fixer.dist.php (86%) create mode 100644 tests/DocScan/Session/Retrieve/FaceCaptureResourceResponseTest.php diff --git a/.php_cs.dist b/.php-cs-fixer.dist.php similarity index 86% rename from .php_cs.dist rename to .php-cs-fixer.dist.php index af0a1cb8..18a287e2 100644 --- a/.php_cs.dist +++ b/.php-cs-fixer.dist.php @@ -5,7 +5,9 @@ ->in(__DIR__ . '/tests') ; -return PhpCsFixer\Config::create() +$config = new PhpCsFixer\Config(); +$config + ->setRiskyAllowed(true) ->setRules([ 'array_syntax' => ['syntax' => 'short'], 'no_unused_imports' => true, @@ -22,3 +24,5 @@ ]) ->setFinder($finder) ; + +return $config; diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a312a072..207b6a27 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,7 +32,7 @@ composer coverage-clover We follow the [PSR-12 Style Guide](https://www.php-fig.org/psr/psr-12/), which is configured in [.phpcs.xml.dist](.phpcs.xml.dist). -Additional checks are configured in [.php_cs.dist](.php_cs.dist) - See +Additional checks are configured in [.php-cs-fixer.dist.php](.php-cs-fixer.dist.php) - See for further information. Coding style can be verified by running: diff --git a/composer.json b/composer.json index 53ce4f66..7629e4a8 100755 --- a/composer.json +++ b/composer.json @@ -9,14 +9,14 @@ "homepage": "https://yoti.com", "license": "MIT", "require": { - "php": "^7.1 || ^8.0", + "php": "^7.1 || ^8.1", "ext-json": "*", "google/protobuf": "^3.10", "phpseclib/phpseclib": "^3.0", - "guzzlehttp/guzzle": "^6.4 || ^7.0", + "guzzlehttp/guzzle": "^7.0", "psr/http-client": "^1.0", "psr/http-message": "^1.0", - "guzzlehttp/psr7": "^2.0", + "guzzlehttp/psr7": "^2.4", "ext-openssl": "*" }, "autoload": { @@ -27,7 +27,7 @@ "require-dev": { "phpunit/phpunit": "^9.5.13", "squizlabs/php_codesniffer": "^3.4", - "friendsofphp/php-cs-fixer": "^2.15", + "friendsofphp/php-cs-fixer": "^3.4", "brainmaestro/composer-git-hooks": "^2.8", "phpstan/phpstan-strict-rules": "^0.12.1", "phpstan/extension-installer": "^1.0", @@ -45,12 +45,12 @@ "coverage-clover": "phpunit --coverage-clover ./coverage/coverage.xml", "coverage-html": "phpunit --coverage-html ./coverage/report", "fix": [ - "php-cs-fixer fix --config=.php_cs.dist -v --using-cache=no --diff-format=udiff --ansi", + "php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --using-cache=no", "phpcbf" ], "lint": [ "phpcs", - "php-cs-fixer fix --config=.php_cs.dist -v --dry-run --using-cache=no --diff-format=udiff --ansi", + "php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --dry-run --using-cache=no", "phpstan analyse" ], "post-install-cmd": "cghooks add --ignore-lock", diff --git a/src/DocScan/Session/Create/Filters/Document/DocumentRestrictionsFilter.php b/src/DocScan/Session/Create/Filters/Document/DocumentRestrictionsFilter.php index bf3099ef..49c52ee7 100644 --- a/src/DocScan/Session/Create/Filters/Document/DocumentRestrictionsFilter.php +++ b/src/DocScan/Session/Create/Filters/Document/DocumentRestrictionsFilter.php @@ -32,7 +32,7 @@ class DocumentRestrictionsFilter extends DocumentFilter implements \JsonSerializ /** * @param string $inclusion - * @param array $documents + * @param DocumentRestriction[] $documents * @param bool|null $allowNonLatinDocuments * @param bool|null $allowExpiredDocuments */ diff --git a/src/DocScan/Session/Retrieve/FaceCaptureImageResponse.php b/src/DocScan/Session/Retrieve/FaceCaptureImageResponse.php index b8ef635a..05da77e4 100644 --- a/src/DocScan/Session/Retrieve/FaceCaptureImageResponse.php +++ b/src/DocScan/Session/Retrieve/FaceCaptureImageResponse.php @@ -2,17 +2,30 @@ namespace Yoti\DocScan\Session\Retrieve; +use Yoti\Exception\DateTimeException; + class FaceCaptureImageResponse { /** - * @var MediaResponse $media + * @var null|MediaResponse $media */ private $media; /** - * @return MediaResponse + * @param array $image + * @throws DateTimeException + */ + public function __construct(array $image) + { + if (isset($image['media'])) { + $this->media = new MediaResponse($image['media']); + } + } + + /** + * @return null|MediaResponse */ - public function getMedia(): MediaResponse + public function getMedia(): ?MediaResponse { return $this->media; } diff --git a/src/DocScan/Session/Retrieve/FaceCaptureResourceResponse.php b/src/DocScan/Session/Retrieve/FaceCaptureResourceResponse.php index 13836ae8..7c61d590 100644 --- a/src/DocScan/Session/Retrieve/FaceCaptureResourceResponse.php +++ b/src/DocScan/Session/Retrieve/FaceCaptureResourceResponse.php @@ -2,6 +2,8 @@ namespace Yoti\DocScan\Session\Retrieve; +use Yoti\Exception\DateTimeException; + class FaceCaptureResourceResponse extends ResourceResponse { /** @@ -9,6 +11,20 @@ class FaceCaptureResourceResponse extends ResourceResponse */ private $image; + /** + * FaceCaptureResourceResponse constructor. + * @param array $faceCaptures + * @throws DateTimeException + */ + public function __construct(array $faceCaptures) + { + parent::__construct($faceCaptures); + + if (isset($faceCaptures['image'])) { + $this->image = new FaceCaptureImageResponse($faceCaptures['image']); + } + } + /** * @return FaceCaptureImageResponse */ diff --git a/src/DocScan/Session/Retrieve/ResourceResponse.php b/src/DocScan/Session/Retrieve/ResourceResponse.php index eaaa8982..aa7de1f3 100644 --- a/src/DocScan/Session/Retrieve/ResourceResponse.php +++ b/src/DocScan/Session/Retrieve/ResourceResponse.php @@ -4,6 +4,10 @@ use Yoti\DocScan\Constants; use Yoti\DocScan\Session\Retrieve\Configuration\Capture\Source\AllowedSourceResponse; +use Yoti\DocScan\Session\Retrieve\Configuration\Capture\Source\EndUserAllowedSourceResponse; +use Yoti\DocScan\Session\Retrieve\Configuration\Capture\Source\IbvAllowedSourceResponse; +use Yoti\DocScan\Session\Retrieve\Configuration\Capture\Source\RelyingBusinessAllowedSourceResponse; +use Yoti\DocScan\Session\Retrieve\Configuration\Capture\Source\UnknownAllowedSourceResponse; class ResourceResponse { @@ -35,6 +39,10 @@ public function __construct(array $resource) $this->tasks[] = $this->createTaskFromArray($task); } } + + if (isset($resource['source']['type'])) { + $this->source = $this->createSourceFromType($resource['source']['type']); + } } /** @@ -100,4 +108,22 @@ private function createTaskFromArray(array $task): TaskResponse return new TaskResponse($task); } } + + /** + * @param string $type + * @return AllowedSourceResponse + */ + private function createSourceFromType(string $type): AllowedSourceResponse + { + switch ($type ?? null) { + case Constants::END_USER: + return new EndUserAllowedSourceResponse(); + case Constants::IBV: + return new IbvAllowedSourceResponse(); + case Constants::RELYING_BUSINESS: + return new RelyingBusinessAllowedSourceResponse(); + default: + return new UnknownAllowedSourceResponse(); + } + } } diff --git a/tests/DocScan/Session/Retrieve/FaceCaptureResourceResponseTest.php b/tests/DocScan/Session/Retrieve/FaceCaptureResourceResponseTest.php new file mode 100644 index 00000000..952c8581 --- /dev/null +++ b/tests/DocScan/Session/Retrieve/FaceCaptureResourceResponseTest.php @@ -0,0 +1,54 @@ + [], + 'source' => [ + 'type' => self::RELYING_BUSINESS + ], + 'image' => [ + 'media' => [ + 'id' => self::SOME_ID, + 'type' => 'IMAGE', + 'created' => '2021-06-11T11:39:24Z', + 'last_updated' => '2021-06-11T11:39:24Z', + ] + ], + + ]; + + $result = new FaceCaptureResourceResponse($input); + + $this->assertEquals(self::RELYING_BUSINESS, $result->getSource()->getType()); + $this->assertInstanceOf(AllowedSourceResponse::class, $result->getSource()); + + $this->assertEquals(self::SOME_ID, $result->getImage()->getMedia()->getId()); + $this->assertInstanceOf(FaceCaptureImageResponse::class, $result->getImage()); + } +} diff --git a/tests/DocScan/Session/Retrieve/ResourceResponseTest.php b/tests/DocScan/Session/Retrieve/ResourceResponseTest.php index 709d24fa..9e7b270f 100644 --- a/tests/DocScan/Session/Retrieve/ResourceResponseTest.php +++ b/tests/DocScan/Session/Retrieve/ResourceResponseTest.php @@ -4,6 +4,7 @@ namespace Yoti\Test\DocScan\Session\Retrieve; +use Yoti\DocScan\Session\Retrieve\Configuration\Capture\Source\AllowedSourceResponse; use Yoti\DocScan\Session\Retrieve\ResourceResponse; use Yoti\DocScan\Session\Retrieve\TaskResponse; use Yoti\DocScan\Session\Retrieve\TextExtractionTaskResponse; @@ -18,6 +19,7 @@ class ResourceResponseTest extends TestCase private const SUPPLEMENTARY_DOCUMENT_TEXT_DATA_EXTRACTION = 'SUPPLEMENTARY_DOCUMENT_TEXT_DATA_EXTRACTION'; private const SOME_UNKNOWN_TASK = 'someUnknownTask'; private const SOME_ID = 'someId'; + private const RELYING_BUSINESS = 'RELYING_BUSINESS'; /** * @test @@ -113,4 +115,22 @@ public function shouldNotThrowExceptionWhenMissingValues() $this->assertNull($result->getId()); $this->assertCount(0, $result->getTasks()); } + + /** + * @test + * @covers ::__construct + * @covers ::createSourceFromType + */ + public function shouldCreateSourceCorrectly() + { + $input = [ + 'source' => [ + 'type' => self::RELYING_BUSINESS + ] + ]; + + $result = new ResourceResponse($input); + + $this->assertInstanceOf(AllowedSourceResponse::class, $result->getSource()); + } } From 0edcd2a6e8cbc528d92ec789858e06088dc0fb48 Mon Sep 17 00:00:00 2001 From: Rodion Liuborets Date: Fri, 28 Oct 2022 13:31:15 +0300 Subject: [PATCH 04/45] Update github actions php8.0 -> 8.1 --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 26513bcd..149a151e 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: [ 8.0 ] + php-version: [ 8.1 ] steps: - uses: actions/checkout@v2 From 70e526b52f45f25c2cf9a6f3b57a30d4043544ae Mon Sep 17 00:00:00 2001 From: Rodion Liuborets Date: Fri, 28 Oct 2022 13:46:14 +0300 Subject: [PATCH 05/45] Update github actions for sonar check php8.0 -> 8.1 --- .github/workflows/sonar.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index f96c4e18..88be05a1 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -19,7 +19,7 @@ jobs: fetch-depth: 0 - uses: shivammathur/setup-php@2.9.0 with: - php-version: 8.0 + php-version: 8.1 - run: composer install - run: composer coverage-clover From 69bf24258c8203aecd14a939f54e480cea9c8ede Mon Sep 17 00:00:00 2001 From: Rodion Liuborets Date: Fri, 28 Oct 2022 15:25:11 +0300 Subject: [PATCH 06/45] Remove support of php7.1 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7629e4a8..b8f14da1 100755 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "homepage": "https://yoti.com", "license": "MIT", "require": { - "php": "^7.1 || ^8.1", + "php": "^8.1", "ext-json": "*", "google/protobuf": "^3.10", "phpseclib/phpseclib": "^3.0", From e1ca60840c0debbebe38769d554c2aef713bde18 Mon Sep 17 00:00:00 2001 From: Rodion Liuborets Date: Fri, 28 Oct 2022 15:27:32 +0300 Subject: [PATCH 07/45] Modify sonar config for php8.1 --- .github/workflows/tests.yaml | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 149a151e..aee42b54 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -31,32 +31,6 @@ jobs: - run: composer test - php7: - name: Unit Tests (php ${{ matrix.php-version }}) - runs-on: ubuntu-latest - # always run on push events - # only run on pull_request_target event when pull request pulls from fork repository - if: > - github.event_name == 'push' || - github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository - strategy: - fail-fast: false - matrix: - php-version: [ 7.4 ] - - steps: - - uses: actions/checkout@v2 - - - uses: shivammathur/setup-php@2.9.0 - with: - php-version: ${{ matrix.php-version }} - - - run: composer self-update - - - run: composer install --no-interaction --prefer-source --dev - - - run: composer test - protobuf: name: Unit Tests With Protobuf C Extension 3.13 (php ${{ matrix.php-version }}) runs-on: ubuntu-latest @@ -68,7 +42,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: [ 7.4 ] + php-version: [ 8.1 ] steps: - uses: actions/checkout@v2 From 4908a0a397004ce581efd9af5064cc367e600ae5 Mon Sep 17 00:00:00 2001 From: Rodion Liuborets Date: Fri, 28 Oct 2022 17:40:09 +0300 Subject: [PATCH 08/45] Add php7.4, php8.0 support --- .github/workflows/tests.yaml | 54 +++++++++++++++++++++++++++++++++++- composer.json | 2 +- 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index aee42b54..584c592f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -3,7 +3,7 @@ on: [ push, pull_request_target ] jobs: php8compat: - name: Unit Tests PHP8 Compatibility (php ${{ matrix.php-version }}) + name: Unit Tests php8.1 (php ${{ matrix.php-version }}) runs-on: ubuntu-latest # always run on push events # only run on pull_request_target event when pull request pulls from fork repository @@ -31,6 +31,58 @@ jobs: - run: composer test + php7: + name: Unit Tests php7.4 (php ${{ matrix.php-version }}) + runs-on: ubuntu-latest + # always run on push events + # only run on pull_request_target event when pull request pulls from fork repository + if: > + github.event_name == 'push' || + github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository + strategy: + fail-fast: false + matrix: + php-version: [ 7.4 ] + + steps: + - uses: actions/checkout@v2 + + - uses: shivammathur/setup-php@2.9.0 + with: + php-version: ${{ matrix.php-version }} + + - run: composer self-update + + - run: composer install --no-interaction --prefer-source --dev + + - run: composer test + + php8.0: + name: Unit Tests php8.0 (php ${{ matrix.php-version }}) + runs-on: ubuntu-latest + # always run on push events + # only run on pull_request_target event when pull request pulls from fork repository + if: > + github.event_name == 'push' || + github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository + strategy: + fail-fast: false + matrix: + php-version: [ 8.0 ] + + steps: + - uses: actions/checkout@v2 + + - uses: shivammathur/setup-php@2.9.0 + with: + php-version: ${{ matrix.php-version }} + + - run: composer self-update + + - run: composer install --no-interaction --prefer-source --dev + + - run: composer test + protobuf: name: Unit Tests With Protobuf C Extension 3.13 (php ${{ matrix.php-version }}) runs-on: ubuntu-latest diff --git a/composer.json b/composer.json index b8f14da1..ff6ed4c0 100755 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "homepage": "https://yoti.com", "license": "MIT", "require": { - "php": "^8.1", + "php": "^7.4 || ^8.0 || ^8.1", "ext-json": "*", "google/protobuf": "^3.10", "phpseclib/phpseclib": "^3.0", From 4b1cea924a823cf13e49576ba7e872cc15f59038 Mon Sep 17 00:00:00 2001 From: Rodion Liuborets Date: Fri, 28 Oct 2022 17:45:30 +0300 Subject: [PATCH 09/45] Add php7.4, php8.0 support --- .github/workflows/tests.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 584c592f..8ef9f42d 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -2,7 +2,7 @@ name: Unit Tests on: [ push, pull_request_target ] jobs: - php8compat: + php8-1: name: Unit Tests php8.1 (php ${{ matrix.php-version }}) runs-on: ubuntu-latest # always run on push events @@ -31,7 +31,7 @@ jobs: - run: composer test - php7: + php7-4: name: Unit Tests php7.4 (php ${{ matrix.php-version }}) runs-on: ubuntu-latest # always run on push events @@ -57,7 +57,7 @@ jobs: - run: composer test - php8.0: + php8-0: name: Unit Tests php8.0 (php ${{ matrix.php-version }}) runs-on: ubuntu-latest # always run on push events From 122523b67edecd508699ae47300bdfd012a76791 Mon Sep 17 00:00:00 2001 From: Rodion Liuborets Date: Tue, 1 Nov 2022 16:47:09 +0200 Subject: [PATCH 10/45] Update README.md (#306) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 467588ac..57594652 100755 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Please feel free to reach out ## Requirements -* PHP ^7.1 +* PHP ^7.4 || ^8.0 || ^8.1 * CURL PHP extension (must support TLSv1.2) ### Recommended (optional) @@ -42,13 +42,13 @@ Add the Yoti SDK dependency: ```json "require": { - "yoti/yoti-php-sdk" : "^3.0" + "yoti/yoti-php-sdk" : "^4.1" } ``` Or run this Composer command ```console -$ composer require yoti/yoti-php-sdk "^3.0" +$ composer require yoti/yoti-php-sdk "^4.1" ``` ## Setup From 5a1ebf6291e5a00d8ea78038589b2cab451a80d0 Mon Sep 17 00:00:00 2001 From: Rodion Liuborets Date: Tue, 10 Jan 2023 22:40:15 +0200 Subject: [PATCH 11/45] Updated dependencies --- composer.json | 6 +++--- src/Util/Logger.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index ff6ed4c0..8b6b7c7c 100755 --- a/composer.json +++ b/composer.json @@ -29,10 +29,10 @@ "squizlabs/php_codesniffer": "^3.4", "friendsofphp/php-cs-fixer": "^3.4", "brainmaestro/composer-git-hooks": "^2.8", - "phpstan/phpstan-strict-rules": "^0.12.1", + "phpstan/phpstan-strict-rules": "^1.4.4", "phpstan/extension-installer": "^1.0", - "psr/log": "^1.1", - "symfony/phpunit-bridge": "^5.1" + "psr/log": "^3.0", + "symfony/phpunit-bridge": "^6.2" }, "autoload-dev": { "psr-4": { diff --git a/src/Util/Logger.php b/src/Util/Logger.php index 4a69fc01..c9fdc7e8 100644 --- a/src/Util/Logger.php +++ b/src/Util/Logger.php @@ -27,7 +27,7 @@ class Logger extends AbstractLogger /** * @inheritDoc */ - public function log($level, $message, array $context = []) + public function log($level, $message, array $context = []): void { if (!in_array($level, self::LEVELS, true)) { throw new InvalidArgumentException(sprintf('"%s" level is not allowed', $level)); From 2924306e6239f0aad016bf1411e56df30055245e Mon Sep 17 00:00:00 2001 From: Rodion Liuborets Date: Tue, 10 Jan 2023 22:54:21 +0200 Subject: [PATCH 12/45] Fixed psr/log for php7.4 --- composer.json | 4 ++-- src/DocScan/Session/Create/SdkConfigBuilder.php | 2 +- .../Session/Retrieve/IdentityProfilePreviewResponse.php | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 8b6b7c7c..02f7d812 100755 --- a/composer.json +++ b/composer.json @@ -29,9 +29,9 @@ "squizlabs/php_codesniffer": "^3.4", "friendsofphp/php-cs-fixer": "^3.4", "brainmaestro/composer-git-hooks": "^2.8", - "phpstan/phpstan-strict-rules": "^1.4.4", + "phpstan/phpstan-strict-rules": "^0.12.1", "phpstan/extension-installer": "^1.0", - "psr/log": "^3.0", + "psr/log": "^1.1", "symfony/phpunit-bridge": "^6.2" }, "autoload-dev": { diff --git a/src/DocScan/Session/Create/SdkConfigBuilder.php b/src/DocScan/Session/Create/SdkConfigBuilder.php index 01bd1d1b..c91adc05 100644 --- a/src/DocScan/Session/Create/SdkConfigBuilder.php +++ b/src/DocScan/Session/Create/SdkConfigBuilder.php @@ -172,7 +172,7 @@ public function withIdDocumentTextExtractionReclassificationRetries(int $reclass /** * @deprecated from 4.2.0, @see withIdDocumentTextExtractionGenericAttempts */ - public function withIdDocumentTextExtractionGenericRetries(int $genericRetries) + public function withIdDocumentTextExtractionGenericRetries(int $genericRetries): void { } diff --git a/src/DocScan/Session/Retrieve/IdentityProfilePreviewResponse.php b/src/DocScan/Session/Retrieve/IdentityProfilePreviewResponse.php index 7ee8c7fa..6a3958eb 100644 --- a/src/DocScan/Session/Retrieve/IdentityProfilePreviewResponse.php +++ b/src/DocScan/Session/Retrieve/IdentityProfilePreviewResponse.php @@ -6,6 +6,10 @@ class IdentityProfilePreviewResponse { private ?MediaResponse $media = null; + /** + * @param array $sessionData + * @throws \Yoti\Exception\DateTimeException + */ public function __construct(array $sessionData) { if (isset($sessionData['media'])) { From 167bff048476218e1191ca8ea2e292424cc8be34 Mon Sep 17 00:00:00 2001 From: Rodion Liuborets Date: Fri, 27 Jan 2023 10:25:04 +0200 Subject: [PATCH 13/45] Improve identity report view --- .../resources/views/partial/report.blade.php | 41 +++++++++++++++---- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/examples/profile/resources/views/partial/report.blade.php b/examples/profile/resources/views/partial/report.blade.php index 26d8f3bb..28bdd3f0 100644 --- a/examples/profile/resources/views/partial/report.blade.php +++ b/examples/profile/resources/views/partial/report.blade.php @@ -1,12 +1,39 @@ - - @foreach ($report as $key => $value) +@foreach ($report as $key => $value) +
+ - + + + @foreach ($value as $name => $result) + @if (is_array($result)) + @foreach ($result as $data => $view) + @if (is_array($view)) + @foreach ($view as $key2 => $value2) + @if (is_array($value2)) + {{json_encode($value2)}} + @else + + + + @endif + @endforeach + @else + + + + @endif + @endforeach + @else + + + + @endif + @endforeach + + +
{{ $key }} -
-                    {{ $value }}
-                
+

{{ $key }}

{{ $key2 }}
{{ $value2 }}
{{ $data }}
{{ $view }}
{{ $name }}
{{ $result }}
@endforeach - \ No newline at end of file From 102de431c4853495e0176d253cbe263e1ab4e53d Mon Sep 17 00:00:00 2001 From: Rodion Liuborets Date: Fri, 3 Feb 2023 22:33:27 +0200 Subject: [PATCH 14/45] Fix version to 4.2.0 (#314) --- composer.json | 2 +- src/Constants.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 02f7d812..602c2179 100755 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "yoti/yoti-php-sdk", "description": "Yoti SDK for quickly integrating your PHP backend with Yoti", - "version": "4.1.0", + "version": "4.2.0", "keywords": [ "yoti", "sdk" diff --git a/src/Constants.php b/src/Constants.php index 6933f0d9..f784e2ec 100644 --- a/src/Constants.php +++ b/src/Constants.php @@ -25,7 +25,7 @@ class Constants public const SDK_IDENTIFIER = 'PHP'; /** Default SDK version */ - public const SDK_VERSION = '4.1.0'; + public const SDK_VERSION = '4.2.0'; /** Base url for connect page (user will be redirected to this page eg. baseurl/app-id) */ public const CONNECT_BASE_URL = 'https://www.yoti.com/connect'; From d0e0ea342d110f0fccf61a47724f9b08fb399bc4 Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Thu, 29 Jun 2023 14:19:10 +0100 Subject: [PATCH 15/45] SDK-2335:Added expanded document fields media feature --- .../resources/views/success.blade.php | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/examples/doc-scan/resources/views/success.blade.php b/examples/doc-scan/resources/views/success.blade.php index c2944a0d..0e49c218 100644 --- a/examples/doc-scan/resources/views/success.blade.php +++ b/examples/doc-scan/resources/views/success.blade.php @@ -346,6 +346,41 @@ class="badge badge-primary">{{ $document->getIssuingCountry() }} @endif + @if ($document->getExpandedDocumentFields()) +
+
+

+ +

+
+
+
+ @if ($document->getExpandedDocumentFields()->getMedia()) +
Media
+ + + + + + + +
ID + + {{ $document->getExpandedDocumentFields()->getMedia()->getId() }} + +
+ @endif +
+
+
+ @endif + @if ($document->getDocumentIdPhoto())
From 6510b92ba8b97e07125cdf4dc9f42a4602bfd1c6 Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Fri, 30 Jun 2023 10:35:12 +0100 Subject: [PATCH 16/45] SDK-2236: added enabling expanded document fields feature --- .../app/Http/Controllers/HomeController.php | 2 ++ .../RequestedTextExtractionTaskBuilder.php | 20 +++++++++++- .../RequestedTextExtractionTaskConfig.php | 18 ++++++++++- .../ExpandedDocumentFieldsResponse.php | 32 +++++++++++++++++++ .../Retrieve/IdDocumentResourceResponse.php | 17 ++++++++++ 5 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 src/DocScan/Session/Retrieve/ExpandedDocumentFieldsResponse.php diff --git a/examples/doc-scan/app/Http/Controllers/HomeController.php b/examples/doc-scan/app/Http/Controllers/HomeController.php index 5aae0ea8..6f75236a 100644 --- a/examples/doc-scan/app/Http/Controllers/HomeController.php +++ b/examples/doc-scan/app/Http/Controllers/HomeController.php @@ -118,6 +118,7 @@ public function show(Request $request, DocScanClient $client) (new RequestedTextExtractionTaskBuilder()) ->withManualCheckAlways() ->withChipDataDesired() + ->withCreateExpandedDocumentFields(true) ->build() ) ->withRequestedTask( @@ -160,6 +161,7 @@ public function show(Request $request, DocScanClient $client) ) ->build(); + $session = $client->createSession($sessionSpec); $request->session()->put('YOTI_SESSION_ID', $session->getSessionId()); diff --git a/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskBuilder.php b/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskBuilder.php index 5b29fca1..174828f9 100644 --- a/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskBuilder.php +++ b/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskBuilder.php @@ -58,6 +58,23 @@ public function withManualCheck(string $manualCheck): self return $this->setManualCheck($manualCheck); } + /** + * @var bool + */ + private $createExpandedDocumentFields; + + /** + * + * @param string $createExpandedDocumentFields + * + * @return $this + */ + public function withCreateExpandedDocumentFields(bool $createExpandedDocumentFields): self + { + $this->createExpandedDocumentFields = $createExpandedDocumentFields; + return $this; + } + /** * @return RequestedTextExtractionTask */ @@ -65,7 +82,8 @@ public function build(): RequestedTextExtractionTask { Validation::notEmptyString($this->manualCheck, 'manualCheck'); - $config = new RequestedTextExtractionTaskConfig($this->manualCheck, $this->chipData); + $config = new RequestedTextExtractionTaskConfig($this->manualCheck, $this->chipData, + $this->createExpandedDocumentFields); return new RequestedTextExtractionTask($config); } } diff --git a/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfig.php b/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfig.php index 9a9fb083..7e5716d1 100644 --- a/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfig.php +++ b/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfig.php @@ -19,14 +19,21 @@ class RequestedTextExtractionTaskConfig implements RequestedTaskConfigInterface */ private $chipData; + /** + * @var bool|null + */ + private $createExpandedDocumentFields; + /** * @param string $manualCheck * @param string|null $chipData + * @param bool|null $createExpandedDocumentFields */ - public function __construct(string $manualCheck, ?string $chipData = null) + public function __construct(string $manualCheck, ?string $chipData = null, ?bool $createExpandedDocumentFields = false) { $this->manualCheck = $manualCheck; $this->chipData = $chipData; + $this->createExpandedDocumentFields = $createExpandedDocumentFields; } /** @@ -37,6 +44,7 @@ public function jsonSerialize(): stdClass return (object)Json::withoutNullValues([ 'manual_check' => $this->getManualCheck(), 'chip_data' => $this->getChipData(), + 'create_expanded_document_fields' => $this->getCreateExpandedDocumentFields(), ]); } @@ -55,4 +63,12 @@ public function getChipData(): ?string { return $this->chipData; } + + /** + * @return bool + */ + public function getCreateExpandedDocumentFields(): ?bool + { + return $this->createExpandedDocumentFields; + } } diff --git a/src/DocScan/Session/Retrieve/ExpandedDocumentFieldsResponse.php b/src/DocScan/Session/Retrieve/ExpandedDocumentFieldsResponse.php new file mode 100644 index 00000000..acf17f74 --- /dev/null +++ b/src/DocScan/Session/Retrieve/ExpandedDocumentFieldsResponse.php @@ -0,0 +1,32 @@ + $documentFields + */ + public function __construct(array $documentFields) + { + $this->media = isset($documentFields['media']) + ? new MediaResponse($documentFields['media']) + : null; + } + + /** + * @return MediaResponse|null + */ + public function getMedia(): ?MediaResponse + { + return $this->media; + } +} diff --git a/src/DocScan/Session/Retrieve/IdDocumentResourceResponse.php b/src/DocScan/Session/Retrieve/IdDocumentResourceResponse.php index b6e7f46a..6d9dc824 100644 --- a/src/DocScan/Session/Retrieve/IdDocumentResourceResponse.php +++ b/src/DocScan/Session/Retrieve/IdDocumentResourceResponse.php @@ -24,6 +24,11 @@ class IdDocumentResourceResponse extends ResourceResponse */ private $documentFields; + /** + * @var ExpandedDocumentFieldsResponse|null + */ + private $expandedDocumentFields; + /** * @var DocumentIdPhotoResponse|null */ @@ -49,6 +54,10 @@ public function __construct(array $idDocument) $this->documentFields = isset($idDocument['document_fields']) ? new DocumentFieldsResponse($idDocument['document_fields']) : null; + + $this->expandedDocumentFields = isset($idDocument['expanded_document_fields']) + ? new ExpandedDocumentFieldsResponse($idDocument['expanded_document_fields']) + : null; $this->documentIdPhoto = isset($idDocument['document_id_photo']) ? new DocumentIdPhotoResponse($idDocument['document_id_photo']) @@ -87,6 +96,14 @@ public function getDocumentFields(): ?DocumentFieldsResponse return $this->documentFields; } + /** + * @return ExpandedDocumentFieldsResponse|null + */ + public function getExpandedDocumentFields(): ?ExpandedDocumentFieldsResponse + { + return $this->expandedDocumentFields; + } + /** * @return DocumentIdPhotoResponse|null */ From 51c1dc79a3f0f68f72154eabef39636ed54ca646 Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Fri, 7 Jul 2023 07:53:50 +0100 Subject: [PATCH 17/45] SDK-2336:Update tests --- .../RequestedSupplementaryDocTextExtractionTaskConfigTest.php | 2 ++ .../Create/Task/RequestedTextExtractionTaskConfigTest.php | 3 +++ 2 files changed, 5 insertions(+) diff --git a/tests/DocScan/Session/Create/Task/RequestedSupplementaryDocTextExtractionTaskConfigTest.php b/tests/DocScan/Session/Create/Task/RequestedSupplementaryDocTextExtractionTaskConfigTest.php index 4d0b0f76..94cc80ba 100644 --- a/tests/DocScan/Session/Create/Task/RequestedSupplementaryDocTextExtractionTaskConfigTest.php +++ b/tests/DocScan/Session/Create/Task/RequestedSupplementaryDocTextExtractionTaskConfigTest.php @@ -11,6 +11,7 @@ class RequestedSupplementaryDocTextExtractionTaskConfigTest extends TestCase { private const SOME_MANUAL_CHECK = 'someManualCheck'; + private const SOME_EXPANDED_DOCUMENT_FIELDS = 'false'; /** * @test @@ -24,6 +25,7 @@ public function shouldSerializeToJsonCorrectlyWithRequiredProperties() $expected = [ 'manual_check' => self::SOME_MANUAL_CHECK, + 'create_expanded_document_fields' => self::SOME_EXPANDED_DOCUMENT_FIELDS ]; $this->assertJsonStringEqualsJsonString(json_encode($expected), json_encode($result)); diff --git a/tests/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfigTest.php b/tests/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfigTest.php index 630b5652..2aefd55c 100644 --- a/tests/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfigTest.php +++ b/tests/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfigTest.php @@ -12,6 +12,8 @@ class RequestedTextExtractionTaskConfigTest extends TestCase { private const SOME_MANUAL_CHECK = 'someManualCheck'; private const SOME_CHIP_DATA = 'someChipData'; + private const SOME_EXPANDED_DOCUMENT_FIELDS = 'false'; + /** * @test @@ -44,6 +46,7 @@ public function shouldSerializeToJsonCorrectlyWithAllProperties() $expected = [ 'manual_check' => self::SOME_MANUAL_CHECK, 'chip_data' => self::SOME_CHIP_DATA, + 'create_expanded_document_fields' => self::SOME_EXPANDED_DOCUMENT_FIELDS ]; $this->assertJsonStringEqualsJsonString(json_encode($expected), json_encode($result)); From 5f15bca43bf76e11a9f2d83712519d9dc73e29ad Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Fri, 7 Jul 2023 07:56:25 +0100 Subject: [PATCH 18/45] SDK-2336:Update tests --- ...RequestedSupplementaryDocTextExtractionTaskConfigTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/DocScan/Session/Create/Task/RequestedSupplementaryDocTextExtractionTaskConfigTest.php b/tests/DocScan/Session/Create/Task/RequestedSupplementaryDocTextExtractionTaskConfigTest.php index 94cc80ba..7023785e 100644 --- a/tests/DocScan/Session/Create/Task/RequestedSupplementaryDocTextExtractionTaskConfigTest.php +++ b/tests/DocScan/Session/Create/Task/RequestedSupplementaryDocTextExtractionTaskConfigTest.php @@ -24,8 +24,9 @@ public function shouldSerializeToJsonCorrectlyWithRequiredProperties() $result = new RequestedSupplementaryDocTextExtractionTaskConfig(self::SOME_MANUAL_CHECK); $expected = [ - 'manual_check' => self::SOME_MANUAL_CHECK, - 'create_expanded_document_fields' => self::SOME_EXPANDED_DOCUMENT_FIELDS + 'create_expanded_document_fields' => self::SOME_EXPANDED_DOCUMENT_FIELDS, + 'manual_check' => self::SOME_MANUAL_CHECK + ]; $this->assertJsonStringEqualsJsonString(json_encode($expected), json_encode($result)); From cc63af3952af1d1c6daf2d5e21bec5b272048729 Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Fri, 7 Jul 2023 08:01:08 +0100 Subject: [PATCH 19/45] SDK-2336:Update tests --- .../Create/Task/RequestedTextExtractionTaskConfigTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfigTest.php b/tests/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfigTest.php index 2aefd55c..e9920f82 100644 --- a/tests/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfigTest.php +++ b/tests/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfigTest.php @@ -26,6 +26,7 @@ public function shouldSerializeToJsonCorrectlyWithRequiredProperties() $result = new RequestedTextExtractionTaskConfig(self::SOME_MANUAL_CHECK); $expected = [ + 'create_expanded_document_fields' => self::SOME_EXPANDED_DOCUMENT_FIELDS, 'manual_check' => self::SOME_MANUAL_CHECK, ]; @@ -45,8 +46,8 @@ public function shouldSerializeToJsonCorrectlyWithAllProperties() $expected = [ 'manual_check' => self::SOME_MANUAL_CHECK, - 'chip_data' => self::SOME_CHIP_DATA, - 'create_expanded_document_fields' => self::SOME_EXPANDED_DOCUMENT_FIELDS + 'create_expanded_document_fields' => self::SOME_EXPANDED_DOCUMENT_FIELDS, + 'chip_data' => self::SOME_CHIP_DATA ]; $this->assertJsonStringEqualsJsonString(json_encode($expected), json_encode($result)); From baed4cf41a46dd53c82937302183674f689d1e43 Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Fri, 7 Jul 2023 08:03:37 +0100 Subject: [PATCH 20/45] SDK-2336:Update tests --- .../RequestedSupplementaryDocTextExtractionTaskConfigTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/DocScan/Session/Create/Task/RequestedSupplementaryDocTextExtractionTaskConfigTest.php b/tests/DocScan/Session/Create/Task/RequestedSupplementaryDocTextExtractionTaskConfigTest.php index 7023785e..e7a771e4 100644 --- a/tests/DocScan/Session/Create/Task/RequestedSupplementaryDocTextExtractionTaskConfigTest.php +++ b/tests/DocScan/Session/Create/Task/RequestedSupplementaryDocTextExtractionTaskConfigTest.php @@ -26,7 +26,6 @@ public function shouldSerializeToJsonCorrectlyWithRequiredProperties() $expected = [ 'create_expanded_document_fields' => self::SOME_EXPANDED_DOCUMENT_FIELDS, 'manual_check' => self::SOME_MANUAL_CHECK - ]; $this->assertJsonStringEqualsJsonString(json_encode($expected), json_encode($result)); From e3b2c50f582de76f1aede32bd9676d0bfd679e54 Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Fri, 7 Jul 2023 08:08:39 +0100 Subject: [PATCH 21/45] SDK-2336:Update tests --- ...equestedSupplementaryDocTextExtractionTaskConfigTest.php | 1 - .../Create/Task/RequestedTextExtractionTaskConfigTest.php | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/DocScan/Session/Create/Task/RequestedSupplementaryDocTextExtractionTaskConfigTest.php b/tests/DocScan/Session/Create/Task/RequestedSupplementaryDocTextExtractionTaskConfigTest.php index e7a771e4..e7de54b4 100644 --- a/tests/DocScan/Session/Create/Task/RequestedSupplementaryDocTextExtractionTaskConfigTest.php +++ b/tests/DocScan/Session/Create/Task/RequestedSupplementaryDocTextExtractionTaskConfigTest.php @@ -24,7 +24,6 @@ public function shouldSerializeToJsonCorrectlyWithRequiredProperties() $result = new RequestedSupplementaryDocTextExtractionTaskConfig(self::SOME_MANUAL_CHECK); $expected = [ - 'create_expanded_document_fields' => self::SOME_EXPANDED_DOCUMENT_FIELDS, 'manual_check' => self::SOME_MANUAL_CHECK ]; diff --git a/tests/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfigTest.php b/tests/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfigTest.php index e9920f82..825a3a35 100644 --- a/tests/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfigTest.php +++ b/tests/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfigTest.php @@ -26,8 +26,8 @@ public function shouldSerializeToJsonCorrectlyWithRequiredProperties() $result = new RequestedTextExtractionTaskConfig(self::SOME_MANUAL_CHECK); $expected = [ - 'create_expanded_document_fields' => self::SOME_EXPANDED_DOCUMENT_FIELDS, 'manual_check' => self::SOME_MANUAL_CHECK, + 'create_expanded_document_fields' => self::SOME_EXPANDED_DOCUMENT_FIELDS ]; $this->assertJsonStringEqualsJsonString(json_encode($expected), json_encode($result)); @@ -46,8 +46,8 @@ public function shouldSerializeToJsonCorrectlyWithAllProperties() $expected = [ 'manual_check' => self::SOME_MANUAL_CHECK, - 'create_expanded_document_fields' => self::SOME_EXPANDED_DOCUMENT_FIELDS, - 'chip_data' => self::SOME_CHIP_DATA + 'chip_data' => self::SOME_CHIP_DATA, + 'create_expanded_document_fields' => self::SOME_EXPANDED_DOCUMENT_FIELDS ]; $this->assertJsonStringEqualsJsonString(json_encode($expected), json_encode($result)); From 23980e3f258b6787e0aeea03eaadd861acb6f50d Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Fri, 7 Jul 2023 08:10:48 +0100 Subject: [PATCH 22/45] SDK-2336:Update tests --- .../Create/Task/RequestedTextExtractionTaskConfigTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfigTest.php b/tests/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfigTest.php index 825a3a35..1ee04962 100644 --- a/tests/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfigTest.php +++ b/tests/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfigTest.php @@ -12,7 +12,7 @@ class RequestedTextExtractionTaskConfigTest extends TestCase { private const SOME_MANUAL_CHECK = 'someManualCheck'; private const SOME_CHIP_DATA = 'someChipData'; - private const SOME_EXPANDED_DOCUMENT_FIELDS = 'false'; + private const SOME_EXPANDED_DOCUMENT_FIELDS = false; /** From 43f91e792f5c425e0df56bfc44227c592002e6c4 Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Fri, 7 Jul 2023 08:33:35 +0100 Subject: [PATCH 23/45] SDK-2311:Added set setting for biometric consent screen --- src/DocScan/Session/Create/SdkConfig.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/DocScan/Session/Create/SdkConfig.php b/src/DocScan/Session/Create/SdkConfig.php index 453ad44a..07bfd854 100644 --- a/src/DocScan/Session/Create/SdkConfig.php +++ b/src/DocScan/Session/Create/SdkConfig.php @@ -63,6 +63,11 @@ class SdkConfig implements \JsonSerializable */ private $attemptsConfiguration; + /** + * @var string|null + */ + private $biometricConsentFlow; + /** * @param string|null $allowedCaptureMethods * @param string|null $primaryColour @@ -75,6 +80,7 @@ class SdkConfig implements \JsonSerializable * @param string|null $privacyPolicyUrl * @param bool|null $allowHandoff * @param array|null $idDocumentTextDataExtractionRetriesConfig + * @param string|null $biometricConsentFlow */ public function __construct( ?string $allowedCaptureMethods, @@ -87,7 +93,9 @@ public function __construct( ?string $errorUrl, ?string $privacyPolicyUrl = null, ?bool $allowHandoff = null, - ?array $idDocumentTextDataExtractionRetriesConfig = null + ?array $idDocumentTextDataExtractionRetriesConfig = null, + ?string $biometricConsentFlow = null + ) { $this->allowedCaptureMethods = $allowedCaptureMethods; $this->primaryColour = $primaryColour; @@ -102,6 +110,8 @@ public function __construct( if (!is_null($idDocumentTextDataExtractionRetriesConfig)) { $this->attemptsConfiguration = new AttemptsConfiguration($idDocumentTextDataExtractionRetriesConfig); } + $this->biometricConsentFlow = $biometricConsentFlow; + } /** @@ -121,6 +131,7 @@ public function jsonSerialize(): \stdClass 'privacy_policy_url' => $this->getPrivacyPolicyUrl(), 'allow_handoff' => $this->getAllowHandoff(), 'attempts_configuration' => $this->getAttemptsConfiguration(), + 'biometric_consent_flow' => $this->getBiometricConsentFlow() ]); } @@ -211,4 +222,12 @@ public function getAttemptsConfiguration(): ?AttemptsConfiguration { return $this->attemptsConfiguration; } + + /** + * @return string|null + */ + public function getBiometricConsentFlow(): ?string + { + return $this->privacyPolicyUrl; + } } From 397c10ef78e7245fd55fb4ec1bbf6740c345b90f Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Fri, 7 Jul 2023 08:49:11 +0100 Subject: [PATCH 24/45] SDK-2311:Added set setting for biometric consent screen --- src/DocScan/Session/Create/SdkConfig.php | 2 +- tests/DocScan/Session/Create/SdkConfigBuilderTest.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/DocScan/Session/Create/SdkConfig.php b/src/DocScan/Session/Create/SdkConfig.php index 07bfd854..51b85112 100644 --- a/src/DocScan/Session/Create/SdkConfig.php +++ b/src/DocScan/Session/Create/SdkConfig.php @@ -228,6 +228,6 @@ public function getAttemptsConfiguration(): ?AttemptsConfiguration */ public function getBiometricConsentFlow(): ?string { - return $this->privacyPolicyUrl; + return $this->biometricConsentFlow; } } diff --git a/tests/DocScan/Session/Create/SdkConfigBuilderTest.php b/tests/DocScan/Session/Create/SdkConfigBuilderTest.php index 5377c5b9..3c84f5d2 100644 --- a/tests/DocScan/Session/Create/SdkConfigBuilderTest.php +++ b/tests/DocScan/Session/Create/SdkConfigBuilderTest.php @@ -22,6 +22,8 @@ class SdkConfigBuilderTest extends TestCase private const SOME_PRIVACY_POLICY_URL = 'somePrivacyPolicyUrl'; private const SOME_CATEGORY = 'someCategory'; private const SOME_NUMBER_RETRIES = 5; + private const SOME_BIOMETRIC_CONSENT_FLOW = 'someBiometricConsentFlow'; + /** * @test @@ -118,6 +120,7 @@ public function shouldProduceTheCorrectJsonString() ->withErrorUrl(self::SOME_ERROR_URL) ->withPrivacyPolicyUrl(self::SOME_PRIVACY_POLICY_URL) ->withAllowHandoff(true) + ->withBiometricConsentFlow(self::SOME_BIOMETRIC_CONSENT_FLOW) ->build(); $expected = [ @@ -131,6 +134,7 @@ public function shouldProduceTheCorrectJsonString() 'error_url' => self::SOME_ERROR_URL, 'privacy_policy_url' => self::SOME_PRIVACY_POLICY_URL, 'allow_handoff' => true, + 'biometric_consent_flow' => self::SOME_BIOMETRIC_CONSENT_FLOW ]; $this->assertJsonStringEqualsJsonString(json_encode($expected), json_encode($result)); From 7a5fb99b5be82bd18d33774ba6d73f96be526f22 Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Fri, 7 Jul 2023 09:32:31 +0100 Subject: [PATCH 25/45] SDK-2311:Added set setting for biometric consent screen --- examples/doc-scan/app/Http/Controllers/HomeController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/doc-scan/app/Http/Controllers/HomeController.php b/examples/doc-scan/app/Http/Controllers/HomeController.php index 5aae0ea8..bb50054b 100644 --- a/examples/doc-scan/app/Http/Controllers/HomeController.php +++ b/examples/doc-scan/app/Http/Controllers/HomeController.php @@ -136,6 +136,7 @@ public function show(Request $request, DocScanClient $client) ->withSuccessUrl(config('app.url') . '/success') ->withErrorUrl(config('app.url') . '/error') ->withPrivacyPolicyUrl(config('app.url') . '/privacy-policy') + ->withBiometricConsentFlow('EARLY') ->build() ) ->withRequiredDocument( From 7c46be2b293d0bc4f790dbd7ca1c72e94a71e7fa Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Fri, 7 Jul 2023 10:40:07 +0100 Subject: [PATCH 26/45] SDK-2311:Added set setting for biometric consent screen --- src/DocScan/Session/Create/SdkConfigBuilder.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/DocScan/Session/Create/SdkConfigBuilder.php b/src/DocScan/Session/Create/SdkConfigBuilder.php index c91adc05..acf30fcc 100644 --- a/src/DocScan/Session/Create/SdkConfigBuilder.php +++ b/src/DocScan/Session/Create/SdkConfigBuilder.php @@ -66,6 +66,11 @@ class SdkConfigBuilder */ private $idDocumentTextDataExtractionRetriesConfig; + /** + * @var string|null + */ + private $biometricConsentFlow; + public function withAllowsCamera(): self { return $this->withAllowedCaptureMethod(self::CAMERA); @@ -136,6 +141,11 @@ public function withAllowHandoff(bool $allowHandoff): self return $this; } + public function withBiometricConsentFlow(string $biometricConsentFlow): self + { + $this->biometricConsentFlow = $biometricConsentFlow; + return $this; + } /** * Allows configuring the number of attempts permitted for text extraction on an ID document * @@ -203,7 +213,8 @@ public function build(): SdkConfig $this->errorUrl, $this->privacyPolicyUrl, $this->allowHandoff, - $this->idDocumentTextDataExtractionRetriesConfig + $this->idDocumentTextDataExtractionRetriesConfig, + $this->biometricConsentFlow ); } } From 5f6479c2ef2dfa24106e9139f7ec94d69488a342 Mon Sep 17 00:00:00 2001 From: Rodion Liuborets Date: Tue, 7 Feb 2023 22:57:32 +0200 Subject: [PATCH 27/45] Master -> Development (#315) * Release 4.1.0 * Add helper method to GetSessionResult getFaceComparisonChecks * Add several fixes, update php8.0 -> 8.1, guzzlehttp/guzzle -> 7.0, guzzlehttp/psr7 -> 2.4 * Update github actions php8.0 -> 8.1 * Update github actions for sonar check php8.0 -> 8.1 * Remove support of php7.1 * Modify sonar config for php8.1 * Add php7.4, php8.0 support * Add php7.4, php8.0 support * Update README.md (#306) * Updated dependencies * Fixed psr/log for php7.4 * Improve identity report view * Fix version to 4.2.0 (#314) From c8f546a9742050bfcd104b90c127a0e073c4610a Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Wed, 12 Jul 2023 14:15:06 +0100 Subject: [PATCH 28/45] SDK-2347 fix bug on tags attribute when its missing --- .../Retrieve/CustomAccountWatchlistCaSearchConfigResponse.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DocScan/Session/Retrieve/CustomAccountWatchlistCaSearchConfigResponse.php b/src/DocScan/Session/Retrieve/CustomAccountWatchlistCaSearchConfigResponse.php index d1372b54..efa7819d 100644 --- a/src/DocScan/Session/Retrieve/CustomAccountWatchlistCaSearchConfigResponse.php +++ b/src/DocScan/Session/Retrieve/CustomAccountWatchlistCaSearchConfigResponse.php @@ -35,7 +35,7 @@ public function __construct(array $searchConfig) $this->apiKey = $searchConfig['api_key']; $this->monitoring = $searchConfig['monitoring']; $this->clientRef = $searchConfig['client_ref']; - $this->tags = json_decode($searchConfig['tags'], true); + $this->tags = array_key_exists('tags', $searchConfig) ? json_decode($searchConfig['tags'], true) : []; } /** From 7d158766b7aaeda05cd537f6bf85c0087638acae Mon Sep 17 00:00:00 2001 From: mehmet-yoti <111424390+mehmet-yoti@users.noreply.github.com> Date: Wed, 12 Jul 2023 18:39:54 +0300 Subject: [PATCH 29/45] Revert "SDK-2241 Share V2 Create Session (#319)" This reverts commit 6e28b4ccf143b04cdd06ce17cea5f095e03e4c57. --- .../Http/Controllers/IdentityController.php | 64 -- .../resources/views/identity.blade.php | 62 -- src/Exception/IdentityException.php | 9 - src/Identity/Constraint/Constraint.php | 8 - src/Identity/Constraint/PreferredSources.php | 54 -- src/Identity/Constraint/SourceConstraint.php | 43 -- .../Constraint/SourceConstraintBuilder.php | 46 -- .../Extension/BasicExtensionBuilder.php | 40 -- src/Identity/Extension/Extension.php | 38 -- .../Extension/ExtensionBuilderInterface.php | 8 - .../Extension/LocationConstraintContent.php | 61 -- .../LocationConstraintExtensionBuilder.php | 82 --- .../Extension/ThirdPartyAttributeContent.php | 38 -- .../ThirdPartyAttributeExtensionBuilder.php | 66 -- .../TransactionalFlowExtensionBuilder.php | 35 - src/Identity/IdentityService.php | 109 --- src/Identity/Policy/Policy.php | 75 -- src/Identity/Policy/PolicyBuilder.php | 332 --------- src/Identity/Policy/WantedAnchor.php | 29 - src/Identity/Policy/WantedAnchorBuilder.php | 32 - src/Identity/Policy/WantedAttribute.php | 123 ---- .../Policy/WantedAttributeBuilder.php | 77 --- src/Identity/ShareSessionCreated.php | 71 -- src/Identity/ShareSessionCreatedQrCode.php | 48 -- src/Identity/ShareSessionFetched.php | 117 ---- src/Identity/ShareSessionFetchedQrCode.php | 110 --- src/Identity/ShareSessionNotification.php | 70 -- .../ShareSessionNotificationBuilder.php | 65 -- src/Identity/ShareSessionRequest.php | 110 --- src/Identity/ShareSessionRequestBuilder.php | 84 --- src/Util/Validation.php | 2 +- src/YotiClient.php | 69 +- .../Constraint/PreferredSourcesTest.php | 42 -- .../SourceConstraintsBuilderTest.php | 66 -- .../Extension/BasicExtensionBuilderTest.php | 40 -- .../LocationConstraintContentTest.php | 44 -- ...LocationConstraintExtensionBuilderTest.php | 164 ----- .../ThirdPartyAttributeContentTest.php | 42 -- ...hirdPartyAttributeExtensionBuilderTest.php | 132 ---- .../TransactionalFlowExtensionBuilderTest.php | 36 - tests/Identity/IdentityServiceTest.php | 133 ---- tests/Identity/Policy/PolicyBuilderTest.php | 644 ------------------ .../Policy/WantedAnchorBuilderTest.php | 39 -- .../Policy/WantedAttributeBuilderTest.php | 162 ----- .../ShareSessionCreatedQrCodeTest.php | 42 -- tests/Identity/ShareSessionCreatedTest.php | 45 -- .../ShareSessionFetchedQrCodeTest.php | 76 --- tests/Identity/ShareSessionFetchedTest.php | 66 -- .../ShareSessionNotificationBuilderTest.php | 80 --- .../ShareSessionRequestBuilderTest.php | 100 --- tests/YotiClientTest.php | 140 ---- 51 files changed, 13 insertions(+), 4257 deletions(-) delete mode 100644 examples/profile/app/Http/Controllers/IdentityController.php delete mode 100644 examples/profile/resources/views/identity.blade.php delete mode 100644 src/Exception/IdentityException.php delete mode 100644 src/Identity/Constraint/Constraint.php delete mode 100644 src/Identity/Constraint/PreferredSources.php delete mode 100644 src/Identity/Constraint/SourceConstraint.php delete mode 100644 src/Identity/Constraint/SourceConstraintBuilder.php delete mode 100644 src/Identity/Extension/BasicExtensionBuilder.php delete mode 100644 src/Identity/Extension/Extension.php delete mode 100644 src/Identity/Extension/ExtensionBuilderInterface.php delete mode 100644 src/Identity/Extension/LocationConstraintContent.php delete mode 100644 src/Identity/Extension/LocationConstraintExtensionBuilder.php delete mode 100644 src/Identity/Extension/ThirdPartyAttributeContent.php delete mode 100644 src/Identity/Extension/ThirdPartyAttributeExtensionBuilder.php delete mode 100644 src/Identity/Extension/TransactionalFlowExtensionBuilder.php delete mode 100644 src/Identity/IdentityService.php delete mode 100644 src/Identity/Policy/Policy.php delete mode 100644 src/Identity/Policy/PolicyBuilder.php delete mode 100644 src/Identity/Policy/WantedAnchor.php delete mode 100644 src/Identity/Policy/WantedAnchorBuilder.php delete mode 100644 src/Identity/Policy/WantedAttribute.php delete mode 100644 src/Identity/Policy/WantedAttributeBuilder.php delete mode 100644 src/Identity/ShareSessionCreated.php delete mode 100644 src/Identity/ShareSessionCreatedQrCode.php delete mode 100644 src/Identity/ShareSessionFetched.php delete mode 100644 src/Identity/ShareSessionFetchedQrCode.php delete mode 100644 src/Identity/ShareSessionNotification.php delete mode 100644 src/Identity/ShareSessionNotificationBuilder.php delete mode 100644 src/Identity/ShareSessionRequest.php delete mode 100644 src/Identity/ShareSessionRequestBuilder.php delete mode 100644 tests/Identity/Constraint/PreferredSourcesTest.php delete mode 100644 tests/Identity/Constraint/SourceConstraintsBuilderTest.php delete mode 100644 tests/Identity/Extension/BasicExtensionBuilderTest.php delete mode 100644 tests/Identity/Extension/LocationConstraintContentTest.php delete mode 100644 tests/Identity/Extension/LocationConstraintExtensionBuilderTest.php delete mode 100644 tests/Identity/Extension/ThirdPartyAttributeContentTest.php delete mode 100644 tests/Identity/Extension/ThirdPartyAttributeExtensionBuilderTest.php delete mode 100644 tests/Identity/Extension/TransactionalFlowExtensionBuilderTest.php delete mode 100644 tests/Identity/IdentityServiceTest.php delete mode 100644 tests/Identity/Policy/PolicyBuilderTest.php delete mode 100644 tests/Identity/Policy/WantedAnchorBuilderTest.php delete mode 100644 tests/Identity/Policy/WantedAttributeBuilderTest.php delete mode 100644 tests/Identity/ShareSessionCreatedQrCodeTest.php delete mode 100644 tests/Identity/ShareSessionCreatedTest.php delete mode 100644 tests/Identity/ShareSessionFetchedQrCodeTest.php delete mode 100644 tests/Identity/ShareSessionFetchedTest.php delete mode 100644 tests/Identity/ShareSessionNotificationBuilderTest.php delete mode 100644 tests/Identity/ShareSessionRequestBuilderTest.php diff --git a/examples/profile/app/Http/Controllers/IdentityController.php b/examples/profile/app/Http/Controllers/IdentityController.php deleted file mode 100644 index 61b6317b..00000000 --- a/examples/profile/app/Http/Controllers/IdentityController.php +++ /dev/null @@ -1,64 +0,0 @@ -build(); - - $redirectUri = 'https://host/redirect/'; - - $shareSessionRequest = (new ShareSessionRequestBuilder()) - ->withPolicy($policy) - ->withRedirectUri($redirectUri) - ->build(); - - $session = $client->createShareSession($shareSessionRequest); - - $createdQrCode = $client->createShareQrCode($session->getId()); - - $fetchedQrCode = $client->fetchShareQrCode($createdQrCode->getId()); - - $sessionFetched = $client->fetchShareSession($session->getId()); - - return view('identity', [ - 'title' => 'Digital Identity Complete Example', - // Creating session - 'sessionId' => $session->getId(), - 'sessionStatus' => $session->getStatus(), - 'sessionExpiry' => $session->getExpiry(), - // Creating QR code - 'createdQrCodeId' => $createdQrCode->getId(), - 'createdQrCodeUri' => $createdQrCode->getUri(), - // Fetch QR code - 'fetchedQrCodeExpiry' => $fetchedQrCode->getExpiry(), - 'fetchedQrCodeExtensions' => $fetchedQrCode->getExtensions(), - 'fetchedQrCodeRedirectUri' => $fetchedQrCode->getRedirectUri(), - 'fetchedQrCodeSessionId' => $fetchedQrCode->getSession()->getId(), - 'fetchedQrCodeSessionStatus' => $fetchedQrCode->getSession()->getStatus(), - 'fetchedQrCodeSessionExpiry' => $fetchedQrCode->getSession()->getExpiry(), - // Fetch session - 'fetchedSessionId' => $sessionFetched->getId(), - 'fetchedSessionStatus' => $sessionFetched->getStatus(), - 'fetchedSessionExpiry' => $sessionFetched->getExpiry(), - 'fetchedSessionCreated' => $sessionFetched->getCreated(), - 'fetchedSessionUpdated' => $sessionFetched->getUpdated(), - 'fetchedSessionQrCodeId' => $sessionFetched->getQrCodeId(), - 'fetchedSessionReceiptId' => $sessionFetched->getReceiptId(), - ]); - } catch (\Throwable $e) { - Log::error($e->getTraceAsString()); - throw new BadRequestHttpException($e->getMessage()); - } - } -} diff --git a/examples/profile/resources/views/identity.blade.php b/examples/profile/resources/views/identity.blade.php deleted file mode 100644 index f4523ea3..00000000 --- a/examples/profile/resources/views/identity.blade.php +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - {{ $title }} - - - - - -
-
-
- - Yoti - -
- -

Digital Identity Share Complete Example page

- -
-

Created Session

-

Id: {{$sessionId}}

-

Status: {{$sessionStatus}}

-

Expiry: {{$sessionExpiry}}

-
- -
-

Created Session QR Code

-

Id: {{$createdQrCodeId}}

-

URI: {{$createdQrCodeUri}}

-
- -
-

Fetched Session QR Code

-

Expiry: {{$fetchedQrCodeExpiry}}

-

Extensions: {{$fetchedQrCodeExtensions}}

-

Redirect URI: {{$fetchedQrCodeRedirectUri}}

-

Session ID: {{$fetchedQrCodeSessionId}}

-

Session Status: {{$fetchedQrCodeSessionStatus}}

-

Session Expiry: {{$fetchedQrCodeSessionExpiry}}

-
- -
-

Fetched Session

-

Id: {{$fetchedSessionId}}

-

Created: {{$fetchedSessionCreated}}

-

Updated: {{$fetchedSessionUpdated}}

-

Expiry: {{$fetchedSessionExpiry}}

-

Status: {{$fetchedSessionStatus}}

-

QR Code ID: {{$fetchedSessionQrCodeId}}

-

Receipt ID: {{$fetchedSessionReceiptId}}

-
- -
-
- - - \ No newline at end of file diff --git a/src/Exception/IdentityException.php b/src/Exception/IdentityException.php deleted file mode 100644 index 0c235e8b..00000000 --- a/src/Exception/IdentityException.php +++ /dev/null @@ -1,9 +0,0 @@ -wantedAnchors = $wantedAnchors; - - Validation::isBoolean($softPreference, 'soft_preference'); - $this->softPreference = $softPreference; - } - - public function jsonSerialize(): stdClass - { - return (object)[ - 'anchors' => $this->wantedAnchors, - 'soft_preference' => $this->softPreference, - ]; - } - - /** - * @return WantedAnchor[] - */ - public function getWantedAnchors(): array - { - return $this->wantedAnchors; - } - - /** - * @return bool - */ - public function isSoftPreference(): bool - { - return $this->softPreference; - } -} diff --git a/src/Identity/Constraint/SourceConstraint.php b/src/Identity/Constraint/SourceConstraint.php deleted file mode 100644 index cd903789..00000000 --- a/src/Identity/Constraint/SourceConstraint.php +++ /dev/null @@ -1,43 +0,0 @@ -type = 'SOURCE'; - - Validation::isArrayOfType($wantedAnchors, [WantedAnchor::class], 'anchors'); - $this->preferredSources = new PreferredSources($wantedAnchors, $softPreference); - } - - public function getType(): string - { - return $this->type; - } - - public function getPreferredSources(): PreferredSources - { - return $this->preferredSources; - } - - public function jsonSerialize(): object - { - return (object)[ - 'type' => $this->getType(), - 'preferred_sources' => $this->getPreferredSources(), - ]; - } -} diff --git a/src/Identity/Constraint/SourceConstraintBuilder.php b/src/Identity/Constraint/SourceConstraintBuilder.php deleted file mode 100644 index 59b62e16..00000000 --- a/src/Identity/Constraint/SourceConstraintBuilder.php +++ /dev/null @@ -1,46 +0,0 @@ -wantedAnchors = $wantedAnchors; - - return $this; - } - - public function withWantedAnchor(WantedAnchor $wantedAnchor): self - { - $this->wantedAnchors[] = $wantedAnchor; - - return $this; - } - - public function withSoftPreference(bool $softPreference): self - { - $this->softPreference = $softPreference; - - return $this; - } - - public function build(): SourceConstraint - { - return new SourceConstraint($this->wantedAnchors, $this->softPreference); - } -} diff --git a/src/Identity/Extension/BasicExtensionBuilder.php b/src/Identity/Extension/BasicExtensionBuilder.php deleted file mode 100644 index 97d913aa..00000000 --- a/src/Identity/Extension/BasicExtensionBuilder.php +++ /dev/null @@ -1,40 +0,0 @@ -type = $type; - - return $this; - } - - /** - * @param mixed $content - * - * @return $this - */ - public function withContent($content): self - { - $this->content = $content; - - return $this; - } - - public function build(): Extension - { - return new Extension($this->type, $this->content); - } -} diff --git a/src/Identity/Extension/Extension.php b/src/Identity/Extension/Extension.php deleted file mode 100644 index d7e436b1..00000000 --- a/src/Identity/Extension/Extension.php +++ /dev/null @@ -1,38 +0,0 @@ -type = $type; - - Validation::notNull($type, 'content'); - $this->content = $content; - } - - /** - * @return stdClass - */ - public function jsonSerialize(): stdClass - { - return (object)[ - 'type' => $this->type, - 'content' => $this->content, - ]; - } -} diff --git a/src/Identity/Extension/ExtensionBuilderInterface.php b/src/Identity/Extension/ExtensionBuilderInterface.php deleted file mode 100644 index 1ab39bd8..00000000 --- a/src/Identity/Extension/ExtensionBuilderInterface.php +++ /dev/null @@ -1,8 +0,0 @@ -latitude = $latitude; - - Validation::withinRange($longitude, -180, 180, 'longitude'); - $this->longitude = $longitude; - - Validation::notLessThan($radius, 0, 'radius'); - $this->radius = $radius; - - Validation::notLessThan($maxUncertainty, 0, 'maxUncertainty'); - $this->maxUncertainty = $maxUncertainty; - } - - /** - * @inheritDoc - * - * @return stdClass - */ - public function jsonSerialize(): stdClass - { - return (object)[ - 'expected_device_location' => [ - 'latitude' => $this->latitude, - 'longitude' => $this->longitude, - 'radius' => $this->radius, - 'max_uncertainty_radius' => $this->maxUncertainty, - ] - ]; - } -} diff --git a/src/Identity/Extension/LocationConstraintExtensionBuilder.php b/src/Identity/Extension/LocationConstraintExtensionBuilder.php deleted file mode 100644 index 556cd19d..00000000 --- a/src/Identity/Extension/LocationConstraintExtensionBuilder.php +++ /dev/null @@ -1,82 +0,0 @@ -latitude = $latitude; - return $this; - } - - /** - * Allows you to specify the Longitude of the user's expected location - */ - public function withLongitude(float $longitude): self - { - $this->longitude = $longitude; - return $this; - } - - /** - * Radius of the circle, centred on the specified location coordinates, where the device is - * allowed to perform the share. - * - * If not provided, a default value of 150m will be used. - * - * @param float $radius - * The allowable distance, in metres, from the given lat/long location - */ - public function withRadius(float $radius): self - { - $this->radius = $radius; - return $this; - } - - /** - * Maximum acceptable distance, in metres, of the area of uncertainty associated with the device - * location coordinates. - * - * If not provided, a default value of 150m will be used. - * - * @param float $maxUncertainty - * Maximum allowed measurement uncertainty, in metres - * - * @return $this - */ - public function withMaxUncertainty(float $maxUncertainty): self - { - $this->maxUncertainty = $maxUncertainty; - - return $this; - } - - public function build(): Extension - { - $content = new LocationConstraintContent( - $this->latitude, - $this->longitude, - $this->radius, - $this->maxUncertainty - ); - - return new Extension(self::LOCATION_CONSTRAINT, $content); - } -} diff --git a/src/Identity/Extension/ThirdPartyAttributeContent.php b/src/Identity/Extension/ThirdPartyAttributeContent.php deleted file mode 100644 index 0eeec95a..00000000 --- a/src/Identity/Extension/ThirdPartyAttributeContent.php +++ /dev/null @@ -1,38 +0,0 @@ -expiryDate = $expiryDate; - - Validation::isArrayOfType($definitions, [AttributeDefinition::class], 'definitions'); - $this->definitions = $definitions; - } - - public function jsonSerialize(): stdClass - { - return (object)[ - 'expiry_date' => $this->expiryDate - ->setTimezone(new \DateTimeZone('UTC')) - ->format(\DateTime::RFC3339_EXTENDED), - 'definitions' => $this->definitions, - ]; - } -} diff --git a/src/Identity/Extension/ThirdPartyAttributeExtensionBuilder.php b/src/Identity/Extension/ThirdPartyAttributeExtensionBuilder.php deleted file mode 100644 index 132fa720..00000000 --- a/src/Identity/Extension/ThirdPartyAttributeExtensionBuilder.php +++ /dev/null @@ -1,66 +0,0 @@ -expiryDate = $expiryDate; - - return $this; - } - - public function withDefinition(string $definition): self - { - $this->definitions[] = new AttributeDefinition($definition); - - return $this; - } - - /** - * @param string[] $definitions - */ - public function withDefinitions(array $definitions): self - { - Validation::isArrayOfStrings($definitions, 'definitions'); - $this->definitions = array_map( - function ($definition): AttributeDefinition { - return new AttributeDefinition($definition); - }, - $definitions - ); - - return $this; - } - - public function build(): Extension - { - return new Extension( - self::THIRD_PARTY_ATTRIBUTE, - new ThirdPartyAttributeContent( - $this->expiryDate, - $this->definitions - ) - ); - } -} diff --git a/src/Identity/Extension/TransactionalFlowExtensionBuilder.php b/src/Identity/Extension/TransactionalFlowExtensionBuilder.php deleted file mode 100644 index 22eb5821..00000000 --- a/src/Identity/Extension/TransactionalFlowExtensionBuilder.php +++ /dev/null @@ -1,35 +0,0 @@ -content = $content; - - return $this; - } - - /** - * @return Extension with TRANSACTIONAL_FLOW type - */ - public function build(): Extension - { - return new Extension(static::TYPE, $this->content); - } -} diff --git a/src/Identity/IdentityService.php b/src/Identity/IdentityService.php deleted file mode 100644 index edbf96f5..00000000 --- a/src/Identity/IdentityService.php +++ /dev/null @@ -1,109 +0,0 @@ -sdkId = $sdkId; - $this->pemFile = $pemFile; - $this->config = $config; - } - - public function createShareSession(ShareSessionRequest $shareSessionRequest): ShareSessionCreated - { - $response = (new RequestBuilder($this->config)) - ->withBaseUrl($this->config->getApiUrl() ?? Constants::API_URL) - ->withEndpoint(self::IDENTITY_SESSION_CREATION) - ->withHeader('X-Yoti-Auth-Id', $this->sdkId) - ->withPost() - ->withPayload(Payload::fromJsonData($shareSessionRequest)) - ->withPemFile($this->pemFile) - ->build() - ->execute(); - - $httpCode = $response->getStatusCode(); - if ($httpCode < 200 || $httpCode > 299) { - throw new IdentityException("Server responded with {$httpCode}", $response); - } - - return new ShareSessionCreated(Json::decode((string)$response->getBody())); - } - - public function createShareQrCode(string $sessionId): ShareSessionCreatedQrCode - { - $response = (new RequestBuilder($this->config)) - ->withBaseUrl($this->config->getApiUrl() ?? Constants::API_URL) - ->withEndpoint(sprintf(self::IDENTITY_SESSION_QR_CODE_CREATION, $sessionId)) - ->withHeader('X-Yoti-Auth-Id', $this->sdkId) - ->withPost() - ->withPemFile($this->pemFile) - ->build() - ->execute(); - - $httpCode = $response->getStatusCode(); - if ($httpCode < 200 || $httpCode > 299) { - throw new IdentityException("Server responded with {$httpCode}", $response); - } - - return new ShareSessionCreatedQrCode(Json::decode((string)$response->getBody())); - } - - public function fetchShareQrCode(string $qrCodeId): ShareSessionFetchedQrCode - { - $response = (new RequestBuilder($this->config)) - ->withBaseUrl($this->config->getApiUrl() ?? Constants::API_URL) - ->withEndpoint(sprintf(self::IDENTITY_SESSION_QR_CODE_RETRIEVAL, $qrCodeId)) - ->withHeader('X-Yoti-Auth-Id', $this->sdkId) - ->withPost() - ->withPemFile($this->pemFile) - ->build() - ->execute(); - - $httpCode = $response->getStatusCode(); - if ($httpCode < 200 || $httpCode > 299) { - throw new IdentityException("Server responded with {$httpCode}", $response); - } - - return new ShareSessionFetchedQrCode(Json::decode((string)$response->getBody())); - } - - public function fetchShareSession(string $sessionId): ShareSessionFetched - { - $response = (new RequestBuilder($this->config)) - ->withBaseUrl($this->config->getApiUrl() ?? Constants::API_URL) - ->withEndpoint(sprintf(self::IDENTITY_SESSION_RETRIEVAL, $sessionId)) - ->withHeader('X-Yoti-Auth-Id', $this->sdkId) - ->withPost() - ->withPemFile($this->pemFile) - ->build() - ->execute(); - - $httpCode = $response->getStatusCode(); - if ($httpCode < 200 || $httpCode > 299) { - throw new IdentityException("Server responded with {$httpCode}", $response); - } - - return new ShareSessionFetched(Json::decode((string)$response->getBody())); - } -} diff --git a/src/Identity/Policy/Policy.php b/src/Identity/Policy/Policy.php deleted file mode 100644 index 62ade060..00000000 --- a/src/Identity/Policy/Policy.php +++ /dev/null @@ -1,75 +0,0 @@ -wantedAttributes = $wantedAttributes; - - Validation::isArrayOfIntegers($wantedAuthTypes, 'wantedAuthTypes'); - $this->wantedAuthTypes = $wantedAuthTypes; - - $this->wantedRememberMe = $wantedRememberMe; - $this->wantedRememberMeOptional = $wantedRememberMeOptional; - $this->identityProfileRequirements = $identityProfileRequirements; - } - - - public function jsonSerialize(): stdClass - { - return (object)[ - 'wanted' => $this->wantedAttributes, - 'wanted_auth_types' => $this->wantedAuthTypes, - 'wanted_remember_me' => $this->wantedRememberMe, - 'wanted_remember_me_optional' => $this->wantedRememberMeOptional, - 'identity_profile_requirements' => $this->identityProfileRequirements, - ]; - } - - /** - * IdentityProfileRequirements requested in the policy - * - * @return object|null - */ - public function getIdentityProfileRequirements() - { - return $this->identityProfileRequirements; - } -} diff --git a/src/Identity/Policy/PolicyBuilder.php b/src/Identity/Policy/PolicyBuilder.php deleted file mode 100644 index e8a8b190..00000000 --- a/src/Identity/Policy/PolicyBuilder.php +++ /dev/null @@ -1,332 +0,0 @@ -getName(); - - if (null !== $wantedAttribute->getDerivation()) { - $key = $wantedAttribute->getDerivation(); - } - - if (null !== $wantedAttribute->getConstraints()) { - $key .= '-' . hash('sha256', Json::encode($wantedAttribute->getConstraints())); - } - - $this->wantedAttributes[$key] = $wantedAttribute; - - return $this; - } - - /** - * @param Constraint[]|null $constraints - */ - public function withWantedAttributeByName( - string $name, - array $constraints = null, - bool $acceptSelfAsserted = null - ): self { - $wantedAttributeBuilder = (new WantedAttributeBuilder()) - ->withName($name); - - if ($constraints !== null) { - $wantedAttributeBuilder->withConstraints($constraints); - } - - if ($acceptSelfAsserted !== null) { - $wantedAttributeBuilder->withAcceptSelfAsserted($acceptSelfAsserted); - } - - return $this->withWantedAttribute($wantedAttributeBuilder->build()); - } - - /** - * @param Constraint[]|null $constraints - */ - public function withFamilyName(array $constraints = null, bool $acceptSelfAsserted = null): self - { - return $this->withWantedAttributeByName( - UserProfile::ATTR_FAMILY_NAME, - $constraints, - $acceptSelfAsserted - ); - } - - /** - * @param Constraint[]|null $constraints - */ - public function withGivenNames(array $constraints = null, bool $acceptSelfAsserted = null): self - { - return $this->withWantedAttributeByName( - UserProfile::ATTR_GIVEN_NAMES, - $constraints, - $acceptSelfAsserted - ); - } - - /** - * @param Constraint[]|null $constraints - */ - public function withFullName(array $constraints = null, bool $acceptSelfAsserted = null): self - { - return $this->withWantedAttributeByName( - UserProfile::ATTR_FULL_NAME, - $constraints, - $acceptSelfAsserted - ); - } - - /** - * @param Constraint[]|null $constraints - */ - public function withDateOfBirth(array $constraints = null, bool $acceptSelfAsserted = null): self - { - return $this->withWantedAttributeByName( - UserProfile::ATTR_DATE_OF_BIRTH, - $constraints, - $acceptSelfAsserted - ); - } - - /** - * @param Constraint[]|null $constraints - */ - public function withAgeOver(int $age, array $constraints = null, bool $acceptSelfAsserted = null): self - { - return $this->withAgeDerivedAttribute( - UserProfile::AGE_OVER . $age, - $constraints, - $acceptSelfAsserted - ); - } - - /** - * @param Constraint[]|null $constraints - */ - public function withAgeUnder(int $age, array $constraints = null, bool $acceptSelfAsserted = null): self - { - return $this->withAgeDerivedAttribute( - UserProfile::AGE_UNDER . $age, - $constraints, - $acceptSelfAsserted - ); - } - - /** - * @param Constraint[]|null $constraints - */ - public function withAgeDerivedAttribute( - string $derivation, - array $constraints = null, - bool $acceptSelfAsserted = null - ): self { - $wantedAttributeBuilder = (new WantedAttributeBuilder()) - ->withName(UserProfile::ATTR_DATE_OF_BIRTH) - ->withDerivation($derivation); - - if ($constraints !== null) { - $wantedAttributeBuilder->withConstraints($constraints); - } - - if ($acceptSelfAsserted !== null) { - $wantedAttributeBuilder->withAcceptSelfAsserted($acceptSelfAsserted); - } - - return $this->withWantedAttribute($wantedAttributeBuilder->build()); - } - - /** - * @param Constraint[]|null $constraints - */ - public function withGender(array $constraints = null, bool $acceptSelfAsserted = null): self - { - return $this->withWantedAttributeByName( - UserProfile::ATTR_GENDER, - $constraints, - $acceptSelfAsserted - ); - } - - /** - * @param Constraint[]|null $constraints - */ - public function withPostalAddress(array $constraints = null, bool $acceptSelfAsserted = null): self - { - return $this->withWantedAttributeByName( - UserProfile::ATTR_POSTAL_ADDRESS, - $constraints, - $acceptSelfAsserted - ); - } - - /** - * @param Constraint[]|null $constraints - */ - public function withStructuredPostalAddress(array $constraints = null, bool $acceptSelfAsserted = null): self - { - return $this->withWantedAttributeByName( - UserProfile::ATTR_STRUCTURED_POSTAL_ADDRESS, - $constraints, - $acceptSelfAsserted - ); - } - - /** - * @param Constraint[]|null $constraints - */ - public function withNationality(array $constraints = null, bool $acceptSelfAsserted = null): self - { - return $this->withWantedAttributeByName( - UserProfile::ATTR_NATIONALITY, - $constraints, - $acceptSelfAsserted - ); - } - - /** - * @param Constraint[]|null $constraints - */ - public function withPhoneNumber(array $constraints = null, bool $acceptSelfAsserted = null): self - { - return $this->withWantedAttributeByName( - UserProfile::ATTR_PHONE_NUMBER, - $constraints, - $acceptSelfAsserted - ); - } - - /** - * @param Constraint[]|null $constraints - */ - public function withSelfie(array $constraints = null, bool $acceptSelfAsserted = null): self - { - return $this->withWantedAttributeByName( - UserProfile::ATTR_SELFIE, - $constraints, - $acceptSelfAsserted - ); - } - - /** - * @param Constraint[]|null $constraints - */ - public function withDocumentDetails(array $constraints = null, bool $acceptSelfAsserted = null): self - { - return $this->withWantedAttributeByName( - UserProfile::ATTR_DOCUMENT_DETAILS, - $constraints, - $acceptSelfAsserted - ); - } - - /** - * @param Constraint[]|null $constraints - */ - public function withDocumentImages(array $constraints = null, bool $acceptSelfAsserted = null): self - { - return $this->withWantedAttributeByName( - UserProfile::ATTR_DOCUMENT_IMAGES, - $constraints, - $acceptSelfAsserted - ); - } - - /** - * @param Constraint[]|null $constraints - */ - public function withEmail(array $constraints = null, bool $acceptSelfAsserted = null): self - { - return $this->withWantedAttributeByName( - UserProfile::ATTR_EMAIL_ADDRESS, - $constraints, - $acceptSelfAsserted - ); - } - - - public function withSelfieAuthentication(bool $enabled = true): self - { - return $this->withWantedAuthType(self::SELFIE_AUTH_TYPE, $enabled); - } - - - public function withPinAuthentication(bool $enabled = true): self - { - return $this->withWantedAuthType(self::PIN_AUTH_TYPE, $enabled); - } - - public function withWantedAuthType(int $wantedAuthType, bool $enabled = true): self - { - if ($enabled) { - $this->wantedAuthTypes[$wantedAuthType] = $wantedAuthType; - } else { - unset($this->wantedAuthTypes[$wantedAuthType]); - } - - return $this; - } - - - public function withWantedRememberMe(bool $wantedRememberMe): self - { - $this->wantedRememberMe = $wantedRememberMe; - return $this; - } - - public function withWantedRememberMeOptional(bool $wantedRememberMeOptional): self - { - $this->wantedRememberMeOptional = $wantedRememberMeOptional; - return $this; - } - - /** - * Use an Identity Profile Requirement object for the share - * - * @param object $identityProfileRequirements - * @return $this - */ - public function withIdentityProfileRequirements($identityProfileRequirements): self - { - $this->identityProfileRequirements = $identityProfileRequirements; - return $this; - } - - - public function build(): Policy - { - return new Policy( - array_values($this->wantedAttributes), - array_values($this->wantedAuthTypes), - $this->wantedRememberMe, - $this->wantedRememberMeOptional, - $this->identityProfileRequirements - ); - } -} diff --git a/src/Identity/Policy/WantedAnchor.php b/src/Identity/Policy/WantedAnchor.php deleted file mode 100644 index 1714ca8a..00000000 --- a/src/Identity/Policy/WantedAnchor.php +++ /dev/null @@ -1,29 +0,0 @@ -value = $value; - $this->subType = $subType; - } - - public function jsonSerialize(): stdClass - { - return (object)[ - 'name' => $this->value, - 'sub_type' => $this->subType, - ]; - } -} diff --git a/src/Identity/Policy/WantedAnchorBuilder.php b/src/Identity/Policy/WantedAnchorBuilder.php deleted file mode 100644 index 9625445f..00000000 --- a/src/Identity/Policy/WantedAnchorBuilder.php +++ /dev/null @@ -1,32 +0,0 @@ -value = $value; - return $this; - } - - public function withSubType(string $subType): self - { - $this->subType = $subType; - return $this; - } - - public function build(): WantedAnchor - { - Validation::notNull($this->value, 'value'); - Validation::notNull($this->subType, 'sub_type'); - - return new WantedAnchor($this->value, $this->subType); - } -} diff --git a/src/Identity/Policy/WantedAttribute.php b/src/Identity/Policy/WantedAttribute.php deleted file mode 100644 index dc34da79..00000000 --- a/src/Identity/Policy/WantedAttribute.php +++ /dev/null @@ -1,123 +0,0 @@ -name = $name; - - $this->derivation = $derivation; - $this->optional = $optional; - $this->acceptSelfAsserted = $acceptSelfAsserted; - - if (null !== $constraints) { - Validation::isArrayOfType($constraints, [Constraint::class], 'constraints'); - $this->constraints = $constraints; - } - } - - /** - * Name identifying the WantedAttribute - * - * @return string - */ - public function getName(): string - { - return $this->name; - } - - /** - * Additional derived criteria. - * - * @return string - */ - public function getDerivation(): ?string - { - return $this->derivation; - } - - /** - * List of constraints to add to an attribute. - * - * If you do not provide any particular constraints, Yoti will provide you with the - * information from the most recently added source. - * - * @return Constraint[] $constraints - */ - public function getConstraints(): ?array - { - return $this->constraints; - } - - /** - * Accept self asserted attributes. - * - * These are attributes that have been self-declared, and not verified by Yoti. - * - * @return bool|null - */ - public function getAcceptSelfAsserted(): ?bool - { - return $this->acceptSelfAsserted; - } - - /** - * @return bool - */ - public function getOptional(): bool - { - return $this->optional; - } - - public function jsonSerialize(): stdClass - { - $data = new stdClass(); - $data->name = $this->getName(); - $data->optional = $this->getOptional(); - - if (null !== $this->getDerivation()) { - $data->derivation = $this->getDerivation(); - } - - if (null !== $this->getConstraints()) { - $data->constraints = $this->getConstraints(); - } - - if (null !== $this->getAcceptSelfAsserted()) { - $data->accept_self_asserted = $this->getAcceptSelfAsserted(); - } - - return $data; - } -} diff --git a/src/Identity/Policy/WantedAttributeBuilder.php b/src/Identity/Policy/WantedAttributeBuilder.php deleted file mode 100644 index c2a53f1f..00000000 --- a/src/Identity/Policy/WantedAttributeBuilder.php +++ /dev/null @@ -1,77 +0,0 @@ -name = $name; - - return $this; - } - - public function withDerivation(string $derivation): self - { - $this->derivation = $derivation; - - return $this; - } - - public function withOptional(bool $optional): self - { - $this->optional = $optional; - - return $this; - } - - public function withAcceptSelfAsserted(bool $acceptSelfAsserted): self - { - $this->acceptSelfAsserted = $acceptSelfAsserted; - - return $this; - } - - /** - * @param Constraint[] $constraints - */ - public function withConstraints(array $constraints): self - { - $this->constraints = $constraints; - - return $this; - } - - public function withConstraint(Constraint $constraint): self - { - $this->constraints[] = $constraint; - - return $this; - } - - public function build(): WantedAttribute - { - return new WantedAttribute( - $this->name, - $this->derivation, - $this->optional, - $this->acceptSelfAsserted, - $this->constraints, - ); - } -} diff --git a/src/Identity/ShareSessionCreated.php b/src/Identity/ShareSessionCreated.php deleted file mode 100644 index 4bb0f924..00000000 --- a/src/Identity/ShareSessionCreated.php +++ /dev/null @@ -1,71 +0,0 @@ -id = $sessionData['id']; - } - - if (isset($sessionData['status'])) { - Validation::isString($sessionData['status'], 'status'); - $this->status = $sessionData['status']; - } - - if (isset($sessionData['expiry'])) { - Validation::isString($sessionData['expiry'], 'expiry'); - $this->expiry = $sessionData['expiry']; - } - } - - /** - * @return string - */ - public function getId(): string - { - return $this->id; - } - - /** - * @return string - */ - public function getStatus(): string - { - return $this->status; - } - - /** - * @return string - */ - public function getExpiry(): string - { - return $this->expiry; - } - - public function jsonSerialize(): object - { - return (object)[ - 'id' => $this->getId(), - 'status' => $this->getStatus(), - 'expiry' => $this->getExpiry(), - ]; - } -} diff --git a/src/Identity/ShareSessionCreatedQrCode.php b/src/Identity/ShareSessionCreatedQrCode.php deleted file mode 100644 index 901074b0..00000000 --- a/src/Identity/ShareSessionCreatedQrCode.php +++ /dev/null @@ -1,48 +0,0 @@ -id = $sessionData['id']; - } - - if (isset($sessionData['uri'])) { - $this->uri = $sessionData['uri']; - } - } - - public function jsonSerialize(): object - { - return (object)[ - 'id' => $this->id, - 'uri' => $this->uri - ]; - } - - /** - * @return string - */ - public function getId(): string - { - return $this->id; - } - - /** - * @return string - */ - public function getUri(): string - { - return $this->uri; - } -} diff --git a/src/Identity/ShareSessionFetched.php b/src/Identity/ShareSessionFetched.php deleted file mode 100644 index ac171a2f..00000000 --- a/src/Identity/ShareSessionFetched.php +++ /dev/null @@ -1,117 +0,0 @@ - $sessionData - */ - public function __construct(array $sessionData) - { - if (isset($sessionData['id'])) { - $this->id = $sessionData['id']; - } - if (isset($sessionData['status'])) { - $this->status = $sessionData['status']; - } - if (isset($sessionData['expiry'])) { - $this->expiry = $sessionData['expiry']; - } - if (isset($sessionData['created'])) { - $this->created = $sessionData['created']; - } - if (isset($sessionData['updated'])) { - $this->updated = $sessionData['updated']; - } - if (isset($sessionData['qrCode'])) { - $this->qrCodeId = $sessionData['qrCode']['id']; - } - if (isset($sessionData['receipt'])) { - $this->receiptId = $sessionData['receipt']['id']; - } - } - - public function jsonSerialize(): object - { - return (object)[ - 'id' => $this->id, - 'status' => $this->status, - 'expiry' => $this->expiry, - 'created' => $this->created, - 'updated' => $this->updated, - 'qrCodeId' => $this->qrCodeId, - 'receiptId' => $this->receiptId, - ]; - } - - /** - * @return string - */ - public function getId(): string - { - return $this->id; - } - - /** - * @return string - */ - public function getStatus(): string - { - return $this->status; - } - - /** - * @return string - */ - public function getCreated(): string - { - return $this->created; - } - - /** - * @return string - */ - public function getUpdated(): string - { - return $this->updated; - } - - /** - * @return string - */ - public function getExpiry(): string - { - return $this->expiry; - } - - /** - * @return string - */ - public function getQrCodeId(): string - { - return $this->qrCodeId; - } - - /** - * @return string - */ - public function getReceiptId(): string - { - return $this->receiptId; - } -} diff --git a/src/Identity/ShareSessionFetchedQrCode.php b/src/Identity/ShareSessionFetchedQrCode.php deleted file mode 100644 index 1f8aaabf..00000000 --- a/src/Identity/ShareSessionFetchedQrCode.php +++ /dev/null @@ -1,110 +0,0 @@ - $sessionData - */ - public function __construct(array $sessionData) - { - if (isset($sessionData['id'])) { - $this->id = $sessionData['id']; - } - if (isset($sessionData['expiry'])) { - $this->expiry = $sessionData['expiry']; - } - if (isset($sessionData['policy'])) { - $this->policy = $sessionData['policy']; - } - if (isset($sessionData['extensions'])) { - foreach ($sessionData['extensions'] as $extension) { - $this->extensions[] = new Extension($extension['type'], $extension['content']); - } - } - if (isset($sessionData['session'])) { - $this->session = new ShareSessionCreated($sessionData['session']); - } - if (isset($sessionData['redirectUri'])) { - $this->redirectUri = $sessionData['redirectUri']; - } - } - - public function jsonSerialize(): object - { - return (object)[ - 'id' => $this->id, - 'expiry' => $this->expiry, - 'policy' => $this->policy, - 'extensions' => $this->extensions, - 'session' => $this->session, - 'redirectUri' => $this->redirectUri, - ]; - } - - /** - * @return string - */ - public function getId(): string - { - return $this->id; - } - - /** - * @return string - */ - public function getExpiry(): string - { - return $this->expiry; - } - - /** - * @return string - */ - public function getPolicy(): string - { - return $this->policy; - } - - /** - * @return Extension[] - */ - public function getExtensions(): array - { - return $this->extensions; - } - - /** - * @return ShareSessionCreated - */ - public function getSession(): ShareSessionCreated - { - return $this->session; - } - - /** - * @return string - */ - public function getRedirectUri(): string - { - return $this->redirectUri; - } -} diff --git a/src/Identity/ShareSessionNotification.php b/src/Identity/ShareSessionNotification.php deleted file mode 100644 index 5a6fc24f..00000000 --- a/src/Identity/ShareSessionNotification.php +++ /dev/null @@ -1,70 +0,0 @@ - - */ - private array $headers; - - /** - * @param string[] $headers - */ - public function __construct(string $url, string $method, bool $verifyTls, array $headers) - { - $this->url = $url; - $this->method = $method; - $this->verifyTls = $verifyTls; - $this->headers = $headers; - } - - public function jsonSerialize(): object - { - return (object)[ - 'url' => $this->getUrl(), - 'method' => $this->getMethod(), - 'verifyTls' => $this->isVerifyTls(), - 'headers' => $this->getHeaders(), - ]; - } - - /** - * @return string - */ - public function getUrl(): string - { - return $this->url; - } - - /** - * @return string - */ - public function getMethod(): string - { - return $this->method; - } - - /** - * @return bool - */ - public function isVerifyTls(): bool - { - return $this->verifyTls; - } - - /** - * @return string[] - */ - public function getHeaders(): array - { - return $this->headers; - } -} diff --git a/src/Identity/ShareSessionNotificationBuilder.php b/src/Identity/ShareSessionNotificationBuilder.php deleted file mode 100644 index 39d7aba3..00000000 --- a/src/Identity/ShareSessionNotificationBuilder.php +++ /dev/null @@ -1,65 +0,0 @@ - - */ - private array $headers; - - public function withUrl(string $url): self - { - $this->url = $url; - - return $this; - } - - public function withMethod(string $method = 'POST'): self - { - $this->method = $method; - - return $this; - } - - public function withVerifyTls(bool $verifyTls = true): self - { - $this->verifyTls = $verifyTls; - - return $this; - } - - /** - * @param string[] $headers - */ - public function withHeaders(array $headers): self - { - $this->headers = $headers; - - return $this; - } - - public function withHeader(string $key, string $header): self - { - $this->headers[$key] = $header; - - return $this; - } - - public function build(): ShareSessionNotification - { - return new ShareSessionNotification( - $this->url, - $this->method, - $this->verifyTls, - $this->headers - ); - } -} diff --git a/src/Identity/ShareSessionRequest.php b/src/Identity/ShareSessionRequest.php deleted file mode 100644 index 94e9cadb..00000000 --- a/src/Identity/ShareSessionRequest.php +++ /dev/null @@ -1,110 +0,0 @@ -|null - */ - private ?array $subject; - - private Policy $policy; - - /** - * @var Extension[]|null - */ - private ?array $extensions = null; - - private string $redirectUri; - - private ?ShareSessionNotification $notification; - - /** - * @param array|null $subject - * @param Policy $policy - * @param Extension[]|null $extensions - * @param string $redirectUri - * @param ShareSessionNotification|null $notification - */ - public function __construct( - Policy $policy, - string $redirectUri, - ?array $extensions = null, - ?array $subject = null, - ?ShareSessionNotification $notification = null - ) { - $this->policy = $policy; - $this->redirectUri = $redirectUri; - - if (null !== $extensions) { - Validation::isArrayOfType($extensions, [Extension::class], 'extensions'); - $this->extensions = $extensions; - } - - $this->subject = $subject; - $this->notification = $notification; - } - - /** - * @return array|null - */ - public function getSubject(): ?array - { - return $this->subject; - } - - /** - * @return Policy - */ - public function getPolicy(): Policy - { - return $this->policy; - } - - /** - * @return Extension[]|null - */ - public function getExtensions(): ?array - { - return $this->extensions; - } - - /** - * @return string - */ - public function getRedirectUri(): string - { - return $this->redirectUri; - } - - /** - * @return ShareSessionNotification|null - */ - public function getNotification(): ?ShareSessionNotification - { - return $this->notification; - } - - public function jsonSerialize(): \stdClass - { - $data = new \stdClass(); - $data->policy = $this->getPolicy(); - $data->redirectUri = $this->getRedirectUri(); - if (null !== $this->getSubject()) { - $data->subject = $this->getSubject(); - } - if (null !== $this->getExtensions()) { - $data->extensions = $this->getExtensions(); - } - if (null !== $this->getNotification()) { - $data->notification = $this->getNotification(); - } - - return $data; - } -} diff --git a/src/Identity/ShareSessionRequestBuilder.php b/src/Identity/ShareSessionRequestBuilder.php deleted file mode 100644 index 583d06fe..00000000 --- a/src/Identity/ShareSessionRequestBuilder.php +++ /dev/null @@ -1,84 +0,0 @@ - - */ - private ?array $subject = null; - - private Policy $policy; - - /** - * @var Extension[] - */ - private ?array $extensions = null; - - private string $redirectUri; - - private ?ShareSessionNotification $notification = null; - - /** - * @param array $subject - */ - public function withSubject(array $subject): self - { - $this->subject = $subject; - - return $this; - } - - public function withPolicy(Policy $policy): self - { - $this->policy = $policy; - - return $this; - } - - /** - * @param Extension[] $extensions - */ - public function withExtensions(array $extensions): self - { - $this->extensions = $extensions; - - return $this; - } - - public function withExtension(Extension $extension): self - { - $this->extensions[] = $extension; - - return $this; - } - - public function withRedirectUri(string $redirectUri): self - { - $this->redirectUri = $redirectUri; - - return $this; - } - - public function withNotification(ShareSessionNotification $notification): ShareSessionRequestBuilder - { - $this->notification = $notification; - - return $this; - } - - public function build(): ShareSessionRequest - { - return new ShareSessionRequest( - $this->policy, - $this->redirectUri, - $this->extensions, - $this->subject, - $this->notification - ); - } -} diff --git a/src/Util/Validation.php b/src/Util/Validation.php index c998db56..1bfbb82c 100644 --- a/src/Util/Validation.php +++ b/src/Util/Validation.php @@ -40,7 +40,7 @@ public static function isBoolean($value, $name): void */ public static function notNull($value, string $name): void { - if (null === $value) { + if (is_null($value)) { throw new \InvalidArgumentException("{$name} cannot be null"); } } diff --git a/src/YotiClient.php b/src/YotiClient.php index c706ca37..54caf6bc 100644 --- a/src/YotiClient.php +++ b/src/YotiClient.php @@ -8,11 +8,8 @@ use Yoti\Aml\Result as AmlResult; use Yoti\Aml\Service as AmlService; use Yoti\Exception\ActivityDetailsException; -use Yoti\Exception\IdentityException; use Yoti\Exception\PemFileException; use Yoti\Exception\ReceiptException; -use Yoti\Identity\IdentityService; -use Yoti\Identity\ShareSessionRequest; use Yoti\Profile\ActivityDetails; use Yoti\Profile\Service as ProfileService; use Yoti\ShareUrl\DynamicScenario; @@ -31,13 +28,20 @@ */ class YotiClient { - private AmlService $amlService; - - private ProfileService $profileService; + /** + * @var AmlService + */ + private $amlService; - private ShareUrlService $shareUrlService; + /** + * @var ProfileService + */ + private $profileService; - private IdentityService $identityService; + /** + * @var ShareUrlService + */ + private $shareUrlService; /** * YotiClient constructor. @@ -67,7 +71,6 @@ public function __construct( $this->profileService = new ProfileService($sdkId, $pemFile, $config); $this->amlService = new AmlService($sdkId, $pemFile, $config); $this->shareUrlService = new ShareUrlService($sdkId, $pemFile, $config); - $this->identityService = new IdentityService($sdkId, $pemFile, $config); } /** @@ -126,52 +129,4 @@ public function createShareUrl(DynamicScenario $dynamicScenario): ShareUrlResult { return $this->shareUrlService->createShareUrl($dynamicScenario); } - - /** - * Create a sharing session to initiate a sharing process based on a policy - * - * @throws IdentityException - * - * Aggregate exception signalling issues during the call - */ - public function createShareSession(ShareSessionRequest $request): Identity\ShareSessionCreated - { - return $this->identityService->createShareSession($request); - } - - /** - * Create a sharing session QR code to initiate a sharing process based on a policy - * - * @throws IdentityException - * - * Aggregate exception signalling issues during the call - */ - public function createShareQrCode(string $sessionId): Identity\ShareSessionCreatedQrCode - { - return $this->identityService->createShareQrCode($sessionId); - } - - /** - * Retrieve the sharing session QR code - * - * @throws IdentityException - * - * Aggregate exception signalling issues during the call - */ - public function fetchShareQrCode(string $qrCodeId): Identity\ShareSessionFetchedQrCode - { - return $this->identityService->fetchShareQrCode($qrCodeId); - } - - /** - * Retrieve the sharing session - * - * @throws IdentityException - * - * Aggregate exception signalling issues during the call - */ - public function fetchShareSession(string $sessionId): Identity\ShareSessionFetched - { - return $this->identityService->fetchShareSession($sessionId); - } } diff --git a/tests/Identity/Constraint/PreferredSourcesTest.php b/tests/Identity/Constraint/PreferredSourcesTest.php deleted file mode 100644 index 8b5b4ff1..00000000 --- a/tests/Identity/Constraint/PreferredSourcesTest.php +++ /dev/null @@ -1,42 +0,0 @@ - $wantedAnchors, - 'soft_preference' => true - ]; - - $this->assertInstanceOf(PreferredSources::class, $preferredSource); - $this->assertEquals(json_encode($expected), json_encode($preferredSource)); - $this->assertEquals($wantedAnchors, $preferredSource->getWantedAnchors()); - $this->assertTrue($preferredSource->isSoftPreference()); - } -} diff --git a/tests/Identity/Constraint/SourceConstraintsBuilderTest.php b/tests/Identity/Constraint/SourceConstraintsBuilderTest.php deleted file mode 100644 index ac6423c6..00000000 --- a/tests/Identity/Constraint/SourceConstraintsBuilderTest.php +++ /dev/null @@ -1,66 +0,0 @@ -withWantedAnchor(new WantedAnchor('SOME_VALUE')) - ->withSoftPreference(true) - ->build(); - - $this->assertInstanceOf(SourceConstraint::class, $sourceConstraint); - $this->assertInstanceOf(PreferredSources::class, $sourceConstraint->getPreferredSources()); - $this->assertEquals('SOURCE', $sourceConstraint->getType()); - } - - /** - * @covers ::build - * @covers ::withWantedAnchors - * @covers \Yoti\Identity\Constraint\SourceConstraint::__construct - * @covers \Yoti\Identity\Constraint\SourceConstraint::jsonSerialize - */ - public function testShouldBuildCorrectlyWithMultipleAnchors() - { - $wantedAnchors = [ - new WantedAnchor('some'), - new WantedAnchor('some_2'), - ]; - - $sourceConstraint = (new SourceConstraintBuilder()) - ->withWantedAnchors($wantedAnchors) - ->build(); - - $expectedConstraint = [ - 'type' => 'SOURCE', - 'preferred_sources' => $sourceConstraint->getPreferredSources() - ]; - - $this->assertEquals($wantedAnchors, $sourceConstraint->getPreferredSources()->getWantedAnchors()); - $this->assertEquals( - json_encode($wantedAnchors), - json_encode($sourceConstraint->getPreferredSources()->getWantedAnchors()) - ); - $this->assertEquals(json_encode($expectedConstraint), json_encode($sourceConstraint)); - } -} diff --git a/tests/Identity/Extension/BasicExtensionBuilderTest.php b/tests/Identity/Extension/BasicExtensionBuilderTest.php deleted file mode 100644 index 026a045f..00000000 --- a/tests/Identity/Extension/BasicExtensionBuilderTest.php +++ /dev/null @@ -1,40 +0,0 @@ -withType($someType) - ->withContent($someContent) - ->build(); - - $expectedJson = json_encode([ - 'type' => $someType, - 'content' => $someContent, - ]); - - $this->assertEquals($expectedJson, json_encode($constraints)); - } -} diff --git a/tests/Identity/Extension/LocationConstraintContentTest.php b/tests/Identity/Extension/LocationConstraintContentTest.php deleted file mode 100644 index a0973db1..00000000 --- a/tests/Identity/Extension/LocationConstraintContentTest.php +++ /dev/null @@ -1,44 +0,0 @@ - [ - 'latitude' => $expectedLatitude, - 'longitude' => $expectedLongitude, - 'radius' => $expectedRadius, - 'max_uncertainty_radius' => $expectedMaxUncertainty, - ], - ]); - - $this->assertEquals($expectedJson, json_encode($content)); - } -} diff --git a/tests/Identity/Extension/LocationConstraintExtensionBuilderTest.php b/tests/Identity/Extension/LocationConstraintExtensionBuilderTest.php deleted file mode 100644 index 875b8bb7..00000000 --- a/tests/Identity/Extension/LocationConstraintExtensionBuilderTest.php +++ /dev/null @@ -1,164 +0,0 @@ -expectException(\RangeException::class); - $this->expectExceptionMessage('\'latitude\' value \'-91\' is less than \'-90\''); - - (new LocationConstraintExtensionBuilder()) - ->withLatitude(-91) - ->withLongitude(0) - ->build(); - } - - /** - * @covers ::withLatitude - */ - public function testLatitudeTooHigh() - { - $this->expectException(\RangeException::class); - $this->expectExceptionMessage('\'latitude\' value \'91\' is greater than \'90\''); - - (new LocationConstraintExtensionBuilder()) - ->withLatitude(91) - ->withLongitude(0) - ->build(); - } - - /** - * @covers ::withLongitude - */ - public function testLongitudeTooLow() - { - $this->expectException(\RangeException::class); - $this->expectExceptionMessage('\'longitude\' value \'-181\' is less than \'-180\''); - - (new LocationConstraintExtensionBuilder()) - ->withLatitude(0) - ->withLongitude(-181) - ->build(); - } - - /** - * @covers ::withLongitude - */ - public function testLongitudeTooHigh() - { - $this->expectException(\RangeException::class); - $this->expectExceptionMessage('\'longitude\' value \'181\' is greater than \'180\''); - - (new LocationConstraintExtensionBuilder()) - ->withLatitude(0) - ->withLongitude(181) - ->build(); - } - - /** - * @covers ::withRadius - */ - public function testRadiusLessThanZero() - { - $this->expectException(\RangeException::class); - $this->expectExceptionMessage('\'radius\' value \'-1\' is less than \'0\''); - - (new LocationConstraintExtensionBuilder()) - ->withLatitude(0) - ->withLongitude(0) - ->withRadius(-1) - ->build(); - } - - /** - * @covers ::withMaxUncertainty - */ - public function testMaxUncertaintyLessThanZero() - { - $this->expectException(\RangeException::class); - $this->expectExceptionMessage('\'maxUncertainty\' value \'-1\' is less than \'0\''); - - (new LocationConstraintExtensionBuilder()) - ->withLatitude(0) - ->withLongitude(0) - ->withMaxUncertainty(-1) - ->build(); - } - - /** - * @covers ::build - */ - public function testBuild() - { - $expectedLatitude = 50.8169; - $expectedLongitude = -0.1367; - $expectedRadius = 30; - $expectedMaxUncertainty = 40; - - $extension = (new LocationConstraintExtensionBuilder()) - ->withLatitude($expectedLatitude) - ->withLongitude($expectedLongitude) - ->withRadius($expectedRadius) - ->withMaxUncertainty($expectedMaxUncertainty) - ->build(); - - $expectedJson = json_encode([ - 'type' => self::TYPE_LOCATION_CONSTRAINT, - 'content' => [ - 'expected_device_location' => [ - 'latitude' => $expectedLatitude, - 'longitude' => $expectedLongitude, - 'radius' => $expectedRadius, - 'max_uncertainty_radius' => $expectedMaxUncertainty, - ], - ], - ]); - - $this->assertEquals($expectedJson, json_encode($extension)); - } - - /** - * @covers ::build - */ - public function testBuildDefaultValues() - { - $expectedLatitude = 50.8169; - $expectedLongitude = -0.1367; - $expectedDefaultRadius = 150; - $expectedDefaultMaxUncertainty = 150; - - $extension = (new LocationConstraintExtensionBuilder()) - ->withLatitude($expectedLatitude) - ->withLongitude($expectedLongitude) - ->build(); - - $expectedJson = json_encode([ - 'type' => self::TYPE_LOCATION_CONSTRAINT, - 'content' => [ - 'expected_device_location' => [ - 'latitude' => $expectedLatitude, - 'longitude' => $expectedLongitude, - 'radius' => $expectedDefaultRadius, - 'max_uncertainty_radius' => $expectedDefaultMaxUncertainty, - ], - ], - ]); - - $this->assertEquals($expectedJson, json_encode($extension)); - } -} diff --git a/tests/Identity/Extension/ThirdPartyAttributeContentTest.php b/tests/Identity/Extension/ThirdPartyAttributeContentTest.php deleted file mode 100644 index 4fe6b729..00000000 --- a/tests/Identity/Extension/ThirdPartyAttributeContentTest.php +++ /dev/null @@ -1,42 +0,0 @@ - '2019-12-02T12:00:00.123+00:00', - 'definitions' => [ - [ - 'name' => $someDefinition, - ], - ], - ]); - - $this->assertEquals($expectedJson, json_encode($thirdPartyAttributeContent)); - } -} diff --git a/tests/Identity/Extension/ThirdPartyAttributeExtensionBuilderTest.php b/tests/Identity/Extension/ThirdPartyAttributeExtensionBuilderTest.php deleted file mode 100644 index 43252040..00000000 --- a/tests/Identity/Extension/ThirdPartyAttributeExtensionBuilderTest.php +++ /dev/null @@ -1,132 +0,0 @@ -someDate = new \DateTime(self::SOME_DATE_STRING); - } - - /** - * @covers ::withExpiryDate - * @covers ::withDefinition - * @covers ::build - */ - public function testBuild() - { - $thirdPartyAttributeExtension = (new ThirdPartyAttributeExtensionBuilder()) - ->withExpiryDate($this->someDate) - ->withDefinition(self::SOME_DEFINITION) - ->withDefinition(self::SOME_OTHER_DEFINITION) - ->build(); - - $expectedJson = $this->createExpectedJson( - $this->someDate->format(\DateTime::RFC3339_EXTENDED), - [ - self::SOME_DEFINITION, - self::SOME_OTHER_DEFINITION, - ] - ); - - $this->assertJsonStringEqualsJsonString( - $expectedJson, - json_encode($thirdPartyAttributeExtension) - ); - } - - /** - * @covers ::withDefinitions - */ - public function testWithDefinitionsOverwritesExistingDefinitions() - { - $thirdPartyAttributeExtension = (new ThirdPartyAttributeExtensionBuilder()) - ->withExpiryDate($this->someDate) - ->withDefinition('initial definition') - ->withDefinitions([ - self::SOME_DEFINITION, - self::SOME_OTHER_DEFINITION, - ]) - ->build(); - - $this->assertJsonStringEqualsJsonString( - $this->createExpectedJson( - $this->someDate->format(\DateTime::RFC3339_EXTENDED), - [ - self::SOME_DEFINITION, - self::SOME_OTHER_DEFINITION, - ] - ), - json_encode($thirdPartyAttributeExtension) - ); - } - - /** - * @covers ::withExpiryDate - * - * @dataProvider expiryDateDataProvider - */ - public function testWithExpiryDateFormat($inputDate, $outputDate) - { - $thirdPartyAttributeExtension = (new ThirdPartyAttributeExtensionBuilder()) - ->withExpiryDate(new \DateTime($inputDate)) - ->build(); - - $this->assertJsonStringEqualsJsonString( - $this->createExpectedJson($outputDate, []), - json_encode($thirdPartyAttributeExtension) - ); - } - - /** - * Provides test expiry dates. - */ - public function expiryDateDataProvider(): array - { - return [ - ['2020-01-02T01:02:03.123456Z', '2020-01-02T01:02:03.123+00:00'], - ['2020-01-01T01:02:03.123+04:00', '2019-12-31T21:02:03.123+00:00'], - ['2020-01-02T01:02:03.123-02:00', '2020-01-02T03:02:03.123+00:00'] - ]; - } - - /** - * Create expected third party extension JSON. - * - * @param string $expiryDate - * @param string[] $definitions - * - * @return string - */ - private function createExpectedJson(string $expiryDate, array $definitions): string - { - return json_encode([ - 'type' => self::THIRD_PARTY_ATTRIBUTE_TYPE, - 'content' => [ - 'expiry_date' => $expiryDate, - 'definitions' => array_map( - function ($definition) { - return [ 'name' => $definition ]; - }, - $definitions - ), - ], - ]); - } -} diff --git a/tests/Identity/Extension/TransactionalFlowExtensionBuilderTest.php b/tests/Identity/Extension/TransactionalFlowExtensionBuilderTest.php deleted file mode 100644 index 6ad50610..00000000 --- a/tests/Identity/Extension/TransactionalFlowExtensionBuilderTest.php +++ /dev/null @@ -1,36 +0,0 @@ - 'content']; - - $constraints = (new TransactionalFlowExtensionBuilder()) - ->withContent($someContent) - ->build(); - - $expectedJson = json_encode([ - 'type' => self::TYPE_TRANSACTIONAL_FLOW, - 'content' => $someContent, - ]); - - $this->assertEquals($expectedJson, json_encode($constraints)); - } -} diff --git a/tests/Identity/IdentityServiceTest.php b/tests/Identity/IdentityServiceTest.php deleted file mode 100644 index 98b3cc08..00000000 --- a/tests/Identity/IdentityServiceTest.php +++ /dev/null @@ -1,133 +0,0 @@ -extensionMock = $this->createMock(Extension::class); - $this->policyMock = $this->createMock(Policy::class); - } - - /** - * @covers ::createShareSession - * @covers ::__construct - */ - public function testShouldCreateShareSession() - { - $shareSessionRequest = (new ShareSessionRequestBuilder()) - ->withPolicy($this->policyMock) - ->withRedirectUri(self::URI) - ->withExtension($this->extensionMock) - ->build(); - - $response = $this->createMock(ResponseInterface::class); - $response->method('getBody')->willReturn(Psr7\Utils::streamFor(json_encode([ - 'id' => 'some_id', - 'status' => 'some_status', - 'expiry' => 'some_time', - ]))); - - $response->method('getStatusCode')->willReturn(201); - - $identityService = $this->createMock(IdentityService::class); - - $result = $identityService->createShareSession($shareSessionRequest); - - $this->assertInstanceOf(ShareSessionCreated::class, $result); - } - - /** - * @covers ::createShareQrCode - * @covers ::__construct - */ - public function testShouldCreateShareQrCode() - { - $response = $this->createMock(ResponseInterface::class); - $response->method('getBody')->willReturn(Psr7\Utils::streamFor(json_encode([ - 'id' => 'some_id', - 'uri' => 'some_uri', - ]))); - - $response->method('getStatusCode')->willReturn(201); - - $identityService = $this->createMock(IdentityService::class); - - $result = $identityService->createShareQrCode(TestData::SOME_ID); - - $this->assertInstanceOf(ShareSessionCreatedQrCode::class, $result); - } - - /** - * @covers ::fetchShareQrCode - * @covers ::__construct - */ - public function testShouldFetchShareQrCode() - { - $response = $this->createMock(ResponseInterface::class); - $response->method('getBody')->willReturn(Psr7\Utils::streamFor(json_encode([ - 'id' => 'id', - 'expiry' => 'expiry', - 'policy' => 'policy', - 'extensions' => [['type' => 'type', 'content' => 'content']], - 'session' => ['id' => 'id', 'status' => 'status', 'expiry' => 'expiry'], - 'redirectUri' => 'redirectUri', - ]))); - - $response->method('getStatusCode')->willReturn(201); - - $identityService = $this->createMock(IdentityService::class); - - $result = $identityService->fetchShareQrCode(TestData::SOME_ID); - - $this->assertInstanceOf(ShareSessionFetchedQrCode::class, $result); - } - - /** - * @covers ::fetchShareSession - * @covers ::__construct - */ - public function testShouldFetchShareSession() - { - $response = $this->createMock(ResponseInterface::class); - $response->method('getBody')->willReturn(Psr7\Utils::streamFor(json_encode([ - 'id' => 'SOME_ID', - 'status' => 'SOME_STATUS', - 'expiry' => 'SOME_EXPIRY', - 'created' => 'SOME_CREATED', - 'updated' => 'SOME_UPDATED', - 'qrCode' => ['id' => 'SOME_QRCODE_ID'], - 'receipt' => ['id' => 'SOME_RECEIPT_ID'], - ]))); - - $response->method('getStatusCode')->willReturn(201); - - $identityService = $this->createMock(IdentityService::class); - - $result = $identityService->fetchShareSession(TestData::SOME_ID); - - $this->assertInstanceOf(ShareSessionFetched::class, $result); - } -} diff --git a/tests/Identity/Policy/PolicyBuilderTest.php b/tests/Identity/Policy/PolicyBuilderTest.php deleted file mode 100644 index d223bd79..00000000 --- a/tests/Identity/Policy/PolicyBuilderTest.php +++ /dev/null @@ -1,644 +0,0 @@ -withFamilyName() - ->withGivenNames() - ->withFullName() - ->withDateOfBirth() - ->withGender() - ->withPostalAddress() - ->withStructuredPostalAddress() - ->withNationality() - ->withPhoneNumber() - ->withSelfie() - ->withEmail() - ->withDocumentDetails() - ->withDocumentImages() - ->build(); - - $expectedWantedAttributeData = [ - 'wanted' => [ - ['name' => 'family_name', 'optional' => false], - ['name' => 'given_names', 'optional' => false], - ['name' => 'full_name', 'optional' => false], - ['name' => 'date_of_birth', 'optional' => false], - ['name' => 'gender', 'optional' => false], - ['name' => 'postal_address', 'optional' => false], - ['name' => 'structured_postal_address', 'optional' => false], - ['name' => 'nationality', 'optional' => false], - ['name' => 'phone_number', 'optional' => false], - ['name' => 'selfie', 'optional' => false], - ['name' => 'email_address', 'optional' => false], - ['name' => 'document_details', 'optional' => false], - ['name' => 'document_images', 'optional' => false], - ], - 'wanted_auth_types' => [], - 'wanted_remember_me' => false, - 'wanted_remember_me_optional' => false, - 'identity_profile_requirements' => null, - ]; - - $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); - } - - /** - * @covers ::withWantedAttributeByName - */ - public function testWithWantedAttributeByNameWithConstraints() - { - $someAttributeName = 'some_attribute_name'; - $sourceConstraint = (new SourceConstraintBuilder()) - ->withWantedAnchor(new WantedAnchor('SOME')) - ->build(); - - $constraints = [ - $sourceConstraint, - ]; - - $policy = (new PolicyBuilder()) - ->withWantedAttributeByName($someAttributeName, $constraints, true) - ->build(); - - $expectedWantedAttributeData = [ - 'wanted' => [ - [ - 'name' => $someAttributeName, - 'optional' => false, - "constraints" => [ - [ - "type" => "SOURCE", - "preferred_sources" => [ - "anchors" => [ - [ - "name" => "SOME", - "sub_type" => "", - ] - ], - "soft_preference" => false, - ], - ], - ], - "accept_self_asserted" => true, - ], - ], - 'wanted_auth_types' => [], - 'wanted_remember_me' => false, - 'wanted_remember_me_optional' => false, - 'identity_profile_requirements' => null, - ]; - - $this->assertJsonStringEqualsJsonString( - json_encode($expectedWantedAttributeData), - json_encode($policy) - ); - } - - /** - * @covers ::withWantedAttribute - * @covers ::withFamilyName - */ - public function testWithDuplicateAttribute() - { - $policy = (new PolicyBuilder()) - ->withFamilyName() - ->withFamilyName() - ->build(); - - $expectedWantedAttributeData = [ - 'wanted' => [ - ['name' => 'family_name', 'optional' => false], - ], - 'wanted_auth_types' => [], - 'wanted_remember_me' => false, - 'wanted_remember_me_optional' => false, - 'identity_profile_requirements' => null, - ]; - - $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); - } - - /** - * @covers ::withWantedAttribute - * @covers ::withFamilyName - */ - public function testWithDuplicateAttributeDifferentConstraints() - { - $sourceConstraint = (new SourceConstraintBuilder()) - ->withWantedAnchor(new WantedAnchor('SOME')) - ->build(); - - $sourceConstraint2 = (new SourceConstraintBuilder()) - ->withWantedAnchor(new WantedAnchor('SOME_2')) - ->build(); - - - $policy = (new PolicyBuilder()) - ->withFamilyName() - ->withFamilyName([$sourceConstraint]) - ->withFamilyName([$sourceConstraint2]) - ->build(); - - $jsonData = $policy->jsonSerialize(); - - $this->assertCount(3, $jsonData->wanted); - foreach ($jsonData->wanted as $wantedAttribute) { - $this->assertEquals('family_name', $wantedAttribute->getName()); - } - } - - /** - * @covers ::build - * @covers ::withWantedAttributeByName - */ - public function testWithWantedAttributeByName() - { - $policy = (new PolicyBuilder()) - ->withWantedAttributeByName('family_name') - ->withWantedAttributeByName('given_names') - ->build(); - - $expectedWantedAttributeData = [ - 'wanted' => [ - ['name' => 'family_name', 'optional' => false], - ['name' => 'given_names', 'optional' => false], - ], - 'wanted_auth_types' => [], - 'wanted_remember_me' => false, - 'wanted_remember_me_optional' => false, - 'identity_profile_requirements' => null, - ]; - - $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); - } - - /** - * @covers ::build - * @covers ::withWantedAttribute - */ - public function testWithAttributeObjects() - { - $wantedFamilyName = (new WantedAttributeBuilder()) - ->withName('family_name') - ->build(); - - $wantedGivenNames = (new WantedAttributeBuilder()) - ->withName('given_names') - ->build(); - - $policy = (new PolicyBuilder()) - ->withWantedAttribute($wantedFamilyName) - ->withWantedAttribute($wantedGivenNames) - ->build(); - - $expectedWantedAttributeData = [ - 'wanted' => [ - ['name' => 'family_name', 'optional' => false], - ['name' => 'given_names', 'optional' => false], - ], - 'wanted_auth_types' => [], - 'wanted_remember_me' => false, - 'wanted_remember_me_optional' => false, - 'identity_profile_requirements' => null, - ]; - - $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); - } - - /** - * @covers ::withDateOfBirth - * @covers ::withAgeOver - * @covers ::withAgeUnder - * @covers ::withAgeDerivedAttribute - */ - public function testWithAgeDerivedAttributes() - { - $policy = (new PolicyBuilder()) - ->withDateOfBirth() - ->withAgeOver(18) - ->withAgeUnder(30) - ->withAgeUnder(40) - ->build(); - - $expectedWantedAttributeData = [ - 'wanted' => [ - ['name' => 'date_of_birth', 'optional' => false], - ['name' => 'date_of_birth', 'optional' => false, 'derivation' => 'age_over:18'], - ['name' => 'date_of_birth', 'optional' => false, 'derivation' => 'age_under:30'], - ['name' => 'date_of_birth', 'optional' => false, 'derivation' => 'age_under:40'], - ], - 'wanted_auth_types' => [], - 'wanted_remember_me' => false, - 'wanted_remember_me_optional' => false, - 'identity_profile_requirements' => null, - ]; - - $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); - } - - /** - * @covers ::withAgeDerivedAttribute - */ - public function testWithAgeDerivedAttributesWithConstraints() - { - $sourceConstraint = (new SourceConstraintBuilder()) - ->withWantedAnchor(new WantedAnchor('SOME')) - ->build(); - - - $policy = (new PolicyBuilder()) - ->withAgeDerivedAttribute(UserProfile::AGE_OVER . '18', [$sourceConstraint]) - ->build(); - - $expectedWantedAttributeData = [ - 'wanted' => [ - [ - 'name' => 'date_of_birth', - 'optional' => false, - 'derivation' => 'age_over:18', - "constraints" => [ - [ - "type" => "SOURCE", - "preferred_sources" => [ - "anchors" => [ - [ - "name" => "SOME", - "sub_type" => "", - ] - ], - "soft_preference" => false, - ], - ], - ], - ], - ], - 'wanted_auth_types' => [], - 'wanted_remember_me' => false, - 'wanted_remember_me_optional' => false, - 'identity_profile_requirements' => null, - ]; - - $this->assertJsonStringEqualsJsonString( - json_encode($expectedWantedAttributeData), - json_encode($policy) - ); - } - - - /** - * @covers ::withAgeUnder - * @covers ::withAgeDerivedAttribute - * @covers ::withWantedAttribute - */ - public function testWithDuplicateAgeDerivedAttributes() - { - $policy = (new PolicyBuilder()) - ->withAgeUnder(30) - ->withAgeUnder(30) - ->build(); - - $expectedWantedAttributeData = [ - 'wanted' => [ - ['name' => 'date_of_birth', 'optional' => false, 'derivation' => 'age_under:30'], - ], - 'wanted_auth_types' => [], - 'wanted_remember_me' => false, - 'wanted_remember_me_optional' => false, - 'identity_profile_requirements' => null, - ]; - - $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); - } - - /** - * @covers ::withSelfieAuthentication - * @covers ::withPinAuthentication - * @covers ::withWantedAuthType - */ - public function testWithAuthTypes() - { - $policy = (new PolicyBuilder()) - ->withSelfieAuthentication() - ->withPinAuthentication() - ->withWantedAuthType(99) - ->build(); - - $expectedWantedAttributeData = [ - 'wanted' => [], - 'wanted_auth_types' => [self::SELFIE_AUTH_TYPE, self::PIN_AUTH_TYPE, 99], - 'wanted_remember_me' => false, - 'wanted_remember_me_optional' => false, - 'identity_profile_requirements' => null, - ]; - - $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); - } - - /** - * @covers ::withSelfieAuthentication - * @covers ::withPinAuthentication - * @covers ::withWantedAuthType - */ - public function testWithAuthTypesTrue() - { - $policy = (new PolicyBuilder()) - ->withSelfieAuthentication() - ->withPinAuthentication() - ->withWantedAuthType(99) - ->build(); - - $expectedWantedAttributeData = [ - 'wanted' => [], - 'wanted_auth_types' => [self::SELFIE_AUTH_TYPE, self::PIN_AUTH_TYPE, 99], - 'wanted_remember_me' => false, - 'wanted_remember_me_optional' => false, - 'identity_profile_requirements' => null - ]; - - $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); - } - - /** - * @covers ::withSelfieAuthentication - * @covers ::withPinAuthentication - * @covers ::withWantedAuthType - */ - public function testWithAuthTypesFalse() - { - $policy = (new PolicyBuilder()) - ->withSelfieAuthentication(false) - ->withPinAuthentication(false) - ->withWantedAuthType(99, false) - ->build(); - - $expectedWantedAttributeData = [ - 'wanted' => [], - 'wanted_auth_types' => [], - 'wanted_remember_me' => false, - 'wanted_remember_me_optional' => false, - 'identity_profile_requirements' => null, - ]; - - $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); - } - - /** - * @covers ::withSelfieAuthentication - * @covers ::withPinAuthentication - */ - public function testWithAuthEnabledThenDisabled() - { - $policy = (new PolicyBuilder()) - ->withSelfieAuthentication() - ->withSelfieAuthentication(false) - ->withPinAuthentication() - ->withPinAuthentication(false) - ->build(); - - $expectedWantedAttributeData = [ - 'wanted' => [], - 'wanted_auth_types' => [], - 'wanted_remember_me' => false, - 'wanted_remember_me_optional' => false, - 'identity_profile_requirements' => null, - ]; - - $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); - } - - /** - * @covers ::withSelfieAuthentication - */ - public function testWithSameAuthTypeAddedOnlyOnce() - { - $policy = (new PolicyBuilder()) - ->withSelfieAuthentication() - ->withSelfieAuthentication() - ->withSelfieAuthentication() - ->build(); - - $expectedWantedAttributeData = [ - 'wanted' => [], - 'wanted_auth_types' => [self::SELFIE_AUTH_TYPE], - 'wanted_remember_me' => false, - 'wanted_remember_me_optional' => false, - 'identity_profile_requirements' => null, - ]; - - $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); - } - - /** - * @covers ::withSelfieAuthentication - */ - public function testWithOnlyTwoAuthTypes() - { - $policy = (new PolicyBuilder()) - ->withSelfieAuthentication() - ->withPinAuthentication() - ->build(); - - $expectedWantedAttributeData = [ - 'wanted' => [], - 'wanted_auth_types' => [self::SELFIE_AUTH_TYPE, self::PIN_AUTH_TYPE], - 'wanted_remember_me' => false, - 'wanted_remember_me_optional' => false, - 'identity_profile_requirements' => null, - ]; - - $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); - } - - /** - * @covers ::withSelfieAuthentication - */ - public function testWithNoSelfieAuthAfterRemoval() - { - $policy = (new PolicyBuilder()) - ->withSelfieAuthentication() - ->withSelfieAuthentication(false) - ->build(); - - $expectedWantedAttributeData = [ - 'wanted' => [], - 'wanted_auth_types' => [], - 'wanted_remember_me' => false, - 'wanted_remember_me_optional' => false, - 'identity_profile_requirements' => null, - ]; - - $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); - } - - /** - * @covers ::withSelfieAuthentication - */ - public function testWithNoPinAuthAfterRemoval() - { - $policy = (new PolicyBuilder()) - ->withPinAuthentication() - ->withPinAuthentication(false) - ->build(); - - $expectedWantedAttributeData = [ - 'wanted' => [], - 'wanted_auth_types' => [], - 'wanted_remember_me' => false, - 'wanted_remember_me_optional' => false, - 'identity_profile_requirements' => null, - ]; - - $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); - } - - - /** - * @covers ::withWantedRememberMe - */ - public function testWithRememberMe() - { - $policy = (new PolicyBuilder()) - ->withWantedRememberMe(true) - ->build(); - - $expectedWantedAttributeData = [ - 'wanted' => [], - 'wanted_auth_types' => [], - 'wanted_remember_me' => true, - 'wanted_remember_me_optional' => false, - 'identity_profile_requirements' => null, - ]; - - $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); - } - - /** - * @covers ::withWantedRememberMe - */ - public function testWithoutRememberMe() - { - $policy = (new PolicyBuilder()) - ->withWantedRememberMe(false) - ->build(); - - $expectedWantedAttributeData = [ - 'wanted' => [], - 'wanted_auth_types' => [], - 'wanted_remember_me' => false, - 'wanted_remember_me_optional' => false, - 'identity_profile_requirements' => null - ]; - - $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); - } - - /** - * @covers ::withWantedRememberMeOptional - */ - public function testWithRememberMeOptional() - { - $policy = (new PolicyBuilder()) - ->withWantedRememberMeOptional(true) - ->build(); - - $expectedWantedAttributeData = [ - 'wanted' => [], - 'wanted_auth_types' => [], - 'wanted_remember_me' => false, - 'wanted_remember_me_optional' => true, - 'identity_profile_requirements' => null, - ]; - - $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); - } - - /** - * @covers ::withWantedRememberMeOptional - */ - public function testWithoutRememberMeOptional() - { - $policy = (new PolicyBuilder()) - ->withWantedRememberMeOptional(false) - ->build(); - - $expectedWantedAttributeData = [ - 'wanted' => [], - 'wanted_auth_types' => [], - 'wanted_remember_me' => false, - 'wanted_remember_me_optional' => false, - 'identity_profile_requirements' => null - ]; - - $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); - } - - /** - * @covers ::withIdentityProfileRequirements - * @covers \Yoti\Identity\Policy\Policy::__construct - * @covers \Yoti\Identity\Policy\Policy::getIdentityProfileRequirements - * @covers \Yoti\Identity\Policy\Policy::jsonSerialize - */ - public function testWithIdentityProfileRequirements() - { - $identityProfileSample = (object)[ - 'trust_framework' => 'UK_TFIDA', - 'scheme' => [ - 'type' => 'DBS', - 'objective' => 'STANDARD' - ] - ]; - - $expectedWantedAttributeData = [ - 'wanted' => [], - 'wanted_auth_types' => [], - 'wanted_remember_me' => false, - 'wanted_remember_me_optional' => false, - 'identity_profile_requirements' => $identityProfileSample - ]; - - $policy = (new PolicyBuilder()) - ->withIdentityProfileRequirements($identityProfileSample) - ->build(); - - $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); - $this->assertEquals($identityProfileSample, $policy->getIdentityProfileRequirements()); - } -} diff --git a/tests/Identity/Policy/WantedAnchorBuilderTest.php b/tests/Identity/Policy/WantedAnchorBuilderTest.php deleted file mode 100644 index 2d0479e0..00000000 --- a/tests/Identity/Policy/WantedAnchorBuilderTest.php +++ /dev/null @@ -1,39 +0,0 @@ -withValue($someName) - ->withSubType($someSubType) - ->build(); - - $expectedJsonData = [ - 'name' => $someName, - 'sub_type' => $someSubType, - ]; - - $this->assertEquals(json_encode($expectedJsonData), json_encode($wantedAnchor)); - } -} diff --git a/tests/Identity/Policy/WantedAttributeBuilderTest.php b/tests/Identity/Policy/WantedAttributeBuilderTest.php deleted file mode 100644 index 7cd8a8f1..00000000 --- a/tests/Identity/Policy/WantedAttributeBuilderTest.php +++ /dev/null @@ -1,162 +0,0 @@ -withWantedAnchor(new WantedAnchor('SOME')) - ->build(); - - $wantedAttribute = (new WantedAttributeBuilder()) - ->withName($someName) - ->withDerivation($someDerivation) - ->withOptional(true) - ->withConstraint($sourceConstraint) - ->withAcceptSelfAsserted(false) - ->build(); - - $expectedJsonData = [ - 'name' => $someName, - 'optional' => true, - 'derivation' => $someDerivation, - 'constraints' => [$sourceConstraint], - 'accept_self_asserted' => false, - ]; - - $this->assertEquals(json_encode($expectedJsonData), json_encode($wantedAttribute)); - $this->assertTrue($wantedAttribute->getOptional()); - $this->assertContains($sourceConstraint, $wantedAttribute->getConstraints()); - $this->assertFalse($wantedAttribute->getAcceptSelfAsserted()); - } - - /** - * @covers ::build - * @covers ::withName - */ - public function testEmptyName() - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('name cannot be empty'); - - (new WantedAttributeBuilder()) - ->withName('') - ->build(); - } - - /** - * @covers ::withAcceptSelfAsserted - * @covers \Yoti\ShareUrl\Policy\WantedAttribute::__construct - * @covers \Yoti\ShareUrl\Policy\WantedAttribute::jsonSerialize - * @covers \Yoti\ShareUrl\Policy\WantedAttribute::getAcceptSelfAsserted - */ - public function testAcceptSelfAsserted() - { - $someName = 'some name'; - - $expectedJsonData = [ - 'name' => $someName, - 'optional' => false, - 'accept_self_asserted' => true, - ]; - - $wantedAttributeDefault = (new WantedAttributeBuilder()) - ->withName($someName) - ->withAcceptSelfAsserted(true) - ->build(); - - $this->assertEquals(json_encode($expectedJsonData), json_encode($wantedAttributeDefault)); - - $wantedAttribute = (new WantedAttributeBuilder()) - ->withName($someName) - ->withAcceptSelfAsserted(true) - ->build(); - - $this->assertEquals(json_encode($expectedJsonData), json_encode($wantedAttribute)); - } - - /** - * @covers ::withAcceptSelfAsserted - * @covers \Yoti\ShareUrl\Policy\WantedAttribute::__construct - * @covers \Yoti\ShareUrl\Policy\WantedAttribute::jsonSerialize - * @covers \Yoti\ShareUrl\Policy\WantedAttribute::getAcceptSelfAsserted - */ - public function testWithoutAcceptSelfAsserted() - { - $someName = 'some name'; - - $expectedJsonData = [ - 'name' => $someName, - 'optional' => false, - 'accept_self_asserted' => false, - ]; - - $wantedAttribute = (new WantedAttributeBuilder()) - ->withName($someName) - ->withAcceptSelfAsserted(false) - ->build(); - - $this->assertEquals(json_encode($expectedJsonData), json_encode($wantedAttribute)); - } - - /** - * @covers ::withAcceptSelfAsserted - * @covers ::withConstraints - * @covers \Yoti\ShareUrl\Policy\WantedAttribute::__construct - * @covers \Yoti\ShareUrl\Policy\WantedAttribute::jsonSerialize - * @covers \Yoti\ShareUrl\Policy\WantedAttribute::getAcceptSelfAsserted - */ - public function testWithMultipleConstraints() - { - $sourceConstraint = (new SourceConstraintBuilder()) - ->withWantedAnchor(new WantedAnchor('SOME')) - ->build(); - - $sourceConstraint2 = (new SourceConstraintBuilder()) - ->withWantedAnchor(new WantedAnchor('SOME_2')) - ->build(); - - - $constraints = [ - $sourceConstraint, - $sourceConstraint2 - ]; - - $wantedAttribute = (new WantedAttributeBuilder()) - ->withName('someName') - ->withAcceptSelfAsserted(false) - ->withConstraints($constraints) - ->build(); - - $this->assertEquals($constraints, $wantedAttribute->getConstraints()); - } -} diff --git a/tests/Identity/ShareSessionCreatedQrCodeTest.php b/tests/Identity/ShareSessionCreatedQrCodeTest.php deleted file mode 100644 index c0fc50ba..00000000 --- a/tests/Identity/ShareSessionCreatedQrCodeTest.php +++ /dev/null @@ -1,42 +0,0 @@ - self::SOME_ID, - 'uri' => self::SOME_URI, - 'failed' => 'failed' - ]); - - $expected = [ - 'id' => self::SOME_ID, - 'uri' => self::SOME_URI, - ]; - - $this->assertInstanceOf(ShareSessionCreatedQrCode::class, $qrCode); - - $this->assertEquals(self::SOME_ID, $qrCode->getId()); - $this->assertEquals(self::SOME_URI, $qrCode->getUri()); - - $this->assertEquals(json_encode($expected), json_encode($qrCode)); - } -} diff --git a/tests/Identity/ShareSessionCreatedTest.php b/tests/Identity/ShareSessionCreatedTest.php deleted file mode 100644 index 380be268..00000000 --- a/tests/Identity/ShareSessionCreatedTest.php +++ /dev/null @@ -1,45 +0,0 @@ - self::SOME_ID, - 'status' => self::SOME_STATUS, - 'expiry' => self::SOME_EXPIRY, - 'failed' => 'SQL injection' - ]); - - $expected = [ - 'id' => self::SOME_ID, - 'status' => self::SOME_STATUS, - 'expiry' => self::SOME_EXPIRY, - ]; - - $this->assertInstanceOf(ShareSessionCreated::class, $shareSession); - $this->assertEquals(self::SOME_ID, $shareSession->getId()); - $this->assertEquals(self::SOME_STATUS, $shareSession->getStatus()); - $this->assertEquals(self::SOME_EXPIRY, $shareSession->getExpiry()); - $this->assertEquals(json_encode($expected), json_encode($shareSession)); - } -} diff --git a/tests/Identity/ShareSessionFetchedQrCodeTest.php b/tests/Identity/ShareSessionFetchedQrCodeTest.php deleted file mode 100644 index 3be47c69..00000000 --- a/tests/Identity/ShareSessionFetchedQrCodeTest.php +++ /dev/null @@ -1,76 +0,0 @@ - 'some', 'content' => 'content'], - ['type' => 'some2', 'content' => 'content2'], - ]; - - $shareSession = [ - 'id' => 'some', - 'status' => 'status', - 'expiry' => 'expiry', - ]; - - $qrCode = new ShareSessionFetchedQrCode([ - 'id' => self::SOME_ID, - 'expiry' => self::SOME_EXPIRY, - 'policy' => self::SOME_POLICY, - 'extensions' => $extensions, - 'session' => $shareSession, - 'redirectUri' => self::SOME_REDIRECT_URI, - ]); - - $expected = [ - 'id' => self::SOME_ID, - 'expiry' => self::SOME_EXPIRY, - 'policy' => self::SOME_POLICY, - 'extensions' => $extensions, - 'session' => $shareSession, - 'redirectUri' => self::SOME_REDIRECT_URI, - ]; - - $this->assertInstanceOf(ShareSessionFetchedQrCode::class, $qrCode); - - $this->assertEquals(self::SOME_ID, $qrCode->getId()); - $this->assertEquals(self::SOME_EXPIRY, $qrCode->getExpiry()); - $this->assertEquals(self::SOME_POLICY, $qrCode->getPolicy()); - $this->assertEquals(self::SOME_REDIRECT_URI, $qrCode->getRedirectUri()); - - $this->assertInstanceOf(ShareSessionCreated::class, $qrCode->getSession()); - - $this->assertContainsOnlyInstancesOf(Extension::class, $qrCode->getExtensions()); - - $this->assertEquals(self::SOME_REDIRECT_URI, $qrCode->getRedirectUri()); - - $this->assertEquals(json_encode($expected), json_encode($qrCode)); - } -} diff --git a/tests/Identity/ShareSessionFetchedTest.php b/tests/Identity/ShareSessionFetchedTest.php deleted file mode 100644 index cc38224d..00000000 --- a/tests/Identity/ShareSessionFetchedTest.php +++ /dev/null @@ -1,66 +0,0 @@ - self::SOME_ID, - 'status' => self::SOME_STATUS, - 'expiry' => self::SOME_EXPIRY, - 'created' => self::SOME_CREATED, - 'updated' => self::SOME_UPDATED, - 'failed' => 'SQL injection', - 'qrCode' => ['id' => self::SOME_QRCODE_ID], - 'receipt' => ['id' => self::SOME_RECEIPT_ID], - ]); - - $expected = [ - 'id' => self::SOME_ID, - 'status' => self::SOME_STATUS, - 'expiry' => self::SOME_EXPIRY, - 'created' => self::SOME_CREATED, - 'updated' => self::SOME_UPDATED, - 'qrCodeId' => self::SOME_QRCODE_ID, - 'receiptId' => self::SOME_RECEIPT_ID, - ]; - - $this->assertInstanceOf(ShareSessionFetched::class, $shareSession); - $this->assertEquals(self::SOME_ID, $shareSession->getId()); - $this->assertEquals(self::SOME_STATUS, $shareSession->getStatus()); - $this->assertEquals(self::SOME_EXPIRY, $shareSession->getExpiry()); - $this->assertEquals(self::SOME_CREATED, $shareSession->getCreated()); - $this->assertEquals(self::SOME_UPDATED, $shareSession->getUpdated()); - $this->assertEquals(self::SOME_QRCODE_ID, $shareSession->getQrCodeId()); - $this->assertEquals(self::SOME_RECEIPT_ID, $shareSession->getReceiptId()); - $this->assertEquals(json_encode($expected), json_encode($shareSession)); - } -} diff --git a/tests/Identity/ShareSessionNotificationBuilderTest.php b/tests/Identity/ShareSessionNotificationBuilderTest.php deleted file mode 100644 index ffee1e5e..00000000 --- a/tests/Identity/ShareSessionNotificationBuilderTest.php +++ /dev/null @@ -1,80 +0,0 @@ - 'auth', 'header_3' => 'auth_3']; - - /** - * @covers ::withUrl - * @covers ::withMethod - * @covers ::withHeader - * @covers ::withVerifyTls - * @covers ::build - * @covers \Yoti\Identity\ShareSessionNotification::getUrl - * @covers \Yoti\Identity\ShareSessionNotification::getHeaders - * @covers \Yoti\Identity\ShareSessionNotification::getMethod - * @covers \Yoti\Identity\ShareSessionNotification::getUrl - * @covers \Yoti\Identity\ShareSessionNotification::__construct - */ - public function testShouldBuildCorrectly() - { - $shareNotification = (new ShareSessionNotificationBuilder()) - ->withMethod() - ->withUrl(self::URL) - ->withHeader(self::HEADER_KEY, self::HEADER_VALUE) - ->withVerifyTls() - ->build(); - - $this->assertInstanceOf(ShareSessionNotification::class, $shareNotification); - - $this->assertEquals(self::URL, $shareNotification->getUrl()); - $this->assertEquals([self::HEADER_KEY => self::HEADER_VALUE], $shareNotification->getHeaders()); - $this->assertEquals('POST', $shareNotification->getMethod()); - } - - /** - * @covers ::withUrl - * @covers ::withMethod - * @covers ::withHeaders - * @covers ::withVerifyTls - * @covers ::build - * @covers \Yoti\Identity\ShareSessionNotification::getHeaders - * @covers \Yoti\Identity\ShareSessionNotification::isVerifyTls - * @covers \Yoti\Identity\ShareSessionNotification::jsonSerialize - * @covers \Yoti\Identity\ShareSessionNotification::__construct - */ - public function testShouldBuildCorrectlyWithMultipleHeaders() - { - $shareNotification = (new ShareSessionNotificationBuilder()) - ->withMethod() - ->withUrl(self::URL) - ->withHeaders(self::HEADERS) - ->withVerifyTls(false) - ->build(); - - $expected = [ - 'url' => self::URL, - 'method' => 'POST', - 'verifyTls' => false, - 'headers' => self::HEADERS, - ]; - - $this->assertEquals(self::HEADERS, $shareNotification->getHeaders()); - $this->assertFalse($shareNotification->isVerifyTls()); - $this->assertEquals(json_encode($expected), json_encode($shareNotification)); - } -} diff --git a/tests/Identity/ShareSessionRequestBuilderTest.php b/tests/Identity/ShareSessionRequestBuilderTest.php deleted file mode 100644 index 4be3a1ef..00000000 --- a/tests/Identity/ShareSessionRequestBuilderTest.php +++ /dev/null @@ -1,100 +0,0 @@ -extensionMock = $this->createMock(Extension::class); - $this->policyMock = $this->createMock(Policy::class); - } - - /** - * @covers ::withRedirectUri - * @covers ::withPolicy - * @covers ::withExtension - * @covers ::withNotification - * @covers ::withSubject - * @covers ::build - * @covers \Yoti\Identity\ShareSessionRequest::getPolicy - * @covers \Yoti\Identity\ShareSessionRequest::getNotification - * @covers \Yoti\Identity\ShareSessionRequest::getExtensions - * @covers \Yoti\Identity\ShareSessionRequest::getSubject - * @covers \Yoti\Identity\ShareSessionRequest::__construct - */ - public function testShouldBuildCorrectly() - { - $subject = [ - 'key' => (object)['some' => 'good'] - ]; - - $shareNotification = (new ShareSessionNotificationBuilder()) - ->withMethod() - ->withUrl('some') - ->withHeader('some', 'some') - ->withVerifyTls() - ->build(); - - $shareRequest = (new ShareSessionRequestBuilder()) - ->withSubject($subject) - ->withNotification($shareNotification) - ->withPolicy($this->policyMock) - ->withRedirectUri(self::URI) - ->withExtension($this->extensionMock) - ->build(); - - $this->assertInstanceOf(ShareSessionRequest::class, $shareRequest); - - $this->assertEquals($subject, $shareRequest->getSubject()); - $this->assertEquals([$this->extensionMock], $shareRequest->getExtensions()); - $this->assertEquals($this->policyMock, $shareRequest->getPolicy()); - $this->assertEquals($shareNotification, $shareRequest->getNotification()); - $this->assertEquals(self::URI, $shareRequest->getRedirectUri()); - } - - /** - * @covers ::withRedirectUri - * @covers ::withPolicy - * @covers ::withExtensions - * @covers ::withNotification - * @covers ::withSubject - * @covers ::build - * @covers \Yoti\Identity\ShareSessionRequest::getExtensions - * @covers \Yoti\Identity\ShareSessionRequest::__construct - * @covers \Yoti\Identity\ShareSessionRequest::jsonSerialize - */ - public function testShouldBuildCorrectlyWithMultipleExtensions() - { - $shareRequest = (new ShareSessionRequestBuilder()) - ->withPolicy($this->policyMock) - ->withRedirectUri(self::URI) - ->withExtensions([$this->extensionMock]) - ->build(); - - - $expected = [ - 'policy' => $this->policyMock, - 'redirectUri' => self::URI, - 'extensions' => [$this->extensionMock], - ]; - - $this->assertEquals([$this->extensionMock], $shareRequest->getExtensions()); - $this->assertEquals(json_encode($expected), json_encode($shareRequest)); - } -} diff --git a/tests/YotiClientTest.php b/tests/YotiClientTest.php index 828373ab..24ddaa36 100755 --- a/tests/YotiClientTest.php +++ b/tests/YotiClientTest.php @@ -13,12 +13,6 @@ use Yoti\Aml\Profile as AmlProfile; use Yoti\Aml\Result as AmlResult; use Yoti\Exception\DateTimeException; -use Yoti\Identity\Policy\Policy; -use Yoti\Identity\ShareSessionCreated; -use Yoti\Identity\ShareSessionCreatedQrCode; -use Yoti\Identity\ShareSessionFetched; -use Yoti\Identity\ShareSessionFetchedQrCode; -use Yoti\Identity\ShareSessionRequestBuilder; use Yoti\Profile\ActivityDetails; use Yoti\ShareUrl\DynamicScenarioBuilder; use Yoti\ShareUrl\Policy\DynamicPolicyBuilder; @@ -210,140 +204,6 @@ public function testCreateShareUrl() $this->assertInstanceOf(ShareUrlResult::class, $result); } - /** - * @covers ::createShareSession - * @covers ::__construct - */ - public function testCreateShareSession() - { - $policy = $this->createMock(Policy::class); - $redirectUri = 'https://host/redirect/'; - - $shareSessionRequest = (new ShareSessionRequestBuilder()) - ->withPolicy($policy) - ->withRedirectUri($redirectUri) - ->build(); - - $response = $this->createMock(ResponseInterface::class); - $response->method('getBody')->willReturn(Psr7\Utils::streamFor(json_encode([ - 'id' => 'some_id', - 'status' => 'some_status', - 'expiry' => 'some_time', - ]))); - - $response->method('getStatusCode')->willReturn(201); - - $httpClient = $this->createMock(ClientInterface::class); - $httpClient - ->expects($this->once()) - ->method('sendRequest') - ->willReturn($response); - - $yotiClient = new YotiClient(TestData::SDK_ID, TestData::PEM_FILE, [ - Config::HTTP_CLIENT => $httpClient, - ]); - - $result = $yotiClient->createShareSession($shareSessionRequest); - - $this->assertInstanceOf(ShareSessionCreated::class, $result); - } - - /** - * @covers ::createShareQrCode - * @covers ::__construct - */ - public function testCreateShareQrCode() - { - $response = $this->createMock(ResponseInterface::class); - $response->method('getBody')->willReturn(Psr7\Utils::streamFor(json_encode([ - 'id' => 'some_id', - 'uri' => 'some_uri', - ]))); - - $response->method('getStatusCode')->willReturn(201); - - $httpClient = $this->createMock(ClientInterface::class); - $httpClient - ->expects($this->once()) - ->method('sendRequest') - ->willReturn($response); - - $yotiClient = new YotiClient(TestData::SDK_ID, TestData::PEM_FILE, [ - Config::HTTP_CLIENT => $httpClient, - ]); - - $result = $yotiClient->createShareQrCode(TestData::SOME_ID); - - $this->assertInstanceOf(ShareSessionCreatedQrCode::class, $result); - } - - /** - * @covers ::fetchShareQrCode - * @covers ::__construct - */ - public function testFetchShareQrCode() - { - $response = $this->createMock(ResponseInterface::class); - $response->method('getBody')->willReturn(Psr7\Utils::streamFor(json_encode([ - 'id' => 'id', - 'expiry' => 'expiry', - 'policy' => 'policy', - 'extensions' => [['type' => 'type', 'content' => 'content']], - 'session' => ['id' => 'id', 'status' => 'status', 'expiry' => 'expiry'], - 'redirectUri' => 'redirectUri', - ]))); - - $response->method('getStatusCode')->willReturn(201); - - $httpClient = $this->createMock(ClientInterface::class); - $httpClient - ->expects($this->once()) - ->method('sendRequest') - ->willReturn($response); - - $yotiClient = new YotiClient(TestData::SDK_ID, TestData::PEM_FILE, [ - Config::HTTP_CLIENT => $httpClient, - ]); - - $result = $yotiClient->fetchShareQrCode(TestData::SOME_ID); - - $this->assertInstanceOf(ShareSessionFetchedQrCode::class, $result); - } - - /** - * @covers ::fetchShareSession - * @covers ::__construct - */ - public function testFetchShareSession() - { - $response = $this->createMock(ResponseInterface::class); - $response->method('getBody')->willReturn(Psr7\Utils::streamFor(json_encode([ - 'id' => 'SOME_ID', - 'status' => 'SOME_STATUS', - 'expiry' => 'SOME_EXPIRY', - 'created' => 'SOME_CREATED', - 'updated' => 'SOME_UPDATED', - 'qrCode' => ['id' => 'SOME_QRCODE_ID'], - 'receipt' => ['id' => 'SOME_RECEIPT_ID'], - ]))); - - $response->method('getStatusCode')->willReturn(201); - - $httpClient = $this->createMock(ClientInterface::class); - $httpClient - ->expects($this->once()) - ->method('sendRequest') - ->willReturn($response); - - $yotiClient = new YotiClient(TestData::SDK_ID, TestData::PEM_FILE, [ - Config::HTTP_CLIENT => $httpClient, - ]); - - $result = $yotiClient->fetchShareSession(TestData::SOME_ID); - - $this->assertInstanceOf(ShareSessionFetched::class, $result); - } - /** * @covers ::getLoginUrl */ From ad27c2a956b097010472434087218e1229cff0fe Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Tue, 18 Jul 2023 15:11:33 +0100 Subject: [PATCH 30/45] version update for release --- composer.json | 2 +- src/Constants.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 602c2179..0af26520 100755 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "yoti/yoti-php-sdk", "description": "Yoti SDK for quickly integrating your PHP backend with Yoti", - "version": "4.2.0", + "version": "4.2.1", "keywords": [ "yoti", "sdk" diff --git a/src/Constants.php b/src/Constants.php index f784e2ec..d8a8ceaa 100644 --- a/src/Constants.php +++ b/src/Constants.php @@ -25,7 +25,7 @@ class Constants public const SDK_IDENTIFIER = 'PHP'; /** Default SDK version */ - public const SDK_VERSION = '4.2.0'; + public const SDK_VERSION = '4.2.1'; /** Base url for connect page (user will be redirected to this page eg. baseurl/app-id) */ public const CONNECT_BASE_URL = 'https://www.yoti.com/connect'; From d847a2ceb4ad690402eaa9e52f792a0e81e1c017 Mon Sep 17 00:00:00 2001 From: nikhilPank <49190426+nikhilPank@users.noreply.github.com> Date: Fri, 28 Jul 2023 12:24:39 +0100 Subject: [PATCH 31/45] Update README.md change support contact --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 57594652..baf6ffee 100755 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ The Yoti SDK can be used for the following products, follow the links for more i ## Support -For any questions or support please email [clientsupport@yoti.com](mailto:clientsupport@yoti.com). +For any questions or support please contact us here: https://support.yoti.com Please provide the following to get you up and working as quickly as possible: * Computer type From d953f9497c6187287b0de6d314d6398932793b1f Mon Sep 17 00:00:00 2001 From: nikhilPank <49190426+nikhilPank@users.noreply.github.com> Date: Fri, 28 Jul 2023 13:43:03 +0100 Subject: [PATCH 32/45] Update ISSUE_TEMPLATE.md --- .github/ISSUE_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index cce3710d..98f0c89d 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -12,6 +12,6 @@ assignees: '' # # There's a better way to get help! # -# Send your questions or issues to sdksupport@yoti.com +# Send your questions or issues to https://support.yoti.com # # From ad6c1416bdc801f0931e3c7b19f6f2c370078987 Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Fri, 9 Feb 2024 08:20:43 +0000 Subject: [PATCH 33/45] SDK-2423:solved php-sdk-activity-details-get-profile-function-retrieves-empty-user-profile --- .../profile/app/Http/Controllers/DynamicShareController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/profile/app/Http/Controllers/DynamicShareController.php b/examples/profile/app/Http/Controllers/DynamicShareController.php index f5db2c97..f9ec13bd 100644 --- a/examples/profile/app/Http/Controllers/DynamicShareController.php +++ b/examples/profile/app/Http/Controllers/DynamicShareController.php @@ -29,7 +29,7 @@ public function show(YotiClient $client) $scenario = (new DynamicScenarioBuilder()) ->withPolicy($policy) ->withCallbackEndpoint('/profile') - ->withExtension($locationConstraint) + //->withExtension($locationConstraint) ->build(); return view('share', [ From 1a35b6681b18e7ece5dc9d00553f249adf6b7773 Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Fri, 9 Feb 2024 08:23:53 +0000 Subject: [PATCH 34/45] SDK-2423:solved php-sdk-activity-details-get-profile-function-retrieves-empty-user-profile --- src/Profile/Util/Attribute/AnchorConverter.php | 2 +- src/Util/Json.php | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/Profile/Util/Attribute/AnchorConverter.php b/src/Profile/Util/Attribute/AnchorConverter.php index 89558202..33e6fb57 100644 --- a/src/Profile/Util/Attribute/AnchorConverter.php +++ b/src/Profile/Util/Attribute/AnchorConverter.php @@ -115,7 +115,7 @@ private static function convertCertToX509(string $certificate): \stdClass } }); - $decodedX509Data = Json::decode(Json::encode($X509Data), false); + $decodedX509Data = Json::decode(Json::encode(Json::convert_from_latin1_to_utf8_recursively($X509Data)), false); // Ensure serial number is cast to string. // @see \phpseclib\Math\BigInteger::__toString() diff --git a/src/Util/Json.php b/src/Util/Json.php index cdeeefd9..e014e174 100644 --- a/src/Util/Json.php +++ b/src/Util/Json.php @@ -55,4 +55,22 @@ private static function validate(): void throw new JsonException(json_last_error_msg(), json_last_error()); } } + + public static function convert_from_latin1_to_utf8_recursively($dat) + { + if (is_string($dat)) { + return utf8_encode($dat); + } elseif (is_array($dat)) { + $ret = []; + foreach ($dat as $i => $d) $ret[ $i ] = self::convert_from_latin1_to_utf8_recursively($d); + + return $ret; + } elseif (is_object($dat)) { + foreach ($dat as $i => $d) $dat->$i = self::convert_from_latin1_to_utf8_recursively($d); + + return $dat; + } else { + return $dat; + } + } } From 42bc2c245f5d0457260b0e9ee4807826e4a74c46 Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Fri, 9 Feb 2024 08:37:47 +0000 Subject: [PATCH 35/45] SDK-2423:updated sdk version string --- composer.json | 2 +- src/Constants.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 0af26520..46af649a 100755 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "yoti/yoti-php-sdk", "description": "Yoti SDK for quickly integrating your PHP backend with Yoti", - "version": "4.2.1", + "version": "4.2.2", "keywords": [ "yoti", "sdk" diff --git a/src/Constants.php b/src/Constants.php index d8a8ceaa..300def72 100644 --- a/src/Constants.php +++ b/src/Constants.php @@ -25,7 +25,7 @@ class Constants public const SDK_IDENTIFIER = 'PHP'; /** Default SDK version */ - public const SDK_VERSION = '4.2.1'; + public const SDK_VERSION = '4.2.2'; /** Base url for connect page (user will be redirected to this page eg. baseurl/app-id) */ public const CONNECT_BASE_URL = 'https://www.yoti.com/connect'; From 391157850a77d6a2c5d3d2639ae19021cacdc4fa Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Fri, 9 Feb 2024 08:49:51 +0000 Subject: [PATCH 36/45] SDK-2423:solved php-sdk-activity-details-get-profile-function-retrieves-empty-user-profile --- .../profile/app/Http/Controllers/DynamicShareController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/profile/app/Http/Controllers/DynamicShareController.php b/examples/profile/app/Http/Controllers/DynamicShareController.php index f9ec13bd..f5db2c97 100644 --- a/examples/profile/app/Http/Controllers/DynamicShareController.php +++ b/examples/profile/app/Http/Controllers/DynamicShareController.php @@ -29,7 +29,7 @@ public function show(YotiClient $client) $scenario = (new DynamicScenarioBuilder()) ->withPolicy($policy) ->withCallbackEndpoint('/profile') - //->withExtension($locationConstraint) + ->withExtension($locationConstraint) ->build(); return view('share', [ From e9065ead213c60ce606b31d6f949715f1fab0dcf Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Mon, 19 Feb 2024 10:46:11 +0300 Subject: [PATCH 37/45] SDK-2432 dbs-check profile error was solved --- examples/profile/resources/views/partial/report.blade.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/profile/resources/views/partial/report.blade.php b/examples/profile/resources/views/partial/report.blade.php index 28bdd3f0..707abe99 100644 --- a/examples/profile/resources/views/partial/report.blade.php +++ b/examples/profile/resources/views/partial/report.blade.php @@ -8,6 +8,7 @@ + @if (isset($value) && is_array($value)) @foreach ($value as $name => $result) @if (is_array($result)) @foreach ($result as $data => $view) @@ -33,7 +34,7 @@ @endif @endforeach - + @endif @endforeach From d213f426bf4b89cdab617ea80c3ae024ad62c3a9 Mon Sep 17 00:00:00 2001 From: nikhilPank <49190426+nikhilPank@users.noreply.github.com> Date: Tue, 20 Feb 2024 12:18:13 +0000 Subject: [PATCH 38/45] Create config.yml --- .github/ISSUE_TEMPLATE/config.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..9486bc24 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Yoti Support + url: https://support.yoti.com/yotisupport/s/contactsupport + about: Please send your questions or issues here. From de73bae1b1f1c70bd44d0bd45239c9367621f33b Mon Sep 17 00:00:00 2001 From: nikhilPank <49190426+nikhilPank@users.noreply.github.com> Date: Tue, 20 Feb 2024 12:18:43 +0000 Subject: [PATCH 39/45] Delete .github/ISSUE_TEMPLATE.md --- .github/ISSUE_TEMPLATE.md | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 98f0c89d..00000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -name: Custom issue template -about: " There's a better way to get help!" -title: '' -labels: '' -assignees: '' - ---- - -# -# Wait ✋ -# -# There's a better way to get help! -# -# Send your questions or issues to https://support.yoti.com -# -# From 7e4c33362b300cb4e2e2c624c4fce8b61d051e8d Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Thu, 20 Jun 2024 23:22:45 +0300 Subject: [PATCH 40/45] SDK-2265 added missing test --- tests/Util/JsonTest.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/Util/JsonTest.php b/tests/Util/JsonTest.php index c215ce98..df232c6e 100644 --- a/tests/Util/JsonTest.php +++ b/tests/Util/JsonTest.php @@ -75,4 +75,36 @@ public function testWithoutNullValues() $this->assertArrayNotHasKey('other_key', $withoutNull); } + + /** + * @covers ::convertFromLatin1ToUtf8Recursively + */ + public function testConvertFromLatin1ToUtf8Recursively() + { + $latin1String = utf8_decode('éàê'); + $latin1Array = [utf8_decode('éàê'), utf8_decode('çî')]; + $nestedLatin1Array = [utf8_decode('éàê'), [utf8_decode('çî'), utf8_decode('üñ')]]; + + $latin1Object = new \stdClass(); + $latin1Object->property1 = utf8_decode('éàê'); + $latin1Object->property2 = utf8_decode('çî'); + + $nestedLatin1Object = new \stdClass(); + $nestedLatin1Object->property = utf8_decode('çî'); + $latin1ObjectWithNestedObject = new \stdClass(); + $latin1ObjectWithNestedObject->property1 = utf8_decode('éàê'); + $latin1ObjectWithNestedObject->property2 = $nestedLatin1Object; + + $this->assertSame('éàê', Json::convertFromLatin1ToUtf8Recursively($latin1String)); + $this->assertSame(['éàê', 'çî'], Json::convertFromLatin1ToUtf8Recursively($latin1Array)); + $this->assertSame(['éàê', ['çî', 'üñ']], Json::convertFromLatin1ToUtf8Recursively($nestedLatin1Array)); + + $utf8Object = Json::convertFromLatin1ToUtf8Recursively($latin1Object); + $this->assertSame('éàê', $utf8Object->property1); + $this->assertSame('çî', $utf8Object->property2); + + $utf8NestedObject = Json::convertFromLatin1ToUtf8Recursively($latin1ObjectWithNestedObject); + $this->assertSame('éàê', $utf8NestedObject->property1); + $this->assertSame('çî', $utf8NestedObject->property2->property); + } } From 0931fc95bb37376dfb13c8a0064df3008ad38629 Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Thu, 20 Jun 2024 23:43:07 +0300 Subject: [PATCH 41/45] SDK-2265 added missing tests --- .php-cs-fixer.cache | 2 +- src/DocScan/Session/Create/SdkConfig.php | 21 +- .../Session/Create/SdkConfigBuilder.php | 13 +- .../RequestedTextExtractionTaskBuilder.php | 20 +- .../RequestedTextExtractionTaskConfig.php | 18 +- ...AccountWatchlistCaSearchConfigResponse.php | 2 +- .../Retrieve/IdDocumentResourceResponse.php | 17 - src/Identity/Constraint/Constraint.php | 8 + src/Identity/Constraint/PreferredSources.php | 54 ++ src/Identity/Constraint/SourceConstraint.php | 43 ++ .../Constraint/SourceConstraintBuilder.php | 46 ++ .../Extension/BasicExtensionBuilder.php | 40 ++ src/Identity/Extension/Extension.php | 38 ++ .../Extension/ExtensionBuilderInterface.php | 8 + .../Extension/LocationConstraintContent.php | 61 ++ .../LocationConstraintExtensionBuilder.php | 82 +++ .../Extension/ThirdPartyAttributeContent.php | 38 ++ .../ThirdPartyAttributeExtensionBuilder.php | 66 ++ .../TransactionalFlowExtensionBuilder.php | 35 + src/Identity/Policy/Policy.php | 75 ++ src/Identity/Policy/PolicyBuilder.php | 332 +++++++++ src/Identity/Policy/WantedAnchor.php | 29 + src/Identity/Policy/WantedAnchorBuilder.php | 32 + src/Identity/Policy/WantedAttribute.php | 123 ++++ .../Policy/WantedAttributeBuilder.php | 77 +++ src/Identity/ShareSessionCreated.php | 71 ++ src/Identity/ShareSessionCreatedQrCode.php | 48 ++ src/Identity/ShareSessionFetched.php | 117 ++++ src/Identity/ShareSessionFetchedQrCode.php | 110 +++ src/Identity/ShareSessionNotification.php | 70 ++ .../ShareSessionNotificationBuilder.php | 65 ++ src/Identity/ShareSessionRequest.php | 110 +++ src/Identity/ShareSessionRequestBuilder.php | 84 +++ .../Constraint/PreferredSourcesTest.php | 42 ++ .../SourceConstraintsBuilderTest.php | 66 ++ .../Extension/BasicExtensionBuilderTest.php | 40 ++ .../LocationConstraintContentTest.php | 44 ++ ...LocationConstraintExtensionBuilderTest.php | 164 +++++ .../ThirdPartyAttributeContentTest.php | 42 ++ ...hirdPartyAttributeExtensionBuilderTest.php | 132 ++++ .../TransactionalFlowExtensionBuilderTest.php | 36 + tests/Identity/Policy/PolicyBuilderTest.php | 644 ++++++++++++++++++ .../Policy/WantedAnchorBuilderTest.php | 39 ++ .../Policy/WantedAttributeBuilderTest.php | 162 +++++ .../ShareSessionCreatedQrCodeTest.php | 42 ++ tests/Identity/ShareSessionCreatedTest.php | 45 ++ .../ShareSessionFetchedQrCodeTest.php | 76 +++ tests/Identity/ShareSessionFetchedTest.php | 66 ++ .../ShareSessionNotificationBuilderTest.php | 80 +++ .../ShareSessionRequestBuilderTest.php | 100 +++ 50 files changed, 3688 insertions(+), 87 deletions(-) create mode 100644 src/Identity/Constraint/Constraint.php create mode 100644 src/Identity/Constraint/PreferredSources.php create mode 100644 src/Identity/Constraint/SourceConstraint.php create mode 100644 src/Identity/Constraint/SourceConstraintBuilder.php create mode 100644 src/Identity/Extension/BasicExtensionBuilder.php create mode 100644 src/Identity/Extension/Extension.php create mode 100644 src/Identity/Extension/ExtensionBuilderInterface.php create mode 100644 src/Identity/Extension/LocationConstraintContent.php create mode 100644 src/Identity/Extension/LocationConstraintExtensionBuilder.php create mode 100644 src/Identity/Extension/ThirdPartyAttributeContent.php create mode 100644 src/Identity/Extension/ThirdPartyAttributeExtensionBuilder.php create mode 100644 src/Identity/Extension/TransactionalFlowExtensionBuilder.php create mode 100644 src/Identity/Policy/Policy.php create mode 100644 src/Identity/Policy/PolicyBuilder.php create mode 100644 src/Identity/Policy/WantedAnchor.php create mode 100644 src/Identity/Policy/WantedAnchorBuilder.php create mode 100644 src/Identity/Policy/WantedAttribute.php create mode 100644 src/Identity/Policy/WantedAttributeBuilder.php create mode 100644 src/Identity/ShareSessionCreated.php create mode 100644 src/Identity/ShareSessionCreatedQrCode.php create mode 100644 src/Identity/ShareSessionFetched.php create mode 100644 src/Identity/ShareSessionFetchedQrCode.php create mode 100644 src/Identity/ShareSessionNotification.php create mode 100644 src/Identity/ShareSessionNotificationBuilder.php create mode 100644 src/Identity/ShareSessionRequest.php create mode 100644 src/Identity/ShareSessionRequestBuilder.php create mode 100644 tests/Identity/Constraint/PreferredSourcesTest.php create mode 100644 tests/Identity/Constraint/SourceConstraintsBuilderTest.php create mode 100644 tests/Identity/Extension/BasicExtensionBuilderTest.php create mode 100644 tests/Identity/Extension/LocationConstraintContentTest.php create mode 100644 tests/Identity/Extension/LocationConstraintExtensionBuilderTest.php create mode 100644 tests/Identity/Extension/ThirdPartyAttributeContentTest.php create mode 100644 tests/Identity/Extension/ThirdPartyAttributeExtensionBuilderTest.php create mode 100644 tests/Identity/Extension/TransactionalFlowExtensionBuilderTest.php create mode 100644 tests/Identity/Policy/PolicyBuilderTest.php create mode 100644 tests/Identity/Policy/WantedAnchorBuilderTest.php create mode 100644 tests/Identity/Policy/WantedAttributeBuilderTest.php create mode 100644 tests/Identity/ShareSessionCreatedQrCodeTest.php create mode 100644 tests/Identity/ShareSessionCreatedTest.php create mode 100644 tests/Identity/ShareSessionFetchedQrCodeTest.php create mode 100644 tests/Identity/ShareSessionFetchedTest.php create mode 100644 tests/Identity/ShareSessionNotificationBuilderTest.php create mode 100644 tests/Identity/ShareSessionRequestBuilderTest.php diff --git a/.php-cs-fixer.cache b/.php-cs-fixer.cache index 04df92ac..c6fb1f24 100644 --- a/.php-cs-fixer.cache +++ b/.php-cs-fixer.cache @@ -1 +1 @@ -{"php":"8.1.29","version":"3.52.1:v3.52.1#6e77207f0d851862ceeb6da63e6e22c01b1587bc","indent":" ","lineEnding":"\n","rules":{"array_syntax":{"syntax":"short"},"no_unused_imports":true,"ordered_imports":{"imports_order":["const","class","function"]},"php_unit_fqcn_annotation":true,"phpdoc_return_self_reference":true,"phpdoc_scalar":true},"hashes":{"\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder2251\/examples\/profile\/routes\/web.php":"4d6d95a1a884c50539b3ba82cb1cae6e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder14248\/examples\/profile\/routes\/web.php":"4d6d95a1a884c50539b3ba82cb1cae6e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder6481\/examples\/digitalidentity\/app\/Http\/Controllers\/ReceiptController.php":"10f70ffe111a0030b29762494cc5de7d","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder17383\/examples\/digitalidentity\/app\/Http\/Controllers\/IdentityController.php":"369515522c3efd6cd55a8363d4e97c05","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder7913\/examples\/digitalidentity\/app\/Http\/Controllers\/IdentityController.php":"369515522c3efd6cd55a8363d4e97c05","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder9690\/tests\/Identity\/DigitalIdentityServiceTest.php":"d3bcc6557c58c4301e0875c38f7c0c12","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder13374\/tests\/Identity\/DigitalIdentityServiceTest.php":"70473ccb2db6eb62fdedfff721a214a8","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder5073\/tests\/Identity\/DigitalIdentityServiceTest.php":"99d9b9277669e852ff57a8d0342d6c39","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder12947\/tests\/Identity\/DigitalIdentityServiceTest.php":"9ac6d6a63849af693c9a0d20e75d1431","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder6060\/tests\/Identity\/ReceiptItemKeyTest.php":"55d8ca1a8d0503d5c1db4cae2d334f02","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder16745\/tests\/Identity\/ReceiptItemKeyTest.php":"5f59fbb78733add24176a1f18b573bd8","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder15237\/tests\/Identity\/ReceiptItemKeyTest.php":"759ee7f5430046ffd1f4b66727dfdfac","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder2482\/tests\/Identity\/ReceiptItemKeyTest.php":"759ee7f5430046ffd1f4b66727dfdfac","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder9500\/tests\/Identity\/ReceiptItemKeyTest.php":"759ee7f5430046ffd1f4b66727dfdfac","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8154\/tests\/Identity\/ReceiptItemKeyTest.php":"759ee7f5430046ffd1f4b66727dfdfac","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3096\/tests\/Identity\/ReceiptItemKeyTest.php":"759ee7f5430046ffd1f4b66727dfdfac","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder10727\/tests\/Identity\/DigitalIdentityServiceTest.php":"9ac6d6a63849af693c9a0d20e75d1431","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder1094\/tests\/Identity\/DigitalIdentityServiceTest.php":"9ac6d6a63849af693c9a0d20e75d1431","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder1203\/tests\/Identity\/DigitalIdentityServiceTest.php":"954b753c374f04913b3a73c0584824d7","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8242\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8662\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder9336\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder4589\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder7107\/src\/Util\/Json.php":"416feed44d604ebe1ab41024bfe1e842","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder676\/src\/Util\/Json.php":"416feed44d604ebe1ab41024bfe1e842","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3256\/src\/Util\/Json.php":"fcfdbafac60b46074a2e5bff67a4da5e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder16969\/src\/Util\/Json.php":"43f6186a4d9a6fa33f171b50d1fd16cf","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder2814\/src\/Util\/Json.php":"981cbea86ffe2c2d2f0dc1a0bae0d131","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder14602\/src\/Util\/Json.php":"35167d47b2c78183ce0239909063207f","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder6556\/src\/Util\/Json.php":"438bb921ff61fc933627c10b42950061","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder14722\/src\/Util\/Json.php":"baf949e9e66eaef974049925a9a3c07a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder2471\/src\/Util\/Json.php":"399e30560c468f336ca381fc5ef60a6a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder16727\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"ed067e23d37fc508a688fe507a58f093","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder4520\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"ed067e23d37fc508a688fe507a58f093","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder14740\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"7ff610cf299b932c8e18a7ac767d9b79","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder5419\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"7ff610cf299b932c8e18a7ac767d9b79","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder9224\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"7ff610cf299b932c8e18a7ac767d9b79","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder7635\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"7ff610cf299b932c8e18a7ac767d9b79","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder11320\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"7ff610cf299b932c8e18a7ac767d9b79","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder2840\/src\/Util\/Json.php":"399e30560c468f336ca381fc5ef60a6a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder4668\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"7ff610cf299b932c8e18a7ac767d9b79","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder793\/src\/Util\/Json.php":"399e30560c468f336ca381fc5ef60a6a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder13155\/src\/Util\/Json.php":"399e30560c468f336ca381fc5ef60a6a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder15963\/src\/Util\/Json.php":"399e30560c468f336ca381fc5ef60a6a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder14757\/src\/Util\/Json.php":"3823f798ec319e906874613cae901c2b","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder2396\/src\/Util\/Json.php":"3823f798ec319e906874613cae901c2b","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder15785\/src\/Util\/Json.php":"f3bceeffab837a6c1867ee2faa60b5e3","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder6944\/src\/Util\/Json.php":"f3bceeffab837a6c1867ee2faa60b5e3","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder14577\/src\/DigitalIdentityClient.php":"23ce922c1c224fe16e2ffda312ff9723","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder13671\/src\/Util\/Json.php":"f3bceeffab837a6c1867ee2faa60b5e3","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder17359\/src\/DigitalIdentityClient.php":"91d4b2079927f23dcd4b4c11b7addb71","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8823\/src\/Util\/Json.php":"f3bceeffab837a6c1867ee2faa60b5e3","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder5305\/src\/DigitalIdentityClient.php":"0f901f713835ac4747b4132e3147cc68","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder17072\/src\/Util\/Json.php":"f3bceeffab837a6c1867ee2faa60b5e3","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder9380\/src\/DigitalIdentityClient.php":"0f901f713835ac4747b4132e3147cc68","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder9175\/src\/Util\/Json.php":"f3bceeffab837a6c1867ee2faa60b5e3","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder4237\/src\/DigitalIdentityClient.php":"0f901f713835ac4747b4132e3147cc68","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder5464\/tests\/Identity\/ReceiptItemKeyTest.php":"759ee7f5430046ffd1f4b66727dfdfac","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder2115\/src\/DigitalIdentityClient.php":"0f901f713835ac4747b4132e3147cc68","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder1066\/tests\/Identity\/ReceiptItemKeyTest.php":"759ee7f5430046ffd1f4b66727dfdfac","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder1075\/src\/DigitalIdentityClient.php":"0f901f713835ac4747b4132e3147cc68","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder11516\/tests\/Identity\/ReceiptItemKeyTest.php":"759ee7f5430046ffd1f4b66727dfdfac","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder18199\/src\/DigitalIdentityClient.php":"0f901f713835ac4747b4132e3147cc68","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder14323\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8335\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder18769\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder16269\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder2045\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder4112\/src\/DigitalIdentityClient.php":"0f901f713835ac4747b4132e3147cc68","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder4430\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder5343\/src\/DigitalIdentityClient.php":"0f901f713835ac4747b4132e3147cc68","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder18883\/src\/DigitalIdentityClient.php":"0f901f713835ac4747b4132e3147cc68","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder5545\/src\/DigitalIdentityClient.php":"0f901f713835ac4747b4132e3147cc68","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder5258\/src\/DigitalIdentityClient.php":"0f901f713835ac4747b4132e3147cc68","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder6300\/src\/DigitalIdentityClient.php":"e47a018ced67b5654c33892a16c12b24","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder883\/src\/DigitalIdentityClient.php":"9fba09c315d5bba5bd7b90ae9a717003","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder9271\/src\/DigitalIdentityClient.php":"9fba09c315d5bba5bd7b90ae9a717003","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder18128\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"7ff610cf299b932c8e18a7ac767d9b79","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder11252\/src\/Util\/Json.php":"f3bceeffab837a6c1867ee2faa60b5e3","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8070\/src\/Util\/Json.php":"3614821552571b08458651531fa2244a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder14329\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"7ff610cf299b932c8e18a7ac767d9b79","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder11739\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"7ff610cf299b932c8e18a7ac767d9b79","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder9179\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"7ff610cf299b932c8e18a7ac767d9b79","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3527\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"7ff610cf299b932c8e18a7ac767d9b79","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8434\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"7ff610cf299b932c8e18a7ac767d9b79","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder4161\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"7ff610cf299b932c8e18a7ac767d9b79","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8925\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"7ff610cf299b932c8e18a7ac767d9b79","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder9863\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"7ff610cf299b932c8e18a7ac767d9b79","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder14952\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"7ff610cf299b932c8e18a7ac767d9b79","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder10903\/src\/Util\/Json.php":"2b9e6981db0d7c984f0681cc6198d2fa","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder16968\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"7ff610cf299b932c8e18a7ac767d9b79","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder13512\/src\/Util\/Json.php":"f3bceeffab837a6c1867ee2faa60b5e3","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder10629\/src\/Util\/Json.php":"f3bceeffab837a6c1867ee2faa60b5e3","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder951\/src\/Util\/Json.php":"f3bceeffab837a6c1867ee2faa60b5e3","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder5246\/src\/Util\/Json.php":"f3bceeffab837a6c1867ee2faa60b5e3","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder17794\/src\/Util\/Json.php":"34d6f488baf792a5f65fb005ade1cb21","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder14129\/src\/Util\/Json.php":"17a68a33bd185354336301ae7ab20357","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder18673\/src\/Util\/Json.php":"0015fd9dba1e470dd3f9103b3645c6bf","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder14989\/src\/Util\/Json.php":"0015fd9dba1e470dd3f9103b3645c6bf","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder16311\/src\/Util\/Json.php":"703611be04e77b206274447d586eeb78","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder15550\/src\/Util\/Json.php":"703611be04e77b206274447d586eeb78","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder17676\/src\/Util\/Json.php":"703611be04e77b206274447d586eeb78","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder20242\/src\/Util\/Json.php":"703611be04e77b206274447d586eeb78","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder4853\/src\/Util\/Json.php":"5c34e189670912a642f01880daf37f2b","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder792\/src\/Util\/Json.php":"5c34e189670912a642f01880daf37f2b","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder11173\/src\/Util\/Json.php":"5c34e189670912a642f01880daf37f2b","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder640\/src\/Util\/Json.php":"ec9942ed9643d6694b3464ef5e95ff14","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder31\/src\/Util\/Json.php":"ec9942ed9643d6694b3464ef5e95ff14","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder12677\/src\/Util\/Json.php":"9254d07997116f33d53f3e153652efac","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder5735\/src\/Util\/Json.php":"402873b822b8ff0ab506b867b0284b27","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder10939\/src\/Util\/Json.php":"402873b822b8ff0ab506b867b0284b27","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder11755\/src\/Util\/Json.php":"402873b822b8ff0ab506b867b0284b27","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder9318\/src\/Util\/Json.php":"ec9942ed9643d6694b3464ef5e95ff14","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder13404\/src\/Util\/Json.php":"c4fb1fb130d8553a3cc091fe29120375","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8092\/src\/Util\/Json.php":"e309c022805530654120c3f46da286c8","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder20477\/src\/Util\/Json.php":"3f4a63e967fa3613c453202901551c8f","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder20545\/src\/Util\/Json.php":"e309c022805530654120c3f46da286c8","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder1983\/src\/Util\/Json.php":"898389c83f9899f1cb767f2ff0830405","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder7856\/src\/Util\/Json.php":"a4d756b12101cc8076bb274216478765","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder19874\/src\/Util\/Json.php":"e5167f42e08bbe70b18817ce5f059c8d","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder19449\/src\/Util\/Json.php":"1ad92f37cc957bae66e983ae1be2ec82","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder7291\/src\/Util\/Json.php":"eb93f1a61ff4653943c7cbbad92b4ed9","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8369\/src\/Util\/Json.php":"87109bc8d7c76aee5a0279db0d399076","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder1323\/src\/Util\/Json.php":"e74f6b19b813e269a0a722867c1cb668","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder5881\/src\/Util\/Json.php":"e0cefb8ebd92e9ece8bc2d0d1c589b63","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8174\/src\/Util\/Json.php":"e0cefb8ebd92e9ece8bc2d0d1c589b63","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder19818\/src\/Util\/Json.php":"e0cefb8ebd92e9ece8bc2d0d1c589b63","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder978\/src\/Util\/Json.php":"e0cefb8ebd92e9ece8bc2d0d1c589b63","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder17708\/src\/Util\/Json.php":"e0cefb8ebd92e9ece8bc2d0d1c589b63","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8198\/src\/Util\/Json.php":"e0cefb8ebd92e9ece8bc2d0d1c589b63","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder9911\/src\/Util\/Json.php":"2173a371cae72ea1c14e71245dafd121","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder743\/src\/Util\/Json.php":"2173a371cae72ea1c14e71245dafd121","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder17774\/src\/Util\/Json.php":"2173a371cae72ea1c14e71245dafd121","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder2001\/src\/Util\/Json.php":"2173a371cae72ea1c14e71245dafd121","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder18642\/src\/Util\/Json.php":"2173a371cae72ea1c14e71245dafd121","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder787\/src\/Util\/Json.php":"b944483bdefcb8644782ac516d296a79","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder11064\/src\/Util\/Json.php":"b944483bdefcb8644782ac516d296a79","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder6989\/src\/Util\/Json.php":"b944483bdefcb8644782ac516d296a79","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder6811\/src\/Util\/Json.php":"b944483bdefcb8644782ac516d296a79","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder5471\/src\/Util\/Json.php":"7308fd8e9f42d86934a5aea104849a6e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder17646\/src\/Util\/Json.php":"7308fd8e9f42d86934a5aea104849a6e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder4263\/src\/Util\/Json.php":"7308fd8e9f42d86934a5aea104849a6e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder18621\/src\/Util\/Json.php":"b944483bdefcb8644782ac516d296a79","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder18994\/src\/Util\/Json.php":"7308fd8e9f42d86934a5aea104849a6e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3936\/src\/Util\/Json.php":"7308fd8e9f42d86934a5aea104849a6e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder13966\/src\/Util\/Json.php":"b944483bdefcb8644782ac516d296a79","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder13895\/src\/Util\/Json.php":"2173a371cae72ea1c14e71245dafd121","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder18054\/src\/Util\/Json.php":"2173a371cae72ea1c14e71245dafd121","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder17506\/src\/Util\/Json.php":"2173a371cae72ea1c14e71245dafd121","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder10224\/src\/Util\/Json.php":"e0cefb8ebd92e9ece8bc2d0d1c589b63","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3087\/src\/Util\/Json.php":"e0cefb8ebd92e9ece8bc2d0d1c589b63","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder17683\/src\/Util\/Json.php":"e0cefb8ebd92e9ece8bc2d0d1c589b63","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder4535\/src\/Util\/Json.php":"e0cefb8ebd92e9ece8bc2d0d1c589b63","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder6783\/.php-cs-fixer.dist.php":"0a31d73e56a1ecd093b4f761852ee1d3","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder17761\/.php-cs-fixer.dist.php":"0a31d73e56a1ecd093b4f761852ee1d3","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder19549\/src\/Util\/Json.php":"e0cefb8ebd92e9ece8bc2d0d1c589b63","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder17713\/src\/Util\/Json.php":"6b09dbb84c5bc28d1f253869a6e9aa6a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder14312\/src\/Util\/Json.php":"6b09dbb84c5bc28d1f253869a6e9aa6a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder17129\/src\/Util\/Json.php":"6b09dbb84c5bc28d1f253869a6e9aa6a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder6586\/src\/Util\/Json.php":"6b09dbb84c5bc28d1f253869a6e9aa6a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder7395\/src\/Util\/Json.php":"506e473433b735d2ba4b6f623f294ae3","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder139\/src\/Util\/Json.php":"506e473433b735d2ba4b6f623f294ae3","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder16609\/src\/Util\/Json.php":"506e473433b735d2ba4b6f623f294ae3","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder5188\/src\/Util\/Json.php":"506e473433b735d2ba4b6f623f294ae3","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder16358\/src\/Util\/Json.php":"506e473433b735d2ba4b6f623f294ae3","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder16910\/src\/Util\/Json.php":"6b09dbb84c5bc28d1f253869a6e9aa6a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder15948\/src\/Util\/Json.php":"e0cefb8ebd92e9ece8bc2d0d1c589b63","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder7555\/src\/Util\/Json.php":"eb93f1a61ff4653943c7cbbad92b4ed9","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder13803\/src\/Util\/Json.php":"1ad92f37cc957bae66e983ae1be2ec82","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder328\/src\/Util\/Json.php":"e5167f42e08bbe70b18817ce5f059c8d","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder2830\/src\/Util\/Json.php":"a4d756b12101cc8076bb274216478765","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8983\/src\/Util\/Json.php":"e309c022805530654120c3f46da286c8","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder20557\/src\/Util\/Json.php":"ec9942ed9643d6694b3464ef5e95ff14","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder7262\/src\/Util\/Json.php":"402873b822b8ff0ab506b867b0284b27","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder12558\/src\/Util\/Json.php":"402873b822b8ff0ab506b867b0284b27","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder2921\/src\/Util\/Json.php":"402873b822b8ff0ab506b867b0284b27","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder21265\/src\/Util\/Json.php":"9254d07997116f33d53f3e153652efac","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder13708\/src\/Util\/Json.php":"ec9942ed9643d6694b3464ef5e95ff14","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3632\/src\/Util\/Json.php":"5c34e189670912a642f01880daf37f2b","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder680\/src\/Util\/Json.php":"5c34e189670912a642f01880daf37f2b","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder14936\/src\/Util\/Json.php":"5c34e189670912a642f01880daf37f2b","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder13229\/src\/Util\/Json.php":"5c34e189670912a642f01880daf37f2b","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder4031\/src\/Util\/Json.php":"5c34e189670912a642f01880daf37f2b","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder330\/src\/Util\/Json.php":"5c34e189670912a642f01880daf37f2b","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder18123\/src\/Util\/Json.php":"5c34e189670912a642f01880daf37f2b","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder21026\/src\/Util\/Json.php":"5c34e189670912a642f01880daf37f2b","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder13768\/src\/Util\/Json.php":"5c34e189670912a642f01880daf37f2b","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder5865\/src\/Util\/Json.php":"5c34e189670912a642f01880daf37f2b","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder30\/src\/Util\/Json.php":"5c34e189670912a642f01880daf37f2b","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder13281\/src\/Util\/Json.php":"5c34e189670912a642f01880daf37f2b","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder7240\/src\/Util\/Json.php":"5c34e189670912a642f01880daf37f2b","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder2674\/src\/Identity\/WrappedReceipt.php":"3a77a22be093a1da75438ea2bb9fcb20","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder12684\/src\/DigitalIdentityClient.php":"9fba09c315d5bba5bd7b90ae9a717003","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder1573\/src\/Util\/Config.php":"46ed5ebc2a984ab4af8c108119bfad2e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8169\/src\/DigitalIdentityClient.php":"9fba09c315d5bba5bd7b90ae9a717003","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder18629\/tests\/DigitalIdentityClientTest.php":"80700900f098b612b7b973e4dfbe744c","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder19904\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder4683\/examples\/profile\/sdk\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder7034\/tests\/DigitalIdentityClientTest.php":"80700900f098b612b7b973e4dfbe744c","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder20120\/tests\/DigitalIdentityClientTest.php":"80700900f098b612b7b973e4dfbe744c","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder13320\/tests\/DigitalIdentityClientTest.php":"80700900f098b612b7b973e4dfbe744c","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder6703\/tests\/DigitalIdentityClientTest.php":"5f76cb916302ba067a29022496f89f08","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3296\/tests\/DigitalIdentityClientTest.php":"5f76cb916302ba067a29022496f89f08","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder22224\/tests\/DigitalIdentityClientTest.php":"c2e9abfc9da60a57ce9a6a13009ef514","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder14862\/src\/DigitalIdentityClient.php":"9fba09c315d5bba5bd7b90ae9a717003","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder12538\/examples\/profile\/sdk\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder9837\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder11954\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder20262\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder10165\/tests\/DigitalIdentityClientTest.php":"953eff9597ede61c3443df04ab6f73a1","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder21693\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder21939\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder1101\/tests\/DigitalIdentityClientTest.php":"0202399f750760f0a9fe103f288136fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder1472\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder21854\/tests\/DigitalIdentityClientTest.php":"f41cd7bc113d5aea083c34a8b9e91d75","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder2270\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder7872\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder1307\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder5105\/tests\/DigitalIdentityClientTest.php":"528c3b0f2dc6f0ad109085a4bc2e7ef8","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder14108\/tests\/DigitalIdentityClientTest.php":"528c3b0f2dc6f0ad109085a4bc2e7ef8","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder20536\/tests\/DigitalIdentityClientTest.php":"528c3b0f2dc6f0ad109085a4bc2e7ef8","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder22047\/tests\/DigitalIdentityClientTest.php":"528c3b0f2dc6f0ad109085a4bc2e7ef8","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder20880\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder9281\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder10376\/tests\/DigitalIdentityClientTest.php":"0af037fdbccbe745e05d9e5d76f47fc9","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3106\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder15880\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder18815\/tests\/DigitalIdentityClientTest.php":"0af037fdbccbe745e05d9e5d76f47fc9","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder5895\/tests\/DigitalIdentityClientTest.php":"0af037fdbccbe745e05d9e5d76f47fc9","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder11712\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder20786\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder5851\/tests\/DigitalIdentityClientTest.php":"f4df423ac41e5ba91d3bb481e7f1a93f","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder18644\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder4888\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder164\/tests\/DigitalIdentityClientTest.php":"f4df423ac41e5ba91d3bb481e7f1a93f","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder20836\/tests\/DigitalIdentityClientTest.php":"f4df423ac41e5ba91d3bb481e7f1a93f","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder12690\/tests\/DigitalIdentityClientTest.php":"45529bd7b31bb206e9e84d0ca2f6c107","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder6330\/tests\/DigitalIdentityClientTest.php":"45529bd7b31bb206e9e84d0ca2f6c107","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder15499\/tests\/DigitalIdentityClientTest.php":"f4df423ac41e5ba91d3bb481e7f1a93f","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder6442\/tests\/DigitalIdentityClientTest.php":"fca1404f1ad711562bbbfbdbd7b17093","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder12990\/tests\/DigitalIdentityClientTest.php":"314f82e6800417e3d455b0ccbd4fd013","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder21119\/tests\/DigitalIdentityClientTest.php":"0ba5e47b02cebf2edc2f7fc4b4c22ab2","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8949\/tests\/DigitalIdentityClientTest.php":"0ba5e47b02cebf2edc2f7fc4b4c22ab2","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder17749\/tests\/DigitalIdentityClientTest.php":"0ba5e47b02cebf2edc2f7fc4b4c22ab2","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder141\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder2618\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder15512\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder5546\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder7040\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder9182\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder17462\/examples\/doc-scan\/app\/Http\/Controllers\/HomeController.php":"c32a3dc3cb5ae67c23c66ec5aff73365","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder10025\/examples\/doc-scan\/app\/Http\/Controllers\/HomeController.php":"c32a3dc3cb5ae67c23c66ec5aff73365","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder18182\/examples\/digitalidentity\/app\/Http\/Kernel.php":"aad72f11b36f9393d25b1a8941ba8b39","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder944\/examples\/doc-scan\/app\/Http\/Controllers\/HomeController.php":"c32a3dc3cb5ae67c23c66ec5aff73365","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder533\/src\/Util\/Json.php":"5c34e189670912a642f01880daf37f2b","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder1252\/src\/Util\/Json.php":"5c34e189670912a642f01880daf37f2b","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8028\/src\/Util\/Json.php":"5c34e189670912a642f01880daf37f2b","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder12731\/src\/Util\/Json.php":"5c34e189670912a642f01880daf37f2b","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder30801\/src\/Util\/Json.php":"7ebb6b44136d8e703d460029dec27318","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder24448\/src\/Util\/Json.php":"761bcc459afb5518e772b4a83552d051","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder11957\/src\/Util\/Json.php":"761bcc459afb5518e772b4a83552d051","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder26441\/src\/Util\/Json.php":"761bcc459afb5518e772b4a83552d051","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder31456\/src\/Util\/Json.php":"761bcc459afb5518e772b4a83552d051","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder15272\/src\/Util\/Json.php":"761bcc459afb5518e772b4a83552d051","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder16060\/src\/Util\/Json.php":"761bcc459afb5518e772b4a83552d051","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder9581\/src\/Util\/Json.php":"761bcc459afb5518e772b4a83552d051","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder2255\/src\/Util\/Json.php":"761bcc459afb5518e772b4a83552d051","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder24541\/src\/Util\/Json.php":"761bcc459afb5518e772b4a83552d051","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8103\/src\/Util\/Json.php":"761bcc459afb5518e772b4a83552d051","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8531\/src\/Util\/Json.php":"8e53d5d66d55e0619d026ce821ec4237","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder12372\/src\/Util\/Json.php":"0a82acbcdf378adf0211899e0770843d"}} \ No newline at end of file +{"php":"8.1.29","version":"3.59.3:v3.59.3#30ba9ecc2b0e5205e578fe29973c15653d9bfd29","indent":" ","lineEnding":"\n","rules":{"array_syntax":{"syntax":"short"},"no_unused_imports":true,"ordered_imports":{"imports_order":["const","class","function"]},"php_unit_fqcn_annotation":true,"phpdoc_return_self_reference":true,"phpdoc_scalar":true},"hashes":{"\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32718\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder30753\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder24222\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder25907\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder35317\/src\/DigitalIdentityClient.php":"9fba09c315d5bba5bd7b90ae9a717003","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3167\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder667\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32289\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder821\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8036\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3553\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder9961\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder34449\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32249\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder37291\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3093\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder28127\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a"}} \ No newline at end of file diff --git a/src/DocScan/Session/Create/SdkConfig.php b/src/DocScan/Session/Create/SdkConfig.php index 51b85112..453ad44a 100644 --- a/src/DocScan/Session/Create/SdkConfig.php +++ b/src/DocScan/Session/Create/SdkConfig.php @@ -63,11 +63,6 @@ class SdkConfig implements \JsonSerializable */ private $attemptsConfiguration; - /** - * @var string|null - */ - private $biometricConsentFlow; - /** * @param string|null $allowedCaptureMethods * @param string|null $primaryColour @@ -80,7 +75,6 @@ class SdkConfig implements \JsonSerializable * @param string|null $privacyPolicyUrl * @param bool|null $allowHandoff * @param array|null $idDocumentTextDataExtractionRetriesConfig - * @param string|null $biometricConsentFlow */ public function __construct( ?string $allowedCaptureMethods, @@ -93,9 +87,7 @@ public function __construct( ?string $errorUrl, ?string $privacyPolicyUrl = null, ?bool $allowHandoff = null, - ?array $idDocumentTextDataExtractionRetriesConfig = null, - ?string $biometricConsentFlow = null - + ?array $idDocumentTextDataExtractionRetriesConfig = null ) { $this->allowedCaptureMethods = $allowedCaptureMethods; $this->primaryColour = $primaryColour; @@ -110,8 +102,6 @@ public function __construct( if (!is_null($idDocumentTextDataExtractionRetriesConfig)) { $this->attemptsConfiguration = new AttemptsConfiguration($idDocumentTextDataExtractionRetriesConfig); } - $this->biometricConsentFlow = $biometricConsentFlow; - } /** @@ -131,7 +121,6 @@ public function jsonSerialize(): \stdClass 'privacy_policy_url' => $this->getPrivacyPolicyUrl(), 'allow_handoff' => $this->getAllowHandoff(), 'attempts_configuration' => $this->getAttemptsConfiguration(), - 'biometric_consent_flow' => $this->getBiometricConsentFlow() ]); } @@ -222,12 +211,4 @@ public function getAttemptsConfiguration(): ?AttemptsConfiguration { return $this->attemptsConfiguration; } - - /** - * @return string|null - */ - public function getBiometricConsentFlow(): ?string - { - return $this->biometricConsentFlow; - } } diff --git a/src/DocScan/Session/Create/SdkConfigBuilder.php b/src/DocScan/Session/Create/SdkConfigBuilder.php index acf30fcc..c91adc05 100644 --- a/src/DocScan/Session/Create/SdkConfigBuilder.php +++ b/src/DocScan/Session/Create/SdkConfigBuilder.php @@ -66,11 +66,6 @@ class SdkConfigBuilder */ private $idDocumentTextDataExtractionRetriesConfig; - /** - * @var string|null - */ - private $biometricConsentFlow; - public function withAllowsCamera(): self { return $this->withAllowedCaptureMethod(self::CAMERA); @@ -141,11 +136,6 @@ public function withAllowHandoff(bool $allowHandoff): self return $this; } - public function withBiometricConsentFlow(string $biometricConsentFlow): self - { - $this->biometricConsentFlow = $biometricConsentFlow; - return $this; - } /** * Allows configuring the number of attempts permitted for text extraction on an ID document * @@ -213,8 +203,7 @@ public function build(): SdkConfig $this->errorUrl, $this->privacyPolicyUrl, $this->allowHandoff, - $this->idDocumentTextDataExtractionRetriesConfig, - $this->biometricConsentFlow + $this->idDocumentTextDataExtractionRetriesConfig ); } } diff --git a/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskBuilder.php b/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskBuilder.php index 174828f9..5b29fca1 100644 --- a/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskBuilder.php +++ b/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskBuilder.php @@ -58,23 +58,6 @@ public function withManualCheck(string $manualCheck): self return $this->setManualCheck($manualCheck); } - /** - * @var bool - */ - private $createExpandedDocumentFields; - - /** - * - * @param string $createExpandedDocumentFields - * - * @return $this - */ - public function withCreateExpandedDocumentFields(bool $createExpandedDocumentFields): self - { - $this->createExpandedDocumentFields = $createExpandedDocumentFields; - return $this; - } - /** * @return RequestedTextExtractionTask */ @@ -82,8 +65,7 @@ public function build(): RequestedTextExtractionTask { Validation::notEmptyString($this->manualCheck, 'manualCheck'); - $config = new RequestedTextExtractionTaskConfig($this->manualCheck, $this->chipData, - $this->createExpandedDocumentFields); + $config = new RequestedTextExtractionTaskConfig($this->manualCheck, $this->chipData); return new RequestedTextExtractionTask($config); } } diff --git a/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfig.php b/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfig.php index 7e5716d1..9a9fb083 100644 --- a/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfig.php +++ b/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfig.php @@ -19,21 +19,14 @@ class RequestedTextExtractionTaskConfig implements RequestedTaskConfigInterface */ private $chipData; - /** - * @var bool|null - */ - private $createExpandedDocumentFields; - /** * @param string $manualCheck * @param string|null $chipData - * @param bool|null $createExpandedDocumentFields */ - public function __construct(string $manualCheck, ?string $chipData = null, ?bool $createExpandedDocumentFields = false) + public function __construct(string $manualCheck, ?string $chipData = null) { $this->manualCheck = $manualCheck; $this->chipData = $chipData; - $this->createExpandedDocumentFields = $createExpandedDocumentFields; } /** @@ -44,7 +37,6 @@ public function jsonSerialize(): stdClass return (object)Json::withoutNullValues([ 'manual_check' => $this->getManualCheck(), 'chip_data' => $this->getChipData(), - 'create_expanded_document_fields' => $this->getCreateExpandedDocumentFields(), ]); } @@ -63,12 +55,4 @@ public function getChipData(): ?string { return $this->chipData; } - - /** - * @return bool - */ - public function getCreateExpandedDocumentFields(): ?bool - { - return $this->createExpandedDocumentFields; - } } diff --git a/src/DocScan/Session/Retrieve/CustomAccountWatchlistCaSearchConfigResponse.php b/src/DocScan/Session/Retrieve/CustomAccountWatchlistCaSearchConfigResponse.php index efa7819d..d1372b54 100644 --- a/src/DocScan/Session/Retrieve/CustomAccountWatchlistCaSearchConfigResponse.php +++ b/src/DocScan/Session/Retrieve/CustomAccountWatchlistCaSearchConfigResponse.php @@ -35,7 +35,7 @@ public function __construct(array $searchConfig) $this->apiKey = $searchConfig['api_key']; $this->monitoring = $searchConfig['monitoring']; $this->clientRef = $searchConfig['client_ref']; - $this->tags = array_key_exists('tags', $searchConfig) ? json_decode($searchConfig['tags'], true) : []; + $this->tags = json_decode($searchConfig['tags'], true); } /** diff --git a/src/DocScan/Session/Retrieve/IdDocumentResourceResponse.php b/src/DocScan/Session/Retrieve/IdDocumentResourceResponse.php index 6d9dc824..b6e7f46a 100644 --- a/src/DocScan/Session/Retrieve/IdDocumentResourceResponse.php +++ b/src/DocScan/Session/Retrieve/IdDocumentResourceResponse.php @@ -24,11 +24,6 @@ class IdDocumentResourceResponse extends ResourceResponse */ private $documentFields; - /** - * @var ExpandedDocumentFieldsResponse|null - */ - private $expandedDocumentFields; - /** * @var DocumentIdPhotoResponse|null */ @@ -54,10 +49,6 @@ public function __construct(array $idDocument) $this->documentFields = isset($idDocument['document_fields']) ? new DocumentFieldsResponse($idDocument['document_fields']) : null; - - $this->expandedDocumentFields = isset($idDocument['expanded_document_fields']) - ? new ExpandedDocumentFieldsResponse($idDocument['expanded_document_fields']) - : null; $this->documentIdPhoto = isset($idDocument['document_id_photo']) ? new DocumentIdPhotoResponse($idDocument['document_id_photo']) @@ -96,14 +87,6 @@ public function getDocumentFields(): ?DocumentFieldsResponse return $this->documentFields; } - /** - * @return ExpandedDocumentFieldsResponse|null - */ - public function getExpandedDocumentFields(): ?ExpandedDocumentFieldsResponse - { - return $this->expandedDocumentFields; - } - /** * @return DocumentIdPhotoResponse|null */ diff --git a/src/Identity/Constraint/Constraint.php b/src/Identity/Constraint/Constraint.php new file mode 100644 index 00000000..f5afe554 --- /dev/null +++ b/src/Identity/Constraint/Constraint.php @@ -0,0 +1,8 @@ +wantedAnchors = $wantedAnchors; + + Validation::isBoolean($softPreference, 'soft_preference'); + $this->softPreference = $softPreference; + } + + public function jsonSerialize(): stdClass + { + return (object)[ + 'anchors' => $this->wantedAnchors, + 'soft_preference' => $this->softPreference, + ]; + } + + /** + * @return WantedAnchor[] + */ + public function getWantedAnchors(): array + { + return $this->wantedAnchors; + } + + /** + * @return bool + */ + public function isSoftPreference(): bool + { + return $this->softPreference; + } +} diff --git a/src/Identity/Constraint/SourceConstraint.php b/src/Identity/Constraint/SourceConstraint.php new file mode 100644 index 00000000..cd903789 --- /dev/null +++ b/src/Identity/Constraint/SourceConstraint.php @@ -0,0 +1,43 @@ +type = 'SOURCE'; + + Validation::isArrayOfType($wantedAnchors, [WantedAnchor::class], 'anchors'); + $this->preferredSources = new PreferredSources($wantedAnchors, $softPreference); + } + + public function getType(): string + { + return $this->type; + } + + public function getPreferredSources(): PreferredSources + { + return $this->preferredSources; + } + + public function jsonSerialize(): object + { + return (object)[ + 'type' => $this->getType(), + 'preferred_sources' => $this->getPreferredSources(), + ]; + } +} diff --git a/src/Identity/Constraint/SourceConstraintBuilder.php b/src/Identity/Constraint/SourceConstraintBuilder.php new file mode 100644 index 00000000..59b62e16 --- /dev/null +++ b/src/Identity/Constraint/SourceConstraintBuilder.php @@ -0,0 +1,46 @@ +wantedAnchors = $wantedAnchors; + + return $this; + } + + public function withWantedAnchor(WantedAnchor $wantedAnchor): self + { + $this->wantedAnchors[] = $wantedAnchor; + + return $this; + } + + public function withSoftPreference(bool $softPreference): self + { + $this->softPreference = $softPreference; + + return $this; + } + + public function build(): SourceConstraint + { + return new SourceConstraint($this->wantedAnchors, $this->softPreference); + } +} diff --git a/src/Identity/Extension/BasicExtensionBuilder.php b/src/Identity/Extension/BasicExtensionBuilder.php new file mode 100644 index 00000000..97d913aa --- /dev/null +++ b/src/Identity/Extension/BasicExtensionBuilder.php @@ -0,0 +1,40 @@ +type = $type; + + return $this; + } + + /** + * @param mixed $content + * + * @return $this + */ + public function withContent($content): self + { + $this->content = $content; + + return $this; + } + + public function build(): Extension + { + return new Extension($this->type, $this->content); + } +} diff --git a/src/Identity/Extension/Extension.php b/src/Identity/Extension/Extension.php new file mode 100644 index 00000000..d7e436b1 --- /dev/null +++ b/src/Identity/Extension/Extension.php @@ -0,0 +1,38 @@ +type = $type; + + Validation::notNull($type, 'content'); + $this->content = $content; + } + + /** + * @return stdClass + */ + public function jsonSerialize(): stdClass + { + return (object)[ + 'type' => $this->type, + 'content' => $this->content, + ]; + } +} diff --git a/src/Identity/Extension/ExtensionBuilderInterface.php b/src/Identity/Extension/ExtensionBuilderInterface.php new file mode 100644 index 00000000..1ab39bd8 --- /dev/null +++ b/src/Identity/Extension/ExtensionBuilderInterface.php @@ -0,0 +1,8 @@ +latitude = $latitude; + + Validation::withinRange($longitude, -180, 180, 'longitude'); + $this->longitude = $longitude; + + Validation::notLessThan($radius, 0, 'radius'); + $this->radius = $radius; + + Validation::notLessThan($maxUncertainty, 0, 'maxUncertainty'); + $this->maxUncertainty = $maxUncertainty; + } + + /** + * @inheritDoc + * + * @return stdClass + */ + public function jsonSerialize(): stdClass + { + return (object)[ + 'expected_device_location' => [ + 'latitude' => $this->latitude, + 'longitude' => $this->longitude, + 'radius' => $this->radius, + 'max_uncertainty_radius' => $this->maxUncertainty, + ] + ]; + } +} diff --git a/src/Identity/Extension/LocationConstraintExtensionBuilder.php b/src/Identity/Extension/LocationConstraintExtensionBuilder.php new file mode 100644 index 00000000..556cd19d --- /dev/null +++ b/src/Identity/Extension/LocationConstraintExtensionBuilder.php @@ -0,0 +1,82 @@ +latitude = $latitude; + return $this; + } + + /** + * Allows you to specify the Longitude of the user's expected location + */ + public function withLongitude(float $longitude): self + { + $this->longitude = $longitude; + return $this; + } + + /** + * Radius of the circle, centred on the specified location coordinates, where the device is + * allowed to perform the share. + * + * If not provided, a default value of 150m will be used. + * + * @param float $radius + * The allowable distance, in metres, from the given lat/long location + */ + public function withRadius(float $radius): self + { + $this->radius = $radius; + return $this; + } + + /** + * Maximum acceptable distance, in metres, of the area of uncertainty associated with the device + * location coordinates. + * + * If not provided, a default value of 150m will be used. + * + * @param float $maxUncertainty + * Maximum allowed measurement uncertainty, in metres + * + * @return $this + */ + public function withMaxUncertainty(float $maxUncertainty): self + { + $this->maxUncertainty = $maxUncertainty; + + return $this; + } + + public function build(): Extension + { + $content = new LocationConstraintContent( + $this->latitude, + $this->longitude, + $this->radius, + $this->maxUncertainty + ); + + return new Extension(self::LOCATION_CONSTRAINT, $content); + } +} diff --git a/src/Identity/Extension/ThirdPartyAttributeContent.php b/src/Identity/Extension/ThirdPartyAttributeContent.php new file mode 100644 index 00000000..0eeec95a --- /dev/null +++ b/src/Identity/Extension/ThirdPartyAttributeContent.php @@ -0,0 +1,38 @@ +expiryDate = $expiryDate; + + Validation::isArrayOfType($definitions, [AttributeDefinition::class], 'definitions'); + $this->definitions = $definitions; + } + + public function jsonSerialize(): stdClass + { + return (object)[ + 'expiry_date' => $this->expiryDate + ->setTimezone(new \DateTimeZone('UTC')) + ->format(\DateTime::RFC3339_EXTENDED), + 'definitions' => $this->definitions, + ]; + } +} diff --git a/src/Identity/Extension/ThirdPartyAttributeExtensionBuilder.php b/src/Identity/Extension/ThirdPartyAttributeExtensionBuilder.php new file mode 100644 index 00000000..132fa720 --- /dev/null +++ b/src/Identity/Extension/ThirdPartyAttributeExtensionBuilder.php @@ -0,0 +1,66 @@ +expiryDate = $expiryDate; + + return $this; + } + + public function withDefinition(string $definition): self + { + $this->definitions[] = new AttributeDefinition($definition); + + return $this; + } + + /** + * @param string[] $definitions + */ + public function withDefinitions(array $definitions): self + { + Validation::isArrayOfStrings($definitions, 'definitions'); + $this->definitions = array_map( + function ($definition): AttributeDefinition { + return new AttributeDefinition($definition); + }, + $definitions + ); + + return $this; + } + + public function build(): Extension + { + return new Extension( + self::THIRD_PARTY_ATTRIBUTE, + new ThirdPartyAttributeContent( + $this->expiryDate, + $this->definitions + ) + ); + } +} diff --git a/src/Identity/Extension/TransactionalFlowExtensionBuilder.php b/src/Identity/Extension/TransactionalFlowExtensionBuilder.php new file mode 100644 index 00000000..22eb5821 --- /dev/null +++ b/src/Identity/Extension/TransactionalFlowExtensionBuilder.php @@ -0,0 +1,35 @@ +content = $content; + + return $this; + } + + /** + * @return Extension with TRANSACTIONAL_FLOW type + */ + public function build(): Extension + { + return new Extension(static::TYPE, $this->content); + } +} diff --git a/src/Identity/Policy/Policy.php b/src/Identity/Policy/Policy.php new file mode 100644 index 00000000..62ade060 --- /dev/null +++ b/src/Identity/Policy/Policy.php @@ -0,0 +1,75 @@ +wantedAttributes = $wantedAttributes; + + Validation::isArrayOfIntegers($wantedAuthTypes, 'wantedAuthTypes'); + $this->wantedAuthTypes = $wantedAuthTypes; + + $this->wantedRememberMe = $wantedRememberMe; + $this->wantedRememberMeOptional = $wantedRememberMeOptional; + $this->identityProfileRequirements = $identityProfileRequirements; + } + + + public function jsonSerialize(): stdClass + { + return (object)[ + 'wanted' => $this->wantedAttributes, + 'wanted_auth_types' => $this->wantedAuthTypes, + 'wanted_remember_me' => $this->wantedRememberMe, + 'wanted_remember_me_optional' => $this->wantedRememberMeOptional, + 'identity_profile_requirements' => $this->identityProfileRequirements, + ]; + } + + /** + * IdentityProfileRequirements requested in the policy + * + * @return object|null + */ + public function getIdentityProfileRequirements() + { + return $this->identityProfileRequirements; + } +} diff --git a/src/Identity/Policy/PolicyBuilder.php b/src/Identity/Policy/PolicyBuilder.php new file mode 100644 index 00000000..e8a8b190 --- /dev/null +++ b/src/Identity/Policy/PolicyBuilder.php @@ -0,0 +1,332 @@ +getName(); + + if (null !== $wantedAttribute->getDerivation()) { + $key = $wantedAttribute->getDerivation(); + } + + if (null !== $wantedAttribute->getConstraints()) { + $key .= '-' . hash('sha256', Json::encode($wantedAttribute->getConstraints())); + } + + $this->wantedAttributes[$key] = $wantedAttribute; + + return $this; + } + + /** + * @param Constraint[]|null $constraints + */ + public function withWantedAttributeByName( + string $name, + array $constraints = null, + bool $acceptSelfAsserted = null + ): self { + $wantedAttributeBuilder = (new WantedAttributeBuilder()) + ->withName($name); + + if ($constraints !== null) { + $wantedAttributeBuilder->withConstraints($constraints); + } + + if ($acceptSelfAsserted !== null) { + $wantedAttributeBuilder->withAcceptSelfAsserted($acceptSelfAsserted); + } + + return $this->withWantedAttribute($wantedAttributeBuilder->build()); + } + + /** + * @param Constraint[]|null $constraints + */ + public function withFamilyName(array $constraints = null, bool $acceptSelfAsserted = null): self + { + return $this->withWantedAttributeByName( + UserProfile::ATTR_FAMILY_NAME, + $constraints, + $acceptSelfAsserted + ); + } + + /** + * @param Constraint[]|null $constraints + */ + public function withGivenNames(array $constraints = null, bool $acceptSelfAsserted = null): self + { + return $this->withWantedAttributeByName( + UserProfile::ATTR_GIVEN_NAMES, + $constraints, + $acceptSelfAsserted + ); + } + + /** + * @param Constraint[]|null $constraints + */ + public function withFullName(array $constraints = null, bool $acceptSelfAsserted = null): self + { + return $this->withWantedAttributeByName( + UserProfile::ATTR_FULL_NAME, + $constraints, + $acceptSelfAsserted + ); + } + + /** + * @param Constraint[]|null $constraints + */ + public function withDateOfBirth(array $constraints = null, bool $acceptSelfAsserted = null): self + { + return $this->withWantedAttributeByName( + UserProfile::ATTR_DATE_OF_BIRTH, + $constraints, + $acceptSelfAsserted + ); + } + + /** + * @param Constraint[]|null $constraints + */ + public function withAgeOver(int $age, array $constraints = null, bool $acceptSelfAsserted = null): self + { + return $this->withAgeDerivedAttribute( + UserProfile::AGE_OVER . $age, + $constraints, + $acceptSelfAsserted + ); + } + + /** + * @param Constraint[]|null $constraints + */ + public function withAgeUnder(int $age, array $constraints = null, bool $acceptSelfAsserted = null): self + { + return $this->withAgeDerivedAttribute( + UserProfile::AGE_UNDER . $age, + $constraints, + $acceptSelfAsserted + ); + } + + /** + * @param Constraint[]|null $constraints + */ + public function withAgeDerivedAttribute( + string $derivation, + array $constraints = null, + bool $acceptSelfAsserted = null + ): self { + $wantedAttributeBuilder = (new WantedAttributeBuilder()) + ->withName(UserProfile::ATTR_DATE_OF_BIRTH) + ->withDerivation($derivation); + + if ($constraints !== null) { + $wantedAttributeBuilder->withConstraints($constraints); + } + + if ($acceptSelfAsserted !== null) { + $wantedAttributeBuilder->withAcceptSelfAsserted($acceptSelfAsserted); + } + + return $this->withWantedAttribute($wantedAttributeBuilder->build()); + } + + /** + * @param Constraint[]|null $constraints + */ + public function withGender(array $constraints = null, bool $acceptSelfAsserted = null): self + { + return $this->withWantedAttributeByName( + UserProfile::ATTR_GENDER, + $constraints, + $acceptSelfAsserted + ); + } + + /** + * @param Constraint[]|null $constraints + */ + public function withPostalAddress(array $constraints = null, bool $acceptSelfAsserted = null): self + { + return $this->withWantedAttributeByName( + UserProfile::ATTR_POSTAL_ADDRESS, + $constraints, + $acceptSelfAsserted + ); + } + + /** + * @param Constraint[]|null $constraints + */ + public function withStructuredPostalAddress(array $constraints = null, bool $acceptSelfAsserted = null): self + { + return $this->withWantedAttributeByName( + UserProfile::ATTR_STRUCTURED_POSTAL_ADDRESS, + $constraints, + $acceptSelfAsserted + ); + } + + /** + * @param Constraint[]|null $constraints + */ + public function withNationality(array $constraints = null, bool $acceptSelfAsserted = null): self + { + return $this->withWantedAttributeByName( + UserProfile::ATTR_NATIONALITY, + $constraints, + $acceptSelfAsserted + ); + } + + /** + * @param Constraint[]|null $constraints + */ + public function withPhoneNumber(array $constraints = null, bool $acceptSelfAsserted = null): self + { + return $this->withWantedAttributeByName( + UserProfile::ATTR_PHONE_NUMBER, + $constraints, + $acceptSelfAsserted + ); + } + + /** + * @param Constraint[]|null $constraints + */ + public function withSelfie(array $constraints = null, bool $acceptSelfAsserted = null): self + { + return $this->withWantedAttributeByName( + UserProfile::ATTR_SELFIE, + $constraints, + $acceptSelfAsserted + ); + } + + /** + * @param Constraint[]|null $constraints + */ + public function withDocumentDetails(array $constraints = null, bool $acceptSelfAsserted = null): self + { + return $this->withWantedAttributeByName( + UserProfile::ATTR_DOCUMENT_DETAILS, + $constraints, + $acceptSelfAsserted + ); + } + + /** + * @param Constraint[]|null $constraints + */ + public function withDocumentImages(array $constraints = null, bool $acceptSelfAsserted = null): self + { + return $this->withWantedAttributeByName( + UserProfile::ATTR_DOCUMENT_IMAGES, + $constraints, + $acceptSelfAsserted + ); + } + + /** + * @param Constraint[]|null $constraints + */ + public function withEmail(array $constraints = null, bool $acceptSelfAsserted = null): self + { + return $this->withWantedAttributeByName( + UserProfile::ATTR_EMAIL_ADDRESS, + $constraints, + $acceptSelfAsserted + ); + } + + + public function withSelfieAuthentication(bool $enabled = true): self + { + return $this->withWantedAuthType(self::SELFIE_AUTH_TYPE, $enabled); + } + + + public function withPinAuthentication(bool $enabled = true): self + { + return $this->withWantedAuthType(self::PIN_AUTH_TYPE, $enabled); + } + + public function withWantedAuthType(int $wantedAuthType, bool $enabled = true): self + { + if ($enabled) { + $this->wantedAuthTypes[$wantedAuthType] = $wantedAuthType; + } else { + unset($this->wantedAuthTypes[$wantedAuthType]); + } + + return $this; + } + + + public function withWantedRememberMe(bool $wantedRememberMe): self + { + $this->wantedRememberMe = $wantedRememberMe; + return $this; + } + + public function withWantedRememberMeOptional(bool $wantedRememberMeOptional): self + { + $this->wantedRememberMeOptional = $wantedRememberMeOptional; + return $this; + } + + /** + * Use an Identity Profile Requirement object for the share + * + * @param object $identityProfileRequirements + * @return $this + */ + public function withIdentityProfileRequirements($identityProfileRequirements): self + { + $this->identityProfileRequirements = $identityProfileRequirements; + return $this; + } + + + public function build(): Policy + { + return new Policy( + array_values($this->wantedAttributes), + array_values($this->wantedAuthTypes), + $this->wantedRememberMe, + $this->wantedRememberMeOptional, + $this->identityProfileRequirements + ); + } +} diff --git a/src/Identity/Policy/WantedAnchor.php b/src/Identity/Policy/WantedAnchor.php new file mode 100644 index 00000000..1714ca8a --- /dev/null +++ b/src/Identity/Policy/WantedAnchor.php @@ -0,0 +1,29 @@ +value = $value; + $this->subType = $subType; + } + + public function jsonSerialize(): stdClass + { + return (object)[ + 'name' => $this->value, + 'sub_type' => $this->subType, + ]; + } +} diff --git a/src/Identity/Policy/WantedAnchorBuilder.php b/src/Identity/Policy/WantedAnchorBuilder.php new file mode 100644 index 00000000..9625445f --- /dev/null +++ b/src/Identity/Policy/WantedAnchorBuilder.php @@ -0,0 +1,32 @@ +value = $value; + return $this; + } + + public function withSubType(string $subType): self + { + $this->subType = $subType; + return $this; + } + + public function build(): WantedAnchor + { + Validation::notNull($this->value, 'value'); + Validation::notNull($this->subType, 'sub_type'); + + return new WantedAnchor($this->value, $this->subType); + } +} diff --git a/src/Identity/Policy/WantedAttribute.php b/src/Identity/Policy/WantedAttribute.php new file mode 100644 index 00000000..dc34da79 --- /dev/null +++ b/src/Identity/Policy/WantedAttribute.php @@ -0,0 +1,123 @@ +name = $name; + + $this->derivation = $derivation; + $this->optional = $optional; + $this->acceptSelfAsserted = $acceptSelfAsserted; + + if (null !== $constraints) { + Validation::isArrayOfType($constraints, [Constraint::class], 'constraints'); + $this->constraints = $constraints; + } + } + + /** + * Name identifying the WantedAttribute + * + * @return string + */ + public function getName(): string + { + return $this->name; + } + + /** + * Additional derived criteria. + * + * @return string + */ + public function getDerivation(): ?string + { + return $this->derivation; + } + + /** + * List of constraints to add to an attribute. + * + * If you do not provide any particular constraints, Yoti will provide you with the + * information from the most recently added source. + * + * @return Constraint[] $constraints + */ + public function getConstraints(): ?array + { + return $this->constraints; + } + + /** + * Accept self asserted attributes. + * + * These are attributes that have been self-declared, and not verified by Yoti. + * + * @return bool|null + */ + public function getAcceptSelfAsserted(): ?bool + { + return $this->acceptSelfAsserted; + } + + /** + * @return bool + */ + public function getOptional(): bool + { + return $this->optional; + } + + public function jsonSerialize(): stdClass + { + $data = new stdClass(); + $data->name = $this->getName(); + $data->optional = $this->getOptional(); + + if (null !== $this->getDerivation()) { + $data->derivation = $this->getDerivation(); + } + + if (null !== $this->getConstraints()) { + $data->constraints = $this->getConstraints(); + } + + if (null !== $this->getAcceptSelfAsserted()) { + $data->accept_self_asserted = $this->getAcceptSelfAsserted(); + } + + return $data; + } +} diff --git a/src/Identity/Policy/WantedAttributeBuilder.php b/src/Identity/Policy/WantedAttributeBuilder.php new file mode 100644 index 00000000..c2a53f1f --- /dev/null +++ b/src/Identity/Policy/WantedAttributeBuilder.php @@ -0,0 +1,77 @@ +name = $name; + + return $this; + } + + public function withDerivation(string $derivation): self + { + $this->derivation = $derivation; + + return $this; + } + + public function withOptional(bool $optional): self + { + $this->optional = $optional; + + return $this; + } + + public function withAcceptSelfAsserted(bool $acceptSelfAsserted): self + { + $this->acceptSelfAsserted = $acceptSelfAsserted; + + return $this; + } + + /** + * @param Constraint[] $constraints + */ + public function withConstraints(array $constraints): self + { + $this->constraints = $constraints; + + return $this; + } + + public function withConstraint(Constraint $constraint): self + { + $this->constraints[] = $constraint; + + return $this; + } + + public function build(): WantedAttribute + { + return new WantedAttribute( + $this->name, + $this->derivation, + $this->optional, + $this->acceptSelfAsserted, + $this->constraints, + ); + } +} diff --git a/src/Identity/ShareSessionCreated.php b/src/Identity/ShareSessionCreated.php new file mode 100644 index 00000000..4bb0f924 --- /dev/null +++ b/src/Identity/ShareSessionCreated.php @@ -0,0 +1,71 @@ +id = $sessionData['id']; + } + + if (isset($sessionData['status'])) { + Validation::isString($sessionData['status'], 'status'); + $this->status = $sessionData['status']; + } + + if (isset($sessionData['expiry'])) { + Validation::isString($sessionData['expiry'], 'expiry'); + $this->expiry = $sessionData['expiry']; + } + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @return string + */ + public function getStatus(): string + { + return $this->status; + } + + /** + * @return string + */ + public function getExpiry(): string + { + return $this->expiry; + } + + public function jsonSerialize(): object + { + return (object)[ + 'id' => $this->getId(), + 'status' => $this->getStatus(), + 'expiry' => $this->getExpiry(), + ]; + } +} diff --git a/src/Identity/ShareSessionCreatedQrCode.php b/src/Identity/ShareSessionCreatedQrCode.php new file mode 100644 index 00000000..901074b0 --- /dev/null +++ b/src/Identity/ShareSessionCreatedQrCode.php @@ -0,0 +1,48 @@ +id = $sessionData['id']; + } + + if (isset($sessionData['uri'])) { + $this->uri = $sessionData['uri']; + } + } + + public function jsonSerialize(): object + { + return (object)[ + 'id' => $this->id, + 'uri' => $this->uri + ]; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @return string + */ + public function getUri(): string + { + return $this->uri; + } +} diff --git a/src/Identity/ShareSessionFetched.php b/src/Identity/ShareSessionFetched.php new file mode 100644 index 00000000..ac171a2f --- /dev/null +++ b/src/Identity/ShareSessionFetched.php @@ -0,0 +1,117 @@ + $sessionData + */ + public function __construct(array $sessionData) + { + if (isset($sessionData['id'])) { + $this->id = $sessionData['id']; + } + if (isset($sessionData['status'])) { + $this->status = $sessionData['status']; + } + if (isset($sessionData['expiry'])) { + $this->expiry = $sessionData['expiry']; + } + if (isset($sessionData['created'])) { + $this->created = $sessionData['created']; + } + if (isset($sessionData['updated'])) { + $this->updated = $sessionData['updated']; + } + if (isset($sessionData['qrCode'])) { + $this->qrCodeId = $sessionData['qrCode']['id']; + } + if (isset($sessionData['receipt'])) { + $this->receiptId = $sessionData['receipt']['id']; + } + } + + public function jsonSerialize(): object + { + return (object)[ + 'id' => $this->id, + 'status' => $this->status, + 'expiry' => $this->expiry, + 'created' => $this->created, + 'updated' => $this->updated, + 'qrCodeId' => $this->qrCodeId, + 'receiptId' => $this->receiptId, + ]; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @return string + */ + public function getStatus(): string + { + return $this->status; + } + + /** + * @return string + */ + public function getCreated(): string + { + return $this->created; + } + + /** + * @return string + */ + public function getUpdated(): string + { + return $this->updated; + } + + /** + * @return string + */ + public function getExpiry(): string + { + return $this->expiry; + } + + /** + * @return string + */ + public function getQrCodeId(): string + { + return $this->qrCodeId; + } + + /** + * @return string + */ + public function getReceiptId(): string + { + return $this->receiptId; + } +} diff --git a/src/Identity/ShareSessionFetchedQrCode.php b/src/Identity/ShareSessionFetchedQrCode.php new file mode 100644 index 00000000..1f8aaabf --- /dev/null +++ b/src/Identity/ShareSessionFetchedQrCode.php @@ -0,0 +1,110 @@ + $sessionData + */ + public function __construct(array $sessionData) + { + if (isset($sessionData['id'])) { + $this->id = $sessionData['id']; + } + if (isset($sessionData['expiry'])) { + $this->expiry = $sessionData['expiry']; + } + if (isset($sessionData['policy'])) { + $this->policy = $sessionData['policy']; + } + if (isset($sessionData['extensions'])) { + foreach ($sessionData['extensions'] as $extension) { + $this->extensions[] = new Extension($extension['type'], $extension['content']); + } + } + if (isset($sessionData['session'])) { + $this->session = new ShareSessionCreated($sessionData['session']); + } + if (isset($sessionData['redirectUri'])) { + $this->redirectUri = $sessionData['redirectUri']; + } + } + + public function jsonSerialize(): object + { + return (object)[ + 'id' => $this->id, + 'expiry' => $this->expiry, + 'policy' => $this->policy, + 'extensions' => $this->extensions, + 'session' => $this->session, + 'redirectUri' => $this->redirectUri, + ]; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @return string + */ + public function getExpiry(): string + { + return $this->expiry; + } + + /** + * @return string + */ + public function getPolicy(): string + { + return $this->policy; + } + + /** + * @return Extension[] + */ + public function getExtensions(): array + { + return $this->extensions; + } + + /** + * @return ShareSessionCreated + */ + public function getSession(): ShareSessionCreated + { + return $this->session; + } + + /** + * @return string + */ + public function getRedirectUri(): string + { + return $this->redirectUri; + } +} diff --git a/src/Identity/ShareSessionNotification.php b/src/Identity/ShareSessionNotification.php new file mode 100644 index 00000000..5a6fc24f --- /dev/null +++ b/src/Identity/ShareSessionNotification.php @@ -0,0 +1,70 @@ + + */ + private array $headers; + + /** + * @param string[] $headers + */ + public function __construct(string $url, string $method, bool $verifyTls, array $headers) + { + $this->url = $url; + $this->method = $method; + $this->verifyTls = $verifyTls; + $this->headers = $headers; + } + + public function jsonSerialize(): object + { + return (object)[ + 'url' => $this->getUrl(), + 'method' => $this->getMethod(), + 'verifyTls' => $this->isVerifyTls(), + 'headers' => $this->getHeaders(), + ]; + } + + /** + * @return string + */ + public function getUrl(): string + { + return $this->url; + } + + /** + * @return string + */ + public function getMethod(): string + { + return $this->method; + } + + /** + * @return bool + */ + public function isVerifyTls(): bool + { + return $this->verifyTls; + } + + /** + * @return string[] + */ + public function getHeaders(): array + { + return $this->headers; + } +} diff --git a/src/Identity/ShareSessionNotificationBuilder.php b/src/Identity/ShareSessionNotificationBuilder.php new file mode 100644 index 00000000..39d7aba3 --- /dev/null +++ b/src/Identity/ShareSessionNotificationBuilder.php @@ -0,0 +1,65 @@ + + */ + private array $headers; + + public function withUrl(string $url): self + { + $this->url = $url; + + return $this; + } + + public function withMethod(string $method = 'POST'): self + { + $this->method = $method; + + return $this; + } + + public function withVerifyTls(bool $verifyTls = true): self + { + $this->verifyTls = $verifyTls; + + return $this; + } + + /** + * @param string[] $headers + */ + public function withHeaders(array $headers): self + { + $this->headers = $headers; + + return $this; + } + + public function withHeader(string $key, string $header): self + { + $this->headers[$key] = $header; + + return $this; + } + + public function build(): ShareSessionNotification + { + return new ShareSessionNotification( + $this->url, + $this->method, + $this->verifyTls, + $this->headers + ); + } +} diff --git a/src/Identity/ShareSessionRequest.php b/src/Identity/ShareSessionRequest.php new file mode 100644 index 00000000..94e9cadb --- /dev/null +++ b/src/Identity/ShareSessionRequest.php @@ -0,0 +1,110 @@ +|null + */ + private ?array $subject; + + private Policy $policy; + + /** + * @var Extension[]|null + */ + private ?array $extensions = null; + + private string $redirectUri; + + private ?ShareSessionNotification $notification; + + /** + * @param array|null $subject + * @param Policy $policy + * @param Extension[]|null $extensions + * @param string $redirectUri + * @param ShareSessionNotification|null $notification + */ + public function __construct( + Policy $policy, + string $redirectUri, + ?array $extensions = null, + ?array $subject = null, + ?ShareSessionNotification $notification = null + ) { + $this->policy = $policy; + $this->redirectUri = $redirectUri; + + if (null !== $extensions) { + Validation::isArrayOfType($extensions, [Extension::class], 'extensions'); + $this->extensions = $extensions; + } + + $this->subject = $subject; + $this->notification = $notification; + } + + /** + * @return array|null + */ + public function getSubject(): ?array + { + return $this->subject; + } + + /** + * @return Policy + */ + public function getPolicy(): Policy + { + return $this->policy; + } + + /** + * @return Extension[]|null + */ + public function getExtensions(): ?array + { + return $this->extensions; + } + + /** + * @return string + */ + public function getRedirectUri(): string + { + return $this->redirectUri; + } + + /** + * @return ShareSessionNotification|null + */ + public function getNotification(): ?ShareSessionNotification + { + return $this->notification; + } + + public function jsonSerialize(): \stdClass + { + $data = new \stdClass(); + $data->policy = $this->getPolicy(); + $data->redirectUri = $this->getRedirectUri(); + if (null !== $this->getSubject()) { + $data->subject = $this->getSubject(); + } + if (null !== $this->getExtensions()) { + $data->extensions = $this->getExtensions(); + } + if (null !== $this->getNotification()) { + $data->notification = $this->getNotification(); + } + + return $data; + } +} diff --git a/src/Identity/ShareSessionRequestBuilder.php b/src/Identity/ShareSessionRequestBuilder.php new file mode 100644 index 00000000..583d06fe --- /dev/null +++ b/src/Identity/ShareSessionRequestBuilder.php @@ -0,0 +1,84 @@ + + */ + private ?array $subject = null; + + private Policy $policy; + + /** + * @var Extension[] + */ + private ?array $extensions = null; + + private string $redirectUri; + + private ?ShareSessionNotification $notification = null; + + /** + * @param array $subject + */ + public function withSubject(array $subject): self + { + $this->subject = $subject; + + return $this; + } + + public function withPolicy(Policy $policy): self + { + $this->policy = $policy; + + return $this; + } + + /** + * @param Extension[] $extensions + */ + public function withExtensions(array $extensions): self + { + $this->extensions = $extensions; + + return $this; + } + + public function withExtension(Extension $extension): self + { + $this->extensions[] = $extension; + + return $this; + } + + public function withRedirectUri(string $redirectUri): self + { + $this->redirectUri = $redirectUri; + + return $this; + } + + public function withNotification(ShareSessionNotification $notification): ShareSessionRequestBuilder + { + $this->notification = $notification; + + return $this; + } + + public function build(): ShareSessionRequest + { + return new ShareSessionRequest( + $this->policy, + $this->redirectUri, + $this->extensions, + $this->subject, + $this->notification + ); + } +} diff --git a/tests/Identity/Constraint/PreferredSourcesTest.php b/tests/Identity/Constraint/PreferredSourcesTest.php new file mode 100644 index 00000000..8b5b4ff1 --- /dev/null +++ b/tests/Identity/Constraint/PreferredSourcesTest.php @@ -0,0 +1,42 @@ + $wantedAnchors, + 'soft_preference' => true + ]; + + $this->assertInstanceOf(PreferredSources::class, $preferredSource); + $this->assertEquals(json_encode($expected), json_encode($preferredSource)); + $this->assertEquals($wantedAnchors, $preferredSource->getWantedAnchors()); + $this->assertTrue($preferredSource->isSoftPreference()); + } +} diff --git a/tests/Identity/Constraint/SourceConstraintsBuilderTest.php b/tests/Identity/Constraint/SourceConstraintsBuilderTest.php new file mode 100644 index 00000000..ac6423c6 --- /dev/null +++ b/tests/Identity/Constraint/SourceConstraintsBuilderTest.php @@ -0,0 +1,66 @@ +withWantedAnchor(new WantedAnchor('SOME_VALUE')) + ->withSoftPreference(true) + ->build(); + + $this->assertInstanceOf(SourceConstraint::class, $sourceConstraint); + $this->assertInstanceOf(PreferredSources::class, $sourceConstraint->getPreferredSources()); + $this->assertEquals('SOURCE', $sourceConstraint->getType()); + } + + /** + * @covers ::build + * @covers ::withWantedAnchors + * @covers \Yoti\Identity\Constraint\SourceConstraint::__construct + * @covers \Yoti\Identity\Constraint\SourceConstraint::jsonSerialize + */ + public function testShouldBuildCorrectlyWithMultipleAnchors() + { + $wantedAnchors = [ + new WantedAnchor('some'), + new WantedAnchor('some_2'), + ]; + + $sourceConstraint = (new SourceConstraintBuilder()) + ->withWantedAnchors($wantedAnchors) + ->build(); + + $expectedConstraint = [ + 'type' => 'SOURCE', + 'preferred_sources' => $sourceConstraint->getPreferredSources() + ]; + + $this->assertEquals($wantedAnchors, $sourceConstraint->getPreferredSources()->getWantedAnchors()); + $this->assertEquals( + json_encode($wantedAnchors), + json_encode($sourceConstraint->getPreferredSources()->getWantedAnchors()) + ); + $this->assertEquals(json_encode($expectedConstraint), json_encode($sourceConstraint)); + } +} diff --git a/tests/Identity/Extension/BasicExtensionBuilderTest.php b/tests/Identity/Extension/BasicExtensionBuilderTest.php new file mode 100644 index 00000000..026a045f --- /dev/null +++ b/tests/Identity/Extension/BasicExtensionBuilderTest.php @@ -0,0 +1,40 @@ +withType($someType) + ->withContent($someContent) + ->build(); + + $expectedJson = json_encode([ + 'type' => $someType, + 'content' => $someContent, + ]); + + $this->assertEquals($expectedJson, json_encode($constraints)); + } +} diff --git a/tests/Identity/Extension/LocationConstraintContentTest.php b/tests/Identity/Extension/LocationConstraintContentTest.php new file mode 100644 index 00000000..a0973db1 --- /dev/null +++ b/tests/Identity/Extension/LocationConstraintContentTest.php @@ -0,0 +1,44 @@ + [ + 'latitude' => $expectedLatitude, + 'longitude' => $expectedLongitude, + 'radius' => $expectedRadius, + 'max_uncertainty_radius' => $expectedMaxUncertainty, + ], + ]); + + $this->assertEquals($expectedJson, json_encode($content)); + } +} diff --git a/tests/Identity/Extension/LocationConstraintExtensionBuilderTest.php b/tests/Identity/Extension/LocationConstraintExtensionBuilderTest.php new file mode 100644 index 00000000..875b8bb7 --- /dev/null +++ b/tests/Identity/Extension/LocationConstraintExtensionBuilderTest.php @@ -0,0 +1,164 @@ +expectException(\RangeException::class); + $this->expectExceptionMessage('\'latitude\' value \'-91\' is less than \'-90\''); + + (new LocationConstraintExtensionBuilder()) + ->withLatitude(-91) + ->withLongitude(0) + ->build(); + } + + /** + * @covers ::withLatitude + */ + public function testLatitudeTooHigh() + { + $this->expectException(\RangeException::class); + $this->expectExceptionMessage('\'latitude\' value \'91\' is greater than \'90\''); + + (new LocationConstraintExtensionBuilder()) + ->withLatitude(91) + ->withLongitude(0) + ->build(); + } + + /** + * @covers ::withLongitude + */ + public function testLongitudeTooLow() + { + $this->expectException(\RangeException::class); + $this->expectExceptionMessage('\'longitude\' value \'-181\' is less than \'-180\''); + + (new LocationConstraintExtensionBuilder()) + ->withLatitude(0) + ->withLongitude(-181) + ->build(); + } + + /** + * @covers ::withLongitude + */ + public function testLongitudeTooHigh() + { + $this->expectException(\RangeException::class); + $this->expectExceptionMessage('\'longitude\' value \'181\' is greater than \'180\''); + + (new LocationConstraintExtensionBuilder()) + ->withLatitude(0) + ->withLongitude(181) + ->build(); + } + + /** + * @covers ::withRadius + */ + public function testRadiusLessThanZero() + { + $this->expectException(\RangeException::class); + $this->expectExceptionMessage('\'radius\' value \'-1\' is less than \'0\''); + + (new LocationConstraintExtensionBuilder()) + ->withLatitude(0) + ->withLongitude(0) + ->withRadius(-1) + ->build(); + } + + /** + * @covers ::withMaxUncertainty + */ + public function testMaxUncertaintyLessThanZero() + { + $this->expectException(\RangeException::class); + $this->expectExceptionMessage('\'maxUncertainty\' value \'-1\' is less than \'0\''); + + (new LocationConstraintExtensionBuilder()) + ->withLatitude(0) + ->withLongitude(0) + ->withMaxUncertainty(-1) + ->build(); + } + + /** + * @covers ::build + */ + public function testBuild() + { + $expectedLatitude = 50.8169; + $expectedLongitude = -0.1367; + $expectedRadius = 30; + $expectedMaxUncertainty = 40; + + $extension = (new LocationConstraintExtensionBuilder()) + ->withLatitude($expectedLatitude) + ->withLongitude($expectedLongitude) + ->withRadius($expectedRadius) + ->withMaxUncertainty($expectedMaxUncertainty) + ->build(); + + $expectedJson = json_encode([ + 'type' => self::TYPE_LOCATION_CONSTRAINT, + 'content' => [ + 'expected_device_location' => [ + 'latitude' => $expectedLatitude, + 'longitude' => $expectedLongitude, + 'radius' => $expectedRadius, + 'max_uncertainty_radius' => $expectedMaxUncertainty, + ], + ], + ]); + + $this->assertEquals($expectedJson, json_encode($extension)); + } + + /** + * @covers ::build + */ + public function testBuildDefaultValues() + { + $expectedLatitude = 50.8169; + $expectedLongitude = -0.1367; + $expectedDefaultRadius = 150; + $expectedDefaultMaxUncertainty = 150; + + $extension = (new LocationConstraintExtensionBuilder()) + ->withLatitude($expectedLatitude) + ->withLongitude($expectedLongitude) + ->build(); + + $expectedJson = json_encode([ + 'type' => self::TYPE_LOCATION_CONSTRAINT, + 'content' => [ + 'expected_device_location' => [ + 'latitude' => $expectedLatitude, + 'longitude' => $expectedLongitude, + 'radius' => $expectedDefaultRadius, + 'max_uncertainty_radius' => $expectedDefaultMaxUncertainty, + ], + ], + ]); + + $this->assertEquals($expectedJson, json_encode($extension)); + } +} diff --git a/tests/Identity/Extension/ThirdPartyAttributeContentTest.php b/tests/Identity/Extension/ThirdPartyAttributeContentTest.php new file mode 100644 index 00000000..4fe6b729 --- /dev/null +++ b/tests/Identity/Extension/ThirdPartyAttributeContentTest.php @@ -0,0 +1,42 @@ + '2019-12-02T12:00:00.123+00:00', + 'definitions' => [ + [ + 'name' => $someDefinition, + ], + ], + ]); + + $this->assertEquals($expectedJson, json_encode($thirdPartyAttributeContent)); + } +} diff --git a/tests/Identity/Extension/ThirdPartyAttributeExtensionBuilderTest.php b/tests/Identity/Extension/ThirdPartyAttributeExtensionBuilderTest.php new file mode 100644 index 00000000..43252040 --- /dev/null +++ b/tests/Identity/Extension/ThirdPartyAttributeExtensionBuilderTest.php @@ -0,0 +1,132 @@ +someDate = new \DateTime(self::SOME_DATE_STRING); + } + + /** + * @covers ::withExpiryDate + * @covers ::withDefinition + * @covers ::build + */ + public function testBuild() + { + $thirdPartyAttributeExtension = (new ThirdPartyAttributeExtensionBuilder()) + ->withExpiryDate($this->someDate) + ->withDefinition(self::SOME_DEFINITION) + ->withDefinition(self::SOME_OTHER_DEFINITION) + ->build(); + + $expectedJson = $this->createExpectedJson( + $this->someDate->format(\DateTime::RFC3339_EXTENDED), + [ + self::SOME_DEFINITION, + self::SOME_OTHER_DEFINITION, + ] + ); + + $this->assertJsonStringEqualsJsonString( + $expectedJson, + json_encode($thirdPartyAttributeExtension) + ); + } + + /** + * @covers ::withDefinitions + */ + public function testWithDefinitionsOverwritesExistingDefinitions() + { + $thirdPartyAttributeExtension = (new ThirdPartyAttributeExtensionBuilder()) + ->withExpiryDate($this->someDate) + ->withDefinition('initial definition') + ->withDefinitions([ + self::SOME_DEFINITION, + self::SOME_OTHER_DEFINITION, + ]) + ->build(); + + $this->assertJsonStringEqualsJsonString( + $this->createExpectedJson( + $this->someDate->format(\DateTime::RFC3339_EXTENDED), + [ + self::SOME_DEFINITION, + self::SOME_OTHER_DEFINITION, + ] + ), + json_encode($thirdPartyAttributeExtension) + ); + } + + /** + * @covers ::withExpiryDate + * + * @dataProvider expiryDateDataProvider + */ + public function testWithExpiryDateFormat($inputDate, $outputDate) + { + $thirdPartyAttributeExtension = (new ThirdPartyAttributeExtensionBuilder()) + ->withExpiryDate(new \DateTime($inputDate)) + ->build(); + + $this->assertJsonStringEqualsJsonString( + $this->createExpectedJson($outputDate, []), + json_encode($thirdPartyAttributeExtension) + ); + } + + /** + * Provides test expiry dates. + */ + public function expiryDateDataProvider(): array + { + return [ + ['2020-01-02T01:02:03.123456Z', '2020-01-02T01:02:03.123+00:00'], + ['2020-01-01T01:02:03.123+04:00', '2019-12-31T21:02:03.123+00:00'], + ['2020-01-02T01:02:03.123-02:00', '2020-01-02T03:02:03.123+00:00'] + ]; + } + + /** + * Create expected third party extension JSON. + * + * @param string $expiryDate + * @param string[] $definitions + * + * @return string + */ + private function createExpectedJson(string $expiryDate, array $definitions): string + { + return json_encode([ + 'type' => self::THIRD_PARTY_ATTRIBUTE_TYPE, + 'content' => [ + 'expiry_date' => $expiryDate, + 'definitions' => array_map( + function ($definition) { + return [ 'name' => $definition ]; + }, + $definitions + ), + ], + ]); + } +} diff --git a/tests/Identity/Extension/TransactionalFlowExtensionBuilderTest.php b/tests/Identity/Extension/TransactionalFlowExtensionBuilderTest.php new file mode 100644 index 00000000..6ad50610 --- /dev/null +++ b/tests/Identity/Extension/TransactionalFlowExtensionBuilderTest.php @@ -0,0 +1,36 @@ + 'content']; + + $constraints = (new TransactionalFlowExtensionBuilder()) + ->withContent($someContent) + ->build(); + + $expectedJson = json_encode([ + 'type' => self::TYPE_TRANSACTIONAL_FLOW, + 'content' => $someContent, + ]); + + $this->assertEquals($expectedJson, json_encode($constraints)); + } +} diff --git a/tests/Identity/Policy/PolicyBuilderTest.php b/tests/Identity/Policy/PolicyBuilderTest.php new file mode 100644 index 00000000..d223bd79 --- /dev/null +++ b/tests/Identity/Policy/PolicyBuilderTest.php @@ -0,0 +1,644 @@ +withFamilyName() + ->withGivenNames() + ->withFullName() + ->withDateOfBirth() + ->withGender() + ->withPostalAddress() + ->withStructuredPostalAddress() + ->withNationality() + ->withPhoneNumber() + ->withSelfie() + ->withEmail() + ->withDocumentDetails() + ->withDocumentImages() + ->build(); + + $expectedWantedAttributeData = [ + 'wanted' => [ + ['name' => 'family_name', 'optional' => false], + ['name' => 'given_names', 'optional' => false], + ['name' => 'full_name', 'optional' => false], + ['name' => 'date_of_birth', 'optional' => false], + ['name' => 'gender', 'optional' => false], + ['name' => 'postal_address', 'optional' => false], + ['name' => 'structured_postal_address', 'optional' => false], + ['name' => 'nationality', 'optional' => false], + ['name' => 'phone_number', 'optional' => false], + ['name' => 'selfie', 'optional' => false], + ['name' => 'email_address', 'optional' => false], + ['name' => 'document_details', 'optional' => false], + ['name' => 'document_images', 'optional' => false], + ], + 'wanted_auth_types' => [], + 'wanted_remember_me' => false, + 'wanted_remember_me_optional' => false, + 'identity_profile_requirements' => null, + ]; + + $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); + } + + /** + * @covers ::withWantedAttributeByName + */ + public function testWithWantedAttributeByNameWithConstraints() + { + $someAttributeName = 'some_attribute_name'; + $sourceConstraint = (new SourceConstraintBuilder()) + ->withWantedAnchor(new WantedAnchor('SOME')) + ->build(); + + $constraints = [ + $sourceConstraint, + ]; + + $policy = (new PolicyBuilder()) + ->withWantedAttributeByName($someAttributeName, $constraints, true) + ->build(); + + $expectedWantedAttributeData = [ + 'wanted' => [ + [ + 'name' => $someAttributeName, + 'optional' => false, + "constraints" => [ + [ + "type" => "SOURCE", + "preferred_sources" => [ + "anchors" => [ + [ + "name" => "SOME", + "sub_type" => "", + ] + ], + "soft_preference" => false, + ], + ], + ], + "accept_self_asserted" => true, + ], + ], + 'wanted_auth_types' => [], + 'wanted_remember_me' => false, + 'wanted_remember_me_optional' => false, + 'identity_profile_requirements' => null, + ]; + + $this->assertJsonStringEqualsJsonString( + json_encode($expectedWantedAttributeData), + json_encode($policy) + ); + } + + /** + * @covers ::withWantedAttribute + * @covers ::withFamilyName + */ + public function testWithDuplicateAttribute() + { + $policy = (new PolicyBuilder()) + ->withFamilyName() + ->withFamilyName() + ->build(); + + $expectedWantedAttributeData = [ + 'wanted' => [ + ['name' => 'family_name', 'optional' => false], + ], + 'wanted_auth_types' => [], + 'wanted_remember_me' => false, + 'wanted_remember_me_optional' => false, + 'identity_profile_requirements' => null, + ]; + + $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); + } + + /** + * @covers ::withWantedAttribute + * @covers ::withFamilyName + */ + public function testWithDuplicateAttributeDifferentConstraints() + { + $sourceConstraint = (new SourceConstraintBuilder()) + ->withWantedAnchor(new WantedAnchor('SOME')) + ->build(); + + $sourceConstraint2 = (new SourceConstraintBuilder()) + ->withWantedAnchor(new WantedAnchor('SOME_2')) + ->build(); + + + $policy = (new PolicyBuilder()) + ->withFamilyName() + ->withFamilyName([$sourceConstraint]) + ->withFamilyName([$sourceConstraint2]) + ->build(); + + $jsonData = $policy->jsonSerialize(); + + $this->assertCount(3, $jsonData->wanted); + foreach ($jsonData->wanted as $wantedAttribute) { + $this->assertEquals('family_name', $wantedAttribute->getName()); + } + } + + /** + * @covers ::build + * @covers ::withWantedAttributeByName + */ + public function testWithWantedAttributeByName() + { + $policy = (new PolicyBuilder()) + ->withWantedAttributeByName('family_name') + ->withWantedAttributeByName('given_names') + ->build(); + + $expectedWantedAttributeData = [ + 'wanted' => [ + ['name' => 'family_name', 'optional' => false], + ['name' => 'given_names', 'optional' => false], + ], + 'wanted_auth_types' => [], + 'wanted_remember_me' => false, + 'wanted_remember_me_optional' => false, + 'identity_profile_requirements' => null, + ]; + + $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); + } + + /** + * @covers ::build + * @covers ::withWantedAttribute + */ + public function testWithAttributeObjects() + { + $wantedFamilyName = (new WantedAttributeBuilder()) + ->withName('family_name') + ->build(); + + $wantedGivenNames = (new WantedAttributeBuilder()) + ->withName('given_names') + ->build(); + + $policy = (new PolicyBuilder()) + ->withWantedAttribute($wantedFamilyName) + ->withWantedAttribute($wantedGivenNames) + ->build(); + + $expectedWantedAttributeData = [ + 'wanted' => [ + ['name' => 'family_name', 'optional' => false], + ['name' => 'given_names', 'optional' => false], + ], + 'wanted_auth_types' => [], + 'wanted_remember_me' => false, + 'wanted_remember_me_optional' => false, + 'identity_profile_requirements' => null, + ]; + + $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); + } + + /** + * @covers ::withDateOfBirth + * @covers ::withAgeOver + * @covers ::withAgeUnder + * @covers ::withAgeDerivedAttribute + */ + public function testWithAgeDerivedAttributes() + { + $policy = (new PolicyBuilder()) + ->withDateOfBirth() + ->withAgeOver(18) + ->withAgeUnder(30) + ->withAgeUnder(40) + ->build(); + + $expectedWantedAttributeData = [ + 'wanted' => [ + ['name' => 'date_of_birth', 'optional' => false], + ['name' => 'date_of_birth', 'optional' => false, 'derivation' => 'age_over:18'], + ['name' => 'date_of_birth', 'optional' => false, 'derivation' => 'age_under:30'], + ['name' => 'date_of_birth', 'optional' => false, 'derivation' => 'age_under:40'], + ], + 'wanted_auth_types' => [], + 'wanted_remember_me' => false, + 'wanted_remember_me_optional' => false, + 'identity_profile_requirements' => null, + ]; + + $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); + } + + /** + * @covers ::withAgeDerivedAttribute + */ + public function testWithAgeDerivedAttributesWithConstraints() + { + $sourceConstraint = (new SourceConstraintBuilder()) + ->withWantedAnchor(new WantedAnchor('SOME')) + ->build(); + + + $policy = (new PolicyBuilder()) + ->withAgeDerivedAttribute(UserProfile::AGE_OVER . '18', [$sourceConstraint]) + ->build(); + + $expectedWantedAttributeData = [ + 'wanted' => [ + [ + 'name' => 'date_of_birth', + 'optional' => false, + 'derivation' => 'age_over:18', + "constraints" => [ + [ + "type" => "SOURCE", + "preferred_sources" => [ + "anchors" => [ + [ + "name" => "SOME", + "sub_type" => "", + ] + ], + "soft_preference" => false, + ], + ], + ], + ], + ], + 'wanted_auth_types' => [], + 'wanted_remember_me' => false, + 'wanted_remember_me_optional' => false, + 'identity_profile_requirements' => null, + ]; + + $this->assertJsonStringEqualsJsonString( + json_encode($expectedWantedAttributeData), + json_encode($policy) + ); + } + + + /** + * @covers ::withAgeUnder + * @covers ::withAgeDerivedAttribute + * @covers ::withWantedAttribute + */ + public function testWithDuplicateAgeDerivedAttributes() + { + $policy = (new PolicyBuilder()) + ->withAgeUnder(30) + ->withAgeUnder(30) + ->build(); + + $expectedWantedAttributeData = [ + 'wanted' => [ + ['name' => 'date_of_birth', 'optional' => false, 'derivation' => 'age_under:30'], + ], + 'wanted_auth_types' => [], + 'wanted_remember_me' => false, + 'wanted_remember_me_optional' => false, + 'identity_profile_requirements' => null, + ]; + + $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); + } + + /** + * @covers ::withSelfieAuthentication + * @covers ::withPinAuthentication + * @covers ::withWantedAuthType + */ + public function testWithAuthTypes() + { + $policy = (new PolicyBuilder()) + ->withSelfieAuthentication() + ->withPinAuthentication() + ->withWantedAuthType(99) + ->build(); + + $expectedWantedAttributeData = [ + 'wanted' => [], + 'wanted_auth_types' => [self::SELFIE_AUTH_TYPE, self::PIN_AUTH_TYPE, 99], + 'wanted_remember_me' => false, + 'wanted_remember_me_optional' => false, + 'identity_profile_requirements' => null, + ]; + + $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); + } + + /** + * @covers ::withSelfieAuthentication + * @covers ::withPinAuthentication + * @covers ::withWantedAuthType + */ + public function testWithAuthTypesTrue() + { + $policy = (new PolicyBuilder()) + ->withSelfieAuthentication() + ->withPinAuthentication() + ->withWantedAuthType(99) + ->build(); + + $expectedWantedAttributeData = [ + 'wanted' => [], + 'wanted_auth_types' => [self::SELFIE_AUTH_TYPE, self::PIN_AUTH_TYPE, 99], + 'wanted_remember_me' => false, + 'wanted_remember_me_optional' => false, + 'identity_profile_requirements' => null + ]; + + $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); + } + + /** + * @covers ::withSelfieAuthentication + * @covers ::withPinAuthentication + * @covers ::withWantedAuthType + */ + public function testWithAuthTypesFalse() + { + $policy = (new PolicyBuilder()) + ->withSelfieAuthentication(false) + ->withPinAuthentication(false) + ->withWantedAuthType(99, false) + ->build(); + + $expectedWantedAttributeData = [ + 'wanted' => [], + 'wanted_auth_types' => [], + 'wanted_remember_me' => false, + 'wanted_remember_me_optional' => false, + 'identity_profile_requirements' => null, + ]; + + $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); + } + + /** + * @covers ::withSelfieAuthentication + * @covers ::withPinAuthentication + */ + public function testWithAuthEnabledThenDisabled() + { + $policy = (new PolicyBuilder()) + ->withSelfieAuthentication() + ->withSelfieAuthentication(false) + ->withPinAuthentication() + ->withPinAuthentication(false) + ->build(); + + $expectedWantedAttributeData = [ + 'wanted' => [], + 'wanted_auth_types' => [], + 'wanted_remember_me' => false, + 'wanted_remember_me_optional' => false, + 'identity_profile_requirements' => null, + ]; + + $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); + } + + /** + * @covers ::withSelfieAuthentication + */ + public function testWithSameAuthTypeAddedOnlyOnce() + { + $policy = (new PolicyBuilder()) + ->withSelfieAuthentication() + ->withSelfieAuthentication() + ->withSelfieAuthentication() + ->build(); + + $expectedWantedAttributeData = [ + 'wanted' => [], + 'wanted_auth_types' => [self::SELFIE_AUTH_TYPE], + 'wanted_remember_me' => false, + 'wanted_remember_me_optional' => false, + 'identity_profile_requirements' => null, + ]; + + $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); + } + + /** + * @covers ::withSelfieAuthentication + */ + public function testWithOnlyTwoAuthTypes() + { + $policy = (new PolicyBuilder()) + ->withSelfieAuthentication() + ->withPinAuthentication() + ->build(); + + $expectedWantedAttributeData = [ + 'wanted' => [], + 'wanted_auth_types' => [self::SELFIE_AUTH_TYPE, self::PIN_AUTH_TYPE], + 'wanted_remember_me' => false, + 'wanted_remember_me_optional' => false, + 'identity_profile_requirements' => null, + ]; + + $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); + } + + /** + * @covers ::withSelfieAuthentication + */ + public function testWithNoSelfieAuthAfterRemoval() + { + $policy = (new PolicyBuilder()) + ->withSelfieAuthentication() + ->withSelfieAuthentication(false) + ->build(); + + $expectedWantedAttributeData = [ + 'wanted' => [], + 'wanted_auth_types' => [], + 'wanted_remember_me' => false, + 'wanted_remember_me_optional' => false, + 'identity_profile_requirements' => null, + ]; + + $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); + } + + /** + * @covers ::withSelfieAuthentication + */ + public function testWithNoPinAuthAfterRemoval() + { + $policy = (new PolicyBuilder()) + ->withPinAuthentication() + ->withPinAuthentication(false) + ->build(); + + $expectedWantedAttributeData = [ + 'wanted' => [], + 'wanted_auth_types' => [], + 'wanted_remember_me' => false, + 'wanted_remember_me_optional' => false, + 'identity_profile_requirements' => null, + ]; + + $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); + } + + + /** + * @covers ::withWantedRememberMe + */ + public function testWithRememberMe() + { + $policy = (new PolicyBuilder()) + ->withWantedRememberMe(true) + ->build(); + + $expectedWantedAttributeData = [ + 'wanted' => [], + 'wanted_auth_types' => [], + 'wanted_remember_me' => true, + 'wanted_remember_me_optional' => false, + 'identity_profile_requirements' => null, + ]; + + $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); + } + + /** + * @covers ::withWantedRememberMe + */ + public function testWithoutRememberMe() + { + $policy = (new PolicyBuilder()) + ->withWantedRememberMe(false) + ->build(); + + $expectedWantedAttributeData = [ + 'wanted' => [], + 'wanted_auth_types' => [], + 'wanted_remember_me' => false, + 'wanted_remember_me_optional' => false, + 'identity_profile_requirements' => null + ]; + + $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); + } + + /** + * @covers ::withWantedRememberMeOptional + */ + public function testWithRememberMeOptional() + { + $policy = (new PolicyBuilder()) + ->withWantedRememberMeOptional(true) + ->build(); + + $expectedWantedAttributeData = [ + 'wanted' => [], + 'wanted_auth_types' => [], + 'wanted_remember_me' => false, + 'wanted_remember_me_optional' => true, + 'identity_profile_requirements' => null, + ]; + + $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); + } + + /** + * @covers ::withWantedRememberMeOptional + */ + public function testWithoutRememberMeOptional() + { + $policy = (new PolicyBuilder()) + ->withWantedRememberMeOptional(false) + ->build(); + + $expectedWantedAttributeData = [ + 'wanted' => [], + 'wanted_auth_types' => [], + 'wanted_remember_me' => false, + 'wanted_remember_me_optional' => false, + 'identity_profile_requirements' => null + ]; + + $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); + } + + /** + * @covers ::withIdentityProfileRequirements + * @covers \Yoti\Identity\Policy\Policy::__construct + * @covers \Yoti\Identity\Policy\Policy::getIdentityProfileRequirements + * @covers \Yoti\Identity\Policy\Policy::jsonSerialize + */ + public function testWithIdentityProfileRequirements() + { + $identityProfileSample = (object)[ + 'trust_framework' => 'UK_TFIDA', + 'scheme' => [ + 'type' => 'DBS', + 'objective' => 'STANDARD' + ] + ]; + + $expectedWantedAttributeData = [ + 'wanted' => [], + 'wanted_auth_types' => [], + 'wanted_remember_me' => false, + 'wanted_remember_me_optional' => false, + 'identity_profile_requirements' => $identityProfileSample + ]; + + $policy = (new PolicyBuilder()) + ->withIdentityProfileRequirements($identityProfileSample) + ->build(); + + $this->assertEquals(json_encode($expectedWantedAttributeData), json_encode($policy)); + $this->assertEquals($identityProfileSample, $policy->getIdentityProfileRequirements()); + } +} diff --git a/tests/Identity/Policy/WantedAnchorBuilderTest.php b/tests/Identity/Policy/WantedAnchorBuilderTest.php new file mode 100644 index 00000000..2d0479e0 --- /dev/null +++ b/tests/Identity/Policy/WantedAnchorBuilderTest.php @@ -0,0 +1,39 @@ +withValue($someName) + ->withSubType($someSubType) + ->build(); + + $expectedJsonData = [ + 'name' => $someName, + 'sub_type' => $someSubType, + ]; + + $this->assertEquals(json_encode($expectedJsonData), json_encode($wantedAnchor)); + } +} diff --git a/tests/Identity/Policy/WantedAttributeBuilderTest.php b/tests/Identity/Policy/WantedAttributeBuilderTest.php new file mode 100644 index 00000000..7cd8a8f1 --- /dev/null +++ b/tests/Identity/Policy/WantedAttributeBuilderTest.php @@ -0,0 +1,162 @@ +withWantedAnchor(new WantedAnchor('SOME')) + ->build(); + + $wantedAttribute = (new WantedAttributeBuilder()) + ->withName($someName) + ->withDerivation($someDerivation) + ->withOptional(true) + ->withConstraint($sourceConstraint) + ->withAcceptSelfAsserted(false) + ->build(); + + $expectedJsonData = [ + 'name' => $someName, + 'optional' => true, + 'derivation' => $someDerivation, + 'constraints' => [$sourceConstraint], + 'accept_self_asserted' => false, + ]; + + $this->assertEquals(json_encode($expectedJsonData), json_encode($wantedAttribute)); + $this->assertTrue($wantedAttribute->getOptional()); + $this->assertContains($sourceConstraint, $wantedAttribute->getConstraints()); + $this->assertFalse($wantedAttribute->getAcceptSelfAsserted()); + } + + /** + * @covers ::build + * @covers ::withName + */ + public function testEmptyName() + { + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('name cannot be empty'); + + (new WantedAttributeBuilder()) + ->withName('') + ->build(); + } + + /** + * @covers ::withAcceptSelfAsserted + * @covers \Yoti\ShareUrl\Policy\WantedAttribute::__construct + * @covers \Yoti\ShareUrl\Policy\WantedAttribute::jsonSerialize + * @covers \Yoti\ShareUrl\Policy\WantedAttribute::getAcceptSelfAsserted + */ + public function testAcceptSelfAsserted() + { + $someName = 'some name'; + + $expectedJsonData = [ + 'name' => $someName, + 'optional' => false, + 'accept_self_asserted' => true, + ]; + + $wantedAttributeDefault = (new WantedAttributeBuilder()) + ->withName($someName) + ->withAcceptSelfAsserted(true) + ->build(); + + $this->assertEquals(json_encode($expectedJsonData), json_encode($wantedAttributeDefault)); + + $wantedAttribute = (new WantedAttributeBuilder()) + ->withName($someName) + ->withAcceptSelfAsserted(true) + ->build(); + + $this->assertEquals(json_encode($expectedJsonData), json_encode($wantedAttribute)); + } + + /** + * @covers ::withAcceptSelfAsserted + * @covers \Yoti\ShareUrl\Policy\WantedAttribute::__construct + * @covers \Yoti\ShareUrl\Policy\WantedAttribute::jsonSerialize + * @covers \Yoti\ShareUrl\Policy\WantedAttribute::getAcceptSelfAsserted + */ + public function testWithoutAcceptSelfAsserted() + { + $someName = 'some name'; + + $expectedJsonData = [ + 'name' => $someName, + 'optional' => false, + 'accept_self_asserted' => false, + ]; + + $wantedAttribute = (new WantedAttributeBuilder()) + ->withName($someName) + ->withAcceptSelfAsserted(false) + ->build(); + + $this->assertEquals(json_encode($expectedJsonData), json_encode($wantedAttribute)); + } + + /** + * @covers ::withAcceptSelfAsserted + * @covers ::withConstraints + * @covers \Yoti\ShareUrl\Policy\WantedAttribute::__construct + * @covers \Yoti\ShareUrl\Policy\WantedAttribute::jsonSerialize + * @covers \Yoti\ShareUrl\Policy\WantedAttribute::getAcceptSelfAsserted + */ + public function testWithMultipleConstraints() + { + $sourceConstraint = (new SourceConstraintBuilder()) + ->withWantedAnchor(new WantedAnchor('SOME')) + ->build(); + + $sourceConstraint2 = (new SourceConstraintBuilder()) + ->withWantedAnchor(new WantedAnchor('SOME_2')) + ->build(); + + + $constraints = [ + $sourceConstraint, + $sourceConstraint2 + ]; + + $wantedAttribute = (new WantedAttributeBuilder()) + ->withName('someName') + ->withAcceptSelfAsserted(false) + ->withConstraints($constraints) + ->build(); + + $this->assertEquals($constraints, $wantedAttribute->getConstraints()); + } +} diff --git a/tests/Identity/ShareSessionCreatedQrCodeTest.php b/tests/Identity/ShareSessionCreatedQrCodeTest.php new file mode 100644 index 00000000..c0fc50ba --- /dev/null +++ b/tests/Identity/ShareSessionCreatedQrCodeTest.php @@ -0,0 +1,42 @@ + self::SOME_ID, + 'uri' => self::SOME_URI, + 'failed' => 'failed' + ]); + + $expected = [ + 'id' => self::SOME_ID, + 'uri' => self::SOME_URI, + ]; + + $this->assertInstanceOf(ShareSessionCreatedQrCode::class, $qrCode); + + $this->assertEquals(self::SOME_ID, $qrCode->getId()); + $this->assertEquals(self::SOME_URI, $qrCode->getUri()); + + $this->assertEquals(json_encode($expected), json_encode($qrCode)); + } +} diff --git a/tests/Identity/ShareSessionCreatedTest.php b/tests/Identity/ShareSessionCreatedTest.php new file mode 100644 index 00000000..380be268 --- /dev/null +++ b/tests/Identity/ShareSessionCreatedTest.php @@ -0,0 +1,45 @@ + self::SOME_ID, + 'status' => self::SOME_STATUS, + 'expiry' => self::SOME_EXPIRY, + 'failed' => 'SQL injection' + ]); + + $expected = [ + 'id' => self::SOME_ID, + 'status' => self::SOME_STATUS, + 'expiry' => self::SOME_EXPIRY, + ]; + + $this->assertInstanceOf(ShareSessionCreated::class, $shareSession); + $this->assertEquals(self::SOME_ID, $shareSession->getId()); + $this->assertEquals(self::SOME_STATUS, $shareSession->getStatus()); + $this->assertEquals(self::SOME_EXPIRY, $shareSession->getExpiry()); + $this->assertEquals(json_encode($expected), json_encode($shareSession)); + } +} diff --git a/tests/Identity/ShareSessionFetchedQrCodeTest.php b/tests/Identity/ShareSessionFetchedQrCodeTest.php new file mode 100644 index 00000000..3be47c69 --- /dev/null +++ b/tests/Identity/ShareSessionFetchedQrCodeTest.php @@ -0,0 +1,76 @@ + 'some', 'content' => 'content'], + ['type' => 'some2', 'content' => 'content2'], + ]; + + $shareSession = [ + 'id' => 'some', + 'status' => 'status', + 'expiry' => 'expiry', + ]; + + $qrCode = new ShareSessionFetchedQrCode([ + 'id' => self::SOME_ID, + 'expiry' => self::SOME_EXPIRY, + 'policy' => self::SOME_POLICY, + 'extensions' => $extensions, + 'session' => $shareSession, + 'redirectUri' => self::SOME_REDIRECT_URI, + ]); + + $expected = [ + 'id' => self::SOME_ID, + 'expiry' => self::SOME_EXPIRY, + 'policy' => self::SOME_POLICY, + 'extensions' => $extensions, + 'session' => $shareSession, + 'redirectUri' => self::SOME_REDIRECT_URI, + ]; + + $this->assertInstanceOf(ShareSessionFetchedQrCode::class, $qrCode); + + $this->assertEquals(self::SOME_ID, $qrCode->getId()); + $this->assertEquals(self::SOME_EXPIRY, $qrCode->getExpiry()); + $this->assertEquals(self::SOME_POLICY, $qrCode->getPolicy()); + $this->assertEquals(self::SOME_REDIRECT_URI, $qrCode->getRedirectUri()); + + $this->assertInstanceOf(ShareSessionCreated::class, $qrCode->getSession()); + + $this->assertContainsOnlyInstancesOf(Extension::class, $qrCode->getExtensions()); + + $this->assertEquals(self::SOME_REDIRECT_URI, $qrCode->getRedirectUri()); + + $this->assertEquals(json_encode($expected), json_encode($qrCode)); + } +} diff --git a/tests/Identity/ShareSessionFetchedTest.php b/tests/Identity/ShareSessionFetchedTest.php new file mode 100644 index 00000000..cc38224d --- /dev/null +++ b/tests/Identity/ShareSessionFetchedTest.php @@ -0,0 +1,66 @@ + self::SOME_ID, + 'status' => self::SOME_STATUS, + 'expiry' => self::SOME_EXPIRY, + 'created' => self::SOME_CREATED, + 'updated' => self::SOME_UPDATED, + 'failed' => 'SQL injection', + 'qrCode' => ['id' => self::SOME_QRCODE_ID], + 'receipt' => ['id' => self::SOME_RECEIPT_ID], + ]); + + $expected = [ + 'id' => self::SOME_ID, + 'status' => self::SOME_STATUS, + 'expiry' => self::SOME_EXPIRY, + 'created' => self::SOME_CREATED, + 'updated' => self::SOME_UPDATED, + 'qrCodeId' => self::SOME_QRCODE_ID, + 'receiptId' => self::SOME_RECEIPT_ID, + ]; + + $this->assertInstanceOf(ShareSessionFetched::class, $shareSession); + $this->assertEquals(self::SOME_ID, $shareSession->getId()); + $this->assertEquals(self::SOME_STATUS, $shareSession->getStatus()); + $this->assertEquals(self::SOME_EXPIRY, $shareSession->getExpiry()); + $this->assertEquals(self::SOME_CREATED, $shareSession->getCreated()); + $this->assertEquals(self::SOME_UPDATED, $shareSession->getUpdated()); + $this->assertEquals(self::SOME_QRCODE_ID, $shareSession->getQrCodeId()); + $this->assertEquals(self::SOME_RECEIPT_ID, $shareSession->getReceiptId()); + $this->assertEquals(json_encode($expected), json_encode($shareSession)); + } +} diff --git a/tests/Identity/ShareSessionNotificationBuilderTest.php b/tests/Identity/ShareSessionNotificationBuilderTest.php new file mode 100644 index 00000000..ffee1e5e --- /dev/null +++ b/tests/Identity/ShareSessionNotificationBuilderTest.php @@ -0,0 +1,80 @@ + 'auth', 'header_3' => 'auth_3']; + + /** + * @covers ::withUrl + * @covers ::withMethod + * @covers ::withHeader + * @covers ::withVerifyTls + * @covers ::build + * @covers \Yoti\Identity\ShareSessionNotification::getUrl + * @covers \Yoti\Identity\ShareSessionNotification::getHeaders + * @covers \Yoti\Identity\ShareSessionNotification::getMethod + * @covers \Yoti\Identity\ShareSessionNotification::getUrl + * @covers \Yoti\Identity\ShareSessionNotification::__construct + */ + public function testShouldBuildCorrectly() + { + $shareNotification = (new ShareSessionNotificationBuilder()) + ->withMethod() + ->withUrl(self::URL) + ->withHeader(self::HEADER_KEY, self::HEADER_VALUE) + ->withVerifyTls() + ->build(); + + $this->assertInstanceOf(ShareSessionNotification::class, $shareNotification); + + $this->assertEquals(self::URL, $shareNotification->getUrl()); + $this->assertEquals([self::HEADER_KEY => self::HEADER_VALUE], $shareNotification->getHeaders()); + $this->assertEquals('POST', $shareNotification->getMethod()); + } + + /** + * @covers ::withUrl + * @covers ::withMethod + * @covers ::withHeaders + * @covers ::withVerifyTls + * @covers ::build + * @covers \Yoti\Identity\ShareSessionNotification::getHeaders + * @covers \Yoti\Identity\ShareSessionNotification::isVerifyTls + * @covers \Yoti\Identity\ShareSessionNotification::jsonSerialize + * @covers \Yoti\Identity\ShareSessionNotification::__construct + */ + public function testShouldBuildCorrectlyWithMultipleHeaders() + { + $shareNotification = (new ShareSessionNotificationBuilder()) + ->withMethod() + ->withUrl(self::URL) + ->withHeaders(self::HEADERS) + ->withVerifyTls(false) + ->build(); + + $expected = [ + 'url' => self::URL, + 'method' => 'POST', + 'verifyTls' => false, + 'headers' => self::HEADERS, + ]; + + $this->assertEquals(self::HEADERS, $shareNotification->getHeaders()); + $this->assertFalse($shareNotification->isVerifyTls()); + $this->assertEquals(json_encode($expected), json_encode($shareNotification)); + } +} diff --git a/tests/Identity/ShareSessionRequestBuilderTest.php b/tests/Identity/ShareSessionRequestBuilderTest.php new file mode 100644 index 00000000..4be3a1ef --- /dev/null +++ b/tests/Identity/ShareSessionRequestBuilderTest.php @@ -0,0 +1,100 @@ +extensionMock = $this->createMock(Extension::class); + $this->policyMock = $this->createMock(Policy::class); + } + + /** + * @covers ::withRedirectUri + * @covers ::withPolicy + * @covers ::withExtension + * @covers ::withNotification + * @covers ::withSubject + * @covers ::build + * @covers \Yoti\Identity\ShareSessionRequest::getPolicy + * @covers \Yoti\Identity\ShareSessionRequest::getNotification + * @covers \Yoti\Identity\ShareSessionRequest::getExtensions + * @covers \Yoti\Identity\ShareSessionRequest::getSubject + * @covers \Yoti\Identity\ShareSessionRequest::__construct + */ + public function testShouldBuildCorrectly() + { + $subject = [ + 'key' => (object)['some' => 'good'] + ]; + + $shareNotification = (new ShareSessionNotificationBuilder()) + ->withMethod() + ->withUrl('some') + ->withHeader('some', 'some') + ->withVerifyTls() + ->build(); + + $shareRequest = (new ShareSessionRequestBuilder()) + ->withSubject($subject) + ->withNotification($shareNotification) + ->withPolicy($this->policyMock) + ->withRedirectUri(self::URI) + ->withExtension($this->extensionMock) + ->build(); + + $this->assertInstanceOf(ShareSessionRequest::class, $shareRequest); + + $this->assertEquals($subject, $shareRequest->getSubject()); + $this->assertEquals([$this->extensionMock], $shareRequest->getExtensions()); + $this->assertEquals($this->policyMock, $shareRequest->getPolicy()); + $this->assertEquals($shareNotification, $shareRequest->getNotification()); + $this->assertEquals(self::URI, $shareRequest->getRedirectUri()); + } + + /** + * @covers ::withRedirectUri + * @covers ::withPolicy + * @covers ::withExtensions + * @covers ::withNotification + * @covers ::withSubject + * @covers ::build + * @covers \Yoti\Identity\ShareSessionRequest::getExtensions + * @covers \Yoti\Identity\ShareSessionRequest::__construct + * @covers \Yoti\Identity\ShareSessionRequest::jsonSerialize + */ + public function testShouldBuildCorrectlyWithMultipleExtensions() + { + $shareRequest = (new ShareSessionRequestBuilder()) + ->withPolicy($this->policyMock) + ->withRedirectUri(self::URI) + ->withExtensions([$this->extensionMock]) + ->build(); + + + $expected = [ + 'policy' => $this->policyMock, + 'redirectUri' => self::URI, + 'extensions' => [$this->extensionMock], + ]; + + $this->assertEquals([$this->extensionMock], $shareRequest->getExtensions()); + $this->assertEquals(json_encode($expected), json_encode($shareRequest)); + } +} From 3adf06ccadfc8ecf6ba4ec0a58713035d0e9df1e Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Thu, 20 Jun 2024 23:43:28 +0300 Subject: [PATCH 42/45] SDK-2265 added missing tests --- .php-cs-fixer.cache | 2 +- tests/DocScan/Session/Create/SdkConfigBuilderTest.php | 4 ---- .../RequestedSupplementaryDocTextExtractionTaskConfigTest.php | 3 +-- .../Create/Task/RequestedTextExtractionTaskConfigTest.php | 4 ---- 4 files changed, 2 insertions(+), 11 deletions(-) diff --git a/.php-cs-fixer.cache b/.php-cs-fixer.cache index c6fb1f24..7ad3f1ad 100644 --- a/.php-cs-fixer.cache +++ b/.php-cs-fixer.cache @@ -1 +1 @@ -{"php":"8.1.29","version":"3.59.3:v3.59.3#30ba9ecc2b0e5205e578fe29973c15653d9bfd29","indent":" ","lineEnding":"\n","rules":{"array_syntax":{"syntax":"short"},"no_unused_imports":true,"ordered_imports":{"imports_order":["const","class","function"]},"php_unit_fqcn_annotation":true,"phpdoc_return_self_reference":true,"phpdoc_scalar":true},"hashes":{"\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32718\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder30753\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder24222\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder25907\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder35317\/src\/DigitalIdentityClient.php":"9fba09c315d5bba5bd7b90ae9a717003","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3167\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder667\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32289\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder821\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8036\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3553\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder9961\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder34449\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32249\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder37291\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3093\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder28127\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a"}} \ No newline at end of file +{"php":"8.1.29","version":"3.59.3:v3.59.3#30ba9ecc2b0e5205e578fe29973c15653d9bfd29","indent":" ","lineEnding":"\n","rules":{"array_syntax":{"syntax":"short"},"no_unused_imports":true,"ordered_imports":{"imports_order":["const","class","function"]},"php_unit_fqcn_annotation":true,"phpdoc_return_self_reference":true,"phpdoc_scalar":true},"hashes":{"\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32718\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder30753\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder24222\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder25907\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder35317\/src\/DigitalIdentityClient.php":"9fba09c315d5bba5bd7b90ae9a717003","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3167\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder667\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32289\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder821\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8036\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3553\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder9961\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder34449\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32249\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder37291\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3093\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder28127\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder33456\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a"}} \ No newline at end of file diff --git a/tests/DocScan/Session/Create/SdkConfigBuilderTest.php b/tests/DocScan/Session/Create/SdkConfigBuilderTest.php index 3c84f5d2..5377c5b9 100644 --- a/tests/DocScan/Session/Create/SdkConfigBuilderTest.php +++ b/tests/DocScan/Session/Create/SdkConfigBuilderTest.php @@ -22,8 +22,6 @@ class SdkConfigBuilderTest extends TestCase private const SOME_PRIVACY_POLICY_URL = 'somePrivacyPolicyUrl'; private const SOME_CATEGORY = 'someCategory'; private const SOME_NUMBER_RETRIES = 5; - private const SOME_BIOMETRIC_CONSENT_FLOW = 'someBiometricConsentFlow'; - /** * @test @@ -120,7 +118,6 @@ public function shouldProduceTheCorrectJsonString() ->withErrorUrl(self::SOME_ERROR_URL) ->withPrivacyPolicyUrl(self::SOME_PRIVACY_POLICY_URL) ->withAllowHandoff(true) - ->withBiometricConsentFlow(self::SOME_BIOMETRIC_CONSENT_FLOW) ->build(); $expected = [ @@ -134,7 +131,6 @@ public function shouldProduceTheCorrectJsonString() 'error_url' => self::SOME_ERROR_URL, 'privacy_policy_url' => self::SOME_PRIVACY_POLICY_URL, 'allow_handoff' => true, - 'biometric_consent_flow' => self::SOME_BIOMETRIC_CONSENT_FLOW ]; $this->assertJsonStringEqualsJsonString(json_encode($expected), json_encode($result)); diff --git a/tests/DocScan/Session/Create/Task/RequestedSupplementaryDocTextExtractionTaskConfigTest.php b/tests/DocScan/Session/Create/Task/RequestedSupplementaryDocTextExtractionTaskConfigTest.php index e7de54b4..4d0b0f76 100644 --- a/tests/DocScan/Session/Create/Task/RequestedSupplementaryDocTextExtractionTaskConfigTest.php +++ b/tests/DocScan/Session/Create/Task/RequestedSupplementaryDocTextExtractionTaskConfigTest.php @@ -11,7 +11,6 @@ class RequestedSupplementaryDocTextExtractionTaskConfigTest extends TestCase { private const SOME_MANUAL_CHECK = 'someManualCheck'; - private const SOME_EXPANDED_DOCUMENT_FIELDS = 'false'; /** * @test @@ -24,7 +23,7 @@ public function shouldSerializeToJsonCorrectlyWithRequiredProperties() $result = new RequestedSupplementaryDocTextExtractionTaskConfig(self::SOME_MANUAL_CHECK); $expected = [ - 'manual_check' => self::SOME_MANUAL_CHECK + 'manual_check' => self::SOME_MANUAL_CHECK, ]; $this->assertJsonStringEqualsJsonString(json_encode($expected), json_encode($result)); diff --git a/tests/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfigTest.php b/tests/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfigTest.php index 1ee04962..630b5652 100644 --- a/tests/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfigTest.php +++ b/tests/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfigTest.php @@ -12,8 +12,6 @@ class RequestedTextExtractionTaskConfigTest extends TestCase { private const SOME_MANUAL_CHECK = 'someManualCheck'; private const SOME_CHIP_DATA = 'someChipData'; - private const SOME_EXPANDED_DOCUMENT_FIELDS = false; - /** * @test @@ -27,7 +25,6 @@ public function shouldSerializeToJsonCorrectlyWithRequiredProperties() $expected = [ 'manual_check' => self::SOME_MANUAL_CHECK, - 'create_expanded_document_fields' => self::SOME_EXPANDED_DOCUMENT_FIELDS ]; $this->assertJsonStringEqualsJsonString(json_encode($expected), json_encode($result)); @@ -47,7 +44,6 @@ public function shouldSerializeToJsonCorrectlyWithAllProperties() $expected = [ 'manual_check' => self::SOME_MANUAL_CHECK, 'chip_data' => self::SOME_CHIP_DATA, - 'create_expanded_document_fields' => self::SOME_EXPANDED_DOCUMENT_FIELDS ]; $this->assertJsonStringEqualsJsonString(json_encode($expected), json_encode($result)); From d61b0cd779ff9d1f64ca827bb9ce01a11980d074 Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Thu, 20 Jun 2024 23:46:40 +0300 Subject: [PATCH 43/45] SDK-2265 added missing tests --- .php-cs-fixer.cache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.php-cs-fixer.cache b/.php-cs-fixer.cache index 7ad3f1ad..0904f824 100644 --- a/.php-cs-fixer.cache +++ b/.php-cs-fixer.cache @@ -1 +1 @@ -{"php":"8.1.29","version":"3.59.3:v3.59.3#30ba9ecc2b0e5205e578fe29973c15653d9bfd29","indent":" ","lineEnding":"\n","rules":{"array_syntax":{"syntax":"short"},"no_unused_imports":true,"ordered_imports":{"imports_order":["const","class","function"]},"php_unit_fqcn_annotation":true,"phpdoc_return_self_reference":true,"phpdoc_scalar":true},"hashes":{"\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32718\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder30753\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder24222\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder25907\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder35317\/src\/DigitalIdentityClient.php":"9fba09c315d5bba5bd7b90ae9a717003","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3167\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder667\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32289\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder821\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8036\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3553\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder9961\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder34449\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32249\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder37291\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3093\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder28127\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder33456\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a"}} \ No newline at end of file +{"php":"8.1.29","version":"3.59.3:v3.59.3#30ba9ecc2b0e5205e578fe29973c15653d9bfd29","indent":" ","lineEnding":"\n","rules":{"array_syntax":{"syntax":"short"},"no_unused_imports":true,"ordered_imports":{"imports_order":["const","class","function"]},"php_unit_fqcn_annotation":true,"phpdoc_return_self_reference":true,"phpdoc_scalar":true},"hashes":{"\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32718\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder30753\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder24222\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder25907\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder35317\/src\/DigitalIdentityClient.php":"9fba09c315d5bba5bd7b90ae9a717003","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3167\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder667\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32289\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder821\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8036\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3553\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder9961\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder34449\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32249\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder37291\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3093\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder28127\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder33456\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder37936\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe"}} \ No newline at end of file From 1c8629cc272ae2dfd2c6c8862fbce2945f3ba8b2 Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Fri, 21 Jun 2024 00:19:23 +0300 Subject: [PATCH 44/45] SDK-2265 added missing features --- .php-cs-fixer.cache | 2 +- src/DocScan/Session/Create/SdkConfig.php | 21 ++++++++++++++++++- .../Session/Create/SdkConfigBuilder.php | 13 +++++++++++- .../RequestedTextExtractionTaskBuilder.php | 20 +++++++++++++++++- .../RequestedTextExtractionTaskConfig.php | 18 +++++++++++++++- ...AccountWatchlistCaSearchConfigResponse.php | 2 +- .../Retrieve/IdDocumentResourceResponse.php | 17 +++++++++++++++ .../Session/Create/SdkConfigBuilderTest.php | 4 ++++ ...mentaryDocTextExtractionTaskConfigTest.php | 3 ++- .../RequestedTextExtractionTaskConfigTest.php | 4 ++++ 10 files changed, 97 insertions(+), 7 deletions(-) diff --git a/.php-cs-fixer.cache b/.php-cs-fixer.cache index 0904f824..fd41f6cb 100644 --- a/.php-cs-fixer.cache +++ b/.php-cs-fixer.cache @@ -1 +1 @@ -{"php":"8.1.29","version":"3.59.3:v3.59.3#30ba9ecc2b0e5205e578fe29973c15653d9bfd29","indent":" ","lineEnding":"\n","rules":{"array_syntax":{"syntax":"short"},"no_unused_imports":true,"ordered_imports":{"imports_order":["const","class","function"]},"php_unit_fqcn_annotation":true,"phpdoc_return_self_reference":true,"phpdoc_scalar":true},"hashes":{"\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32718\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder30753\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder24222\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder25907\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder35317\/src\/DigitalIdentityClient.php":"9fba09c315d5bba5bd7b90ae9a717003","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3167\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder667\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32289\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder821\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8036\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3553\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder9961\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder34449\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32249\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder37291\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3093\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder28127\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder33456\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder37936\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe"}} \ No newline at end of file +{"php":"8.1.29","version":"3.59.3:v3.59.3#30ba9ecc2b0e5205e578fe29973c15653d9bfd29","indent":" ","lineEnding":"\n","rules":{"array_syntax":{"syntax":"short"},"no_unused_imports":true,"ordered_imports":{"imports_order":["const","class","function"]},"php_unit_fqcn_annotation":true,"phpdoc_return_self_reference":true,"phpdoc_scalar":true},"hashes":{"\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32718\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder30753\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder24222\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder25907\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder35317\/src\/DigitalIdentityClient.php":"9fba09c315d5bba5bd7b90ae9a717003","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3167\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder667\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32289\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder821\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8036\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3553\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder9961\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder34449\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32249\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder37291\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3093\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder28127\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder33456\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder37936\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder20323\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0"}} \ No newline at end of file diff --git a/src/DocScan/Session/Create/SdkConfig.php b/src/DocScan/Session/Create/SdkConfig.php index 453ad44a..51b85112 100644 --- a/src/DocScan/Session/Create/SdkConfig.php +++ b/src/DocScan/Session/Create/SdkConfig.php @@ -63,6 +63,11 @@ class SdkConfig implements \JsonSerializable */ private $attemptsConfiguration; + /** + * @var string|null + */ + private $biometricConsentFlow; + /** * @param string|null $allowedCaptureMethods * @param string|null $primaryColour @@ -75,6 +80,7 @@ class SdkConfig implements \JsonSerializable * @param string|null $privacyPolicyUrl * @param bool|null $allowHandoff * @param array|null $idDocumentTextDataExtractionRetriesConfig + * @param string|null $biometricConsentFlow */ public function __construct( ?string $allowedCaptureMethods, @@ -87,7 +93,9 @@ public function __construct( ?string $errorUrl, ?string $privacyPolicyUrl = null, ?bool $allowHandoff = null, - ?array $idDocumentTextDataExtractionRetriesConfig = null + ?array $idDocumentTextDataExtractionRetriesConfig = null, + ?string $biometricConsentFlow = null + ) { $this->allowedCaptureMethods = $allowedCaptureMethods; $this->primaryColour = $primaryColour; @@ -102,6 +110,8 @@ public function __construct( if (!is_null($idDocumentTextDataExtractionRetriesConfig)) { $this->attemptsConfiguration = new AttemptsConfiguration($idDocumentTextDataExtractionRetriesConfig); } + $this->biometricConsentFlow = $biometricConsentFlow; + } /** @@ -121,6 +131,7 @@ public function jsonSerialize(): \stdClass 'privacy_policy_url' => $this->getPrivacyPolicyUrl(), 'allow_handoff' => $this->getAllowHandoff(), 'attempts_configuration' => $this->getAttemptsConfiguration(), + 'biometric_consent_flow' => $this->getBiometricConsentFlow() ]); } @@ -211,4 +222,12 @@ public function getAttemptsConfiguration(): ?AttemptsConfiguration { return $this->attemptsConfiguration; } + + /** + * @return string|null + */ + public function getBiometricConsentFlow(): ?string + { + return $this->biometricConsentFlow; + } } diff --git a/src/DocScan/Session/Create/SdkConfigBuilder.php b/src/DocScan/Session/Create/SdkConfigBuilder.php index c91adc05..acf30fcc 100644 --- a/src/DocScan/Session/Create/SdkConfigBuilder.php +++ b/src/DocScan/Session/Create/SdkConfigBuilder.php @@ -66,6 +66,11 @@ class SdkConfigBuilder */ private $idDocumentTextDataExtractionRetriesConfig; + /** + * @var string|null + */ + private $biometricConsentFlow; + public function withAllowsCamera(): self { return $this->withAllowedCaptureMethod(self::CAMERA); @@ -136,6 +141,11 @@ public function withAllowHandoff(bool $allowHandoff): self return $this; } + public function withBiometricConsentFlow(string $biometricConsentFlow): self + { + $this->biometricConsentFlow = $biometricConsentFlow; + return $this; + } /** * Allows configuring the number of attempts permitted for text extraction on an ID document * @@ -203,7 +213,8 @@ public function build(): SdkConfig $this->errorUrl, $this->privacyPolicyUrl, $this->allowHandoff, - $this->idDocumentTextDataExtractionRetriesConfig + $this->idDocumentTextDataExtractionRetriesConfig, + $this->biometricConsentFlow ); } } diff --git a/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskBuilder.php b/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskBuilder.php index 5b29fca1..174828f9 100644 --- a/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskBuilder.php +++ b/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskBuilder.php @@ -58,6 +58,23 @@ public function withManualCheck(string $manualCheck): self return $this->setManualCheck($manualCheck); } + /** + * @var bool + */ + private $createExpandedDocumentFields; + + /** + * + * @param string $createExpandedDocumentFields + * + * @return $this + */ + public function withCreateExpandedDocumentFields(bool $createExpandedDocumentFields): self + { + $this->createExpandedDocumentFields = $createExpandedDocumentFields; + return $this; + } + /** * @return RequestedTextExtractionTask */ @@ -65,7 +82,8 @@ public function build(): RequestedTextExtractionTask { Validation::notEmptyString($this->manualCheck, 'manualCheck'); - $config = new RequestedTextExtractionTaskConfig($this->manualCheck, $this->chipData); + $config = new RequestedTextExtractionTaskConfig($this->manualCheck, $this->chipData, + $this->createExpandedDocumentFields); return new RequestedTextExtractionTask($config); } } diff --git a/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfig.php b/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfig.php index 9a9fb083..7e5716d1 100644 --- a/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfig.php +++ b/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfig.php @@ -19,14 +19,21 @@ class RequestedTextExtractionTaskConfig implements RequestedTaskConfigInterface */ private $chipData; + /** + * @var bool|null + */ + private $createExpandedDocumentFields; + /** * @param string $manualCheck * @param string|null $chipData + * @param bool|null $createExpandedDocumentFields */ - public function __construct(string $manualCheck, ?string $chipData = null) + public function __construct(string $manualCheck, ?string $chipData = null, ?bool $createExpandedDocumentFields = false) { $this->manualCheck = $manualCheck; $this->chipData = $chipData; + $this->createExpandedDocumentFields = $createExpandedDocumentFields; } /** @@ -37,6 +44,7 @@ public function jsonSerialize(): stdClass return (object)Json::withoutNullValues([ 'manual_check' => $this->getManualCheck(), 'chip_data' => $this->getChipData(), + 'create_expanded_document_fields' => $this->getCreateExpandedDocumentFields(), ]); } @@ -55,4 +63,12 @@ public function getChipData(): ?string { return $this->chipData; } + + /** + * @return bool + */ + public function getCreateExpandedDocumentFields(): ?bool + { + return $this->createExpandedDocumentFields; + } } diff --git a/src/DocScan/Session/Retrieve/CustomAccountWatchlistCaSearchConfigResponse.php b/src/DocScan/Session/Retrieve/CustomAccountWatchlistCaSearchConfigResponse.php index d1372b54..efa7819d 100644 --- a/src/DocScan/Session/Retrieve/CustomAccountWatchlistCaSearchConfigResponse.php +++ b/src/DocScan/Session/Retrieve/CustomAccountWatchlistCaSearchConfigResponse.php @@ -35,7 +35,7 @@ public function __construct(array $searchConfig) $this->apiKey = $searchConfig['api_key']; $this->monitoring = $searchConfig['monitoring']; $this->clientRef = $searchConfig['client_ref']; - $this->tags = json_decode($searchConfig['tags'], true); + $this->tags = array_key_exists('tags', $searchConfig) ? json_decode($searchConfig['tags'], true) : []; } /** diff --git a/src/DocScan/Session/Retrieve/IdDocumentResourceResponse.php b/src/DocScan/Session/Retrieve/IdDocumentResourceResponse.php index b6e7f46a..6d9dc824 100644 --- a/src/DocScan/Session/Retrieve/IdDocumentResourceResponse.php +++ b/src/DocScan/Session/Retrieve/IdDocumentResourceResponse.php @@ -24,6 +24,11 @@ class IdDocumentResourceResponse extends ResourceResponse */ private $documentFields; + /** + * @var ExpandedDocumentFieldsResponse|null + */ + private $expandedDocumentFields; + /** * @var DocumentIdPhotoResponse|null */ @@ -49,6 +54,10 @@ public function __construct(array $idDocument) $this->documentFields = isset($idDocument['document_fields']) ? new DocumentFieldsResponse($idDocument['document_fields']) : null; + + $this->expandedDocumentFields = isset($idDocument['expanded_document_fields']) + ? new ExpandedDocumentFieldsResponse($idDocument['expanded_document_fields']) + : null; $this->documentIdPhoto = isset($idDocument['document_id_photo']) ? new DocumentIdPhotoResponse($idDocument['document_id_photo']) @@ -87,6 +96,14 @@ public function getDocumentFields(): ?DocumentFieldsResponse return $this->documentFields; } + /** + * @return ExpandedDocumentFieldsResponse|null + */ + public function getExpandedDocumentFields(): ?ExpandedDocumentFieldsResponse + { + return $this->expandedDocumentFields; + } + /** * @return DocumentIdPhotoResponse|null */ diff --git a/tests/DocScan/Session/Create/SdkConfigBuilderTest.php b/tests/DocScan/Session/Create/SdkConfigBuilderTest.php index 5377c5b9..3c84f5d2 100644 --- a/tests/DocScan/Session/Create/SdkConfigBuilderTest.php +++ b/tests/DocScan/Session/Create/SdkConfigBuilderTest.php @@ -22,6 +22,8 @@ class SdkConfigBuilderTest extends TestCase private const SOME_PRIVACY_POLICY_URL = 'somePrivacyPolicyUrl'; private const SOME_CATEGORY = 'someCategory'; private const SOME_NUMBER_RETRIES = 5; + private const SOME_BIOMETRIC_CONSENT_FLOW = 'someBiometricConsentFlow'; + /** * @test @@ -118,6 +120,7 @@ public function shouldProduceTheCorrectJsonString() ->withErrorUrl(self::SOME_ERROR_URL) ->withPrivacyPolicyUrl(self::SOME_PRIVACY_POLICY_URL) ->withAllowHandoff(true) + ->withBiometricConsentFlow(self::SOME_BIOMETRIC_CONSENT_FLOW) ->build(); $expected = [ @@ -131,6 +134,7 @@ public function shouldProduceTheCorrectJsonString() 'error_url' => self::SOME_ERROR_URL, 'privacy_policy_url' => self::SOME_PRIVACY_POLICY_URL, 'allow_handoff' => true, + 'biometric_consent_flow' => self::SOME_BIOMETRIC_CONSENT_FLOW ]; $this->assertJsonStringEqualsJsonString(json_encode($expected), json_encode($result)); diff --git a/tests/DocScan/Session/Create/Task/RequestedSupplementaryDocTextExtractionTaskConfigTest.php b/tests/DocScan/Session/Create/Task/RequestedSupplementaryDocTextExtractionTaskConfigTest.php index 4d0b0f76..e7de54b4 100644 --- a/tests/DocScan/Session/Create/Task/RequestedSupplementaryDocTextExtractionTaskConfigTest.php +++ b/tests/DocScan/Session/Create/Task/RequestedSupplementaryDocTextExtractionTaskConfigTest.php @@ -11,6 +11,7 @@ class RequestedSupplementaryDocTextExtractionTaskConfigTest extends TestCase { private const SOME_MANUAL_CHECK = 'someManualCheck'; + private const SOME_EXPANDED_DOCUMENT_FIELDS = 'false'; /** * @test @@ -23,7 +24,7 @@ public function shouldSerializeToJsonCorrectlyWithRequiredProperties() $result = new RequestedSupplementaryDocTextExtractionTaskConfig(self::SOME_MANUAL_CHECK); $expected = [ - 'manual_check' => self::SOME_MANUAL_CHECK, + 'manual_check' => self::SOME_MANUAL_CHECK ]; $this->assertJsonStringEqualsJsonString(json_encode($expected), json_encode($result)); diff --git a/tests/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfigTest.php b/tests/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfigTest.php index 630b5652..1ee04962 100644 --- a/tests/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfigTest.php +++ b/tests/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfigTest.php @@ -12,6 +12,8 @@ class RequestedTextExtractionTaskConfigTest extends TestCase { private const SOME_MANUAL_CHECK = 'someManualCheck'; private const SOME_CHIP_DATA = 'someChipData'; + private const SOME_EXPANDED_DOCUMENT_FIELDS = false; + /** * @test @@ -25,6 +27,7 @@ public function shouldSerializeToJsonCorrectlyWithRequiredProperties() $expected = [ 'manual_check' => self::SOME_MANUAL_CHECK, + 'create_expanded_document_fields' => self::SOME_EXPANDED_DOCUMENT_FIELDS ]; $this->assertJsonStringEqualsJsonString(json_encode($expected), json_encode($result)); @@ -44,6 +47,7 @@ public function shouldSerializeToJsonCorrectlyWithAllProperties() $expected = [ 'manual_check' => self::SOME_MANUAL_CHECK, 'chip_data' => self::SOME_CHIP_DATA, + 'create_expanded_document_fields' => self::SOME_EXPANDED_DOCUMENT_FIELDS ]; $this->assertJsonStringEqualsJsonString(json_encode($expected), json_encode($result)); From e1fdcd5230925e82b118afb0d34589d6bef3b695 Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Fri, 21 Jun 2024 10:01:48 +0300 Subject: [PATCH 45/45] SDK-2265 removed digital identity examples from profile example --- .php-cs-fixer.cache | 2 +- .../Http/Controllers/IdentityController.php | 64 ------------------- .../YotiDigitalIdentityServiceProvider.php | 29 --------- examples/profile/config/app.php | 1 - .../resources/views/identity.blade.php | 60 ----------------- examples/profile/routes/web.php | 1 - src/DocScan/Session/Create/SdkConfig.php | 2 - .../RequestedTextExtractionTaskBuilder.php | 12 ++-- .../RequestedTextExtractionTaskConfig.php | 7 +- .../Retrieve/IdDocumentResourceResponse.php | 1 - 10 files changed, 12 insertions(+), 167 deletions(-) delete mode 100644 examples/profile/app/Http/Controllers/IdentityController.php delete mode 100644 examples/profile/app/Providers/YotiDigitalIdentityServiceProvider.php delete mode 100644 examples/profile/resources/views/identity.blade.php diff --git a/.php-cs-fixer.cache b/.php-cs-fixer.cache index fd41f6cb..c814b4a8 100644 --- a/.php-cs-fixer.cache +++ b/.php-cs-fixer.cache @@ -1 +1 @@ -{"php":"8.1.29","version":"3.59.3:v3.59.3#30ba9ecc2b0e5205e578fe29973c15653d9bfd29","indent":" ","lineEnding":"\n","rules":{"array_syntax":{"syntax":"short"},"no_unused_imports":true,"ordered_imports":{"imports_order":["const","class","function"]},"php_unit_fqcn_annotation":true,"phpdoc_return_self_reference":true,"phpdoc_scalar":true},"hashes":{"\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32718\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder30753\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder24222\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder25907\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder35317\/src\/DigitalIdentityClient.php":"9fba09c315d5bba5bd7b90ae9a717003","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3167\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder667\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32289\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder821\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8036\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3553\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder9961\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder34449\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32249\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder37291\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3093\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder28127\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder33456\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder37936\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder20323\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0"}} \ No newline at end of file +{"php":"8.1.29","version":"3.59.3:v3.59.3#30ba9ecc2b0e5205e578fe29973c15653d9bfd29","indent":" ","lineEnding":"\n","rules":{"array_syntax":{"syntax":"short"},"no_unused_imports":true,"ordered_imports":{"imports_order":["const","class","function"]},"php_unit_fqcn_annotation":true,"phpdoc_return_self_reference":true,"phpdoc_scalar":true},"hashes":{"\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32718\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder30753\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder24222\/tests\/Util\/JsonTest.php":"229e164156257a33bc40ec45910f1561","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder25907\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder35317\/src\/DigitalIdentityClient.php":"9fba09c315d5bba5bd7b90ae9a717003","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3167\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder667\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32289\/src\/Identity\/DigitalIdentityService.php":"d1ca6e501e690798ca13ec028cbf505e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder821\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8036\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3553\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder9961\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder34449\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32249\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder37291\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder3093\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder28127\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder33456\/src\/Profile\/Util\/Attribute\/AnchorConverter.php":"c348f7a24bc5c13dc8b7362319cbfc9a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder37936\/tests\/DigitalIdentityClientTest.php":"7afddf255900f83a72e0a37a93a6f6fe","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder20323\/tests\/Identity\/DigitalIdentityServiceTest.php":"a2830bae77f9853790b730ab1c52a9c0","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder135\/src\/DocScan\/Session\/Retrieve\/IdDocumentResourceResponse.php":"7bf4d09cc0a58470af431046cfc7687e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder452\/src\/DocScan\/Session\/Retrieve\/IdDocumentResourceResponse.php":"7bf4d09cc0a58470af431046cfc7687e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder1835\/src\/DocScan\/Session\/Retrieve\/IdDocumentResourceResponse.php":"f39668a92c3059e9d8298359ad6eedc9","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder11703\/src\/DocScan\/Session\/Create\/SdkConfig.php":"e570742d72b41967f9cc7e20495b7100","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder6945\/src\/DocScan\/Session\/Create\/SdkConfig.php":"defa00a16760c0f07cb4f16484770ddc","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder10761\/src\/DocScan\/Session\/Create\/SdkConfig.php":"61b63d7cb686a25b1e664868fb8a5460","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder25491\/src\/DocScan\/Session\/Create\/SdkConfig.php":"52a187cef6aa401b2c24a6af50f6d1b3","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder25245\/src\/DocScan\/Session\/Create\/SdkConfig.php":"e97a84e32a50146e14db930c88f07dec","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder6169\/src\/DocScan\/Session\/Create\/Task\/RequestedTextExtractionTaskBuilder.php":"994c482f94c986253a3da93140575f26","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder14820\/src\/DocScan\/Session\/Create\/Task\/RequestedTextExtractionTaskBuilder.php":"994c482f94c986253a3da93140575f26","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder8237\/src\/DocScan\/Session\/Create\/Task\/RequestedTextExtractionTaskBuilder.php":"07bb664508b1053fde7518c3e5c9e0d2","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder30396\/src\/DocScan\/Session\/Create\/Task\/RequestedTextExtractionTaskBuilder.php":"994c482f94c986253a3da93140575f26","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder26547\/src\/DocScan\/Session\/Create\/Task\/RequestedTextExtractionTaskBuilder.php":"575c5c8750d0429c00d78f86f8b15d71","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder26103\/src\/DocScan\/Session\/Create\/Task\/RequestedTextExtractionTaskBuilder.php":"756a15f92fed8a36b7645e3400543738","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32665\/src\/DocScan\/Session\/Create\/Task\/RequestedTextExtractionTaskBuilder.php":"bbcf30388bf6ab6423a58d6c8cf20b2a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder12231\/src\/DocScan\/Session\/Create\/Task\/RequestedTextExtractionTaskBuilder.php":"d4c1e5cd33fc66ed0e9016ef83067f13","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder15671\/src\/DocScan\/Session\/Create\/Task\/RequestedTextExtractionTaskBuilder.php":"1baf3d3d5e54d0120769f58a50b2d6a4","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder16639\/src\/DocScan\/Session\/Create\/Task\/RequestedTextExtractionTaskBuilder.php":"790f204c58bb5c755878db5467155929","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder29864\/src\/DocScan\/Session\/Create\/Task\/RequestedTextExtractionTaskBuilder.php":"1baf3d3d5e54d0120769f58a50b2d6a4","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder32797\/src\/DocScan\/Session\/Create\/Task\/RequestedTextExtractionTaskBuilder.php":"9d3a05bc0553ae4fb61fad16444794f1","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder17371\/src\/DocScan\/Session\/Create\/Task\/RequestedTextExtractionTaskBuilder.php":"1ab0b067273a82103be9978f9090d751","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder2626\/src\/DocScan\/Session\/Create\/Task\/RequestedTextExtractionTaskBuilder.php":"b262cf859858d0bfc7d493b82cfaf386","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder36694\/src\/DocScan\/Session\/Create\/Task\/RequestedTextExtractionTaskConfig.php":"b217af9f0e6d73ee26e5037494076717","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder24413\/src\/DocScan\/Session\/Create\/Task\/RequestedTextExtractionTaskConfig.php":"3a913bedb33741c25993d6f54631aab5","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder27718\/src\/DocScan\/Session\/Create\/Task\/RequestedTextExtractionTaskConfig.php":"639289121ce1709eeb7da41ad648d3f7","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder21698\/src\/DocScan\/Session\/Create\/Task\/RequestedTextExtractionTaskConfig.php":"c7d6178d1b7e1734a2315145e477d61a","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder22514\/src\/DocScan\/Session\/Create\/Task\/RequestedTextExtractionTaskConfig.php":"e991f862707f4967f66f52cf6e1ff4fc","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder37049\/src\/DocScan\/Session\/Create\/Task\/RequestedTextExtractionTaskConfig.php":"427142582bbc86bf6c5e80aa8c7b2945","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder24008\/src\/DocScan\/Session\/Create\/Task\/RequestedTextExtractionTaskConfig.php":"17c7713fa71fecefc01fc83ae0120850","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder19212\/src\/DocScan\/Session\/Create\/Task\/RequestedTextExtractionTaskConfig.php":"d45835ea3ec3e7889e1262ff766f22a8","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder6528\/src\/DocScan\/Session\/Create\/Task\/RequestedTextExtractionTaskConfig.php":"a8b7d00af84b1ecf11a3755ef4270a21","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder29603\/src\/DocScan\/Session\/Create\/Task\/RequestedTextExtractionTaskBuilder.php":"b262cf859858d0bfc7d493b82cfaf386","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder37059\/src\/DocScan\/Session\/Create\/Task\/RequestedTextExtractionTaskBuilder.php":"5ebeced1a30fcb9579e2c023fb6683f9","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder18315\/examples\/doc-scan\/routes\/web.php":"cb44e031de8731bfa516c2057adb3705","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder33073\/examples\/profile\/app\/Http\/Controllers\/IdentityController.php":"2f614a4174a0403ac48ef6dcd4796ebc","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder1171\/examples\/doc-scan\/routes\/web.php":"cb44e031de8731bfa516c2057adb3705","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder24221\/examples\/profile\/app\/Providers\/YotiDigitalIdentityServiceProvider.php":"ca9bdcd9f57192ded3421ec399c655d3","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder28861\/examples\/profile\/app\/Providers\/YotiDigitalIdentityServiceProvider.php":"ca9bdcd9f57192ded3421ec399c655d3","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder28556\/examples\/digitalidentity\/config\/app.php":"fd9dd9b2aa7f77bd4898eff4039a5399","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder14596\/examples\/profile\/config\/app.php":"fd9dd9b2aa7f77bd4898eff4039a5399","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder29786\/examples\/profile\/config\/app.php":"fd9dd9b2aa7f77bd4898eff4039a5399","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder18285\/examples\/profile\/config\/app.php":"dc2cea437306a860734271b629691f1b","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder6012\/examples\/profile\/config\/app.php":"dc2cea437306a860734271b629691f1b","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder9177\/examples\/digitalidentity\/storage\/framework\/views\/95c786522cd6c5bb1d0a69b2f33616f23bfd97c6.php":"fec431b44c0882fb0ff10121625ab7df","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder5081\/examples\/profile\/routes\/web.php":"4d6d95a1a884c50539b3ba82cb1cae6e","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder28691\/examples\/profile\/routes\/web.php":"b21cb257df9016e8e827652aecc620d6","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder16838\/examples\/digitalidentity\/storage\/framework\/views\/95c786522cd6c5bb1d0a69b2f33616f23bfd97c6.php":"fec431b44c0882fb0ff10121625ab7df","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder35858\/examples\/profile\/routes\/web.php":"b21cb257df9016e8e827652aecc620d6","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder18443\/examples\/digitalidentity\/storage\/framework\/views\/95c786522cd6c5bb1d0a69b2f33616f23bfd97c6.php":"fec431b44c0882fb0ff10121625ab7df","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder1673\/examples\/profile\/routes\/web.php":"b21cb257df9016e8e827652aecc620d6","\/private\/var\/folders\/hs\/kw0d0_0d2kj8xl5yd5_t2rz40000gn\/T\/PHP CS Fixertemp_folder4880\/examples\/digitalidentity\/storage\/framework\/views\/95c786522cd6c5bb1d0a69b2f33616f23bfd97c6.php":"fec431b44c0882fb0ff10121625ab7df"}} \ No newline at end of file diff --git a/examples/profile/app/Http/Controllers/IdentityController.php b/examples/profile/app/Http/Controllers/IdentityController.php deleted file mode 100644 index 681cf7a9..00000000 --- a/examples/profile/app/Http/Controllers/IdentityController.php +++ /dev/null @@ -1,64 +0,0 @@ -build(); - - $redirectUri = 'https://host/redirect/'; - - $shareSessionRequest = (new ShareSessionRequestBuilder()) - ->withPolicy($policy) - ->withRedirectUri($redirectUri) - ->build(); - - $session = $client->createShareSession($shareSessionRequest); - - $createdQrCode = $client->createShareQrCode($session->getId()); - - $fetchedQrCode = $client->fetchShareQrCode($createdQrCode->getId()); - - $sessionFetched = $client->fetchShareSession($session->getId()); - - return view('identity', [ - 'title' => 'Digital Identity Complete Example', - // Creating session - 'sessionId' => $session->getId(), - 'sessionStatus' => $session->getStatus(), - 'sessionExpiry' => $session->getExpiry(), - // Creating QR code - 'createdQrCodeId' => $createdQrCode->getId(), - 'createdQrCodeUri' => $createdQrCode->getUri(), - // Fetch QR code - 'fetchedQrCodeExpiry' => $fetchedQrCode->getExpiry(), - - 'fetchedQrCodeRedirectUri' => $fetchedQrCode->getRedirectUri(), - 'fetchedQrCodeSessionId' => $fetchedQrCode->getSession()->getId(), - 'fetchedQrCodeSessionStatus' => $fetchedQrCode->getSession()->getStatus(), - 'fetchedQrCodeSessionExpiry' => $fetchedQrCode->getSession()->getExpiry(), - // Fetch session - 'fetchedSessionId' => $sessionFetched->getId(), - 'fetchedSessionStatus' => $sessionFetched->getStatus(), - 'fetchedSessionExpiry' => $sessionFetched->getExpiry(), - 'fetchedSessionCreated' => $sessionFetched->getCreated(), - 'fetchedSessionUpdated' => $sessionFetched->getUpdated(), - - ]); - } catch (\Throwable $e) { - Log::error($e->getTraceAsString()); - throw new BadRequestHttpException($e->getMessage()); - } - } -} diff --git a/examples/profile/app/Providers/YotiDigitalIdentityServiceProvider.php b/examples/profile/app/Providers/YotiDigitalIdentityServiceProvider.php deleted file mode 100644 index f0d3ffa2..00000000 --- a/examples/profile/app/Providers/YotiDigitalIdentityServiceProvider.php +++ /dev/null @@ -1,29 +0,0 @@ -app->singleton(DigitalIdentityClient::class, function ($app) { - $config = $app['config']['yoti']; - return new DigitalIdentityClient($config['client.sdk.id'], $config['pem.file.path']); - }); - } - - /** - * @return array - */ - public function provides() - { - return [DigitalIdentityClient::class]; - } -} diff --git a/examples/profile/config/app.php b/examples/profile/config/app.php index 1a57883e..c61e364c 100644 --- a/examples/profile/config/app.php +++ b/examples/profile/config/app.php @@ -170,7 +170,6 @@ * Application Service Providers... */ App\Providers\YotiServiceProvider::class, - App\Providers\YotiDigitalIdentityServiceProvider::class, App\Providers\RouteServiceProvider::class, ], diff --git a/examples/profile/resources/views/identity.blade.php b/examples/profile/resources/views/identity.blade.php deleted file mode 100644 index e0928c1f..00000000 --- a/examples/profile/resources/views/identity.blade.php +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - {{ $title }} - - - - - -
-
-
- - Yoti - -
- -

Digital Identity Share Complete Example page

- -
-

Created Session

-

Id: {{$sessionId}}

-

Status: {{$sessionStatus}}

-

Expiry: {{$sessionExpiry}}

-
- -
-

Created Session QR Code

-

Id: {{$createdQrCodeId}}

-

URI: {{$createdQrCodeUri}}

-
- -
-

Fetched Session QR Code

-

Expiry: {{$fetchedQrCodeExpiry}}

-

Redirect URI: {{$fetchedQrCodeRedirectUri}}

-

Session ID: {{$fetchedQrCodeSessionId}}

-

Session Status: {{$fetchedQrCodeSessionStatus}}

-

Session Expiry: {{$fetchedQrCodeSessionExpiry}}

-
- -
-

Fetched Session

-

Id: {{$fetchedSessionId}}

-

Created: {{$fetchedSessionCreated}}

-

Updated: {{$fetchedSessionUpdated}}

-

Expiry: {{$fetchedSessionExpiry}}

-

Status: {{$fetchedSessionStatus}}

- -
- -
-
- - - \ No newline at end of file diff --git a/examples/profile/routes/web.php b/examples/profile/routes/web.php index b1598b3c..9565f235 100644 --- a/examples/profile/routes/web.php +++ b/examples/profile/routes/web.php @@ -20,4 +20,3 @@ Route::get('/dynamic-share', 'DynamicShareController@show'); Route::get('/dbs-check', 'DbsCheckController@show'); -Route::get('/generate-share', 'IdentityController@show'); diff --git a/src/DocScan/Session/Create/SdkConfig.php b/src/DocScan/Session/Create/SdkConfig.php index 51b85112..a3c8086d 100644 --- a/src/DocScan/Session/Create/SdkConfig.php +++ b/src/DocScan/Session/Create/SdkConfig.php @@ -95,7 +95,6 @@ public function __construct( ?bool $allowHandoff = null, ?array $idDocumentTextDataExtractionRetriesConfig = null, ?string $biometricConsentFlow = null - ) { $this->allowedCaptureMethods = $allowedCaptureMethods; $this->primaryColour = $primaryColour; @@ -111,7 +110,6 @@ public function __construct( $this->attemptsConfiguration = new AttemptsConfiguration($idDocumentTextDataExtractionRetriesConfig); } $this->biometricConsentFlow = $biometricConsentFlow; - } /** diff --git a/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskBuilder.php b/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskBuilder.php index 174828f9..802e1a51 100644 --- a/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskBuilder.php +++ b/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskBuilder.php @@ -62,11 +62,8 @@ public function withManualCheck(string $manualCheck): self * @var bool */ private $createExpandedDocumentFields; - /** - * - * @param string $createExpandedDocumentFields - * + * @param bool $createExpandedDocumentFields * @return $this */ public function withCreateExpandedDocumentFields(bool $createExpandedDocumentFields): self @@ -82,8 +79,11 @@ public function build(): RequestedTextExtractionTask { Validation::notEmptyString($this->manualCheck, 'manualCheck'); - $config = new RequestedTextExtractionTaskConfig($this->manualCheck, $this->chipData, - $this->createExpandedDocumentFields); + $config = new RequestedTextExtractionTaskConfig( + $this->manualCheck, + $this->chipData, + $this->createExpandedDocumentFields + ); return new RequestedTextExtractionTask($config); } } diff --git a/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfig.php b/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfig.php index 7e5716d1..b124b343 100644 --- a/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfig.php +++ b/src/DocScan/Session/Create/Task/RequestedTextExtractionTaskConfig.php @@ -29,8 +29,11 @@ class RequestedTextExtractionTaskConfig implements RequestedTaskConfigInterface * @param string|null $chipData * @param bool|null $createExpandedDocumentFields */ - public function __construct(string $manualCheck, ?string $chipData = null, ?bool $createExpandedDocumentFields = false) - { + public function __construct( + string $manualCheck, + ?string $chipData = null, + ?bool $createExpandedDocumentFields = false + ) { $this->manualCheck = $manualCheck; $this->chipData = $chipData; $this->createExpandedDocumentFields = $createExpandedDocumentFields; diff --git a/src/DocScan/Session/Retrieve/IdDocumentResourceResponse.php b/src/DocScan/Session/Retrieve/IdDocumentResourceResponse.php index 6d9dc824..6a25f006 100644 --- a/src/DocScan/Session/Retrieve/IdDocumentResourceResponse.php +++ b/src/DocScan/Session/Retrieve/IdDocumentResourceResponse.php @@ -54,7 +54,6 @@ public function __construct(array $idDocument) $this->documentFields = isset($idDocument['document_fields']) ? new DocumentFieldsResponse($idDocument['document_fields']) : null; - $this->expandedDocumentFields = isset($idDocument['expanded_document_fields']) ? new ExpandedDocumentFieldsResponse($idDocument['expanded_document_fields']) : null;