diff --git a/lib/ResponseDefinitions.php b/lib/ResponseDefinitions.php index cd22332e4..44794f0e6 100644 --- a/lib/ResponseDefinitions.php +++ b/lib/ResponseDefinitions.php @@ -120,6 +120,16 @@ * type: string, * coordinates: LibresignCoordinate, * } + * @psalm-type LibresignSignatureMethod = array{ + * enabled: bool, + * label: string, + * name: string, + * } + * @psalm-type LibresignSignatureMethods = array{ + * clickToSign?: LibresignSignatureMethod, + * emailToken?: LibresignSignatureMethod, + * password?: LibresignSignatureMethod, + * } * @psalm-type LibresignSigner = array{ * description: ?string, * displayName: string, @@ -133,6 +143,7 @@ * signRequestId: non-negative-int, * identifyMethods?: LibresignIdentifyMethod[], * visibleElements?: LibresignVisibleElement[], + * signatureMethods?: LibresignSignatureMethods[], * } * @psalm-type LibresignValidateFile = array{ * uuid: string, diff --git a/lib/Service/FileService.php b/lib/Service/FileService.php index c03514268..fd991d967 100644 --- a/lib/Service/FileService.php +++ b/lib/Service/FileService.php @@ -227,8 +227,8 @@ private function getSigners(): array { } } } - if ($signatureToShow['me'] && !is_null($this->signRequest)) { - $signatureToShow['signatureMethods'] = $this->identifyMethodService->getSignMethodsOfIdentifiedFactors($this->signRequest->getId()); + if ($signatureToShow['me']) { + $signatureToShow['signatureMethods'] = $this->identifyMethodService->getSignMethodsOfIdentifiedFactors($signer->getId()); } $signatureToShow['identifyMethods'] = array_reduce($signatureToShow['identifyMethods'], function ($carry, $list) { foreach ($list as $identifyMethod) { diff --git a/openapi-full.json b/openapi-full.json index 5ddd9228d..24c98b83f 100644 --- a/openapi-full.json +++ b/openapi-full.json @@ -593,6 +593,39 @@ } } }, + "SignatureMethod": { + "type": "object", + "required": [ + "enabled", + "label", + "name" + ], + "properties": { + "enabled": { + "type": "boolean" + }, + "label": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "SignatureMethods": { + "type": "object", + "properties": { + "clickToSign": { + "$ref": "#/components/schemas/SignatureMethod" + }, + "emailToken": { + "$ref": "#/components/schemas/SignatureMethod" + }, + "password": { + "$ref": "#/components/schemas/SignatureMethod" + } + } + }, "Signer": { "type": "object", "required": [ @@ -650,6 +683,12 @@ "items": { "$ref": "#/components/schemas/VisibleElement" } + }, + "signatureMethods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SignatureMethods" + } } } }, diff --git a/openapi.json b/openapi.json index 57c8b590c..d70fd4457 100644 --- a/openapi.json +++ b/openapi.json @@ -497,6 +497,39 @@ } } }, + "SignatureMethod": { + "type": "object", + "required": [ + "enabled", + "label", + "name" + ], + "properties": { + "enabled": { + "type": "boolean" + }, + "label": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "SignatureMethods": { + "type": "object", + "properties": { + "clickToSign": { + "$ref": "#/components/schemas/SignatureMethod" + }, + "emailToken": { + "$ref": "#/components/schemas/SignatureMethod" + }, + "password": { + "$ref": "#/components/schemas/SignatureMethod" + } + } + }, "Signer": { "type": "object", "required": [ @@ -554,6 +587,12 @@ "items": { "$ref": "#/components/schemas/VisibleElement" } + }, + "signatureMethods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SignatureMethods" + } } } }, diff --git a/src/types/openapi/openapi-full.ts b/src/types/openapi/openapi-full.ts index b056671a7..43790efb0 100644 --- a/src/types/openapi/openapi-full.ts +++ b/src/types/openapi/openapi-full.ts @@ -1205,6 +1205,16 @@ export type components = { needIdentificationDocuments?: boolean; identificationDocumentsWaitingApproval?: boolean; }; + SignatureMethod: { + enabled: boolean; + label: string; + name: string; + }; + SignatureMethods: { + clickToSign?: components["schemas"]["SignatureMethod"]; + emailToken?: components["schemas"]["SignatureMethod"]; + password?: components["schemas"]["SignatureMethod"]; + }; Signer: { description: string | null; displayName: string; @@ -1219,6 +1229,7 @@ export type components = { signRequestId: number; identifyMethods?: components["schemas"]["IdentifyMethod"][]; visibleElements?: components["schemas"]["VisibleElement"][]; + signatureMethods?: components["schemas"]["SignatureMethods"][]; }; UserElement: { /** Format: int64 */ diff --git a/src/types/openapi/openapi.ts b/src/types/openapi/openapi.ts index a1aa3434e..1f7aa8f68 100644 --- a/src/types/openapi/openapi.ts +++ b/src/types/openapi/openapi.ts @@ -1059,6 +1059,16 @@ export type components = { needIdentificationDocuments?: boolean; identificationDocumentsWaitingApproval?: boolean; }; + SignatureMethod: { + enabled: boolean; + label: string; + name: string; + }; + SignatureMethods: { + clickToSign?: components["schemas"]["SignatureMethod"]; + emailToken?: components["schemas"]["SignatureMethod"]; + password?: components["schemas"]["SignatureMethod"]; + }; Signer: { description: string | null; displayName: string; @@ -1073,6 +1083,7 @@ export type components = { signRequestId: number; identifyMethods?: components["schemas"]["IdentifyMethod"][]; visibleElements?: components["schemas"]["VisibleElement"][]; + signatureMethods?: components["schemas"]["SignatureMethods"][]; }; UserElement: { /** Format: int64 */