mirror of
https://github.com/penpot/penpot.git
synced 2026-09-01 17:49:08 +00:00
✨ Add a new nitrate endpoint to check the airgapped flag (#11434)
This commit is contained in:
parent
806f947360
commit
93ac6d8338
@ -1045,3 +1045,18 @@ RETURNING id, deleted_at;")
|
||||
(update acc :created conj email)))))
|
||||
{:created [] :skipped []}
|
||||
emails)))))
|
||||
|
||||
;; ---- API: get-air-gapped
|
||||
|
||||
(def ^:private schema:get-air-gapped-result
|
||||
[:map
|
||||
[:air-gapped ::sm/boolean]])
|
||||
|
||||
(sv/defmethod ::get-air-gapped
|
||||
"Returns whether this Penpot instance runs in air-gapped mode."
|
||||
{::doc/added "2.18"
|
||||
::sm/params [:map]
|
||||
::sm/result schema:get-air-gapped-result
|
||||
::rpc/auth false}
|
||||
[_cfg _params]
|
||||
{:air-gapped (contains? cf/flags :air-gapped-conf)})
|
||||
|
||||
@ -194,6 +194,15 @@
|
||||
(string? (get version k)))))
|
||||
(t/is (= cf/version version))))
|
||||
|
||||
(t/deftest get-air-gapped
|
||||
(let [out (th/management-command! {::th/type :get-air-gapped})]
|
||||
(t/is (th/success? out))
|
||||
(t/is (false? (-> out :result :air-gapped))))
|
||||
(binding [cf/flags (conj cf/flags :air-gapped-conf)]
|
||||
(let [out (th/management-command! {::th/type :get-air-gapped})]
|
||||
(t/is (th/success? out))
|
||||
(t/is (true? (-> out :result :air-gapped))))))
|
||||
|
||||
(t/deftest get-teams-returns-only-owned-non-default-non-deleted
|
||||
(with-mocks [nitrate-mock {:target 'app.nitrate/call :return nil}]
|
||||
(let [profile (th/create-profile* 1 {:is-active true})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user