包文件→ .shtukbase/packages/live/checks/l02_token.ts
checks/l02_token.ts
13 行, 812 B.
文件按包中的原样显示:代码及其注释不做翻译。
- // LIVE-R02. Writing through the live server needs the session token. The server has no switch to turn the token off;
- // a field in /base/live.md that looks like one (token, auth, public, open, noToken, anonymousWrite) is a finding,
- // so nobody believes the write is open. The behaviour itself is held by the package's test (test/live.test.ts).
- import { type Project, type Result } from '../../collections/checks/lib/speclib.ts';
- import { main, settingsFindings } from './lib.ts';
- export const RULE = { id: 'live02', title: 'Writing through the live server needs the session token', scope: 'page /base/live.md' };
- export function check(p: Project, res: Result): void {
- settingsFindings(p, res, 'LIVE-R02', 'remove the field: the token cannot be turned off');
- }
- if (import.meta.main) main({ RULE, check });