Media-Access-Service — Presigned Media URL Issuer

By Engineering Team•September 21, 2026•6 min read

Responsibility

media-access-service is the only service in the pipeline a client ever talks to directly for media access. It owns exactly one narrow, security-sensitive job — mint a short-lived, cryptographically signed URL for either an upload or a download — plus the metadata/audit trail for that access.

  • Upload path: the API Gateway asks media-access-service for a secure upload URL; the client then PUTs its raw image directly to the staging bucket using that URL — media-access-service never receives the image bytes.
  • Download path: the API Gateway asks media-access-service for a secure download URL for a tenant-owned asset; the CDN serves the asset once the client uses that URL.
  • Media file metadata management — upload records, access control, tenant-scoped URL issuance.
  • Audit trail for every media access operation: who requested a URL for which asset, when.

Why a standalone Rust microservice

This is the question Option 3 of the pipeline’s ADR weighs explicitly:

  • The work is cryptographic, not compute-heavy. Minting a signed URL is HMAC/RSA signing over a GCS object path — the same class of narrow, security-sensitive responsibility this monorepo already puts in Rust (pii-service, pci-service, user-secure-engine, payment-service) for its memory safety and small attack surface.
  • The traffic shape doesn’t match content-processor’s. Every image rendered on every client screen — product thumbnails, banners, tenant logos, avatars — needs a fresh signed download URL: a high-QPS, low-latency, read-heavy path, structurally unlike content-processor’s comparatively low-QPS, CPU-heavy, event-driven transcoding work.
  • Independent scaling. media-access-service scales horizontally on request volume alone (cheap, stateless signing); content-processor scales on transcoding CPU load. Splitting them means each scales on the metric that actually drives its cost, instead of sharing one scaling knob, deployment cadence, and blast radius.
  • Credential isolation. GCS signing credentials live in exactly one narrowly-scoped service, instead of being spread across every service that happens to need a signed URL.

Tech Stack

Concern Choice
Language Rust
Web framework Axum
Data store PostgreSQL via SeaORM
Core library rust-lang-core-lib (typed errors, logging macros, HeaderAuthClaims, telemetry)
Observability Tracing + OpenTelemetry
Template @templates/rust-postgres-microservice

Ports

Gateway HTTP/REST Service
8000 (Nginx /media/admin/api/v1/*) 8088 media-access-service

Implementation Notes

  • Auth: HeaderAuthClaims from rust_lang_core_lib::auth — tenant_id/user_id/role are always sourced from the standard header contract, never trusted from the request body, per the platform’s security standards.
  • Every table carries the five mandatory audit columns (tenant_id, created_user_id, updated_user_id, created_at, updated_at).
  • Local-dev quirk: the Firebase Storage emulator drops x-goog-meta-* headers on its /v0/b/ upload endpoint, so in non-production environments media-access-service embeds every tracing/tenant identifier as a path segment instead of object metadata when it builds the local upload URL — <tenant_id>/<user_id>/<transaction_name>/<transaction_id>/<correlation_id>/<traceparent>/<filename>. Production uses real x-goog-meta-* object metadata instead. See firebase-function for the extraction side of this contract.

Full service reference: media-access-service/CLAUDE.md. Pipeline overview: Create high resolution image for different process (ADR).