MCPcopy
hub / github.com/scality/cloudserver / destroyBucketKey

Method destroyBucketKey

lib/kms/wrapper.js:297–312  ·  view source on GitHub ↗

* * @param {string} bucketKeyId - the Id of the bucket key * @param {object} log - logger object * @param {function} cb - callback * @returns {undefined} * @callback called with (err)

(bucketKeyId, log, cb)

Source from the content-addressed store, hash-verified

295 * @callback called with (err)
296 */
297 static destroyBucketKey(bucketKeyId, log, cb) {
298 log.debug('deleting bucket key', { bucketKeyId });
299 // shadowing global client for key
300 const { error, client, implName, key } = getClientForKey(bucketKeyId, log);
301 if (error) {
302 return cb(error);
303 }
304 return client.destroyBucketKey(key, log, err => {
305 if (err) {
306 log.debug('error from kms', { implName, error: err });
307 return cb(err);
308 }
309 log.trace('bucket key destroyed in kms');
310 return cb(null);
311 });
312 }
313
314 /**
315 * createCipherBundle

Callers 1

deleteBucketFunction · 0.80

Calls 3

getClientForKeyFunction · 0.85
debugMethod · 0.80
traceMethod · 0.80

Tested by

no test coverage detected