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

Function writeSecretStorageEntry

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

Source from the content-addressed store, hash-verified

581}
582
583async function writeSecretStorageEntry(
584 app: App | undefined,
585 secretRef: string,
586 value: string,
587): Promise<boolean> {
588 const secretStorage = getSecretStorage(app);
589 if (!secretStorage?.setSecret) return false;
590
591 try {
592 await Promise.resolve(secretStorage.setSecret(secretRef, value));
593 return true;
594 } catch (error) {
595 log.logWarning(
596 `Failed to write user script SecretStorage entry "${secretRef}": ${formatSecretError(error)}`,
597 );
598 return false;
599 }
600}
601
602async function buildAvailableSecretRef(
603 app: App | undefined,

Callers 1

storeUserScriptSecretFunction · 0.85

Calls 4

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

Tested by

no test coverage detected