diff --git a/lib/kamal/secrets/adapters/one_password.rb b/lib/kamal/secrets/adapters/one_password.rb index f3db373f..c7e9b28d 100644 --- a/lib/kamal/secrets/adapters/one_password.rb +++ b/lib/kamal/secrets/adapters/one_password.rb @@ -11,7 +11,7 @@ class Kamal::Secrets::Adapters::OnePassword < Kamal::Secrets::Adapters::Base end def loggedin?(account) - `op account get --account #{account.shellescape}` + `op account get --account #{account.shellescape} 2> /dev/null` $?.success? end diff --git a/test/secrets/one_password_adapter_test.rb b/test/secrets/one_password_adapter_test.rb index e36cf8a2..59ad511d 100644 --- a/test/secrets/one_password_adapter_test.rb +++ b/test/secrets/one_password_adapter_test.rb @@ -2,7 +2,7 @@ require "test_helper" class SecretsOnePasswordAdapterTest < SecretAdapterTestCase test "fetch" do - stub_ticks.with("op account get --account myaccount") + stub_ticks.with("op account get --account myaccount 2> /dev/null") stub_ticks .with("op item get myitem --vault \"myvault\" --fields \"label=section.SECRET1,label=section.SECRET2,label=section2.SECRET3\" --format \"json\" --account \"myaccount\"") @@ -56,7 +56,7 @@ class SecretsOnePasswordAdapterTest < SecretAdapterTestCase end test "fetch with multiple items" do - stub_ticks.with("op account get --account myaccount") + stub_ticks.with("op account get --account myaccount 2> /dev/null") stub_ticks .with("op item get myitem --vault \"myvault\" --fields \"label=section.SECRET1,label=section.SECRET2\" --format \"json\" --account \"myaccount\"") @@ -115,7 +115,7 @@ class SecretsOnePasswordAdapterTest < SecretAdapterTestCase end test "fetch with signin, no session" do - stub_ticks_with("op account get --account myaccount", succeed: false) + stub_ticks_with("op account get --account myaccount 2> /dev/null", succeed: false) stub_ticks_with("op signin --account \"myaccount\" --force --raw", succeed: true).returns("") stub_ticks @@ -132,7 +132,7 @@ class SecretsOnePasswordAdapterTest < SecretAdapterTestCase end test "fetch with signin and session" do - stub_ticks_with("op account get --account myaccount", succeed: false) + stub_ticks_with("op account get --account myaccount 2> /dev/null", succeed: false) stub_ticks_with("op signin --account \"myaccount\" --force --raw", succeed: true).returns("1234567890") stub_ticks