Commit f75bb28
committed
fix(oauth2): scope Native client custom-scheme lock to payloads that touch URI fields
ClientService::create()/update() acquired the TOCTOU lock
(NATIVE_CUSTOM_SCHEME_REGISTRATION_LOCK) whenever application_type was
Native, regardless of whether the payload touched redirect_uris,
allowed_origins, or post_logout_redirect_uris. A plain app_name rename
on one Native client therefore contended with an unrelated tenant's
scheme registration, producing spurious "please retry" 412s.
Extract NATIVE_CUSTOM_SCHEME_URI_FIELDS as the single source of truth
for which fields matter, shared by assertNativeCustomSchemesAllowed()
and the new payloadTouchesNativeCustomSchemeFields() gate. The lock is
now taken only when the payload actually registers a custom scheme -
matching what the SHORTCUT comment on the lock constant already
claimed.
Found during /review-pr-deep review of PR #147.1 parent 889c57c commit f75bb28
2 files changed
Lines changed: 59 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
68 | 76 | | |
69 | 77 | | |
70 | 78 | | |
| |||
154 | 162 | | |
155 | 163 | | |
156 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
157 | 182 | | |
158 | 183 | | |
159 | 184 | | |
| |||
286 | 311 | | |
287 | 312 | | |
288 | 313 | | |
289 | | - | |
| 314 | + | |
290 | 315 | | |
291 | 316 | | |
292 | 317 | | |
| |||
351 | 376 | | |
352 | 377 | | |
353 | 378 | | |
354 | | - | |
| 379 | + | |
| 380 | + | |
355 | 381 | | |
356 | 382 | | |
357 | 383 | | |
| |||
450 | 476 | | |
451 | 477 | | |
452 | 478 | | |
453 | | - | |
| 479 | + | |
| 480 | + | |
454 | 481 | | |
455 | 482 | | |
456 | 483 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
445 | 445 | | |
446 | 446 | | |
447 | 447 | | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
448 | 477 | | |
0 commit comments