SecureOps 1.0.3
dotnet add package SecureOps --version 1.0.3
NuGet\Install-Package SecureOps -Version 1.0.3
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="SecureOps" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SecureOps" Version="1.0.3" />
<PackageReference Include="SecureOps" />
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 SecureOps --version 1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SecureOps, 1.0.3"
#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 SecureOps@1.0.3
#: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=SecureOps&version=1.0.3
#tool nuget:?package=SecureOps&version=1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
// ========================= // 📦 NuGet README (for .csproj) // =========================
SecureOps
SecureOps is a lightweight, extensible, feature-based authorization framework for ASP.NET Core.
SecureOps lets you secure endpoints using named permissions like "Product.Create"
or "User.Manage"
, with support for:
- Custom permission stores (InMemory, DB, Redis)
- Caching (InMemory and Redis)
- Configurable user claim resolution (e.g.,
sub
,email
) - Optional permission management API (Add/Remove/List)
- Minimal API + Attribute Routing
- Zero-dependency core + extensible services
Installation
dotnet add package SecureOps
Getting Started
1. Register SecureOps in Program.cs
builder.Services.AddSecureOps(options =>
{
options.CacheMode = CacheMode.Memory;
options.UserIdClaimType = "sub"; // Default is ClaimTypes.Name
options.AuthenticationOptions.DefaultScheme = JwtBearerDefaults.AuthenticationScheme;
});
2. Use the [HasPermission]
Attribute
[HasPermission("Product.Create")]
[HttpPost("create")]
public IActionResult CreateProduct() => Ok("Permission granted.");
Permission Claim API (Optional)
Enable built-in endpoints to manage permissions:
app.UseSecureOps(config =>
{
config.MapPermissionEndpoints(api =>
{
api.RoutePrefix = "api/permissions";
api.PermissionClaim = "ManagePermissions";
api.EnableUserPermissionManagement = true;
});
});
Redis Support
builder.Services.AddSecureOps(options =>
{
options.CacheMode = CacheMode.Redis;
options.RedisConfiguration = "localhost:6379";
});
Or register your own
IConnectionMultiplexer
before callingAddSecureOps
.
License
SecureOps is licensed under the MIT License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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.
-
net8.0
- StackExchange.Redis (>= 2.8.41)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.