Commit ec284b0
fix(api,cli): stop auto-deriving RFC 8707 resource indicator from URL (#5204)
* fix(api): stop auto-deriving RFC 8707 resource indicator from URL
The API path unconditionally derived the RFC 8707 resource parameter
from the server URL, while the CLI only did so when --resource-url was
explicitly passed. This broke OAuth for servers like Common Room that
don't support RFC 8707.
Remove the automatic URL-to-resource fallback in both
buildRemoteAuthConfigFromMetadata and createRequestToRemoteAuthConfig,
keeping only user-provided and metadata-provided resource values.
Fixes: #5203
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* test(api): add resource indicator tests for createRequestToRemoteAuthConfig
Verify that resource is NOT auto-derived from URL when not explicitly
set, and that an explicitly provided resource is preserved verbatim.
These tests guard against re-introducing the removed fallback derivation.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(api,cli): remove auto-derivation of RFC 8707 resource from all paths
Also fix the CLI registry path (getRemoteAuthFromRemoteServerMetadata)
which had the same unconditional fallback to DefaultResourceIndicator.
Inline orphaned variable in createRequestToRemoteAuthConfig.
The resource parameter is now only set when explicitly provided by the
user or registry metadata, matching the behavior of the direct CLI path
which gates on --resource-url.
Refs: #5203
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* chore: address review nits — clarify comments
Add explanatory comment on registry path resource assignment
explaining why --resource-url derivation is intentionally skipped.
Reword test comment to be reader-facing rather than author-local.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent bf3ebe7 commit ec284b0
4 files changed
Lines changed: 47 additions & 19 deletions
File tree
- cmd/thv/app
- pkg/api/v1
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
948 | 948 | | |
949 | 949 | | |
950 | 950 | | |
951 | | - | |
952 | | - | |
953 | | - | |
954 | | - | |
955 | | - | |
956 | | - | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
957 | 956 | | |
958 | 957 | | |
959 | 958 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
432 | | - | |
| 432 | + | |
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | 437 | | |
441 | 438 | | |
442 | 439 | | |
| |||
466 | 463 | | |
467 | 464 | | |
468 | 465 | | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | 466 | | |
476 | 467 | | |
477 | 468 | | |
| |||
480 | 471 | | |
481 | 472 | | |
482 | 473 | | |
483 | | - | |
| 474 | + | |
484 | 475 | | |
485 | 476 | | |
486 | 477 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
753 | 753 | | |
754 | 754 | | |
755 | 755 | | |
756 | | - | |
| 756 | + | |
757 | 757 | | |
758 | 758 | | |
759 | 759 | | |
| |||
762 | 762 | | |
763 | 763 | | |
764 | 764 | | |
765 | | - | |
| 765 | + | |
766 | 766 | | |
767 | 767 | | |
768 | 768 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
515 | 515 | | |
516 | 516 | | |
517 | 517 | | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
518 | 556 | | |
519 | 557 | | |
520 | 558 | | |
| |||
0 commit comments