@@ -153,10 +153,7 @@ func TestAuthorizeAllEndpoints(t *testing.T) {
153153 "GET:/api/v2/workspaceagents/me/listen" : {NoAuthorize : true },
154154 "GET:/api/v2/workspaceagents/me/metadata" : {NoAuthorize : true },
155155 "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 },
158156 "GET:/api/v2/workspaceagents/{workspaceagent}/iceservers" : {NoAuthorize : true },
159- "GET:/api/v2/workspaceagents/{workspaceagent}/pty" : {NoAuthorize : true },
160157 "GET:/api/v2/workspaceagents/{workspaceagent}/turn" : {NoAuthorize : true },
161158
162159 // 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) {
210207 AssertAction : rbac .ActionRead ,
211208 AssertObject : workspaceRBACObj ,
212209 },
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+ },
213222 "GET:/api/v2/workspaces/" : {
214223 StatusCode : http .StatusOK ,
215224 AssertAction : rbac .ActionRead ,
@@ -378,6 +387,7 @@ func TestAuthorizeAllEndpoints(t *testing.T) {
378387 route = strings .ReplaceAll (route , "{workspacebuild}" , workspace .LatestBuild .ID .String ())
379388 route = strings .ReplaceAll (route , "{workspacename}" , workspace .Name )
380389 route = strings .ReplaceAll (route , "{workspacebuildname}" , workspace .LatestBuild .Name )
390+ route = strings .ReplaceAll (route , "{workspaceagent}" , workspaceResources [0 ].Agents [0 ].ID .String ())
381391 route = strings .ReplaceAll (route , "{template}" , template .ID .String ())
382392 route = strings .ReplaceAll (route , "{hash}" , file .Hash )
383393 route = strings .ReplaceAll (route , "{workspaceresource}" , workspaceResources [0 ].ID .String ())
0 commit comments