Phase 7 (Bridge): response shaper, diff tool, expanded mapper

- shaper.rs: shape_response() dispatches on core_path to wrap Core
  JSON in FUT envelope format; shapes auth (/ut/auth → sid/pid/
  phishingToken/persona envelope), profile, club, squad, market,
  packs; unknown paths pass through unchanged
- proxy.rs: calls shape_response() on every successful Core response
  before returning to the FIFA 23 client
- mapper.rs: expanded from 6 to 18 speculative FUT endpoint mappings
  covering auth, profile/settings, club/usermassinfo, item/collection,
  squad (GET+PUT), packs+purchase, transfer market+watchlist+bid,
  objectives, events, squad battles, and match result submission
- admin.rs: GET /_bridge/captures/diff?a=<id>&b=<id> compares two
  captures; reports method/path/status changes, header diffs, and
  structured JSON body diffs (key-level for objects, length for others)
- main.rs: registers /_bridge/captures/diff route
- Unit tests: 4 shaper tests, 6 mapper tests (10 total, all passing)
- All 13 integration tests still passing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
funman300
2026-06-25 16:32:37 -07:00
parent 3b7a4928c9
commit b8e766e9dd
6 changed files with 510 additions and 14 deletions
+4
View File
@@ -48,6 +48,10 @@ async fn main() -> Result<()> {
get(routes::admin::get_unknown_endpoints),
)
.route("/_bridge/status", get(routes::admin::get_endpoint_status))
.route(
"/_bridge/captures/diff",
get(routes::admin::get_capture_diff),
)
.fallback(any(openfut_bridge::proxy::catch_all_handler))
.layer(TraceLayer::new_for_http())
.layer(CorsLayer::permissive())