集中凭证
我正在寻找设置测试和暂存环境。我们有许多取决于环境的配置参数,即在测试环境中,它应该向 [email ;protected] 在生产过程中,它应该发送电子邮件至 [电子邮件受保护]。此外,我们还使用许多第三方服务(即 Salesforce、PayPal),它们提供单独的凭据/URL 来访问测试环境。
我正在考虑创建一个安全的 Web 服务,该服务将根据请求 IP 地址返回给定密钥的值。即,如果请求来自测试服务器计算机,那么它将返回 [email protected]而如果相同的代码在生产中运行,它将返回 [email protected]
基本上,我想保留我的代码和配置部署更易于管理。
您能评论一下并提出建议吗?
I am looking to setup testing & staging environments. We have many config parameters that depends on environment i.e on test environment it should send out email to [email protected] while on production it should send email to [email protected]. Also, we are using many third-party services (i.e Salesforce, PayPal) that provides separate credentials/URL to access test environments.
I am thinking of creating a secured web service that will return value for a given key based on request IP address. i.e if request is from testing server machine then it will return [email protected] while if same code is running in production it will return [email protected]
Basically, I want to keep my code & config deployment easier to manage.
Can you please review and suggest?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您考虑为每个环境配置的属性列表很小,那么您可以从构建环境中可靠地实现这一点,在该环境中构建可以从属性文件中获取所需的详细信息。然而,风险在于在开发环境中运行生产凭证,因此您需要小心。
IF the list of properties that you are considering to configure for each environment is small, then you can achieve that reliably from a build environment, where the build can pick up from properties file the required details. However the risk is running production credentials on a development environment, for that you need to be careful.
我认为您所描述的机制称为(企业)单点登录。也许已经有合适的解决方案可用?
如果没有合适的解决方案可用,我宁愿使用不同的哈希值来识别测试/生产服务器而不是 IP 地址,因为后者可以很容易地更改
I think the mechanism you're describing is known as (enterprise) single sign-on. Maybe there is a fitting solution already available?
If there isn't a fitting solution already available, I'd rather use different hashes to identify test/production server instead of IP address, because the latter can change quite easily