node.js - 在用于系统测试的开源项目中保护 travis ci 环境变量

标签 node.js testing continuous-integration travis-ci system-testing

我正在构建一个为第三方服务提供 API 的开源库。在此期间,我正在学习测试、git-flow 和持续部署,并遇到了一个与保护开源项目的环境变量相关的问题。

我目前已经通过 travis cli 生成了 secret 环境变量:
travis encrypt key=value,用于自动化系统测试。

在将更新推送到功能分支或拉取请求时,注意到测试由 travis ci 自动运行,这非常棒。但我开始想知道是什么保护我免受恶意收集 process.env 对象并将其推送到外部对象的拉取请求,从而泄露我宝贵的环境变量。

如何真正确保环境凭据(例如 API 凭据)在 travis ci 中受到保护以进行系统测试?

我应该创建系统测试吗?还是应该伪造对外部服务的请求?

最佳答案

Travis CI 文档说:

For the protection of secure data, Travis CI makes it available only on pull requests coming from the same repository. These are considered trustworthy, as only members with write access to the repository can send them.

Pull requests sent from forked repositories don’t have this data available in their builds. All data that’s considered confidential will not be added to the build’s environment.

https://docs.travis-ci.com/user/pull-requests#Security-Restrictions-when-testing-Pull-Requests

关于node.js - 在用于系统测试的开源项目中保护 travis ci 环境变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37731595/

相关文章:

testing - 使用 HP UFT 的移动自动化

java - 用于测试的最小 postgres 实例

php - mock 不从存储库(接口(interface))调用方法

continuous-integration - 自托管代理未显示在代理池下拉列表下

java - 从 Jenkins 构建作业将 Jar 部署到远程服务器

node.js - 如何通过 NodeJS 中的 SOCKS5 代理发送 UDP 数据包?

javascript - Node.js 在回调中调用回调函数

node.js - 什么 TypeScript 配置产生最接近 Node.js 14 功能的输出?

javascript - 如何检索 xpath 的内部文本?

亚搏体育应用程序 CI/CD : Run jobs only when files in a specific directory have changed