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

Add unit tests for $$ appearing within policy inputs #5097

Merged
merged 8 commits into from
Jul 19, 2024

Conversation

michel-laterman
Copy link
Contributor

@michel-laterman michel-laterman commented Jul 9, 2024

What does this PR do?

Add unit tests for special characters, mainly the escape sequence of $$ in the transpiler, and input parsing of policies.

Why is it important?

Secrets are being incorrectly formatted when they contain these characters.
This also applies to any key: value pair the user specifies in the fleet-ui.

Testing found that this is caused by the UI escaping $$ to $; but we should have unit tests in the agent to ensure we don't inadvertently introduce a regression.

Related issues

@michel-laterman michel-laterman added bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team labels Jul 9, 2024
Copy link
Contributor

mergify bot commented Jul 9, 2024

This pull request does not have a backport label. Could you fix it @michel-laterman? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 8./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip label Jul 9, 2024
@michel-laterman michel-laterman added technical debt and removed bug Something isn't working labels Jul 15, 2024
@michel-laterman michel-laterman changed the title wip: validate policy with special characters Add unit tests for $$ appearing within policy inputs Jul 15, 2024
@michel-laterman michel-laterman marked this pull request as ready for review July 15, 2024 22:58
@michel-laterman michel-laterman requested a review from a team as a code owner July 15, 2024 22:58
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@ycombinator ycombinator requested review from andrzej-stencel and removed request for blakerouse July 16, 2024 14:27
Copy link

@pierrehilbert
Copy link
Contributor

Skipping the changelog check as this PR is only adding Unit Tests

@michel-laterman michel-laterman merged commit 482eecb into elastic:main Jul 19, 2024
13 of 14 checks passed
@michel-laterman michel-laterman deleted the special-chars branch July 19, 2024 14:56
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.

4 participants