Ephenodrom / Dart-Acme-Client

ACME client written in Dart.
MIT License
3 stars 5 forks source link

finalizeOrder ignores status of 'processing. #10

Closed bsutton closed 11 months ago

bsutton commented 11 months ago

I having problems with the call to AcmeClient.finalizeOrder.

The issue is that the CA is returning a status of 'processing'.

According to the RFC:

 "processing": The certificate is being issued.  Send a POST-as-GET
      request after the time given in the Retry-After header field of
      the response, if any.

Is the retry something that finalizeOrder should do or should the calling library do the retry.

As it stands the calling library can't do the retry as the response status isn't returned. The best the calling library can do is check if the certificate on the order is non-null.

Of course that approach is less than ideal as the calling process may be doing retries when the failure is actually a permanent failure.

I will have a go at putting some retry logic into finalizeOrder to see if it fixes the issue.

Ephenodrom commented 11 months ago

I think both ways are ok.

1) If you retry it within the method you should add a dart doc that informs about the retry logic within the method. 2) As the method returns the Order entity that contains the status, also the retry mechanism can be done in the calling library.

For my personal opinion I would suggest number 2 as this keeps the acme package more simple. I would suggest to add some doc comment that informs the user that he should check the status and what he should do if the status has the value "processing".

bsutton commented 11 months ago

I went with one and added an optional retry count. I will update the doc comment.

It looks to be working nicely and is non breaking.

On Sun, 10 Dec 2023, 1:28 am Ephenodrom, @.***> wrote:

I think both ways are ok.

  1. If you retry it within the method you should add a dart doc that informs about the retry logic within the method.
  2. As the method returns the Order entity that contains the status, also the retry mechanism can be done in the calling library.

For my personal opinion I would suggest number 2 as this keeps the acme package more simple. I would suggest to add some doc comment that informs the user that he should check the status and what he should do if the status has the value "processing".

— Reply to this email directly, view it on GitHub https://github.com/Ephenodrom/Dart-Acme-Client/issues/10#issuecomment-1848425204, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG32OEDSQOYNWV376AI7TTYIRYQ3AVCNFSM6AAAAABANPPP6WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBYGQZDKMRQGQ . You are receiving this because you authored the thread.Message ID: @.***>

Ephenodrom commented 11 months ago

@bsutton Sounds great!

Ephenodrom commented 11 months ago

Version 1.3.0 is out on pub.dev including this fix.