github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/libkb/secret_store_fail_test.go (about) 1 package libkb 2 3 import "errors" 4 5 // Secret store for testing where all operations (besides Get/SetOptions) fail. 6 7 type SecretStoreFail struct{} 8 9 var _ SecretStoreAll = (*SecretStoreFail)(nil) 10 11 var ErrSecretStoreFail = errors.New("SecretStoreFail Test Error") 12 13 func NewSecretStoreFail() *SecretStoreFail { 14 return &SecretStoreFail{} 15 } 16 17 func (s *SecretStoreFail) RetrieveSecret(m MetaContext, username NormalizedUsername) (LKSecFullSecret, error) { 18 return LKSecFullSecret{}, ErrSecretStoreFail 19 } 20 21 func (s *SecretStoreFail) StoreSecret(m MetaContext, username NormalizedUsername, secret LKSecFullSecret) error { 22 return ErrSecretStoreFail 23 } 24 25 func (s *SecretStoreFail) ClearSecret(m MetaContext, username NormalizedUsername) error { 26 return ErrSecretStoreFail 27 } 28 29 func (s *SecretStoreFail) GetUsersWithStoredSecrets(m MetaContext) ([]string, error) { 30 return []string{}, ErrSecretStoreFail 31 } 32 33 func (s *SecretStoreFail) GetOptions(MetaContext) *SecretStoreOptions { return nil } 34 func (s *SecretStoreFail) SetOptions(MetaContext, *SecretStoreOptions) {}