diff --git a/app/src/main/java/io/xpipe/app/util/SecretManager.java b/app/src/main/java/io/xpipe/app/util/SecretManager.java index bad96e8b8..3f7a15070 100644 --- a/app/src/main/java/io/xpipe/app/util/SecretManager.java +++ b/app/src/main/java/io/xpipe/app/util/SecretManager.java @@ -29,8 +29,8 @@ public class SecretManager { } public static synchronized SecretQueryProgress expectAskpass( - UUID request, UUID storeId, List suppliers, SecretQuery fallback, CountDown countDown) { - var p = new SecretQueryProgress(request, storeId, suppliers, fallback, countDown); + UUID request, UUID storeId, List suppliers, SecretQuery fallback, List filters, CountDown countDown) { + var p = new SecretQueryProgress(request, storeId, suppliers, fallback, filters, countDown); progress.add(p); return p; } @@ -56,7 +56,7 @@ public class SecretManager { } var uuid = UUID.randomUUID(); - var p = expectAskpass(uuid, secretId, List.of(strategy.query()), SecretQuery.prompt(false), CountDown.of()); + var p = expectAskpass(uuid, secretId, List.of(strategy.query()), SecretQuery.prompt(false), List.of(), CountDown.of()); p.preAdvance(sub); var r = p.process(prompt); completeRequest(uuid); diff --git a/app/src/main/java/io/xpipe/app/util/SecretQueryFilter.java b/app/src/main/java/io/xpipe/app/util/SecretQueryFilter.java new file mode 100644 index 000000000..633b4a431 --- /dev/null +++ b/app/src/main/java/io/xpipe/app/util/SecretQueryFilter.java @@ -0,0 +1,10 @@ +package io.xpipe.app.util; + +import io.xpipe.core.util.SecretValue; + +import java.util.Optional; + +public interface SecretQueryFilter { + + Optional filter(String prompt); +} diff --git a/app/src/main/java/io/xpipe/app/util/SecretQueryProgress.java b/app/src/main/java/io/xpipe/app/util/SecretQueryProgress.java index 0be4cae7b..8ac867490 100644 --- a/app/src/main/java/io/xpipe/app/util/SecretQueryProgress.java +++ b/app/src/main/java/io/xpipe/app/util/SecretQueryProgress.java @@ -18,6 +18,7 @@ public class SecretQueryProgress { private final UUID storeId; private final List suppliers; private final SecretQuery fallback; + private final List filters; private final List seenPrompts; private final CountDown countDown; private boolean requestCancelled; @@ -27,11 +28,13 @@ public class SecretQueryProgress { @NonNull UUID storeId, @NonNull List suppliers, @NonNull SecretQuery fallback, + @NonNull List filters, @NonNull CountDown countDown) { this.requestId = requestId; this.storeId = storeId; this.suppliers = new ArrayList<>(suppliers); this.fallback = fallback; + this.filters = filters; this.countDown = countDown; this.seenPrompts = new ArrayList<>(); } @@ -49,6 +52,13 @@ public class SecretQueryProgress { return null; } + for (SecretQueryFilter filter : filters) { + var o = filter.filter(prompt); + if (o.isPresent()) { + return o.get(); + } + } + var seenBefore = seenPrompts.contains(prompt); if (!seenBefore) { seenPrompts.add(prompt); diff --git a/lang/proc/strings/translations_de.properties b/lang/proc/strings/translations_de.properties index a6ce69122..d62c91068 100644 --- a/lang/proc/strings/translations_de.properties +++ b/lang/proc/strings/translations_de.properties @@ -297,3 +297,5 @@ openAsRoot=Als Root öffnen openInVsCodeRemote=Öffnen in VSCode remote openInWSL=In WSL öffnen launch=Starten +sshTrustKeyHeader=Der Hostschlüssel ist nicht bekannt und du hast die manuelle Überprüfung des Hostschlüssels aktiviert. +sshTrustKeyTitle=Unbekannter Host-Schlüssel diff --git a/lang/proc/strings/translations_en.properties b/lang/proc/strings/translations_en.properties index 93a3cb898..e5e342b23 100644 --- a/lang/proc/strings/translations_en.properties +++ b/lang/proc/strings/translations_en.properties @@ -296,3 +296,5 @@ openAsRoot=Open as root openInVsCodeRemote=Open in VSCode remote openInWSL=Open in WSL launch=Launch +sshTrustKeyHeader=The host key is not known, and you have enabled manual host key verification. +sshTrustKeyTitle=Unknown host key diff --git a/lang/proc/strings/translations_es.properties b/lang/proc/strings/translations_es.properties index bb0ff6414..37b236b67 100644 --- a/lang/proc/strings/translations_es.properties +++ b/lang/proc/strings/translations_es.properties @@ -295,3 +295,5 @@ openAsRoot=Abrir como raíz openInVsCodeRemote=Abrir en VSCode remoto openInWSL=Abrir en WSL launch=Inicia +sshTrustKeyHeader=No se conoce la clave del host y has activado la verificación manual de la clave del host. +sshTrustKeyTitle=Clave de host desconocida diff --git a/lang/proc/strings/translations_fr.properties b/lang/proc/strings/translations_fr.properties index ca08ad4cb..10319a1a1 100644 --- a/lang/proc/strings/translations_fr.properties +++ b/lang/proc/strings/translations_fr.properties @@ -295,3 +295,5 @@ openAsRoot=Ouvrir en tant que racine openInVsCodeRemote=Ouvrir en VSCode à distance openInWSL=Ouvrir en WSL launch=Lancer +sshTrustKeyHeader=La clé de l'hôte n'est pas connue et tu as activé la vérification manuelle de la clé de l'hôte. +sshTrustKeyTitle=Clé d'hôte inconnue diff --git a/lang/proc/strings/translations_it.properties b/lang/proc/strings/translations_it.properties index a476d9a13..33b8b60b2 100644 --- a/lang/proc/strings/translations_it.properties +++ b/lang/proc/strings/translations_it.properties @@ -295,3 +295,5 @@ openAsRoot=Apri come root openInVsCodeRemote=Aprire in VSCode remoto openInWSL=Aprire in WSL launch=Lancio +sshTrustKeyHeader=La chiave host non è nota e hai attivato la verifica manuale della chiave host. +sshTrustKeyTitle=Chiave host sconosciuta diff --git a/lang/proc/strings/translations_ja.properties b/lang/proc/strings/translations_ja.properties index 6d576e6e0..cb25ce436 100644 --- a/lang/proc/strings/translations_ja.properties +++ b/lang/proc/strings/translations_ja.properties @@ -295,3 +295,5 @@ openAsRoot=ルートとして開く openInVsCodeRemote=VSCodeリモートで開く openInWSL=WSLで開く launch=起動 +sshTrustKeyHeader=ホスト鍵が不明で、手動ホスト鍵検証を有効にしている。 +sshTrustKeyTitle=不明なホストキー diff --git a/lang/proc/strings/translations_nl.properties b/lang/proc/strings/translations_nl.properties index fdf7bf90f..1eb2c59a6 100644 --- a/lang/proc/strings/translations_nl.properties +++ b/lang/proc/strings/translations_nl.properties @@ -295,3 +295,5 @@ openAsRoot=Openen als root openInVsCodeRemote=Openen in VSCode op afstand openInWSL=Openen in WSL launch=Start +sshTrustKeyHeader=De hostsleutel is niet bekend en je hebt handmatige hostsleutelverificatie ingeschakeld. +sshTrustKeyTitle=Onbekende hostsleutel diff --git a/lang/proc/strings/translations_pt.properties b/lang/proc/strings/translations_pt.properties index 56170e803..810939630 100644 --- a/lang/proc/strings/translations_pt.properties +++ b/lang/proc/strings/translations_pt.properties @@ -295,3 +295,5 @@ openAsRoot=Abre como raiz openInVsCodeRemote=Abre no VSCode remoto openInWSL=Abre em WSL launch=Lança +sshTrustKeyHeader=A chave do anfitrião não é conhecida e activaste a verificação manual da chave do anfitrião. +sshTrustKeyTitle=Chave de anfitrião desconhecida diff --git a/lang/proc/strings/translations_ru.properties b/lang/proc/strings/translations_ru.properties index 375166699..62b0995cd 100644 --- a/lang/proc/strings/translations_ru.properties +++ b/lang/proc/strings/translations_ru.properties @@ -295,3 +295,5 @@ openAsRoot=Открыть как корень openInVsCodeRemote=Открыть в VSCode remote openInWSL=Открыть в WSL launch=Запустите +sshTrustKeyHeader=Ключ хоста неизвестен, и ты включил ручную проверку ключа хоста. +sshTrustKeyTitle=Неизвестный ключ хоста diff --git a/lang/proc/strings/translations_tr.properties b/lang/proc/strings/translations_tr.properties index 2c0f88a91..c796da1ed 100644 --- a/lang/proc/strings/translations_tr.properties +++ b/lang/proc/strings/translations_tr.properties @@ -295,3 +295,5 @@ openAsRoot=Kök olarak aç openInVsCodeRemote=VSCode remote'da açın openInWSL=WSL'de Açık launch=Fırlatma +sshTrustKeyHeader=Ana bilgisayar anahtarı bilinmiyor ve manuel ana bilgisayar anahtarı doğrulamasını etkinleştirdiniz. +sshTrustKeyTitle=Bilinmeyen ana bilgisayar anahtarı diff --git a/lang/proc/strings/translations_zh.properties b/lang/proc/strings/translations_zh.properties index 7653d4473..d8762e0c1 100644 --- a/lang/proc/strings/translations_zh.properties +++ b/lang/proc/strings/translations_zh.properties @@ -295,3 +295,5 @@ openAsRoot=以根用户身份打开 openInVsCodeRemote=在 VSCode 远程中打开 openInWSL=在 WSL 中打开 launch=启动 +sshTrustKeyHeader=主机密钥未知,您已启用手动主机密钥验证。 +sshTrustKeyTitle=未知主机密钥