The purpose of this card is to evaluate if, thanks to the recent changes inside of TinyGo, policy authors can now unmarshall the bytes holding the Settings objects straight into a native Go structure.
For example, in go-policy-template, this would mean changing the following block and defining a struct that contains your settings. Then, unmarshall the payload in validateSettings and validate the settings in the go native struct. This may also mean removing calls to gjson such as this one.
Acceptance criteria
We no longer use gjson to "manually populate" a Settings structure
Old versions of TinyGo didn't support the
encoding/json
package, because of that the task of extracting the policy settings was pretty painful.This can be seen here.
The purpose of this card is to evaluate if, thanks to the recent changes inside of TinyGo, policy authors can now unmarshall the bytes holding the Settings objects straight into a native Go structure.
For example, in go-policy-template, this would mean changing the following block and defining a struct that contains your settings. Then, unmarshall the
payload
invalidateSettings
and validate the settings in the go native struct. This may also mean removing calls to gjson such as this one.Acceptance criteria