Documentation
¶
Overview ¶
Package encryptiontest provides an in-memory key store and ready Boxes for tests of stores that seal secrets.
Index ¶
- Constants
- Variables
- func Rotate(t testing.TB, store *KeyStore) *encryption.Box
- type KeyStore
- func (s *KeyStore) Activate(_ context.Context, id string) error
- func (s *KeyStore) FailLists(n int)
- func (s *KeyStore) Insert(_ context.Context, key encryption.Key) (bool, error)
- func (s *KeyStore) List(context.Context) ([]encryption.Key, error)
- func (s *KeyStore) UpdateWrapping(_ context.Context, key encryption.Key) error
Constants ¶
View Source
const Key = "test-encryption-key"
Key is the GOMODEL_ENCRYPTION_KEY the helpers use.
Variables ¶
View Source
var ErrListFailed = errors.New("encryption_keys is unavailable")
ErrListFailed is what List returns while FailLists is in effect.
Functions ¶
Types ¶
type KeyStore ¶
type KeyStore struct {
// contains filtered or unexported fields
}
KeyStore is an in-memory encryption.KeyStore.
func NewBox ¶
func NewBox(t testing.TB) (*encryption.Box, *KeyStore)
NewBox returns an enabled Box over a fresh in-memory key store, together with the store so a test can rotate the data key.
func (*KeyStore) UpdateWrapping ¶
Click to show internal directories.
Click to hide internal directories.