mirror of
https://github.com/penpot/penpot.git
synced 2026-07-24 15:08:24 +00:00
✨ Gate nitrate bulk-create-profiles behind a flag (#10785)
The bulk profile creation endpoint creates already active profiles that skip email verification and onboarding, so it should not be reachable on production deployments. Add the `nitrate-bulk-create-profiles` flag, disabled by default, and reject the call when it is not enabled. Signed-off-by: Juanfran <juanfran.ag@gmail.com>
This commit is contained in:
parent
4383cf183a
commit
4900d4b24a
@ -980,12 +980,19 @@ RETURNING id, deleted_at;")
|
||||
created users skip email verification and onboarding. Emails that already
|
||||
belong to an existing profile are skipped. Intended for the Nitrate admin
|
||||
bulk-creation screen; access is gated by the shared key and, in Nitrate, an
|
||||
email allow-list."
|
||||
email allow-list. Requires the `nitrate-bulk-create-profiles` flag, disabled
|
||||
by default so it is only available on test environments."
|
||||
{::doc/added "2.19"
|
||||
::sm/params schema:bulk-create-profiles-params
|
||||
::sm/result schema:bulk-create-profiles-result
|
||||
::rpc/auth false}
|
||||
[cfg {:keys [password emails]}]
|
||||
|
||||
(when-not (contains? cf/flags :nitrate-bulk-create-profiles)
|
||||
(ex/raise :type :restriction
|
||||
:code :nitrate-bulk-create-profiles-not-allowed
|
||||
:hint "Bulk profile creation is disabled by config."))
|
||||
|
||||
(let [derived (aauth/derive-password password)]
|
||||
(db/tx-run!
|
||||
cfg
|
||||
|
||||
@ -167,6 +167,11 @@
|
||||
;; Activates the nitrate module
|
||||
:nitrate
|
||||
|
||||
;; disabled by default. When enabled, allows the nitrate
|
||||
;; `bulk-create-profiles` method to create batches of already
|
||||
;; active profiles. Only intended for test environments.
|
||||
:nitrate-bulk-create-profiles
|
||||
|
||||
:mcp
|
||||
:background-blur
|
||||
:available-viewer-wasm
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user