Skip to content

chore: enforce orgid in audit logs where required #12283

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 4 commits into from
Feb 26, 2024
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
Drop panic
  • Loading branch information
Emyrk committed Feb 23, 2024
commit d6b34eee35d91ce308350e2051e77d17f9590149
5 changes: 0 additions & 5 deletions coderd/audit/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,6 @@ func InitRequest[T Auditable](w http.ResponseWriter, p *RequestParams) (*Request
action = req.Action
}

if ResourceRequiresOrgID[T]() && p.OrganizationID == uuid.Nil {
// We panic as this is a developer error and should never happen.
panic(fmt.Sprintf("missing required organization ID for resource %s", either(req.Old, req.New, ResourceType[T], req.params.Action)))
}

ip := parseIP(p.Request.RemoteAddr)
auditLog := database.AuditLog{
ID: uuid.New(),
Expand Down