internal/cveschema: handle different formats for Credit

The "credit" field in the CVE schema can be a []string, a []LangString,
or a more complicated object. Decode it in any of those forms.

By adding an UnmarshalJSON method to the CVE type, we don't
need to change any existing code.

Change-Id: Iba2477f23dcfb6c1d6d4fbd55f55ede54522bc2c
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/375954
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2 files changed
tree: 9f188a01c9ce0071fb4d9ea0f9d28cd317a4d8a0
  1. cmd/
  2. deploy/
  3. devtools/
  4. doc/
  5. internal/
  6. reports/
  7. terraform/
  8. .gitignore
  9. all_test.go
  10. AUTHORS
  11. checks.bash
  12. CONTRIBUTING.md
  13. CONTRIBUTORS
  14. go.mod
  15. go.sum
  16. LICENSE
  17. PATENTS
  18. README.md
  19. tools_test.go
README.md

The Go Vulnerability Database

This repository contains the reports for the Go Vulnerability Database.

If you are interested accessing data from the Go Vulnerability Database, see x/vuln for information. This repository is only used for adding new vulnerabilities.

Reporting a vulnerability

We are not accepting new vulnerability reports at this time. We will update this README.md once we are ready to receive reports.

License

Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.

Database entries are distributed under the terms of the CC-BY 4.0 license. See x/vuln for information on how to access these entries.