BarakoCMS.FeatureFlags
4.3.2
dotnet add package BarakoCMS.FeatureFlags --version 4.3.2
NuGet\Install-Package BarakoCMS.FeatureFlags -Version 4.3.2
<PackageReference Include="BarakoCMS.FeatureFlags" Version="4.3.2" />
<PackageVersion Include="BarakoCMS.FeatureFlags" Version="4.3.2" />
<PackageReference Include="BarakoCMS.FeatureFlags" />
paket add BarakoCMS.FeatureFlags --version 4.3.2
#r "nuget: BarakoCMS.FeatureFlags, 4.3.2"
#:package BarakoCMS.FeatureFlags@4.3.2
#addin nuget:?package=BarakoCMS.FeatureFlags&version=4.3.2
#tool nuget:?package=BarakoCMS.FeatureFlags&version=4.3.2
<div align="center"> <img src="https://raw.githubusercontent.com/BaryoDev/barakoCMS/master/assets/icon.png" width="96" height="96" alt="BarakoCMS.FeatureFlags logo" /> <h1>BarakoCMS.FeatureFlags</h1> <p><em>Ship it dark, turn it on for some people, then everyone.</em></p> </div>
Create a flag, toggle it, and target it — by tenant, by user, or by percentage rollout. Flags are global with per-tenant targeting, and every decision is made server-side.
Enable it
dotnet add package BarakoCMS.FeatureFlags
builder.Services.AddBarakoCMS(builder.Configuration);
var app = builder.Build();
app.UseBarakoCMS();
The package reference plus a restart is the install. AddBarakoCMS finds every module in the
application's dependency context, and BarakoCMS:Modules:Enabled decides which of them run
(BarakoCMS__Modules__Enabled=FeatureFlags). Unset, every referenced module runs and the API logs
one warning saying so. To name it by hand instead, put
modules.Add(new BarakoCMS.FeatureFlags.FeatureFlagsModule())
in the AddBarakoCMS callback; discovery skips a type the host already added. See MODULES.md in
the repository.
Endpoints
| Method & path | Purpose | Access |
|---|---|---|
GET /api/feature-flags |
Flags as evaluated for the caller | Anyone (public flags only until signed in) |
GET /api/feature-flags/admin |
Every flag with its targeting rules | Admin / SuperAdmin held as a global role |
POST /api/feature-flags/admin |
Create or update a flag | Admin / SuperAdmin held as a global role |
POST /api/feature-flags/admin/{key}/toggle |
Flip a flag | Admin / SuperAdmin held as a global role |
DELETE /api/feature-flags/admin/{key} |
Remove a flag | Admin / SuperAdmin held as a global role |
Flags are global and their targeting names tenants, so the admin routes answer 403 to an Admin whose role comes only from a tenant membership.
GET /api/feature-flags returns decisions, not rules — the client never learns why it was included,
and cannot flip itself in by editing a response.
Public flags
A flag is private until someone publishes it. GET /api/feature-flags is anonymous, because a public
page rendering with flags has no user to authenticate, so an anonymous caller is handed only the flags
with isPublic: true. Everything else is absent from the response, not returned as false: the key
name is the leak, and {"acquisition-of-northwind": false} gives it away just as thoroughly.
Publish one deliberately:
POST /api/feature-flags/admin
{ "key": "new-checkout", "enabled": true, "isPublic": true }
isPublic defaults to false, and the admin upsert replaces the whole flag, so a body that omits the
field makes the flag private. Flags created before this field existed read back as private, which is
why upgrading discloses nothing that was not already meant to be public.
A flag is not access control
Use a flag to decide whether a feature is available. Keep using roles to decide whether a caller is allowed. A flag that hides an admin button still leaves the endpoint reachable.
Part of barakoCMS
This is an optional module for barakoCMS, an open-source
headless CMS for .NET 10. Every module is published under the barakocms-module tag, so a single
search on nuget.org returns the whole set.
Contributions are welcome — including a module icon or other design work. See CONTRIBUTING.md.
Licensed under MPL-2.0.
If barakoCMS is useful to you, a star on the repository helps other people find it.
| 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
- AspNetCore.HealthChecks.Npgsql (>= 9.0.0)
- AspNetCore.HealthChecks.System (>= 9.0.0)
- AspNetCore.HealthChecks.UI (>= 9.0.0)
- AspNetCore.HealthChecks.UI.Client (>= 9.0.0)
- AspNetCore.HealthChecks.UI.InMemory.Storage (>= 9.0.0)
- BarakoCMS (>= 4.6.0)
- BarakoCMS.Abstractions (>= 4.6.0)
- BCrypt.Net-Next (>= 4.2.0)
- FastEndpoints (>= 8.3.0)
- FastEndpoints.Security (>= 8.3.0)
- FastEndpoints.Swagger (>= 8.3.0)
- IdentityModel (>= 7.0.0)
- JasperFx (>= 2.75.2)
- KubernetesClient (>= 18.0.13)
- Marten (>= 9.40.0)
- Microsoft.Extensions.DependencyModel (>= 10.0.12)
- Microsoft.Extensions.Http.Resilience (>= 10.10.0)
- Microsoft.IdentityModel.JsonWebTokens (>= 8.23.0)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.19.1)
- OpenTelemetry.Extensions.Hosting (>= 1.19.1)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.19.0)
- OpenTelemetry.Instrumentation.Http (>= 1.19.0)
- Otp.NET (>= 1.4.1)
- prometheus-net.AspNetCore (>= 8.2.1)
- Serilog.AspNetCore (>= 10.0.0)
- Serilog.Sinks.Console (>= 6.1.1)
- Serilog.Sinks.File (>= 7.0.0)
- System.IdentityModel.Tokens.Jwt (>= 8.23.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.