Commit 10f8a38
committed
fix(webapp): require user auth + org-membership on replay action
The `action` handler in resources.taskruns.$runParam.replay.ts had no
`requireUser`/`requireUserId` call and the underlying PG findFirst was
keyed only on `friendlyId` — any request with a valid runParam could
POST a replay against any run. The buffered fallback inherited the same
gap.
Mirrors the canonical pattern from resources.taskruns.$runParam.cancel.ts:
- `await requireUser(request)` at the top of the action.
- PG findFirst scoped by `project.organization.members.some.userId`.
- Buffered path verifies org membership via `orgMember.findFirst`
against the snapshot's orgId before synthesising the TaskRun.
Devin-follow-up on PR #3757 (🚩 finding on commit bc6de3e). Surfaces
as a pre-existing PG-side auth gap that the new buffered surface would
have extended.
Target PR: phase-3-dashboard.1 parent e98fc8f commit 10f8a38
1 file changed
Lines changed: 32 additions & 0 deletions
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
250 | 259 | | |
251 | 260 | | |
252 | 261 | | |
| |||
260 | 269 | | |
261 | 270 | | |
262 | 271 | | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
263 | 281 | | |
264 | 282 | | |
265 | 283 | | |
| |||
285 | 303 | | |
286 | 304 | | |
287 | 305 | | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
288 | 320 | | |
289 | 321 | | |
290 | 322 | | |
| |||
0 commit comments