feat: Phase 6 — proxy polish, TLS, admin UI, replay CLI

## TLS (#11)
- Self-signed cert generated at startup via rcgen (covers localhost, 127.0.0.1,
  fut.ea.com, utas.mob.v4.fut.ea.com); activated with TLS_ENABLED=true
- Custom accept loop: tokio-rustls acceptor → hyper-util auto Builder → axum
  Router (no axum-server dependency — uses hyper 1.x natively)

## Replay CLI (#12)
- New binary: openfut-bridge-replay <file.json|dir> [bridge-url]
- Replays single capture or entire directory against Bridge
- Accepts self-signed certs automatically

## Capture quality (#13, #14)
- DELETE /_bridge/captures — wipe all capture files from disk
- Deduplication: same method+path within 1 s is skipped (configurable constant)

## Admin UI (#21, #22, #23)
- GET /_bridge/admin — embedded HTML dashboard; auto-refresh every 10 s
  Shows: live stats, SSE log of incoming traffic, endpoint status table,
  recent captures list with delete button
- GET /_bridge/status — per-endpoint mapped/known/unknown status
- GET /_bridge/captures/stream — SSE stream; event: capture on each request
  Uses tokio::sync::broadcast channel (capacity 256) in ProxyState

## Tests (#24, #25)
- 9 new tests: placeholder format, full HTTP integration (health, placeholder,
  captures list, delete captures, status), TLS cert generation + acceptor build
- Total bridge tests: 13/13 passing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
funman300
2026-06-25 16:15:48 -07:00
parent a826e5f7d3
commit 3b7a4928c9
12 changed files with 1063 additions and 39 deletions
+18 -9
View File
@@ -13,10 +13,14 @@
- [ ] #10 Identify any binary/protobuf endpoints (most are JSON but verify)
## Proxy
- [ ] #11 Add TLS support (self-signed cert) so FIFA 23 connects via HTTPS
- [ ] #12 Add replay CLI: `openfut-bridge replay captures/some_file.json`
- [ ] #13 Add `DELETE /_bridge/captures` to wipe capture folder
- [ ] #14 Add capture deduplication (same method+path within 1 second)
- [x] #11 Add TLS support (self-signed cert) so FIFA 23 connects via HTTPS
`TLS_ENABLED=true` generates cert at startup via rcgen; uses tokio-rustls
→ Cert covers localhost, 127.0.0.1, fut.ea.com, utas.mob.v4.fut.ea.com
- [x] #12 Add replay CLI: `openfut-bridge-replay captures/some_file.json [bridge-url]`
→ Accepts single file or entire captures/ directory
→ TLS: danger_accept_invalid_certs=true so self-signed certs work
- [x] #13 Add `DELETE /_bridge/captures` to wipe capture folder
- [x] #14 Add capture deduplication (same method+path within 1 second)
- [ ] #15 Add request diff tool: show what changed between two captures
## Mapper
@@ -27,10 +31,15 @@
- [ ] #20 Add phishing token passthrough
## Admin UI
- [ ] #21 Build a simple web dashboard for viewing captures
- [ ] #22 Add endpoint status page (known vs unknown vs confirmed)
- [ ] #23 Add live capture stream via SSE
- [x] #21 Build a simple web dashboard for viewing captures (`GET /_bridge/admin`)
→ Auto-refreshes every 10s; shows stats, endpoint table, recent captures
- [x] #22 Add endpoint status page (`GET /_bridge/status`)
→ Reports each unique endpoint as mapped/known/unknown
- [x] #23 Add live capture stream via SSE (`GET /_bridge/captures/stream`)
`event: capture` events pushed on each new capture
- [ ] #15 Add request diff tool
## Testing
- [ ] #24 Add test for placeholder response format
- [ ] #25 Add integration test that fires real HTTP at the Bridge
- [x] #24 Add test for placeholder response format
- [x] #25 Add integration test that fires real HTTP at the Bridge
→ 8 new tests: health, placeholder, captures CRUD, status, TLS cert gen