From 7db7a6e137dea2b714119de372c38c8039a32106 Mon Sep 17 00:00:00 2001 From: Luis Amorim Date: Fri, 18 Sep 2026 11:27:19 -0300 Subject: [PATCH 01/10] test(behat): add PDF_BASE64 placeholder for demo fixtures Provide an inline data-URI from small_valid.pdf so scenarios can send PDFs without nested HTTP to the PHP built-in server. Signed-off-by: Luis Amorim --- .../features/bootstrap/FeatureContext.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php index db97f6df23..bc7a14da68 100644 --- a/tests/integration/features/bootstrap/FeatureContext.php +++ b/tests/integration/features/bootstrap/FeatureContext.php @@ -51,6 +51,7 @@ protected function parseText(string $text): string { $fields = $this->fields; $fields['BASE_URL'] = $this->baseUrl . '/index.php'; $fields['TSA_URL'] = getenv('LIBRESIGN_TSA_URL') ?: 'https://freetsa.org/tsr'; + $fields['PDF_BASE64'] = $this->getDemoPdfBase64(); $patterns = []; $replacements = []; foreach ($fields as $key => $value) { @@ -62,6 +63,20 @@ protected function parseText(string $text): string { return $text; } + /** + * Inline PDF fixture for Behat requests. + * + * Prefer this over {"url":".../develop/pdf"} so request-signature does not + * HTTP-call the same PHP built-in server (which requires PHP_CLI_SERVER_WORKERS + * and is a known source of cURL 52 Empty reply flakes). + */ + private function getDemoPdfBase64(): string { + $pdfPath = __DIR__ . '/../../../php/fixtures/pdfs/small_valid.pdf'; + $contents = file_get_contents($pdfPath); + Assert::assertNotFalse($contents, 'Demo PDF fixture missing: ' . $pdfPath); + return 'data:application/pdf;base64,' . base64_encode($contents); + } + #[Given('I fetch the signer UUID from opened email')] public function iFetchTheLinkOnOpenedEmail(): void { if (!$this->openedEmailStorage->hasOpenedEmail()) { From be6c476eca3f53615e2f6b3b4c1f2ad133d0c27e Mon Sep 17 00:00:00 2001 From: Luis Amorim Date: Fri, 18 Sep 2026 11:27:34 -0300 Subject: [PATCH 02/10] test(behat): disable PHP built-in server workers With fixtures no longer nesting HTTP to develop/pdf, a single-process php -S is enough and avoids experimental PHP_CLI_SERVER_WORKERS flakes. Signed-off-by: Luis Amorim --- tests/integration/config/behat.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/integration/config/behat.yml b/tests/integration/config/behat.yml index 6fb644805f..bab02ebc0e 100644 --- a/tests/integration/config/behat.yml +++ b/tests/integration/config/behat.yml @@ -16,7 +16,10 @@ default: base_url: http://mailpit:8025 PhpBuiltin\Server: runAs: www-data - workers: 10 + # Keep single-process built-in server. Multi-worker (PHP_CLI_SERVER_WORKERS) + # is experimental and flakes with cURL 52 under Behat load. Fixtures use + # inline instead of nested HTTP to /develop/pdf. + workers: 0 jarnaiz\JUnitFormatter\JUnitFormatterExtension: filename: report.xml outputDir: '%paths.base%/../output/' From 22992264e38ec4af94db93d9117fd2c2665f562c Mon Sep 17 00:00:00 2001 From: Luis Amorim Date: Fri, 18 Sep 2026 11:34:08 -0300 Subject: [PATCH 03/10] fix(behat): keep two PHP built-in server workers workers: 0 deadlocks any nested self-HTTP on php -S. Use the minimum of two workers while fixtures stay on inline PDF base64 to avoid the previous cURL 52 flakes from workers: 10. Signed-off-by: Luis Amorim --- tests/integration/config/behat.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/integration/config/behat.yml b/tests/integration/config/behat.yml index bab02ebc0e..0b3b9cbfd2 100644 --- a/tests/integration/config/behat.yml +++ b/tests/integration/config/behat.yml @@ -16,10 +16,11 @@ default: base_url: http://mailpit:8025 PhpBuiltin\Server: runAs: www-data - # Keep single-process built-in server. Multi-worker (PHP_CLI_SERVER_WORKERS) - # is experimental and flakes with cURL 52 under Behat load. Fixtures use - # inline instead of nested HTTP to /develop/pdf. - workers: 0 + # Keep the minimum workers needed for occasional nested HTTP to the same + # PHP built-in server (single-process deadlocks on self-requests). Prefer + # inline fixtures over url→/develop/pdf to avoid load-driven + # cURL 52 flakes from higher PHP_CLI_SERVER_WORKERS values. + workers: 2 jarnaiz\JUnitFormatter\JUnitFormatterExtension: filename: report.xml outputDir: '%paths.base%/../output/' From a02c7e3caa01762cdf26427075881aa651ceb143 Mon Sep 17 00:00:00 2001 From: Luis Amorim Date: Fri, 18 Sep 2026 11:37:49 -0300 Subject: [PATCH 04/10] test(behat): cover request-signature url via separate fixture server Serve small_valid.pdf from a second local php -S process and add a scenario that posts {"url":""} so url download stays covered without nested HTTP to the Behat Nextcloud server. Signed-off-by: Luis Amorim --- .../features/bootstrap/FeatureContext.php | 16 ++- .../features/bootstrap/FixtureHttpServer.php | 107 ++++++++++++++++++ .../integration/features/sign/request.feature | 13 +++ 3 files changed, 132 insertions(+), 4 deletions(-) create mode 100644 tests/integration/features/bootstrap/FixtureHttpServer.php diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php index bc7a14da68..041638ea5b 100644 --- a/tests/integration/features/bootstrap/FeatureContext.php +++ b/tests/integration/features/bootstrap/FeatureContext.php @@ -7,6 +7,7 @@ */ use Behat\Gherkin\Node\TableNode; +use Behat\Hook\AfterSuite; use Behat\Hook\BeforeScenario; use Behat\Hook\BeforeSuite; use Behat\Step\Given; @@ -25,11 +26,18 @@ class FeatureContext extends NextcloudApiContext implements OpenedEmailStorageAw #[BeforeSuite()] public static function beforeSuite(BeforeSuiteScope $scope):void { parent::beforeSuite($scope); + FixtureHttpServer::start(); self::runCommand('config:system:set debug --value true --type boolean'); + self::runCommand('config:system:set allow_local_remote_servers --value true --type boolean'); self::runCommand('app:enable --force libresign'); self::runCommand('app:enable --force notifications'); } + #[AfterSuite()] + public static function afterSuite(): void { + FixtureHttpServer::stop(); + } + #[BeforeScenario()] public static function beforeScenario(): void { parent::beforeScenario(); @@ -52,6 +60,7 @@ protected function parseText(string $text): string { $fields['BASE_URL'] = $this->baseUrl . '/index.php'; $fields['TSA_URL'] = getenv('LIBRESIGN_TSA_URL') ?: 'https://freetsa.org/tsr'; $fields['PDF_BASE64'] = $this->getDemoPdfBase64(); + $fields['PDF_URL'] = FixtureHttpServer::getPdfUrl(); $patterns = []; $replacements = []; foreach ($fields as $key => $value) { @@ -64,11 +73,10 @@ protected function parseText(string $text): string { } /** - * Inline PDF fixture for Behat requests. + * Inline PDF fixture for Behat requests that do not need to exercise url download. * - * Prefer this over {"url":".../develop/pdf"} so request-signature does not - * HTTP-call the same PHP built-in server (which requires PHP_CLI_SERVER_WORKERS - * and is a known source of cURL 52 Empty reply flakes). + * Prefer this over url→the Behat Nextcloud server. For url coverage use , + * which is served by FixtureHttpServer on a separate local port. */ private function getDemoPdfBase64(): string { $pdfPath = __DIR__ . '/../../../php/fixtures/pdfs/small_valid.pdf'; diff --git a/tests/integration/features/bootstrap/FixtureHttpServer.php b/tests/integration/features/bootstrap/FixtureHttpServer.php new file mode 100644 index 0000000000..ce1a75f16d --- /dev/null +++ b/tests/integration/features/bootstrap/FixtureHttpServer.php @@ -0,0 +1,107 @@ + /dev/null 2>&1 & echo $!', + escapeshellarg(self::$host), + self::$port, + escapeshellarg(self::$documentRoot) + ); + + self::$pid = trim((string) shell_exec($cmd)); + if (self::$pid === '' || !ctype_digit(self::$pid)) { + throw new RuntimeException('Failed to start fixture HTTP server process.'); + } + + for ($attempt = 0; $attempt < 30; $attempt++) { + usleep(100000); + $socket = @fsockopen(self::$host, self::$port); + if (is_resource($socket)) { + fclose($socket); + register_shutdown_function(static function (): void { + self::stop(); + }); + return; + } + } + + self::stop(); + throw new RuntimeException('Fixture HTTP server did not become ready in time.'); + } + + public static function stop(): void { + if (self::isRunning()) { + exec('kill ' . self::$pid); + } + self::$pid = '0'; + self::$port = 0; + } + + public static function getPdfUrl(): string { + if (!self::isRunning() || self::$port <= 0) { + throw new RuntimeException('Fixture HTTP server is not running.'); + } + + return sprintf('http://%s:%d/small_valid.pdf', self::$host, self::$port); + } + + private static function isRunning(): bool { + if (self::$pid === '' || self::$pid === '0') { + return false; + } + + exec(sprintf('ps %d', (int) self::$pid), $result); + + return count($result) > 1; + } + + private static function findOpenPort(string $host): int { + $server = @stream_socket_server('tcp://' . $host . ':0', $errno, $errstr); + if ($server === false) { + throw new RuntimeException('Unable to allocate local port for fixture HTTP server: ' . $errstr); + } + + $name = stream_socket_get_name($server, false); + fclose($server); + + if (!is_string($name) || !str_contains($name, ':')) { + throw new RuntimeException('Unable to detect allocated local port for fixture HTTP server.'); + } + + $parts = explode(':', $name); + $port = (int) end($parts); + if ($port <= 0) { + throw new RuntimeException('Invalid allocated port for fixture HTTP server.'); + } + + return $port; + } +} diff --git a/tests/integration/features/sign/request.feature b/tests/integration/features/sign/request.feature index 73e43a659e..7b420ecfe3 100644 --- a/tests/integration/features/sign/request.feature +++ b/tests/integration/features/sign/request.feature @@ -28,6 +28,19 @@ Feature: request-signature | key | value | | (jq).ocs.data.message | File name is required | + Scenario: Create signature request from a remote PDF URL + Given as user "admin" + And sending "post" to ocs "/apps/libresign/api/v1/admin/certificate/openssl" + | rootCert | {"commonName":"test"} | + When sending "post" to ocs "/apps/libresign/api/v1/request-signature" + | file | {"url":""} | + | signers | [{"identifyMethods":[{"method":"email","value":"signer-url@domain.test"}]}] | + | name | document-from-url | + Then the response should have a status code 200 + And the response should be a JSON array with the following mandatory values + | key | value | + | (jq).ocs.data.name | document-from-url | + Scenario: Create signature request with error using different authenticated account Given as user "admin" And user "signer1" exists From f6903be246d99b86d9b32fc8556531dc23a6d966 Mon Sep 17 00:00:00 2001 From: Luis Amorim Date: Fri, 18 Sep 2026 11:47:02 -0300 Subject: [PATCH 05/10] style(behat): apply php-cs-fixer to FixtureHttpServer Signed-off-by: Luis Amorim --- tests/integration/features/bootstrap/FixtureHttpServer.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/integration/features/bootstrap/FixtureHttpServer.php b/tests/integration/features/bootstrap/FixtureHttpServer.php index ce1a75f16d..c8f0ae7229 100644 --- a/tests/integration/features/bootstrap/FixtureHttpServer.php +++ b/tests/integration/features/bootstrap/FixtureHttpServer.php @@ -36,7 +36,7 @@ public static function start(): void { escapeshellarg(self::$documentRoot) ); - self::$pid = trim((string) shell_exec($cmd)); + self::$pid = trim((string)shell_exec($cmd)); if (self::$pid === '' || !ctype_digit(self::$pid)) { throw new RuntimeException('Failed to start fixture HTTP server process.'); } @@ -78,7 +78,7 @@ private static function isRunning(): bool { return false; } - exec(sprintf('ps %d', (int) self::$pid), $result); + exec(sprintf('ps %d', (int)self::$pid), $result); return count($result) > 1; } @@ -97,7 +97,7 @@ private static function findOpenPort(string $host): int { } $parts = explode(':', $name); - $port = (int) end($parts); + $port = (int)end($parts); if ($port <= 0) { throw new RuntimeException('Invalid allocated port for fixture HTTP server.'); } From 5084a0bf91d732a7bf28bc6970624bb1ee093d9e Mon Sep 17 00:00:00 2001 From: Luis Amorim Date: Fri, 18 Sep 2026 15:32:41 -0300 Subject: [PATCH 06/10] test(behat): retry ConnectException against PHP built-in server Failsafe for residual cURL 52 empty-reply flakes during Behat HTTP bursts; retries up to three times with backoff and STDERR diagnostics. Signed-off-by: Luis Amorim --- .../features/bootstrap/FeatureContext.php | 37 ++++++--- .../bootstrap/TransientConnectionRetry.php | 50 ++++++++++++ .../TransientConnectionRetryTest.php | 76 +++++++++++++++++++ 3 files changed, 153 insertions(+), 10 deletions(-) create mode 100644 tests/integration/features/bootstrap/TransientConnectionRetry.php create mode 100644 tests/integration/features/bootstrap/TransientConnectionRetryTest.php diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php index 041638ea5b..e98a079bc0 100644 --- a/tests/integration/features/bootstrap/FeatureContext.php +++ b/tests/integration/features/bootstrap/FeatureContext.php @@ -6,6 +6,7 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ +use Behat\Gherkin\Node\PyStringNode; use Behat\Gherkin\Node\TableNode; use Behat\Hook\AfterSuite; use Behat\Hook\BeforeScenario; @@ -55,6 +56,20 @@ protected function beforeRequest(string $fullUrl, array $options): array { return [$fullUrl, $options]; } + /** + * Retry transient connection drops from the PHP built-in server (cURL 52). + * + * Intentionally has no #[Given] attribute: Behat keeps the parent step + * definition, and PHP dispatches to this override on the FeatureContext instance. + * + * @param TableNode|PyStringNode|array|null $body + */ + public function sendRequest(string $verb, string $url, $body = null, array $headers = [], array $options = []): void { + TransientConnectionRetry::run( + fn () => parent::sendRequest($verb, $url, $body, $headers, $options) + ); + } + protected function parseText(string $text): string { $fields = $this->fields; $fields['BASE_URL'] = $this->baseUrl . '/index.php'; @@ -235,16 +250,18 @@ public function fetchWebDavPropertyTo(string $property, string $alias): void { } private function davRequest(string $user, string $method, string $path, ?string $body = null, array $headers = []): void { - $client = new \GuzzleHttp\Client(); - try { - $this->response = $client->request($method, $this->baseUrl . '/remote.php/dav/files/' . $user . '/' . $path, [ - 'auth' => [$user === 'admin' ? 'admin' : $user, $user === 'admin' ? $this->adminPassword : $this->testPassword], - 'headers' => $headers, - 'body' => $body, - ]); - } catch (\GuzzleHttp\Exception\ClientException $ex) { - $this->response = $ex->getResponse(); - } + TransientConnectionRetry::run(function () use ($user, $method, $path, $body, $headers): void { + $client = new \GuzzleHttp\Client(); + try { + $this->response = $client->request($method, $this->baseUrl . '/remote.php/dav/files/' . $user . '/' . $path, [ + 'auth' => [$user === 'admin' ? 'admin' : $user, $user === 'admin' ? $this->adminPassword : $this->testPassword], + 'headers' => $headers, + 'body' => $body, + ]); + } catch (\GuzzleHttp\Exception\ClientException $ex) { + $this->response = $ex->getResponse(); + } + }); } private function parseXml(): \SimpleXMLElement { diff --git a/tests/integration/features/bootstrap/TransientConnectionRetry.php b/tests/integration/features/bootstrap/TransientConnectionRetry.php new file mode 100644 index 0000000000..465917386d --- /dev/null +++ b/tests/integration/features/bootstrap/TransientConnectionRetry.php @@ -0,0 +1,50 @@ += $maxAttempts) { + throw $exception; + } + fwrite( + STDERR, + sprintf( + "[behat] transient connection error (attempt %d/%d): %s\n", + $attempt, + $maxAttempts, + $exception->getMessage() + ) + ); + usleep($baseDelayMicros * $attempt); + } + } + } +} diff --git a/tests/integration/features/bootstrap/TransientConnectionRetryTest.php b/tests/integration/features/bootstrap/TransientConnectionRetryTest.php new file mode 100644 index 0000000000..9931e4b992 --- /dev/null +++ b/tests/integration/features/bootstrap/TransientConnectionRetryTest.php @@ -0,0 +1,76 @@ +assertSame('ok', $result); + $this->assertSame(1, $calls); + } + + public function testRetriesConnectExceptionThenSucceeds(): void { + $calls = 0; + $result = TransientConnectionRetry::run(function () use (&$calls): string { + $calls++; + if ($calls < 3) { + throw new ConnectException( + 'cURL error 52: Empty reply from server', + new Request('POST', 'http://localhost/ocs/v2.php/apps/libresign/api/v1/request-signature') + ); + } + return 'recovered'; + }, 3, 1); + + $this->assertSame('recovered', $result); + $this->assertSame(3, $calls); + } + + public function testRethrowsAfterExhaustingAttempts(): void { + $calls = 0; + $this->expectException(ConnectException::class); + $this->expectExceptionMessage('Empty reply from server'); + + try { + TransientConnectionRetry::run(function () use (&$calls): void { + $calls++; + throw new ConnectException( + 'cURL error 52: Empty reply from server', + new Request('POST', 'http://localhost/test') + ); + }, 3, 1); + } finally { + $this->assertSame(3, $calls); + } + } + + public function testDoesNotRetryNonConnectExceptions(): void { + $calls = 0; + $this->expectException(RuntimeException::class); + $this->expectExceptionMessage('boom'); + + try { + TransientConnectionRetry::run(function () use (&$calls): void { + $calls++; + throw new RuntimeException('boom'); + }, 3, 1); + } finally { + $this->assertSame(1, $calls); + } + } +} From 85c72faa44886d69bc2f67a523abe57f6bb22d6b Mon Sep 17 00:00:00 2001 From: Luis Amorim Date: Fri, 18 Sep 2026 22:55:07 -0300 Subject: [PATCH 07/10] revert(behat): remove TransientConnectionRetry workaround Retrying around cURL 52/7 hides the real failure and is unsafe for POST requests such as request-signature. Prefer diagnosing PHP built-in server death via behat-builtin-extension verbose mode. Signed-off-by: Luis Amorim --- .../features/bootstrap/FeatureContext.php | 37 +++------ .../bootstrap/TransientConnectionRetry.php | 50 ------------ .../TransientConnectionRetryTest.php | 76 ------------------- 3 files changed, 10 insertions(+), 153 deletions(-) delete mode 100644 tests/integration/features/bootstrap/TransientConnectionRetry.php delete mode 100644 tests/integration/features/bootstrap/TransientConnectionRetryTest.php diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php index e98a079bc0..041638ea5b 100644 --- a/tests/integration/features/bootstrap/FeatureContext.php +++ b/tests/integration/features/bootstrap/FeatureContext.php @@ -6,7 +6,6 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -use Behat\Gherkin\Node\PyStringNode; use Behat\Gherkin\Node\TableNode; use Behat\Hook\AfterSuite; use Behat\Hook\BeforeScenario; @@ -56,20 +55,6 @@ protected function beforeRequest(string $fullUrl, array $options): array { return [$fullUrl, $options]; } - /** - * Retry transient connection drops from the PHP built-in server (cURL 52). - * - * Intentionally has no #[Given] attribute: Behat keeps the parent step - * definition, and PHP dispatches to this override on the FeatureContext instance. - * - * @param TableNode|PyStringNode|array|null $body - */ - public function sendRequest(string $verb, string $url, $body = null, array $headers = [], array $options = []): void { - TransientConnectionRetry::run( - fn () => parent::sendRequest($verb, $url, $body, $headers, $options) - ); - } - protected function parseText(string $text): string { $fields = $this->fields; $fields['BASE_URL'] = $this->baseUrl . '/index.php'; @@ -250,18 +235,16 @@ public function fetchWebDavPropertyTo(string $property, string $alias): void { } private function davRequest(string $user, string $method, string $path, ?string $body = null, array $headers = []): void { - TransientConnectionRetry::run(function () use ($user, $method, $path, $body, $headers): void { - $client = new \GuzzleHttp\Client(); - try { - $this->response = $client->request($method, $this->baseUrl . '/remote.php/dav/files/' . $user . '/' . $path, [ - 'auth' => [$user === 'admin' ? 'admin' : $user, $user === 'admin' ? $this->adminPassword : $this->testPassword], - 'headers' => $headers, - 'body' => $body, - ]); - } catch (\GuzzleHttp\Exception\ClientException $ex) { - $this->response = $ex->getResponse(); - } - }); + $client = new \GuzzleHttp\Client(); + try { + $this->response = $client->request($method, $this->baseUrl . '/remote.php/dav/files/' . $user . '/' . $path, [ + 'auth' => [$user === 'admin' ? 'admin' : $user, $user === 'admin' ? $this->adminPassword : $this->testPassword], + 'headers' => $headers, + 'body' => $body, + ]); + } catch (\GuzzleHttp\Exception\ClientException $ex) { + $this->response = $ex->getResponse(); + } } private function parseXml(): \SimpleXMLElement { diff --git a/tests/integration/features/bootstrap/TransientConnectionRetry.php b/tests/integration/features/bootstrap/TransientConnectionRetry.php deleted file mode 100644 index 465917386d..0000000000 --- a/tests/integration/features/bootstrap/TransientConnectionRetry.php +++ /dev/null @@ -1,50 +0,0 @@ -= $maxAttempts) { - throw $exception; - } - fwrite( - STDERR, - sprintf( - "[behat] transient connection error (attempt %d/%d): %s\n", - $attempt, - $maxAttempts, - $exception->getMessage() - ) - ); - usleep($baseDelayMicros * $attempt); - } - } - } -} diff --git a/tests/integration/features/bootstrap/TransientConnectionRetryTest.php b/tests/integration/features/bootstrap/TransientConnectionRetryTest.php deleted file mode 100644 index 9931e4b992..0000000000 --- a/tests/integration/features/bootstrap/TransientConnectionRetryTest.php +++ /dev/null @@ -1,76 +0,0 @@ -assertSame('ok', $result); - $this->assertSame(1, $calls); - } - - public function testRetriesConnectExceptionThenSucceeds(): void { - $calls = 0; - $result = TransientConnectionRetry::run(function () use (&$calls): string { - $calls++; - if ($calls < 3) { - throw new ConnectException( - 'cURL error 52: Empty reply from server', - new Request('POST', 'http://localhost/ocs/v2.php/apps/libresign/api/v1/request-signature') - ); - } - return 'recovered'; - }, 3, 1); - - $this->assertSame('recovered', $result); - $this->assertSame(3, $calls); - } - - public function testRethrowsAfterExhaustingAttempts(): void { - $calls = 0; - $this->expectException(ConnectException::class); - $this->expectExceptionMessage('Empty reply from server'); - - try { - TransientConnectionRetry::run(function () use (&$calls): void { - $calls++; - throw new ConnectException( - 'cURL error 52: Empty reply from server', - new Request('POST', 'http://localhost/test') - ); - }, 3, 1); - } finally { - $this->assertSame(3, $calls); - } - } - - public function testDoesNotRetryNonConnectExceptions(): void { - $calls = 0; - $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('boom'); - - try { - TransientConnectionRetry::run(function () use (&$calls): void { - $calls++; - throw new RuntimeException('boom'); - }, 3, 1); - } finally { - $this->assertSame(1, $calls); - } - } -} From e0dde8603f8bd8b81ed1e25f33d0b2173e67c36a Mon Sep 17 00:00:00 2001 From: Luis Amorim Date: Sun, 20 Sep 2026 16:09:58 -0300 Subject: [PATCH 08/10] chore(behat): bump nextcloud-behat to 1.6.1 for builtin 0.7.0 chore(behat): bump nextcloud-behat to 1.6.1 for builtin 0.7.0 Unlock verbose PHP built-in server diagnostics so Behat CI can show PID, logs, and exit status on cURL 52 flakes. Signed-off-by: Luis Amorim [skip ci] --- tests/integration/composer.lock | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/integration/composer.lock b/tests/integration/composer.lock index db167d43c4..5ddf40d438 100644 --- a/tests/integration/composer.lock +++ b/tests/integration/composer.lock @@ -905,16 +905,16 @@ }, { "name": "libresign/behat-builtin-extension", - "version": "v0.6.3", + "version": "v0.7.0", "source": { "type": "git", "url": "https://github.com/LibreSign/behat-builtin-extension.git", - "reference": "d9ddb309bbf36826f47318ca74d67c9e6c5714f9" + "reference": "fbb27f1573ab646f774daab8f4a6c5d5e2c25102" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/LibreSign/behat-builtin-extension/zipball/d9ddb309bbf36826f47318ca74d67c9e6c5714f9", - "reference": "d9ddb309bbf36826f47318ca74d67c9e6c5714f9", + "url": "https://api.github.com/repos/LibreSign/behat-builtin-extension/zipball/fbb27f1573ab646f774daab8f4a6c5d5e2c25102", + "reference": "fbb27f1573ab646f774daab8f4a6c5d5e2c25102", "shasum": "" }, "require": { @@ -945,9 +945,9 @@ "description": "Behat extension to run php built-in web server", "support": { "issues": "https://github.com/LibreSign/behat-builtin-extension/issues", - "source": "https://github.com/LibreSign/behat-builtin-extension/tree/v0.6.3" + "source": "https://github.com/LibreSign/behat-builtin-extension/tree/v0.7.0" }, - "time": "2024-10-31T18:50:11+00:00" + "time": "2026-09-19T19:17:52+00:00" }, { "name": "libresign/behat-tsa-extension", @@ -1128,24 +1128,24 @@ }, { "name": "libresign/nextcloud-behat", - "version": "v1.6.0", + "version": "v1.6.1", "source": { "type": "git", "url": "https://github.com/LibreSign/nextcloud-behat.git", - "reference": "617ffaae34ebf0e3794a09123a376c2598008f48" + "reference": "c650035f5e61d19110b8d62ca4a8a073ad7fad12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/LibreSign/nextcloud-behat/zipball/617ffaae34ebf0e3794a09123a376c2598008f48", - "reference": "617ffaae34ebf0e3794a09123a376c2598008f48", + "url": "https://api.github.com/repos/LibreSign/nextcloud-behat/zipball/c650035f5e61d19110b8d62ca4a8a073ad7fad12", + "reference": "c650035f5e61d19110b8d62ca4a8a073ad7fad12", "shasum": "" }, "require": { "behat/behat": "^3.29", "estahn/json-query-wrapper": "*", "guzzlehttp/guzzle": "^7.10", - "libresign/behat-builtin-extension": "^0.6.3", - "php": ">=8.1", + "libresign/behat-builtin-extension": "^0.7.0", + "php": ">=8.2", "phpunit/phpunit": "*" }, "require-dev": { @@ -1182,9 +1182,9 @@ ], "support": { "issues": "https://github.com/LibreSign/nextcloud-behat/issues", - "source": "https://github.com/LibreSign/nextcloud-behat/tree/v1.6.0" + "source": "https://github.com/LibreSign/nextcloud-behat/tree/v1.6.1" }, - "time": "2026-04-11T00:33:49+00:00" + "time": "2026-09-20T16:52:51+00:00" }, { "name": "myclabs/deep-copy", From 77c93feca9ad39c8cb2ac8744c7ae2f41862009f Mon Sep 17 00:00:00 2001 From: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> Date: Sun, 20 Sep 2026 17:05:27 -0300 Subject: [PATCH 09/10] fix(behat): complete #8430 backport for stable35 Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> --- tests/integration/config/behat.yml | 2 +- .../features/account/signature.feature | 2 +- .../features/bootstrap/FeatureContext.php | 8 ++-- .../features/bootstrap/FixtureHttpServer.php | 2 +- .../features/file/envelope.feature | 6 +-- tests/integration/features/file/list.feature | 12 ++--- .../features/file/thumbnail.feature | 2 +- .../features/file/validate.feature | 10 ++--- .../custom_message_notification.feature | 8 ++-- .../features/page/validate.feature | 4 +- .../groups_request_sign_policy.feature | 20 ++++----- .../identification_documents_policy.feature | 4 +- .../integration/features/sign/cancel.feature | 8 ++-- .../integration/features/sign/reject.feature | 30 ++++++------- .../integration/features/sign/request.feature | 44 +++++++++---------- .../features/sign/sequential_signing.feature | 4 +- .../integration/features/sign/signed.feature | 8 ++-- .../features/sign/signer_geolocation.feature | 6 +-- tests/integration/features/sign/tsa.feature | 4 +- 19 files changed, 92 insertions(+), 92 deletions(-) diff --git a/tests/integration/config/behat.yml b/tests/integration/config/behat.yml index 0b3b9cbfd2..3a38b111f3 100644 --- a/tests/integration/config/behat.yml +++ b/tests/integration/config/behat.yml @@ -18,7 +18,7 @@ default: runAs: www-data # Keep the minimum workers needed for occasional nested HTTP to the same # PHP built-in server (single-process deadlocks on self-requests). Prefer - # inline fixtures over url→/develop/pdf to avoid load-driven + # inline fixtures over url→/develop/pdf to avoid load-driven # cURL 52 flakes from higher PHP_CLI_SERVER_WORKERS values. workers: 2 jarnaiz\JUnitFormatter\JUnitFormatterExtension: diff --git a/tests/integration/features/account/signature.feature b/tests/integration/features/account/signature.feature index e7e5cb4ccb..a497e5439e 100644 --- a/tests/integration/features/account/signature.feature +++ b/tests/integration/features/account/signature.feature @@ -257,7 +257,7 @@ Feature: account/signature And sending "post" to ocs "/apps/libresign/api/v1/policies/system/identify_methods" | value | (string){"can_create_account":false,"factors":[{"name":"email","enabled":true,"requirement":"required"}]} | And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"email","value":"signer@test.coop"}]}] | | name | document | When as user "" diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php index 041638ea5b..e58f005186 100644 --- a/tests/integration/features/bootstrap/FeatureContext.php +++ b/tests/integration/features/bootstrap/FeatureContext.php @@ -59,8 +59,8 @@ protected function parseText(string $text): string { $fields = $this->fields; $fields['BASE_URL'] = $this->baseUrl . '/index.php'; $fields['TSA_URL'] = getenv('LIBRESIGN_TSA_URL') ?: 'https://freetsa.org/tsr'; - $fields['PDF_BASE64'] = $this->getDemoPdfBase64(); - $fields['PDF_URL'] = FixtureHttpServer::getPdfUrl(); + $fields['SMALL_VALID_PDF_BASE64'] = $this->getSmallValidPdfBase64(); + $fields['SMALL_VALID_PDF_URL'] = FixtureHttpServer::getSmallValidPdfUrl(); $patterns = []; $replacements = []; foreach ($fields as $key => $value) { @@ -75,10 +75,10 @@ protected function parseText(string $text): string { /** * Inline PDF fixture for Behat requests that do not need to exercise url download. * - * Prefer this over url→the Behat Nextcloud server. For url coverage use , + * Prefer this over url→the Behat Nextcloud server. For url coverage use , * which is served by FixtureHttpServer on a separate local port. */ - private function getDemoPdfBase64(): string { + private function getSmallValidPdfBase64(): string { $pdfPath = __DIR__ . '/../../../php/fixtures/pdfs/small_valid.pdf'; $contents = file_get_contents($pdfPath); Assert::assertNotFalse($contents, 'Demo PDF fixture missing: ' . $pdfPath); diff --git a/tests/integration/features/bootstrap/FixtureHttpServer.php b/tests/integration/features/bootstrap/FixtureHttpServer.php index c8f0ae7229..11b561ee1b 100644 --- a/tests/integration/features/bootstrap/FixtureHttpServer.php +++ b/tests/integration/features/bootstrap/FixtureHttpServer.php @@ -65,7 +65,7 @@ public static function stop(): void { self::$port = 0; } - public static function getPdfUrl(): string { + public static function getSmallValidPdfUrl(): string { if (!self::isRunning() || self::$port <= 0) { throw new RuntimeException('Fixture HTTP server is not running.'); } diff --git a/tests/integration/features/file/envelope.feature b/tests/integration/features/file/envelope.feature index f8da38ead1..212780f254 100644 --- a/tests/integration/features/file/envelope.feature +++ b/tests/integration/features/file/envelope.feature @@ -6,7 +6,7 @@ Feature: envelope And sending "post" to ocs "/apps/libresign/api/v1/admin/certificate/openssl" | rootCert | {"commonName":"test"} | When sending "post" to ocs "/apps/libresign/api/v1/file" - | files | [{"url":"/apps/libresign/develop/pdf"},{"url":"/apps/libresign/develop/pdf"}] | + | files | [{"base64":""},{"base64":""}] | | name | Contract Package | Then the response should have a status code 422 And the response should be a JSON array with the following mandatory values @@ -43,7 +43,7 @@ Feature: envelope And sending "post" to ocs "/apps/libresign/api/v1/admin/certificate/openssl" | rootCert | {"commonName":"test"} | When sending "post" to ocs "/apps/libresign/api/v1/file" - | files | [{"url":"/apps/libresign/develop/pdf"},{"url":"/apps/libresign/develop/pdf"},{"url":"/apps/libresign/develop/pdf"}] | + | files | [{"base64":""},{"base64":""},{"base64":""}] | | name | Too Many Files | Then the response should have a status code 422 And the response should be a JSON array with the following mandatory values @@ -55,7 +55,7 @@ Feature: envelope And sending "post" to ocs "/apps/libresign/api/v1/admin/certificate/openssl" | rootCert | {"commonName":"test"} | When sending "post" to ocs "/apps/libresign/api/v1/file" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | name | Single Document | Then the response should have a status code 200 And the response should be a JSON array with the following mandatory values diff --git a/tests/integration/features/file/list.feature b/tests/integration/features/file/list.feature index 50a566f739..3dcef48d6f 100644 --- a/tests/integration/features/file/list.feature +++ b/tests/integration/features/file/list.feature @@ -6,7 +6,7 @@ Feature: file-list And set the email of user "signer1" to "signer1@domain.test" And set the email of user "signer2" to "" And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"email","value":"signer1@domain.test"}]},{"identifyMethods":[{"method":"account","value":"signer2"}]}] | | name | document | And the response should have a status code 200 @@ -47,25 +47,25 @@ Feature: file-list And sending "post" to ocs "/apps/libresign/api/v1/policies/system/identify_methods" | value | (string){"can_create_account":false,"factors":[{"name":"email","enabled":true,"requirement":"required"}]} | And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"email","value":"signer1@domain.test"}]}] | | name | document | And the response should have a status code 200 And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"email","value":"signer1@domain.test"}]}] | | name | document | And the response should have a status code 200 And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"email","value":"signer1@domain.test"}]}] | | name | document | And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"email","value":"signer1@domain.test"}]}] | | name | document | And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"email","value":"signer1@domain.test"}]}] | | name | document | And the response should have a status code 200 diff --git a/tests/integration/features/file/thumbnail.feature b/tests/integration/features/file/thumbnail.feature index 031faaaf2c..536c3ad8f3 100644 --- a/tests/integration/features/file/thumbnail.feature +++ b/tests/integration/features/file/thumbnail.feature @@ -6,7 +6,7 @@ Feature: file-thumbnail And sending "post" to ocs "/apps/libresign/api/v1/policies/system/identify_methods" | value | (string){"factors":[{"name":"account","enabled":true,"requirement":"required"}]} | And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]}] | | name | document | And the response should have a status code 200 diff --git a/tests/integration/features/file/validate.feature b/tests/integration/features/file/validate.feature index 4e75c231ac..414e17ffa7 100644 --- a/tests/integration/features/file/validate.feature +++ b/tests/integration/features/file/validate.feature @@ -5,7 +5,7 @@ Feature: validate And sending "post" to ocs "/apps/libresign/api/v1/admin/certificate/openssl" | rootCert | {"commonName":"test"} | When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"admin"}]},{"identifyMethods":[{"method":"account","value":"signer1"}]}] | | status | 0 | | name | Visible elements validation | @@ -76,7 +76,7 @@ Feature: validate | value | (string){"factors":[{"name":"account","enabled":true,"requirement":"required","signatureMethods":{"clickToSign":{"enabled":true}}}]} | And user "signer1" exists When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]}] | | name | Document Name | Then the response should have a status code 200 @@ -122,7 +122,7 @@ Feature: validate And the response should have a status code 200 When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"admin"}]}] | | name | document | And the response should have a status code 200 @@ -144,7 +144,7 @@ Feature: validate And the response should have a status code 200 When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"admin"}]}] | | name | Requester legal information | Then the response should have a status code 200 @@ -168,7 +168,7 @@ Feature: validate And the response should have a status code 200 When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"admin"}]}] | | name | Validation page requester legal information | Then the response should have a status code 200 diff --git a/tests/integration/features/notification/custom_message_notification.feature b/tests/integration/features/notification/custom_message_notification.feature index afcf8d4b3a..e60860493f 100644 --- a/tests/integration/features/notification/custom_message_notification.feature +++ b/tests/integration/features/notification/custom_message_notification.feature @@ -15,7 +15,7 @@ Feature: Custom message for signers Scenario: Account method - default message without custom description When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | name | Document without custom message | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]}] | Then the response should have a status code 200 @@ -25,7 +25,7 @@ Feature: Custom message for signers Scenario: Account method - custom description in email When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | name | Document with custom message | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}],"description":"Please review section 3 and the appendix before signing."}] | Then the response should have a status code 200 @@ -36,14 +36,14 @@ Feature: Custom message for signers Scenario: Email method - default notification When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | name | Document for email method | | signers | [{"identifyMethods":[{"method":"email","value":"external@domain.test"}],"displayName":"External Signer"}] | Then the response should have a status code 200 Scenario: Email method - custom description via reminder Given sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | name | Document for email with description | | signers | [{"identifyMethods":[{"method":"email","value":"external@domain.test"}],"displayName":"External Signer","description":"Urgent: Please sign by end of day."}] | And the response should have a status code 200 diff --git a/tests/integration/features/page/validate.feature b/tests/integration/features/page/validate.feature index 4e969a9ccc..8dab524ea9 100644 --- a/tests/integration/features/page/validate.feature +++ b/tests/integration/features/page/validate.feature @@ -9,7 +9,7 @@ Feature: page/validate And the response should have a status code 200 When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"admin"}]}] | | name | document | And the response should have a status code 200 @@ -78,7 +78,7 @@ Feature: page/validate | value | (string){"can_create_account":false,"factors":[{"name":"email","enabled":true,"requirement":"required","signatureMethods":{"clickToSign":{"enabled":true}}}]} | And my inbox is empty When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"displayName":"External Signer","identifyMethods":[{"method":"email","value":"external@domain.test"}]}] | | name | external-email-pdf | | settings | {"folderName":"rm-target-folder"} | diff --git a/tests/integration/features/policies/groups_request_sign_policy.feature b/tests/integration/features/policies/groups_request_sign_policy.feature index a830b0270c..013107e330 100644 --- a/tests/integration/features/policies/groups_request_sign_policy.feature +++ b/tests/integration/features/policies/groups_request_sign_policy.feature @@ -101,7 +101,7 @@ Feature: policies/groups_request_sign_policy | (jq).ocs.data.policies | (jq)length == 0 | When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"ceo-request-access-policy"}]}] | | name | group-admin-without-policy | | status | 0 | @@ -114,7 +114,7 @@ Feature: policies/groups_request_sign_policy # VALIDATION: A regular member of the same group also cannot request signatures without an allow policy Given as user "member-request-access-policy" When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"member-request-access-policy"}]}] | | name | member-without-policy | | status | 0 | @@ -152,7 +152,7 @@ Feature: policies/groups_request_sign_policy # VALIDATION: The regular member now inherits the sysadmin allow rule and can request signatures Given as user "member-request-access-policy" When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"member-request-access-policy"}]}] | | name | member-with-system-allow | | status | 0 | @@ -183,7 +183,7 @@ Feature: policies/groups_request_sign_policy # VALIDATION: After the deny override, the regular member loses the ability to request signatures Given as user "member-request-access-policy" When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"member-request-access-policy"}]}] | | name | member-with-group-deny | | status | 0 | @@ -206,7 +206,7 @@ Feature: policies/groups_request_sign_policy | (jq).ocs.data.policies | (jq)length == 0 | When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"ceo-request-access-policy"}]}] | | name | group-admin-after-delete | | status | 0 | @@ -215,7 +215,7 @@ Feature: policies/groups_request_sign_policy # VALIDATION: The regular member also regains inherited request access after the deny override is deleted Given as user "member-request-access-policy" When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"member-request-access-policy"}]}] | | name | member-after-delete | | status | 0 | @@ -248,14 +248,14 @@ Feature: policies/groups_request_sign_policy Given as user "allow-only-requester" When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"allow-only-requester"}]}] | | name | document | Then the response should have a status code 200 Given as user "deny-precedence-requester" When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"deny-precedence-requester"}]}] | | name | document | Then the response should have a status code 422 @@ -310,7 +310,7 @@ Feature: policies/groups_request_sign_policy # VALIDATION: A company-only member still cannot request signatures before the delegated admin extends access. Given as user "company-member-request-access-extension" When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"company-member-request-access-extension"}]}] | | name | company-member-before-extension | | status | 0 | @@ -334,7 +334,7 @@ Feature: policies/groups_request_sign_policy # VALIDATION: After the delegated extension, the company-only member can request signatures. Given as user "company-member-request-access-extension" When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"company-member-request-access-extension"}]}] | | name | company-member-after-extension | | status | 0 | diff --git a/tests/integration/features/policies/identification_documents_policy.feature b/tests/integration/features/policies/identification_documents_policy.feature index 9065e6ec13..f8c35bc83e 100644 --- a/tests/integration/features/policies/identification_documents_policy.feature +++ b/tests/integration/features/policies/identification_documents_policy.feature @@ -68,7 +68,7 @@ Feature: policies/identification_documents_policy And the response should have a status code 200 When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]}] | | name | Identification flow document | Then the response should have a status code 200 @@ -82,7 +82,7 @@ Feature: policies/identification_documents_policy | (jq).ocs.data.settings.identificationDocumentsWaitingApproval | false | When sending "post" to ocs "/apps/libresign/api/v1/id-docs" - | files | [{"file":{"url":"/apps/libresign/develop/pdf"},"type":"IDENTIFICATION"}] | + | files | [{"file":{"base64":""},"type":"IDENTIFICATION"}] | When sending "get" to ocs "/apps/libresign/api/v1/id-docs/approval/list" Then the response should have a status code 404 diff --git a/tests/integration/features/sign/cancel.feature b/tests/integration/features/sign/cancel.feature index 6f09322047..92a8108189 100644 --- a/tests/integration/features/sign/cancel.feature +++ b/tests/integration/features/sign/cancel.feature @@ -5,7 +5,7 @@ Feature: sign-request-cancel And reset notifications of user "signer1" And run the command "libresign:configure:openssl --cn test" with result code 0 And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]}] | | name | document | And the response should have a status code 200 @@ -26,7 +26,7 @@ Feature: sign-request-cancel And reset notifications of user "signer1" And run the command "libresign:configure:openssl --cn test" with result code 0 And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}],"notify":false}] | | name | document | | status | 0 | @@ -47,7 +47,7 @@ Feature: sign-request-cancel And user "signer1" exists And run the command "libresign:configure:openssl --cn test" with result code 0 And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]}] | | name | document | When sending "get" to ocs "/apps/libresign/api/v1/file/list?details=1" @@ -63,7 +63,7 @@ Feature: sign-request-cancel And user "signer1" exists And run the command "libresign:configure:openssl --cn test" with result code 0 And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]}] | | name | document | And the response should have a status code 200 diff --git a/tests/integration/features/sign/reject.feature b/tests/integration/features/sign/reject.feature index 7aa3da3be9..d3bad52ab5 100644 --- a/tests/integration/features/sign/reject.feature +++ b/tests/integration/features/sign/reject.feature @@ -7,7 +7,7 @@ Feature: sign-signature-rejection | value | {"enabled":false} | And the response should have a status code 200 And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]}] | | name | document | And the response should have a status code 200 @@ -28,7 +28,7 @@ Feature: sign-signature-rejection | value | {"enabled":true,"comment_mode":"optional"} | And the response should have a status code 200 And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]}] | | name | document | And the response should have a status code 200 @@ -77,7 +77,7 @@ Feature: sign-signature-rejection | value | {"enabled":false} | And the response should have a status code 200 When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]}] | | name | document | | policy | {"overrides":{"signature_rejection":{"enabled":true}}} | @@ -95,7 +95,7 @@ Feature: sign-signature-rejection | value | {"enabled":true,"comment_mode":"optional","cancel_workflow":false} | And the response should have a status code 200 And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]},{"identifyMethods":[{"method":"account","value":"signer2"}]}] | | name | document | | policy | {"overrides":{"signature_rejection":{"enabled":true}}} | @@ -127,7 +127,7 @@ Feature: sign-signature-rejection | value | {"enabled":true,"comment_mode":"required"} | And the response should have a status code 200 And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]}] | | name | document | | policy | {"overrides":{"signature_rejection":{"enabled":true}}} | @@ -152,7 +152,7 @@ Feature: sign-signature-rejection | value | {"enabled":true,"comment_mode":"optional"} | And the response should have a status code 200 And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]}] | | name | document | | policy | {"overrides":{"signature_rejection":{"enabled":true}}} | @@ -178,7 +178,7 @@ Feature: sign-signature-rejection | value | {"enabled":true,"comment_mode":"optional"} | And the response should have a status code 200 And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]}] | | name | document | | status | 0 | @@ -209,7 +209,7 @@ Feature: sign-signature-rejection | value | {"enabled":true,"comment_mode":"optional"} | And the response should have a status code 200 And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]}] | | name | document | | status | 0 | @@ -242,7 +242,7 @@ Feature: sign-signature-rejection | value | {"enabled":true,"comment_mode":"optional"} | And the response should have a status code 200 And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]}] | | name | document | | status | 0 | @@ -274,7 +274,7 @@ Feature: sign-signature-rejection | value | {"enabled":true,"comment_mode":"optional"} | And the response should have a status code 200 And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]}] | | name | document | | policy | {"overrides":{"signature_rejection":{"enabled":true}}} | @@ -483,7 +483,7 @@ Feature: sign-signature-rejection | value | {"enabled":true,"comment_mode":"optional","public_status":true,"show_comment_on_validation":true} | And the response should have a status code 200 And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]},{"identifyMethods":[{"method":"account","value":"signer2"}]}] | | name | document | | policy | {"overrides":{"signature_rejection":{"enabled":true}}} | @@ -526,7 +526,7 @@ Feature: sign-signature-rejection | value | {"enabled":true,"comment_mode":"optional","public_status":true,"show_comment_on_validation":true} | And the response should have a status code 200 And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]},{"identifyMethods":[{"method":"account","value":"signer2"}]}] | | name | document | | policy | {"overrides":{"signature_rejection":{"enabled":true}}} | @@ -552,7 +552,7 @@ Feature: sign-signature-rejection | value | {"enabled":true,"comment_mode":"optional"} | And the response should have a status code 200 And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]}] | | name | document | | policy | {"overrides":{"signature_rejection":{"enabled":true}}} | @@ -576,7 +576,7 @@ Feature: sign-signature-rejection | value | {"enabled":true,"comment_mode":"optional"} | And the response should have a status code 200 And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}],"signingOrder":1},{"identifyMethods":[{"method":"account","value":"signer2"}],"signingOrder":2}] | | name | document | | policy | {"overrides":{"signature_rejection":{"enabled":true}}} | @@ -603,7 +603,7 @@ Feature: sign-signature-rejection | value | {"enabled":true,"comment_mode":"optional","cancel_workflow":true} | And the response should have a status code 200 And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]},{"identifyMethods":[{"method":"account","value":"signer2"}]}] | | name | document | | policy | {"overrides":{"signature_rejection":{"enabled":true}}} | diff --git a/tests/integration/features/sign/request.feature b/tests/integration/features/sign/request.feature index 7b420ecfe3..3c92b63183 100644 --- a/tests/integration/features/sign/request.feature +++ b/tests/integration/features/sign/request.feature @@ -33,7 +33,7 @@ Feature: request-signature And sending "post" to ocs "/apps/libresign/api/v1/admin/certificate/openssl" | rootCert | {"commonName":"test"} | When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":""} | + | file | {"url":""} | | signers | [{"identifyMethods":[{"method":"email","value":"signer-url@domain.test"}]}] | | name | document-from-url | Then the response should have a status code 200 @@ -55,7 +55,7 @@ Feature: request-signature And sending "post" to ocs "/apps/libresign/api/v1/admin/certificate/openssl" | rootCert | {"commonName":"test"} | And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]}] | | name | document | And the response should have a status code 200 @@ -92,7 +92,7 @@ Feature: request-signature And sending "post" to ocs "/apps/libresign/api/v1/admin/certificate/openssl" | rootCert | {"commonName":"test"} | And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]}] | | name | document | And the response should have a status code 200 @@ -122,7 +122,7 @@ Feature: request-signature And reset notifications of user "signer1" And my inbox is empty And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]}] | | name | document | Then the response should have a status code 200 @@ -145,7 +145,7 @@ Feature: request-signature And set the email of user "signer1" to "signer1@domain.test" And my inbox is empty And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"email","value":"signer1@domain.test"}]}] | | name | document | Then the response should have a status code 200 @@ -169,7 +169,7 @@ Feature: request-signature | rootCert | {"commonName":"test"} | And run the command "config:app:set libresign maximum_validity --value=1 --type=integer" with result code 0 When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"email","value":"signer2@domain.test"}]}] | | name | document | Then the response should have a status code 200 @@ -193,7 +193,7 @@ Feature: request-signature And sending "post" to ocs "/apps/libresign/api/v1/policies/system/identify_methods" | value | (string){"can_create_account":false,"factors":[{"name":"email","enabled":true,"requirement":"required"}]} | And sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"email","value":"signer2@domain.test"}]}] | | name | document | And the response should have a status code 200 @@ -245,7 +245,7 @@ Feature: request-signature And sending "post" to ocs "/apps/libresign/api/v1/policies/system/identify_methods" | value | (string){"factors":[{"name":"account","enabled":true}]} | When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer2"}]}] | | name | document | Then the response should be a JSON array with the following mandatory values @@ -261,7 +261,7 @@ Feature: request-signature And reset notifications of user "signer1" And my inbox is empty When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]}] | | name | document | Then the response should have a status code 200 @@ -284,7 +284,7 @@ Feature: request-signature And sending "post" to ocs "/apps/libresign/api/v1/admin/certificate/openssl" | rootCert | {"commonName":"test"} | When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"invaliddomain.test"}]}] | | name | document | Then the response should have a status code 422 @@ -297,7 +297,7 @@ Feature: request-signature And sending "post" to ocs "/apps/libresign/api/v1/admin/certificate/openssl" | rootCert | {"commonName":"test"} | When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer3@domain.test"}]}] | | name | document | Then the response should have a status code 422 @@ -312,7 +312,7 @@ Feature: request-signature | rootCert | {"commonName":"test"} | And my inbox is empty When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"email","value":"signer2@domain.test"}]}] | | name | document | Then the response should have a status code 200 @@ -328,7 +328,7 @@ Feature: request-signature And reset notifications of user "signer1" And my inbox is empty When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]}] | | name | document | Then the response should have a status code 200 @@ -341,7 +341,7 @@ Feature: request-signature And set the email of user "signer1" to "signer1@domain.test" And my inbox is empty When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"email","value":"signer1@domain.test"}]}] | | name | document | Then the response should have a status code 200 @@ -355,7 +355,7 @@ Feature: request-signature And sending "post" to ocs "/apps/libresign/api/v1/policies/system/identify_methods" | value | (string){"can_create_account":false,"factors":[{"name":"email","enabled":true,"requirement":"required"}]} | And I send a file to be signed - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"email","value":"signer1@domain.test"}]}] | | status | 0 | | name | document | @@ -385,7 +385,7 @@ Feature: request-signature And set the email of user "signer1" to "" And my inbox is empty When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"email","value":"signer1@domain.test"}]},{"identifyMethods":[{"method":"account","value":"signer1"}]}] | | name | document | Then the response should have a status code 200 @@ -404,7 +404,7 @@ Feature: request-signature | value | (string){"can_create_account":false,"factors":[{"name":"email","enabled":true,"requirement":"required","signatureMethods":{"emailToken":{"enabled":true}}}]} | And my inbox is empty When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"email","value":"11111@domain.test"}]},{"identifyMethods":[{"method":"email","value":"22222@domain.test"}]}] | | name | document | Then the response should have a status code 200 @@ -446,7 +446,7 @@ Feature: request-signature | value | (string){"can_create_account":false,"factors":[{"name":"email","enabled":true,"requirement":"required","signatureMethods":{"emailToken":{"enabled":true}}}]} | And my inbox is empty When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"email","value":"11111@domain.test"}]}] | | name | document | Then the response should have a status code 200 @@ -491,7 +491,7 @@ Feature: request-signature | value | (string){"can_create_account":false,"factors":[{"name":"email","enabled":true,"requirement":"required","signatureMethods":{"emailToken":{"enabled":true}}}]} | And my inbox is empty When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"email","value":"11111@domain.test"}]}] | | name | document | Then the response should have a status code 200 @@ -530,7 +530,7 @@ Feature: request-signature And user "signer1" exists And as user "admin" When I send a file to be signed - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"email","value":"signer1@domain.test"}]},{"identifyMethods":[{"method":"account","value":"signer1"}]}] | | name | document | And fetch field "(FILE_UUID)ocs.data.uuid" from previous JSON response @@ -571,13 +571,13 @@ Feature: request-signature And sending "post" to ocs "/apps/libresign/api/v1/policies/system/identify_methods" | value | (string){"factors":[{"name":"email","enabled":true,"requirement":"required","signatureMethods":{"emailToken":{"enabled":true}}}]} | When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"email","value":"signer1@domain.test"}]}] | | name | document | | status | 0 | And there should be 0 emails in my inbox When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"email","value":"signer1@domain.test"}]}] | | name | document | | status | 1 | diff --git a/tests/integration/features/sign/sequential_signing.feature b/tests/integration/features/sign/sequential_signing.feature index 5fc74e4c7b..6efbed111f 100644 --- a/tests/integration/features/sign/sequential_signing.feature +++ b/tests/integration/features/sign/sequential_signing.feature @@ -14,7 +14,7 @@ Feature: sequential-signing Given user "signer1" exists And user "signer2" exists When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}]},{"identifyMethods":[{"method":"account","value":"signer2"}]}] | | name | Parallel Document | Then the response should have a status code 200 @@ -40,7 +40,7 @@ Feature: sequential-signing | value | ordered_numeric | And the response should have a status code 200 When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods":[{"method":"account","value":"signer1"}],"signingOrder":1},{"identifyMethods":[{"method":"account","value":"signer2"}],"signingOrder":2}] | | name | Sequential Document | Then the response should have a status code 200 diff --git a/tests/integration/features/sign/signed.feature b/tests/integration/features/sign/signed.feature index c20583430c..e3fcb1f84c 100644 --- a/tests/integration/features/sign/signed.feature +++ b/tests/integration/features/sign/signed.feature @@ -17,7 +17,7 @@ Feature: signed | value | (string){"factors":[{"name":"account","enabled":true,"requirement":"required","signatureMethods":{"password":{"name":"password","enabled":true}},"signatureMethodEnabled":"password"}]} | And the response should have a status code 200 When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"displayName": "Signer Name","description": "Please, sign this document","identifyMethods": [{"method": "account", "value": "signer1"}]}] | | name | Document Name | And the response should have a status code 200 @@ -70,7 +70,7 @@ Feature: signed And reset notifications of user "admin" And reset activity of user "admin" When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"displayName": "Signer Name","identifyMethods": [{"method": "account", "value": "signer1"}]},{"displayName": "Admin","identifyMethods": [{"method": "account", "value": "admin"}]}] | | name | Document Name | And the response should have a status code 200 @@ -135,7 +135,7 @@ Feature: signed And reset notifications of user "admin" And reset activity of user "admin" When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"displayName": "Signer Name","identifyMethods": [{"method": "account", "value": "signer1"}]},{"displayName": "Admin","identifyMethods": [{"method": "account", "value": "admin"}]}] | | name | Document Name | And the response should have a status code 200 @@ -190,7 +190,7 @@ Feature: signed And reset notifications of user "admin" And reset activity of user "admin" When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"displayName": "Signer Name","identifyMethods": [{"method": "email", "value": "unauthenticated@email.tld"}]}] | | name | Document Name | And the response should have a status code 200 diff --git a/tests/integration/features/sign/signer_geolocation.feature b/tests/integration/features/sign/signer_geolocation.feature index e8d875d325..90901f6308 100644 --- a/tests/integration/features/sign/signer_geolocation.feature +++ b/tests/integration/features/sign/signer_geolocation.feature @@ -17,7 +17,7 @@ Feature: sign/signer_geolocation | value | (string){"factors":[{"name":"account","enabled":true,"requirement":"required","signatureMethods":{"clickToSign":{"enabled":true}}}]} | And the response should have a status code 200 When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"displayName":"Signer Name","identifyMethods":[{"method":"account","value":"signer1"}]}] | | name | Geolocation document | And the response should have a status code 200 @@ -63,7 +63,7 @@ Feature: sign/signer_geolocation | value | (string){"factors":[{"name":"account","enabled":true,"requirement":"required","signatureMethods":{"clickToSign":{"enabled":true}}}]} | And the response should have a status code 200 When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"displayName":"Required signer","geolocationRequired":true,"identifyMethods":[{"method":"account","value":"signer1"}]},{"displayName":"Optional signer","geolocationRequired":false,"identifyMethods":[{"method":"account","value":"signer2"}]}] | | name | Mixed geolocation document | And the response should have a status code 200 @@ -100,7 +100,7 @@ Feature: sign/signer_geolocation | value | (string){"factors":[{"name":"account","enabled":true,"requirement":"required","signatureMethods":{"clickToSign":{"enabled":true}}}]} | And the response should have a status code 200 When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"displayName":"Signer Name","identifyMethods":[{"method":"account","value":"signer1"}]}] | | name | Frozen geolocation document | And the response should have a status code 200 diff --git a/tests/integration/features/sign/tsa.feature b/tests/integration/features/sign/tsa.feature index 2eef050c25..0f17ea525a 100644 --- a/tests/integration/features/sign/tsa.feature +++ b/tests/integration/features/sign/tsa.feature @@ -17,7 +17,7 @@ Feature: TSA Integration - End-to-End Workflow | value | (string){"factors":[{"name":"account","enabled":true,"requirement":"required","signatureMethods":{"clickToSign":{"enabled":true}},"signatureMethodEnabled":"clickToSign"}]} | And the response should have a status code 200 When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"displayName": "TSA Signer","identifyMethods": [{"method": "account", "value": "signer1"}]}] | | name | TSA Document Test | Then the response should have a status code 200 @@ -60,7 +60,7 @@ Feature: TSA Integration - End-to-End Workflow And sending "post" to ocs "/apps/libresign/api/v1/policies/system/identify_methods" | value | (string){"factors":[{"name":"account","enabled":true,"requirement":"required","signatureMethods":{"clickToSign":{"enabled":true}},"signatureMethodEnabled":"clickToSign"}]} | When sending "post" to ocs "/apps/libresign/api/v1/request-signature" - | file | {"url":"/apps/libresign/develop/pdf"} | + | file | {"base64":""} | | signers | [{"identifyMethods": [{"method": "account", "value": "signer1"}]}] | | name | TSA Error Test | And as user "signer1" From b29314df47f4a38debc3ed2488a9f0cd6a50f0c1 Mon Sep 17 00:00:00 2001 From: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> Date: Sun, 20 Sep 2026 17:49:01 -0300 Subject: [PATCH 10/10] fix(behat): complete envelope fixture backport for stable35 Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com> --- .../features/security/envelope_authorization.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/features/security/envelope_authorization.feature b/tests/integration/features/security/envelope_authorization.feature index 26f19dd92d..ef587e535f 100644 --- a/tests/integration/features/security/envelope_authorization.feature +++ b/tests/integration/features/security/envelope_authorization.feature @@ -10,7 +10,7 @@ Feature: envelope authorization Scenario: A requester cannot modify another requester's draft envelope Given sending "post" to ocs "/apps/libresign/api/v1/file" - | files | [{"url":"/apps/libresign/develop/pdf","name":"Contract.pdf"},{"url":"/apps/libresign/develop/pdf","name":"Annex.pdf"}] | + | files | [{"base64":"","name":"Contract.pdf"},{"base64":"","name":"Annex.pdf"}] | | name | Owner Envelope | And the response should have a status code 200 And fetch field "(ENVELOPE_UUID)ocs.data.uuid" from previous JSON response @@ -23,7 +23,7 @@ Feature: envelope authorization Scenario: The envelope owner reaches upload validation Given sending "post" to ocs "/apps/libresign/api/v1/file" - | files | [{"url":"/apps/libresign/develop/pdf","name":"Contract.pdf"},{"url":"/apps/libresign/develop/pdf","name":"Annex.pdf"}] | + | files | [{"base64":"","name":"Contract.pdf"},{"base64":"","name":"Annex.pdf"}] | | name | Owner Envelope | And the response should have a status code 200 And fetch field "(ENVELOPE_UUID)ocs.data.uuid" from previous JSON response