Subject: [Acme] [QUESTION] Implementation of 'new-order'

From: Prasheel Soni <[email-masked]>
Date: Thu, 26 Oct 2017 12:00:02 +0530

Hi Devs,

I am facing an issue while implementing the ACME. I am trying to create
new-order endpoint which should provide the order object with the list of
authorizations in response.

So, I need to create the record in authorization entity and further in
challenges entity.

I have set the primary key(id) of authorization and challenges to
autoIncrement.

I am facing the issue that for creating an order I need to first insert a
record in order entity leaving the authorizations field data empty. Then
further I need to create a record in authorization entity which will
provide me with the id (primary key) and this id is required to create
authorization's URL.

so should I remove authorization id (PK) from autoincrement and generate it
randomly?

Thanks in advance!!

Regards
*Prasheel*

‌

---

From: Jacob Hoffman-Andrews <[email-masked]>
Date: Fri, 27 Oct 2017 14:52:56 -0700

On 10/25/2017 11:30 PM, Prasheel Soni wrote:
> I am facing the issue that for creating an order I need to first
> insert a record in order entity leaving the authorizations field data
> empty. Then further I need to create a record in authorization entity
> which will provide me with the id (primary key) and this id is
> required to create authorization's URL.
>
> so should I remove authorization id (PK) from autoincrement and
> generate it randomly?
The approach we are taking in Boulder is to treat the relationship
between orders and authorizations as a many-to-many relationship. Each
order can contain many authorizations, and each authorization can be
contained in many orders. We represent this as a relationship table that
has one column for order id, and one column for authorization id,
created after both the order and the authorizations.

---

From: Prasheel Soni <[email-masked]>
Date: Sat, 28 Oct 2017 11:21:49 +0530

Thanks, Jacob.
I was wondering about the process flow and the schema that you followed in
Boulder. I tried to go through the code on GitHub but I'm not that good at
go lang, so I wasn't able to figure out much. It would be a great help if
you can do that.

Thanks again

‌

*Prasheel Soni*
Enterprise Software Engineer
HotWax Systems <http://www.hotwaxsystems.com/>
Plot no. 80, Scheme no. 78, Vijay Nagar, Indore, M.P. India 452010
Cell phone: +91 94259 64489

On Sat, Oct 28, 2017 at 3:22 AM, Jacob Hoffman-Andrews <[email-masked]> wrote:

> so should I remove authorization id (PK) from autoincrement and generate
> it randomly?
>
> The approach we are taking in Boulder is to treat the relationship between
> orders and authorizations as a many-to-many relationship. Each order can
> contain many authorizations, and each authorization can be contained in
> many orders. We represent this as a relationship table that has one column
> for order id, and one column for authorization id, created after both the
> order and the authorizations.
>