@@ -220,6 +220,7 @@ func TestAuthorizeAllEndpoints(t *testing.T) {
220
220
221
221
// Some quick reused objects
222
222
workspaceRBACObj := rbac .ResourceWorkspace .InOrg (organization .ID ).WithOwner (workspace .OwnerID .String ())
223
+ workspaceExecObj := rbac .ResourceWorkspaceExecution .InOrg (organization .ID ).WithOwner (workspace .OwnerID .String ())
223
224
224
225
// skipRoutes allows skipping routes from being checked.
225
226
skipRoutes := map [string ]string {
@@ -268,7 +269,6 @@ func TestAuthorizeAllEndpoints(t *testing.T) {
268
269
"GET:/api/v2/workspaceagents/me/wireguardlisten" : {NoAuthorize : true },
269
270
"POST:/api/v2/workspaceagents/me/keys" : {NoAuthorize : true },
270
271
"GET:/api/v2/workspaceagents/{workspaceagent}/iceservers" : {NoAuthorize : true },
271
- "GET:/api/v2/workspaceagents/{workspaceagent}/turn" : {NoAuthorize : true },
272
272
"GET:/api/v2/workspaceagents/{workspaceagent}/derp" : {NoAuthorize : true },
273
273
274
274
// These endpoints have more assertions. This is good, add more endpoints to assert if you can!
@@ -331,12 +331,16 @@ func TestAuthorizeAllEndpoints(t *testing.T) {
331
331
AssertObject : workspaceRBACObj ,
332
332
},
333
333
"GET:/api/v2/workspaceagents/{workspaceagent}/dial" : {
334
- AssertAction : rbac .ActionUpdate ,
335
- AssertObject : workspaceRBACObj ,
334
+ AssertAction : rbac .ActionCreate ,
335
+ AssertObject : workspaceExecObj ,
336
+ },
337
+ "GET:/api/v2/workspaceagents/{workspaceagent}/turn" : {
338
+ AssertAction : rbac .ActionCreate ,
339
+ AssertObject : workspaceExecObj ,
336
340
},
337
341
"GET:/api/v2/workspaceagents/{workspaceagent}/pty" : {
338
- AssertAction : rbac .ActionUpdate ,
339
- AssertObject : workspaceRBACObj ,
342
+ AssertAction : rbac .ActionCreate ,
343
+ AssertObject : workspaceExecObj ,
340
344
},
341
345
"GET:/api/v2/workspaces/" : {
342
346
StatusCode : http .StatusOK ,
0 commit comments