Skip to content
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

Painless should reject assignment to special getter variables #117929

Open
rjernst opened this issue Dec 3, 2024 · 1 comment
Open

Painless should reject assignment to special getter variables #117929

rjernst opened this issue Dec 3, 2024 · 1 comment
Labels
:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache Team:Core/Infra Meta label for core/infra team

Comments

@rjernst
Copy link
Member

rjernst commented Dec 3, 2024

Painless adds additional variables into scripts based on getter present in the script context. For example, in IngestScript the getCtx() method provides for the ctx variable. Although the variable is backed by a getter and so there is clearly no assignment possible, painless does not reject overwriting the local ctx variable. To a user it appears assignment to ctx works, but in practice the change is a noop. We should block such assignment with a clear error message.

@rjernst rjernst added the :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache label Dec 3, 2024
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Dec 3, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache Team:Core/Infra Meta label for core/infra team
Projects
None yet
Development

No branches or pull requests

2 participants