Skip to content

improve performance of workspace agent authorization #8065

Closed
@johnstcn

Description

@johnstcn

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

Metadata

Metadata

Assignees

Labels

scaletestIssues related to scale testing.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions