Verify V1 scheduling and static boundaries; record Terra workflow and visual QA
This commit is contained in:
parent
ffaa1f6afa
commit
4bf121728b
4 changed files with 36 additions and 13 deletions
|
|
@ -4,6 +4,7 @@ import path from 'node:path';
|
|||
import { unzipSync } from 'fflate';
|
||||
import { afterEach, describe, expect, it } from 'vitest';
|
||||
import { loadConfig } from '../server/config.ts';
|
||||
import { createApp } from '../server/app.ts';
|
||||
import { encryptSecret, decryptSecret } from '../server/crypto.ts';
|
||||
import { openDatabase } from '../server/db.ts';
|
||||
import { TINY_PNG } from '../server/documents/testFixtures.ts';
|
||||
|
|
@ -48,6 +49,22 @@ describe('private image authorization', () => {
|
|||
});
|
||||
|
||||
describe('key durability and restore', () => {
|
||||
it('does not serve a sibling directory through an encoded static path', async () => {
|
||||
app = await createTestApp();
|
||||
const dir = temporary();
|
||||
const web = path.join(dir, 'web');
|
||||
fs.mkdirSync(web);
|
||||
fs.mkdirSync(path.join(dir, 'web-private'));
|
||||
fs.writeFileSync(path.join(web, 'index.html'), '<html>Study Desk</html>');
|
||||
fs.writeFileSync(path.join(dir, 'web-private', 'secret.txt'), 'private fixture');
|
||||
const hono = createApp({ ...app.ctx, config: { ...app.ctx.config, webDir: web } });
|
||||
const result = await hono.request('/..%2fweb-private%2fsecret.txt');
|
||||
expect(result.status).toBe(404);
|
||||
expect(await result.text()).not.toContain('private fixture');
|
||||
expect((await hono.request('/%ZZ')).status).toBe(400);
|
||||
expect((await hono.request('/classes/example')).status).toBe(200);
|
||||
});
|
||||
|
||||
it('refuses a damaged encryption key without replacing it', () => {
|
||||
const dir = temporary();
|
||||
const config = loadConfig({ dataDir: dir }, {});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue