Skip to content

[v15] feat: add regexp.match to access request filter and where expressions#40642

Merged
nklaassen merged 1 commit intobranch/v15from
bot/backport-40568-branch/v15
Apr 18, 2024
Merged

[v15] feat: add regexp.match to access request filter and where expressions#40642
nklaassen merged 1 commit intobranch/v15from
bot/backport-40568-branch/v15

Conversation

@nklaassen
Copy link
Copy Markdown
Contributor

@nklaassen nklaassen commented Apr 18, 2024

Backport #40568 to branch/v15

changelog: Added regexp.match to access request filter and where expressions

…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
@github-actions
Copy link
Copy Markdown
Contributor

🤖 Vercel preview here: https://docs-89vimnhci-goteleport.vercel.app/docs/ver/preview

@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from ptgott April 18, 2024 08:12
@nklaassen nklaassen added this pull request to the merge queue Apr 18, 2024
Merged via the queue into branch/v15 with commit ed80764 Apr 18, 2024
@nklaassen nklaassen deleted the bot/backport-40568-branch/v15 branch April 18, 2024 21:26
@camscale camscale mentioned this pull request Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants