From 3a5168917ea4f10296adfdffa41d2ea6b953fb3d Mon Sep 17 00:00:00 2001 From: Alex Goodman Date: Mon, 9 Aug 2021 15:47:33 -0400 Subject: [PATCH] Update SPDX license list from 3.13 to 3.14 (#474) * update SPDX license list from 3.13 to 3.14 Signed-off-by: Alex Goodman * remove license list version from spdx snapshot unit tests Signed-off-by: Alex Goodman --- .../packages/spdx_json_presenter_test.go | 5 ++++- .../packages/spdx_tag_value_presenter_test.go | 5 ++++- internal/spdxlicense/license_list.go | 18 ++++++++++++++++-- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/internal/presenter/packages/spdx_json_presenter_test.go b/internal/presenter/packages/spdx_json_presenter_test.go index 4e750ed40..f0053fd70 100644 --- a/internal/presenter/packages/spdx_json_presenter_test.go +++ b/internal/presenter/packages/spdx_json_presenter_test.go @@ -29,5 +29,8 @@ func TestSPDXJSONImagePresenter(t *testing.T) { } func spdxJsonRedactor(s []byte) []byte { - return regexp.MustCompile(`"created": .*`).ReplaceAll(s, []byte("redacted")) + // each SBOM reports the time it was generated, which is not useful during snapshot testing + s = regexp.MustCompile(`"created": .*`).ReplaceAll(s, []byte("redacted")) + // the license list will be updated periodically, the value here should not be directly tested in snapshot tests + return regexp.MustCompile(`"licenseListVersion": .*`).ReplaceAll(s, []byte("redacted")) } diff --git a/internal/presenter/packages/spdx_tag_value_presenter_test.go b/internal/presenter/packages/spdx_tag_value_presenter_test.go index 7cd81cdf3..8ffff1d62 100644 --- a/internal/presenter/packages/spdx_tag_value_presenter_test.go +++ b/internal/presenter/packages/spdx_tag_value_presenter_test.go @@ -29,5 +29,8 @@ func TestSPDXTagValueImagePresenter(t *testing.T) { } func spdxTagValueRedactor(s []byte) []byte { - return regexp.MustCompile(`Created: .*`).ReplaceAll(s, []byte("redacted")) + // each SBOM reports the time it was generated, which is not useful during snapshot testing + s = regexp.MustCompile(`Created: .*`).ReplaceAll(s, []byte("redacted")) + // the license list will be updated periodically, the value here should not be directly tested in snapshot tests + return regexp.MustCompile(`LicenseListVersion: .*`).ReplaceAll(s, []byte("redacted")) } diff --git a/internal/spdxlicense/license_list.go b/internal/spdxlicense/license_list.go index 39bd69212..0bd02cc63 100644 --- a/internal/spdxlicense/license_list.go +++ b/internal/spdxlicense/license_list.go @@ -1,9 +1,9 @@ // Code generated by go generate; DO NOT EDIT. -// This file was generated by robots at 2021-06-23 11:13:41.969613 -0400 EDT m=+0.325660925 +// This file was generated by robots at 2021-08-09 15:08:22.639351 -0400 EDT m=+0.318960693 // using data from https://spdx.org/licenses/licenses.json package spdxlicense -const Version = "3.13" +const Version = "3.14" var licenseIDs = map[string]string{ "0bsd": "0BSD", @@ -84,30 +84,40 @@ var licenseIDs = map[string]string{ "cc-by-1.0": "CC-BY-1.0", "cc-by-2.0": "CC-BY-2.0", "cc-by-2.5": "CC-BY-2.5", + "cc-by-2.5-au": "CC-BY-2.5-AU", "cc-by-3.0": "CC-BY-3.0", "cc-by-3.0-at": "CC-BY-3.0-AT", + "cc-by-3.0-de": "CC-BY-3.0-DE", + "cc-by-3.0-nl": "CC-BY-3.0-NL", "cc-by-3.0-us": "CC-BY-3.0-US", "cc-by-4.0": "CC-BY-4.0", "cc-by-nc-1.0": "CC-BY-NC-1.0", "cc-by-nc-2.0": "CC-BY-NC-2.0", "cc-by-nc-2.5": "CC-BY-NC-2.5", "cc-by-nc-3.0": "CC-BY-NC-3.0", + "cc-by-nc-3.0-de": "CC-BY-NC-3.0-DE", "cc-by-nc-4.0": "CC-BY-NC-4.0", "cc-by-nc-nd-1.0": "CC-BY-NC-ND-1.0", "cc-by-nc-nd-2.0": "CC-BY-NC-ND-2.0", "cc-by-nc-nd-2.5": "CC-BY-NC-ND-2.5", "cc-by-nc-nd-3.0": "CC-BY-NC-ND-3.0", + "cc-by-nc-nd-3.0-de": "CC-BY-NC-ND-3.0-DE", "cc-by-nc-nd-3.0-igo": "CC-BY-NC-ND-3.0-IGO", "cc-by-nc-nd-4.0": "CC-BY-NC-ND-4.0", "cc-by-nc-sa-1.0": "CC-BY-NC-SA-1.0", "cc-by-nc-sa-2.0": "CC-BY-NC-SA-2.0", + "cc-by-nc-sa-2.0-fr": "CC-BY-NC-SA-2.0-FR", + "cc-by-nc-sa-2.0-uk": "CC-BY-NC-SA-2.0-UK", "cc-by-nc-sa-2.5": "CC-BY-NC-SA-2.5", "cc-by-nc-sa-3.0": "CC-BY-NC-SA-3.0", + "cc-by-nc-sa-3.0-de": "CC-BY-NC-SA-3.0-DE", + "cc-by-nc-sa-3.0-igo": "CC-BY-NC-SA-3.0-IGO", "cc-by-nc-sa-4.0": "CC-BY-NC-SA-4.0", "cc-by-nd-1.0": "CC-BY-ND-1.0", "cc-by-nd-2.0": "CC-BY-ND-2.0", "cc-by-nd-2.5": "CC-BY-ND-2.5", "cc-by-nd-3.0": "CC-BY-ND-3.0", + "cc-by-nd-3.0-de": "CC-BY-ND-3.0-DE", "cc-by-nd-4.0": "CC-BY-ND-4.0", "cc-by-sa-1.0": "CC-BY-SA-1.0", "cc-by-sa-2.0": "CC-BY-SA-2.0", @@ -116,6 +126,7 @@ var licenseIDs = map[string]string{ "cc-by-sa-2.5": "CC-BY-SA-2.5", "cc-by-sa-3.0": "CC-BY-SA-3.0", "cc-by-sa-3.0-at": "CC-BY-SA-3.0-AT", + "cc-by-sa-3.0-de": "CC-BY-SA-3.0-DE", "cc-by-sa-4.0": "CC-BY-SA-4.0", "cc-pddc": "CC-PDDC", "cc0-1.0": "CC0-1.0", @@ -123,6 +134,7 @@ var licenseIDs = map[string]string{ "cddl-1.1": "CDDL-1.1", "cdl-1.0": "CDL-1.0", "cdla-permissive-1.0": "CDLA-Permissive-1.0", + "cdla-permissive-2.0": "CDLA-Permissive-2.0", "cdla-sharing-1.0": "CDLA-Sharing-1.0", "cecill-1.0": "CECILL-1.0", "cecill-1.1": "CECILL-1.1", @@ -320,6 +332,7 @@ var licenseIDs = map[string]string{ "nist-pd": "NIST-PD", "nist-pd-fallback": "NIST-PD-fallback", "nlod-1.0": "NLOD-1.0", + "nlod-2.0": "NLOD-2.0", "nlpl": "NLPL", "nokia": "Nokia", "nosl": "NOSL", @@ -368,6 +381,7 @@ var licenseIDs = map[string]string{ "oml": "OML", "openssl": "OpenSSL", "opl-1.0": "OPL-1.0", + "opubl-1.0": "OPUBL-1.0", "oset-pl-2.1": "OSET-PL-2.1", "osl-1.0": "OSL-1.0", "osl-1.1": "OSL-1.1",