ShtukbaseStandard
archivo del paquete→ .shtukbase/packages/live/checks/l02_token.ts

checks/l02_token.ts

13 líneas, 812 B.

El archivo tal como está en el paquete: el código y sus comentarios no se traducen.

  1. // LIVE-R02. Writing through the live server needs the session token. The server has no switch to turn the token off;
  2. // a field in /base/live.md that looks like one (token, auth, public, open, noToken, anonymousWrite) is a finding,
  3. // so nobody believes the write is open. The behaviour itself is held by the package's test (test/live.test.ts).
  4. import { type Project, type Result } from '../../collections/checks/lib/speclib.ts';
  5. import { main, settingsFindings } from './lib.ts';
  6. export const RULE = { id: 'live02', title: 'Writing through the live server needs the session token', scope: 'page /base/live.md' };
  7. export function check(p: Project, res: Result): void {
  8. settingsFindings(p, res, 'LIVE-R02', 'remove the field: the token cannot be turned off');
  9. }
  10. if (import.meta.main) main({ RULE, check });