Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2383f64

Browse files
authored
fix: add dbauthz for streaming startup logs (#6758)
This was causing logs to end early!
1 parent88e24db commit2383f64

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎coderd/workspaceagents.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ func (api *API) workspaceAgentStartupLogs(rw http.ResponseWriter, r *http.Reques
367367
// This mostly copies how provisioner job logs are streamed!
368368
var (
369369
ctx=r.Context()
370+
actor,_=dbauthz.ActorFromContext(ctx)
370371
workspaceAgent=httpmw.WorkspaceAgentParam(r)
371372
workspace=httpmw.WorkspaceParam(r)
372373
logger=api.Logger.With(slog.F("workspace_agent_id",workspaceAgent.ID))
@@ -475,7 +476,7 @@ func (api *API) workspaceAgentStartupLogs(rw http.ResponseWriter, r *http.Reques
475476
}
476477

477478
ifjlMsg.CreatedAfter!=0 {
478-
logs,err:=api.Database.GetWorkspaceAgentStartupLogsAfter(ctx, database.GetWorkspaceAgentStartupLogsAfterParams{
479+
logs,err:=api.Database.GetWorkspaceAgentStartupLogsAfter(dbauthz.As(ctx,actor), database.GetWorkspaceAgentStartupLogsAfterParams{
479480
AgentID:workspaceAgent.ID,
480481
CreatedAfter:jlMsg.CreatedAfter,
481482
})
@@ -488,7 +489,7 @@ func (api *API) workspaceAgentStartupLogs(rw http.ResponseWriter, r *http.Reques
488489

489490
ifjlMsg.EndOfLogs {
490491
endOfLogs.Store(true)
491-
logs,err:=api.Database.GetWorkspaceAgentStartupLogsAfter(ctx, database.GetWorkspaceAgentStartupLogsAfterParams{
492+
logs,err:=api.Database.GetWorkspaceAgentStartupLogsAfter(dbauthz.As(ctx,actor), database.GetWorkspaceAgentStartupLogsAfterParams{
492493
AgentID:workspaceAgent.ID,
493494
CreatedAfter:lastSentLogID.Load(),
494495
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp