Commit 2f31554
邝谧
fix(push): add cross-tenant ownership check to DeleteAll + clean up owners map
DeleteAll previously had no ownership verification, allowing any caller
to delete arbitrary task push configs — a cross-tenant isolation bypass.
Changes:
- DeleteAll now calls checkOwner (same pattern as Delete) and returns
ErrTaskNotFound for cross-tenant access or nil for never-saved tasks.
- DeleteAll now cleans up s.owners[taskID] to prevent stale owner
entries after all configs are removed.
- CrossTenantIsolation test extended to cover DeleteAll.1 parent 6492d4f commit 2f31554
2 files changed
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
| 223 | + | |
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
227 | 235 | | |
| 236 | + | |
228 | 237 | | |
229 | 238 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
482 | 485 | | |
483 | 486 | | |
484 | 487 | | |
| |||
0 commit comments