File tree 2 files changed +0
-33
lines changed
2 files changed +0
-33
lines changed Original file line number Diff line number Diff line change @@ -44,14 +44,6 @@ func ExtractWorkspaceParam(db database.Store) func(http.Handler) http.Handler {
44
44
return
45
45
}
46
46
47
- apiKey := APIKey (r )
48
- if apiKey .UserID != workspace .OwnerID {
49
- httpapi .Write (rw , http .StatusUnauthorized , httpapi.Response {
50
- Message : "getting non-personal workspaces isn't supported" ,
51
- })
52
- return
53
- }
54
-
55
47
ctx := context .WithValue (r .Context (), workspaceParamContextKey {}, workspace )
56
48
next .ServeHTTP (rw , r .WithContext (ctx ))
57
49
})
Original file line number Diff line number Diff line change @@ -92,31 +92,6 @@ func TestWorkspaceParam(t *testing.T) {
92
92
require .Equal (t , http .StatusNotFound , res .StatusCode )
93
93
})
94
94
95
- t .Run ("NonPersonal" , func (t * testing.T ) {
96
- t .Parallel ()
97
- db := databasefake .New ()
98
- rtr := chi .NewRouter ()
99
- rtr .Use (
100
- httpmw .ExtractAPIKey (db , nil ),
101
- httpmw .ExtractWorkspaceParam (db ),
102
- )
103
- rtr .Get ("/" , nil )
104
- r , _ := setup (db )
105
- workspace , err := db .InsertWorkspace (context .Background (), database.InsertWorkspaceParams {
106
- ID : uuid .New (),
107
- OwnerID : uuid .New (),
108
- Name : "hello" ,
109
- })
110
- require .NoError (t , err )
111
- chi .RouteContext (r .Context ()).URLParams .Add ("workspace" , workspace .ID .String ())
112
- rw := httptest .NewRecorder ()
113
- rtr .ServeHTTP (rw , r )
114
-
115
- res := rw .Result ()
116
- defer res .Body .Close ()
117
- require .Equal (t , http .StatusUnauthorized , res .StatusCode )
118
- })
119
-
120
95
t .Run ("Found" , func (t * testing.T ) {
121
96
t .Parallel ()
122
97
db := databasefake .New ()
You can’t perform that action at this time.
0 commit comments