diff --git a/backend/src/app/http/middleware.clj b/backend/src/app/http/middleware.clj index e7b4b5c953..7d4e29b721 100644 --- a/backend/src/app/http/middleware.clj +++ b/backend/src/app/http/middleware.clj @@ -309,7 +309,7 @@ (fn [request] (let [key (yreq/get-header request "x-shared-key")] (if (= key shared-key) - (handler request) + (handler (assoc request ::http/auth-with-shared-key true)) {::yres/status 403})))) (fn [_ _] {::yres/status 403}))) diff --git a/backend/src/app/rpc.clj b/backend/src/app/rpc.clj index 782c91b042..7d4a241817 100644 --- a/backend/src/app/rpc.clj +++ b/backend/src/app/rpc.clj @@ -14,6 +14,7 @@ [app.common.spec :as us] [app.common.time :as ct] [app.common.uri :as u] + [app.common.uuid :as uuid] [app.config :as cf] [app.db :as db] [app.http :as-alias http] @@ -92,7 +93,11 @@ (let [handler-name (:type path-params) etag (yreq/get-header request "if-none-match") 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) data (-> params