Does the target match the whitelist entry?

def matches(target, entry):
    """Does the target match the whitelist entry?"""

    # It must match all the non-empty entries.
    for t, e in itertools.zip_longest(target, entry):
        if e and t != e:
            return False

    # ...and the provider and user can't be empty.
    return entry[0] and entry[1]