(request, response, log, callback)
| 1230 | } |
| 1231 | |
| 1232 | function putObjectTagging(request, response, log, callback) { |
| 1233 | const err = _checkMultipleBackendRequest(request, log); |
| 1234 | if (err) { |
| 1235 | return callback(err); |
| 1236 | } |
| 1237 | const sourceVersionId = request.headers['x-scal-source-version-id']; |
| 1238 | const sourceBucket = request.headers['x-scal-source-bucket']; |
| 1239 | const site = request.headers['x-scal-replication-endpoint-site']; |
| 1240 | let dataStoreVersionId = request.headers['x-scal-data-store-version-id']; |
| 1241 | // If the tagging request is made before the replication has completed, the |
| 1242 | // Kafka entry will not have the dataStoreVersionId available so we |
| 1243 | // retrieve it from metadata here. |
| 1244 | if (dataStoreVersionId === '') { |
| 1245 | return metadataGetObject(sourceBucket, request.objectKey, sourceVersionId, null, log, (err, objMD) => { |
| 1246 | if (err) { |
| 1247 | return callback(err); |
| 1248 | } |
| 1249 | if (!objMD) { |
| 1250 | return callback(errors.NoSuchKey); |
| 1251 | } |
| 1252 | const backend = objMD.replicationInfo.backends.find(o => o.site === site); |
| 1253 | dataStoreVersionId = backend.dataStoreVersionId; |
| 1254 | return handleTaggingOperation(request, response, 'Put', dataStoreVersionId, log, callback); |
| 1255 | }); |
| 1256 | } |
| 1257 | return handleTaggingOperation(request, response, 'Put', dataStoreVersionId, log, callback); |
| 1258 | } |
| 1259 | |
| 1260 | function deleteObjectTagging(request, response, log, callback) { |
| 1261 | const err = _checkMultipleBackendRequest(request, log); |
nothing calls this directly
no test coverage detected