-
Notifications
You must be signed in to change notification settings - Fork 0
02 Packages and Installation
RuleGate is split into focused packages. Most applications should install the host integration package rather than assembling the engine manually.
flowchart LR
subgraph NuGet["NuGet package family"]
KEY["Fotbiler.RuleGate.Keycloak"] --> ASP["Fotbiler.RuleGate.AspNetCore"]
ASP --> MAN["Fotbiler.RuleGate.Manifest"]
ASP --> CORE["Fotbiler.RuleGate.Core"]
MAN --> ABS["Fotbiler.RuleGate.Abstractions"]
CORE --> ABS
CLI["Fotbiler.RuleGate.Cli"] --> MAN
end
subgraph npm["npm package family"]
NG["@fotbiler/rulegate-angular"] --> CLIENT["@fotbiler/rulegate-client"]
LEGACY["@fotbiler/rulegate-angular-legacy"] --> CLIENT
end
This guide targets RuleGate 1.0.0.
The six NuGet packages share one version. The three npm packages also share
one version. NuGet and npm families are versioned independently even when both
currently use 1.0.0.
| Package | Install when | What it contains |
|---|---|---|
Fotbiler.RuleGate.Abstractions |
Building an integration or extension that needs only contracts | Subjects, resources, requests, decisions, policy definitions, source/reload contracts, diagnostics contracts |
Fotbiler.RuleGate.Core |
Hosting RuleGate outside ASP.NET Core or constructing the engine directly | Fail-closed engine, built-in evaluators, in-memory and atomic policy providers |
Fotbiler.RuleGate.Manifest |
Reading or compiling YAML outside the ASP.NET Core package graph | YAML loader, validator, compiler, file and embedded-resource sources |
Fotbiler.RuleGate.AspNetCore |
Building an ASP.NET Core API, MVC application, or service | DI registration, subject/resource mapping, endpoint metadata, enrichment, configuration source, HTTP results |
Fotbiler.RuleGate.Cli |
Validating, generating, testing, explaining, or linting policies |
rulegate .NET tool |
Fotbiler.RuleGate.Keycloak |
Keycloak supplies realm/client roles and you want canonical mapping helpers | Optional Keycloak subject factory and role normalization |
Installing Fotbiler.RuleGate.AspNetCore brings the engine, abstractions, and
manifest dependencies required by the common host path:
dotnet add package Fotbiler.RuleGate.AspNetCore --version 1.0.0Add Keycloak helpers only when needed:
dotnet add package Fotbiler.RuleGate.Keycloak --version 1.0.0Install the CLI as a repository-local tool so CI and developers use the same version:
dotnet new tool-manifest
dotnet tool install Fotbiler.RuleGate.Cli --version 1.0.0
dotnet tool run rulegate infoGlobal installation is convenient for exploration:
dotnet tool install --global Fotbiler.RuleGate.Cli --version 1.0.0
rulegate --version| Package group | Target frameworks |
|---|---|
| Abstractions, Core, Manifest |
.NET Standard 2.0, .NET 8, .NET 9, .NET 10
|
| ASP.NET Core, Keycloak |
.NET Core 3.1, .NET 5, .NET 6, .NET 7, .NET 8, .NET 9, .NET 10
|
| CLI |
.NET 8, .NET 9, .NET 10 tool assets |
Read platform compatibility for the tested runtime matrix and support definitions.
| Package | Framework range | Use it for |
|---|---|---|
@fotbiler/rulegate-client |
Framework-independent | Fail-closed snapshot storage and permission, role, or policy checks |
@fotbiler/rulegate-angular |
Angular 20–22 | Signals client, functional guards, standalone directives, TypeScript generation, optional Keycloak adapter |
@fotbiler/rulegate-angular-legacy |
Angular 12–19 | Observable client, class guard, NgModule, and legacy directives |
Angular 9–11 applications use the framework-independent client directly.
Modern Angular:
pnpm add @fotbiler/rulegate-angular@1.0.0Legacy Angular:
pnpm add @fotbiler/rulegate-angular-legacy@1.0.0Framework-independent client:
pnpm add @fotbiler/rulegate-client@1.0.0Do not install modern and legacy Angular adapters into the same application. They target different peer-dependency ranges.
Use this decision sequence:
-
ASP.NET Core host? Install
Fotbiler.RuleGate.AspNetCore. -
Keycloak role mapping? Also install
Fotbiler.RuleGate.Keycloak. - Worker, console, or custom host? Use Abstractions + Core + Manifest.
- Policy work in local development or CI? Install the CLI tool.
- Angular 20–22? Install the modern Angular package.
- Angular 12–19? Install the legacy Angular package.
- Angular 9–11 or another TypeScript framework? Install the client.
An ASP.NET Core application that loads rulegate.yaml from its content root
must publish the file:
<ItemGroup>
<Content Include="rulegate.yaml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>For immutable deployments, an embedded resource avoids a separate policy file. For configuration-driven or reloadable policies, use the source options in Policy sources and reload.
Within one ecosystem, do not mix RuleGate versions intentionally. A package manager may select transitive dependencies that work, but aligned versions make API, behavior, support, and incident investigation predictable.
<PackageReference Include="Fotbiler.RuleGate.AspNetCore" Version="1.0.0" />
<PackageReference Include="Fotbiler.RuleGate.Keycloak" Version="1.0.0" />{
"dependencies": {
"@fotbiler/rulegate-angular": "1.0.0"
}
}Commit lock files. Pin the CLI in a tool manifest. Upgrade packages and policy tests together.
Use only the official package pages linked above. RuleGate stable NuGet and npm packages contain repository metadata, MIT license metadata, README files, and package-specific payloads. npm packages publish provenance; NuGet.org adds its repository signature after acceptance.
Previous: Authorization foundations · Next: First protected API
Canonical source: docs/guide · Documentation index · RuleGate 1.0.0
- Home
- 1. Authorization foundations
- 2. Packages and installation
- 3. First protected API
- 4. Policy language
- 5. ASP.NET Core integration
- 6. Trusted attributes and context
- 7. Identity and Keycloak
- 8. Frontend integration
- 9. CLI and policy lifecycle
- 10. Testing and diagnostics
- 11. Policy sources and reload
- 12. Extensibility
- 13. Real-world recipes
- 14. Production checklist
- Glossary