@ouro.bot/cli 0.1.0-alpha.405 → 0.1.0-alpha.406
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/changelog.json
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
|
|
3
3
|
"versions": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.1.0-alpha.406",
|
|
6
|
+
"changes": [
|
|
7
|
+
"`ouro auth --agent <agent> --provider <provider>` now keeps narrating the post-login vault save path with `opening ... vault session`, `storing ... credentials`, and `refreshing local provider snapshot`, so a successful browser login no longer drops into a silent cursor while secrets are being persisted.",
|
|
8
|
+
"Bitwarden-backed provider saves now classify timeouts and empty command failures by operation and redact raw `bw create item ...` command text, encoded payloads, and prompt echoes from auth output.",
|
|
9
|
+
"Auth, repair CLI, and Bitwarden regression coverage now encodes the reported post-login save failure shapes so the same leak-prone path stays guarded.",
|
|
10
|
+
"`@ouro.bot/cli` and the `ouro.bot` wrapper are version-synced for the post-login vault save hardening release."
|
|
11
|
+
]
|
|
12
|
+
},
|
|
4
13
|
{
|
|
5
14
|
"version": "0.1.0-alpha.405",
|
|
6
15
|
"changes": [
|
|
@@ -148,6 +148,7 @@ async function storeProviderCredentials(agentName, provider, credentials, deps =
|
|
|
148
148
|
config: split.config,
|
|
149
149
|
provenance: { source: "auth-flow" },
|
|
150
150
|
now: deps.now,
|
|
151
|
+
onProgress: deps.onProgress,
|
|
151
152
|
});
|
|
152
153
|
return { credentialPath: (0, provider_credentials_1.providerCredentialItemName)(provider) };
|
|
153
154
|
}
|
|
@@ -391,11 +392,14 @@ async function runRuntimeAuthFlow(input, deps = {}) {
|
|
|
391
392
|
throw new Error(`${vault.error}\n${(0, vault_unlock_1.vaultUnlockReplaceRecoverFix)(input.agentName, `Then retry 'ouro auth --agent ${input.agentName} --provider ${input.provider}'.`)}`);
|
|
392
393
|
}
|
|
393
394
|
const credentials = await collectRuntimeAuthCredentials(input, deps);
|
|
394
|
-
writeAuthProgress(input, `${input.provider} credentials collected; storing in ${input.agentName}'s vault...`);
|
|
395
395
|
let credentialPath;
|
|
396
396
|
try {
|
|
397
397
|
;
|
|
398
|
-
({
|
|
398
|
+
({
|
|
399
|
+
credentialPath,
|
|
400
|
+
} = await storeProviderCredentials(input.agentName, input.provider, credentials, {
|
|
401
|
+
onProgress: (message) => writeAuthProgress(input, message),
|
|
402
|
+
}));
|
|
399
403
|
}
|
|
400
404
|
catch (error) {
|
|
401
405
|
throw formatVaultStoreError(input.agentName, input.provider, error);
|
|
@@ -328,12 +328,15 @@ async function upsertProviderCredential(input) {
|
|
|
328
328
|
},
|
|
329
329
|
};
|
|
330
330
|
const record = recordFromPayload(payload);
|
|
331
|
+
input.onProgress?.(`opening ${input.agentName}'s vault session...`);
|
|
331
332
|
const store = (0, credential_access_1.getCredentialStore)(input.agentName);
|
|
333
|
+
input.onProgress?.(`storing ${input.provider} credentials in ${input.agentName}'s vault...`);
|
|
332
334
|
await store.store(providerCredentialItemName(input.provider), {
|
|
333
335
|
username: input.provider,
|
|
334
336
|
password: JSON.stringify(payload),
|
|
335
337
|
notes: "Ouro provider credentials. The vault item password is a versioned JSON payload.",
|
|
336
338
|
});
|
|
339
|
+
input.onProgress?.(`refreshing local provider snapshot from ${input.agentName}'s vault...`);
|
|
337
340
|
const refreshResult = await refreshProviderCredentialPool(input.agentName);
|
|
338
341
|
if (!refreshResult.ok) {
|
|
339
342
|
throw new Error(`credential stored in vault, but the local provider snapshot could not be refreshed: ${refreshResult.error}. ` +
|
|
@@ -59,6 +59,21 @@ function isBwSessionUnavailableMessage(message) {
|
|
|
59
59
|
function isBwInvalidUnlockSecretMessage(message) {
|
|
60
60
|
return /invalid master password/i.test(message) || /saved vault unlock secret/i.test(message);
|
|
61
61
|
}
|
|
62
|
+
function isBwTimeoutError(err) {
|
|
63
|
+
const timeoutErr = err;
|
|
64
|
+
const message = err.message.toLowerCase();
|
|
65
|
+
return (timeoutErr.code === "ETIMEDOUT" ||
|
|
66
|
+
timeoutErr.killed === true ||
|
|
67
|
+
timeoutErr.signal === "SIGTERM" ||
|
|
68
|
+
message.includes("timed out"));
|
|
69
|
+
}
|
|
70
|
+
function formatBwOperation(args) {
|
|
71
|
+
const [command, target] = args;
|
|
72
|
+
/* v8 ignore next -- defensive: all execBw call sites pass a concrete bw subcommand @preserve */
|
|
73
|
+
if (!command)
|
|
74
|
+
return "bw command";
|
|
75
|
+
return [command, target].filter(Boolean).join(" ");
|
|
76
|
+
}
|
|
62
77
|
function sanitizeBwErrorDetail(message) {
|
|
63
78
|
if (isBwInvalidUnlockSecretMessage(message)) {
|
|
64
79
|
return "bw CLI rejected the saved vault unlock secret for this machine";
|
|
@@ -75,8 +90,15 @@ function sanitizeBwErrorDetail(message) {
|
|
|
75
90
|
.replace(/[A-Za-z0-9+/=]{80,}/g, "[redacted]")
|
|
76
91
|
.slice(0, 500);
|
|
77
92
|
}
|
|
78
|
-
function formatBwCliError(err, stderr = "") {
|
|
93
|
+
function formatBwCliError(err, stderr = "", args = []) {
|
|
94
|
+
const operation = formatBwOperation(args);
|
|
95
|
+
if (isBwTimeoutError(err)) {
|
|
96
|
+
return new Error(`bw CLI error: ${operation} timed out while waiting for a vault response`);
|
|
97
|
+
}
|
|
79
98
|
const detail = sanitizeBwErrorDetail(stderr.trim() || err.message);
|
|
99
|
+
if (detail === "command failed") {
|
|
100
|
+
return new Error(`bw CLI error: ${operation} failed without error detail`);
|
|
101
|
+
}
|
|
80
102
|
return new Error(`bw CLI error: ${detail}`);
|
|
81
103
|
}
|
|
82
104
|
function isBwSessionAuthError(err) {
|
|
@@ -99,7 +121,7 @@ function execBw(args, sessionToken, appDataDir, stdin) {
|
|
|
99
121
|
reject(new Error("bw CLI not found. Install from https://bitwarden.com/help/cli/"));
|
|
100
122
|
return;
|
|
101
123
|
}
|
|
102
|
-
reject(formatBwCliError(err, stderr));
|
|
124
|
+
reject(formatBwCliError(err, stderr, args));
|
|
103
125
|
return;
|
|
104
126
|
}
|
|
105
127
|
resolve(stdout);
|