forked from wangziqi/gongxue-base
feat: add platform dunning notifications
This commit is contained in:
@@ -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}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user