gpt4 book ai didi

python - 在代码中隐藏 API key (Python)

转载 作者:太空狗 更新时间:2023-10-30 02:34:35 24 4
gpt4 key购买 nike

我正在一些我希望分发的 Python 代码中使用 API key 。此 API key 适用于 Google map 。分发此 API key 是否存在任何安全问题?如果存在,最好如何隐藏它?

最佳答案

这不是必需的,Google API key 与您的域相关联,因此在使用时会检查引荐来源网址。

You can read more about how it works here

相关部分

Note that a key for http://www.mygooglemapssite.com/ will only be accepted when the site is accessed using this address. It will not be accepted if the site is accessed by IP address (eg. http://10.1.2.3/) or by a hostname that is aliased to www.mygooglemapssite.com using a DNS CNAME record.

他们的第 3 版 API 现在不需要 key 。

http://code.google.com/apis/maps/documentation/javascript/

关于python - 在代码中隐藏 API key (Python),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7458227/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com