From 989e3667bad4c10cb1a779d3a7efd526929dc002 Mon Sep 17 00:00:00 2001 From: koplas Date: Mon, 16 Sep 2024 20:23:22 +0200 Subject: [PATCH] Fix provider-metadata.json --- cmd/csaf_downloader/downloader_test.go | 13 +++++++------ .../simple-rolie-provider/provider-metadata.json | 8 ++++---- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/cmd/csaf_downloader/downloader_test.go b/cmd/csaf_downloader/downloader_test.go index 46c091d7..8fecaeb3 100644 --- a/cmd/csaf_downloader/downloader_test.go +++ b/cmd/csaf_downloader/downloader_test.go @@ -23,9 +23,9 @@ import ( ) type ProviderParams struct { - url string - enableSha256 bool - enableSha512 bool + URL string + EnableSha256 bool + EnableSha512 bool } func ProviderHandler(params *ProviderParams, directoryProvider bool) http.HandlerFunc { @@ -88,14 +88,15 @@ func TestShaMarking(t *testing.T) { tt.Parallel() serverURL := "" params := ProviderParams{ - url: "", - enableSha256: true, - enableSha512: true, + URL: "", + EnableSha256: true, + EnableSha512: true, } server := httptest.NewTLSServer(ProviderHandler(¶ms, test.directoryProvider)) defer server.Close() serverURL = server.URL + params.URL = server.URL hClient := server.Client() client := util.Client(hClient) diff --git a/testdata/simple-rolie-provider/provider-metadata.json b/testdata/simple-rolie-provider/provider-metadata.json index 5ead99e2..7abb3163 100644 --- a/testdata/simple-rolie-provider/provider-metadata.json +++ b/testdata/simple-rolie-provider/provider-metadata.json @@ -1,5 +1,5 @@ { - "canonical_url": "/provider-metadata.json", + "canonical_url": "{{.URL}}/provider-metadata.json", "distributions": [ { "rolie": { @@ -7,20 +7,20 @@ { "summary": "TLP:WHITE advisories", "tlp_label": "WHITE", - "url": "/white/white-feed.json" + "url": "{{.URL}}/white/white-feed.json" } ] } } ], - "last_updated": "2020-00-00T00:00:00Z", + "last_updated": "2020-01-01T00:00:00Z", "list_on_CSAF_aggregators": true, "metadata_version": "2.0", "mirror_on_CSAF_aggregators": true, "public_openpgp_keys": [ { "fingerprint": "A8914CA2F11139C6A69A0018FB3CD9B15DE61596", - "url": "/openpgp/pubkey.asc" + "url": "{{.URL}}/openpgp/pubkey.asc" } ], "publisher": {