Giter Club home page Giter Club logo

Comments (4)

fhunleth avatar fhunleth commented on September 18, 2024

The relation is the other way. @jjcarstens can comment on that line. However, it should be many CAs to one product.

A CA can only JITP for one product, though. You can't have one CA JITP'ing for multiple products since NH wouldn't know which product to assign to the device when it first authenticates.

from nerves_hub_web.

jeanparpaillon avatar jeanparpaillon commented on September 18, 2024

I understand a CA can only JITP for one product.
I may be wrong, but on line 12, create unique_index(:jitp, [:product_id]) enforces a single JITP enabled CA per product.
From https://github.com/nerves-hub/nerves_hub_web/blob/main/apps/nerves_hub_web_core/lib/nerves_hub_web_core/products/product.ex#L22 , we have in Product : has_one :jitp

@jjcarstens can you explain this limitation ?

from nerves_hub_web.

jjcarstens avatar jjcarstens commented on September 18, 2024

Right now there is a hard limitation of one JITP CA per product because of that unique index (as @jeanparpaillon said). But we should probably remove that so unique index so that many CAs can JITP one product (as @fhunleth said). The way CAs are structured already enforces that a CA can only JITP for one product

FWIW, we had discussed this need for our internal instance, but then moved away from using JITP entirely and hadn't circled back to it. I believe we can simply just remove the linked index for :product_id on JITP records

from nerves_hub_web.

fhunleth avatar fhunleth commented on September 18, 2024

Got it. I forgot the discussion and just assumed that it was working for us internally at one time. The restriction doesn't make sense, and if it's as simple as removing the linked index for :product_id, then I'm definitely for it.

from nerves_hub_web.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.