a ‚oeÛã@sHdZddlZddlmZddlmZddlmZddlmZddlmZddl Z ej rbddl m Z Gd d „d e ƒZGd d „d eƒZGd d„dejƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd „d eƒZGd!d"„d"eƒZGd#d$„d$eƒZdS)%z ACME errors.éN)ÚAny)ÚList)ÚMapping)ÚSet)Úerrors)Úmessagesc@seZdZdZdS)ÚErrorzGeneric ACME error.N©Ú__name__Ú __module__Ú __qualname__Ú__doc__©rrú,C:\Program Files\Certbot\pkgs\acme\errors.pyrsrc@seZdZdZdS)ÚDependencyErrorzDependency errorNr rrrrrsrc@seZdZdZdS)ÚSchemaValidationErrorz)JSON schema ACME object validation error.Nr rrrrrsrc@seZdZdZdS)Ú ClientErrorzNetwork error.Nr rrrrrsrc@seZdZdZdS)ÚUnexpectedUpdatezUnexpected update error.Nr rrrrr!src@seZdZdZdS)Ú NonceErrorzServer response nonce error.Nr rrrrr%srcs:eZdZdZeeeddœ‡fdd„ Zedœdd„Z‡Z S) ÚBadNoncezBad nonce error.N)ÚnonceÚerrorÚargsÚreturncstƒj|Ž||_||_dS©N)ÚsuperÚ__init__rr)Úselfrrr©Ú __class__rrr+s zBadNonce.__init__©rcCsd |j|j¡S)NzInvalid nonce ({0!r}): {1})Úformatrr©rrrrÚ__str__0szBadNonce.__str__) r r r r ÚstrÚ Exceptionrrr#Ú __classcell__rrrrr)srcs:eZdZdZejeddœ‡fdd„ Zedœdd„Z ‡Z S) Ú MissingNoncezý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 N)Úresponserrcstƒj|Ž||_dSr)rrr()rr(rrrrr>s zMissingNonce.__init__r cCsd |jjj|jj¡S)Nz_Server {0} response did not include a replay nonce, headers: {1} (This may be a service outage))r!r(ZrequestÚmethodZheadersr"rrrr#BsþzMissingNonce.__str__) r r r r ÚrequestsZResponserrr$r#r&rrrrr'4s r'csReZdZdZededddœ‡fdd„ Zeedœd d „ƒZ e dœd d „Z ‡Z S) Ú PollErroraŠ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 úmessages.AuthorizationResource)r,r,N)Ú exhaustedÚupdatedrcs||_||_tƒ ¡dSr)r-r.rr)rr-r.rrrrTszPollError.__init__r cCs t|jƒS)z Was the error caused by timeout?)Úboolr-r"rrrÚtimeout\szPollError.timeoutcCsd |jj|j|j¡S)Nz#{0}(exhausted={1!r}, updated={2!r}))r!rr r-r.r"rrrÚ__repr__asÿzPollError.__repr__) r r r r rrrÚpropertyr/r0r$r1r&rrrrr+Hs ýr+cs,eZdZdZedddœ‡fdd„ Z‡ZS)ÚValidationErrorz�Error for authorization failures. Contains a list of authorization resources, each of which is invalid and should have an error field. r,N)Úfailed_authzrsrcs||_tƒ ¡dSr)r4rr)rr4rrrrjszValidationError.__init__)r r r r rrr&rrrrr3fsr3c@seZdZdZdS)Ú TimeoutErrorz>Error for when polling an authorization or an order times out.Nr rrrrr5osr5cs(eZdZdZdddœ‡fdd„ Z‡ZS)Ú IssuanceErrorzDError sent by the server after requesting issuance of a certificate.zmessages.ErrorN)rrcs||_tƒ ¡dS)z\Initialize. :param messages.Error error: The error provided by the server. N)rrr)rrrrrrvszIssuanceError.__init__)r r r r rr&rrrrr6ssr6cs(eZdZdZeddœ‡fdd„ Z‡ZS)Ú ConflictErroraError 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. N)Úlocationrcs||_tƒ ¡dSr)r8rr)rr8rrrr‡szConflictError.__init__)r r r r r$rr&rrrrr7sr7c@seZdZdZdS)ÚWildcardUnsupportedErrorzEError for when a wildcard is requested but is unsupported by ACME CA.Nr rrrrr9Œsr9)r ÚtypingrrrrZjosepyrZ jose_errorsr*Ú TYPE_CHECKINGZacmerr%rrZDeserializationErrorrrrrrr'r+r3r5r6r7r9rrrrÚs.