Skip to content

Commit

Permalink
Upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-kulhanek committed May 14, 2024
1 parent fe56c1f commit 009bf7c
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ '8.1', '8.2', '8.3' ]
php-version: [ '8.2', '8.3' ]
fail-fast: false

steps:
Expand Down
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
ARG PHP_VERSION=8.2
FROM composer:2 AS composer

FROM php:latest
FROM php:${PHP_VERSION}

RUN apt-get update \
&& apt-get install -y libzip-dev zlib1g-dev zlib1g-dev zip git libfcgi-bin jq librabbitmq-dev libpng-dev libonig-dev unzip \
&& apt-get install -y libzip-dev zlib1g-dev zlib1g-dev zip git libfcgi-bin jq libpng-dev libonig-dev unzip \
&& apt-get clean \
&& rm -rf /var/lib/apt/list/* \
&& docker-php-ext-install pdo_mysql bcmath gd mysqli \
&& docker-php-ext-configure bcmath --enable-bcmath \
&& docker-php-ext-configure zip
&& pecl install xdebug \
&& docker-php-ext-enable xdebug

COPY --from=composer /usr/bin/composer /usr/bin/composer
COPY --from=composer /usr/bin/composer /usr/bin/composer
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ Pokud je potřeba implementovat vlastního klienta, je potřeba implementovat ro
## Popis
Tato knihovna slouží k základní komunikaci s Informačním systémem datových scrhánek [ISDS](https://mojedatovaschranka.cz) nebo [ISDS test](https://czebox.cz)

Veškeré ukázky, jak pracovat s knihovnou naleznete v examples. Jediná podmínka ke zprovoznění je ta, že musíte vlastnit své přístupové údaje.

## Základní použití
Pro každou operaci je potřebné zadat přístupové údaje
```php
Expand Down
20 changes: 10 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
"source": "https://github.com/tomas-kulhanek/czech-data-box"
},
"require": {
"php": ">=8.1",
"php": ">=8.2",
"ext-curl": "*",
"ext-dom": "*",
"ext-mbstring": "*",
"ext-openssl": "*",
"ext-xml": "*",
"symfony/validator": "^6.0",
"tomas-kulhanek/serializer": "^2.0"
"symfony/validator": "^7.0",
"tomas-kulhanek/serializer": "^2.0.3"
},
"autoload": {
"psr-4": {
Expand All @@ -46,14 +46,14 @@
"symfony/http-client": "for usage with symfony"
},
"require-dev": {
"guzzlehttp/guzzle": "^7.3",
"nyholm/psr7": "^1.4",
"php-http/httplug": "^2.2",
"symfony/http-client": "5.4.*|6.*",
"phpstan/phpstan": "^1.10",
"guzzlehttp/guzzle": "^7.8",
"nyholm/psr7": "^1.8",
"php-http/httplug": "^2.4",
"symfony/http-client": "5.4.*|6.*|7.*",
"phpstan/phpstan": "^1.11",
"phpunit/phpunit": "^10.5",
"rector/rector": "^0.19.2 || ^1.0.0",
"squizlabs/php_codesniffer": "^3.7"
"rector/rector": "^1.0",
"squizlabs/php_codesniffer": "^3.9"
},
"scripts": {
"check": [
Expand Down
13 changes: 11 additions & 2 deletions src/Provider/GuzzleClientProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,17 @@ public function sendRequest(Account $account, int $serviceType, string $xmlBody)
}
fwrite($publicCert, $account->getPublicKey());
fwrite($privateKey, $account->getPrivateKey());
$requestOptions[RequestOptions::CERT] = [stream_get_meta_data($publicCert)['uri'], $account->getPrivateKeyPassPhrase()];
$requestOptions[RequestOptions::SSL_KEY] = [stream_get_meta_data($privateKey)['uri'], $account->getPrivateKeyPassPhrase()];

$publicStream = stream_get_meta_data($publicCert);
if (!array_key_exists('uri', $publicStream)) {
throw new \LogicException('Failed to get stream metadata of public certificate');
}
$privateStream = stream_get_meta_data($privateKey);
if (!array_key_exists('uri', $privateStream)) {
throw new \LogicException('Failed to get stream metadata of private certificate');
}
$requestOptions[RequestOptions::CERT] = [$publicStream['uri'], $account->getPrivateKeyPassPhrase()];
$requestOptions[RequestOptions::SSL_KEY] = [$privateStream['uri'], $account->getPrivateKeyPassPhrase()];
}

$requestOptions[RequestOptions::HEADERS] = $this->getHeaders();
Expand Down
13 changes: 11 additions & 2 deletions src/Provider/SymfonyClientProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,17 @@ public function sendRequest(Account $account, int $serviceType, string $xmlBody)
}
fwrite($publicCert, $account->getPublicKey());
fwrite($privateKey, $account->getPrivateKey());
$requestOptions['local_cert'] = stream_get_meta_data($publicCert)['uri'];
$requestOptions['local_pk'] = stream_get_meta_data($privateKey)['uri'];

$publicStream = stream_get_meta_data($publicCert);
if (!array_key_exists('uri', $publicStream)) {
throw new \LogicException('Failed to get stream metadata of public certificate');
}
$privateStream = stream_get_meta_data($privateKey);
if (!array_key_exists('uri', $privateStream)) {
throw new \LogicException('Failed to get stream metadata of private certificate');
}
$requestOptions['local_cert'] = $publicStream['uri'];
$requestOptions['local_pk'] = $privateStream['uri'];
$requestOptions['passphrase'] = $account->getPrivateKeyPassPhrase();
}

Expand Down

0 comments on commit 009bf7c

Please sign in to comment.