Skip to content

Commit 232e0c2

Browse files
authored
Merge branch 'main' into cvss4
2 parents e883d2b + 6727786 commit 232e0c2

6 files changed

Lines changed: 9736 additions & 4 deletions

File tree

vulnerabilities/importers/github.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"PIP": "pypi",
3838
"RUBYGEMS": "gem",
3939
"NPM": "npm",
40+
"RUST": "cargo",
4041
# "GO": "golang",
4142
}
4243

@@ -47,7 +48,7 @@
4748
# TODO: We will try to gather more info from GH API
4849
# Check https://github.com/nexB/vulnerablecode/issues/1039#issuecomment-1366458885
4950
# Check https://github.com/nexB/vulnerablecode/issues/645
50-
# set of all possible values of first '%s' = {'MAVEN','COMPOSER', 'NUGET', 'RUBYGEMS', 'PYPI', 'NPM'}
51+
# set of all possible values of first '%s' = {'MAVEN','COMPOSER', 'NUGET', 'RUBYGEMS', 'PYPI', 'NPM', 'RUST'}
5152
# second '%s' is interesting, it will have the value '' for the first request,
5253
GRAPHQL_QUERY_TEMPLATE = """
5354
query{
@@ -139,7 +140,7 @@ def get_purl(pkg_type: str, github_name: str) -> Optional[PackageURL]:
139140
vendor, _, name = github_name.partition("/")
140141
return PackageURL(type=pkg_type, namespace=vendor, name=name)
141142

142-
if pkg_type in ("nuget", "pypi", "gem", "golang", "npm"):
143+
if pkg_type in ("nuget", "pypi", "gem", "golang", "npm", "cargo"):
143144
return PackageURL(type=pkg_type, name=github_name)
144145

145146
logger.error(f"get_purl: Unknown package type {pkg_type}")
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{% extends "rest_framework/base.html" %}
2+
3+
{% block style %}
4+
{{ block.super }}
5+
<style>
6+
body {background: none;}
7+
.navbar {background: #363636; border-top: 3px solid #3298dc;}
8+
.navbar-inverse .navbar-brand {color: white;}
9+
.booleanwidget {width: 90%;}
10+
</style>
11+
{% endblock %}
12+
13+
{% block title %}
14+
VulnerableCode.io REST API
15+
{% endblock %}
16+
17+
{% block branding %}
18+
<span class="navbar-brand">
19+
VulnerableCode<span class="nexb-orange">.</span>io REST API
20+
</span>
21+
{% endblock %}
22+
23+
{% block userlinks %}
24+
<li class="navbar-link">
25+
<a href="/api/docs/">API Documentation</a>
26+
</li>
27+
<li class="navbar-link">
28+
<a href="/">Back to app</a>
29+
</li>
30+
{{ block.super }}
31+
{% endblock %}

0 commit comments

Comments
 (0)