ó
Į£ō_c           @   sQ  d  Z  d d l m Z d e f d     YZ d e f d     YZ d e j f d     YZ d	 e f d
     YZ	 d e	 f d     YZ
 d e	 f d     YZ d e f d     YZ d e f d     YZ d e	 f d     YZ d e f d     YZ d e f d     YZ d e f d     YZ d e	 f d     YZ d e f d     YZ d S(    s   ACME errors.i’’’’(   t   errorst   Errorc           B   s   e  Z d  Z RS(   s   Generic ACME error.(   t   __name__t
   __module__t   __doc__(    (    (    s/   /usr/lib/python2.7/site-packages/acme/errors.pyR      s   t   DependencyErrorc           B   s   e  Z d  Z RS(   s   Dependency error(   R   R   R   (    (    (    s/   /usr/lib/python2.7/site-packages/acme/errors.pyR   	   s   t   SchemaValidationErrorc           B   s   e  Z d  Z RS(   s)   JSON schema ACME object validation error.(   R   R   R   (    (    (    s/   /usr/lib/python2.7/site-packages/acme/errors.pyR      s   t   ClientErrorc           B   s   e  Z d  Z RS(   s   Network error.(   R   R   R   (    (    (    s/   /usr/lib/python2.7/site-packages/acme/errors.pyR      s   t   UnexpectedUpdatec           B   s   e  Z d  Z RS(   s   Unexpected update error.(   R   R   R   (    (    (    s/   /usr/lib/python2.7/site-packages/acme/errors.pyR      s   t
   NonceErrorc           B   s   e  Z d  Z RS(   s   Server response nonce error.(   R   R   R   (    (    (    s/   /usr/lib/python2.7/site-packages/acme/errors.pyR	      s   t   BadNoncec           B   s    e  Z d  Z d   Z d   Z RS(   s   Bad nonce error.c         O   s/   t  t |   j | |   | |  _ | |  _ d  S(   N(   t   superR
   t   __init__t   noncet   error(   t   selfR   R   t   argst   kwargs(    (    s/   /usr/lib/python2.7/site-packages/acme/errors.pyR      s    	c         C   s   d j  |  j |  j  S(   Ns   Invalid nonce ({0!r}): {1}(   t   formatR   R   (   R   (    (    s/   /usr/lib/python2.7/site-packages/acme/errors.pyt   __str__)   s    (   R   R   R   R   R   (    (    (    s/   /usr/lib/python2.7/site-packages/acme/errors.pyR
      s   	
t   MissingNoncec           B   s    e  Z d  Z d   Z d   Z RS(   sū   Missing nonce error.

    According to the specification an "ACME server MUST include an
    Replay-Nonce header field in each successful response to a POST it
    provides to a client (...)".

    :ivar requests.Response response: HTTP Response

    c         O   s&   t  t |   j | |   | |  _ d  S(   N(   R   R   R   t   response(   R   R   R   R   (    (    s/   /usr/lib/python2.7/site-packages/acme/errors.pyR   7   s    c         C   s   d j  |  j j j |  j j  S(   Ns_   Server {0} response did not include a replay nonce, headers: {1} (This may be a service outage)(   R   R   t   requestt   methodt   headers(   R   (    (    s/   /usr/lib/python2.7/site-packages/acme/errors.pyR   <   s    (   R   R   R   R   R   (    (    (    s/   /usr/lib/python2.7/site-packages/acme/errors.pyR   -   s   		t	   PollErrorc           B   s/   e  Z d  Z d   Z e d    Z d   Z RS(   s  Generic error when polling for authorization fails.

    This might be caused by either timeout (`exhausted` will be non-empty)
    or by some authorization being invalid.

    :ivar exhausted: Set of `.AuthorizationResource` that didn't finish
        within max allowed attempts.
    :ivar updated: Mapping from original `.AuthorizationResource`
        to the most recently updated one

    c         C   s)   | |  _  | |  _ t t |   j   d  S(   N(   t	   exhaustedt   updatedR   R   R   (   R   R   R   (    (    s/   /usr/lib/python2.7/site-packages/acme/errors.pyR   N   s    		c         C   s   t  |  j  S(   s    Was the error caused by timeout?(   t   boolR   (   R   (    (    s/   /usr/lib/python2.7/site-packages/acme/errors.pyt   timeoutS   s    c         C   s   d j  |  j j |  j |  j  S(   Ns#   {0}(exhausted={1!r}, updated={2!r})(   R   t	   __class__R   R   R   (   R   (    (    s/   /usr/lib/python2.7/site-packages/acme/errors.pyt   __repr__X   s    (   R   R   R   R   t   propertyR   R   (    (    (    s/   /usr/lib/python2.7/site-packages/acme/errors.pyR   B   s   	t   ValidationErrorc           B   s   e  Z d  Z d   Z RS(   s   Error for authorization failures. Contains a list of authorization
    resources, each of which is invalid and should have an error field.
    c         C   s    | |  _  t t |   j   d  S(   N(   t   failed_authzrsR   R!   R   (   R   R"   (    (    s/   /usr/lib/python2.7/site-packages/acme/errors.pyR   a   s    	(   R   R   R   R   (    (    (    s/   /usr/lib/python2.7/site-packages/acme/errors.pyR!   ]   s   t   TimeoutErrorc           B   s   e  Z d  Z RS(   s>   Error for when polling an authorization or an order times out.(   R   R   R   (    (    (    s/   /usr/lib/python2.7/site-packages/acme/errors.pyR#   f   s   t   IssuanceErrorc           B   s   e  Z d  Z d   Z RS(   sD   Error sent by the server after requesting issuance of a certificate.c         C   s    | |  _  t t |   j   d S(   s\   Initialize.

        :param messages.Error error: The error provided by the server.
        N(   R   R   R$   R   (   R   R   (    (    s/   /usr/lib/python2.7/site-packages/acme/errors.pyR   m   s    	(   R   R   R   R   (    (    (    s/   /usr/lib/python2.7/site-packages/acme/errors.pyR$   j   s   t   ConflictErrorc           B   s   e  Z d  Z d   Z RS(   s  Error for when the server returns a 409 (Conflict) HTTP status.

    In the version of ACME implemented by Boulder, this is used to find an
    account if you only have the private key, but don't know the account URL.

    Also used in V2 of the ACME client for the same purpose.
    c         C   s    | |  _  t t |   j   d  S(   N(   t   locationR   R%   R   (   R   R&   (    (    s/   /usr/lib/python2.7/site-packages/acme/errors.pyR   ~   s    	(   R   R   R   R   (    (    (    s/   /usr/lib/python2.7/site-packages/acme/errors.pyR%   v   s   t   WildcardUnsupportedErrorc           B   s   e  Z d  Z RS(   sE   Error for when a wildcard is requested but is unsupported by ACME CA.(   R   R   R   (    (    (    s/   /usr/lib/python2.7/site-packages/acme/errors.pyR'      s   N(   R   t   josepyR    t   jose_errorst	   ExceptionR   R   t   DeserializationErrorR   R   R   R	   R
   R   R   R!   R#   R$   R%   R'   (    (    (    s/   /usr/lib/python2.7/site-packages/acme/errors.pyt   <module>   s   	