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

Fix provider-metadata.json

This commit is contained in:
koplas 2024-09-16 20:23:22 +02:00
parent 714735d74a
commit 989e3667ba
2 changed files with 11 additions and 10 deletions

View file

@ -23,9 +23,9 @@ import (
) )
type ProviderParams struct { type ProviderParams struct {
url string URL string
enableSha256 bool EnableSha256 bool
enableSha512 bool EnableSha512 bool
} }
func ProviderHandler(params *ProviderParams, directoryProvider bool) http.HandlerFunc { func ProviderHandler(params *ProviderParams, directoryProvider bool) http.HandlerFunc {
@ -88,14 +88,15 @@ func TestShaMarking(t *testing.T) {
tt.Parallel() tt.Parallel()
serverURL := "" serverURL := ""
params := ProviderParams{ params := ProviderParams{
url: "", URL: "",
enableSha256: true, EnableSha256: true,
enableSha512: true, EnableSha512: true,
} }
server := httptest.NewTLSServer(ProviderHandler(&params, test.directoryProvider)) server := httptest.NewTLSServer(ProviderHandler(&params, test.directoryProvider))
defer server.Close() defer server.Close()
serverURL = server.URL serverURL = server.URL
params.URL = server.URL
hClient := server.Client() hClient := server.Client()
client := util.Client(hClient) client := util.Client(hClient)

View file

@ -1,5 +1,5 @@
{ {
"canonical_url": "/provider-metadata.json", "canonical_url": "{{.URL}}/provider-metadata.json",
"distributions": [ "distributions": [
{ {
"rolie": { "rolie": {
@ -7,20 +7,20 @@
{ {
"summary": "TLP:WHITE advisories", "summary": "TLP:WHITE advisories",
"tlp_label": "WHITE", "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, "list_on_CSAF_aggregators": true,
"metadata_version": "2.0", "metadata_version": "2.0",
"mirror_on_CSAF_aggregators": true, "mirror_on_CSAF_aggregators": true,
"public_openpgp_keys": [ "public_openpgp_keys": [
{ {
"fingerprint": "A8914CA2F11139C6A69A0018FB3CD9B15DE61596", "fingerprint": "A8914CA2F11139C6A69A0018FB3CD9B15DE61596",
"url": "/openpgp/pubkey.asc" "url": "{{.URL}}/openpgp/pubkey.asc"
} }
], ],
"publisher": { "publisher": {