perf: 提升服务注册安全性

This commit is contained in:
ibuler
2025-03-27 16:07:57 +08:00
committed by Bryan
parent 9ed822bb3e
commit b55000663e
6 changed files with 52 additions and 9 deletions

View File

@@ -85,12 +85,6 @@ class TerminalRegistrationApi(generics.CreateAPIView):
permission_classes = [WithBootstrapToken]
http_method_names = ['post']
def create(self, request, *args, **kwargs):
if not settings.SECURITY_SERVICE_ACCOUNT_REGISTRATION:
data = {"error": "service account registration disabled"}
return Response(data=data, status=status.HTTP_400_BAD_REQUEST)
return super().create(request, *args, **kwargs)
class EncryptedTerminalConfig(generics.CreateAPIView):
serializer_class = serializers.EncryptedConfigSerializer