Skip to content

Commit

Permalink
enable keyring lib debug logging when KEYRING_DEBUG env var is set
Browse files Browse the repository at this point in the history
  • Loading branch information
joemiller committed Jun 3, 2021
1 parent 1099506 commit 59983ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/store/secret_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import (

func TestSecretServiceStore(t *testing.T) {
// TODO: get this working in CI. The current blocker is needing to have a dbus prompter service that
// can be driven automatically and headless.
// can be driven automatically and headless:
// https://github.com/99designs/keyring/blob/d9b6b92e219ff56ce753cf84d4956f823d431651/libsecret_test.go#L13-L22
if os.Getenv("CI") != "" {
t.Skip("Skipping testing in CI environment")
}
Expand Down
5 changes: 5 additions & 0 deletions pkg/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package store

import (
"net/url"
"os"

"github.com/99designs/keyring"
"github.com/PuerkitoBio/purell"
Expand Down Expand Up @@ -30,6 +31,10 @@ var SupportedBackends = []keyring.BackendType{

// New creates a new Store from a keyring.Config
func New(cfg keyring.Config) (*Store, error) {
if os.Getenv("KEYRING_DEBUG") != "" {
keyring.Debug = true
}

kr, err := keyring.Open(cfg)
if err != nil {
return nil, err
Expand Down

0 comments on commit 59983ba

Please sign in to comment.