def _parse_chap_header(headers):
    """Parses the X-CHAP header.

    CHAP headers are encoded like:
        X-CHAP:request:negz
        X-CHAP:challenge:butts
        X-CHAP:response:moo
        X-CHAP:token:zomgauthentication

    Each HTTP request or response should have a single X-CHAP header.

    Args:
        headers: A case insensitive dictionary of HTTP headers.

    Returns:
        A tuple like (chap_header_key, chap_header_value).
    """
    return tuple([s.strip() for s in headers['X-CHAP'].split(':', 1)])