dimah-s3v0.4.1
Database

Hooks

Guards and row updates the db plugin adds to each lifecycle step.

The db() plugin attaches guards and database updates to upload, multipart, download, and delete. Enable the feature, register the plugin — you do not wire these hooks yourself.

Your own guards and lifecycle hooks on each feature still run after the plugin's.

Access rules

The plugin resolves the caller's scope (configured in Setup) and rejects:

SituationResponse
No scope (unauthenticated)401
File owned by another scope403
Expected row missing404

By feature

FeatureBeforeAfter
UploadReject if the key belongs to another scopeRow created or updated as pending
Upload confirmRow must exist and match the callerPromoted to active with verified size
MultipartSame ownership check as uploadpending on start, active on complete, row removed on abort
DownloadFile must be active and owned
DeleteRow must exist and ownedRow updated per deleteMode

Delete always removes the file from S3 through the normal api.delete path. The plugin only updates the database row afterward.

Multipart resume

To resume a large upload after a refresh, load the pending row with s3.db.objects.findPendingMultipart, map it with toPendingMultipartResume, and return it from a custom UploadStore on the client.

See API for store methods.

On this page