News for hackers. Stuff that matters.
Re:JsonLogic by sebmellen on Thursday May 27, 2021 @04:34PM (#27308070)
Ok, I take your point, but let's say we need to share these credential objects between different systems that do not have prior knowledge of how to evaluate the credential data. Also, let's say we constrain the logic to only allow for evaluation of any given part of the credential data against a binary "pass | fail" matrix.

What is a better way to share this important part of the schema (the matrix) without resorting to letting the "business logic" perform the evaluation? Optimally, any matrix should be able to run against the same business logic for evaluation.

Also, though I understand why you say that, we won't have "100 other yahoos doing this nonsense," and each schema would go through a pretty thorough review process.

Re:JsonLogic by valenterry on Thursday May 27, 2021 @07:58PM (#27310129)
> but let's say we need to share these credential objects between different systems that do not have prior knowledge of how to evaluate the credential data

Well, they _must_ have prior knowledge about it, because they must have to understand the concept of JsonLogic beforehand. So instead, you can just make these systems understand a proper programming language that can produce outputs. Something like https://github.com/dhall-lang/dhall-lang would probably be a much better option for this usecase.

Re:JsonLogic by sebmellen on Thursday May 27, 2021 @11:01PM (#27311277)
With the standard that we're working with (the W3C's "Verifiable Credentials" standard [0]) having something that's in JSON or at least "JSON-compatible" is quite important.

[0]: https://www.w3.org/TR/vc-data-model/

Re:JsonLogic by valenterry on Thursday May 27, 2021 @11:40PM (#27311488)
No problem, just serialize the dhall into a json string.
Re:JsonLogic by omegaworks on Thursday May 27, 2021 @04:41PM (#27308176)
If your business logic doesn't meet the needs of your business without the schema, the schema is a part of your business logic, that should be subjected to a suite of automated tests.

If your concern is the sharability, consider making a library or service that provides the business logic.

Re:JsonLogic by sebmellen on Thursday May 27, 2021 @04:45PM (#27308261)
We'd like to be able to include evaluation matrices within credentials as an extension to the Verifiable Credentials standard (see https://www.w3.org/TR/vc-data-model/). Optimally, different libraries and different services will be able to evaluate a credential using the credential's included matrix (i.e. the evaluation matrix should not be reliant on any business logic from any particular party). I can't get too deep into the use-case but having these parts bundled together is important for what we're working on.
Re:JsonLogic by Seb-C on Thursday May 27, 2021 @11:05PM (#27311299)
What about an "isValid" field returned by your API?

Your problem is that you need the same logic in two places, and you can solve it by centralizing this logic in one place.