Skip to content

Rename path to internal/ui/mounts/<path> #4435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion command/kv_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions vault/logical_system.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/*",
},
},

Expand Down Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions vault/logical_system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand All @@ -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()) {
Expand All @@ -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()) {
Expand All @@ -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 {
Expand Down