"offline" verification using the bundle of attestations without any additional handling of the file (#9523)
This commit is contained in:
parent
19daa35c81
commit
8305a49c3f
1 changed files with 5 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue