feat: add platform dunning notifications

This commit is contained in:
Codex
2026-06-30 07:28:32 +08:00
parent e66623158d
commit 51f8cbdec8
26 changed files with 1782 additions and 24 deletions

View File

@@ -21,6 +21,7 @@ const safeBaseEnv = {
WORKER_ASSET_SECURITY_SCAN_HTTP_TOKEN: 's3cure-asset-scanner-token-2026-06-30-abcdef',
WORKER_ASSET_SECURITY_SCAN_FAIL_OPEN: 'false',
WORKER_PLATFORM_AUDIT_NOTIFICATION_ALLOW_INSECURE_LOCALHOST: 'false',
WORKER_PLATFORM_DUNNING_NOTIFICATION_ALLOW_INSECURE_LOCALHOST: 'false',
};
const safeApiEnv = {
@@ -90,6 +91,17 @@ assert.match(
'worker config should name unsafe platform audit notification localhost mode',
);
const unsafeWorkerPlatformDunningNotification = runImport(workerConfigUrl, {
...safeBaseEnv,
WORKER_PLATFORM_DUNNING_NOTIFICATION_ALLOW_INSECURE_LOCALHOST: 'true',
});
assert.notEqual(unsafeWorkerPlatformDunningNotification.status, 0, 'production worker config should reject platform dunning notification localhost mode');
assert.match(
unsafeWorkerPlatformDunningNotification.output,
/WORKER_PLATFORM_DUNNING_NOTIFICATION_ALLOW_INSECURE_LOCALHOST=true/,
'worker config should name unsafe platform dunning notification localhost mode',
);
const safeWorker = runImport(workerConfigUrl, safeBaseEnv);
assert.equal(safeWorker.status, 0, `safe production worker config should load: ${safeWorker.output}`);