DSAR
Storage

Storage S3 Adapter Integration

This document describes how to register and use @dsar/storage-s3 with backend runtime.

Runtime Registration

import { dsarInstance } from "@dsar/backend";
import { makeS3StorageAdapter } from "@dsar/storage-s3";

const runtime = dsarInstance({
	adapters: {
		inbound: "stub",
		notifications: "stub",
		storage: makeS3StorageAdapter({
			bucket: "dsar-artifacts",
			region: "us-east-1",
			prefix: "artifacts",
			retryMaxAttempts: 3,
			timeoutMs: 3000,
		}),
	},
});

Config Fields

  • bucket (required)
  • region (required)
  • endpoint (optional for S3-compatible providers)
  • accessKeyId, secretAccessKey, sessionToken (optional explicit credentials)
  • forcePathStyle (optional)
  • prefix (optional, default artifacts)
  • timeoutMs (optional, default 3000)
  • retryMaxAttempts (optional, default 3)

Key Strategy Reference

Default deterministic key layout:

<prefix>/<requestId>/<manifestId>/<category>/<redaction>/<thirdParty>/<artifactName>

Fallback behavior:

  • missing requestId => request-unknown
  • missing manifestId => manifest-unknown
  • missing category => uncategorized
  • missing name/id => artifact.bin

Error and Retry Behavior Matrix

CategoryRetriableExamples
timeoutyestimeout, aborted request
rate_limityesthrottling, 429
networkyessocket/connection failures
authnounauthorized, access denied
validationnomalformed key/input
confignoinvalid adapter config
unknownnounmatched provider errors

Manifest Linkage

Storage operations preserve manifest-linked metadata on artifact references:

  • requestId
  • manifestId
  • manifestHash
  • manifestSignature

This metadata is available via putObject results and headObject/getObject metadata for review and audit correlation paths.