/** * Copyright (c) 2025 Ofri Peretz * Licensed under the MIT License. Use of this source code is governed by the * MIT license that can be found in the LICENSE file. */ /** * ESLint Rule: no-missing-authentication * Detects missing authentication checks in route handlers * CWE-287: Improper Authentication * * @see https://cwe.mitre.org/data/definitions/287.html * @see https://owasp.org/www-community/vulnerabilities/Improper_Authentication */ import type { TSESLint } from '@interlace/eslint-devkit'; type MessageIds = 'missingAuthentication' | 'addAuthentication'; export interface Options { /** Allow missing authentication in test files. Default: false */ allowInTests?: boolean; /** Test file pattern regex string. Default: '\\.(test|spec)\\.(ts|tsx|js|jsx)$' */ testFilePattern?: string; /** Authentication middleware patterns to recognize. Default: ['authenticate', 'auth', 'requireAuth', 'isAuthenticated'] */ authMiddlewarePatterns?: string[]; /** Route handler patterns to check. Default: ['get', 'post', 'put', 'delete', 'patch', 'all'] */ routeHandlerPatterns?: string[]; /** Additional patterns to ignore. Default: [] */ ignorePatterns?: string[]; } type RuleOptions = [Options?]; export declare const noMissingAuthentication: TSESLint.RuleModule & { name: string; }; export {};