Expire terminal mutation identities by configured epoch
This commit is contained in:
parent
4b044b1456
commit
cc23211e63
1 changed files with 565 additions and 12 deletions
|
|
@ -362,6 +362,8 @@ handleUploadRequest env session root path operation declaredSize contentIdentity
|
|||
pure UploadResponse
|
||||
{ uploadResponseOperationId = operation
|
||||
, uploadResponseResult = result
|
||||
, uploadResponseIdempotencyWindowSeconds =
|
||||
cfgIdempotencyWindowSec (envConfig env)
|
||||
}
|
||||
|
||||
requireDownloadBandwidth :: Env -> SessionUser -> Integer -> Handler ()
|
||||
|
|
@ -430,6 +432,8 @@ handleDeleteRequest env session request = do
|
|||
pure DeleteResponse
|
||||
{ deleteResponseOperationId = operation
|
||||
, deleteResponseResult = result
|
||||
, deleteResponseIdempotencyWindowSeconds =
|
||||
cfgIdempotencyWindowSec (envConfig env)
|
||||
}
|
||||
|
||||
handleDeletePrefixRequest
|
||||
|
|
@ -537,6 +541,7 @@ runPut env user root rel op size sha body = do
|
|||
outcome <- withTransaction (envDb env) $ \conn ->
|
||||
admitMutation conn uid Put op pool key rel size (Just sha)
|
||||
(cfgMaxObjectBytes (envConfig env))
|
||||
(cfgIdempotencyWindowSec (envConfig env))
|
||||
case outcome of
|
||||
AdmitConflict -> pure (Right MutationConflict)
|
||||
AdmitRejected reason _ -> pure (Left (PutRejected reason))
|
||||
|
|
@ -608,6 +613,7 @@ runDelete env user root rel op = do
|
|||
outcome <- withTransaction (envDb env) $ \conn ->
|
||||
admitMutation conn uid Delete op pool key rel 0 Nothing
|
||||
(cfgMaxObjectBytes (envConfig env))
|
||||
(cfgIdempotencyWindowSec (envConfig env))
|
||||
case outcome of
|
||||
AdmitConflict -> pure (Right MutationConflict)
|
||||
AdmitRejected reason _ -> pure (Left reason)
|
||||
|
|
|
|||
Loading…
Reference in a new issue