MCPcopy Create free account
hub / github.com/ProtonDriveApps/sdk / load

Method load

cli/src/credentials/secretCredentialsStore.ts:12–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10 async load(): Promise<Credentials | null> {
11 this.logger.debug(`Loading session ${CREDENTIALS_NAME} from secrets`);
12 let raw;
13 try {
14 raw = await Bun.secrets.get({ service: CREDENTIALS_SERVICE, name: CREDENTIALS_NAME });
15 } catch (error: unknown) {
16 const message = error instanceof Error ? error.message : String(error);
17 throw new ValidationError(
18 `Failed to load session from secrets (ensure you have secrets available, read the README for more information): ${message}`,
19 undefined,
20 { cause: error },
21 );
22 }
23 return parseStoredSnapshot(raw);
24 }
25
26 async save(snapshot: Credentials): Promise<void> {
27 this.logger.debug(`Saving session ${CREDENTIALS_NAME} to secrets`);
28 await Bun.secrets.set({
29 service: CREDENTIALS_SERVICE,

Callers

nothing calls this directly

Calls 3

parseStoredSnapshotFunction · 0.90
debugMethod · 0.65
getMethod · 0.45

Tested by

no test coverage detected