Add WithRecoveryKms option to test controller
This commit is contained in:
1 parent
e119466233
commit
8445d4bbbc
1 file changed
+10
@@ -6,6 +6,7 @@ import (
|
||||
|
||||
"github.com/hashicorp/boundary/internal/cmd/config"
|
||||
"github.com/hashicorp/boundary/internal/servers/controller"
|
||||
wrapping "github.com/hashicorp/go-kms-wrapping"
|
||||
)
|
||||
|
||||
func getOpts(opt ...Option) (*controller.TestControllerOpts, error) {
|
||||
@@ -46,6 +47,7 @@ type option struct {
|
||||
setDefaultAuthMethodId bool
|
||||
setDefaultLoginName bool
|
||||
setDefaultPassword bool
|
||||
setRecoveryKms bool
|
||||
}
|
||||
|
||||
type Option func(*option) error
|
||||
@@ -127,6 +129,14 @@ func WithDefaultPassword(pw string) Option {
|
||||
}
|
||||
}
|
||||
|
||||
func WithRecoveryKms(wrapper wrapping.Wrapper) Option {
|
||||
return func(c *option) error {
|
||||
c.setRecoveryKms = true
|
||||
c.tcOptions.RecoveryKms = wrapper
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// NewTestController blocks until a new TestController is created, returns the url for the TestController and a function
|
||||
// that can be called to tear down the controller after it has been used for testing.
|
||||
func NewTestController(t *testing.T, opt ...Option) *TestController {
|
||||
|
||||
Reference in new issue
Block a user