@@ -153,10 +153,7 @@ func TestAuthorizeAllEndpoints(t *testing.T) {
153
153
"GET:/api/v2/workspaceagents/me/listen" : {NoAuthorize : true },
154
154
"GET:/api/v2/workspaceagents/me/metadata" : {NoAuthorize : true },
155
155
"GET:/api/v2/workspaceagents/me/turn" : {NoAuthorize : true },
156
- "GET:/api/v2/workspaceagents/{workspaceagent}" : {NoAuthorize : true },
157
- "GET:/api/v2/workspaceagents/{workspaceagent}/dial" : {NoAuthorize : true },
158
156
"GET:/api/v2/workspaceagents/{workspaceagent}/iceservers" : {NoAuthorize : true },
159
- "GET:/api/v2/workspaceagents/{workspaceagent}/pty" : {NoAuthorize : true },
160
157
"GET:/api/v2/workspaceagents/{workspaceagent}/turn" : {NoAuthorize : true },
161
158
162
159
// These endpoints have more assertions. This is good, add more endpoints to assert if you can!
@@ -210,6 +207,18 @@ func TestAuthorizeAllEndpoints(t *testing.T) {
210
207
AssertAction : rbac .ActionRead ,
211
208
AssertObject : workspaceRBACObj ,
212
209
},
210
+ "GET:/api/v2/workspaceagents/{workspaceagent}" : {
211
+ AssertAction : rbac .ActionRead ,
212
+ AssertObject : workspaceRBACObj ,
213
+ },
214
+ "GET:/api/v2/workspaceagents/{workspaceagent}/dial" : {
215
+ AssertAction : rbac .ActionUpdate ,
216
+ AssertObject : workspaceRBACObj ,
217
+ },
218
+ "GET:/api/v2/workspaceagents/{workspaceagent}/pty" : {
219
+ AssertAction : rbac .ActionUpdate ,
220
+ AssertObject : workspaceRBACObj ,
221
+ },
213
222
"GET:/api/v2/workspaces/" : {
214
223
StatusCode : http .StatusOK ,
215
224
AssertAction : rbac .ActionRead ,
@@ -378,6 +387,7 @@ func TestAuthorizeAllEndpoints(t *testing.T) {
378
387
route = strings .ReplaceAll (route , "{workspacebuild}" , workspace .LatestBuild .ID .String ())
379
388
route = strings .ReplaceAll (route , "{workspacename}" , workspace .Name )
380
389
route = strings .ReplaceAll (route , "{workspacebuildname}" , workspace .LatestBuild .Name )
390
+ route = strings .ReplaceAll (route , "{workspaceagent}" , workspaceResources [0 ].Agents [0 ].ID .String ())
381
391
route = strings .ReplaceAll (route , "{template}" , template .ID .String ())
382
392
route = strings .ReplaceAll (route , "{hash}" , file .Hash )
383
393
route = strings .ReplaceAll (route , "{workspaceresource}" , workspaceResources [0 ].ID .String ())
0 commit comments