Commit 1a81e68
committed
feat(057): /mcp/p/<slug> profile routing + 4-surface filter + tests (T008-T022)
- profileMiddleware in server.go: resolves slug from config snapshot, builds
ProfileScope, injects into context, 404s on missing/unknown profile
- /mcp/p/ and /mcp/p routes registered after mcpAuthMiddleware (auth->profile)
- retrieve_tools filter (T010): profile.Allows() independent of enforceAgentScope
- call_tool_* filter (T011): profile error before token-scope check, names profile
- upstream_servers list filter (T011a): excludes out-of-profile servers
- code_execution filter (T011b): profile servers intersected into AllowedServers
so empty caller list at a profile URL does not mean 'allow all'
- ProfileScope.AllowedServerNames() helper for T011b intersection
- withProfileMeta() injects metadata["profile"] at activity emit sites (T019)
- Integration tests: 404-no-profiles, 404-unknown-slug, retrieve_tools isolation,
full /mcp union unchanged, call_tool_* out-of-profile rejection, upstream_servers
list filtering, policy intersection, per-server disabled_tools guard, activity
metadata smoke-test, backward-compat endpoint reachability (T012-T018/T020)
- docs/features/profiles.md
Related #551 parent f91d0a6 commit 1a81e68
6 files changed
Lines changed: 774 additions & 1 deletion
File tree
- docs/features
- internal
- profile
- server
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
54 | 68 | | |
55 | 69 | | |
56 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
443 | 444 | | |
444 | 445 | | |
445 | 446 | | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
446 | 460 | | |
447 | 461 | | |
448 | 462 | | |
| |||
1111 | 1125 | | |
1112 | 1126 | | |
1113 | 1127 | | |
| 1128 | + | |
| 1129 | + | |
1114 | 1130 | | |
1115 | 1131 | | |
1116 | 1132 | | |
| |||
1142 | 1158 | | |
1143 | 1159 | | |
1144 | 1160 | | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
1145 | 1166 | | |
1146 | 1167 | | |
1147 | 1168 | | |
| |||
1525 | 1546 | | |
1526 | 1547 | | |
1527 | 1548 | | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
1528 | 1557 | | |
1529 | 1558 | | |
1530 | 1559 | | |
| |||
1888 | 1917 | | |
1889 | 1918 | | |
1890 | 1919 | | |
| 1920 | + | |
1891 | 1921 | | |
1892 | 1922 | | |
1893 | 1923 | | |
| |||
2777 | 2807 | | |
2778 | 2808 | | |
2779 | 2809 | | |
| 2810 | + | |
| 2811 | + | |
| 2812 | + | |
| 2813 | + | |
| 2814 | + | |
| 2815 | + | |
| 2816 | + | |
| 2817 | + | |
| 2818 | + | |
| 2819 | + | |
| 2820 | + | |
| 2821 | + | |
2780 | 2822 | | |
2781 | 2823 | | |
2782 | 2824 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
190 | 191 | | |
191 | 192 | | |
192 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
193 | 220 | | |
194 | 221 | | |
195 | 222 | | |
| |||
0 commit comments