Skip to content

Commit c58b4e6

Browse files
committed
Added Slack webhook URL validation regex
1 parent a3d6221 commit c58b4e6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

notifications/notifications/src/main/kotlin/org/opensearch/notifications/index/ConfigIndexingActions.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ object ConfigIndexingActions {
5656

5757
@Suppress("UnusedPrivateMember")
5858
private fun validateSlackConfig(slack: Slack, user: User?) {
59-
// TODO: URL validation with rules
59+
require(slack.url.contains(Regex("https://hooks\\.slack\\.com/services"))) {
60+
"Wrong Slack url. Should contain \"hooks.slack.com/services/\""
61+
}
6062
}
6163

6264
@Suppress("UnusedPrivateMember")

0 commit comments

Comments
 (0)