Skip to Content
精通模块化JavaScript
book

精通模块化JavaScript

by Nicolás Bevacqua
April 2020
Intermediate to advanced
177 pages
1h 45m
Chinese
Publishing House of Electronics Industry
Content preview from 精通模块化JavaScript
137
6
开发的方法论与哲学
尽管我们大多数人做的项目其源代码都是不公开的,但是我们都可以从以
下的开源最佳实践中受益,其中许多实践也适用于闭源项目的开发。设想
一下自己的所有代码日后要开源,你就会更用心地进行配置和私密信息管
理,撰写文档,编写接口,使代码库更易维护。
在本章中,我们将探讨开源原则,并探讨如何让一种方法和一套健壮性原则,
这套原则名为“十二要素应用”(
The Twelve-Factor App
,一般用于后端),
适应现代
JavaScript
应用程序开发,包括前端和后端。
1
6.1
 安全的配置管理
在闭源项目中,配置私密信息(例如
API
密钥或
HTTPS
会话解密密钥)通
常会被硬编码到合适的位置。而在开源项目中,这些信息通常是通过环境
变量或加密的配置文件获取的,这些文件并不会与代码库一起被提交到版
本控制系统。
1
 你可以在
12factor
网站上找到原始的十二要素应用的方法论及其文档。
138
6
开发的方法论与哲学
因此在开源项目中,开发人员可以在不影响生产系统安全性的前提下共享
应用程序的绝大部分内容。虽然在闭源环境中这可能不是一个紧要的问题,
但是一旦某个私密信息被提交到版本控制系统,就会被录入版本历史,除
非强制重写该历史记录,擦除该私密信息。即使这样,我们也无法保证在
从历史记录中删除这些私密信息之前,它们没有被恶意操作者获取 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

数据驱动力:企业数据分析实战

数据驱动力:企业数据分析实战

Carl Anderson
基于Python的智能文本分析

基于Python的智能文本分析

Benjamin Bengfort, Rebecca Bilbro, Tony Ojeda
Lua游戏AI开发指南

Lua游戏AI开发指南

Posts & Telecom Press, David Young

Publisher Resources

ISBN: 9787121387074