diff options
| author | Janusz Bialy <janusz.bialy@qlik.com> | 2019-03-22 15:00:46 -0400 |
|---|---|---|
| committer | Janusz Bialy <janusz.bialy@qlik.com> | 2019-03-23 15:04:21 -0400 |
| commit | 07f37d7f3c36ceee92c06b93111627d06e872664 (patch) | |
| tree | 65b51674446fb5366f461ee92f69a8a8c7f9d0e2 /aws | |
| parent | b235bf53460a8d2d622e951928fd1bf5d3d29d2c (diff) | |
abstract KMS client so that it's easier to test
Diffstat (limited to 'aws')
| -rw-r--r-- | aws/kms.go | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -6,12 +6,18 @@ import ( "github.com/aws/aws-sdk-go/service/kms" ) -// KMS - +// KMSAPI is a subset of kmsiface.KMSAPI +type KMSAPI interface { + Encrypt(input *kms.EncryptInput) (*kms.EncryptOutput, error) + Decrypt(input *kms.DecryptInput) (*kms.DecryptOutput, error) +} + +// KMS is an AWS KMS client type KMS struct { - Client *kms.KMS + Client KMSAPI } -// NewKMS - Create new KMS client +// NewKMS - Create new AWS KMS client using an SDKSession func NewKMS(option ClientOptions) *KMS { client := kms.New(SDKSession()) return &KMS{ |
