Feature request: Support depth levels in feature flag keys
Use case
Currently the key of the conditions of the feature flags only support that the values sent in the context are first level.
It would be very interesting to be able to support depth levels, like with a dot attribute access or with a string list of dictionary keys, so that for example a feature flag can be defined based on the raw content of the event without having to transform it or extract something from it.
Solution/User Experience
Context:
{
"foo": {
"bar": "premium"
}
}
Schema:
{
"premium_feature": {
"default": false,
"rules": {
"customer tier equals premium": {
"when_match": true,
"conditions": [
{
"action": "EQUALS",
"key": ["foo", "bar"],
"value": "premium"
}
]
}
}
}
}
Alternative solutions
No response
Acknowledgment
- [X] This feature request meets Powertools for AWS Lambda (Python) Tenets
- [X] Should this be considered in other Powertools for AWS Lambda languages? i.e. Java, TypeScript, and .NET
Hey @adriantomas! I'm working in some critical issues and will reply to this tomorrow, ok?
Thanks
Hey @adriantomas! I'm working in some critical issues and will reply to this tomorrow, ok?
Thanks
Sure, take your time :)
Idea... maybe we could think of using JMESPath like we use in multiple places here. We started simple because we knew customers could pluck those values before calling .evaluate. JMESPath is used in Logger (correlation ID), Idempotency, etc., and it's a string to easy ;)
Closing this issue as it's been open for a while now, and we didn't have much customer feedback. Please open a new one if it's still an issue.
⚠️COMMENT VISIBILITY WARNING⚠️
This issue is now closed. Please be mindful that future comments are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.