-
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
[Alerting] allow email action to not require auth #60839
Conversation
resolves elastic#57143 Currently, the built-in email action requires user/password properties to be set in it's secrets parameters. This PR changes that requirement, so they are no longer required.
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
@@ -20,10 +19,10 @@ import { ActionsConfigurationUtilities } from '../actions_config'; | |||
export type ActionTypeConfigType = TypeOf<typeof ConfigSchema>; | |||
|
|||
const ConfigSchemaProps = { | |||
service: nullableType(schema.string()), |
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.
the nullableType
function was a pre-cursor to having schema.nullable()
available, so I removed it here.
It's not clear to me that this is a complete solution for using the cloud relay mail server, as I tested this with some "stand alone" smtp server (eg, The changes in the PR are a first step in the right direction though, and could work in some environments. |
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.
Code LGTM
@elasticmachine merge upstream |
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 think that we should handle a validation case, when user entered a user name and didn't set a password like we do for Webhook. With current changes I'm able to set password only or user only value and successfully save.
} | ||
) | ||
); | ||
} |
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.
Maybe it makes sense to do like we have for a webhook:
if (!action.secrets.user && action.secrets.password) {
errors.user.push(
i18n.translate(
'xpack.triggersActionsUI.sections.addAction.webhookAction.error.requiredHostText',
{
defaultMessage: 'Username is required.',
}
)
);
}
if (!action.secrets.password && action.secrets.user) {
errors.password.push(
i18n.translate(
'xpack.triggersActionsUI.sections.addAction.webhookAction.error.requiredPasswordText',
{
defaultMessage: 'Password is required.',
}
)
);
}
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.
makes sense, I'll do that
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.
Changes LGTM!
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
resolves elastic#57143 Currently, the built-in email action requires user/password properties to be set in it's secrets parameters. This PR changes that requirement, so they are no longer required.
* master: (34 commits) [APM] add service map config options to legacy plugin (elastic#61002) [App Arch] migrate legacy CSS to new platform (core_plugins/kibana_react) (elastic#59882) Migrated styles for "share" plugin to new platform (elastic#59981) [ML] Module setup with dynamic model memory estimation (elastic#60656) Drilldowns (elastic#59632) Upgrade mocha dev-dependency from 6.2.2 to 7.1.1 (elastic#60779) [SIEM] Overview: Recent cases widget (elastic#60993) [ML] Functional tests - stabilize df analytics clone tests (elastic#60497) [SIEM] Updates process and TLS tables to use ECS 1.5 fields (elastic#60854) Migrate doc view part of discover (elastic#58094) Revert "[APM] Collect telemetry about data/API performance (elastic#51612)" fix(NA): log rotation watchers usage (elastic#60956) [SIEM] [CASES] Build lego blocks case details view (elastic#60864) Create Painless Lab app (elastic#57538) [SIEM] Move Timeline Template field to first step of rule creation (elastic#60840) [Reporting/New Platform Migration] Use a new config service on server-side (elastic#55882) [Alerting] allow email action to not require auth (elastic#60839) [Maps] Default ES document layer scaling type to clusters and show scaling UI in the create wizard (elastic#60668) [APM] Collect telemetry about data/API performance (elastic#51612) Implement Kibana Login Selector (elastic#53010) ...
PR elastic#60839 added support for unauthenticated emails, but didn't actually do enough to make it work. This PR completes that support, and adds some tests. You can do manual testing now with [maildev](http://maildev.github.io/maildev/).
PR #60839 added support for unauthenticated emails, but didn't actually do enough to make it work. This PR completes that support, and adds some tests. You can do manual testing now with [maildev](http://maildev.github.io/maildev/).
…c#63086) PR elastic#60839 added support for unauthenticated emails, but didn't actually do enough to make it work. This PR completes that support, and adds some tests. You can do manual testing now with [maildev](http://maildev.github.io/maildev/).
…c#63086) PR elastic#60839 added support for unauthenticated emails, but didn't actually do enough to make it work. This PR completes that support, and adds some tests. You can do manual testing now with [maildev](http://maildev.github.io/maildev/).
#63412) PR #60839 added support for unauthenticated emails, but didn't actually do enough to make it work. This PR completes that support, and adds some tests. You can do manual testing now with [maildev](http://maildev.github.io/maildev/).
#63411) PR #60839 added support for unauthenticated emails, but didn't actually do enough to make it work. This PR completes that support, and adds some tests. You can do manual testing now with [maildev](http://maildev.github.io/maildev/).
PR #60839 added support for unauthenticated emails, but didn't actually do enough to make it work. This PR completes that support, and adds some tests. You can do manual testing now with [maildev](http://maildev.github.io/maildev/).
resolves #57143
Currently, the built-in email action requires user/password properties to be
set in it's secrets parameters. This PR changes that requirement, so they
are no longer required.
For maintainers