Commit 0fb6cf5
committed
fix(scim): make SCIM DELETE RFC 7644 compliant (WI-1310)
SCIM DELETE only flipped is_active=false while leaving scim_managed=true,
so a deprovisioned user stayed fetchable via GET /Users/{id}, listed by
/Users, switchable back to active via PUT/PATCH, and exposed through group
member projections. RFC 7644 §3.6 permits retaining a deleted resource
only when it returns 404 and is omitted from all query results.
SCIM DELETE now tombstones the user in one transaction: is_active=false
plus a new users.scim_deleted_at marker, and SCIM-managed group
memberships removed. Every SCIM user query (list, count, get, and the
group-member join and member-visibility guard) excludes tombstoned rows,
so subsequent operations report 404. PATCH active=false remains the
visible deactivation path. Re-provisioning a tombstoned email answers
409 uniqueness instead of silently resurrecting the account; the row is
retained for historical references and stays distinct from the
administrative offboarding state.
Also carries the regenerated api/openapi-v2.json left stale by the theme
logo commit.
Black-box regression coverage in core-tests: delete-then-404 on every
operation, list/filter omission, group membership cleanup, re-provision
conflict, and PATCH-active deactivation staying visible. Tested against
SQLite and PostgreSQL.1 parent bcbab2a commit 0fb6cf5
4 files changed
Lines changed: 64 additions & 10 deletions
File tree
- api
- internal
- database/schema
- handlers
- repository
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23676 | 23676 | | |
23677 | 23677 | | |
23678 | 23678 | | |
| 23679 | + | |
| 23680 | + | |
| 23681 | + | |
| 23682 | + | |
23679 | 23683 | | |
23680 | 23684 | | |
23681 | 23685 | | |
| |||
44147 | 44151 | | |
44148 | 44152 | | |
44149 | 44153 | | |
| 44154 | + | |
| 44155 | + | |
| 44156 | + | |
| 44157 | + | |
44150 | 44158 | | |
44151 | 44159 | | |
44152 | 44160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
| 169 | + | |
168 | 170 | | |
169 | 171 | | |
170 | 172 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
367 | 380 | | |
368 | 381 | | |
369 | 382 | | |
| |||
652 | 665 | | |
653 | 666 | | |
654 | 667 | | |
655 | | - | |
| 668 | + | |
656 | 669 | | |
657 | 670 | | |
658 | 671 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
| 59 | + | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
101 | 103 | | |
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
106 | 108 | | |
107 | 109 | | |
108 | | - | |
| 110 | + | |
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
| |||
178 | 180 | | |
179 | 181 | | |
180 | 182 | | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
185 | 216 | | |
186 | 217 | | |
187 | 218 | | |
| |||
229 | 260 | | |
230 | 261 | | |
231 | 262 | | |
232 | | - | |
| 263 | + | |
233 | 264 | | |
234 | 265 | | |
235 | 266 | | |
| |||
336 | 367 | | |
337 | 368 | | |
338 | 369 | | |
339 | | - | |
| 370 | + | |
340 | 371 | | |
341 | 372 | | |
342 | 373 | | |
| |||
0 commit comments