mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix(coderd): fetch workspace agent scripts and log sources using system auth ctx (#10043)
* add failing unit test * fetch log sources and agent scripts using system auth ctx
This commit is contained in:
@@ -68,11 +68,13 @@ func (api *API) workspaceAgent(rw http.ResponseWriter, r *http.Request) {
|
||||
return err
|
||||
})
|
||||
eg.Go(func() (err error) {
|
||||
scripts, err = api.Database.GetWorkspaceAgentScriptsByAgentIDs(ctx, []uuid.UUID{workspaceAgent.ID})
|
||||
//nolint:gocritic // TODO: can we make this not require system restricted?
|
||||
scripts, err = api.Database.GetWorkspaceAgentScriptsByAgentIDs(dbauthz.AsSystemRestricted(ctx), []uuid.UUID{workspaceAgent.ID})
|
||||
return err
|
||||
})
|
||||
eg.Go(func() (err error) {
|
||||
logSources, err = api.Database.GetWorkspaceAgentLogSourcesByAgentIDs(ctx, []uuid.UUID{workspaceAgent.ID})
|
||||
//nolint:gocritic // TODO: can we make this not require system restricted?
|
||||
logSources, err = api.Database.GetWorkspaceAgentLogSourcesByAgentIDs(dbauthz.AsSystemRestricted(ctx), []uuid.UUID{workspaceAgent.ID})
|
||||
return err
|
||||
})
|
||||
err := eg.Wait()
|
||||
|
||||
Reference in New Issue
Block a user