Valtuutus.Data
0.1.0-alpha
See the version list below for details.
dotnet add package Valtuutus.Data --version 0.1.0-alpha
NuGet\Install-Package Valtuutus.Data -Version 0.1.0-alpha
<PackageReference Include="Valtuutus.Data" Version="0.1.0-alpha" />
paket add Valtuutus.Data --version 0.1.0-alpha
#r "nuget: Valtuutus.Data, 0.1.0-alpha"
// Install Valtuutus.Data as a Cake Addin #addin nuget:?package=Valtuutus.Data&version=0.1.0-alpha&prerelease // Install Valtuutus.Data as a Cake Tool #tool nuget:?package=Valtuutus.Data&version=0.1.0-alpha&prerelease
Valtuutus
A Google Zanzibar inspired authorization library in .NET
The implementation is based on the permify and other ReBac open source projects.
Functionality
The library is designed to be simple and easy to use. Each subset of functionality is divided in engines. The engines are:
- DataEngine: The engine that handles the write and deletion of relation tuples and attributes.
- Read here about how the relational data is stored.
- CheckEngine: The engine that handles the answering of two questions:
Can entity U perform action Y in resource Z
? For that, use theCheck
function.What permissions entity U have in resource Z
? For that, use theSubjectPermission
function.
- LookupSubjectEngine: The engine that can answer:
Which subjects of type T have permission Y on entity:X?
For that, use theLookup
function. - LookupEntityEngine: The engine that can answer:
Which resources of type T can entity:X have permission Y?
For that, use theLookupEntity
function.
Usage
Install the package from NuGet:
If using Postgres:
dotnet add package Valtuutus.Data.Postgres
If using SqlServer:
dotnet add package Valtuutus.Data.SqlServer
Adding to DI:
builder.Services.AddValtuutusCore(c =>
...
See examples of how to define your schema here.
If using Postgres:
builder.Services.AddValtuutusDatabase(() => new NpgsqlConnection(builder.Configuration.GetConnectionString("PostgresDb")!), a => a.AddPostgres());
If using SqlServer:
builder.Services.AddValtuutusDatabase(() => new SqlConnection(builder.Configuration.GetConnectionString("SqlServerDb")!), a => a.AddSqlServer());
Telemetry
The library uses OpenTelemetry to provide telemetry data. To enable it, just add a source with the name "Valtuutus":
builder.Services
.AddOpenTelemetry()
.WithTracing(telemetry =>
{
telemetry
.AddSource("Valtuutus")
...
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. |
-
net8.0
- Dapper (>= 2.1.35)
- Dapper.SqlBuilder (>= 2.0.78)
- IdGen.DependencyInjection (>= 3.0.5)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.1)
- Sqids (>= 3.1.0)
- Valtuutus.Core (>= 0.1.0-alpha)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Valtuutus.Data:
Package | Downloads |
---|---|
Valtuutus.Data.InMemory
Valtuutus InMemory support; Valtuutus provides a developer-focused, modern library for creating ReBAC without complexity. |
|
Valtuutus.Data.Db
Valtuutus relational db data abstractions; Valtuutus provides a developer-focused, modern library for creating ReBAC without complexity. |
|
Valtuutus.Data.Caching
Valtuutus relational caching abstractions; Valtuutus provides a developer-focused, modern library for creating ReBAC without complexity. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.6.0-beta | 45 | 10/9/2024 |
0.5.0-beta | 73 | 8/21/2024 |
0.4.0-alpha | 38 | 7/26/2024 |
0.3.0-alpha | 68 | 4/4/2024 |
0.2.0-alpha | 60 | 3/27/2024 |
0.1.0-alpha | 59 | 3/25/2024 |
Version 0.1-alpha:
Initial release to begin testing