Skip to content

Commit 2aa89be

Browse files
Merge pull request #207 from brevdev/remove-approval
Remove approval
2 parents 2e6c8a5 + 5c41779 commit 2aa89be

File tree

4 files changed

+1
-47
lines changed

4 files changed

+1
-47
lines changed

pkg/cmd/cmd.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"fmt"
66

77
"github.com/brevdev/brev-cli/pkg/auth"
8-
"github.com/brevdev/brev-cli/pkg/cmd/approve"
98
"github.com/brevdev/brev-cli/pkg/cmd/autostop"
109
"github.com/brevdev/brev-cli/pkg/cmd/background"
1110
"github.com/brevdev/brev-cli/pkg/cmd/bmon"
@@ -246,7 +245,6 @@ func createCmdTree(cmd *cobra.Command, t *terminal.Terminal, loginCmdStore *stor
246245
if featureflag.IsDev() {
247246
_ = 0 // noop
248247
cmd.AddCommand(test.NewCmdTest(t, noLoginCmdStore))
249-
cmd.AddCommand(approve.NewCmdApprove(t, loginCmdStore))
250248
cmd.AddCommand(clipboard.EstablishConnection(t, loginCmdStore))
251249
cmd.AddCommand(clipboard.SendToClipboard(t, loginCmdStore))
252250
cmd.AddCommand(clipboard.ForwardPort(t, loginCmdStore))

pkg/store/user.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -111,25 +111,6 @@ func (s AuthHTTPStore) UpdateUser(userID string, updatedUser *entity.UpdateUser)
111111
var usersIDPathPattern = fmt.Sprintf("%s/%s", usersPath, "%s")
112112

113113
// usersIDPath = fmt.Sprintf(usersIDPathPattern, fmt.Sprintf("{%s}", userIDParamStr))
114-
// usersApprovePathPattern = fmt.Sprintf("%s/approve", usersIDPathPattern)
115-
// usersApprovePath = fmt.Sprintf(usersApprovePathPattern, userIDParamStr)
116-
117-
func (s AuthHTTPStore) ApproveUserByID(userID string) (*entity.User, error) {
118-
var result entity.User
119-
res, err := s.authHTTPClient.restyClient.R().
120-
SetHeader("Content-Type", "application/json").
121-
// SetPathParam(userIDParamName, userID).
122-
SetResult(&result).
123-
Post(usersPath + "/" + userID + "/approve")
124-
if err != nil {
125-
return nil, breverrors.WrapAndTrace(err)
126-
}
127-
if res.IsError() {
128-
return nil, NewHTTPResponseError(res)
129-
}
130-
131-
return &result, nil
132-
}
133114

134115
func (s AuthHTTPStore) GetUsers(queryParams map[string]string) ([]entity.User, error) {
135116
var result []entity.User

pkg/store/user_test.go

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -128,29 +128,3 @@ func TestUpdateUser(t *testing.T) {
128128
return
129129
}
130130
}
131-
132-
func TestApproveUser(t *testing.T) {
133-
s := MakeMockAuthHTTPStore()
134-
httpmock.ActivateNonDefault(s.authHTTPClient.restyClient.GetClient())
135-
136-
expected := &entity.User{
137-
ID: "1",
138-
}
139-
res, err := httpmock.NewJsonResponder(200, expected)
140-
if !assert.Nil(t, err) {
141-
return
142-
}
143-
url := fmt.Sprintf("=~^%s/%s/%s/approve.+", s.authHTTPClient.restyClient.BaseURL, usersPath, expected.ID)
144-
httpmock.RegisterResponder("POST", url, res)
145-
146-
u, err := s.ApproveUserByID(expected.ID)
147-
if !assert.Nil(t, err) {
148-
return
149-
}
150-
if !assert.NotNil(t, u) {
151-
return
152-
}
153-
if !assert.Equal(t, expected, u) {
154-
return
155-
}
156-
}

pkg/util/util.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ func runVsCodeCommand(vscodepath string, args []string) ([]byte, error) {
141141
var commonVSCodePaths = []string{
142142
"code",
143143
"/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code",
144+
"/mnt/c/Program Files/Microsoft VS Code/bin/code",
144145
"/usr/bin/code",
145146
"/usr/local/bin/code",
146147
"/snap/bin/code",

0 commit comments

Comments
 (0)