From 5a1c2a08735444720d999dbdcde5a9f529c6c3d9 Mon Sep 17 00:00:00 2001 From: "Sascha L. Teichmann" Date: Wed, 19 Nov 2025 12:12:43 +0100 Subject: [PATCH 1/4] Add category field to ROLIE feed model. --- csaf/rolie.go | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/csaf/rolie.go b/csaf/rolie.go index d3a5ac7..9351386 100644 --- a/csaf/rolie.go +++ b/csaf/rolie.go @@ -9,8 +9,10 @@ package csaf import ( + "bytes" "encoding/json" "io" + "os" "sort" "time" @@ -169,14 +171,15 @@ type Format struct { // Entry for ROLIE. type Entry struct { - ID string `json:"id"` - Titel string `json:"title"` - Link []Link `json:"link"` - Published TimeStamp `json:"published"` - Updated TimeStamp `json:"updated"` - Summary *Summary `json:"summary,omitempty"` - Content Content `json:"content"` - Format Format `json:"format"` + ID string `json:"id"` + Titel string `json:"title"` + Link []Link `json:"link"` + Published TimeStamp `json:"published"` + Updated TimeStamp `json:"updated"` + Summary *Summary `json:"summary,omitempty"` + Content Content `json:"content"` + Format Format `json:"format"` + Category []ROLIECategory `json:"category,omitempty"` } // FeedData is the content of the ROLIE feed. @@ -196,6 +199,14 @@ type ROLIEFeed struct { // LoadROLIEFeed loads a ROLIE feed from a reader. func LoadROLIEFeed(r io.Reader) (*ROLIEFeed, error) { + all, err := io.ReadAll(r) + if err != nil { + return nil, err + } + if err := os.WriteFile("rolie.json", all, 060); err != nil { + return nil, err + } + r = bytes.NewReader(all) var rf ROLIEFeed if err := misc.StrictJSONParse(r, &rf); err != nil { return nil, err From d6bac95e454665b8d5c040b92f72cbb0f1656a74 Mon Sep 17 00:00:00 2001 From: "Sascha L. Teichmann" Date: Wed, 19 Nov 2025 12:56:04 +0100 Subject: [PATCH 2/4] Removed debugging code --- csaf/rolie.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/csaf/rolie.go b/csaf/rolie.go index 9351386..d023028 100644 --- a/csaf/rolie.go +++ b/csaf/rolie.go @@ -9,10 +9,8 @@ package csaf import ( - "bytes" "encoding/json" "io" - "os" "sort" "time" @@ -199,14 +197,6 @@ type ROLIEFeed struct { // LoadROLIEFeed loads a ROLIE feed from a reader. func LoadROLIEFeed(r io.Reader) (*ROLIEFeed, error) { - all, err := io.ReadAll(r) - if err != nil { - return nil, err - } - if err := os.WriteFile("rolie.json", all, 060); err != nil { - return nil, err - } - r = bytes.NewReader(all) var rf ROLIEFeed if err := misc.StrictJSONParse(r, &rf); err != nil { return nil, err From 9a37a8ecfa695dbd973cb9e3dacc2049f14c109a Mon Sep 17 00:00:00 2001 From: "Sascha L. Teichmann" Date: Thu, 27 Nov 2025 15:23:34 +0100 Subject: [PATCH 3/4] Add more fields to rolie entry. --- csaf/rolie.go | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/csaf/rolie.go b/csaf/rolie.go index d023028..2b7d6fd 100644 --- a/csaf/rolie.go +++ b/csaf/rolie.go @@ -169,15 +169,22 @@ type Format struct { // Entry for ROLIE. type Entry struct { - ID string `json:"id"` - Titel string `json:"title"` - Link []Link `json:"link"` - Published TimeStamp `json:"published"` - Updated TimeStamp `json:"updated"` - Summary *Summary `json:"summary,omitempty"` - Content Content `json:"content"` - Format Format `json:"format"` - Category []ROLIECategory `json:"category,omitempty"` + Base *string `json:"base,omitempty"` + LanguageTag *string `json:"lang,omitempty"` + Author *json.RawMessage `json:"author,omitempty"` + Category []ROLIECategory `json:"category,omitempty"` + Content Content `json:"content"` + Contributor *json.RawMessage `json:"contibutor,omitempty"` + ID string `json:"id"` + Link []Link `json:"link"` + Published TimeStamp `json:"published"` + Rights *json.RawMessage `json:"rights,omitempty"` + Source *json.RawMessage `json:"source,omitempty"` + Summary *Summary `json:"summary,omitempty"` + Titel string `json:"title"` + Updated TimeStamp `json:"updated"` + Format Format `json:"format"` + Property *json.RawMessage `json:"property,omitempty"` } // FeedData is the content of the ROLIE feed. From 502376ce3a4104d62b7614557f53a1c38ad62f3c Mon Sep 17 00:00:00 2001 From: JanHoefelmeyer Date: Fri, 28 Nov 2025 16:12:10 +0100 Subject: [PATCH 4/4] fix typo: contibutor -> contributor --- csaf/rolie.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csaf/rolie.go b/csaf/rolie.go index 2b7d6fd..84b916c 100644 --- a/csaf/rolie.go +++ b/csaf/rolie.go @@ -174,7 +174,7 @@ type Entry struct { Author *json.RawMessage `json:"author,omitempty"` Category []ROLIECategory `json:"category,omitempty"` Content Content `json:"content"` - Contributor *json.RawMessage `json:"contibutor,omitempty"` + Contributor *json.RawMessage `json:"contributor,omitempty"` ID string `json:"id"` Link []Link `json:"link"` Published TimeStamp `json:"published"`