Skip to content

Commit d8a39ac

Browse files
committed
- Release v5.2.0
1 parent b1da634 commit d8a39ac

32 files changed

Lines changed: 6559 additions & 107 deletions

File tree

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 & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11

2-
# <img src="https://github.com/CodeShayk/FeatureOne/blob/master/ninja-icon-16.png" alt="ninja" style="width:30px;"/> FeatureOne v5.1.0
2+
# <img src="https://github.com/CodeShayk/FeatureOne/blob/master/images/feature-flag.png" alt="feature-flag" style="width:30px;"/> FeatureOne v5.2.0
33
[![GitHub Release](https://img.shields.io/github/v/release/CodeShayk/FeatureOne?logo=github&sort=semver)](https://github.com/CodeShayk/FeatureOne/releases/latest)
44
[![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)
55
[![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)
6+
[![.Net](https://img.shields.io/badge/.Net_Standard-2.1-green)](https://dotnet.microsoft.com/en-us/download/netstandard/2.1)
87
[![.Net](https://img.shields.io/badge/.Net-9.0-blue)](https://dotnet.microsoft.com/en-us/download/dotnet/9.0)
8+
[![.Net](https://img.shields.io/badge/.Net-10.0-blue)](https://dotnet.microsoft.com/en-us/download/dotnet/10.0)
99

1010
.Net Library to implement feature toggles.
1111
--
1212
#### Nuget Packages
1313
| Package | Latest | Details |
1414
| --------| --------| --------|
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. |
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.2.0**: RelationalCondition, net10.0 support, package upgrades, expanded test coverage. |
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.2.0**: net10.0 support, package upgrades. |
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.2.0**: net10.0 support, package upgrades. |
1818

1919
## Concept
2020
### What is a feature toggle?
@@ -62,6 +62,8 @@ The following previous versions are available:
6262

6363
| Version | Release Notes |
6464
| ----------------------------------------------------------------| ----------------------------------------------------------------------|
65+
| [`v5.2.0`](https://github.com/CodeShayk/FeatureOne/tree/v5.2.0) | [Notes](https://github.com/CodeShayk/FeatureOne/releases/tag/v5.2.0) |
66+
| [`v5.1.0`](https://github.com/CodeShayk/FeatureOne/tree/v5.1.0) | [Notes](https://github.com/CodeShayk/FeatureOne/releases/tag/v5.1.0) |
6567
| [`v5.0.0`](https://github.com/CodeShayk/FeatureOne/tree/v5.0.0) | [Notes](https://github.com/CodeShayk/FeatureOne/releases/tag/v5.0.0) |
6668
| [`v4.0.0`](https://github.com/CodeShayk/FeatureOne/tree/v4.0.0) | [Notes](https://github.com/CodeShayk/FeatureOne/releases/tag/v4.0.0) |
6769
| [`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 +75,7 @@ The following previous versions are available:
7375
|--------|-------------|------|-------------|---------------------|
7476
| v5.0.0 | Previous | Initial | Core feature toggle functionality | N/A (Initial release) |
7577
| 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 |
78+
| 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 |
7679

7780
## Credits
7881
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>

images/feature-flag.png

30 KB
Loading

0 commit comments

Comments
 (0)