-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
matcher: Introduce Remote Matcher interface (#202)
* matcher: Add preliminary support for Remote Matcher RemoteMatcher is an additional interface that a Matcher can implement. When called the interface can invoke the remote matcher using the RESTful API to fetch new vulnerabilities associated with the given IndexRecords. The information retrieved from this interface **won't be persisted** into ClairCore database. * Update internal/matcher/controller.go Co-authored-by: Louis DeLosSantos <louis.delos@gmail.com> * remotematcher: Add a realistic deadline for QueryRemoteMatcher call * remotematcher: Change deadline to 60s according to review comments Co-authored-by: Louis DeLosSantos <louis.delos@gmail.com>
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package driver | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/quay/claircore" | ||
) | ||
|
||
// RemoteMatcher is an additional interface that a Matcher can implement. | ||
|
||
// When called the interface can invoke the remote matcher using the RESTful API | ||
// to fetch new vulnerabilities associated with the given IndexRecords. | ||
|
||
// The information retrieved from this interface won't be persisted into ClairCore database. | ||
type RemoteMatcher interface { | ||
QueryRemoteMatcher(ctx context.Context, records []*claircore.IndexRecord) (map[string][]*claircore.Vulnerability, error) | ||
} |