Some checks failed
dev - build & deploy naar test / build-and-deploy (push) Failing after 4s
21 lines
899 B
JavaScript
21 lines
899 B
JavaScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { readFile } from 'node:fs/promises';
|
|
|
|
test('productieconfig gebruikt secure cookies en begrensde proxy trust', async () => {
|
|
const compose = await readFile('deploy/compose.deploy.yaml', 'utf8');
|
|
assert.match(compose, /COOKIE_SECURE: "true"/);
|
|
assert.match(compose, /TRUST_PROXY_HOPS:/);
|
|
assert.match(compose, /WEB_BIND_IP:-127\.0\.0\.1/);
|
|
});
|
|
|
|
test('nginx behoudt het publieke forwarded protocol', async () => {
|
|
const nginx = await readFile('deploy/nginx.conf', 'utf8');
|
|
assert.match(nginx, /http_x_forwarded_proto/);
|
|
assert.match(nginx, /X-Forwarded-Proto \$teach_forwarded_proto/);
|
|
});
|
|
|
|
test('client bewaart geen bearer-token meer', async () => {
|
|
const core = await readFile('public/js/core.js', 'utf8');
|
|
assert.doesNotMatch(core, /headers\.Authorization|localStorage\.setItem\("teach\.token"/);
|
|
});
|