Add any and all expression support.#49
Merged
jefferai merged 9 commits intohashicorp:mainfrom Sep 11, 2023
Merged
Conversation
The syntax is inspired by Sentinel [Any, All Expressions](https://docs.hashicorp.com/sentinel/language/boolexpr#any-all-expressions) and the [For Statements](https://docs.hashicorp.com/sentinel/language/loops#for-statements). Supporting this sort of complex conditions is useful for the Vault SAML auth method.
mkeeler
reviewed
Sep 6, 2023
Member
|
Benchmarks are showing pretty big improvement with the new code. |
mkeeler
requested changes
Sep 7, 2023
Member
mkeeler
left a comment
There was a problem hiding this comment.
I left a few very minor requests but overall this is looking great.
Author
|
Here's the results I got for the benchmarks on a |
jefferai
reviewed
Sep 8, 2023
| } | ||
|
|
||
| func evaluateMatchExpression(expression *grammar.MatchExpression, datum interface{}, opt ...Option) (bool, error) { | ||
| func getValue(datum interface{}, path []string, opt ...Option) (interface{}, bool, error) { |
Member
There was a problem hiding this comment.
It'd be nice to have a comment here just detailing what this function is doing (the overall flow with the local variables).
Author
There was a problem hiding this comment.
Thanks, I added some comments now.
jefferai
reviewed
Sep 8, 2023
jefferai
reviewed
Sep 8, 2023
mkeeler
approved these changes
Sep 8, 2023
jefferai
approved these changes
Sep 8, 2023
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The syntax is inspired by Sentinel Any, All Expressions and the For Statements.
Supporting this sort of complex conditions is useful for the Vault SAML auth method.