review.security.config
Retrieve current security configuration from ReviewExtension to validate and correct Re:VIEW manuscript files by checking unauthorized tags and fixing duplicate IDs.
Instructions
Get current security configuration (SSOT from ReviewExtention)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | Yes | ||
| forceReload | No |
Implementation Reference
- src/index.ts:631-641 (handler)Handler implementation for the 'review.security.config' tool. It calls loadSecurityConfig with cwd and optional forceReload, then returns the config as JSON text content.case "review.security.config": { const config = await loadSecurityConfig( args.cwd as string, args.forceReload as boolean | undefined ); return { content: [ { type: "text", text: JSON.stringify(config) } ] }; }
- src/index.ts:367-378 (registration)Tool registration in the tools array, including name, description, and input schema. Used by ListToolsRequestSchema handler.{ name: "review.security.config", description: "Get current security configuration (SSOT from ReviewExtention)", inputSchema: { type: "object", properties: { cwd: { type: "string" }, forceReload: { type: "boolean" } }, required: ["cwd"] } },
- src/config/security.ts:9-17 (schema)TypeScript interface defining the structure of the security configuration returned by the tool.export interface SecurityConfig { maxFileSize: number; allowedExtensions: string[]; allowedPaths: string[]; blockAbsolutePaths: boolean; blockTraversal: boolean; source: "reviewextention" | "local" | "default"; timestamp: string; }
- src/config/security.ts:32-71 (helper)Core helper function that implements the logic to load the security configuration from ReviewExtention Ruby script, local YAML files, or falls back to defaults. Called by the tool handler.export async function loadSecurityConfig(cwd: string, forceReload = false): Promise<SecurityConfig> { const now = Date.now(); if (!forceReload && cachedConfig && now < cacheExpiry) { console.log("[Security] Using cached SSOT config"); return cachedConfig; } console.log("[Security] Loading SSOT configuration..."); try { const reviewExtConfig = await loadFromReviewExtention(cwd); if (reviewExtConfig) { cachedConfig = reviewExtConfig; cacheExpiry = now + 5 * 60 * 1000; logConfigSource(reviewExtConfig); return reviewExtConfig; } } catch (error) { console.warn("[Security] Failed to load from ReviewExtention:", error); } try { const localConfig = await loadFromLocalConfig(cwd); if (localConfig) { cachedConfig = localConfig; cacheExpiry = now + 5 * 60 * 1000; logConfigSource(localConfig); return localConfig; } } catch (error) { console.warn("[Security] Failed to load local config:", error); } console.log("[Security] Using default configuration"); cachedConfig = DEFAULT_SECURITY; cacheExpiry = now + 5 * 60 * 1000; logConfigSource(DEFAULT_SECURITY); return DEFAULT_SECURITY; }