[v15] feat: add regexp.match to access request filter and where expressions#40642
Merged
nklaassen merged 1 commit intobranch/v15from Apr 18, 2024
Merged
[v15] feat: add regexp.match to access request filter and where expressions#40642nklaassen merged 1 commit intobranch/v15from
regexp.match to access request filter and where expressions#40642nklaassen merged 1 commit intobranch/v15from
Conversation
…ssions This PR updates the parsers for the role `spec.allow.request.thresholds.filter` and `spec.allow.review.where` expression fields to support a new function `regexp.match(list, re)`. It follows the typical teleport style following from role templates, `where` expressions, login rules, and label expressions: - `list` can be a `[]string` or a `string` (a single string is treated as a list of length 1). - `re` can be a glob pattern like `example-*` or a proper regex like `^example-.*$` when surrounded by `^$`. Some examples are included in the docs and tests. I have switched from using `NewJSONBoolParser` to new dedicated parsers based on `typical`. These should have better performance in terms of speed and memory, be easier to extend in the future, and provide better error messages when users write invalid expressions. These were the only uses of `NewJSONBoolParser`, so it has been removed. Changelog: add `regexp.match` to access request `filter` and `where` expressions
Contributor
|
🤖 Vercel preview here: https://docs-89vimnhci-goteleport.vercel.app/docs/ver/preview |
zmb3
approved these changes
Apr 18, 2024
marcoandredinis
approved these changes
Apr 18, 2024
Merged
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.
Backport #40568 to branch/v15
changelog: Added
regexp.matchto access requestfilterandwhereexpressions