def get_challenge_for_url(url):
    """ Gets the challenge for the cached URL.
    :param url: the URL the challenge is cached for.
    :rtype: HttpBearerChallenge """
    if not url:
        raise ValueError('URL cannot be None')

    url = parse.urlparse(url)

    _lock.acquire()

    val = _cache.get(url.netloc)

    _lock.release()

    return val
Gets the challenge for the cached URL.
    :param url: the URL the challenge is cached for.
    :rtype: HttpBearerChallenge