feat: Remove guest token usage, enhance highlight tag management with validation and improved UI, and add security tests.

This commit is contained in:
Kantine Wrapper
2026-03-12 13:13:32 +01:00
parent 877f0f3649
commit 32c1e1e383
14 changed files with 635 additions and 229 deletions

View File

@@ -45,12 +45,11 @@ try {
throw new Error(`Expected Authorization header 'Token ${token}', but got '${headersWithToken['Authorization']}'`);
}
// Test without token (should use GUEST_TOKEN)
// Test without token (should NOT have Authorization header)
const headersWithoutToken = sandbox.apiHeaders();
console.log("Without token:", JSON.stringify(headersWithoutToken));
const guestToken = vm.runInContext('GUEST_TOKEN', sandbox);
if (headersWithoutToken['Authorization'] !== `Token ${guestToken}`) {
throw new Error(`Expected Authorization header 'Token ${guestToken}', but got '${headersWithoutToken['Authorization']}'`);
if (headersWithoutToken['Authorization']) {
throw new Error(`Expected NO Authorization header when token is missing, but got '${headersWithoutToken['Authorization']}'`);
}
if (headersWithoutToken['Accept'] !== 'application/json') {