digital-asset / daml

The Daml smart contract language
https://www.digitalasset.com/developers
Other
802 stars 204 forks source link

Fix auth0 docs to work with Daml 2.0’s create-daml-app #12849

Closed cocreature closed 2 years ago

cocreature commented 2 years ago

We have some docs for setting up auth0 in https://docs.daml.com/ops/connect/auth0.html as well as support in create-daml-app for working with auth0. However, a few things changed in 2.0 that we need to adapt to:

Required for 2.0:

  1. The docs still reference old daml sandbox commands which don’t work with a Canton sandbox.
  2. create-daml-app now relies on having a public party that all users can readAs. We need to issue tokens to allow for that as well as change create-daml-app to figure out the id of that public party.

Desirable for 2.0:

  1. Ideally, we’d also switch to issuing user tokens instead of the custom Daml-style tokens.
cocreature commented 2 years ago

https://github.com/digital-asset/daml/pull/12878 was the last big change we needed in create-daml-app so you should be able to do the auth0 work without making too many changes. For daml-hub I needed to use a separate token for the public party so if that makes things easier via auth0 we can do that as well instead of issuing actAs for the user party & readAs for the public party in a single token.

stefanobaghino-da commented 2 years ago

I think we'll temporarily delete that page as it depends on the Helm Chart, which will not be ready in time for 2.0, and re-writing and testing the entire process relying on either using plain docker calls seems like a partial, bug-ridden, slow re-implementation of part of the Helm Chart. @ray-roestenburg-da @garyverhaegen-da thoughts?

cocreature commented 2 years ago

Note it’s not that page, there is also auth0 support in create-daml-app which is completely broken and needs to be deleted in that case.

ray-roestenburg-da commented 2 years ago

@stefanobaghino-da sounds good to me to remove docs that simply do not work, and revisit these later.

garyverhaegen-da commented 2 years ago

I agree that temporarily removing these pages seems like the best path forward.

stefanobaghino-da commented 2 years ago

To make sure we can keep track of everything I've broken this down into

stefanobaghino-da commented 2 years ago

I'll update the ticktets mentioned above to reflect the decision took by @bame-da and @davidrichards-da to keep the documentation in for this version, put it in early access and specify it refers to version 1.18.

cocreature commented 2 years ago

I think we should still drop the code from create-daml-app though. Saying it refers to 1.18 doesn’t make sense there.

stefanobaghino-da commented 2 years ago

I think we should still drop the code from create-daml-app though. Saying it refers to 1.18 doesn’t make sense there.

I agree with your point of view and I offered the same, but this is not my decision to take.

cocreature commented 2 years ago

Just to be clear, I’m saying it’s fine for the helm chart and the auth0 docs to do what product suggested. It simply doesn’t work for create-daml-app. The code is literally completely broken with a TODO FIXME. Adding a comment saying that it used to work in 1.18 is not helpful. You need the full 1.18 template for that.