Skip to content

chore: reorder prebuilt workspace authorization logic #18506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 24, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: improve error message for failed workspace and prebuilt author…
…ization
  • Loading branch information
ssncferreira committed Jun 24, 2025
commit 1f0e33a6491cc70d7ff743a60e5cc19d69f16bc6
4 changes: 2 additions & 2 deletions coderd/database/dbauthz/dbauthz.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ func (q *querier) authorizePrebuiltWorkspace(ctx context.Context, action policy.
if prebuiltErr = q.authorizeContext(ctx, action, workspace.AsPrebuild()); prebuiltErr == nil {
return nil
}
return xerrors.Errorf("authorize context as prebuild: %w", errors.Join(workspaceErr, prebuiltErr))
return xerrors.Errorf("authorize context failed for workspace (%v) and prebuilt (%w)", workspaceErr, prebuiltErr)
}

return xerrors.Errorf("authorize context: %w", errors.Join(workspaceErr))
return xerrors.Errorf("authorize context: %w", workspaceErr)
}

type authContextKey struct{}
Expand Down
Loading