diff --git a/lib/Controller/AdminController.php b/lib/Controller/AdminController.php index 34c2458980..370bfe767a 100644 --- a/lib/Controller/AdminController.php +++ b/lib/Controller/AdminController.php @@ -269,7 +269,7 @@ public function configureCheck(): DataResponse { * * This will disable hate limit to current session. * - * @return DataResponse, array{}> + * @return DataResponse * * 200: OK */ diff --git a/lib/ResponseDefinitions.php b/lib/ResponseDefinitions.php index 2706693a13..486f1ad16b 100644 --- a/lib/ResponseDefinitions.php +++ b/lib/ResponseDefinitions.php @@ -132,13 +132,29 @@ * } * @psalm-type LibresignIdentifyAccountsResponse = list * @psalm-type LibresignNotify = array{ - * date: string, + * date: non-negative-int, * method: "activity"|"notify"|"mail", + * description?: string, * } * @psalm-type LibresignRequestedBy = array{ * userId: string, * displayName: ?string, * } + * @psalm-type LibresignDynamicMetadataScalar = string|int|float|bool|null + * @psalm-type LibresignDynamicMetadataRecord = array + * @psalm-type LibresignDynamicMetadataValue = LibresignDynamicMetadataScalar|list|LibresignDynamicMetadataRecord|list + * @psalm-type LibresignSignerCertificateInfo = array{ + * serialNumber?: string, + * serialNumberHex?: string, + * hash?: string, + * subject?: LibresignDynamicMetadataValue, + * } + * @psalm-type LibresignSignerMetadata = array{ + * remote-address?: string, + * user-agent?: string, + * notify?: LibresignNotify[], + * certificate_info?: LibresignSignerCertificateInfo, + * } * @psalm-type LibresignSignerSummary = array{ * signRequestId: int, * displayName: string, @@ -167,7 +183,7 @@ * visibleElements: LibresignVisibleElement[], * signatureMethods?: LibresignSignatureMethods, * uid?: string, - * metadata?: mixed, + * metadata?: LibresignSignerMetadata, * } * * Shared feedback and action contracts @@ -363,7 +379,7 @@ * pdfVersion?: string, * status_changed_at?: string, * } - * @psalm-type LibresignFileRuntimeMetadata = LibresignValidateMetadata|array + * @psalm-type LibresignFileRuntimeMetadata = LibresignValidateMetadata|array * @psalm-type LibresignValidationPageResolution = array{ * w: float, * h: float, diff --git a/openapi-administration.json b/openapi-administration.json index 424224c4c4..fc256a5b93 100644 --- a/openapi-administration.json +++ b/openapi-administration.json @@ -1462,7 +1462,9 @@ "meta": { "$ref": "#/components/schemas/OCSMeta" }, - "data": {} + "data": { + "type": "object" + } } } } diff --git a/openapi-full.json b/openapi-full.json index 205b1914f0..b2007bb35c 100644 --- a/openapi-full.json +++ b/openapi-full.json @@ -949,6 +949,53 @@ } } }, + "DynamicMetadataRecord": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/DynamicMetadataScalar" + } + }, + "DynamicMetadataScalar": { + "nullable": true, + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer", + "format": "int64" + }, + { + "type": "number", + "format": "double" + }, + { + "type": "boolean" + } + ] + }, + "DynamicMetadataValue": { + "anyOf": [ + { + "$ref": "#/components/schemas/DynamicMetadataScalar" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/DynamicMetadataScalar" + } + }, + { + "$ref": "#/components/schemas/DynamicMetadataRecord" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/DynamicMetadataRecord" + } + } + ] + }, "EngineHandler": { "type": "object", "required": [ @@ -1303,7 +1350,7 @@ { "type": "object", "additionalProperties": { - "type": "object" + "$ref": "#/components/schemas/DynamicMetadataValue" } } ] @@ -1793,7 +1840,9 @@ ], "properties": { "date": { - "type": "string" + "type": "integer", + "format": "int64", + "minimum": 0 }, "method": { "type": "string", @@ -1802,6 +1851,9 @@ "notify", "mail" ] + }, + "description": { + "type": "string" } } }, @@ -2353,6 +2405,23 @@ } } }, + "SignerCertificateInfo": { + "type": "object", + "properties": { + "serialNumber": { + "type": "string" + }, + "serialNumberHex": { + "type": "string" + }, + "hash": { + "type": "string" + }, + "subject": { + "$ref": "#/components/schemas/DynamicMetadataValue" + } + } + }, "SignerDetail": { "allOf": [ { @@ -2443,12 +2512,32 @@ "type": "string" }, "metadata": { - "type": "object" + "$ref": "#/components/schemas/SignerMetadata" } } } ] }, + "SignerMetadata": { + "type": "object", + "properties": { + "remote-address": { + "type": "string" + }, + "user-agent": { + "type": "string" + }, + "notify": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Notify" + } + }, + "certificate_info": { + "$ref": "#/components/schemas/SignerCertificateInfo" + } + } + }, "SignerSummary": { "type": "object", "required": [ @@ -10732,7 +10821,9 @@ "meta": { "$ref": "#/components/schemas/OCSMeta" }, - "data": {} + "data": { + "type": "object" + } } } } diff --git a/openapi.json b/openapi.json index 61757b710a..8fa78e29d7 100644 --- a/openapi.json +++ b/openapi.json @@ -622,6 +622,53 @@ } ] }, + "DynamicMetadataRecord": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/DynamicMetadataScalar" + } + }, + "DynamicMetadataScalar": { + "nullable": true, + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer", + "format": "int64" + }, + { + "type": "number", + "format": "double" + }, + { + "type": "boolean" + } + ] + }, + "DynamicMetadataValue": { + "anyOf": [ + { + "$ref": "#/components/schemas/DynamicMetadataScalar" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/DynamicMetadataScalar" + } + }, + { + "$ref": "#/components/schemas/DynamicMetadataRecord" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/DynamicMetadataRecord" + } + } + ] + }, "ErrorItem": { "type": "object", "required": [ @@ -904,7 +951,7 @@ { "type": "object", "additionalProperties": { - "type": "object" + "$ref": "#/components/schemas/DynamicMetadataValue" } } ] @@ -1332,7 +1379,9 @@ ], "properties": { "date": { - "type": "string" + "type": "integer", + "format": "int64", + "minimum": 0 }, "method": { "type": "string", @@ -1341,6 +1390,9 @@ "notify", "mail" ] + }, + "description": { + "type": "string" } } }, @@ -1755,6 +1807,23 @@ } } }, + "SignerCertificateInfo": { + "type": "object", + "properties": { + "serialNumber": { + "type": "string" + }, + "serialNumberHex": { + "type": "string" + }, + "hash": { + "type": "string" + }, + "subject": { + "$ref": "#/components/schemas/DynamicMetadataValue" + } + } + }, "SignerDetail": { "allOf": [ { @@ -1845,12 +1914,32 @@ "type": "string" }, "metadata": { - "type": "object" + "$ref": "#/components/schemas/SignerMetadata" } } } ] }, + "SignerMetadata": { + "type": "object", + "properties": { + "remote-address": { + "type": "string" + }, + "user-agent": { + "type": "string" + }, + "notify": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Notify" + } + }, + "certificate_info": { + "$ref": "#/components/schemas/SignerCertificateInfo" + } + } + }, "SignerSummary": { "type": "object", "required": [ diff --git a/src/types/openapi/openapi-administration.ts b/src/types/openapi/openapi-administration.ts index 1038d0e772..4c5f0f8d8e 100644 --- a/src/types/openapi/openapi-administration.ts +++ b/src/types/openapi/openapi-administration.ts @@ -979,7 +979,7 @@ export interface operations { "application/json": { ocs: { meta: components["schemas"]["OCSMeta"]; - data: unknown; + data: Record; }; }; }; diff --git a/src/types/openapi/openapi-full.ts b/src/types/openapi/openapi-full.ts index 42401b0596..6cb960cb6e 100644 --- a/src/types/openapi/openapi-full.ts +++ b/src/types/openapi/openapi-full.ts @@ -1781,6 +1781,11 @@ export type components = { label: string; description: string; }; + DynamicMetadataRecord: { + [key: string]: components["schemas"]["DynamicMetadataScalar"]; + }; + DynamicMetadataScalar: (string | number | boolean) | null; + DynamicMetadataValue: components["schemas"]["DynamicMetadataScalar"] | components["schemas"]["DynamicMetadataScalar"][] | components["schemas"]["DynamicMetadataRecord"] | components["schemas"]["DynamicMetadataRecord"][]; EngineHandler: { configPath: string; cfsslUri?: string; @@ -1875,7 +1880,7 @@ export type components = { settings?: components["schemas"]["Settings"]; }; FileRuntimeMetadata: components["schemas"]["ValidateMetadata"] | { - [key: string]: Record; + [key: string]: components["schemas"]["DynamicMetadataValue"]; }; FileSummary: { /** Format: int64 */ @@ -2013,9 +2018,11 @@ export type components = { status?: number; }; Notify: { - date: string; + /** Format: int64 */ + date: number; /** @enum {string} */ method: "activity" | "notify" | "mail"; + description?: string; }; OCSMeta: { status: string; @@ -2180,6 +2187,12 @@ export type components = { signatureHeight: number; renderMode: string; }; + SignerCertificateInfo: { + serialNumber?: string; + serialNumberHex?: string; + hash?: string; + subject?: components["schemas"]["DynamicMetadataValue"]; + }; SignerDetail: components["schemas"]["SignerSummary"] & { description: string | null; subject?: string; @@ -2206,7 +2219,13 @@ export type components = { visibleElements: components["schemas"]["VisibleElement"][]; signatureMethods?: components["schemas"]["SignatureMethods"]; uid?: string; - metadata?: Record; + metadata?: components["schemas"]["SignerMetadata"]; + }; + SignerMetadata: { + "remote-address"?: string; + "user-agent"?: string; + notify?: components["schemas"]["Notify"][]; + certificate_info?: components["schemas"]["SignerCertificateInfo"]; }; SignerSummary: { /** Format: int64 */ @@ -5732,7 +5751,7 @@ export interface operations { "application/json": { ocs: { meta: components["schemas"]["OCSMeta"]; - data: unknown; + data: Record; }; }; }; diff --git a/src/types/openapi/openapi.ts b/src/types/openapi/openapi.ts index 5f4b0c4d20..317d0bddaf 100644 --- a/src/types/openapi/openapi.ts +++ b/src/types/openapi/openapi.ts @@ -1214,6 +1214,11 @@ export type components = { /** @enum {string} */ signatureFlow: "none" | "parallel" | "ordered_numeric"; }; + DynamicMetadataRecord: { + [key: string]: components["schemas"]["DynamicMetadataScalar"]; + }; + DynamicMetadataScalar: (string | number | boolean) | null; + DynamicMetadataValue: components["schemas"]["DynamicMetadataScalar"] | components["schemas"]["DynamicMetadataScalar"][] | components["schemas"]["DynamicMetadataRecord"] | components["schemas"]["DynamicMetadataRecord"][]; ErrorItem: { message: string; title?: string; @@ -1289,7 +1294,7 @@ export type components = { settings?: components["schemas"]["Settings"]; }; FileRuntimeMetadata: components["schemas"]["ValidateMetadata"] | { - [key: string]: Record; + [key: string]: components["schemas"]["DynamicMetadataValue"]; }; FileSummary: { /** Format: int64 */ @@ -1409,9 +1414,11 @@ export type components = { status?: number; }; Notify: { - date: string; + /** Format: int64 */ + date: number; /** @enum {string} */ method: "activity" | "notify" | "mail"; + description?: string; }; OCSMeta: { status: string; @@ -1535,6 +1542,12 @@ export type components = { emailToken?: components["schemas"]["SignatureMethodEmailToken"]; password?: components["schemas"]["SignatureMethodPassword"]; }; + SignerCertificateInfo: { + serialNumber?: string; + serialNumberHex?: string; + hash?: string; + subject?: components["schemas"]["DynamicMetadataValue"]; + }; SignerDetail: components["schemas"]["SignerSummary"] & { description: string | null; subject?: string; @@ -1561,7 +1574,13 @@ export type components = { visibleElements: components["schemas"]["VisibleElement"][]; signatureMethods?: components["schemas"]["SignatureMethods"]; uid?: string; - metadata?: Record; + metadata?: components["schemas"]["SignerMetadata"]; + }; + SignerMetadata: { + "remote-address"?: string; + "user-agent"?: string; + notify?: components["schemas"]["Notify"][]; + certificate_info?: components["schemas"]["SignerCertificateInfo"]; }; SignerSummary: { /** Format: int64 */