Add query for vault id first

This commit is contained in:
Jill Regan
2026-02-20 09:35:27 -05:00
parent 8f91e40957
commit 2a0e01171e

View File

@@ -383,7 +383,11 @@ const loadSecretsViaConnect = async (
// Parse the op ref and get the item from the Connect SDK
const parsed = parseOpRef(ref);
const item = await client.getItem(parsed.vault, parsed.item);
const vault = await client.getVault(parsed.vault);
if (!vault.id) {
throw new Error(`Vault "${parsed.vault}" has no id`);
}
const item = await client.getItem(vault.id, parsed.item);
// Get the secret value from the item as Connect returns a full item object
const secretValue = await getSecretFromConnectItem(client, item, parsed);