Skip to the content.

Upload sequence

The local branch calls a shared helper in-process; it does not make an HTTP call to the web host. Signed local PUT validates HMAC, expiry and required headers; its default byte cap is 100 MiB. AWS signs create-only If-None-Match. Completion verifies stored-byte digest, optional client hash, reservation, path kind and extension/MIME agreement. These checks do not imply content sniffing, sanitization or original dimension extraction. Name conflicts map to 409 with suggestions; missing/expired reservations are rejected. Local ingest rolls back the row/blob on audit failure; remote registration rolls back the row and leaves the uploaded blob.

Legend: all drawn relationships are source-verified; branches are conditional execution paths. No inferred service is drawn.

sequenceDiagram
  actor U as Admin user
  participant UI as Admin media page
  participant A as Admin route / service
  participant N as Web media-nuxt
  participant L as MediaLibrary
  participant B as Blob store
  participant C as Catalog and audit
  U->>UI: Select files
  UI->>A: Bearer POST assets (base64 JSON)
  A->>A: requireMediaAdmin, decode and infer kind
  alt Admin local (no MEDIA_API_URL)
    A->>L: ingest(bytes, filename, kind, mime)
    L->>L: Normalize metadata, name, hash bytes
    L->>C: Reserve tenant/kind/name
    L->>B: Put original
    L->>C: Insert asset, append audit
    A->>N: ensureDefaultThumbnail(library, asset) helper call
  else Admin forwarding
    A->>N: Bearer POST ingest/presign
    N->>L: reserveName (30 minute hold)
    L->>C: Hold name
    N-->>A: Signed URL and required headers (15 minute URL)
    A->>B: PUT original (S3/MinIO or signed local route)
    A->>N: Bearer POST ingest/complete
    N->>L: Check path reservation owner
    N->>B: head and digestSha256
    N->>L: registerRemoteAsset
    L->>C: Insert asset, append audit
    N->>N: ensureDefaultThumbnail
  end
  A-->>UI: Asset and public/preview URLs
  Note over N,L: Image thumbnail failure is logged, upload still succeeds
  Note over UI,N: Direct media-client consumers can call presign/PUT/complete without admin proxy

Source evidence