-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
updates doc on action parameter variable mustache escaping #88521
updates doc on action parameter variable mustache escaping #88521
Conversation
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
||
- for the <<email-action-type, Email>> connector, the `message` action configuration property escapes any characters that would be interpreted as Markdown | ||
- for the <<slack-action-type, Slack>> connector, the `message` action configuration property escapes any characters that would be interpreted as Slack markdown | ||
- for the <<webhook-action-type, Webhook>> connector, the `body` action configuration property escapes any characters that are invalid in JSON string values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I'd understand what action configuration property means if I came in without knowledge of the framework internals.
Perhaps we should just call it the message
field? Or something like that, as it's a form field which the user inputs at creation, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
heh, ya, I was working from the docs, where action "params" wasn't referred to as params, but a property, and so the resulting word salad was a bit unwieldy. Will wordsmith that one a bit more, see if I can find other references to a param like that somewhere ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Poking around the docs, action params seem to be referred to as "Action configuration" in the docs, and such references refer to the enclosed "properties":
So, unless we want to use some brand new terminology, I think "action configuration property" is probably the right choice. cc: @gchaps ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++ to "action configuration property"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@elasticmachine merge upstream |
|
||
[role="screenshot"] | ||
image::images/alert-flyout-action-variables.png[Passing alert values to an action] | ||
|
||
There are some cases where the variable values will be "escaped", when used in a context where escaping is needed: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some cases where the variable values will be "escaped", when used in a context where escaping is needed: | |
Some cases exist where the variable values will be "escaped", when used in a context where escaping is needed: |
|
||
[role="screenshot"] | ||
image::images/alert-flyout-action-variables.png[Passing alert values to an action] | ||
|
||
There are some cases where the variable values will be "escaped", when used in a context where escaping is needed: | ||
|
||
- for the <<email-action-type, Email>> connector, the `message` action configuration property escapes any characters that would be interpreted as Markdown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- for the <<email-action-type, Email>> connector, the `message` action configuration property escapes any characters that would be interpreted as Markdown | |
- For the <<email-action-type, Email>> connector, the `message` action configuration property escapes any characters that would be interpreted as Markdown. |
There are some cases where the variable values will be "escaped", when used in a context where escaping is needed: | ||
|
||
- for the <<email-action-type, Email>> connector, the `message` action configuration property escapes any characters that would be interpreted as Markdown | ||
- for the <<slack-action-type, Slack>> connector, the `message` action configuration property escapes any characters that would be interpreted as Slack markdown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- for the <<slack-action-type, Slack>> connector, the `message` action configuration property escapes any characters that would be interpreted as Slack markdown | |
- For the <<slack-action-type, Slack>> connector, the `message` action configuration property escapes any characters that would be interpreted as Slack Markdown. |
|
||
- for the <<email-action-type, Email>> connector, the `message` action configuration property escapes any characters that would be interpreted as Markdown | ||
- for the <<slack-action-type, Slack>> connector, the `message` action configuration property escapes any characters that would be interpreted as Slack markdown | ||
- for the <<webhook-action-type, Webhook>> connector, the `body` action configuration property escapes any characters that are invalid in JSON string values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- for the <<webhook-action-type, Webhook>> connector, the `body` action configuration property escapes any characters that are invalid in JSON string values | |
- For the <<webhook-action-type, Webhook>> connector, the `body` action configuration property escapes any characters that are invalid in JSON string values. |
|
||
- for the <<email-action-type, Email>> connector, the `message` action configuration property escapes any characters that would be interpreted as Markdown | ||
- for the <<slack-action-type, Slack>> connector, the `message` action configuration property escapes any characters that would be interpreted as Slack markdown | ||
- for the <<webhook-action-type, Webhook>> connector, the `body` action configuration property escapes any characters that are invalid in JSON string values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++ to "action configuration property"
…8521) Provides more detail on mustache variable escaping within action parameter templates.
…8521) Provides more detail on mustache variable escaping within action parameter templates.
resolves #87933
Summary
Updates the docs discussing action parameter templating with mustache, and the escaping of values during the rendering of the templates. The text being replaced mentioned HTML escaping, but as of PR #83919, we no longer ever do HTML escaping, but do some action type-specific escaping for some action parameters, described in this PR.
Checklist
Delete any items that are not applicable to this PR.