function checkBucketAndKey(bucketName, objectKey, requestQueryParams, method, log) {
    // In case bucket name is not specified and the request contains an
    // object key or is not a GET, then the bucket name is mandatory.
    // Reject the request in this case.
    if (!bucketName && !(method === 'GET' && !objectKey)) {
        log.debug('empty bucket name', { method: 'checkBucketAndKey' });
        return errors.MethodNotAllowed;
    }
    if (typeof bucketName !== 'string' || routesUtils.isValidBucketName(bucketName, []) === false) {
        log.debug('invalid bucket name', { bucketName });
        if (method === 'DELETE') {
            return errors.NoSuchBucket;
        }
        return errors.InvalidBucketName;
    }
    if (method !== 'LIST') {
        // Reject any unsupported request, but allow downloads and deletes from UI
        // Download relies on GETs calls with auth in query parameters, that can be
        // checked if 'X-Amz-Credential' is included.
        // Deletion requires that the tags of the object are returned.
        if (requestQueryParams && Object.keys(requestQueryParams).length > 0
            && !(method === 'GET' && (requestQueryParams['X-Amz-Credential'] || ('tagging' in requestQueryParams)))) {
            return errorInstances.InvalidRequest
                .customizeDescription('The Veeam SOSAPI folder does not support this action.');
        }
        if (typeof objectKey !== 'string' || !validObjectKeys.includes(objectKey)) {
            log.debug('invalid object name', { objectKey });
            return errors.InvalidArgument;
        }
    }
    return undefined;
}
Validator for the Veeam12 custom routes. Ensures that bucket name and
object name are correct, and that the bucket exists in the DB.
@param {string} bucketName  - name of the bucket
@param {string} objectKey - key of the object
@param {array | null} requestQueryParams - request query parameters
@param {string} method - HTTP verb
@param {object} log - request logger
@returns {Error | undefined} error or undefined