MCPcopy Create free account
hub / github.com/Noumena-Network/code / readSecretIfPresent

Function readSecretIfPresent

src/utils/fileBackedSecrets.ts:43–52  ·  view source on GitHub ↗
(secretPath: string)

Source from the content-addressed store, hash-verified

41}
42
43function readSecretIfPresent(secretPath: string): string | null {
44 try {
45 const secretValue = getFsImplementation()
46 .readFileSync(secretPath, { encoding: 'utf8' })
47 .trim()
48 return secretValue.length > 0 ? secretValue : null
49 } catch {
50 return null
51 }
52}
53
54export function loadFileBackedSecrets(): void {
55 const configDir = getNcodeConfigHomeDir()

Callers 1

loadFileBackedSecretsFunction · 0.85

Calls 1

getFsImplementationFunction · 0.85

Tested by

no test coverage detected