mirror of
https://github.com/penpot/penpot.git
synced 2026-08-18 10:48:35 +00:00
🐛 Fix update-profile-props not rejecting plugin props at validation
The schema:props schema still included :plugins as a valid key, so the closed-map validation passed instead of rejecting it. The system-managed-props denylist only silently stripped the key after validation, never raised an error. Derive schema:props-writeable from schema:props using sm/dissoc-key to exclude system-managed keys, and use it in the update-profile-props params schema. The original schema:props remains intact for get-profile result validation. AI-assisted-by: mimo-v2.5
This commit is contained in:
parent
067ef9d99b
commit
6199f01f9d
@ -78,6 +78,10 @@
|
||||
[:map-of {:gen/max 10} :keyword [:map-of :keyword :string]]]
|
||||
[:nudge {:optional true} schema:nudge]])
|
||||
|
||||
(def schema:props-writeable
|
||||
"Props schema for user-writable fields (excludes system-managed keys)."
|
||||
(reduce sm/dissoc-key schema:props system-managed-props))
|
||||
|
||||
(def schema:profile
|
||||
[:map {:title "Profile"}
|
||||
[:id ::sm/uuid]
|
||||
@ -461,7 +465,7 @@
|
||||
(def ^:private
|
||||
schema:update-profile-props
|
||||
[:map {:title "update-profile-props"}
|
||||
[:props schema:props]])
|
||||
[:props schema:props-writeable]])
|
||||
|
||||
(defn update-profile-props
|
||||
[{:keys [::db/conn] :as cfg} profile-id props]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user