function getReplicationInfo(
    s3config, objKey, bucketMD, isMD, objSize, operationType, objectMD, authInfo) {
    const content = isMD || objSize === 0 ? ['METADATA'] : ['DATA', 'METADATA'];
    const config = bucketMD.getReplicationConfiguration();

    // Do not replicate object in the following cases:
    //
    // - bucket does not have a replication configuration
    //
    // - replication configuration does not apply to the object
    //   (i.e. no rule matches object prefix)
    //
    // - replication configuration applies to the object (i.e. a rule matches
    //   object prefix) but the status is disabled
    //
    // - object owner is an internal service account like Lifecycle,
    //   unless the account properties explicitly allow it to
    //   replicate like MD ingestion (because we do not want to
    //   replicate objects created from actions triggered by internal
    //   services, by design)

    if (config) {
        let doReplicate = false;
        if (!authInfo || !isServiceAccount(authInfo.getCanonicalID())) {
            doReplicate = true;
        } else {
            const serviceAccountProps = getServiceAccountProperties(
                authInfo.getCanonicalID());
            doReplicate = serviceAccountProps.canReplicate;
        }
        if (doReplicate) {
            const rule = config.rules.find(
                rule => (objKey.startsWith(rule.prefix) && rule.enabled));
            if (rule) {
                // TODO CLDSRV-646 : should "merge" the replicationInfo for different rules
                return _getReplicationInfo(
                    s3config, rule, config, content, operationType, objectMD, bucketMD);
            }
        }
    }
    return undefined;
}
Get the object replicationInfo to replicate data and metadata, or only
metadata if the operation only changes metadata or the object is 0 bytes
@param {object} s3config - Cloudserver configuration object
@param {object} s3config.locationConstraints - Configured map of location constraints
@param {object[]} s3config.replicationEndpoints - Configured replication endpoints
@param {string} objKey - The key of the object
@param {object} bucketMD - The bucket metadata
@param {boolean} isMD - Whether the operation is only updating metadata
@param {boolean} objSize - The size, in bytes, of the object being PUT
@param {string} operationType - The type of operation to replicate
@param {object} objectMD - The object metadata
@param {AuthInfo} [authInfo] - authentication info of object owner
@return {undefined}