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 get order method #9
Conversation
Hi, thanks for this contribution. I want to make sure I understand the need for this though. Don't you get the order returned when you call |
ok, I will give my test code: var ids []acme.Identifier
for _, domain := range domains {
ids = append(ids, acme.Identifier{Type: "dns", Value: domain})
}
order := acme.Order{Identifiers: ids}
order, err = client.NewOrder(ctx, account, order)
if err != nil {
return fmt.Errorf("creating new order err: %v", err)
}
fmt.Println("Order create result:", order.Location)
order = acme.Order{Identifiers: ids, Location: "https://acme-staging-v02.api.letsencrypt.org/acme/order/xxxx/1947985738"} // xxx I replaced
order, err = client.GetOrder(ctx, account, order)
if err != nil {
return fmt.Errorf("getting new order err: %v", err)
}
fmt.Println("Order get result:", order.Location) From the screenshot we can see that, |
I think Matt's question is "why do you need to get it again later, at all?" Why can't you just cache the order you get from |
oh, I just explained in the first, I want to make an api service, someone can submit a request, then I will record the txt records he need to add on their dns servers, they maybe add txt records later, when confirmed the records added, they can send another request to solve the challenge |
Well, the order is just a struct with no unexported fields. Why can't you just store it somewhere in the meantime? Serialize it to JSON for example, write it to a database or to file. |
Yes, you are right, I've already do that, but like |
Another motivation is that I use godaddy's dns nameserver, and the minimum txt records time can only be set to 600 seconds. If we go to solve channellege immediately, it is easy to cause letsencrypt to not be able to query the correct txt records, so I'd better wait After 600 seconds, I will go to the query. If there is an interface to query the order, then I can do other things in these 600 seconds. |
Hm, that is a unique flow. I guess having a getter method doesn't hurt. The spec even says:
So, having the ability to read the current status of an order could be useful to some. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, just a couple of nitpicks.
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
Thank you for your advise,I've already changed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
I want make an api service for cert request for those who want get certificate use dns TXT records manually, like this steps:
If we do not have a get order method, we can't get the order created from step 1, these will create a lot of invalid new orders, so I want to add a get order method, we just need to set the order's Location prop before call
GetOrder
method.Hope to be merged. I have tested that method works!