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

Add another layer aound the ROLIE feed documents.

This commit is contained in:
Sascha L. Teichmann 2022-02-23 21:10:19 +01:00
parent 9e13831a6f
commit 4fc6bc5509
3 changed files with 20 additions and 13 deletions

View file

@ -226,16 +226,18 @@ func (c *controller) upload(r *http.Request) (interface{}, error) {
// Create new if does not exists.
if rolie == nil {
rolie = &csaf.ROLIEFeed{
ID: "csaf-feed-tlp-" + ts,
Title: "CSAF feed (TLP:" + string(tlpLabel) + ")",
Link: []csaf.Link{{
Rel: "rel",
HRef: string(feedURL),
}},
Feed: csaf.FeedData{
ID: "csaf-feed-tlp-" + ts,
Title: "CSAF feed (TLP:" + string(tlpLabel) + ")",
Link: []csaf.Link{{
Rel: "rel",
HRef: string(feedURL),
}},
},
}
}
rolie.Updated = csaf.TimeStamp(time.Now())
rolie.Feed.Updated = csaf.TimeStamp(time.Now())
year := strconv.Itoa(ex.initialReleaseDate.Year())
@ -245,7 +247,7 @@ func (c *controller) upload(r *http.Request) (interface{}, error) {
e := rolie.EntryByID(ex.id)
if e == nil {
e = &csaf.Entry{ID: ex.id}
rolie.Entry = append(rolie.Entry, e)
rolie.Feed.Entry = append(rolie.Feed.Entry, e)
}
e.Titel = ex.title