mirror of
https://github.com/certbot/certbot.git
synced 2026-08-02 00:22:28 +02:00
Revert "Do not send status or resource fields in newOrder payloads for ACMEv2"
This reverts commit d19698251d.
This commit is contained in:
+2
-2
@@ -646,7 +646,7 @@ class ClientV2(ClientBase):
|
|||||||
value=name))
|
value=name))
|
||||||
order = messages.NewOrder(identifiers=identifiers)
|
order = messages.NewOrder(identifiers=identifiers)
|
||||||
response = self._post(self.directory['newOrder'], order)
|
response = self._post(self.directory['newOrder'], order)
|
||||||
body = messages.OrderBase.from_json(response.json())
|
body = messages.Order.from_json(response.json())
|
||||||
authorizations = []
|
authorizations = []
|
||||||
for url in body.authorizations:
|
for url in body.authorizations:
|
||||||
authorizations.append(self._authzr_from_response(self.net.get(url), uri=url))
|
authorizations.append(self._authzr_from_response(self.net.get(url), uri=url))
|
||||||
@@ -715,7 +715,7 @@ class ClientV2(ClientBase):
|
|||||||
while datetime.datetime.now() < deadline:
|
while datetime.datetime.now() < deadline:
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
response = self.net.get(orderr.uri)
|
response = self.net.get(orderr.uri)
|
||||||
body = messages.OrderBase.from_json(response.json())
|
body = messages.Order.from_json(response.json())
|
||||||
if body.error is not None:
|
if body.error is not None:
|
||||||
raise errors.IssuanceError(body.error)
|
raise errors.IssuanceError(body.error)
|
||||||
if body.certificate is not None:
|
if body.certificate is not None:
|
||||||
|
|||||||
+8
-15
@@ -509,10 +509,11 @@ class Revocation(jose.JSONObjectWithFields):
|
|||||||
reason = jose.Field('reason')
|
reason = jose.Field('reason')
|
||||||
|
|
||||||
|
|
||||||
class OrderBase(ResourceBody):
|
class Order(ResourceBody):
|
||||||
"""Order Resource Body.
|
"""Order Resource Body.
|
||||||
|
|
||||||
:ivar list of .Identifier: List of identifiers for the certificate.
|
:ivar list of .Identifier: List of identifiers for the certificate.
|
||||||
|
:ivar acme.messages.Status status:
|
||||||
:ivar list of str authorizations: URLs of authorizations.
|
:ivar list of str authorizations: URLs of authorizations.
|
||||||
:ivar str certificate: URL to download certificate as a fullchain PEM.
|
:ivar str certificate: URL to download certificate as a fullchain PEM.
|
||||||
:ivar str finalize: URL to POST to to request issuance once all
|
:ivar str finalize: URL to POST to to request issuance once all
|
||||||
@@ -521,6 +522,8 @@ class OrderBase(ResourceBody):
|
|||||||
:ivar .Error error: Any error that occurred during finalization, if applicable.
|
:ivar .Error error: Any error that occurred during finalization, if applicable.
|
||||||
"""
|
"""
|
||||||
identifiers = jose.Field('identifiers', omitempty=True)
|
identifiers = jose.Field('identifiers', omitempty=True)
|
||||||
|
status = jose.Field('status', decoder=Status.from_json,
|
||||||
|
omitempty=True, default=STATUS_PENDING)
|
||||||
authorizations = jose.Field('authorizations', omitempty=True)
|
authorizations = jose.Field('authorizations', omitempty=True)
|
||||||
certificate = jose.Field('certificate', omitempty=True)
|
certificate = jose.Field('certificate', omitempty=True)
|
||||||
finalize = jose.Field('finalize', omitempty=True)
|
finalize = jose.Field('finalize', omitempty=True)
|
||||||
@@ -531,16 +534,6 @@ class OrderBase(ResourceBody):
|
|||||||
def identifiers(value): # pylint: disable=missing-docstring,no-self-argument
|
def identifiers(value): # pylint: disable=missing-docstring,no-self-argument
|
||||||
return tuple(Identifier.from_json(identifier) for identifier in value)
|
return tuple(Identifier.from_json(identifier) for identifier in value)
|
||||||
|
|
||||||
|
|
||||||
class Order(OrderBase):
|
|
||||||
"""Order Resource Body for ACMEv1
|
|
||||||
|
|
||||||
:ivar acme.messages.Status status:
|
|
||||||
"""
|
|
||||||
status = jose.Field('status', decoder=Status.from_json,
|
|
||||||
omitempty=True, default=STATUS_PENDING)
|
|
||||||
|
|
||||||
|
|
||||||
class OrderResource(ResourceWithURI):
|
class OrderResource(ResourceWithURI):
|
||||||
"""Order Resource.
|
"""Order Resource.
|
||||||
|
|
||||||
@@ -556,8 +549,8 @@ class OrderResource(ResourceWithURI):
|
|||||||
authorizations = jose.Field('authorizations')
|
authorizations = jose.Field('authorizations')
|
||||||
fullchain_pem = jose.Field('fullchain_pem', omitempty=True)
|
fullchain_pem = jose.Field('fullchain_pem', omitempty=True)
|
||||||
|
|
||||||
|
|
||||||
@Directory.register
|
@Directory.register
|
||||||
class NewOrder(OrderBase):
|
class NewOrder(Order):
|
||||||
"""New order for ACMEv2"""
|
"""New order."""
|
||||||
resource_type = "new-order"
|
resource_type = 'new-order'
|
||||||
|
resource = fields.Resource(resource_type)
|
||||||
|
|||||||
Reference in New Issue
Block a user