mirror of https://github.com/penpot/penpot.git
🐛 Mark rpc calls as authenticated when shared key is used (#7901)
This commit is contained in:
parent
2acf15958b
commit
88dcf9d1fe
|
|
@ -309,7 +309,7 @@
|
||||||
(fn [request]
|
(fn [request]
|
||||||
(let [key (yreq/get-header request "x-shared-key")]
|
(let [key (yreq/get-header request "x-shared-key")]
|
||||||
(if (= key shared-key)
|
(if (= key shared-key)
|
||||||
(handler request)
|
(handler (assoc request ::http/auth-with-shared-key true))
|
||||||
{::yres/status 403}))))
|
{::yres/status 403}))))
|
||||||
(fn [_ _]
|
(fn [_ _]
|
||||||
{::yres/status 403})))
|
{::yres/status 403})))
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
[app.common.spec :as us]
|
[app.common.spec :as us]
|
||||||
[app.common.time :as ct]
|
[app.common.time :as ct]
|
||||||
[app.common.uri :as u]
|
[app.common.uri :as u]
|
||||||
|
[app.common.uuid :as uuid]
|
||||||
[app.config :as cf]
|
[app.config :as cf]
|
||||||
[app.db :as db]
|
[app.db :as db]
|
||||||
[app.http :as-alias http]
|
[app.http :as-alias http]
|
||||||
|
|
@ -92,7 +93,11 @@
|
||||||
(let [handler-name (:type path-params)
|
(let [handler-name (:type path-params)
|
||||||
etag (yreq/get-header request "if-none-match")
|
etag (yreq/get-header request "if-none-match")
|
||||||
profile-id (or (::session/profile-id request)
|
profile-id (or (::session/profile-id request)
|
||||||
(::actoken/profile-id request))
|
(::actoken/profile-id request)
|
||||||
|
(if (::http/auth-with-shared-key request)
|
||||||
|
uuid/zero
|
||||||
|
nil))
|
||||||
|
|
||||||
ip-addr (inet/parse-request request)
|
ip-addr (inet/parse-request request)
|
||||||
|
|
||||||
data (-> params
|
data (-> params
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue