Commit c31d2f2
committed
Allow private addresses for explicit URLs in fedify lookup
Since v2.1, `fedify lookup` rejected localhost URLs unless
`-p`/`--allow-private-address` was passed, because the CLI began
forwarding `allowPrivateAddress=false` to the vocab-runtime document
loader, whose `validatePublicUrl` check blocks loopback addresses.
Split the document/auth loaders into two:
- An "initial" loader that always allows private addresses, used for
URLs explicitly provided on the command line (plain lookup, the
first fetch in `--traverse`, and the first fetch in `--recurse`).
- The existing loader, which continues to honor
`--allow-private-address`, used for URLs discovered from remote
responses (traversal pages and recursion targets).
This preserves SSRF protection against `http://localhost/...` URLs
embedded in remote `first`/`next`/`inReplyTo` fields while letting
users look up local servers without extra flags.
Assisted-by: Claude Code:claude-opus-4-71 parent 53bb51a commit c31d2f2
1 file changed
Lines changed: 38 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
87 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| |||
716 | 717 | | |
717 | 718 | | |
718 | 719 | | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
719 | 732 | | |
720 | 733 | | |
721 | 734 | | |
| |||
734 | 747 | | |
735 | 748 | | |
736 | 749 | | |
| 750 | + | |
737 | 751 | | |
738 | 752 | | |
739 | 753 | | |
| |||
836 | 850 | | |
837 | 851 | | |
838 | 852 | | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
839 | 871 | | |
840 | 872 | | |
841 | 873 | | |
| |||
885 | 917 | | |
886 | 918 | | |
887 | 919 | | |
888 | | - | |
889 | | - | |
| 920 | + | |
| 921 | + | |
890 | 922 | | |
891 | 923 | | |
892 | 924 | | |
| |||
1109 | 1141 | | |
1110 | 1142 | | |
1111 | 1143 | | |
1112 | | - | |
| 1144 | + | |
1113 | 1145 | | |
1114 | 1146 | | |
1115 | 1147 | | |
| |||
1248 | 1280 | | |
1249 | 1281 | | |
1250 | 1282 | | |
1251 | | - | |
| 1283 | + | |
1252 | 1284 | | |
1253 | 1285 | | |
1254 | 1286 | | |
| |||
0 commit comments