-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: support set.add on nil sets in traits expression parser #49385
Merged
Conversation
This file contains 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
rosstimothy
approved these changes
Nov 25, 2024
hugoShaka
approved these changes
Nov 25, 2024
public-teleport-github-review-bot
bot
removed the request for review
from fheinecke
November 25, 2024 15:02
@nklaassen See the table below for backport results.
|
nklaassen
added a commit
that referenced
this pull request
Nov 25, 2024
Backport #49385 to branch/v16 This is a manual backport and a much smaller and more targeted change than the original PR, because in this branch lib/expression.Set has not been converted to use lib/utils.Set. Changelog: Fixed a potential panic in login rule and SAML IdP expression parser
nklaassen
added a commit
that referenced
this pull request
Nov 25, 2024
Backport #49385 to branch/v15 This is a manual backport and a much smaller and more targeted change than the original PR, because in this branch lib/expression.Set has not been converted to use lib/utils.Set. Changelog: Fixed a potential panic in login rule and SAML IdP expression parser
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.
Fixes https://github.com/gravitational/teleport-private/issues/1786
This PR fixes a panic in the parser used for login rules and SAML IdP attribute mapping. The panic occurs when using the
add
method on anil
set. It is possible to get anil
set when indexing a dict with a key that is not present. For example,external["groups"].add("example")
would panic if there was no"groups"
trait.These expressions can only be written by authenticated Teleport users with permission to create or edit
login_rule
orsaml_idp_service_provider
resources.Changelog: Fixed a potential panic in login rule and SAML IdP expression parser