From b4c5f743033295307a70ceb0d5ce10cc8486fa7c Mon Sep 17 00:00:00 2001 From: Paul Rijke Date: Thu, 13 Jun 2024 11:43:44 +0200 Subject: [PATCH 1/3] Add tokenCacheDir to the firebase options --- src/Tiqr/TiqrConfiguration.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Tiqr/TiqrConfiguration.php b/src/Tiqr/TiqrConfiguration.php index 6e405c74..8d2b437f 100644 --- a/src/Tiqr/TiqrConfiguration.php +++ b/src/Tiqr/TiqrConfiguration.php @@ -74,6 +74,8 @@ public function __construct(array $tiqrConfiguration) $this->options['firebase.credentialsFile'] = $tiqrConfiguration['library']['firebase']['credentialsFile']; Assertion::boolean($tiqrConfiguration['library']['firebase']['cacheTokens']); $this->options['firebase.cacheTokens'] = $tiqrConfiguration['library']['firebase']['cacheTokens']; + Assertion::string($tiqrConfiguration['library']['firebase']['tokenCacheDir']); + $this->options['firebase.tokenCacheDir'] = $tiqrConfiguration['library']['firebase']['tokenCacheDir']; } if (isset($tiqrConfiguration['accountblocking'][self::MAX_ATTEMPTS])) { From 13c06774a7af108b236800803e5368666daf45c0 Mon Sep 17 00:00:00 2001 From: Paul Rijke Date: Thu, 13 Jun 2024 12:12:20 +0200 Subject: [PATCH 2/3] Fix phpstan type issue --- ci/qa/phpstan-baseline.neon | 15 --------------- src/Tiqr/TiqrConfiguration.php | 2 +- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/ci/qa/phpstan-baseline.neon b/ci/qa/phpstan-baseline.neon index 4a33ee48..67a87265 100644 --- a/ci/qa/phpstan-baseline.neon +++ b/ci/qa/phpstan-baseline.neon @@ -260,21 +260,6 @@ parameters: count: 2 path: ../../src/Tiqr/Legacy/TiqrService.php - - - message: "#^Cannot access offset 'projectId' on mixed\\.$#" - count: 1 - path: ../../src/Tiqr/TiqrConfiguration.php - - - - message: "#^Cannot access offset 'credentialsFile' on mixed\\.$#" - count: 1 - path: ../../src/Tiqr/TiqrConfiguration.php - - - - message: "#^Cannot access offset 'cacheTokens' on mixed\\.$#" - count: 1 - path: ../../src/Tiqr/TiqrConfiguration.php - - message: "#^Cannot access offset 'arguments' on mixed\\.$#" count: 4 diff --git a/src/Tiqr/TiqrConfiguration.php b/src/Tiqr/TiqrConfiguration.php index 8d2b437f..dc80d57e 100644 --- a/src/Tiqr/TiqrConfiguration.php +++ b/src/Tiqr/TiqrConfiguration.php @@ -67,7 +67,7 @@ public function __construct(array $tiqrConfiguration) $this->options['apns.environment'] = $tiqrConfiguration['library']['apns']['environment']; } - if (isset($tiqrConfiguration['library']['firebase'])) { + if (isset($tiqrConfiguration['library']['firebase']) && is_array($tiqrConfiguration['library']['firebase'])) { Assertion::string($tiqrConfiguration['library']['firebase']['projectId']); $this->options['firebase.projectId'] = $tiqrConfiguration['library']['firebase']['projectId']; Assertion::string($tiqrConfiguration['library']['firebase']['credentialsFile']); From 17b71c5ce7e94de3f62d1ea879a4b58d563400a4 Mon Sep 17 00:00:00 2001 From: Paul Rijke Date: Thu, 13 Jun 2024 12:21:26 +0200 Subject: [PATCH 3/3] Added tokenCacheDir to .dist --- config/openconext/parameters.yaml.dist | 1 + 1 file changed, 1 insertion(+) diff --git a/config/openconext/parameters.yaml.dist b/config/openconext/parameters.yaml.dist index f259381a..5705b9f8 100644 --- a/config/openconext/parameters.yaml.dist +++ b/config/openconext/parameters.yaml.dist @@ -61,6 +61,7 @@ parameters: projectId: 'FCM project ID' credentialsFile: 'absolute path to file with service account key' cacheTokens: false + tokenCacheDir: '/tmp' accountblocking: maxAttempts: 5 storage: