Skip to content

Commit 501dead

Browse files
committed
Fix package url call
type was used where name had been and name where type should be. Signed-off-by: Hritik Vijay <hritikxx8@gmail.com>
1 parent d18e03e commit 501dead

2 files changed

Lines changed: 42 additions & 40 deletions

File tree

vulnerabilities/importers/istio.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ def set_api(self):
4848
asyncio.run(self.version_api.load_api(["istio/istio"]))
4949

5050
def added_advisories(self) -> Set[Advisory]:
51+
import pdb
52+
#pdb.set_trace()
5153
return self._load_advisories(self._added_files)
5254

5355
def updated_advisories(self) -> Set[Advisory]:
@@ -161,23 +163,23 @@ def process_file(self, path):
161163
)
162164

163165
safe_purls_golang = {
164-
PackageURL(type="golang", name="istio", version=version)
166+
PackageURL(name="golang", type="istio", version=version)
165167
for version in safe_pkg_versions
166168
}
167169

168170
safe_purls_github = {
169-
PackageURL(type="github", name="istio", version=version)
171+
PackageURL(name="github", type="istio", version=version)
170172
for version in safe_pkg_versions
171173
}
172174
safe_purls = safe_purls_github.union(safe_purls_golang)
173175

174176
vuln_purls_golang = {
175-
PackageURL(type="golang", name="istio", version=version)
177+
PackageURL(name="golang", type="istio", version=version)
176178
for version in vuln_pkg_versions
177179
}
178180

179181
vuln_purls_github = {
180-
PackageURL(type="github", name="istio", version=version)
182+
PackageURL(name="github", type="istio", version=version)
181183
for version in vuln_pkg_versions
182184
}
183185
vuln_purls = vuln_purls_github.union(vuln_purls_golang)

vulnerabilities/tests/test_istio.py

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -81,95 +81,95 @@ def test_process_file(self):
8181
summary=("Incorrect access control."),
8282
impacted_package_urls={
8383
PackageURL(
84-
type="golang",
85-
name="istio",
84+
name="golang",
85+
type="istio",
8686
version="1.1.0-snapshot.2",
8787
),
8888
PackageURL(
89-
type="golang",
90-
name="istio",
89+
name="golang",
90+
type="istio",
9191
version="1.1.0-snapshot.3",
9292
),
9393
PackageURL(
94-
type="github",
95-
name="istio",
94+
name="github",
95+
type="istio",
9696
version="1.1.0-snapshot.2",
9797
),
9898
PackageURL(
99-
type="github",
100-
name="istio",
99+
name="github",
100+
type="istio",
101101
version="1.1.0-snapshot.3",
102102
),
103103
},
104104
resolved_package_urls={
105105
PackageURL(
106-
type="golang",
107-
name="istio",
106+
name="golang",
107+
type="istio",
108108
version="1.1.0-rc.2",
109109
),
110110
PackageURL(
111-
type="golang",
112-
name="istio",
111+
name="golang",
112+
type="istio",
113113
version="1.1.0-rc.4",
114114
),
115115
PackageURL(
116-
type="golang",
117-
name="istio",
116+
name="golang",
117+
type="istio",
118118
version="1.1.0-rc.3",
119119
),
120120
PackageURL(
121-
type="golang",
122-
name="istio",
121+
name="golang",
122+
type="istio",
123123
version="1.1.0-rc.0",
124124
),
125125
PackageURL(
126-
type="golang",
127-
name="istio",
126+
name="golang",
127+
type="istio",
128128
version="1.1.0-rc.5",
129129
),
130130
PackageURL(
131-
type="golang",
132-
name="istio",
131+
name="golang",
132+
type="istio",
133133
version="1.1.0-rc.1",
134134
),
135135
PackageURL(
136-
type="golang",
137-
name="istio",
136+
name="golang",
137+
type="istio",
138138
version="1.1.0-rc.6",
139139
),
140140
PackageURL(
141-
type="github",
142-
name="istio",
141+
name="github",
142+
type="istio",
143143
version="1.1.0-rc.2",
144144
),
145145
PackageURL(
146-
type="github",
147-
name="istio",
146+
name="github",
147+
type="istio",
148148
version="1.1.0-rc.4",
149149
),
150150
PackageURL(
151-
type="github",
152-
name="istio",
151+
name="github",
152+
type="istio",
153153
version="1.1.0-rc.3",
154154
),
155155
PackageURL(
156-
type="github",
157-
name="istio",
156+
name="github",
157+
type="istio",
158158
version="1.1.0-rc.0",
159159
),
160160
PackageURL(
161-
type="github",
162-
name="istio",
161+
name="github",
162+
type="istio",
163163
version="1.1.0-rc.5",
164164
),
165165
PackageURL(
166-
type="github",
167-
name="istio",
166+
name="github",
167+
type="istio",
168168
version="1.1.0-rc.1",
169169
),
170170
PackageURL(
171-
type="github",
172-
name="istio",
171+
name="github",
172+
type="istio",
173173
version="1.1.0-rc.6",
174174
),
175175
},

0 commit comments

Comments
 (0)