function extractLoginDataFromBody(body) {
    let newConnection = {
      label: body.label,
      port: body.port,
      password: body.password,
      dbIndex: body.dbIndex
    };

    if (body.serverType === 'sentinel') {
      newConnection.sentinels = myUtils.parseRedisServerList('newConnection', body.sentinels);
      newConnection.sentinelName = myUtils.getRedisSentinelGroupName(body.sentinelName);
      switch (body.sentinelPWType) {
        case 'sentinel':
          newConnection.sentinelPassword = body.sentinelPassword;
          break;
        case 'redis':
          newConnection.sentinelPassword = body.password;
          break;
      }
      if (body.sentinelTLS === 'yes') {
        newConnection.sentinelTLS = true;
      }
      else if (body.sentinelTLS === 'custom') {
        newConnection.sentinelTLS = {};
        if (body.sentinelTLSCA) {
          newConnection.sentinelTLS.ca = body.sentinelTLSCA.replace(/\\n/g, '\n');
        }
        if (body.sentinelTLSPublicKey) {
          newConnection.sentinelTLS.cert = body.sentinelTLSPublicKey.replace(/\\n/g, '\n');
        }
        if (body.sentinelTLSPrivateKey) {
          newConnection.sentinelTLS.key = body.sentinelTLSPrivateKey.replace(/\\n/g, '\n');
        }
        if (body.sentinelTLSServerName) {
          newConnection.sentinelTLS.servername = body.sentinelTLSServerName;
        }
      }
    }
    else if (body.serverType === 'cluster') {
      newConnection.clusters = myUtils.parseRedisServerList('newConnection', body.clusters);
      delete newConnection.port;
    }
    else if (typeof body.hostname === 'string') {
      if (body.hostname.startsWith('/')) {
        newConnection.path = body.hostname;
      }
      else {
        newConnection.host = body.hostname;
      }
    }
    else {
      throw new Error('invalid or missing hostname or socket path');
    }

    if (body.redisTLS === 'yes') {
      newConnection.tls = true
      newConnection.clusterNoTlsValidation = (typeof body.clusterNoTlsValidation !== 'undefined');  // checkbox
    }
    else if (body.redisTLS === 'custom') {
      newConnection.tls = {};
      newConnection.clusterNoTlsValidation = (typeof body.clusterNoTlsValidation !== 'undefined');
      if (body.redisTLSCA) {
        newConnection.tls.ca = body.redisTLSCA.replace(/\\n/g, '\n');
      }
      if (body.redisTLSPublicKey) {
        newConnection.tls.cert = body.redisTLSPublicKey.replace(/\\n/g, '\n');
      }
      if (body.redisTLSPrivateKey) {
        newConnection.tls.key = body.redisTLSPrivateKey.replace(/\\n/g, '\n');
      }
      if (body.redisTLSServerName) {
        newConnection.tls.servername = body.sentinelTLSServerName;
      }
    }
    return newConnection;
  }
extract all connection data needed from body of request to create a new connection
 object suitable to create new redis client from via utility function.
 Function throws error if data are missing or non-parsable.
 This function understands redis connections via socket, single ip or sentinel.

 @param {object} body body of request with connection data
@returns {{password: *, port: number, dbIndex: number, label: *}} connection object