Skip to content
Closed
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
add auth context to db call
  • Loading branch information
hugodutka committed Jan 28, 2025
commit 24b29e25c2d493a5702b774bc0015100bf3e4f9e
5 changes: 4 additions & 1 deletion coderd/telemetry/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/coder/coder/v2/buildinfo"
clitelemetry "github.com/coder/coder/v2/cli/telemetry"
"github.com/coder/coder/v2/coderd/database"
"github.com/coder/coder/v2/coderd/database/dbauthz"
"github.com/coder/coder/v2/coderd/database/dbtime"
"github.com/coder/coder/v2/codersdk"
tailnetproto "github.com/coder/coder/v2/tailnet/proto"
Expand Down Expand Up @@ -536,7 +537,9 @@ func (r *remoteReporter) createSnapshot() (*Snapshot, error) {
// no longer be reported, and there will be no other indicator that it
// was deleted. This requires special handling when interpreting the
// telemetry data later.
orgs, err := r.options.Database.GetOrganizations(ctx, database.GetOrganizationsParams{})
// nolint:gocritic // AsSystemRestricted is fine here because it's a read-only operation
// used for telemetry reporting.
orgs, err := r.options.Database.GetOrganizations(dbauthz.AsSystemRestricted(r.ctx), database.GetOrganizationsParams{})
if err != nil {
return xerrors.Errorf("get organizations: %w", err)
}
Expand Down
Loading