ecluse:ecluse-runtime
Safe HaskellNone
LanguageGHC2021

Ecluse.Runtime.Aws.S3.Conditional

Description

Conditional S3 writes, the listing that tells a missing key from a refused read, and a byte bound on the responses to both.

amazonka's generated PutObject has no If-Match or If-None-Match field, so ConditionalPut adds the header before signing and the signature covers it. A store that ignores the header would overwrite unconditionally, so a writer that relies on it needs a store that enforces it.

Synopsis

Documentation

data WritePrecondition Source #

What a conditional write requires of the object the key holds.

Constructors

IfAbsent

No object holds the key: If-None-Match: *.

IfRevision ByteString

The object holds exactly this ETag: If-Match.

isWriteConflict :: Error -> Bool Source #

Whether the store refused a conditional write because its precondition no longer held.

absenceListing :: Text -> Text -> ListObjectsV2 Source #

The one-key listing a refused read falls back on, which needs only prefix-scoped s3:ListBucket.

listingProvesAbsence :: ListObjectsV2Response -> Bool Source #

Only a complete, empty listing proves absence. A truncated or populated one proves nothing.

Bounded responses

newtype Capped a Source #

A request whose response body, success or error, is bounded before the generated decoder reads it. A longer one throws ResponseTooLarge.

Constructors

Capped a 

Instances

Instances details
AWSRequest a => AWSRequest (Capped a) Source # 
Instance details

Defined in Ecluse.Runtime.Aws.S3.Conditional

Associated Types

type AWSResponse (Capped a) 
Instance details

Defined in Ecluse.Runtime.Aws.S3.Conditional

type AWSResponse (Capped a) Source # 
Instance details

Defined in Ecluse.Runtime.Aws.S3.Conditional

maxCappedResponseBytes :: Int Source #

64 KiB: a one-key listing or an S3 error document is a few hundred bytes.