I'm building an API and I've started using the GenericAPIViews. In this example
class InsertActivityChange(UpdateAPIView):
authentication_classes = []
permission_classes = []
serializer_class = ActivitiesSerializer
lookup_field = 'id'
def get_queryset(self):
return Activities.objects.filter(id=self.kwargs['id'])
def put(self, request, *args, **kwargs):
return self.update(request, *args, **kwargs)
path('insertactivitychange/<int:id>', views.InsertActivityChange.as_view(), name='insertactivitychange'),
I've used a generic class to do updates for an object. My concern is if I'm risking much by allowing the ID to be directly inputted after the URL. Obviously, I'd further mitigate the risk by properly configuring the authentication and permission class, so is the ID of the entry even a security risk?