mirror of
https://github.com/mileswolfallen2/miles-web.git
synced 2026-12-06 08:33:55 +00:00
update
This commit is contained in:
1 parent
c250653961
commit
f26fdd9d07
18 files changed
+493
-83
No files matched your search
@@ -45,6 +45,23 @@ test('config honors environment overrides without changing code', () => {
|
||||
assert.equal(config.monitor.expectedSubnet, '192.168.1.0/24');
|
||||
});
|
||||
|
||||
test('production split-origin config allows the API and main site origins', () => {
|
||||
const config = loadConfig({
|
||||
NODE_ENV: 'production',
|
||||
SESSION_SECRET: secret,
|
||||
VAULT_PASSWORD: 'a local passphrase',
|
||||
PUBLIC_ORIGIN: 'https://api.milesallen.site',
|
||||
ALLOWED_ORIGINS: 'https://milesallen.site,https://www.milesallen.site'
|
||||
});
|
||||
|
||||
assert.equal(config.publicOrigin, 'https://api.milesallen.site');
|
||||
assert.ok(config.allowedOrigins.has('https://milesallen.site'));
|
||||
assert.ok(config.allowedOrigins.has('https://www.milesallen.site'));
|
||||
assert.ok(config.allowedOrigins.has('https://api.milesallen.site'));
|
||||
assert.equal(config.cookie.sameSite, 'Strict');
|
||||
assert.equal(config.cookie.secure, true);
|
||||
});
|
||||
|
||||
test('production refuses missing or short session secrets', () => {
|
||||
assert.throws(
|
||||
() => loadConfig({ NODE_ENV: 'production', VAULT_PASSWORD: 'a local passphrase' }),
|
||||
|
||||
Reference in new issue
Block a user