From 10b677fbbea2f5f2c403371a7e82340e12c8d942 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Sun, 24 Mar 2024 15:33:04 -0300 Subject: [PATCH 1/3] Retrieve signer data of multiple signers Signed-off-by: Vitor Mattos --- .../integration/features/sign/request.feature | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tests/integration/features/sign/request.feature b/tests/integration/features/sign/request.feature index ddc1735690..2454d7f430 100644 --- a/tests/integration/features/sign/request.feature +++ b/tests/integration/features/sign/request.feature @@ -333,6 +333,54 @@ Feature: request-signature And there should be 1 emails in my inbox And I open the latest email to "signer1@domain.test" with subject "LibreSign: There is a file for you to sign" + Scenario: Request to sign with success using multiple emails + Given run the command "libresign:configure:openssl --cn test" with result code 0 + And as user "admin" + And sending "post" to ocs "/apps/provisioning_api/api/v1/config/apps/libresign/identify_methods" + | value | (string)[{"name":"email","enabled":true,"mandatory":true,"signatureMethods":{"emailToken":{"enabled":true}},"can_create_account":false}] | + And my inbox is empty + When sending "post" to ocs "/apps/libresign/api/v1/request-signature" + | file | {"url":"/apps/libresign/develop/pdf"} | + | users | [{"identify":{"email":"11111@domain.test"}},{"identify":{"email":"22222@domain.test"}}] | + | name | document | + Then the response should have a status code 200 + When I open the latest email to "11111@domain.test" with subject "LibreSign: There is a file for you to sign" + And I fetch the signer UUID from opened email + And as user "" + And follow the link on opened email + And the response should have a status code 200 + Then the response should contain the initial state "libresign-signature_methods" with the following values: + """ + { + "emailToken": { + "blurredEmail": "111***@***.test", + "hasConfirmCode": false, + "hashOfEmail": "c8cb84220c4cf19b723390f29b83a0f8", + "identifyMethod": "email", + "label": "Email token", + "needCode": true + } + } + """ + When I open the latest email to "22222@domain.test" with subject "LibreSign: There is a file for you to sign" + And I fetch the signer UUID from opened email + And as user "" + And follow the link on opened email + And the response should have a status code 200 + Then the response should contain the initial state "libresign-signature_methods" with the following values: + """ + { + "emailToken": { + "blurredEmail": "222***@***.test", + "hasConfirmCode": false, + "hashOfEmail": "d3ab1426f412df8b8bbb9cb2405fb39d", + "identifyMethod": "email", + "label": "Email token", + "needCode": true + } + } + """ + Scenario: CRUD of identify methods Given run the command "libresign:configure:openssl --cn test" with result code 0 And user "signer1" exists From 4553a0b06b9b2e13433a71f6378c244f4089c1e0 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Mon, 25 Mar 2024 15:14:42 -0300 Subject: [PATCH 2/3] Make test pass Signed-off-by: Vitor Mattos --- .../IdentifyMethod/AbstractIdentifyMethod.php | 32 +++++++++++++++++-- lib/Service/IdentifyMethod/Account.php | 17 ++++------ lib/Service/IdentifyMethod/Email.php | 13 +++----- .../IdentifyMethod/IIdentifyMethod.php | 4 +-- .../SignatureMethod/ISignatureMethod.php | 3 ++ lib/Service/IdentifyMethodService.php | 7 ++-- lib/Service/SignFileService.php | 9 +++--- 7 files changed, 52 insertions(+), 33 deletions(-) diff --git a/lib/Service/IdentifyMethod/AbstractIdentifyMethod.php b/lib/Service/IdentifyMethod/AbstractIdentifyMethod.php index b3c58857fa..ca7a69d3d3 100644 --- a/lib/Service/IdentifyMethod/AbstractIdentifyMethod.php +++ b/lib/Service/IdentifyMethod/AbstractIdentifyMethod.php @@ -43,6 +43,10 @@ abstract class AbstractIdentifyMethod implements IIdentifyMethod { protected string $codeSentByUser = ''; protected array $settings = []; protected bool $willNotify = true; + /** + * @var string[] + */ + public array $availableSignatureMethods; /** * @var AbstractSignatureMethod[] */ @@ -89,11 +93,28 @@ public function signatureMethodsToArray(): array { return array_map(function (AbstractSignatureMethod $method) { return [ 'label' => $method->friendlyName, + 'name' => $method->getName(), 'enabled' => $method->isEnabled(), ]; }, $this->signatureMethods); } + public function getEmptyInstanceOfSignatureMethodByName(string $name): AbstractSignatureMethod { + if (!in_array($name, $this->availableSignatureMethods)) { + throw new InvalidArgumentException(sprintf('%s is not a valid signature method of identify method %s', $name, $this->getName())); + } + $className = 'OCA\Libresign\Service\IdentifyMethod\\SignatureMethod\\' . ucfirst($name); + if (!class_exists($className)) { + throw new InvalidArgumentException('Invalid signature method. Set at identify method the list of available signature methdos with right values.'); + } + $signatureMethod = clone \OC::$server->get($className); + $signatureMethod->cleanEntity(); + return $signatureMethod; + } + + /** + * @return AbstractSignatureMethod[] + */ public function getSignatureMethods(): array { return $this->signatureMethods; } @@ -298,10 +319,15 @@ private function loadSavedSettings(): void { return; } foreach ($this->settings['signatureMethods'] as $method => $settings) { - $this->signatureMethods[$method]->setEntity($this->getEntity()); - if (is_object($this->signatureMethods[$method]) && isset($settings['enabled']) && $settings['enabled']) { - $this->signatureMethods[$method]->enable(); + if (!in_array($method, $this->availableSignatureMethods)) { + unset($this->settings['signatureMethods'][$method]); + continue; + } + $signatureMethod = $this->getEmptyInstanceOfSignatureMethodByName($method); + if (isset($settings['enabled']) && $settings['enabled']) { + $signatureMethod->enable(); } + $this->signatureMethods[$method] = $signatureMethod; } } diff --git a/lib/Service/IdentifyMethod/Account.php b/lib/Service/IdentifyMethod/Account.php index e1b011ddd1..d21ef1f3ea 100644 --- a/lib/Service/IdentifyMethod/Account.php +++ b/lib/Service/IdentifyMethod/Account.php @@ -27,9 +27,7 @@ use OCA\Libresign\Db\IdentifyMethodMapper; use OCA\Libresign\Exception\LibresignException; use OCA\Libresign\Helper\JSActions; -use OCA\Libresign\Service\IdentifyMethod\SignatureMethod\ClickToSign; -use OCA\Libresign\Service\IdentifyMethod\SignatureMethod\EmailToken; -use OCA\Libresign\Service\IdentifyMethod\SignatureMethod\Password; +use OCA\Libresign\Service\IdentifyMethod\SignatureMethod\ISignatureMethod; use OCA\Libresign\Service\MailService; use OCA\Libresign\Service\SessionService; use OCP\AppFramework\Utility\ITimeFactory; @@ -43,6 +41,11 @@ use Psr\Log\LoggerInterface; class Account extends AbstractIdentifyMethod { + public array $availableSignatureMethods = [ + ISignatureMethod::SIGNATURE_METHOD_CLICK_TO_SIGN, + ISignatureMethod::SIGNATURE_METHOD_EMAIL_TOKEN, + ISignatureMethod::SIGNATURE_METHOD_PASSWORD, + ]; public function __construct( protected IdentifyService $identifyService, private IUserManager $userManager, @@ -56,17 +59,9 @@ public function __construct( private LoggerInterface $logger, private SessionService $sessionService, private MailService $mail, - private Password $password, - private ClickToSign $clickToSign, - private EmailToken $emailToken, ) { // TRANSLATORS Name of possible authenticator method. This signalize that the signer could be identified by Nextcloud acccount $this->friendlyName = $this->identifyService->getL10n()->t('Account'); - $this->signatureMethods = [ - $this->password->getName() => $this->password, - $this->clickToSign->getName() => $this->clickToSign, - $this->emailToken->getName() => $this->emailToken, - ]; parent::__construct( $identifyService, ); diff --git a/lib/Service/IdentifyMethod/Email.php b/lib/Service/IdentifyMethod/Email.php index 6aad0a9722..b73844589c 100644 --- a/lib/Service/IdentifyMethod/Email.php +++ b/lib/Service/IdentifyMethod/Email.php @@ -28,8 +28,7 @@ use OCA\Libresign\Db\IdentifyMethodMapper; use OCA\Libresign\Exception\LibresignException; use OCA\Libresign\Helper\JSActions; -use OCA\Libresign\Service\IdentifyMethod\SignatureMethod\ClickToSign; -use OCA\Libresign\Service\IdentifyMethod\SignatureMethod\EmailToken; +use OCA\Libresign\Service\IdentifyMethod\SignatureMethod\ISignatureMethod; use OCA\Libresign\Service\SessionService; use OCP\AppFramework\Utility\ITimeFactory; use OCP\Files\IRootFolder; @@ -37,6 +36,10 @@ use OCP\IUserSession; class Email extends AbstractIdentifyMethod { + public array $availableSignatureMethods = [ + ISignatureMethod::SIGNATURE_METHOD_CLICK_TO_SIGN, + ISignatureMethod::SIGNATURE_METHOD_EMAIL_TOKEN, + ]; public function __construct( protected IdentifyService $identifyService, private IdentifyMethodMapper $identifyMethodMapper, @@ -44,16 +47,10 @@ public function __construct( private ITimeFactory $timeFactory, private SessionService $sessionService, private FileElementMapper $fileElementMapper, - private ClickToSign $clickToSign, - private EmailToken $emailToken, private IUserSession $userSession, ) { // TRANSLATORS Name of possible authenticator method. This signalize that the signer could be identified by email $this->friendlyName = $this->identifyService->getL10n()->t('Email'); - $this->signatureMethods = [ - $this->clickToSign->getName() => $this->clickToSign, - $this->emailToken->getName() => $this->emailToken, - ]; parent::__construct( $identifyService, ); diff --git a/lib/Service/IdentifyMethod/IIdentifyMethod.php b/lib/Service/IdentifyMethod/IIdentifyMethod.php index a64f3a14d9..7fd1edbbad 100644 --- a/lib/Service/IdentifyMethod/IIdentifyMethod.php +++ b/lib/Service/IdentifyMethod/IIdentifyMethod.php @@ -36,9 +36,7 @@ public function setCodeSentByUser(string $code): void; public function cleanEntity(): void; public function setEntity(IdentifyMethod $entity): void; public function getEntity(): IdentifyMethod; - /** - * @return AbstractSignatureMethod[] - */ + public function getEmptyInstanceOfSignatureMethodByName(string $name): AbstractSignatureMethod; public function getSignatureMethods(): array; public function signatureMethodsToArray(): array; public function getSettings(): array; diff --git a/lib/Service/IdentifyMethod/SignatureMethod/ISignatureMethod.php b/lib/Service/IdentifyMethod/SignatureMethod/ISignatureMethod.php index 45dc328664..1d1d725784 100644 --- a/lib/Service/IdentifyMethod/SignatureMethod/ISignatureMethod.php +++ b/lib/Service/IdentifyMethod/SignatureMethod/ISignatureMethod.php @@ -25,6 +25,9 @@ namespace OCA\Libresign\Service\IdentifyMethod\SignatureMethod; interface ISignatureMethod { + public const SIGNATURE_METHOD_CLICK_TO_SIGN = 'clickToSign'; + public const SIGNATURE_METHOD_EMAIL_TOKEN = 'emailToken'; + public const SIGNATURE_METHOD_PASSWORD = 'password'; public function enable(): void; public function isEnabled(): bool; public function toArray(): array; diff --git a/lib/Service/IdentifyMethodService.php b/lib/Service/IdentifyMethodService.php index 83210dc734..7418030f67 100644 --- a/lib/Service/IdentifyMethodService.php +++ b/lib/Service/IdentifyMethodService.php @@ -191,10 +191,9 @@ public function getSignMethodsOfIdentifiedFactors(int $signRequestId): array { if (empty($identifyMethod->getEntity()->getIdentifiedAtDate())) { continue; } - foreach ($identifyMethod->getSignatureMethods() as $signatureMethod) { - if (!$signatureMethod->isEnabled()) { - continue; - } + $signatureMethods = $identifyMethod->getSignatureMethods(); + foreach ($signatureMethods as $signatureMethod) { + $signatureMethod->setEntity($identifyMethod->getEntity()); $return[$signatureMethod->getName()] = $signatureMethod->toArray(); } } diff --git a/lib/Service/SignFileService.php b/lib/Service/SignFileService.php index 08c2f92ebb..534a3c06c9 100644 --- a/lib/Service/SignFileService.php +++ b/lib/Service/SignFileService.php @@ -447,12 +447,13 @@ public function requestCode( throw new LibresignException($this->l10n->t('Invalid identification method')); } foreach ($identifyMethods[$identifyMethodName] as $identifyMethod) { - $signatureMethods = $identifyMethod->getSignatureMethods(); - if (empty($signatureMethods[$signMethodName])) { - throw new LibresignException($this->l10n->t('Invalid identification method')); + try { + $signatureMethod = $identifyMethod->getEmptyInstanceOfSignatureMethodByName($signMethodName); + $signatureMethod->setEntity($identifyMethod->getEntity()); + } catch (InvalidArgumentException $th) { + continue; } /** @var EmailToken $signatureMethod */ - $signatureMethod = $signatureMethods[$signMethodName]; $signatureMethod->requestCode($identify); return; } From 5be7265d5b5d5d868a07c0a33ce4470a77add529 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Mon, 25 Mar 2024 16:22:00 -0300 Subject: [PATCH 3/3] Fix CI Signed-off-by: Vitor Mattos --- .../IdentifyMethod/AbstractIdentifyMethod.php | 14 +++++++---- lib/Service/IdentifyMethodService.php | 3 +++ .../features/admin/initial_state.feature | 24 +++++++++---------- tests/integration/features/page/index.feature | 4 ++-- 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/lib/Service/IdentifyMethod/AbstractIdentifyMethod.php b/lib/Service/IdentifyMethod/AbstractIdentifyMethod.php index ca7a69d3d3..b9219d87b2 100644 --- a/lib/Service/IdentifyMethod/AbstractIdentifyMethod.php +++ b/lib/Service/IdentifyMethod/AbstractIdentifyMethod.php @@ -315,19 +315,23 @@ private function loadSavedSettings(): void { } return $carry; }, []); + foreach ($this->availableSignatureMethods as $signatureMethodName) { + $this->signatureMethods[$signatureMethodName] = + $this->getEmptyInstanceOfSignatureMethodByName($signatureMethodName); + } if (!isset($this->settings['signatureMethods']) || !is_array($this->settings['signatureMethods'])) { return; } - foreach ($this->settings['signatureMethods'] as $method => $settings) { - if (!in_array($method, $this->availableSignatureMethods)) { - unset($this->settings['signatureMethods'][$method]); + foreach ($this->settings['signatureMethods'] as $signatureMethodName => $settings) { + if (!in_array($signatureMethodName, $this->availableSignatureMethods)) { + unset($this->settings['signatureMethods'][$signatureMethodName]); continue; } - $signatureMethod = $this->getEmptyInstanceOfSignatureMethodByName($method); + $signatureMethod = $this->getEmptyInstanceOfSignatureMethodByName($signatureMethodName); if (isset($settings['enabled']) && $settings['enabled']) { $signatureMethod->enable(); } - $this->signatureMethods[$method] = $signatureMethod; + $this->signatureMethods[$signatureMethodName] = $signatureMethod; } } diff --git a/lib/Service/IdentifyMethodService.php b/lib/Service/IdentifyMethodService.php index 7418030f67..a21695a00a 100644 --- a/lib/Service/IdentifyMethodService.php +++ b/lib/Service/IdentifyMethodService.php @@ -193,6 +193,9 @@ public function getSignMethodsOfIdentifiedFactors(int $signRequestId): array { } $signatureMethods = $identifyMethod->getSignatureMethods(); foreach ($signatureMethods as $signatureMethod) { + if (!$signatureMethod->isEnabled()) { + continue; + } $signatureMethod->setEntity($identifyMethod->getEntity()); $return[$signatureMethod->getName()] = $signatureMethod->toArray(); } diff --git a/tests/integration/features/admin/initial_state.feature b/tests/integration/features/admin/initial_state.feature index 9648c0d60c..fc49785548 100644 --- a/tests/integration/features/admin/initial_state.feature +++ b/tests/integration/features/admin/initial_state.feature @@ -6,8 +6,8 @@ Feature: admin/initial_state Then the response should contain the initial state "libresign-identify_methods" with the following values: """ [ - {"name":"account","friendly_name":"Account","enabled":true,"mandatory":true,"signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign"},"emailToken":{"enabled":false,"label":"Email token"},"password":{"enabled":false,"label":"Certificate with password"}}}, - {"name":"email","friendly_name":"Email","enabled":false,"mandatory":true,"can_create_account":true,"test_url":"/index.php/settings/admin/mailtest","signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign"},"emailToken":{"enabled":false,"label":"Email token"}}} + {"name":"account","friendly_name":"Account","enabled":true,"mandatory":true,"signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign","name":"clickToSign"},"emailToken":{"enabled":false,"label":"Email token","name":"emailToken"},"password":{"enabled":false,"label":"Certificate with password","name":"password"}}}, + {"name":"email","friendly_name":"Email","enabled":false,"mandatory":true,"can_create_account":true,"test_url":"/index.php/settings/admin/mailtest","signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign","name":"clickToSign"},"emailToken":{"enabled":false,"label":"Email token","name":"emailToken"}}} ] """ @@ -20,8 +20,8 @@ Feature: admin/initial_state And the response should contain the initial state "libresign-identify_methods" with the following values: """ [ - {"name":"account","friendly_name":"Account","enabled":true,"mandatory":true,"signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign"},"emailToken":{"enabled":false,"label":"Email token"},"password":{"enabled":false,"label":"Certificate with password"}}}, - {"name":"email","friendly_name":"Email","enabled":false,"mandatory":true,"can_create_account":true,"test_url":"/index.php/settings/admin/mailtest","signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign"},"emailToken":{"enabled":false,"label":"Email token"}}} + {"name":"account","friendly_name":"Account","enabled":true,"mandatory":true,"signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign","name":"clickToSign"},"emailToken":{"enabled":false,"label":"Email token","name":"emailToken"},"password":{"enabled":false,"label":"Certificate with password","name":"password"}}}, + {"name":"email","friendly_name":"Email","enabled":false,"mandatory":true,"can_create_account":true,"test_url":"/index.php/settings/admin/mailtest","signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign","name":"clickToSign"},"emailToken":{"enabled":false,"label":"Email token","name":"emailToken"}}} ] """ @@ -34,8 +34,8 @@ Feature: admin/initial_state And the response should contain the initial state "libresign-identify_methods" with the following values: """ [ - {"name":"account","friendly_name":"Account","enabled":true,"mandatory":true,"signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign"},"emailToken":{"enabled":false,"label":"Email token"},"password":{"enabled":false,"label":"Certificate with password"}}}, - {"name":"email","friendly_name":"Email","enabled":false,"mandatory":true,"can_create_account":true,"test_url":"/index.php/settings/admin/mailtest","signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign"},"emailToken":{"enabled":false,"label":"Email token"}}} + {"name":"account","friendly_name":"Account","enabled":true,"mandatory":true,"signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign","name":"clickToSign"},"emailToken":{"enabled":false,"label":"Email token","name":"emailToken"},"password":{"enabled":false,"label":"Certificate with password","name":"password"}}}, + {"name":"email","friendly_name":"Email","enabled":false,"mandatory":true,"can_create_account":true,"test_url":"/index.php/settings/admin/mailtest","signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign","name":"clickToSign"},"emailToken":{"enabled":false,"label":"Email token","name":"emailToken"}}} ] """ @@ -48,8 +48,8 @@ Feature: admin/initial_state And the response should contain the initial state "libresign-identify_methods" with the following values: """ [ - {"name":"account","friendly_name":"Account","enabled":true,"mandatory":true,"signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign"},"emailToken":{"enabled":false,"label":"Email token"},"password":{"enabled":false,"label":"Certificate with password"}}}, - {"name":"email","friendly_name":"Email","enabled":false,"mandatory":true,"can_create_account":true,"test_url":"/index.php/settings/admin/mailtest","signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign"},"emailToken":{"enabled":false,"label":"Email token"}}} + {"name":"account","friendly_name":"Account","enabled":true,"mandatory":true,"signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign","name":"clickToSign"},"emailToken":{"enabled":false,"label":"Email token","name":"emailToken"},"password":{"enabled":false,"label":"Certificate with password","name":"password"}}}, + {"name":"email","friendly_name":"Email","enabled":false,"mandatory":true,"can_create_account":true,"test_url":"/index.php/settings/admin/mailtest","signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign","name":"clickToSign"},"emailToken":{"enabled":false,"label":"Email token","name":"emailToken"}}} ] """ @@ -62,8 +62,8 @@ Feature: admin/initial_state And the response should contain the initial state "libresign-identify_methods" with the following values: """ [ - {"name":"account","friendly_name":"Account","enabled":true,"mandatory":true,"signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign"},"emailToken":{"enabled":false,"label":"Email token"},"password":{"enabled":false,"label":"Certificate with password"}}}, - {"name":"email","friendly_name":"Email","enabled":false,"mandatory":true,"can_create_account":true,"test_url":"/index.php/settings/admin/mailtest","signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign"},"emailToken":{"enabled":false,"label":"Email token"}}} + {"name":"account","friendly_name":"Account","enabled":true,"mandatory":true,"signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign","name":"clickToSign"},"emailToken":{"enabled":false,"label":"Email token","name":"emailToken"},"password":{"enabled":false,"label":"Certificate with password","name":"password"}}}, + {"name":"email","friendly_name":"Email","enabled":false,"mandatory":true,"can_create_account":true,"test_url":"/index.php/settings/admin/mailtest","signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign","name":"clickToSign"},"emailToken":{"enabled":false,"label":"Email token","name":"emailToken"}}} ] """ @@ -75,7 +75,7 @@ Feature: admin/initial_state And the response should contain the initial state "libresign-identify_methods" with the following values: """ [ - {"name":"account","friendly_name":"Account","enabled":true,"mandatory":true,"signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign"},"emailToken":{"enabled":false,"label":"Email token"},"password":{"enabled":false,"label":"Certificate with password"}}}, - {"name":"email","friendly_name":"Email","enabled":false,"mandatory":false,"can_create_account":true,"test_url":"/index.php/settings/admin/mailtest","signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign"},"emailToken":{"enabled":false,"label":"Email token"}}} + {"name":"account","friendly_name":"Account","enabled":true,"mandatory":true,"signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign","name":"clickToSign"},"emailToken":{"enabled":false,"label":"Email token","name":"emailToken"},"password":{"enabled":false,"label":"Certificate with password","name":"password"}}}, + {"name":"email","friendly_name":"Email","enabled":false,"mandatory":false,"can_create_account":true,"test_url":"/index.php/settings/admin/mailtest","signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign","name":"clickToSign"},"emailToken":{"enabled":false,"label":"Email token","name":"emailToken"}}} ] """ diff --git a/tests/integration/features/page/index.feature b/tests/integration/features/page/index.feature index e12fe2f521..ce624488ab 100644 --- a/tests/integration/features/page/index.feature +++ b/tests/integration/features/page/index.feature @@ -10,7 +10,7 @@ Feature: page/sign_identify_default And the response should contain the initial state "libresign-identify_methods" with the following values: """ [ - {"name":"account","friendly_name":"Account","enabled":true,"mandatory":true,"signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign"},"emailToken":{"enabled":false,"label":"Email token"},"password":{"enabled":false,"label":"Certificate with password"}}}, - {"name":"email","friendly_name":"Email","enabled":false,"mandatory":true,"can_create_account":true,"test_url":"/index.php/settings/admin/mailtest","signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign"},"emailToken":{"enabled":false,"label":"Email token"}}} + {"name":"account","friendly_name":"Account","enabled":true,"mandatory":true,"signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign","name":"clickToSign"},"emailToken":{"enabled":false,"label":"Email token","name":"emailToken"},"password":{"enabled":false,"label":"Certificate with password","name":"password"}}}, + {"name":"email","friendly_name":"Email","enabled":false,"mandatory":true,"can_create_account":true,"test_url":"/index.php/settings/admin/mailtest","signatureMethods":{"clickToSign":{"enabled":false,"label":"Click to sign","name":"clickToSign"},"emailToken":{"enabled":false,"label":"Email token","name":"emailToken"}}} ] """