forked from RedHatProductSecurity/osidb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serializers.py
27 lines (19 loc) · 821 Bytes
/
serializers.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from rest_framework import serializers
from apps.exploits.models import EPSS, Exploit
from osidb.models import Affect
class ExploitsSimpleSerializer(serializers.ModelSerializer):
class Meta:
model = Exploit
fields = ["date", "source", "reference"]
class AffectExploitReportSerializer(serializers.ModelSerializer):
cve = serializers.CharField(source="flaw.cve_id")
product = serializers.CharField(source="ps_module")
component = serializers.CharField(source="ps_component")
resolution = serializers.CharField(source="resolution_expanded")
class Meta:
model = Affect
fields = ["cve", "product", "component", "affectedness", "resolution"]
class EPSSSerializer(serializers.ModelSerializer):
class Meta:
model = EPSS
fields = ["cve", "epss"]