def METHOD_NAME(credentials):
    """ Replace the key of the entries with host:port values.
    Returns a new dictionary from the credentials where the key will be
    replaced by 'host:port' values so protocols and product names will be
    removed if these are given.
    """
    host_entry_pattern = re.compile(
        r'^(?P<protocol>http[s]?://)*(?P<host>[^:\/\s]+):*(?P<port>\d+)*'
        r'/*(?P<product>\w+)*$')
    ret = {}
    for host_entry, auth_string in credentials.items():
        match = host_entry_pattern.match(host_entry)
        if not match:
            LOG.warning("Not a valid host entry: %s.", host_entry)
            continue
        host = match.group('host')
        port = match.group('port')
        host_port = '{0}:{1}'.format(host, port) if port else host
        ret[host_port] = auth_string
    return ret