S3 versioning=yes config

Not yet used.

This commit was supported by the NSF-funded DataLad project.
This commit is contained in:
Joey Hess 2018-08-30 13:45:28 -04:00
parent 358178fbfb
commit 0ff5a41311
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 57 additions and 10 deletions

View file

@ -559,6 +559,7 @@ data S3Info = S3Info
, metaHeaders :: [(T.Text, T.Text)]
, partSize :: Maybe Integer
, isIA :: Bool
, versioning :: Bool
, public :: Bool
, getpublicurl :: Maybe (BucketObject -> URLString)
}
@ -577,9 +578,8 @@ extractS3Info c = do
, metaHeaders = getMetaHeaders c
, partSize = getPartSize c
, isIA = configIA c
, public = case M.lookup "public" c of
Just "yes" -> True
_ -> False
, versioning = boolcfg "versioning"
, public = boolcfg "public"
, getpublicurl = case M.lookup "publicurl" c of
Just u -> Just $ \p -> genericPublicUrl p u
Nothing -> case M.lookup "host" c of
@ -591,6 +591,10 @@ extractS3Info c = do
_ -> Nothing
}
return info
where
boolcfg k = case M.lookup k c of
Just "yes" -> True
_ -> False
putObject :: S3Info -> T.Text -> RequestBody -> S3.PutObject
putObject info file rbody = (S3.putObject (bucket info) file rbody)