@@ -9,20 +9,13 @@ import (
99
1010var ErrSecretNotFound = errors .New ("secret not found" )
1111
12- // Store provides secure credential storage operations.
13- type Store interface {
14- Get (key string ) ([]byte , error )
15- Put (key string , data []byte ) error
16- Delete (key string ) error
17- }
18-
1912type keyringStore struct {
2013 ctx context.Context
2114 serviceName string
2215}
2316
2417// Open opens the system keyring for the Sourcegraph CLI.
25- func Open (ctx context.Context ) (Store , error ) {
18+ func Open (ctx context.Context ) (* keyringStore , error ) {
2619 return & keyringStore {ctx : ctx , serviceName : "Sourcegraph CLI" }, nil
2720}
2821
@@ -72,15 +65,3 @@ func (k *keyringStore) Get(key string) ([]byte, error) {
7265 return []byte (secret ), nil
7366 })
7467}
75-
76- // Delete removes a key from the keyring.
77- func (k * keyringStore ) Delete (key string ) error {
78- _ , err := withContext (k .ctx , func () (struct {}, error ) {
79- err := keyring .Delete (k .serviceName , key )
80- if err != nil && err != keyring .ErrNotFound {
81- return struct {}{}, errors .Wrap (err , "removing item from keyring" )
82- }
83- return struct {}{}, nil
84- })
85- return err
86- }
0 commit comments