Trellis.Authorization
3.0.0-alpha.94
See the version list below for details.
dotnet add package Trellis.Authorization --version 3.0.0-alpha.94
NuGet\Install-Package Trellis.Authorization -Version 3.0.0-alpha.94
<PackageReference Include="Trellis.Authorization" Version="3.0.0-alpha.94" />
<PackageVersion Include="Trellis.Authorization" Version="3.0.0-alpha.94" />
<PackageReference Include="Trellis.Authorization" />
paket add Trellis.Authorization --version 3.0.0-alpha.94
#r "nuget: Trellis.Authorization, 3.0.0-alpha.94"
#:package Trellis.Authorization@3.0.0-alpha.94
#addin nuget:?package=Trellis.Authorization&version=3.0.0-alpha.94&prerelease
#tool nuget:?package=Trellis.Authorization&version=3.0.0-alpha.94&prerelease
Trellis.Authorization
Lightweight authorization primitives for Trellis.
Provides Actor, IActorProvider, IAuthorize, and IAuthorizeResource types that integrate with the Trellis Result<T> type system. No dependency on any mediator or web framework.
Types
| Type | Purpose |
|---|---|
Actor |
Represents the current user with Id and Permissions |
IActorProvider |
Abstraction for resolving the current actor (implement in API layer) |
IAuthorize |
Marker for static permission-based authorization |
IAuthorizeResource |
Marker for resource-based authorization |
Usage
using Trellis.Authorization;
// Implement IActorProvider in your API layer
public class HttpActorProvider(IHttpContextAccessor accessor) : IActorProvider
{
public Actor GetCurrentActor()
{
var user = accessor.HttpContext!.User;
var id = user.FindFirstValue(ClaimTypes.NameIdentifier)!;
var permissions = user.Claims
.Where(c => c.Type == "permission")
.Select(c => c.Value)
.ToHashSet();
return Actor.Create(id, permissions);
}
}
See the full documentation for details.
| 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
- Trellis.Results (>= 3.0.0-alpha.94)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Trellis.Authorization:
| Package | Downloads |
|---|---|
|
Trellis.Testing
Testing utilities and assertions for Trellis - FluentAssertions extensions, test builders, and fake implementations for Railway-Oriented Programming |
|
|
Trellis.Mediator
Result-aware pipeline behaviors for martinothamar/Mediator. Provides validation, authorization, logging, tracing, and exception handling behaviors that understand Trellis Result types and short-circuit correctly. |
|
|
Trellis.Asp.Authorization
Azure Entra ID v2.0 actor provider for Trellis. Maps JWT claims to Actor with permissions, forbidden permissions, and ABAC attributes. Integrates Trellis.Authorization with ASP.NET Core. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0-alpha.140 | 51 | 3/30/2026 |
| 3.0.0-alpha.137 | 62 | 3/27/2026 |
| 3.0.0-alpha.135 | 39 | 3/26/2026 |
| 3.0.0-alpha.127 | 53 | 3/23/2026 |
| 3.0.0-alpha.123 | 46 | 3/19/2026 |
| 3.0.0-alpha.118 | 52 | 3/14/2026 |
| 3.0.0-alpha.111 | 51 | 3/12/2026 |
| 3.0.0-alpha.104 | 45 | 3/9/2026 |
| 3.0.0-alpha.100 | 45 | 3/4/2026 |
| 3.0.0-alpha.99 | 46 | 3/4/2026 |
| 3.0.0-alpha.98 | 47 | 3/3/2026 |
| 3.0.0-alpha.95 | 49 | 3/2/2026 |
| 3.0.0-alpha.94 | 45 | 3/2/2026 |
| 3.0.0-alpha.93 | 47 | 3/1/2026 |
| 3.0.0-alpha.92 | 52 | 2/28/2026 |