![]() |
VOOZH | about |
dotnet add package Rig.TUnit.Security --version 0.1.0-beta.2
NuGet\Install-Package Rig.TUnit.Security -Version 0.1.0-beta.2
<PackageReference Include="Rig.TUnit.Security" Version="0.1.0-beta.2" />
<PackageVersion Include="Rig.TUnit.Security" Version="0.1.0-beta.2" />Directory.Packages.props
<PackageReference Include="Rig.TUnit.Security" />Project file
paket add Rig.TUnit.Security --version 0.1.0-beta.2
#r "nuget: Rig.TUnit.Security, 0.1.0-beta.2"
#:package Rig.TUnit.Security@0.1.0-beta.2
#addin nuget:?package=Rig.TUnit.Security&version=0.1.0-beta.2&prereleaseInstall as a Cake Addin
#tool nuget:?package=Rig.TUnit.Security&version=0.1.0-beta.2&prereleaseInstall as a Cake Tool
Security family-base:
ISecurityRig,SecurityFixtureBase,SecurityAssertwith HTTP 401/403 helpers.
The shared contract for the Security family (.Jwt, .Mtls, .OAuth,
.Policies). Defines the assertion surface every security test expects
— SecurityAssert.HttpIsUnauthorized(response),
HttpIsForbidden(response), ClaimsPrincipalIsAuthenticated(principal)
— so test code looks identical whether you're using JWT, mTLS, OAuth,
or ASP.NET Core Policies.
Install one of the leaves directly for concrete testing.
using Rig.TUnit.Security;
var response = await client.SendAsync(request);
await SecurityAssert.HttpIsUnauthorized(response);
| Property | Type | Default | Description |
|---|---|---|---|
DefaultScheme |
string |
"Test" |
Authentication scheme for fixtures that register one |
ValidateIssuer |
bool |
true |
Propagate to JwtBearerOptions when paired with .Jwt |
ValidateAudience |
bool |
true |
Same for audience |
ClockSkew |
TimeSpan |
5m |
Leeway on exp / nbf |
Rig.TUnit.Security.ISecurityRigRig.TUnit.Security.Fixtures.SecurityFixtureBaseRig.TUnit.Security.Assertions.SecurityAssertSecurity fixtures typically own ephemeral key material (JWT signing
keys, certificate chains) per-test, keyed by IsolationKey. Each leaf
details the specifics.
certificate generation is expensive (~20 ms) and cached per fixture.
SecurityAssert.HttpIsUnauthorized fails on expected-401 — check
the API's [Authorize] wiring actually runs before your handler;
a missing app.UseAuthorization() lets requests through as 200.See .
JwtBearerHandler /
CertificateAuthentication middleware — no test-only bypass. That is
deliberate; bypassed auth is not a valid security test.*Benchmarks.cs entries under tests/Rig.TUnit.Benchmarks/.
MIT. See .
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 5 NuGet packages that depend on Rig.TUnit.Security:
| Package | Downloads |
|---|---|
|
Rig.TUnit.Security.Policies
TUnit fixture for ASP.NET Core authorisation policies - claim-based, role-based, and resource-based assertions. |
|
|
Rig.TUnit.All
Meta-package containing every Rig.TUnit.* package. DISCOURAGED — prefer per-feature or per-stack meta-packages (Rig.TUnit, Rig.TUnit.Microservices). |
|
|
Rig.TUnit.Security.OAuth
TUnit fixture for OAuth flows (auth-code+PKCE, client-credentials) against an in-process IdentityServer or stub provider. |
|
|
Rig.TUnit.Security.Jwt
TUnit fixture for issuing test JWTs and a JWKS endpoint backed by an in-memory signing key. |
|
|
Rig.TUnit.Security.Mtls
TUnit fixture for mutual-TLS scenarios - test CAs, leaf certs, and revocation list assertions. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-beta.2 | 69 | 4/27/2026 |
| 0.0.0-alpha.0.14 | 67 | 4/26/2026 |