AuthCallout.Client.Wolverine
0.1.35
dotnet add package AuthCallout.Client.Wolverine --version 0.1.35
NuGet\Install-Package AuthCallout.Client.Wolverine -Version 0.1.35
<PackageReference Include="AuthCallout.Client.Wolverine" Version="0.1.35" />
<PackageVersion Include="AuthCallout.Client.Wolverine" Version="0.1.35" />
<PackageReference Include="AuthCallout.Client.Wolverine" />
paket add AuthCallout.Client.Wolverine --version 0.1.35
#r "nuget: AuthCallout.Client.Wolverine, 0.1.35"
#:package AuthCallout.Client.Wolverine@0.1.35
#addin nuget:?package=AuthCallout.Client.Wolverine&version=0.1.35
#tool nuget:?package=AuthCallout.Client.Wolverine&version=0.1.35
AuthCallout.Client.Wolverine
Wolverine integration for nats-auth-callout-service (ADR 0022): a thin adapter binding AuthCallout.Client's token acquisition, connection, and identity-propagation seams into WolverineFx.Nats's transport and handler pipeline. All behavior lives in AuthCallout.Client; this package only wires it into Wolverine.
What it gives you
opts.UseNatsWithCallout(callout => ...): authenticates Wolverine's NATS transport through the callout via anAuthCallbackthat pulls a current token from yourICalloutTokenProvideron every (re)connect (ADR 0021 rules 4-5), and scopes the transport connection'sInboxPrefixto the callout's per-principal inbox grant viaConfigureNatsOpts. Discovery and identity-verification KV reads run over that same single connection. Requires WolverineFx.Nats 6.47+.- Outbound: the connection's cached
Callout-Identityassertion is attached to every outgoing envelope (no-op when the application's discovery descriptor has identity propagation disabled). - Inbound:
CalloutIdentityMiddleware, applied to every handler chain by default (opt out per message type with[RequireIdentity(false)]), verifies theCallout-Identityheader and injects aCalloutIdentityContextparameter, or stops the chain on a missing/forged/expired header.
Quick start (service, client credentials)
builder.UseWolverine(opts =>
{
opts.UseNatsWithCallout(callout =>
{
callout.Url = "nats://localhost:4222";
callout.ApplicationName = "notes";
callout.UseClientCredentials(cc =>
{
cc.Authority = new Uri("https://idp.example.com/realms/dev");
cc.ClientId = "notes-worker";
cc.ClientSecret = SecretRef.Inline("...");
});
});
opts.PublishMessage<CreateNote>().ToNatsSubject("notes.commands");
opts.ListenToNatsSubject("notes.commands");
});
A handler receiving a verified caller just takes the context as a parameter:
public static NoteCreated Handle(CreateNote command, CalloutIdentityContext identity)
{
// identity.Subject, identity.Application are verified, signed by the callout (ADR 0011).
...
}
Exempt a message type that accepts anonymous traffic (e.g. a registration/discovery request):
[RequireIdentity(false)]
public sealed record RegisterDevice(string DeviceId);
Docs: https://ryandanthony.github.io/nats-auth-callout-service/ (see the Wolverine guide).
| 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
- AuthCallout.Client (>= 0.1.35)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Hosting (>= 10.0.15)
- Microsoft.Extensions.Http.Resilience (>= 10.9.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Options (>= 10.0.15)
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 8.22.0)
- NATS.Client.KeyValueStore (>= 3.2.0)
- NATS.Net (>= 3.2.0)
- NATS.NKeys (>= 1.0.2)
- System.IdentityModel.Tokens.Jwt (>= 8.22.0)
- WolverineFx (>= 6.47.0)
- WolverineFx.Nats (>= 6.47.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.