metadataValidateMultipart(params, cb) {
        const { bucketName, uploadId, authInfo,
            objectKey, requestType, log } = params;

        assert.strictEqual(typeof bucketName, 'string');
        // This checks whether the mpu bucket exists.
        // If the MPU was initiated, the mpu bucket should exist.
        const mpuBucketName = `${constants.mpuBucketPrefix}${bucketName}`;
        metadata.getBucket(mpuBucketName, log, (err, mpuBucket) => {
            if (err?.is?.NoSuchBucket) {
                log.debug('bucket not found in metadata', { error: err,
                    method: 'services.metadataValidateMultipart' });
                return cb(errors.NoSuchUpload);
            }
            if (err) {
                log.error('error from metadata', { error: err,
                    method: 'services.metadataValidateMultipart' });
                return cb(err);
            }

            let splitter = constants.splitter;
            // BACKWARD: Remove to remove the old splitter
            if (mpuBucket.getMdBucketModelVersion() < 2) {
                splitter = constants.oldSplitter;
            }
            const mpuOverviewKey =
                `overview${splitter}${objectKey}${splitter}${uploadId}`;

            metadata.getObjectMD(mpuBucket.getName(), mpuOverviewKey,
                {}, log, (err, storedMetadata) => {
                    if (err) {
                        if (err.is.NoSuchKey) {
                            return cb(errors.NoSuchUpload);
                        }
                        log.error('error from metadata', { error: err });
                        return cb(err);
                    }

                    const initiatorID = storedMetadata.initiator.ID;
                    const ownerID = storedMetadata['owner-id'];
                    const mpuOverview = {
                        key: storedMetadata.key,
                        id: storedMetadata.id,
                        eventualStorageBucket:
                            storedMetadata.eventualStorageBucket,
                        initiatorID,
                        initiatorDisplayName:
                            storedMetadata.initiator.DisplayName,
                        ownerID,
                        ownerDisplayName:
                            storedMetadata['owner-display-name'],
                        storageClass:
                            storedMetadata['x-amz-storage-class'],
                        initiated: storedMetadata.initiated,
                        controllingLocationConstraint:
                            storedMetadata.controllingLocationConstraint,
                    };

                    const tagging = storedMetadata['x-amz-tagging'];
                    if (tagging) {
                        mpuOverview.tagging = tagging;
                    }
                    // If access was provided by the destination bucket's
                    // bucket policies, go ahead.
                    if (requestType === 'bucketPolicyGoAhead') {
                        return cb(null, mpuBucket, mpuOverview, storedMetadata);
                    }

                    const requesterID = authInfo.isRequesterAnIAMUser() ?
                        authInfo.getArn() : authInfo.getCanonicalID();
                    const isRequesterInitiator =
                        initiatorID === requesterID;
                    const isRequesterParentAccountOfInitiator =
                        ownerID === authInfo.getCanonicalID();
                    if (requestType === 'putPart or complete') {
                        // Only the initiator of the multipart
                        // upload can upload a part or complete the mpu
                        if (!isRequesterInitiator) {
                            return cb(errors.AccessDenied);
                        }
                    }
                    if (requestType === 'deleteMPU'
                        || requestType === 'listParts') {
                        // In order for account/user to be
                        // authorized must either be the
                        // bucket owner or intitator of
                        // the multipart upload request
                        // (or parent account of initiator).
                        // In addition if the bucket policy
                        // designates someone else with
                        // s3:AbortMultipartUpload or
                        // s3:ListMultipartUploadPartsrights,
                        // as applicable, that account/user will have the right.
                        // If got to this step, it means there is
                        // no bucket policy on this.
                        if (mpuBucket.getOwner() !== authInfo.getCanonicalID()
                        && !isRequesterInitiator
                        && !isRequesterParentAccountOfInitiator) {
                            return cb(errors.AccessDenied);
                        }
                    }
                    return cb(null, mpuBucket, mpuOverview, storedMetadata);
                });
            return undefined;
        });
    }
Checks whether bucket exists, multipart upload
has been initiated and the user is authorized
@param {object} params - custom built object containing
bucket name, uploadId, authInfo etc.
@param {function} cb - callback containing error and
bucket reference for the next task
@return {undefined} calls callback with arguments:
- error
- bucket
- the multipart upload metadata
- the overview key stored metadata