Rwx.Security 0.3.1

dotnet add package Rwx.Security --version 0.3.1
                    
NuGet\Install-Package Rwx.Security -Version 0.3.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Rwx.Security" Version="0.3.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rwx.Security" Version="0.3.1" />
                    
Directory.Packages.props
<PackageReference Include="Rwx.Security" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Rwx.Security --version 0.3.1
                    
#r "nuget: Rwx.Security, 0.3.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Rwx.Security@0.3.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Rwx.Security&version=0.3.1
                    
Install as a Cake Addin
#tool nuget:?package=Rwx.Security&version=0.3.1
                    
Install as a Cake Tool

Rwx.Security

Current-user abstraction and event-bus metadata enrichment for the Rwx framework.

Install

dotnet add package Rwx.Security --version 0.1.0

Quick start

using Rwx.Security;

builder.Services.AddRwxSecurity();

AddRwxSecurity() registers ABP-style claims-based ICurrentUser services. ICurrentPrincipalAccessor.Change(...) temporarily overrides the principal for the current async flow. In an ASP.NET Core host, call AddRwxAspNetSecurity() from Rwx.AspNet to use HttpContext.User as the default principal.

ICurrentUser exposes claim helpers plus the authenticated user's UserId, Id, UserName, Name, roles, OrgId, and DepartmentId.

For messages published through an already-registered IEventBus, call AddRwxEventBusSecurityEnrichment() to add the current OrgId, UserId, and DepartmentId as message headers automatically.

builder.Services.AddRwxSecurity();
builder.Services.AddRwxMessaging(builder.Configuration, typeof(OrderPlaced).Assembly);
builder.Services.AddRwxEventBusSecurityEnrichment();

On the receiving side, a handler reads those same headers back through Rwx.EventBus.Abstractions's IncomingEventContext — see that package's README. There is deliberately no equivalent AddRwx* call that re-hydrates ICurrentPrincipalAccessor from incoming headers: see Boundaries below.

Boundaries

ICurrentUserAccessor provides request/work metadata, not authorization policy. Domain entities must not access it. Message headers are contextual metadata and must be treated as untrusted at a receiving service; authenticate and authorize at that service's boundary. Never decorate IIntegrationEventHandler<T> to set ICurrentPrincipalAccessor/ICurrentUser from IncomingEventContext — that would let any message on the bus impersonate an org or user with no authentication.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Rwx.Security:

Package Downloads
Rwx.Persistence.EfCore

Package Description

Rwx.AspNet

Package Description

Rwx.Authorization

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.1 277 7/26/2026
0.3.0 192 7/20/2026
0.2.2 199 7/14/2026
0.2.1 148 7/13/2026
0.1.1 133 7/12/2026
0.1.0 130 7/12/2026
0.0.2 125 7/12/2026
0.0.1 133 7/12/2026