From 12429b5c6911e58229f58fb3a719be1fd2030550 Mon Sep 17 00:00:00 2001 From: ianaflous <42301579+ianaflous@users.noreply.github.com> Date: Sun, 1 Dec 2024 00:00:13 +0100 Subject: [PATCH] Using ssh default profile(user/password/port) without host Lint correction --- tabby-core/src/services/vault.service.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tabby-core/src/services/vault.service.ts b/tabby-core/src/services/vault.service.ts index 84e5287b57..d9d678002a 100644 --- a/tabby-core/src/services/vault.service.ts +++ b/tabby-core/src/services/vault.service.ts @@ -195,7 +195,13 @@ export class VaultService { if (!vault) { return null } - return vault.secrets.find(s => s.type === type && this.keyMatches(key, s)) ?? null + let vaultSecret = vault.secrets.find(s => s.type === type && this.keyMatches(key, s)) + if (!vaultSecret) { + // search for secret without host in vault (like a default user/password used in multiple servers) + key['host'] = null + vaultSecret = vault.secrets.find(s => s.type === type && this.keyMatches(key, s)) + } + return vaultSecret ?? null } async addSecret (secret: VaultSecret): Promise {