Polhem.JsonRpc.Payload.Server
1.4.0
dotnet add package Polhem.JsonRpc.Payload.Server --version 1.4.0
NuGet\Install-Package Polhem.JsonRpc.Payload.Server -Version 1.4.0
<PackageReference Include="Polhem.JsonRpc.Payload.Server" Version="1.4.0" />
<PackageVersion Include="Polhem.JsonRpc.Payload.Server" Version="1.4.0" />
<PackageReference Include="Polhem.JsonRpc.Payload.Server" />
paket add Polhem.JsonRpc.Payload.Server --version 1.4.0
#r "nuget: Polhem.JsonRpc.Payload.Server, 1.4.0"
#:package Polhem.JsonRpc.Payload.Server@1.4.0
#addin nuget:?package=Polhem.JsonRpc.Payload.Server&version=1.4.0
#tool nuget:?package=Polhem.JsonRpc.Payload.Server&version=1.4.0
Polhem.JsonRpc.Payload.Server
The server half of Polhem.JsonRpc.Payload: a dispatcher filter that opens the payload envelope of each request (decryption, decompression, the codec), checks its replay-protection frame, and answers in the same format and codec.
builder.Services.AddJsonRpcServer(options =>
{
options.ObjectFactory = new MyObjectFactory();
options.Filters.Add(new MyAccessFilter()); // runs before the body is decrypted
options.UsePayload(payloadOptions, new MyPayloadPolicy());
});
IPayloadServerPolicy is where the application answers what the package cannot know: the key of an encrypted call,
the scope a sequence number must be unique in, which methods reject a repeated one, the lowest format a method accepts
(only Encrypted makes the replay checks impossible to skip), and the type to decode into. The
type is always decided by the server; the type member of a request is only checked against it, so the contract types
are not registered with PayloadOptions.TypeResolver.
Where sequence numbers are checked (PayloadOptions.RequireFrame on and a replay scope for the caller), a method that
rejects a repeated one also refuses plain and encoded calls, because only an encrypted frame proves its number new.
UsePayload answers -32602 Invalid params for a malformed envelope, a call below the method's minimum format, and a
plain or encoded call to such a method; every other payload failure is -32603, unless
the application's own ExceptionMapper, set before UsePayload, answers it first.
A compressed body is bounded by the compressor's own limit and, with a compressor that accepts a limit as
GzipPayloadCompressor does, by PayloadOptions.MaxDecompressedBytesPerMessage for the whole message, the call alone or
a batch, because an encoded body is decompressed before any key is asked for.
The items of a streaming method are sealed in the format of the request, and the result of a call from a caller that
reads a stream is bound to the stream, so an item that is dropped, repeated, reordered or moved in from another call
fails to open on the client.
MemoryPayloadReplayStore remembers sequence numbers in the process; a deployment with several instances needs a
shared IPayloadReplayStore.
Upgrade this package together with Polhem.JsonRpc.Server and the other Polhem.JsonRpc packages, to the same version.
It accepts any later version of Polhem.JsonRpc.Server, so the server package can be upgraded beneath it alone; a
version of this package from before 1.3.0, run with Polhem.JsonRpc.Server 1.3.0, does not seal the items of a
streaming method, which then go out unencrypted.
Documentation and samples: https://github.com/polhem-dev/polhem-jsonrpc
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Polhem.JsonRpc.Payload (>= 1.4.0)
- Polhem.JsonRpc.Server (>= 1.4.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Polhem.JsonRpc.Payload.Server:
| Package | Downloads |
|---|---|
|
Polhem.Hosting
Composition root for the Polhem framework. Registers backend services into any IServiceCollection — usable from ASP.NET Core, WinForms/WPF, Console, Worker Service, and integration test hosts without pulling in ASP.NET Core. |
|
|
Polhem.Api.Server
The server side of the Polhem JSON-RPC API: the dispatcher setup, the access and payload filters, API key and authorization checks, and the exception mapping. |
GitHub repositories
This package is not used by any popular GitHub repositories.