boundary icon indicating copy to clipboard operation
boundary copied to clipboard

Filtering by `<Selector> in ["<Value 1>", "<Value 2>", ...]`

Open zx8 opened this issue 4 years ago • 3 comments

I know it's possible to filter by "<Value>" in <Selector>, but is there a way to do the opposite?

Currently I'm doing the following, which is a bit tedious:

"/userinfo/email" == "[email protected]" or "/userinfo/email" == "[email protected]" or "/userinfo/email" == "[email protected]"

It would be a lot easier to be able to do something like:

"/userinfo/email" in ["[email protected]", "[email protected]", "[email protected]"]

Ref. https://www.boundaryproject.io/docs/concepts/filtering

zx8 avatar Dec 20 '21 11:12 zx8

You can use matches with a regex. Something like this should work:

"/userinfo/email" matches "(foo|bar|baz)@example.com"

jefferai avatar Jan 05 '22 15:01 jefferai

Hi @zx8 , just following up on this issue and was wondering if @jefferai's suggestion worked for you?

xingluw avatar May 02 '22 16:05 xingluw

@xingluw While it works, I feel it's a little error prone, given you have to be careful with escaping (e.g. \. vs .) or risk over-granting access. For now, I am sticking to the [...] or [...] or [...] syntax because it is safer.

I still think this is a valid request, but I'll leave it up to you to determine whether it's important enough to action. If not, feel free to close and I'll continue using or.

zx8 avatar May 04 '22 08:05 zx8

I think it's interesting...the grammar doesn't support that now, but could

jefferai avatar Oct 17 '22 21:10 jefferai

Note: https://github.com/hashicorp/go-bexpr/pull/28

jefferai avatar Nov 30 '22 19:11 jefferai

Will leave this open to see if there is more demand for implementing this new potential change

xingluw avatar Dec 06 '22 01:12 xingluw

Closing as this is 2 years old without any movement.

zx8 avatar Dec 09 '23 03:12 zx8