feat(email): generic webhook for all notification emails, hide SMTP UI
Aegis CI / lint-and-test (push) Has been cancelled
Snyk Security Scan / Python vulnerabilities (backend) (push) Has been cancelled
Snyk Security Scan / npm vulnerabilities (frontend) (push) Has been cancelled
Snyk Security Scan / Docker image vulnerabilities (backend) (push) Has been cancelled
Aegis CI / lint-and-test (push) Has been cancelled
Snyk Security Scan / Python vulnerabilities (backend) (push) Has been cancelled
Snyk Security Scan / npm vulnerabilities (frontend) (push) Has been cancelled
Snyk Security Scan / Docker image vulnerabilities (backend) (push) Has been cancelled
- Renamed the password-setup webhook (email_webhook.*, /system/email-webhook-config) and made it the single transport for all notification emails. - New webhook_email_service.py shared by password_setup_service and notification_service. - Wired test validated/rejected, campaign completed, and new-MITRE-technique notifications through the webhook (previously dead SMTP code, never triggered). - Added POST /system/email-webhook-test to send a real test email. - Hid the Email/SMTP settings tab from the UI (SMTP code kept intact, unused). - Redact email_webhook.api_key on config export.
This commit is contained in:
@@ -199,29 +199,34 @@ export async function testJiraConnection(): Promise<{
|
||||
return data;
|
||||
}
|
||||
|
||||
export interface PasswordWebhookConfigOut {
|
||||
export interface EmailWebhookConfigOut {
|
||||
configured: boolean;
|
||||
url: string;
|
||||
api_key_set: boolean;
|
||||
}
|
||||
|
||||
export async function getPasswordWebhookConfig(): Promise<PasswordWebhookConfigOut> {
|
||||
const { data } = await client.get<PasswordWebhookConfigOut>("/system/password-webhook-config");
|
||||
export async function getEmailWebhookConfig(): Promise<EmailWebhookConfigOut> {
|
||||
const { data } = await client.get<EmailWebhookConfigOut>("/system/email-webhook-config");
|
||||
return data;
|
||||
}
|
||||
|
||||
/** apiKey is optional — omit or pass "" to leave the currently-stored key unchanged. */
|
||||
export async function updatePasswordWebhookConfig(
|
||||
export async function updateEmailWebhookConfig(
|
||||
url: string,
|
||||
apiKey?: string,
|
||||
): Promise<PasswordWebhookConfigOut> {
|
||||
const { data } = await client.patch<PasswordWebhookConfigOut>("/system/password-webhook-config", {
|
||||
): Promise<EmailWebhookConfigOut> {
|
||||
const { data } = await client.patch<EmailWebhookConfigOut>("/system/email-webhook-config", {
|
||||
url,
|
||||
api_key: apiKey || undefined,
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function testEmailWebhook(to: string): Promise<{ detail: string }> {
|
||||
const { data } = await client.post<{ detail: string }>("/system/email-webhook-test", { to });
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function testTempoConnection(): Promise<{
|
||||
status: "ok" | "error" | "disabled";
|
||||
message?: string;
|
||||
|
||||
Reference in New Issue
Block a user