Skip to content

Commit

Permalink
Merge 55c7d67 into 6c9fe14
Browse files Browse the repository at this point in the history
  • Loading branch information
pirtleshell committed Apr 15, 2022
2 parents 6c9fe14 + 55c7d67 commit 29a729c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2490,6 +2490,16 @@ func (c *ToznySDKV3) ExecuteSearch(executorRequest *searchExecutorClient.Executo
return nil, err
}
for index, record := range *results {
// TODO: fix root of below problem or support partial success
// If a record is indexed that the user does not actually have access to, the record won't have
// an access key which causes the call to `getAKForListedRecord` to panic. Any error in this loop
// results in a total failure of search. I needed this partial success implemented quick & dirty
// so I just skip attempting to decrypt. It should be handled more properly by allowing this func
// to support partial success.
if record.AccessKey == nil {
fmt.Printf("failure: NO ACCESS KEY! skipping record id: %+s\n", record.Metadata.RecordID)
continue
}
accessKey, err := c.getAKForListedRecord(rawEncryptionKey, record)
if err != nil {
return nil, err
Expand Down

0 comments on commit 29a729c

Please sign in to comment.