Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve NVD handling and more #997

Merged
merged 27 commits into from
Nov 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
78906c1
Use environment variable to enable API auth
pombredanne Oct 26, 2022
c282203
Improve docstring for user signal
pombredanne Oct 27, 2022
78625e7
Enable the admin
pombredanne Oct 27, 2022
5f72d37
Add new command to create API-only users
pombredanne Oct 27, 2022
bc96503
Add minimal command to create API-only users
pombredanne Oct 27, 2022
3b5dd77
Add simplified admin to create API users
pombredanne Oct 27, 2022
0d55cdf
Towards API request self service
pombredanne Oct 27, 2022
7bc453f
Move tos to the template dir for proper styling
pombredanne Oct 28, 2022
dbaa8f2
Transform tos in a template
pombredanne Oct 28, 2022
121f1d0
Add back drf-spectacular as a dependency
pombredanne Oct 28, 2022
a82d34e
Adopt drf_spectacular for live API doc
pombredanne Oct 28, 2022
301b314
Add doc links to generate API docs
pombredanne Oct 28, 2022
fdf99c8
Improve API doc and typing
pombredanne Oct 28, 2022
cfbd05f
Remove outdated schema_view from views
pombredanne Oct 28, 2022
fc2858f
Generate API documentation
pombredanne Oct 28, 2022
06aafa6
Remove unused variables and imports
pombredanne Oct 28, 2022
b2dbdbd
Improve API documentation
pombredanne Oct 28, 2022
1af7625
Doe not extras in pip constraints
pombredanne Oct 28, 2022
c6fe159
Configire email settings
TG1999 Oct 28, 2022
b19bd16
Use psycopg2-binary for consistency
pombredanne Oct 28, 2022
6cd8538
Streamline API key view documentation
pombredanne Oct 28, 2022
caaf6c0
Rename command as create_api_user
pombredanne Oct 29, 2022
fc8362b
Rename and improve cpe<->purl mapping
pombredanne Oct 30, 2022
805c1fa
Format models
pombredanne Oct 30, 2022
fe1e9bb
Format settings
pombredanne Nov 8, 2022
e4d508e
Merge latest main branch
pombredanne Nov 8, 2022
464adb3
Bump version
pombredanne Nov 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,22 @@ Release notes



Version v30.2.2
Version v30.3.0
----------------

- We enabled API throttling for a basic user and for a staff user
they can have unlimited access on API.

- We added throttle rate for each API endpoint and it can be
configured from the settings #991 https://github.com/nexB/vulnerablecode/issues/991.
configured from the settings #991 https://github.com/nexB/vulnerablecode/issues/991

- We improved how we import NVD data
- We refactored and made the purl2cpe script work to dump purl to CPE mappings

Internally:

- We aligned key names internally with the names used in the UI and API (such as affected and fixed)
- We now use querysets as model managers and have streamlined view code


Version v30.2.1
Expand Down
23 changes: 19 additions & 4 deletions docs/source/command-line-interface.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Command Line Interface
======================

The main entry point is Django's :guilabel:`manage.py` management commands.
The main entry point is the Django :guilabel:`manage.py` management command script.

``$ ./manage.py --help``
------------------------
Expand All @@ -14,9 +14,10 @@ VulnerableCode's own commands are listed under the ``[vulnerabilities]`` section
$ ./manage.py --help
...
[vulnerabilities]
create_cpe_to_purl_map
importer
improver
import
improve
purl2cpe


``$ ./manage.py <subcommand> --help``
---------------------------------------
Expand Down Expand Up @@ -58,3 +59,17 @@ Other variations:

* ``--list`` List all available improvers
* ``--all`` Run all available improvers



``$ ./manage.py purl2cpe --destination <directory``
------------------------------------------

Dump a mapping of CPEs to PURLs grouped by vulnerability in the ``destination``
directory.


Other variations:

* ``--limit`` Limit the number of processed vulnerabilities

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ addopts = [
"--ignore=vulnerabilities/importers/mozilla.py",
"--ignore=vulnerabilities/importers/mattermost.py",
"--ignore=vulnerabilities/importers/xen.py",
"--ignore=vulnerabilities/management/commands/create_cpe_to_purl_map.py",
"--ignore=vulnerabilities/management/commands/purl2cpe.py",
"--ignore=vulnerabilities/lib_oval.py",
]

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = vulnerablecode
version = 30.2.1
version = 30.3.0
license = Apache-2.0 AND CC-BY-SA-4.0

# description must be on ONE line https://github.com/pypa/setuptools/issues/1390
Expand Down
2 changes: 1 addition & 1 deletion vulnerabilities/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class VulnerabilitySerializer(serializers.HyperlinkedModelSerializer):
fixed_packages = MinimalPackageSerializer(
many=True, source="filtered_fixed_packages", read_only=True
)
affected_packages = MinimalPackageSerializer(many=True, source="vulnerable_to", read_only=True)
affected_packages = MinimalPackageSerializer(many=True, read_only=True)

references = VulnerabilityReferenceSerializer(many=True, source="vulnerabilityreference_set")
aliases = AliasSerializer(many=True, source="alias")
Expand Down
Loading