Skip to content

Commit d56a2b9

Browse files
committed
Change tests
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
1 parent 76dba48 commit d56a2b9

File tree

2 files changed

+25
-17
lines changed

2 files changed

+25
-17
lines changed

api_v3_usage.rst

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Parameters:
8585
- ``details`` — boolean (default: ``false``)
8686
- ``ignore_qualifiers_subpath`` — boolean (default: ``false``)
8787

88-
The ``approximate`` flag replaces the previous ``plain_purl`` parameter.
88+
The ``ignore_qualifiers_subpath`` flag replaces the previous ``plain_purl`` parameter.
8989
When set to ``true``, qualifiers and subpaths in PURLs are ignored.
9090

9191

@@ -140,12 +140,16 @@ Example response:
140140
"purl": "pkg:npm/atob@2.0.3",
141141
"affected_by_vulnerabilities": [
142142
{
143-
"advisory_id": "nodejs_security_wg/npm-403",
144-
"fixed_by_packages": [
145-
"pkg:npm/atob@2.1.0"
146-
],
147-
"duplicate_advisory_ids": []
148-
}
143+
"advisory_id": "GHSA-g5vw-3h65-2q3v",
144+
"aliases": [],
145+
"weighted_severity": null,
146+
"exploitability_score": null,
147+
"risk_score": null,
148+
"summary": "Access control vulnerable to user data",
149+
"fixed_by_packages": [
150+
"pkg:pypi/accesscontrol@7.2"
151+
],
152+
},
149153
],
150154
"fixing_vulnerabilities": [],
151155
"next_non_vulnerable_version": "2.1.0",
@@ -165,7 +169,7 @@ Using Approximate Matching
165169

166170
{
167171
"purls": ["pkg:npm/atob@2.0.3?foo=bar"],
168-
"approximate": true,
172+
"ignore_qualifiers_subpath": true,
169173
"details": true
170174
}
171175

@@ -181,13 +185,17 @@ Example response:
181185
{
182186
"purl": "pkg:npm/atob@2.0.3",
183187
"affected_by_vulnerabilities": [
184-
{
185-
"advisory_id": "nodejs_security_wg/npm-403",
186-
"fixed_by_packages": [
187-
"pkg:npm/atob@2.1.0"
188-
],
189-
"duplicate_advisory_ids": []
190-
}
188+
{
189+
"advisory_id": "GHSA-g5vw-3h65-2q3v",
190+
"aliases": [],
191+
"weighted_severity": null,
192+
"exploitability_score": null,
193+
"risk_score": null,
194+
"summary": "Access control vulnerable to user data",
195+
"fixed_by_packages": [
196+
"pkg:pypi/accesscontrol@7.2"
197+
],
198+
}
191199
],
192200
"fixing_vulnerabilities": [],
193201
"next_non_vulnerable_version": "2.1.0",

vulnerabilities/tests/test_api_v3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,14 @@ def test_packages_pagination(self):
126126
self.assertIn("results", response.data)
127127
self.assertIn("next", response.data)
128128

129-
def test_packages_approximate(self):
129+
def test_packages_ignore_qualifiers_subpath(self):
130130
url = reverse("package-v3-list")
131131

132132
response = self.client.post(
133133
url,
134134
data={
135135
"purls": ["pkg:pypi/sample@1.0.0?foo=bar"],
136-
"approximate": True,
136+
"ignore_qualifiers_subpath": True,
137137
"details": False,
138138
},
139139
format="json",

0 commit comments

Comments
 (0)