Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DukTapePolicyEngine ¶
type DukTapePolicyEngine struct {
// contains filtered or unexported fields
}
JsPolicyEngine is a javascript implementation of the attestation report generic PolicyValidator interface
func NewDukTapePolicyEngine ¶
func NewDukTapePolicyEngine(policies []byte) *DukTapePolicyEngine
NewDukTapePolicyEngine creates a new JsPolicyEngine with custom policies. Custom policies are handed over as a byte array. This implementation accepts custom policies as javascript code. The javascript code can parse the VerificationResult in the variable 'json', i.e.:
var obj = JSON.parse(json);
The javascript code must return a single boolean to indicate the success of the parsing. Logs can be output via: console.log() A very simple example of a custom Policy could look as follows:
var obj = JSON.parse(json); var success = true; if (obj.type != "Verification Result") { console.log("Invalid type"); success = false; } success
func (*DukTapePolicyEngine) Validate ¶
func (p *DukTapePolicyEngine) Validate(result []byte) bool
Validate uses a the C duktape javascript engine to validate the custom javascript policies against the verification result