mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-14 15:34:19 +00:00
Remove update and destroy CRUD methods
This commit is contained in:
1 file changed
+3
-24
@@ -2782,7 +2782,7 @@ class IntegrationViewSet(BaseRLSViewSet):
|
||||
|
||||
class LighthouseConfigViewSet(BaseRLSViewSet):
|
||||
"""
|
||||
API endpoint for managing OpenAI API configuration.
|
||||
API endpoint for managing Lighthouse configuration.
|
||||
"""
|
||||
|
||||
filterset_fields = {
|
||||
@@ -2835,7 +2835,7 @@ class LighthouseConfigViewSet(BaseRLSViewSet):
|
||||
)
|
||||
|
||||
def create(self, request, *args, **kwargs):
|
||||
"""Create new AI configuration"""
|
||||
"""Create new Lighthouse configuration"""
|
||||
serializer = self.get_serializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
instance = serializer.save()
|
||||
@@ -2849,22 +2849,10 @@ class LighthouseConfigViewSet(BaseRLSViewSet):
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
def update(self, request, *args, **kwargs):
|
||||
"""Update existing AI configuration"""
|
||||
instance = self.get_object()
|
||||
serializer = self.get_serializer(instance, data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
instance = serializer.save()
|
||||
return Response(
|
||||
LighthouseConfigSerializer(
|
||||
instance, context=self.get_serializer_context()
|
||||
).data
|
||||
)
|
||||
|
||||
@action(detail=True, methods=["get"], url_path="show_key")
|
||||
def show_key(self, request, pk=None):
|
||||
"""
|
||||
Return the decrypted API key for the specified AI configuration.
|
||||
Return the decrypted API key for the specified Lighthouse configuration.
|
||||
"""
|
||||
instance = self.get_object()
|
||||
|
||||
@@ -2895,12 +2883,3 @@ class LighthouseConfigViewSet(BaseRLSViewSet):
|
||||
},
|
||||
status=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||
)
|
||||
|
||||
def destroy(self, request, *args, **kwargs):
|
||||
"""Delete AI configuration"""
|
||||
instance = self.get_object()
|
||||
|
||||
# Perform deletion
|
||||
self.perform_destroy(instance)
|
||||
|
||||
return Response(status=status.HTTP_204_NO_CONTENT)
|
||||
Reference in new issue
Block a user