Skip to content

Commit

Permalink
Add risk score
Browse files Browse the repository at this point in the history
Signed-off-by: Tushar Goel <[email protected]>
  • Loading branch information
TG1999 committed Nov 14, 2024
1 parent 707d577 commit 06c4038
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions vulnerabilities/api_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ def list(self, request, *args, **kwargs):

class PackageV2Serializer(serializers.ModelSerializer):
purl = serializers.CharField(source="package_url")
risk_score = serializers.FloatField(read_only=True)
affected_by_vulnerabilities = serializers.SerializerMethodField()
fixing_vulnerabilities = serializers.SerializerMethodField()
next_non_vulnerable_version = serializers.CharField(read_only=True)
Expand All @@ -174,6 +175,7 @@ class Meta:
"fixing_vulnerabilities",
"next_non_vulnerable_version",
"latest_non_vulnerable_version",
"risk_score",
]

def get_affected_by_vulnerabilities(self, obj):
Expand Down

0 comments on commit 06c4038

Please sign in to comment.