@staticmethod
def password_url(base_url, prefix):
    """Calculates actual url identifying the password. Takes
        configured prefix under consideration (so can be shorter
        than repo url)"""
    if not prefix or prefix == b'*':
        return base_url
    scheme, hostpath = base_url.split(b'://', 1)
    p = prefix.split(b'://', 1)
    if len(p) > 1:
        prefix_host_path = p[1]
    else:
        prefix_host_path = prefix
    password_url = scheme + b'://' + prefix_host_path
    return password_url
