Proposal/discussion: Schemas: JSON Schema and maybe more... #278
Unanswered
liamg
asked this question in
OPA and Rego
Replies: 1 comment
-
Sounds good to me! Do you see any risks with the approach? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been discussing this with @srenatus and we thought it best to open it up for global discussion...
Currently the JSON Schema parsing in OPA is done by forking/internalising the xeipuuv/gojsonschema module. There is then a conversion function in
opa
which takes a data structure from the module and spits out atypes.Type
for validation use.This module appears to no longer be maintained, and has many open issues. It also doesn't support drafts 2020-12 and 2019-09.
Recently there have been a couple of missing features/bugs (see link, link) in JSON Schema functionality that have revealed the above to be a potential issue.
The required functionality in OPA, currently can be split into two areas:
a. ...with the caveat that we must be able to avoid network access during parsing as per the specified capabilities
types.Type
to be used for policy validation.My proposal is:
types.Type
- i.e. replacingparseSchema
...and calling
compiler.WithSchemaParser(myCustomParser)
. This would also have the advantage of allowing for other schema/validation formats in other consuming projects if required, without OPA having to know about them in advance.WDYT?
Beta Was this translation helpful? Give feedback.
All reactions