diff --git a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/index/ConfigIndexingActions.kt b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/index/ConfigIndexingActions.kt index 2ef5b93a..bf0a3293 100644 --- a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/index/ConfigIndexingActions.kt +++ b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/index/ConfigIndexingActions.kt @@ -56,7 +56,9 @@ object ConfigIndexingActions { @Suppress("UnusedPrivateMember") private fun validateSlackConfig(slack: Slack, user: User?) { - // TODO: URL validation with rules + require(slack.url.contains(Regex("https://hooks\\.slack\\.com/services"))) { + "Wrong Slack url. Should contain \"hooks.slack.com/services/\"" + } } @Suppress("UnusedPrivateMember")