Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add async interface for finalization to acme.client.ClientV2 #9622

Merged
merged 2 commits into from
Mar 23, 2023

Conversation

aglasgall
Copy link
Contributor

@aglasgall aglasgall commented Mar 22, 2023

Add begin_order_finalization()/poll_finalization() to acme.client.ClientV2, which are directly analogous to answer_challenge()/poll_authorizations(). This allows us to finalize an order and then later poll for its completion as separate steps. Also rewrite finalize_order() to call these two methods (which are just the previous body of finalize_order() split in two.)

I've not added new test cases because the existing test cases for finalize_order() exercise all of the same code paths, but I can if we want to belt-and-suspenders this.

Fixes #9620

Pull Request Checklist

  • The Certbot team has recently expressed interest in reviewing a PR for this. If not, this PR may be closed due our limited resources and need to prioritize how we spend them.
  • If the change being made is to a distributed component, edit the master section of certbot/CHANGELOG.md to include a description of the change being made.
  • Add or update any documentation as needed to support the changes in this PR.
  • Include your name in AUTHORS.md if you like.

Add `begin_order_finalization()`/`poll_finalization()` to
`acme.client.ClientV2`, which are directly analogous to
`answer_challenge()`/`poll_authorizations()`. This allows us to
finalize an order and then later poll for its completion as separate
steps.
@aglasgall
Copy link
Contributor Author

@alexzorin , this is ready for review at your convenience.

Copy link
Collaborator

@alexzorin alexzorin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks! Just some feedback for naming and the changelog.

Comment on lines 11 to 13
* `acme.client.ClientV2` now provides an asynchronous interface for
order finalization (`begin_order_finalization()` and
`poll_finalization()`)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a small potential ambiguity here with Python's async, and it would be good to mention that these relate to finalize_order. Maybe something like:

acme.client.ClientV2 now provides separate begin_order_finalization and poll_finalization methods, in addition to the existing finalize_order method.

def finalize_order(self, orderr: messages.OrderResource, deadline: datetime.datetime,
fetch_alternative_chains: bool = False) -> messages.OrderResource:
"""Finalize an order and obtain a certificate.
def begin_order_finalization(self, orderr: messages.OrderResource
Copy link
Collaborator

@alexzorin alexzorin Mar 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to align this name either with poll_finalization or finalize_order. Perhaps submit_finalization or begin_finalization.

@alexzorin alexzorin self-assigned this Mar 22, 2023
@alexzorin alexzorin added this to the 2.5.0 milestone Mar 22, 2023
Rename `begin_order_finalization` -> `begin_finalization` and tweak
wording of changelog entry
@aglasgall
Copy link
Contributor Author

OK, renamed the method and adopted your proposed wording for the changelog entry. Anything else?

@alexzorin alexzorin merged commit 8e28e36 into certbot:master Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

acme: no interface for asynchronous finalization a la validation
2 participants