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
|
||||
}
|
||||
ts := string(t)
|
||||
title := "CSAF feed (TLP:" + strings.ToUpper(ts) + ")"
|
||||
feedName := "csaf-feed-tlp-" + ts + ".json"
|
||||
href := c.CanonicalURLPrefix +
|
||||
"/.well-known/csaf/" + ts + "/" + feedName
|
||||
|
||||
collection := csaf.ROLIEServiceWorkspaceCollection{
|
||||
Title: title,
|
||||
Title: "CSAF feed (TLP:" + strings.ToUpper(ts) + ")",
|
||||
HRef: href,
|
||||
Categories: categories,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,14 +90,22 @@ func (c *controller) extendROLIE(
|
|||
|
||||
// Create new if does not exists.
|
||||
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{
|
||||
Feed: csaf.FeedData{
|
||||
ID: "csaf-feed-tlp-" + ts,
|
||||
Title: "CSAF feed (TLP:" + string(tlpLabel) + ")",
|
||||
Link: []csaf.Link{{
|
||||
Rel: "self",
|
||||
HRef: string(feedURL),
|
||||
}},
|
||||
Link: links,
|
||||
Category: []csaf.ROLIECategory{{
|
||||
Scheme: "urn:ietf:params:rolie:category:information-type",
|
||||
Term: "csaf",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue