Merge pull request #3854 from penpot/niwinz-develop-yetti-update

 Update yetti and simplify internal worker module
This commit is contained in:
Alejandro
2023-11-29 12:01:33 +01:00
committed by GitHub
43 changed files with 797 additions and 811 deletions

View File

@@ -429,11 +429,11 @@
(= :params-validation (:code data))
(app.common.pprint/pprint
(sm/humanize-data (::sm/explain data)))
(sm/humanize-explain (::sm/explain data)))
(= :data-validation (:code data))
(app.common.pprint/pprint
(sm/humanize-data (::sm/explain data)))
(sm/humanize-explain (::sm/explain data)))
(= :service-error (:type data))
(print-error! (.getCause ^Throwable error))

View File

@@ -31,17 +31,17 @@
request (volatile! nil)
handler (#'app.http.access-token/wrap-soft-auth
(fn [req & _] (vreset! request req))
(fn [req] (vreset! request req))
system)]
(with-mocks [m1 {:target 'app.http.access-token/get-token
:return nil}]
(handler {} nil nil)
(handler {})
(t/is (= {} @request)))
(with-mocks [m1 {:target 'app.http.access-token/get-token
:return (:token token)}]
(handler {} nil nil)
(handler {})
(let [token-id (get @request :app.http.access-token/id)]
(t/is (= token-id (:id token))))))))

View File

@@ -25,7 +25,7 @@
(def http-request
(reify
yetti.request/Request
ring.request/Request
(get-header [_ name]
(case name
"x-forwarded-for" "127.0.0.44"))))

View File

@@ -46,6 +46,6 @@
{:keys [error result]} (th/command! (assoc params ::cond/key etag))]
(t/is (nil? error))
(t/is (fn? result))
(t/is (= 304 (-> (result nil) :yetti.response/status))))
(t/is (= 304 (-> (result nil) :ring.response/status))))
))))