"offline" verification using the bundle of attestations without any additional handling of the file (#9523)

This commit is contained in:
Aryan Bhosale 2024-08-26 21:28:29 +05:30 committed by GitHub
parent 19daa35c81
commit 8305a49c3f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,6 +2,7 @@ package verification
import (
"bufio"
"bytes"
"encoding/json"
"errors"
"fmt"
@ -88,6 +89,10 @@ func loadBundlesFromJSONLinesFile(path string) ([]*api.Attestation, error) {
var line []byte
line, err = reader.ReadBytes('\n')
for err == nil {
if len(bytes.TrimSpace(line)) == 0 {
line, err = reader.ReadBytes('\n')
continue
}
var bundle bundle.ProtobufBundle
bundle.Bundle = new(protobundle.Bundle)
err = bundle.UnmarshalJSON(line)