簡體   English   中英

只允許一個應用訪問 api 端點?

[英]Only let one app have access to api endpoint?

I am gonna have an open source app in which it needs to send some data to an fastapi python api, how can i make it so that only the app can make requests to the api and not some random person abusing the api endpoint?

有很多方法可以做到這一點。 甚至某些技術也不會打擾 API 端點。

  1. IP 限制:您可以限制來自雲提供商的 IP,IP 可以調用 ZDB974238714CA8DE6347A。 即使您可以擁有多個 IP。
  2. API KEY:您可以向 API 客戶端提供 API KEY。 當請求與提供的密鑰一起出現時,您可以處理它,否則忽略。

IP 方法比在應用端做的要好得多。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM