Open-Attestation / open-attestation

Meta framework for providing digital provenance and integrity to documents.
https://openattestation.com
Apache License 2.0
54 stars 18 forks source link

Confirming validity of wrapped documents. #132

Closed mkdior closed 3 years ago

mkdior commented 4 years ago

Hi there, I'm currently trying to validate two different JSON objects ( one containing a raw certificate and the other the same certificate, but wrapped ) using the function below, but it always returns true for some reason; regardless of whether or not the document is wrapped. Am I misunderstanding this function's intended use?

https://github.com/Open-Attestation/open-attestation/blob/e4219564a0eae4efe0f18445cb83bcc0acde0f19/src/utils/utils.ts#L70

Nebulis commented 4 years ago

You are right and the implementation is wrong. Currently the implement will return true for any document that is not does not have the v3 schema. This is wrong and the following checks should be performed:

I'm pretty sure I did that somewhere, I will need to find it or implement it here again. If you are interested for contributing let me know I can guide you

mkdior commented 4 years ago

If I have time left this week I'll push a pr, thanks for the information.

Nebulis commented 3 years ago

available in v5