M1 (1): stored secrets are write-only

smtpPassword and turnstileSecretKey in the Site integrations global are returned
as '********' to every read that goes through access control (REST, GraphQL, the
panel's form state); the Local API with access control off still gets the value.
A save that sends nothing, an empty value or the mask keeps the stored one;
'[[clear]]' removes it. MaskedField says that a value is set and offers to
remove it. Off: secrets: { writeOnly: false }. writeOnlySecret(s) and the hooks
are exported for a project's own fields.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-11-25 00:39:12 +01:00
co-authored by Claude Fable 5.2
parent cff355a541
commit 8fa71238ce
11 changed files with 345 additions and 35 deletions
+1 -1
View File
@@ -612,7 +612,7 @@ export const ipalKit = (options: IpalOptions): Plugin => {
: { searchFields: typeof searchSettings === 'function' ? searchSettings(searchSettingsFields) : searchSettingsFields }),
systemPageFields,
}),
buildSiteIntegrations({ additionalFields: options.integrationsFields }),
buildSiteIntegrations({ additionalFields: options.integrationsFields, writeOnlySecrets: options.secrets?.writeOnly !== false }),
withFillLocales('global', buildCookieSettings(), fillLocales['cookie-settings']),
buildNotifications({ lightbox: options.lightbox === true }),
]