-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: use ajv standalone validation code #258
Conversation
src/shared/ajv.ts
Outdated
if (!schema) throw new Error(`Could not find ${key} schema`); | ||
return schema; | ||
return schema as AnyValidateFunction; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference between AnyValidateFunction
vs ValidateFunction
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh AnyValidateFunction
caters for async
validations. Just realised we dont use it in our validation, Ill revert to using ValidateFunction
like before!
🎉 This PR is included in version 6.8.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This reverts commit 2a69683.
Context
unsafe-eval
in their Content Security Policy (CSP) to use our library because we are using ajv compile at runtime. To have a more secure CSP, we will be compiling the schemas at build time instead.What this PR does
strict
andnon-strict
; hence there are two compiled javascript functions file which caters for both scenarios.unsafe-eval
on Verifiers UItsconfig.json
toallowJs
imports (to import the compiled files)