We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dce8dbd commit 13ab47fCopy full SHA for 13ab47f
1 file changed
scanpipe/api/views.py
@@ -136,6 +136,23 @@ class ProjectViewSet(
136
mixins.ListModelMixin,
137
viewsets.GenericViewSet,
138
):
139
+ @action(detail=True, methods=["get"])
140
+def sbom(self, request, *args, **kwargs):
141
+ """
142
+ Return SBOM for a given PURL.
143
144
+ project = self.get_object()
145
+ purl = request.query_params.get("purl")
146
+
147
+ if not purl:
148
+ return ErrorResponse("purl is required")
149
150
+ # TODO: integrate actual SBOM generation logic
151
+ return Response({
152
+ "project": project.name,
153
+ "purl": purl,
154
+ "sbom": "CycloneDX SBOM will be generated here"
155
+ },status=200)
156
"""
157
A viewset that provides the ability to list, get, create, and destroy projects.
158
Multiple actions are available to manage project instances.
0 commit comments