Skip to content

Feature Flags -- IN does not appear to work #699

Closed
@gwlester

Description

@gwlester

We were attempting to enable a feature if a user was in a given group?
Configuration:

{
  "unhidden": {
    "default": false,
    "rules": {
      "Allow Admins": {
        "when_match": true,
        "conditions": [
          {
            "action": "IN",
            "key": "enterpriseGroups",
            "value": "Ent_Agents"
          }
        ]
      }
    }
  },
  "hidden": {
    "default": false
  }
}

Context:

{
   "username":"NRavuru@msaqa.local",
   "enterpriseGroups":[
      "Ent_Agents Only-Admin",
      "Ent_Scout-SSO",
      "Ent_Agents",
      "ENT_Nuxeo_SSO_Dev",
      "Ent_PropView-SSO",
      "Ent_Bonds-SSO",
      "Ent_PMTAgentDashboard-PaymentROTP",
      "Ent_Agents-Independent",
      "Ent_E1PQADashboard-SSO",
      "Ent_Nuxeo-SSO-Preprod-General",
      "ENT_FusionPC-MSA-Producer-CSR-Preprod"
   ],
   "agencyOnlyGroups":[
      "SuperAdmin"
   ],
   "locationCodes":["180032","280473","320074",]
}
all_features: list[str] = feature_flags.get_enabled_features(context=context)

Expected Behavior

We expected the variable all_features to be a list with one element as follows:

  • unhidden

Current Behavior

all_features is an empty list.

Possible Solution

Steps to Reproduce (for bugs)

  1. see details above.

Environment

  • Powertools version used: 1.20.2
  • Packaging format (Layers, PyPi): Layers
  • AWS Lambda function runtime: 3.8
  • Debugging logs

How to enable debug mode**

# paste logs here

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedCould use a second pair of eyes/handsp1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions