[#30] Client: Add object model for Rules
All checks were successful
DCO / DCO (pull_request) Successful in 27s
lint-build / dotnet8.0 (pull_request) Successful in 43s
lint-build / dotnet8.0 (push) Successful in 46s

Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
Pavel Gross 2025-02-12 04:20:01 +03:00
parent 43e300c773
commit 195854a45b
27 changed files with 677 additions and 155 deletions

View file

@ -88,7 +88,6 @@ public static class Verifier
return key.VerifyData(data2Verify, sig.Sign.ToByteArray());
}
internal static bool VerifyMatryoskaLevel(IMessage body, IMetaHeader meta, IVerificationHeader verification)
{
if (!verification.MetaSignature.VerifyMessagePart(meta))
@ -118,12 +117,19 @@ public static class Verifier
internal static void CheckResponse(IResponse resp)
{
if (!resp.Verify())
{
throw new FormatException($"invalid response, type={resp.GetType()}");
}
var status = resp.MetaHeader.Status.ToModel();
if (resp.MetaHeader != null)
{
var status = resp.MetaHeader.Status.ToModel();
if (status != null && !status.IsSuccess)
throw new FrostFsResponseException(status);
if (status != null && !status.IsSuccess)
{
throw new FrostFsResponseException(status);
}
}
}
/// <summary>
@ -138,6 +144,8 @@ public static class Verifier
}
if (!request.Verify())
{
throw new FrostFsResponseException($"invalid response, type={request.GetType()}");
}
}
}