diff --git a/http/sys_policy_test.go b/http/sys_policy_test.go index 084fa58d8004..48ed675edd70 100644 --- a/http/sys_policy_test.go +++ b/http/sys_policy_test.go @@ -17,8 +17,8 @@ func TestSysPolicies(t *testing.T) { var actual map[string]interface{} expected := map[string]interface{}{ - "policies": []interface{}{"cubbyhole-response-wrapping", "default", "root"}, - "keys": []interface{}{"cubbyhole-response-wrapping", "default", "root"}, + "policies": []interface{}{"response-wrapping", "default", "root"}, + "keys": []interface{}{"response-wrapping", "default", "root"}, } testResponseStatus(t, resp, 200) testResponseBody(t, resp, &actual) @@ -62,8 +62,8 @@ func TestSysWritePolicy(t *testing.T) { var actual map[string]interface{} expected := map[string]interface{}{ - "policies": []interface{}{"cubbyhole-response-wrapping", "default", "foo", "root"}, - "keys": []interface{}{"cubbyhole-response-wrapping", "default", "foo", "root"}, + "policies": []interface{}{"response-wrapping", "default", "foo", "root"}, + "keys": []interface{}{"response-wrapping", "default", "foo", "root"}, } testResponseStatus(t, resp, 200) testResponseBody(t, resp, &actual) @@ -71,7 +71,7 @@ func TestSysWritePolicy(t *testing.T) { t.Fatalf("bad: got\n%#v\nexpected\n%#v\n", actual, expected) } - resp = testHttpPost(t, token, addr+"/v1/sys/policy/cubbyhole-response-wrapping", map[string]interface{}{ + resp = testHttpPost(t, token, addr+"/v1/sys/policy/response-wrapping", map[string]interface{}{ "rules": ``, }) testResponseStatus(t, resp, 400) @@ -94,14 +94,14 @@ func TestSysDeletePolicy(t *testing.T) { // Also attempt to delete these since they should not be allowed (ignore // responses, if they exist later that's sufficient) resp = testHttpDelete(t, token, addr+"/v1/sys/policy/default") - resp = testHttpDelete(t, token, addr+"/v1/sys/policy/cubbyhole-response-wrapping") + resp = testHttpDelete(t, token, addr+"/v1/sys/policy/response-wrapping") resp = testHttpGet(t, token, addr+"/v1/sys/policy") var actual map[string]interface{} expected := map[string]interface{}{ - "policies": []interface{}{"cubbyhole-response-wrapping", "default", "root"}, - "keys": []interface{}{"cubbyhole-response-wrapping", "default", "root"}, + "policies": []interface{}{"response-wrapping", "default", "root"}, + "keys": []interface{}{"response-wrapping", "default", "root"}, } testResponseStatus(t, resp, 200) testResponseBody(t, resp, &actual) diff --git a/vault/logical_system_test.go b/vault/logical_system_test.go index f38f4483251f..f6453b03ed92 100644 --- a/vault/logical_system_test.go +++ b/vault/logical_system_test.go @@ -610,8 +610,8 @@ func TestSystemBackend_policyList(t *testing.T) { } exp := map[string]interface{}{ - "keys": []string{"cubbyhole-response-wrapping", "default", "root"}, - "policies": []string{"cubbyhole-response-wrapping", "default", "root"}, + "keys": []string{"response-wrapping", "default", "root"}, + "policies": []string{"response-wrapping", "default", "root"}, } if !reflect.DeepEqual(resp.Data, exp) { t.Fatalf("got: %#v expect: %#v", resp.Data, exp) @@ -663,8 +663,8 @@ func TestSystemBackend_policyCRUD(t *testing.T) { } exp = map[string]interface{}{ - "keys": []string{"cubbyhole-response-wrapping", "default", "foo", "root"}, - "policies": []string{"cubbyhole-response-wrapping", "default", "foo", "root"}, + "keys": []string{"response-wrapping", "default", "foo", "root"}, + "policies": []string{"response-wrapping", "default", "foo", "root"}, } if !reflect.DeepEqual(resp.Data, exp) { t.Fatalf("got: %#v expect: %#v", resp.Data, exp) @@ -698,8 +698,8 @@ func TestSystemBackend_policyCRUD(t *testing.T) { } exp = map[string]interface{}{ - "keys": []string{"cubbyhole-response-wrapping", "default", "root"}, - "policies": []string{"cubbyhole-response-wrapping", "default", "root"}, + "keys": []string{"response-wrapping", "default", "root"}, + "policies": []string{"response-wrapping", "default", "root"}, } if !reflect.DeepEqual(resp.Data, exp) { t.Fatalf("got: %#v expect: %#v", resp.Data, exp) diff --git a/vault/policy_store.go b/vault/policy_store.go index ff037b065f71..45439ebd6086 100644 --- a/vault/policy_store.go +++ b/vault/policy_store.go @@ -20,7 +20,7 @@ const ( policyCacheSize = 1024 // cubbyholeResponseWrappingPolicyName is the name of the fixed policy - cubbyholeResponseWrappingPolicyName = "cubbyhole-response-wrapping" + cubbyholeResponseWrappingPolicyName = "response-wrapping" // cubbyholeResponseWrappingPolicy is the policy that ensures cubbyhole // response wrapping can always succeed diff --git a/vault/policy_store_test.go b/vault/policy_store_test.go index 7d2e36834b16..1cb21309031b 100644 --- a/vault/policy_store_test.go +++ b/vault/policy_store_test.go @@ -138,11 +138,11 @@ func TestPolicyStore_Predefined(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } - if len(out) != 2 || out[0] != "cubbyhole-response-wrapping" || out[1] != "default" { + if len(out) != 2 || out[0] != "response-wrapping" || out[1] != "default" { t.Fatalf("bad: %v", out) } - pCubby, err := core.policyStore.GetPolicy("cubbyhole-response-wrapping") + pCubby, err := core.policyStore.GetPolicy("response-wrapping") if err != nil { t.Fatalf("err: %v", err) } diff --git a/vault/request_handling.go b/vault/request_handling.go index 9a92fa85cc76..7cefb2a9bba9 100644 --- a/vault/request_handling.go +++ b/vault/request_handling.go @@ -378,7 +378,7 @@ func (c *Core) wrapInCubbyhole(req *logical.Request, resp *logical.Response) (*l creationTime := time.Now() te := TokenEntry{ Path: req.Path, - Policies: []string{"cubbyhole-response-wrapping"}, + Policies: []string{"response-wrapping"}, CreationTime: creationTime.Unix(), TTL: resp.WrapInfo.TTL, NumUses: 1, @@ -432,7 +432,7 @@ func (c *Core) wrapInCubbyhole(req *logical.Request, resp *logical.Response) (*l auth := &logical.Auth{ ClientToken: te.ID, - Policies: []string{"cubbyhole-response-wrapping"}, + Policies: []string{"response-wrapping"}, LeaseOptions: logical.LeaseOptions{ TTL: te.TTL, Renewable: false,