-
Notifications
You must be signed in to change notification settings - Fork 10
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
Feature/157 improve playbook execution speed by embedding the json schemas #199
Feature/157 improve playbook execution speed by embedding the json schemas #199
Conversation
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.
Great to have this in the end! But I think it would be nice to have an option to re-build the local schemas from the remote repository, shall they change.
sch, err = compiler.Compile(oca_cacao_schemas) | ||
if err != nil { | ||
return err | ||
schemaUrl := utils.GetEnv("VALIDATION_SCHEMA_URL", "") |
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.
How do we handle this logic so that we can automatically re-build the local schemas if they change?
if schemaUrl != "" { | ||
return validateWithRemoteSchema(rawJson, schemaUrl) | ||
} else { | ||
return validateWithLocalSchema(rawJson) |
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.
Should we perhaps also have an option "build local schemas", invoked once when building the code, which populates the schemas according to the latest version? Or something along those lines?
Added local cacao schemas for offline operation and speed increase.
The schemas used are: https://raw.githubusercontent.com/opencybersecurityalliance/cacao-roaster/main/lib/cacao-json-schemas/schemas/playbook.json
Go embed is used in combination with string schema building see: