veza/veza-backend-api/internal/models
senke 49335322b5
Some checks failed
Veza CI / Notify on failure (push) Blocked by required conditions
Veza CI / Rust (Stream Server) (push) Successful in 5m33s
Security Scan / Secret Scanning (gitleaks) (push) Failing after 1m0s
Veza CI / Backend (Go) (push) Failing after 9m37s
Veza CI / Frontend (Web) (push) Has been cancelled
E2E Playwright / e2e (full) (push) Has been cancelled
feat(legal): DMCA notice handler + admin queue + 451 playback gate (W3 Day 14)
End-to-end DMCA workflow. Public submission, admin queue, takedown
flips track to is_public=false + dmca_blocked=true, playback paths
return 451 Unavailable For Legal Reasons.

Backend
- migrations/988_dmca_notices.sql + rollback : table dmca_notices
  (id, status, claimant_*, work_description, infringing_track_id FK,
  sworn_statement_at, takedown_at, counter_notice_at, restored_at,
  audit_log JSONB, created_at, updated_at). Adds tracks.dmca_blocked
  BOOLEAN. Partial indexes for the pending queue + per-track lookup.
  Status enum constrained via CHECK.
- internal/models/dmca_notice.go + DmcaBlocked field on Track.
- internal/services/dmca_service.go : CreateNotice + ListPending +
  Takedown + Dismiss. Takedown is a single transaction that flips the
  track's flags AND appends an audit_log entry — partial state can't
  happen if the track was deleted between fetch and update.
- internal/handlers/dmca_handler.go : POST /api/v1/dmca/notice (public),
  GET /api/v1/admin/dmca/notices (paginated), POST /:id/takedown,
  POST /:id/dismiss. sworn_statement=false → 400. Conflict → 409.
  Track gone after notice → 410.
- internal/api/routes_legal.go : route registration. Admin chain :
  RequireAuth + RequireAdmin + RequireMFA (same as moderation routes).
- internal/core/track/track_hls_handler.go : both StreamTrack +
  DownloadTrack now early-return 451 when track.DmcaBlocked. Owner
  cannot bypass — only an admin restoring the notice clears the gate.
- internal/services/dmca_service_test.go : audit_log append helpers,
  malformed-JSON rejection, ordering preservation.

Frontend
- apps/web/src/features/legal/pages/DmcaNoticePage.tsx : public form
  at /legal/dmca/notice. Validates sworn-statement checkbox client-side.
  Receipt panel shows the notice ID after submission.
- apps/web/src/services/api/dmca.ts : thin client (POST /dmca/notice).
- routeConfig + lazy registry updated for the new route.
- DmcaPage now links to /legal/dmca/notice instead of saying "form
  pending".

E2E
- tests/e2e/29-dmca-notice.spec.ts : 3 tests. (1) anonymous submit
  yields 201 + pending receipt. (2) sworn_statement=false rejected
  with 400. (3) admin takedown gates playback with 451 — gated behind
  E2E_DMCA_ADMIN=1 because admin path requires MFA-bearing seed.

Acceptance (Day 14) : public submission produces a pending notice,
admin takedown blocks playback at 451. Lab-side validation pending
admin MFA seed for the e2e admin pathway.

W3 progress : Redis Sentinel ✓ · MinIO distribué ✓ · CDN ✓ · DMCA ✓ ·
embed  Day 15.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 15:39:33 +02:00
..
admin.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
announcement.go feat(admin): global announcements CRUD and public banner endpoint 2026-02-25 19:55:21 +01:00
api_key.go v0.9.4 2026-03-05 23:03:43 +01:00
bitrate_adaptation.go [BE-DB-004] be-db: Add created_at and updated_at timestamps to all models 2025-12-24 15:08:43 +01:00
bitrate_adaptation_test.go report generation and future tasks selection 2025-12-08 19:57:54 +01:00
chat_message.go style(backend): gofmt -w on 85 files (whitespace only) 2026-04-14 12:22:14 +02:00
cloud_file_share.go v0.9.4 2026-03-05 23:03:43 +01:00
cloud_file_version.go feat(cloud): file versioning, restore, and sharing 2026-02-25 13:33:08 +01:00
co_listening_session.go feat(v0.10.7): Collaboration Temps Réel F481-F483 2026-03-10 13:34:16 +01:00
custom_claims.go STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
daily_track_stats.go feat(v0.11.0): F381-F385 database migrations and models for creator analytics 2026-03-10 16:21:01 +01:00
data_export.go style(backend): gofmt -w on 85 files (whitespace only) 2026-04-14 12:22:14 +02:00
delivered_status.go feat(chat): Sprint 1 -- migrations, models, repositories for chat rewrite 2026-02-22 20:38:20 +01:00
dmca_notice.go feat(legal): DMCA notice handler + admin queue + 451 playback gate (W3 Day 14) 2026-04-28 15:39:33 +02:00
feature_flag.go v0.9.4 2026-03-05 23:03:43 +01:00
federated_identity.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
gear.go v0.9.4 2026-03-05 23:03:43 +01:00
gear_document.go feat(v0.802): frontend Cloud/Gear, MSW, docs, scope v0.803, archive 2026-02-25 14:00:58 +01:00
gear_image.go feat(v0.501): Sprint 1 -- infrastructure foundations 2026-02-22 18:10:25 +01:00
gear_repair.go feat(v0.802): frontend Cloud/Gear, MSW, docs, scope v0.803, archive 2026-02-25 14:00:58 +01:00
genre.go feat(v0.10.1): Tags & Genres discover - F351-F355 2026-03-09 01:52:56 +01:00
hardware.go v0.9.4 2026-03-05 23:03:43 +01:00
hls_stream.go v0.9.4 2026-03-05 23:03:43 +01:00
hls_stream_test.go STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
hls_transcode_queue.go v0.9.4 2026-03-05 23:03:43 +01:00
hls_transcode_queue_test.go STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
live_stream.go v0.9.4 2026-03-05 23:03:43 +01:00
message.go feat(chat): Sprint 1 -- migrations, models, repositories for chat rewrite 2026-02-22 20:38:20 +01:00
message_reaction.go feat(chat): Sprint 1 -- migrations, models, repositories for chat rewrite 2026-02-22 20:38:20 +01:00
mfa_config.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
notification.go incus deployement fully implemented, Makefile updated and make fmt ran 2026-01-13 19:47:57 +01:00
playback_analytics.go v0.9.4 2026-03-05 23:03:43 +01:00
playback_analytics_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
playlist.go style(backend): gofmt -w on 85 files (whitespace only) 2026-04-14 12:22:14 +02:00
playlist_collaborator.go STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
playlist_collaborator_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
playlist_follow.go STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
playlist_share_link.go v0.9.4 2026-03-05 23:03:43 +01:00
playlist_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
playlist_version.go v0.9.4 2026-03-05 23:03:43 +01:00
queue.go v0.9.4 2026-03-05 23:03:43 +01:00
queue_session.go v0.9.4 2026-03-05 23:03:43 +01:00
read_receipt.go feat(chat): Sprint 1 -- migrations, models, repositories for chat rewrite 2026-02-22 20:38:20 +01:00
recovery_code.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
refresh_token.go [BE-DB-004] be-db: Add created_at and updated_at timestamps to all models 2025-12-24 15:08:43 +01:00
report.go feat(admin): moderation queue with reports CRUD 2026-02-25 19:53:04 +01:00
requests.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
responses.go [INT-008] int: Standardize date/time formats 2025-12-25 15:16:38 +01:00
role.go [T0-006] test(backend): Ajout tests service role - Progression couverture 2026-01-04 01:44:21 +01:00
role_test.go report generation and future tasks selection 2025-12-08 19:57:54 +01:00
room.go stabilizing veza-backend-api: phase 1 2025-12-16 11:23:49 -05:00
room_invitation.go style(backend): gofmt -w on 85 files (whitespace only) 2026-04-14 12:22:14 +02:00
royalty.go v0.9.4 2026-03-05 23:03:43 +01:00
seller_stripe_account.go style(backend): gofmt -w on 85 files (whitespace only) 2026-04-14 12:22:14 +02:00
session.go stabilizing veza-backend-api: phase 1 2025-12-16 11:23:49 -05:00
storage_quota.go feat(v0.501): Sprint 1 -- infrastructure foundations 2026-02-22 18:10:25 +01:00
tag.go feat(v0.10.1): Tags & Genres discover - F351-F355 2026-03-09 01:52:56 +01:00
track.go feat(legal): DMCA notice handler + admin queue + 451 playback gate (W3 Day 14) 2026-04-28 15:39:33 +02:00
track_comment.go STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
track_comment_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
track_history.go v0.9.4 2026-03-05 23:03:43 +01:00
track_history_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
track_like.go v0.9.4 2026-03-05 23:03:43 +01:00
track_like_test.go report generation and future tasks selection 2025-12-08 19:57:54 +01:00
track_lyrics.go feat(tracks): add lyrics model and endpoints (E3) 2026-02-20 15:36:28 +01:00
track_play.go v0.9.4 2026-03-05 23:03:43 +01:00
track_play_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
track_repost.go feat(v0.10.3): Commentaires & Interactions Sociales - F201-F215 2026-03-09 10:30:47 +01:00
track_share.go STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
track_share_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
track_status.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
track_stem.go feat(v0.10.7): Collaboration Temps Réel F481-F483 2026-03-10 13:34:16 +01:00
track_version.go report generation and future tasks selection 2025-12-08 19:57:54 +01:00
track_version_test.go report generation and future tasks selection 2025-12-08 19:57:54 +01:00
user.go fix(ci): unblock CI red — gofmt + e2e webserver reuse + orders.hyperswitch_payment_id (Day 4) 2026-04-27 12:03:55 +02:00
user_file.go feat(v0.501): Sprint 1 -- infrastructure foundations 2026-02-22 18:10:25 +01:00
user_folder.go feat(v0.501): Sprint 1 -- infrastructure foundations 2026-02-22 18:10:25 +01:00
user_genre_tag_follow.go style(backend): gofmt -w on 85 files (whitespace only) 2026-04-14 12:22:14 +02:00
user_presence.go feat: backend — config, handlers, services, logging, migration 2026-03-23 15:46:57 +01:00
user_settings.go v0.9.4 2026-03-05 23:03:43 +01:00
webauthn_credential.go feat(v0.13.3): complete - Polish Sécurité Avancée 2026-03-13 10:09:01 +01:00
webhook.go incus deployement fully implemented, Makefile updated and make fmt ran 2026-01-13 19:47:57 +01:00