1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 05:40:11 +01:00

Add support for remote validation services. (#185)

* Simple tool to test the remote validation

* Added remote validator support to provider.

* Added remote validation to aggregator.

* Calm golint

* Removed csaf_remote_validator tool as it was only for dev.

* Re-added csaf_remote_validator tool. Testing is not done.

* Embed the document entirely

* Include testing the remote validator in the Itests

* Change permission of the script

* Remove code for Itests

* As these will be done in another branch

Co-authored-by: Fadi Abbud <fadi.abbud@intevation.de>
This commit is contained in:
Sascha L. Teichmann 2022-06-21 14:47:06 +02:00 committed by GitHub
parent 7cbbb4bf81
commit 78d8b89aca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 466 additions and 43 deletions

View file

@ -20,7 +20,11 @@ import (
)
type processor struct {
// cfg is the global configuration.
cfg *config
// remoteValidator is a globally configured remote validator.
remoteValidator csaf.RemoteValidator
}
type summary struct {
@ -30,9 +34,10 @@ type summary struct {
}
type worker struct {
num int
num int
processor *processor
expr *util.PathEval
cfg *config
signRing *crypto.KeyRing
client util.Client // client per provider
@ -43,11 +48,11 @@ type worker struct {
summaries map[string][]summary // the summaries of the advisories.
}
func newWorker(num int, config *config) *worker {
func newWorker(num int, processor *processor) *worker {
return &worker{
num: num,
cfg: config,
expr: util.NewPathEval(),
num: num,
processor: processor,
expr: util.NewPathEval(),
}
}
@ -64,7 +69,7 @@ func (w *worker) createDir() (string, error) {
return w.dir, nil
}
dir, err := util.MakeUniqDir(
filepath.Join(w.cfg.Folder, w.provider.Name))
filepath.Join(w.processor.cfg.Folder, w.provider.Name))
if err == nil {
w.dir = dir
}