Rename KMS purpose 'controller' to 'root'
This commit is contained in:
1 parent
efaf58b568
commit
fff15bc9f3
9 files changed
+12
-12
No files matched your search
@@ -327,7 +327,7 @@ func (b *Server) SetupKMSes(ui cli.Ui, config *configutil.SharedConfig, purposes
|
||||
switch purpose {
|
||||
case "":
|
||||
return errors.New("KMS block missing 'purpose'")
|
||||
case "controller", "worker-auth", "config":
|
||||
case "root", "worker-auth", "config":
|
||||
default:
|
||||
return fmt.Errorf("Unknown KMS purpose %q", kms.Purpose)
|
||||
}
|
||||
@@ -346,7 +346,7 @@ func (b *Server) SetupKMSes(ui cli.Ui, config *configutil.SharedConfig, purposes
|
||||
"After configuration nil KMS returned, KMS type was %s", kms.Type)
|
||||
}
|
||||
|
||||
if purpose == "controller" {
|
||||
if purpose == "root" {
|
||||
b.ControllerKMS = wrapper
|
||||
} else {
|
||||
b.WorkerAuthKMS = wrapper
|
||||
|
||||
@@ -5,7 +5,7 @@ kms "aead" {
|
||||
}
|
||||
|
||||
kms "aead" {
|
||||
purpose = "controller"
|
||||
purpose = "root"
|
||||
aead_type = "aes-gcm"
|
||||
key ="{{decrypt(CkgsDUoQ7B5JhE1ye2yVAm3Ss_KNbLQgBhKtibtGSvpGOrwQ3zRTF_qoHPHX-xuqLyZ9zsb3cMo6OpphKOj7AeTn1_iiqZ_VaCsqAA)}}"
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ kms "aead" {
|
||||
}
|
||||
|
||||
kms "aead" {
|
||||
purpose = "controller"
|
||||
purpose = "root"
|
||||
aead_type = "aes-gcm"
|
||||
key ="{{encrypt(eb78KqCwowELYnkOOko/XYz01q1ax3g76J1vCAvt5dQ=)}}"
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ func (c *Command) Run(args []string) int {
|
||||
return 1
|
||||
}
|
||||
|
||||
if err := c.SetupKMSes(c.UI, c.Config.SharedConfig, []string{"controller", "worker-auth"}); err != nil {
|
||||
if err := c.SetupKMSes(c.UI, c.Config.SharedConfig, []string{"root", "worker-auth"}); err != nil {
|
||||
c.UI.Error(err.Error())
|
||||
return 1
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ func (c *Command) Run(args []string) int {
|
||||
return 1
|
||||
}
|
||||
|
||||
if err := c.SetupKMSes(c.UI, devConfig.SharedConfig, []string{"controller", "worker-auth"}); err != nil {
|
||||
if err := c.SetupKMSes(c.UI, devConfig.SharedConfig, []string{"root", "worker-auth"}); err != nil {
|
||||
c.UI.Error(err.Error())
|
||||
return 1
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ controller {
|
||||
}
|
||||
|
||||
kms "aead" {
|
||||
purpose = "controller"
|
||||
purpose = "root"
|
||||
aead_type = "aes-gcm"
|
||||
key = "%s"
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ func TestDevController(t *testing.T) {
|
||||
Seals: []*configutil.KMS{
|
||||
{
|
||||
Type: "aead",
|
||||
Purpose: []string{"controller"},
|
||||
Purpose: []string{"root"},
|
||||
Config: map[string]string{
|
||||
"aead_type": "aes-gcm",
|
||||
},
|
||||
@@ -140,7 +140,7 @@ kms "aead" {
|
||||
}
|
||||
|
||||
kms "aead" {
|
||||
purpose = "controller"
|
||||
purpose = "root"
|
||||
aead_type = "aes-gcm"
|
||||
key ="eb78KqCwowELYnkOOko/XYz01q1ax3g76J1vCAvt5dQ="
|
||||
}`
|
||||
@@ -153,7 +153,7 @@ kms "aead" {
|
||||
}
|
||||
|
||||
kms "aead" {
|
||||
purpose = "controller"
|
||||
purpose = "root"
|
||||
aead_type = "aes-gcm"
|
||||
key ="{{decrypt(Ckh57d4NA6nsnRKV6DiHTyfwLIakdhN8w7qdPJgo-KWnBdlEKv3NQkUFbouU0eorSGik1Qbca5xEy2NqYT9UYj_GUGo6hHz13MEqAA)}}"
|
||||
}`
|
||||
|
||||
@@ -22,7 +22,7 @@ telemetry {
|
||||
}
|
||||
|
||||
kms "aead" {
|
||||
purpose = "controller"
|
||||
purpose = "root"
|
||||
aead_type = "aes-gcm"
|
||||
key = "09iqFxRJNYsl/b8CQxjnGw=="
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ func NewTestController(t *testing.T, opts *TestControllerOpts) *TestController {
|
||||
tc.b.ControllerKMS = opts.ControllerKMS
|
||||
tc.b.WorkerAuthKMS = opts.WorkerAuthKMS
|
||||
case opts.ControllerKMS == nil && opts.WorkerAuthKMS == nil:
|
||||
if err := tc.b.SetupKMSes(nil, opts.Config.SharedConfig, []string{"controller", "worker-auth"}); err != nil {
|
||||
if err := tc.b.SetupKMSes(nil, opts.Config.SharedConfig, []string{"root", "worker-auth"}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
default:
|
||||
|
||||
Reference in new issue
Block a user