Skip to content

docs: sync spec and pipeline with multipart upload and hls token - #82

Merged
SlavaKuntsov merged 2 commits into
mainfrom
docs/sync-spec-pipeline
Oct 9, 2026
Merged

SlavaKuntsov merged 2 commits into
mainfrom
docs/sync-spec-pipeline

Conversation

@SlavaKuntsov

Copy link
Copy Markdown
Owner

Summary

Syncs docs/spec.md and docs/services-pipeline.md with code that landed after the last docs commit (9b12094) — phases 17–18 hardening plus the upload/playback flows they changed.

services-pipeline.md

  • Service table: upload rewritten around the S3 multipart flow (issue P2 upload: switch resumable upload to S3 multipart with 5-10MB chunks #56) — POST /api/v1/videos/multipart → presigned 8MB chunks direct browser→MinIO → complete with assembled-object verification; legacy paths (/upload proxy, /presign, /resumable) listed. Gateway row adds GET /api/v1/videos/{id}/hls-token (15m signed token). Auth row adds refresh rotation (active jti in Redis, reuse → 401) and /me requiring type=access (issue P1 auth: require type=access in /me (refresh token must not be an identity) #76). Frontend row adds multipart upload with resume, hls-token for private videos, logout killing the player, silent refresh with cross-tab guard. New infra: Redis row.
  • Pipeline diagram: upload steps now reflect the real multipart sequence (CreateMultipartUpload → presign-part ×N → complete → publish) instead of the old server-side PutObject.
  • Playback section (§5): private video flow — hls-token first, ?token= on the manifest URL (15m TTL), logout clears the player source.
  • Debug scenarios (§7): new "HLS 403 on private video" case.

spec.md

Checklist

  • All claims verified against code: services/gateway/internal/middleware/hlsauth.go, services/upload/cmd/server/main.go, services/upload/internal/handler/multipart.go, services/auth/src/routers/auth.py, frontend/src/lib/api.ts, deploy/docker-compose.yml
  • No issue linked — docs sync only, open issues list is empty

Verification

  • git diff main..docs/sync-spec-pipeline --stat — 2 files, +19/−13, docs only
  • No code changes → no build/test/lint runs required

Remaining risks

  • None functional. Event-contract line "Определены как Go struct + Pydantic — см. deploy/postgres/init.sql" predates this PR and looks like a stale pointer, left untouched (out of scope).

Ignore rules for ZCode agent workspace context: env files (keep
.env.example), python caches, node_modules, build artifacts.
- upload: s3 multipart is the primary path (issue #56) - 8MB presigned
  chunks direct to minio, legacy proxy/presign/resumable as fallbacks
- gateway: hls-token endpoint (15m signed jwt) and HLSAuth private
  video protection with metadata lru cache (issue #54)
- auth: /me requires type=access (issue #76), refresh rotation with
  jti revocation in redis
- frontend: multipart upload with resume, silent refresh with
  cross-tab guard, logout kills private player
- stack: redis in infra list, nginx-vod internal without published
  port (issue #43), next.js 14 app router + zustand
@SlavaKuntsov
SlavaKuntsov merged commit d7252a1 into main Oct 9, 2026
4 checks passed
@SlavaKuntsov
SlavaKuntsov deleted the docs/sync-spec-pipeline branch October 9, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant