MCPcopy Create free account
hub / github.com/chhoumann/quickadd / readSecretStorageEntry

Function readSecretStorageEntry

src/utils/userScriptSecrets.ts:566–581  ·  view source on GitHub ↗
(
	app: App | undefined,
	secretRef: string,
)

Source from the content-addressed store, hash-verified

564}
565
566async function readSecretStorageEntry(
567 app: App | undefined,
568 secretRef: string,
569): Promise<string | null> {
570 const secretStorage = getSecretStorage(app);
571 if (!secretStorage?.getSecret) return null;
572
573 try {
574 return await Promise.resolve(secretStorage.getSecret(secretRef));
575 } catch (error) {
576 log.logWarning(
577 `Failed to read user script SecretStorage entry "${secretRef}": ${formatSecretError(error)}`,
578 );
579 return null;
580 }
581}
582
583async function writeSecretStorageEntry(
584 app: App | undefined,

Callers 3

buildAvailableSecretRefFunction · 0.70

Calls 4

getSecretStorageFunction · 0.85
formatSecretErrorFunction · 0.85
logWarningMethod · 0.65
resolveMethod · 0.45

Tested by

no test coverage detected