Skip to content

armgit / hypit

Public Imported from GitHub
0

Clone any viral video with AI agents. Not just a script, the whole workflow: swap the face, the words, the B-roll, ship 100 variants in one command, and get your 100M views.

fix(credentials): write macOS secrets correctly

kashorin4d1c50a38af8
diff --git a/packages/credential-store-os/src/store.ts b/packages/credential-store-os/src/store.ts
index dfedcb35..82284b99 100644
--- a/packages/credential-store-os/src/store.ts
+++ b/packages/credential-store-os/src/store.ts
@@ -33,17 +33,17 @@ function macosReader(service: string): OsCredentialReader {
function macosWriter(service: string): OsCredentialWriter {
return async (_service, account, secret) => await new Promise((resolve, reject) => {
- const child = spawn("/usr/bin/security", ["add-generic-password", "-U", "-s", service, "-a", account, "-w"], {
- detached: true, shell: false, windowsHide: true, stdio: ["pipe", "ignore", "ignore"],
- });
- const timeout = setTimeout(() => child.kill(), 10_000);
- child.on("error", (error) => { clearTimeout(timeout); reject(error); });
- child.on("close", (code) => {
- clearTimeout(timeout);
- if (code === 0) resolve();
+ // macOS security(1) requires the password as the argument to -w; it does
+ // not read an omitted -w value from stdin. execFile keeps shell expansion
+ // out of the path and the callback never includes the secret in errors.
+ execFile("/usr/bin/security", [
+ "add-generic-password", "-U", "-s", service, "-a", account, "-w", secret,
+ ], {
+ timeout: 10_000, shell: false, windowsHide: true,
+ }, (error) => {
+ if (error === null) resolve();
else reject(new Error(`OS credential write for ${account} failed`));
});
- child.stdin.end(`${secret}\n${secret}\n`);
});
}