mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 11:55:40 +01:00
Link service document in ROLIE feeds.
This commit is contained in:
parent
7f62caeedc
commit
e37fe68b34
2 changed files with 13 additions and 6 deletions
|
|
@ -83,13 +83,12 @@ func createService(c *config, wellknownCSAF string) error {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
ts := string(t)
|
ts := string(t)
|
||||||
title := "CSAF feed (TLP:" + strings.ToUpper(ts) + ")"
|
|
||||||
feedName := "csaf-feed-tlp-" + ts + ".json"
|
feedName := "csaf-feed-tlp-" + ts + ".json"
|
||||||
href := c.CanonicalURLPrefix +
|
href := c.CanonicalURLPrefix +
|
||||||
"/.well-known/csaf/" + ts + "/" + feedName
|
"/.well-known/csaf/" + ts + "/" + feedName
|
||||||
|
|
||||||
collection := csaf.ROLIEServiceWorkspaceCollection{
|
collection := csaf.ROLIEServiceWorkspaceCollection{
|
||||||
Title: title,
|
Title: "CSAF feed (TLP:" + strings.ToUpper(ts) + ")",
|
||||||
HRef: href,
|
HRef: href,
|
||||||
Categories: categories,
|
Categories: categories,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -90,14 +90,22 @@ func (c *controller) extendROLIE(
|
||||||
|
|
||||||
// Create new if does not exists.
|
// Create new if does not exists.
|
||||||
if rolie == nil {
|
if rolie == nil {
|
||||||
|
links := []csaf.Link{{
|
||||||
|
Rel: "self",
|
||||||
|
HRef: string(feedURL),
|
||||||
|
}}
|
||||||
|
// If we have a service document we need to link it.
|
||||||
|
if c.cfg.ServiceDocument {
|
||||||
|
links = append(links, csaf.Link{
|
||||||
|
Rel: "service",
|
||||||
|
HRef: c.cfg.CanonicalURLPrefix + "/.well-known/csaf/service.json",
|
||||||
|
})
|
||||||
|
}
|
||||||
rolie = &csaf.ROLIEFeed{
|
rolie = &csaf.ROLIEFeed{
|
||||||
Feed: csaf.FeedData{
|
Feed: csaf.FeedData{
|
||||||
ID: "csaf-feed-tlp-" + ts,
|
ID: "csaf-feed-tlp-" + ts,
|
||||||
Title: "CSAF feed (TLP:" + string(tlpLabel) + ")",
|
Title: "CSAF feed (TLP:" + string(tlpLabel) + ")",
|
||||||
Link: []csaf.Link{{
|
Link: links,
|
||||||
Rel: "self",
|
|
||||||
HRef: string(feedURL),
|
|
||||||
}},
|
|
||||||
Category: []csaf.ROLIECategory{{
|
Category: []csaf.ROLIECategory{{
|
||||||
Scheme: "urn:ietf:params:rolie:category:information-type",
|
Scheme: "urn:ietf:params:rolie:category:information-type",
|
||||||
Term: "csaf",
|
Term: "csaf",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue