Skip to content

Commit

Permalink
Added Slack webhook URL validation regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Noir01 committed Nov 10, 2023
1 parent a3d6221 commit c58b4e6
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit c58b4e6

Please sign in to comment.