← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 4545.c.4.a

配置与密钥独立于代码

理解等级:中级

随环境变化的地址、资源句柄和凭据应与代码分离,使同一制品可部署到不同环境。环境变量是本书依据十二要素推荐的注入方式,配置库可提供类型和默认值。它不等于秘密天然安全;泄露的密钥应视为已暴露,不能因仓库尚未公开就把硬编码当作可接受。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • It’s All About Dependability · 查看原书依据

      Configuration — anything that’s likely to vary between environments (staging, production, developer environments, etc) — should always be cleanly separated from the code. Under no circumstances should an application’s configuration be baked into the code. Configuration items may include, but certainly aren’t limited to: URLs or other resource handles to a database or other upstream

    参考来源

    - 位置:《Cloud Native Go》第06章《It’s All About Dependability》(来源项目book-sources;源文件:extracted/Cloud Native Go (Matthew A. Titmus)/_epub-src/OEBPS/ch06.xhtml) - 结论依据:随环境变化的地址、资源句柄和凭据应与代码分离,使同一制品可部署到不同环境。原文相应定义、示例或限制为此结论提供依据;补充纠错与版本边界在正文就近标明。 - 原始内容:Configuration — anything that’s likely to vary between environments (staging, production, developer environments, etc) — should always be cleanly separated from the code. Under no circumstances should an application’s configuration be baked into the code. Configuration items may include, but certainly aren’t limited to: URLs or other resource handles to a database or other upstream