( filePath: string, encoding: BufferEncoding = 'utf-8' )
| 535 | * Only use for reading Claude config files and similar system configs. |
| 536 | */ |
| 537 | export async function systemPathReadFile( |
| 538 | filePath: string, |
| 539 | encoding: BufferEncoding = 'utf-8' |
| 540 | ): Promise<string> { |
| 541 | if (!isAllowedSystemPath(filePath)) { |
| 542 | throw new Error(`[SystemPaths] Access denied: ${filePath} is not an allowed system path`); |
| 543 | } |
| 544 | return fs.readFile(filePath, encoding); |
| 545 | } |
| 546 | |
| 547 | /** |
| 548 | * Read a file from an allowed system path (synchronous) |
no test coverage detected