microsoft / microsoft/FeatureManagement-Dotnet

Targeting should support claims on top of existing user id & group targeting

Open
#282 2 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C#
Stars
1.2k
Forks
129
Avg merge
1d 1h
Merged PRs (30d)
5

Description

The targeting filter supports targeting specific users and groups. Sometimes a user may carry targetable information that is not a group. For example location and user agent. Targeting should be able to act on this information.

With this approach, group targeting can be viewed as a subset of claim targeting where the claim name is "Group".

Proposal

Add IEnumerable<Claim> to TargetingContext

class TargetingContext
{
    string UserId { get; set; }

    IEnumerable<string> Groups { get; set; }

    IEnumerable<Claim> Claims { get; set; }
}

class Claim
{
    string Name { get; set; }

    string Value { get; set; }
}

Update targeting parameters to support claim targeting.

{
    "MyFeature": {
        "EnabledFor": [
            {
                "Name": "Targeting",
                "Parameters": {
                    "Audience": {
                        "Claims": [
                            "Name": "Location",
                            "Value": "East US",
                            "RolloutPercentage": 20
                        ]
                    }
                }
            }
        ]
    }
}

In the aforementioned example, 20% of users with that have a claim with name Location and value East US will be targeted.

Exclusion

Additionally, exclusion should be supported based on claims.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing TargetingContext and targeting-parameter handling described in the issue, then trace how user IDs and groups are evaluated. Define the claim model and configuration behavior, including claim-based exclusion, and verify that the proposed targeting and rollout semantics are covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.