From 1f46d3e1e8f17c66712aa5470778c3b35f0ee41d Mon Sep 17 00:00:00 2001 From: SergeySeroshtan Date: Tue, 30 Apr 2024 22:25:22 -0400 Subject: [PATCH] Update license years --- LICENSE | 2 +- sample/index.php | 8 +++-- src/Card.php | 2 +- src/CardManager.php | 35 +++++++++++++------ src/CardParams.php | 2 +- src/CardSignature.php | 2 +- src/Exceptions/CardClientException.php | 2 +- src/Exceptions/CardVerificationException.php | 2 +- src/Exceptions/VirgilException.php | 2 +- src/Http/AbstractHttpClient.php | 8 ++--- src/Http/Constants/RequestMethods.php | 2 +- src/Http/Curl/CurlClient.php | 4 +-- src/Http/Curl/CurlRequest.php | 2 +- src/Http/Curl/CurlRequestFactory.php | 2 +- src/Http/Curl/RequestFactoryInterface.php | 2 +- src/Http/Curl/RequestInterface.php | 2 +- src/Http/HttpClientInterface.php | 2 +- src/Http/Requests/AbstractHttpRequest.php | 2 +- src/Http/Requests/DeleteHttpRequest.php | 2 +- src/Http/Requests/GetHttpRequest.php | 2 +- src/Http/Requests/HttpRequestInterface.php | 2 +- src/Http/Requests/PostHttpRequest.php | 2 +- src/Http/Responses/HttpResponse.php | 2 +- src/Http/Responses/HttpResponseInterface.php | 2 +- src/Http/Responses/HttpStatusCode.php | 2 +- .../Responses/HttpStatusCodeInterface.php | 2 +- src/Http/VirgilAgent/HttpVirgilAgent.php | 2 +- src/Signer/ModelSigner.php | 2 +- src/Storage/KeyEntry.php | 2 +- src/Storage/KeyStorage.php | 2 +- src/Storage/PrivateKeyEntry.php | 2 +- src/Storage/PrivateKeyStorage.php | 2 +- src/Verification/CardVerifier.php | 2 +- src/Verification/NullCardVerifier.php | 2 +- src/Verification/VerifierCredentials.php | 2 +- src/Verification/VirgilCardVerifier.php | 2 +- src/Verification/Whitelist.php | 2 +- src/Web/Authorization/AccessToken.php | 2 +- src/Web/Authorization/AccessTokenProvider.php | 2 +- src/Web/Authorization/CallbackJwtProvider.php | 2 +- .../ConstAccessTokenProvider.php | 2 +- .../GeneratorJWTProviderException.php | 2 +- .../Authorization/GeneratorJwtProvider.php | 2 +- src/Web/Authorization/Jwt.php | 2 +- src/Web/Authorization/JwtBodyContent.php | 2 +- src/Web/Authorization/JwtGenerator.php | 2 +- src/Web/Authorization/JwtHeaderContent.php | 2 +- src/Web/Authorization/JwtParser.php | 2 +- src/Web/Authorization/TokenContext.php | 2 +- src/Web/CardClient.php | 28 +++++++++------ src/Web/ErrorResponseModel.php | 2 +- src/Web/RawCardContent.php | 2 +- src/Web/RawSignature.php | 2 +- src/Web/RawSignedModel.php | 2 +- src/Web/ResponseModel.php | 2 +- tests/integration/IntegrationBaseTestCase.php | 2 +- .../IntegrationTestsDataProvider.php | 2 +- tests/integration/Sdk/CardManagerTest.php | 2 +- .../Sdk/Web/RawSignedModelTest.php | 2 +- tests/unit/Http/Curl/CurlClientTest.php | 2 +- .../unit/Http/Curl/CurlRequestFactoryTest.php | 2 +- tests/unit/Http/HttpClientSendRequestTest.php | 2 +- tests/unit/Sdk/CardManagerTest.php | 2 +- tests/unit/Sdk/Signer/ModelSignerTest.php | 2 +- tests/unit/Sdk/Web/RawSignedModelTest.php | 2 +- 65 files changed, 113 insertions(+), 90 deletions(-) diff --git a/LICENSE b/LICENSE index 9301820..e3317e1 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2015-2020, Virgil Security, Inc. +Copyright (c) 2015-2024, Virgil Security, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sample/index.php b/sample/index.php index ce1c56c..24f3d80 100644 --- a/sample/index.php +++ b/sample/index.php @@ -1,6 +1,6 @@ $messageDecryptedForBob, - "isEquals" => $message==$messageDecryptedForBob + "isEquals" => $message == $messageDecryptedForBob ] ); } catch (\Exception $e) { diff --git a/src/Card.php b/src/Card.php index 0f40f45..44dbe2c 100644 --- a/src/Card.php +++ b/src/Card.php @@ -1,6 +1,6 @@ accessTokenProvider->getToken($tokenContext); - $responseModel = $this->cardClient->getCard($cardID, (string)$token); + $responseModel = $this->cardClient->getCard($cardID, (string) $token); if ($responseModel instanceof ErrorResponseModel) { throw new CardClientException( - "error response from card service", $responseModel->getCode(), $responseModel->getMessage() + "error response from card service", + $responseModel->getCode(), + $responseModel->getMessage() ); } @@ -234,10 +236,12 @@ public function searchCards(string $identity): array $tokenContext = new TokenContext($identity, 'search'); $token = $this->accessTokenProvider->getToken($tokenContext); - $responseModel = $this->cardClient->searchCards($identity, (string)$token); + $responseModel = $this->cardClient->searchCards($identity, (string) $token); if ($responseModel instanceof ErrorResponseModel) { throw new CardClientException( - "error response from card service", $responseModel->getCode(), $responseModel->getMessage() + "error response from card service", + $responseModel->getCode(), + $responseModel->getMessage() ); } @@ -263,10 +267,12 @@ public function revokeCard(string $cardID): void $tokenContext = new TokenContext("", 'revoke'); $token = $this->accessTokenProvider->getToken($tokenContext); - $responseModel = $this->cardClient->revokeCard($cardID, (string)$token); + $responseModel = $this->cardClient->revokeCard($cardID, (string) $token); if ($responseModel instanceof ErrorResponseModel) { throw new CardClientException( - "error response from card service", $responseModel->getCode(), $responseModel->getMessage() + "error response from card service", + $responseModel->getCode(), + $responseModel->getMessage() ); } } @@ -325,7 +331,9 @@ public function exportCardAsRawCard(Card $card): RawSignedModel $modelSignatures = []; foreach ($card->getSignatures() as $cardSignature) { $modelSignatures[] = new RawSignature( - $cardSignature->getSigner(), $cardSignature->getSignature(), $cardSignature->getSnapshot() + $cardSignature->getSigner(), + $cardSignature->getSignature(), + $cardSignature->getSnapshot() ); } @@ -344,10 +352,12 @@ private function publishRawSignedModelWithToken(RawSignedModel $model, AccessTok $model = $signCallback($model); } - $responseModel = $this->cardClient->publishCard($model, (string)$token); + $responseModel = $this->cardClient->publishCard($model, (string) $token); if ($responseModel instanceof ErrorResponseModel) { throw new CardClientException( - "error response from card service", $responseModel->getCode(), $responseModel->getMessage() + "error response from card service", + $responseModel->getCode(), + $responseModel->getMessage() ); } @@ -376,7 +386,10 @@ private function parseRawCard(RawSignedModel $rawSignedModel, bool $isOutdated = } $cardSignatures[] = new CardSignature( - $signature->getSigner(), $signature->getSignature(), $signature->getSnapshot(), $extraFields + $signature->getSigner(), + $signature->getSignature(), + $signature->getSnapshot(), + $extraFields ); } diff --git a/src/CardParams.php b/src/CardParams.php index ba19435..060f600 100644 --- a/src/CardParams.php +++ b/src/CardParams.php @@ -1,6 +1,6 @@ get($httpRequest->getUrl(), [], $httpRequest->getHeaders()); case RequestMethods::HTTP_POST: - return $this->post($httpRequest->getUrl(), (string)$httpRequest->getBody(), $httpRequest->getHeaders()); - case RequestMethods::HTTP_DELETE: + return $this->post($httpRequest->getUrl(), (string) $httpRequest->getBody(), $httpRequest->getHeaders()); + case RequestMethods::HTTP_DELETE: return $this->delete( $httpRequest->getUrl(), - (string)$httpRequest->getBody(), + (string) $httpRequest->getBody(), $httpRequest->getHeaders() ); } diff --git a/src/Http/Constants/RequestMethods.php b/src/Http/Constants/RequestMethods.php index 52e9f5f..7c43395 100644 --- a/src/Http/Constants/RequestMethods.php +++ b/src/Http/Constants/RequestMethods.php @@ -1,6 +1,6 @@ getInfo(CURLINFO_HTTP_CODE); $httpRequest->close(); - return $this->buildResponse((string)$httpStatusCode, (string)$httpRawResponse); + return $this->buildResponse((string) $httpStatusCode, (string) $httpRawResponse); } /** diff --git a/src/Http/Curl/CurlRequest.php b/src/Http/Curl/CurlRequest.php index ccfb092..b246ecc 100644 --- a/src/Http/Curl/CurlRequest.php +++ b/src/Http/Curl/CurlRequest.php @@ -1,6 +1,6 @@ getHttpStatusCode() - ->isSuccess()) { + if ( + !$httpResponse->getHttpStatusCode() + ->isSuccess() + ) { return $this->parseErrorResponse($httpResponse->getBody()); } @@ -131,8 +133,10 @@ public function getCard(string $cardID, string $token) ) ); - if (!$httpResponse->getHttpStatusCode() - ->isSuccess()) { + if ( + !$httpResponse->getHttpStatusCode() + ->isSuccess() + ) { return $this->parseErrorResponse($httpResponse->getBody()); } @@ -158,8 +162,10 @@ public function searchCards(string $identity, string $token) ) ); - if (!$httpResponse->getHttpStatusCode() - ->isSuccess()) { + if ( + !$httpResponse->getHttpStatusCode() + ->isSuccess() + ) { return $this->parseErrorResponse($httpResponse->getBody()); } @@ -187,8 +193,10 @@ public function revokeCard(string $cardID, string $token): ?ErrorResponseModel ) ); - if (!$httpResponse->getHttpStatusCode() - ->isSuccess()) { + if ( + !$httpResponse->getHttpStatusCode() + ->isSuccess() + ) { return $this->parseErrorResponse($httpResponse->getBody()); } @@ -211,6 +219,6 @@ private function parseErrorResponse(string $errorBody): ErrorResponseModel } } - return new ErrorResponseModel((int)$code, (string)$message); + return new ErrorResponseModel((int) $code, (string) $message); } } diff --git a/src/Web/ErrorResponseModel.php b/src/Web/ErrorResponseModel.php index 44942ec..e481c79 100644 --- a/src/Web/ErrorResponseModel.php +++ b/src/Web/ErrorResponseModel.php @@ -1,6 +1,6 @@