Django 内部 API 客户端/服务器身份验证与否?

我有一个 django 项目,在其中我公开了一些 api 端点(api 端点 = 获取/发布的答案,返回 json 响应,如果我的定义有误,请纠正我).我在前端使用这些端点,例如更新计数或获取更新的内容,或无数其他事情.我在服务器端处理表示逻辑,在模板中,在某些情况下,将呈现的字符串模板发送给客户端.

I have a django project, in which i expose a few api endpoints (api endpoint = answers to get/post, returns json response, correct me if im wrong in my definition). Those endpoints are used by me on front end, like update counts or get updated content, or a myriad other things. I handle the representation logic on server side, in templates, and in some cases send a rendered to string template to the client.

这里是我试图回答的问题:

So here are the questions im trying to answer:

  1. 我需要在客户端和服务器之间进行某种身份验证吗?
  2. django 跨源保护是否足够?
  3. 在这张图片中,哪里适合 django-oauth-toolkit 之类的包?还有 django-rest-framework?
  4. 如果我不在客户端和服务器之间添加任何身份验证,我是否会让我的服务器对攻击开放?

此外,服务器到服务器的连接是什么?两台服务器都在我的控制之下.

Furthermore, what goes for server-to-server connection? Both servers under my control.



 1 条回答