mirror of
https://github.com/penpot/penpot.git
synced 2025-05-25 00:06:21 +02:00
✨ Improve webhook URI validation
This commit is contained in:
parent
350e4a1d1b
commit
710878a667
9 changed files with 34 additions and 14 deletions
|
@ -74,7 +74,8 @@
|
|||
(when (>= total max-hooks-for-team)
|
||||
(ex/raise :type :restriction
|
||||
:code :webhooks-quote-reached
|
||||
:hint (str/ffmt "can't create more than % webhooks per team" max-hooks-for-team)))))
|
||||
:hint (str/ffmt "can't create more than % webhooks per team"
|
||||
max-hooks-for-team)))))
|
||||
|
||||
(defn- insert-webhook!
|
||||
[{:keys [::db/pool]} {:keys [team-id uri mtype is-active] :as params}]
|
||||
|
@ -99,8 +100,8 @@
|
|||
{::doc/added "1.17"}
|
||||
[{:keys [::db/pool ::wrk/executor] :as cfg} {:keys [profile-id team-id] :as params}]
|
||||
(check-edition-permissions! pool profile-id team-id)
|
||||
(->> (validate-quotes! cfg params)
|
||||
(p/fmap executor (fn [_] (validate-webhook! cfg nil params)))
|
||||
(validate-quotes! cfg params)
|
||||
(->> (validate-webhook! cfg nil params)
|
||||
(p/fmap executor (fn [_] (insert-webhook! cfg params)))))
|
||||
|
||||
(s/def ::update-webhook
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue