parameters: (self, request)
docstring: ensures request is well formed
docstring_summary: ensures request is well formed
docstring_tokens: ensures request is well formed
function: def invalid(self, request):
          """
          ensures request is well formed
          """
          allowed_backends = [path for path, name in app_settings.BACKENDS]
          required_params = [
              ('secret', None),
              ('name', None),
              ('mac_address', None),
              ('backend', allowed_backends),
          ]
          # valid required params or forbid
          for key, value in required_params:
              invalid_response = forbid_unallowed(request, 'POST', key, value)
              if invalid_response:
                  return invalid_response
function_tokens: def invalid ( self , request ) : allowed_backends = [ path for path , name in app_settings . BACKENDS ] required_params = [ ( 'secret' , None ) , ( 'name' , None ) , ( 'mac_address' , None ) , ( 'backend' , allowed_backends ) , ] # valid required params or forbid for key , value in required_params : invalid_response = forbid_unallowed ( request , 'POST' , key , value ) if invalid_response : return invalid_response