Skip to content

Commit aca0a86

Browse files
committed
Add conan package manager API
Signed-off-by: Tushar Goel <[email protected]>
1 parent a224720 commit aca0a86

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ toml==0.10.2
107107
tomli==2.0.1
108108
traitlets==5.1.1
109109
typing_extensions==4.1.1
110-
univers==30.9.1
110+
univers==30.10.0
111111
urllib3==1.26.9
112112
wcwidth==0.2.5
113113
websocket-client==0.59.0

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ install_requires =
7070

7171
#essentials
7272
packageurl-python>=0.10.5rc1
73-
univers>=30.9.1
73+
univers>=30.10.0
7474
license-expression>=21.6.14
7575

7676
# file and data formats

vulnerabilities/package_managers.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,22 @@ def fetch(self, pkg: str) -> Iterable[PackageVersion]:
556556
)
557557

558558

559+
class ConanVersionAPI(VersionAPI):
560+
"""
561+
Fetch versions of Erlang packages from the hex API
562+
"""
563+
564+
package_type = "conan"
565+
566+
def fetch(self, pkg: str) -> Iterable[PackageVersion]:
567+
response = get_response(
568+
url=f"https://conan.io/center/api/ui/details?name={pkg}&user=_&channel=_",
569+
content_type="json",
570+
)
571+
for release in response["versions"]:
572+
yield PackageVersion(value=release["version"])
573+
574+
559575
class GoproxyVersionAPI(VersionAPI):
560576
"""
561577
Fetch versions of Go "golang" packages from the Go proxy API
@@ -688,6 +704,7 @@ def fetch(self, pkg: str) -> Iterable[PackageVersion]:
688704
CratesVersionAPI,
689705
DebianVersionAPI,
690706
GitHubTagsAPI,
707+
ConanVersionAPI,
691708
}
692709

693710
VERSION_API_CLASSES_BY_PACKAGE_TYPE = {cls.package_type: cls for cls in VERSION_API_CLASSES}

0 commit comments

Comments
 (0)