Skip to content

Storage Overview

@mountsqli/storage is a storage layer for objects (files, blobs). It supports HMAC-signed URLs, content-addressed versioning, and an S3 adapter.

Concept What it is
StorageAdapter interface for put/get/delete/list
Signed URL HMAC-signed, time-limited GET URL
Versioning content-addressed revisions of an object
ObjectAcl access control reused from the policy engine

A signed URL lets you grant temporary, revocable read access without exposing your storage credentials or a long-lived token. The signature is verified timing-safe (timingSafeEqual) so it can’t be forged byte-by-byte.

Storage reuses the auth policy engine: compilePolicy(policy, ctx) returns the same FilterNode[] shape the query builder uses, so object access follows the same RLS rules as row access.

  • Use signed URLs for client-side downloads; never hand out raw credentials.
  • Set short expiries on signed URLs.
  • Apply an ObjectAcl to scope who can read/write.
  • Treating signed URLs as permanent — they expire.
  • Storing secrets in the URL (only the HMAC signature belongs there).