MCPcopy
hub / github.com/garrytan/gstack / getLinuxSecretPassword

Function getLinuxSecretPassword

browse/src/cookie-import-browser.ts:619–637  ·  view source on GitHub ↗
(browser: BrowserInfo)

Source from the content-addressed store, hash-verified

617}
618
619async function getLinuxSecretPassword(browser: BrowserInfo): Promise<string | null> {
620 const attempts: string[][] = [
621 ['secret-tool', 'lookup', 'Title', browser.keychainService],
622 ];
623
624 if (browser.linuxApplication) {
625 attempts.push(
626 ['secret-tool', 'lookup', 'xdg:schema', 'chrome_libsecret_os_crypt_password_v2', 'application', browser.linuxApplication],
627 ['secret-tool', 'lookup', 'xdg:schema', 'chrome_libsecret_os_crypt_password', 'application', browser.linuxApplication],
628 );
629 }
630
631 for (const cmd of attempts) {
632 const password = await runPasswordLookup(cmd, 3_000);
633 if (password) return password;
634 }
635
636 return null;
637}
638
639async function runPasswordLookup(cmd: string[], timeoutMs: number): Promise<string | null> {
640 try {

Callers 1

getDerivedKeysFunction · 0.85

Calls 2

runPasswordLookupFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected