Skip to content

Allow a feature flag to require all registered feature filters be enabled. #192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

jimmyca15
Copy link
Member

In response to #28.

Combine feature filters with AND

By default, feature filters are evaluated using a logical OR operation. If any feature filter that is registered for a feature is enabled, then the feature is considered to be enabled. This PR adds the capability to customize this so that feature filters are combined with a logical AND operation. This means all registered feature filters would need to be enabled for the feature to be considered enabled.

Configuration

Overriding feature filter evaluation to use AND can be done by specifying the RequirementType for a given feature flag.

RequirementType

  • Any: Default. If any feature filter is enabled, the feature will be considered enabled.
  • All: Requires all feature filters to be enabled to enable a feature
{
    "FeatureManagement": {
        "FeatureFlags": {
            "MyAndFeature": {
                "RequirementType": "All",
                "EnabledFor": [
                    {
                        "Name": "Test",
                        "Parameters": {}
                    },
                    {
                        "Name": "Test2",
                        "Parameters": {}
                    }
                ]
            }
        }
    }
}

@rossgrambo
Copy link
Contributor

Closing in favor of #221

@rossgrambo rossgrambo closed this Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants