Rename up path to internal/ui/mounts/<path> (#4435)
This commit is contained in:
parent
fbb5e201f5
commit
6d447d2671
|
@ -41,7 +41,7 @@ func kvReadRequest(client *api.Client, path string, params map[string]string) (*
|
|||
}
|
||||
|
||||
func kvPreflightVersionRequest(client *api.Client, path string) (string, int, error) {
|
||||
r := client.NewRequest("GET", "/v1/sys/internal/ui/mount/"+path)
|
||||
r := client.NewRequest("GET", "/v1/sys/internal/ui/mounts/"+path)
|
||||
resp, err := client.RawRequest(r)
|
||||
if resp != nil {
|
||||
defer resp.Body.Close()
|
||||
|
|
|
@ -94,7 +94,7 @@ func NewSystemBackend(core *Core, logger log.Logger) *SystemBackend {
|
|||
"wrapping/pubkey",
|
||||
"replication/status",
|
||||
"internal/ui/mounts",
|
||||
"internal/ui/mount/*",
|
||||
"internal/ui/mounts/*",
|
||||
},
|
||||
},
|
||||
|
||||
|
@ -1079,7 +1079,7 @@ func NewSystemBackend(core *Core, logger log.Logger) *SystemBackend {
|
|||
HelpDescription: strings.TrimSpace(sysHelp["internal-ui-mounts"][1]),
|
||||
},
|
||||
&framework.Path{
|
||||
Pattern: "internal/ui/mount/(?P<path>.+)",
|
||||
Pattern: "internal/ui/mounts/(?P<path>.+)",
|
||||
Fields: map[string]*framework.FieldSchema{
|
||||
"path": &framework.FieldSchema{
|
||||
Type: framework.TypeString,
|
||||
|
|
|
@ -2386,7 +2386,7 @@ func TestSystemBackend_InternalUIMount(t *testing.T) {
|
|||
t.Fatalf("Bad %#v %#v", err, resp)
|
||||
}
|
||||
|
||||
req = logical.TestRequest(t, logical.ReadOperation, "internal/ui/mount/kv/bar")
|
||||
req = logical.TestRequest(t, logical.ReadOperation, "internal/ui/mounts/kv/bar")
|
||||
req.ClientToken = rootToken
|
||||
resp, err = b.HandleRequest(context.Background(), req)
|
||||
if err != nil || (resp != nil && resp.IsError()) {
|
||||
|
@ -2398,14 +2398,14 @@ func TestSystemBackend_InternalUIMount(t *testing.T) {
|
|||
|
||||
testMakeToken(t, core.tokenStore, rootToken, "tokenid", "", []string{"secret"})
|
||||
|
||||
req = logical.TestRequest(t, logical.ReadOperation, "internal/ui/mount/kv")
|
||||
req = logical.TestRequest(t, logical.ReadOperation, "internal/ui/mounts/kv")
|
||||
req.ClientToken = "tokenid"
|
||||
resp, err = b.HandleRequest(context.Background(), req)
|
||||
if err != logical.ErrPermissionDenied {
|
||||
t.Fatal("expected permission denied error")
|
||||
}
|
||||
|
||||
req = logical.TestRequest(t, logical.ReadOperation, "internal/ui/mount/secret")
|
||||
req = logical.TestRequest(t, logical.ReadOperation, "internal/ui/mounts/secret")
|
||||
req.ClientToken = "tokenid"
|
||||
resp, err = b.HandleRequest(context.Background(), req)
|
||||
if err != nil || (resp != nil && resp.IsError()) {
|
||||
|
@ -2415,7 +2415,7 @@ func TestSystemBackend_InternalUIMount(t *testing.T) {
|
|||
t.Fatalf("Bad Response: %#v", resp)
|
||||
}
|
||||
|
||||
req = logical.TestRequest(t, logical.ReadOperation, "internal/ui/mount/sys")
|
||||
req = logical.TestRequest(t, logical.ReadOperation, "internal/ui/mounts/sys")
|
||||
req.ClientToken = "tokenid"
|
||||
resp, err = b.HandleRequest(context.Background(), req)
|
||||
if err != nil || (resp != nil && resp.IsError()) {
|
||||
|
@ -2425,7 +2425,7 @@ func TestSystemBackend_InternalUIMount(t *testing.T) {
|
|||
t.Fatalf("Bad Response: %#v", resp)
|
||||
}
|
||||
|
||||
req = logical.TestRequest(t, logical.ReadOperation, "internal/ui/mount/non-existent")
|
||||
req = logical.TestRequest(t, logical.ReadOperation, "internal/ui/mounts/non-existent")
|
||||
req.ClientToken = "tokenid"
|
||||
resp, err = b.HandleRequest(context.Background(), req)
|
||||
if err != logical.ErrPermissionDenied {
|
||||
|
|
Loading…
Reference in New Issue