Closed
Description
From a TODO in coderd/httpmw/workspaceagent.go
:
Every time we authorize a workspace agent with its API token, we look up the roles of the workspace owner. This currently involves:
- GetWorkspaceByAgentID
- GetUserByID
- GetAuthorizationUserRoles
We can improve this by:
- Creating a single query for the above mapping AgentID -> owner roles
- Creating an in-memory cache for the above which is updated in the background