@@ -13,15 +13,13 @@ type ReceiptValidationOptions struct {
1313 StrictSignature bool
1414 StrictApprovals bool
1515 PublicKeyPath string
16+ PublicKeyDir string
1617}
1718
18- // CompileSchema compiles the receipt JSON Schema once for reuse.
1919func CompileSchema (schemaPath string ) (* jsonschema.Schema , error ) {
2020 return compileSchema (schemaPath )
2121}
2222
23- // ValidateReceiptObject validates a loaded receipt object.
24- // It always validates schema; then (optionally strict) hashes/signature/approvals.
2523func ValidateReceiptObject (
2624 r receipt.Receipt ,
2725 schema * jsonschema.Schema ,
@@ -43,6 +41,7 @@ func ValidateReceiptObject(
4341 sc , err := receipt .ValidateSignature (r , receipt.SignatureValidationOptions {
4442 Strict : opts .StrictSignature ,
4543 PublicKeyPath : opts .PublicKeyPath ,
44+ PublicKeyDir : opts .PublicKeyDir ,
4645 })
4746 if err != nil {
4847 return receipt.HashCheck {}, receipt.SignatureCheck {}, receipt.ApprovalSigCheck {}, err
@@ -51,6 +50,7 @@ func ValidateReceiptObject(
5150 ac , err := receipt .ValidateApprovalSignatures (r , receipt.ApprovalSigValidationOptions {
5251 Strict : opts .StrictApprovals ,
5352 PublicKeyPath : opts .PublicKeyPath ,
53+ PublicKeyDir : opts .PublicKeyDir ,
5454 })
5555 if err != nil {
5656 return receipt.HashCheck {}, receipt.SignatureCheck {}, receipt.ApprovalSigCheck {}, err
0 commit comments