mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 18:15:42 +01:00
Load ROLIE service by library function.
This commit is contained in:
parent
719ecaea76
commit
fd374b30b6
1 changed files with 8 additions and 14 deletions
|
|
@ -9,13 +9,9 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"io"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"encoding/json"
|
|
||||||
|
|
||||||
"github.com/csaf-poc/csaf_distribution/v2/csaf"
|
"github.com/csaf-poc/csaf_distribution/v2/csaf"
|
||||||
"github.com/csaf-poc/csaf_distribution/v2/util"
|
"github.com/csaf-poc/csaf_distribution/v2/util"
|
||||||
)
|
)
|
||||||
|
|
@ -289,23 +285,21 @@ func (p *processor) serviceCheck(url string, feeds [][]csaf.Feed) error {
|
||||||
return errContinue
|
return errContinue
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = func() (any, error) {
|
rolieService, err := func() (any, error) {
|
||||||
defer res.Body.Close()
|
defer res.Body.Close()
|
||||||
all, err := io.ReadAll(res.Body)
|
return csaf.LoadROLIEServiceDocument(res.Body)
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
var rolieService any
|
|
||||||
err = json.NewDecoder(bytes.NewReader(all)).Decode(&rolieService)
|
|
||||||
return rolieService, err
|
|
||||||
|
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
p.badROLIEservice.error("Loading ROLIE service document failed: %v.", err)
|
p.badROLIEservice.error("Loading ROLIE service document failed: %v.", err)
|
||||||
return errContinue
|
return errContinue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Use me!
|
||||||
|
_ = rolieService
|
||||||
|
_ = feeds
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
//Todo: Check conformity with RFC8322
|
// TODO: Check conformity with RFC8322
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue