M1 review: reference site types and an e2e check of the bound SMTP password

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-11-25 00:39:23 +01:00
co-authored by Claude Fable 5.2
parent fd203de326
commit a32329fbb4
2 changed files with 9 additions and 0 deletions
+4
View File
@@ -252,5 +252,9 @@ test('API: a staff password without the 2FA code opens nothing; with the code it
// the secret is stored (create-test-admin.ts) and never returned, also to a fully signed-in admin
expect(after.data.SiteIntegration.smtpPassword).toBe('********')
expect(JSON.stringify(after)).not.toContain('e2e-sink')
// …and it stays with the server it was saved for: moving the server without typing the password again is refused
const moved = await api.post('/api/globals/site-integrations', { data: { smtpHost: 'elsewhere.example.com' } })
expect(moved.status()).toBe(400)
expect(await moved.text()).toMatch(/Enter the password again|Wpisz hasło ponownie/)
await api.dispose()
})
+5
View File
@@ -2799,6 +2799,10 @@ export interface SiteIntegration {
* Usually 587, or 465.
*/
smtpPort?: number | null;
/**
* The password is sent only over an encrypted connection; without one, no e-mail is sent.
*/
smtpRequireTls?: boolean | null;
smtpUser?: string | null;
smtpPassword?: string | null;
emailStatus?: {
@@ -3220,6 +3224,7 @@ export interface SiteIntegrationsSelect<T extends boolean = true> {
smtpFromName?: T;
smtpHost?: T;
smtpPort?: T;
smtpRequireTls?: T;
smtpUser?: T;
smtpPassword?: T;
emailStatus?: