MCPcopy Create free account
hub / github.com/Kong/insomnia / cannotAccessFileError

Function cannotAccessFileError

packages/insomnia/src/main/secure-read-file.ts:51–52  ·  view source on GitHub ↗
(securedPath: string)

Source from the content-addressed store, hash-verified

49// allowed to reach those files even though that directory is otherwise an allowed root.
50const isReservedDatabaseFile = (filePath: string) => /^insomnia\..+\.db.*$/i.test(path.basename(filePath));
51const cannotAccessFileError = (securedPath: string) =>
52 `Insomnia cannot access the file "${securedPath}". You must specify which directories Insomnia can access in ${SECURITY_SETTINGS_PATH_LABEL}`;
53const resolveRealPath = async (filePath: string) => fs.promises.realpath(filePath).catch(() => filePath);
54const statOrNull = async (filePath: string) => fs.promises.stat(filePath).catch(() => null);
55const getUserdataDirectory = () => process.env.INSOMNIA_DATA_PATH || electron.app.getPath('userData');

Callers 1

assertPathAllowedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected