From ce3168ede17ebdf8578decb11d9f4aa4e25a465e Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Thu, 5 Jun 2025 18:15:33 +0200 Subject: [PATCH] Attempt to fix tests --- .../Models/Response/PrivateKeysResponseModel.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Api/KeyManagement/Models/Response/PrivateKeysResponseModel.cs b/src/Api/KeyManagement/Models/Response/PrivateKeysResponseModel.cs index 30f10a5fbe..c9b8e42144 100644 --- a/src/Api/KeyManagement/Models/Response/PrivateKeysResponseModel.cs +++ b/src/Api/KeyManagement/Models/Response/PrivateKeysResponseModel.cs @@ -1,4 +1,5 @@ -using Bit.Core.KeyManagement.Models.Data; +using System.Text.Json.Serialization; +using Bit.Core.KeyManagement.Models.Data; using Bit.Core.Models.Api; namespace Bit.Api.KeyManagement.Models.Response; @@ -28,6 +29,14 @@ public class PrivateKeysResponseModel : ResponseModel } } + [JsonConstructor] + public PrivateKeysResponseModel(SignatureKeyPairResponseModel? signatureKeyPair, PublicKeyEncryptionKeyPairModel publicKeyEncryptionKeyPair) + : base("privateKeys") + { + SignatureKeyPair = signatureKeyPair; + PublicKeyEncryptionKeyPair = publicKeyEncryptionKeyPair ?? throw new ArgumentNullException(nameof(publicKeyEncryptionKeyPair)); + } + // Not all accounts have signature keys, but all accounts have public encryption keys. public SignatureKeyPairResponseModel? SignatureKeyPair { get; set; } public required PublicKeyEncryptionKeyPairModel PublicKeyEncryptionKeyPair { get; set; }