2018-10-19 21:43:57 +00:00
|
|
|
package seal
|
|
|
|
|
|
|
|
import (
|
2020-01-11 01:39:52 +00:00
|
|
|
"github.com/hashicorp/go-hclog"
|
|
|
|
wrapping "github.com/hashicorp/go-kms-wrapping"
|
2018-10-19 21:43:57 +00:00
|
|
|
)
|
|
|
|
|
2020-01-11 01:39:52 +00:00
|
|
|
type TestSealOpts struct {
|
|
|
|
Logger hclog.Logger
|
|
|
|
StoredKeys StoredKeysSupport
|
|
|
|
Secret []byte
|
|
|
|
Name string
|
2018-10-19 21:43:57 +00:00
|
|
|
}
|
|
|
|
|
2020-01-11 01:39:52 +00:00
|
|
|
func NewTestSeal(opts *TestSealOpts) *Access {
|
|
|
|
if opts == nil {
|
|
|
|
opts = new(TestSealOpts)
|
2019-02-01 19:29:55 +00:00
|
|
|
}
|
|
|
|
|
2020-01-11 01:39:52 +00:00
|
|
|
return &Access{
|
|
|
|
Wrapper: wrapping.NewTestWrapper(opts.Secret),
|
|
|
|
OverriddenType: opts.Name,
|
2018-10-19 21:43:57 +00:00
|
|
|
}
|
|
|
|
}
|