Skip to content

Commit 2e08400

Browse files
authored
- Release v5.2.0
1 parent 9ab8ace commit 2e08400

File tree

31 files changed

+6558
-108
lines changed

31 files changed

+6558
-108
lines changed

CoverageResults/2f995bed-6a04-41f7-869e-8202020b2959/coverage.cobertura.xml

Lines changed: 1858 additions & 0 deletions
Large diffs are not rendered by default.

CoverageResults2/9b766267-cb66-45dc-b88c-9597939dfa8d/coverage.cobertura.xml

Lines changed: 1858 additions & 0 deletions
Large diffs are not rendered by default.

CoverageResults3/870b732e-9338-4793-ad0c-19c55d4963c8/coverage.cobertura.xml

Lines changed: 1858 additions & 0 deletions
Large diffs are not rendered by default.

DeveloperGuide.md

Lines changed: 62 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,18 @@ var feature = new Feature
9696
#### ii. Regex Condition
9797
`Regex` condition allows evaluating a regex expression against specified user claim value to enable a given feature.
9898

99-
Below is the serialized representation of toggle with regex condition.
99+
Below is the serialized representation of toggle with regex condition.
100100
```
101101
{
102-
"dashboard_widget":{
103-
"toggle":{
104-
102+
"dashboard_widget":{
103+
"toggle":{
104+
105105
"conditions":[{
106106
"type":"Regex", -- Regex Condition
107107
"claim":"email", -- Claim 'email' to be used for evaluation.
108108
"expression":"*@gbk.com" -- Regex expression to be used for evaluation.
109-
}]
110-
}
109+
}]
110+
}
111111
}
112112
}
113113
```
@@ -119,8 +119,8 @@ var feature = new Feature
119119
Name ="dashboard_widget", // Feature Name
120120
Toggle = new Toggle // Toggle definition
121121
{
122-
Operator = Operator.Any,
123-
Conditions = new[]
122+
Operator = Operator.Any,
123+
Conditions = new[]
124124
{
125125
// Regex condition that evalues role of user to be administrator to enable the feature.
126126
new RegexCondition { Claim = "role", Expression = "administrator" }
@@ -129,6 +129,60 @@ var feature = new Feature
129129
}
130130
```
131131

132+
#### iii. Relational Condition
133+
`Relational` condition (class `RelationalCondition`) allows evaluating a user claim value against a fixed value using a relational operator. This is useful for enabling features based on user tiers, roles, or any string-comparable claim.
134+
135+
Supported operators (`RelationalOperator` enum):
136+
137+
| Operator | Description |
138+
|---|---|
139+
| `Equals` | Claim value equals the configured value |
140+
| `NotEquals` | Claim value does not equal the configured value |
141+
| `GreaterThan` | Claim value is lexicographically greater than the configured value |
142+
| `GreaterThanOrEqual` | Claim value is lexicographically greater than or equal to the configured value |
143+
| `LessThanOrEqual` | Claim value is lexicographically less than or equal to the configured value |
144+
| `LessThan` | Defined in enum but **not yet implemented** — always returns `false` |
145+
146+
> **Note:** String comparison is ordinal (via `string.Compare`). Both the claim value and the configured value are trimmed of leading/trailing whitespace before comparison.
147+
148+
Below is the serialized representation of a toggle with a logical condition.
149+
```
150+
{
151+
"dashboard_widget":{
152+
"toggle":{
153+
"operator":"any",
154+
"conditions":[{
155+
"type":"Relational", -- Relational Condition
156+
"claim":"tier", -- Claim name to evaluate
157+
"operator":"GreaterThanOrEqual", -- Relational operator
158+
"value":"gold" -- Value to compare the claim against
159+
}]
160+
}
161+
}
162+
}
163+
```
164+
C# representation of a feature with a logical condition toggle is
165+
```
166+
var feature = new Feature
167+
{
168+
Name = "dashboard_widget", // Feature Name
169+
Toggle = new Toggle // Toggle definition
170+
{
171+
Operator = Operator.Any,
172+
Conditions = new[]
173+
{
174+
// Relational condition — enable feature for users with tier >= "gold" (lexicographic order).
175+
new RelationalCondition
176+
{
177+
Claim = "tier",
178+
Operator = RelationalOperator.GreaterThanOrEqual,
179+
Value = "gold"
180+
}
181+
}
182+
}
183+
}
184+
```
185+
132186
### Step 3. Implement Storage Provider.
133187
To use FeatureOne, you need to provide implementation for `Storage Provider` to get all the feature toggles from storage medium of choice.
134188
Implement `IStorageProvider` interface to return feature toggles from storage.

GitVersion.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
next-version: 5.1.0
1+
next-version: 5.2.0
22
tag-prefix: '[vV]'
33
mode: ContinuousDeployment
44
branches:

License.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2025 Code Shayk
3+
Copyright (c) 2026 Code Shayk
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
2-
# <img src="https://github.com/CodeShayk/FeatureOne/blob/master/images/feature-flag.png" alt="feature" style="width:60px;"/> FeatureOne v5.1.0
1+
# <img src="https://github.com/CodeShayk/FeatureOne/blob/master/images/feature-flag.png" alt="feature-flag" style="width:60px;"/> FeatureOne v5.2.0
32
[![GitHub Release](https://img.shields.io/github/v/release/CodeShayk/FeatureOne?logo=github&sort=semver)](https://github.com/CodeShayk/FeatureOne/releases/latest)
43
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/CodeShayk/FeatureOne/blob/master/License.md) [![build-master](https://github.com/CodeShayk/FeatureOne/actions/workflows/Build-Master.yml/badge.svg)](https://github.com/CodeShayk/FeatureOne/actions/workflows/Build-Master.yml)
54
[![CodeQL](https://github.com/CodeShayk/FeatureOne/actions/workflows/codeql.yml/badge.svg)](https://github.com/CodeShayk/FeatureOne/actions/workflows/codeql.yml)
6-
[![.Net](https://img.shields.io/badge/.Net_Framework-4.6.2-blue)](https://dotnet.microsoft.com/en-us/download/dotnet-framework/net46)
7-
[![.Net](https://img.shields.io/badge/.Net_Standard-2.1-blue)](https://dotnet.microsoft.com/en-us/download/netstandard/2.1)
5+
[![.Net](https://img.shields.io/badge/.Net_Standard-2.1-green)](https://dotnet.microsoft.com/en-us/download/netstandard/2.1)
86
[![.Net](https://img.shields.io/badge/.Net-9.0-blue)](https://dotnet.microsoft.com/en-us/download/dotnet/9.0)
7+
[![.Net](https://img.shields.io/badge/.Net-10.0-blue)](https://dotnet.microsoft.com/en-us/download/dotnet/10.0)
98

109
.Net Library to implement feature toggles.
1110
--
1211
#### Nuget Packages
1312
| Package | Latest | Details |
1413
| --------| --------| --------|
15-
|FeatureOne |[![NuGet version](https://badge.fury.io/nu/FeatureOne.svg)](https://badge.fury.io/nu/FeatureOne) | Provides core functionality to implement feature toggles with `no` backend storage provider. Needs package consumer to provide `IStorageProvider` implementation. Ideal for use case that requires custom storage backend. **v5.1.0**: Security fixes, DI integration, DateRangeCondition. |
16-
|FeatureOne.SQL| [![NuGet version](https://badge.fury.io/nu/FeatureOne.SQL.svg)](https://badge.fury.io/nu/FeatureOne.SQL) | Provides SQL storage provider for implementing feature toggles using `SQL` backend. **v5.1.0**: Security fixes, DI integration, enhanced configuration. |
17-
|FeatureOne.File |[![NuGet version](https://badge.fury.io/nu/FeatureOne.File.svg)](https://badge.fury.io/nu/FeatureOne.File) | Provides File storage provider for implementing feature toggles using `File System` backend. **v5.1.0**: Security fixes, DI integration, enhanced configuration. |
14+
|FeatureOne |[![NuGet version](https://badge.fury.io/nu/FeatureOne.svg)](https://badge.fury.io/nu/FeatureOne) | Provides core functionality to implement feature toggles with `no` backend storage provider. Needs package consumer to provide `IStorageProvider` implementation. Ideal for use case that requires custom storage backend. **v5.2.0**: RelationalCondition, net10.0 support, package upgrades, expanded test coverage. |
15+
|FeatureOne.SQL| [![NuGet version](https://badge.fury.io/nu/FeatureOne.SQL.svg)](https://badge.fury.io/nu/FeatureOne.SQL) | Provides SQL storage provider for implementing feature toggles using `SQL` backend. **v5.2.0**: net10.0 support, package upgrades. |
16+
|FeatureOne.File |[![NuGet version](https://badge.fury.io/nu/FeatureOne.File.svg)](https://badge.fury.io/nu/FeatureOne.File) | Provides File storage provider for implementing feature toggles using `File System` backend. **v5.2.0**: net10.0 support, package upgrades. |
1817

1918
## Concept
2019
### What is a feature toggle?
@@ -62,6 +61,8 @@ The following previous versions are available:
6261

6362
| Version | Release Notes |
6463
| ----------------------------------------------------------------| ----------------------------------------------------------------------|
64+
| [`v5.2.0`](https://github.com/CodeShayk/FeatureOne/tree/v5.2.0) | [Notes](https://github.com/CodeShayk/FeatureOne/releases/tag/v5.2.0) |
65+
| [`v5.1.0`](https://github.com/CodeShayk/FeatureOne/tree/v5.1.0) | [Notes](https://github.com/CodeShayk/FeatureOne/releases/tag/v5.1.0) |
6566
| [`v5.0.0`](https://github.com/CodeShayk/FeatureOne/tree/v5.0.0) | [Notes](https://github.com/CodeShayk/FeatureOne/releases/tag/v5.0.0) |
6667
| [`v4.0.0`](https://github.com/CodeShayk/FeatureOne/tree/v4.0.0) | [Notes](https://github.com/CodeShayk/FeatureOne/releases/tag/v4.0.0) |
6768
| [`v3.0.0`](https://github.com/CodeShayk/FeatureOne/tree/v3.0.0) | [Notes](https://github.com/CodeShayk/FeatureOne/releases/tag/v3.0.0) |
@@ -73,6 +74,7 @@ The following previous versions are available:
7374
|--------|-------------|------|-------------|---------------------|
7475
| v5.0.0 | Previous | Initial | Core feature toggle functionality | N/A (Initial release) |
7576
| v5.1.0 | Nov 03, 2025 | Minor | **Security fixes** (ReDoS protection, secure type loading), **architectural improvements** (prefix matching, dependency injection), **new features** (DateRangeCondition, configuration validation), **DI integration** | High - maintains all existing functionality with minor security-related behavioral changes |
77+
| v5.2.0 | Mar 18, 2026 | Minor | **New condition** (RelationalCondition with 5 relational operators), **target framework** (added net10.0, removed netstandard2.0 and net8.0), **package upgrades** (all MS packages to 10.0.5), **expanded test coverage** (98%+ line coverage) | High - fully backward compatible, additive changes only |
7678

7779
## Credits
7880
Thank you for reading. Please fork, explore, contribute and report. Happy Coding !! :)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<coverage line-rate="0" branch-rate="0" version="1.9" timestamp="1773873205" lines-covered="0" lines-valid="0" branches-covered="0" branches-valid="0">
3+
<sources />
4+
<packages />
5+
</coverage>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<CoverageSession>
3+
<Summary numSequencePoints="0" visitedSequencePoints="0" numBranchPoints="0" visitedBranchPoints="0" sequenceCoverage="0" branchCoverage="0" maxCyclomaticComplexity="1" minCyclomaticComplexity="1" visitedClasses="0" numClasses="0" visitedMethods="0" numMethods="0" />
4+
<Modules />
5+
</CoverageSession>

src/FeatureOne.File/FeatureOne.File.csproj

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net462;netstandard2.1;net9.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.1;net9.0;net10.0</TargetFrameworks>
55
<Nullable>disable</Nullable>
66
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
77
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
@@ -22,25 +22,22 @@
2222
<RepositoryUrl>https://github.com/codeshayk/FeatureOne</RepositoryUrl>
2323
<RepositoryType>git</RepositoryType>
2424
<PackageTags>feature-toggle; feature-flag; feature-flags; feature-toggles; featureOne; File-system; File-Backend; File-Toggles;</PackageTags>
25-
<Version>5.1.0</Version>
25+
<Version>5.2.0</Version>
2626
<PackageLicenseFile>License.md</PackageLicenseFile>
27-
<PackageIcon>ninja-icon-16.png</PackageIcon>
27+
<PackageIcon>feature-flag.png</PackageIcon>
2828
<PackageReleaseNotes>
29-
Release Notes v5.1.0. - Targets .Net Framework 4.6.2, .NetStandard 2.1 and .Net 9.0
29+
Release Notes v5.2.0. - Targets .NetStandard 2.1, .Net 9.0 and .Net 10.0
3030
Library to Implement Feature Toggles to hide/show program features with File system storage.
31-
Security Fixes:
32-
- Fixed RegexCondition ReDoS (Regular Expression Denial of Service) vulnerability with timeout validation
33-
- Secured dynamic type loading in ConditionDeserializer with explicit safe type registry
34-
35-
Architectural Improvements:
36-
- Fixed FindStartsWith implementation for actual prefix matching
37-
- Implemented proper dependency injection patterns with null validation
38-
31+
3932
New Features:
40-
- Added DateRangeCondition for time-based feature toggles
41-
- Added Configuration Validation System with clear error messages
42-
43-
Provides Out of box Simple and Regex toggle conditions.
33+
- Added RelationalCondition for claim-based relational comparisons (Equals, NotEquals, GreaterThan, GreaterThanOrEqual, LessThanOrEqual)
34+
35+
Framework and Package Updates:
36+
- Added net10.0 target framework
37+
- Removed netstandard2.0 and net8.0 target frameworks
38+
- Upgraded all Microsoft packages to 10.0.5
39+
40+
Provides Out of box Simple, Regex, DateRange and Relational toggle conditions.
4441
Provides Out of box support for File system storage provider to store toggles on disk file.
4542
Provides the support for default memory caching via configuration.
4643
Provides extensibility for custom implementations ie.
@@ -56,7 +53,7 @@
5653
<Pack>True</Pack>
5754
<PackagePath>\</PackagePath>
5855
</None>
59-
<None Include="..\..\ninja-icon-16.png">
56+
<None Include="..\..\images\feature-flag.png">
6057
<Pack>True</Pack>
6158
<PackagePath>\</PackagePath>
6259
</None>
@@ -71,8 +68,7 @@
7168
</ItemGroup>
7269

7370
<ItemGroup>
74-
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
75-
<PackageReference Include="System.IO.FileSystem" Version="4.3.0" />
71+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.5" />
7672
</ItemGroup>
7773

7874
</Project>

0 commit comments

Comments
 (0)