From 5dcaa0bf5db4ce9a03667fff23dde243f01e623c Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 13 Sep 2026 11:59:46 +0000 Subject: [PATCH] Revert "test(commons): make the macOS keychain probe path testable on every host" This reverts commit 047eb197a47cd96c7ddb7c5f23d88fdc92c1ef0f. --- .../amethyst/commons/keystorage/SecureKeyStorage.kt | 10 +--------- .../commons/keystorage/SecureKeyStorageVaultTest.kt | 3 --- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/commons/src/jvmMain/kotlin/com/vitorpamplona/amethyst/commons/keystorage/SecureKeyStorage.kt b/commons/src/jvmMain/kotlin/com/vitorpamplona/amethyst/commons/keystorage/SecureKeyStorage.kt index fb06ac8285..926135932f 100644 --- a/commons/src/jvmMain/kotlin/com/vitorpamplona/amethyst/commons/keystorage/SecureKeyStorage.kt +++ b/commons/src/jvmMain/kotlin/com/vitorpamplona/amethyst/commons/keystorage/SecureKeyStorage.kt @@ -240,14 +240,6 @@ actual class SecureKeyStorage private actual constructor() { } } - /** - * Whether the macOS `security` CLI probe is used for strict lookups. Reads - * `os.name` by default; tests that wire [macSecurityLookup] set it to `true` - * so the probe path is exercised on every host, not only on a Mac (the - * vault test suite was red on Linux CI for exactly this reason). - */ - internal var isMacOs: () -> Boolean = { defaultIsMacOs() } - /** * Test seam: overridable strategy for the strict macOS lookup. Production wires * to [defaultMacSecurityLookup] which spawns `/usr/bin/security`. Tests replace @@ -1015,7 +1007,7 @@ internal fun parseMacSecurityFindResult( } } -private fun defaultIsMacOs(): Boolean = System.getProperty("os.name").orEmpty().startsWith("Mac") +private fun isMacOs(): Boolean = System.getProperty("os.name").orEmpty().startsWith("Mac") /** * Production implementation: spawn `/usr/bin/security` and read exit code + streams. diff --git a/commons/src/jvmTest/kotlin/com/vitorpamplona/amethyst/commons/keystorage/SecureKeyStorageVaultTest.kt b/commons/src/jvmTest/kotlin/com/vitorpamplona/amethyst/commons/keystorage/SecureKeyStorageVaultTest.kt index 887c13de2c..2f759c25a0 100644 --- a/commons/src/jvmTest/kotlin/com/vitorpamplona/amethyst/commons/keystorage/SecureKeyStorageVaultTest.kt +++ b/commons/src/jvmTest/kotlin/com/vitorpamplona/amethyst/commons/keystorage/SecureKeyStorageVaultTest.kt @@ -375,9 +375,6 @@ class SecureKeyStorageVaultTest { storage: SecureKeyStorage, backend: CountingKeyring, ) { - // Force the mac probe path regardless of the host OS: the point of the - // fake is to exercise it, and CI runs this suite on Linux. - storage.isMacOs = { true } storage.macSecurityLookup = { service, account -> backend.store[service to account] ?.let { MacSecurityResult.Found(it) }