Skip to content

Commit

Permalink
Merge pull request #930 from basecamp/hide-1password-login-error
Browse files Browse the repository at this point in the history
Hide the 1password login error
  • Loading branch information
djmb authored Sep 11, 2024
2 parents 63d0b5d + aa630f1 commit deb2a6d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/kamal/secrets/adapters/one_password.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def login(account)
end

def loggedin?(account)
`op account get --account #{account.shellescape}`
`op account get --account #{account.shellescape} 2> /dev/null`
$?.success?
end

Expand Down
8 changes: 4 additions & 4 deletions test/secrets/one_password_adapter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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\"")
Expand Down Expand Up @@ -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\"")
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit deb2a6d

Please sign in to comment.