secubox-deb/common/secubox_core/tests
CyberMind fecd233d88
Some checks failed
License Headers / check (push) Has been cancelled
feat: Media Buffer Phase 2 — HLS reassembly via read-time URL join (#815)
* feat(sbxmitm): capture HLS segments as kind=segment (Phase 2, ref #812)

Add segmentKind(path, ctype) to classify HLS/DASH segment chunks (.ts,
.m4s, .m4v paths or video/mp2t, video/iso.segment content types), and
give it precedence over mediaKind in Capture so a .ts served as
video/mp2t is tagged kind="segment" instead of "video". Whole-file
.mp4/video/* stays "video" and .m3u8/.mpd manifests stay "manifest".
IsMedia now also matches segmentKind so ambiguous-ctype segments (e.g.
.m4s over application/octet-stream) are still captured.

* feat(core): HLS media-playlist parser + segment-URI rewriter (Phase 2, ref #812)

* feat(dpi): HLS manifest replay — rewrite segment URIs to captured segments (Phase 2, ref #812)

media_replay() branches on record kind: a captured HLS manifest is parsed
with secubox_core.hls and its segment URIs are rewritten to the matching
captured kind=="segment" records' replay URLs (read-time join by absolute
URL, scoped to the same mac_hash+host). Master/ABR and AES-128 encrypted
playlists are detected and returned raw with X-SecuBox-Media:
unsupported-variant instead of a broken rewrite. Every other kind keeps the
unchanged Phase-1 FileResponse path; any manifest parse/read error falls
back to the raw FileResponse (never a 500).

* fix(dpi): log HLS manifest/segment/rewrite truncation + pin manifest replay fail-safe (Phase 2 review, ref #812)

* feat(dpi): Media tab — hide HLS segments, manifest playback/download + unsupported-variant note (Phase 2, ref #812)

* test(#812): HLS reassembly end-to-end + changelog 0.1.28 (Phase 2)

Cross-layer integration test seeding a temp media-buffer exactly as the Go
tee + janitor produce on disk (metatag JSONL + per-session object files),
then driving the real DPI media_replay handler: manifest rewrite joins each
segment URI to its captured segment by resolved URL, every rewritten URL's
id replays to byte-identical captured bytes, and a janitor-style append-only
eviction flip leaves the evicted segment unrewritten (410 on direct replay)
while its siblings keep replaying. This is the whole-branch-review-flagged
integration coverage Phase 1 was missing.

Bumps secubox-toolbox-ng changelog to 0.1.28-1~bookworm1 with the Phase 2
HLS reassembly summary (segment capture, manifest rewrite,
unsupported-variant detection for master/ABR + AES + DASH).

* chore(dpi): changelog 1.2.0 — media buffer API + HLS reassembly (#812 Phase 1+2)

---------

Co-authored-by: CyberMind-FR <gandalf@Gk2.net>
2026-07-04 18:17:40 +02:00
..
conftest.py test: scaffold test dirs + conftest for auth rework (ref #120) 2026-05-13 08:16:55 +02:00
test_auth_rewire.py feat(core): auth — delegate to user_store, jti, scope, validator, disabled-reject (ref #120) 2026-05-13 09:00:00 +02:00
test_feature_flags.py feat(core): feature_flags reader with auth.enforce_v2 + require_totp_for_admin (ref #120) 2026-05-13 08:34:10 +02:00
test_hls.py feat: Media Buffer Phase 2 — HLS reassembly via read-time URL join (#815) 2026-07-04 18:17:40 +02:00
test_media_buffer.py feat: SecuBox Media Buffer Phase 1 — dashcam capture + replay + metatag lifecycle (#814) 2026-07-04 18:15:58 +02:00
test_media_catch.py Rapport kbin fidèle (PDF donut-grids + media types) + WebUI DPI + incident hardening (#787) 2026-07-03 12:27:28 +02:00
test_user_store.py feat(core): secubox-user-sync — provisioning push of master users into apps (ref #410) 2026-05-29 07:55:58 +02:00