Commit 93649a1
Add request ID tracking to token validation for support correlation (#6821)
* Send X-Request-ID with token validation and surface it on failure
Tag every call to /api/v1/authenticate/me with a client-generated
X-Request-ID header and quote it in the (now visible) warning/error when
validation fails, so intermittent auth failures can be correlated with
control-plane logs. Expose the id via get_auth_request_id() for
downstream packages (e.g. reflex-enterprise) to include in their own
error messages.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CuGeE8ncgcXTmCTfuP3DE2
* Add news fragment for auth request id feature
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CuGeE8ncgcXTmCTfuP3DE2
* Carry request id on token validation exceptions
Address review: the process-global last-request-id could misreport
under concurrent validations. validate_token now raises
TokenValidationError / TokenAccessDeniedError (backward compatible
with Exception / ValueError) carrying the request id of their own
request, and validate_token_with_retries prefers that over the global.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CuGeE8ncgcXTmCTfuP3DE2
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent d8aaddf commit 93649a1
4 files changed
Lines changed: 128 additions & 14 deletions
File tree
- packages/reflex-hosting-cli
- news
- src/reflex_cli/utils
- tests/units/reflex_cli/utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
12 | 34 | | |
13 | 35 | | |
14 | 36 | | |
| |||
Lines changed: 46 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
389 | 391 | | |
390 | 392 | | |
391 | 393 | | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
392 | 412 | | |
393 | 413 | | |
394 | 414 | | |
| |||
399 | 419 | | |
400 | 420 | | |
401 | 421 | | |
402 | | - | |
403 | | - | |
| 422 | + | |
| 423 | + | |
404 | 424 | | |
405 | 425 | | |
406 | 426 | | |
407 | 427 | | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
408 | 431 | | |
409 | 432 | | |
410 | 433 | | |
| |||
415 | 438 | | |
416 | 439 | | |
417 | 440 | | |
418 | | - | |
| 441 | + | |
419 | 442 | | |
420 | 443 | | |
421 | 444 | | |
422 | 445 | | |
423 | 446 | | |
424 | 447 | | |
425 | | - | |
426 | | - | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
427 | 452 | | |
428 | | - | |
429 | | - | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
430 | 457 | | |
431 | | - | |
432 | | - | |
| 458 | + | |
| 459 | + | |
433 | 460 | | |
434 | | - | |
435 | | - | |
| 461 | + | |
| 462 | + | |
436 | 463 | | |
437 | 464 | | |
438 | 465 | | |
| |||
2486 | 2513 | | |
2487 | 2514 | | |
2488 | 2515 | | |
2489 | | - | |
2490 | | - | |
| 2516 | + | |
| 2517 | + | |
| 2518 | + | |
| 2519 | + | |
2491 | 2520 | | |
2492 | 2521 | | |
2493 | | - | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
2494 | 2526 | | |
2495 | 2527 | | |
2496 | 2528 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| 39 | + | |
| 40 | + | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
| |||
592 | 596 | | |
593 | 597 | | |
594 | 598 | | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
0 commit comments