环境变量是否隐藏(安全)? [英] Environment variable are not hidden (secure)?
本文介绍了环境变量是否隐藏(安全)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在浏览器检查器中找到了位于我的环境文件中的一些专用凭据.他们没有被隐藏吗?那不安全... 我做错了什么?
I found with my browser inspector some private credentials located in my environment file. They're not hidden ? That's not secure... I did something wrong ?
推荐答案
如果将它们包含在Angular项目的environment.ts中,则它们不会被隐藏.您不能直接在前端Angular项目中包含任何秘密值,因为所有内容都会转移到客户端.
If you included them in your environment.ts in your Angular project then they will not be hidden. You can not include any secret values directly in your front-end Angular project as everything will be transferred to the client.
如果您需要使用某种机密,那么通常只能通过您的后端代码访问它们并将其隐藏在API后面.
If you need to use a secret of some kind then usually they are only accessible by your back-end code and hidden behind your API.
这篇关于环境变量是否隐藏(安全)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文