准备好API可以保留我的OAuth2代币吗?
我和我的团队开始使用SmartBear的ReadyApi工具来对我们正在开发的REST Web服务进行一些自动测试。我在ReadyApi中创建了一个新项目,并导入API的OpenAPI定义(通过Swagger)。该项目被保存为“复合项目” - 即它作为项目文件夹中的许多文件保存,而不是一个单片XML定义。该文件夹最终将添加到源控制(GIT)中。
Web服务使用OAuth2.0身份验证,我对Readyapi允许您创建令牌并将其与API中的每个请求相关联的方式感到满意。但是,ReadyApi似乎将令牌写入到settings.xml
该项目的文件,该文件是一个将承诺用于源控制的文件。将令牌值提交来源控制是不合适的。有没有办法告诉ReadyApi在特定于用户的空间中保存该令牌,类似于它处理特定于用户的项目属性的方式?
我认为我不能只能gitignore
整个设置。xml文件,因为它包含了我想保存在源控件中的其他特定于项目的设置。
以下是差异的一部分,显示了在我成功检索令牌后写入的settings.xml
文件的更改:
My team and I are starting to use SmartBear's ReadyAPI tool to do some automated testing of a REST web services we are developing. I have created a new Project within ReadyAPI and imported the API's openapi definition (via Swagger). The project is saved as a "composite project" - i.e. it is saved as many files within a project folder, instead of as one monolithic XML definition. This folder will eventually be added to source control (git).
The web service uses OAuth2.0 authentication, and I'm happy with how ReadyAPI allows you to create a token and associated it with each request in the API. However it seems that ReadyAPI writes the token out to the settings.xml
file for the project, which is a file that would be committed to source control. It is inappropriate to commit a token value to source control. Is there a way to tell ReadyAPI to save that token off in a user-specific space, similar to how it handles user-specific project properties?
I don't think I can just gitignore
the entire settings.xml file, since it contains other project-specific settings that I do want to save in source control.
Below is a portion of a diff showing the change to the settings.xml
file that is written after I successfully retrieve a token:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在
在这种情况下,我们可以做的是加密项目本身。这还将加密项目.xml文件中的所有值。
Check out our documentation on Protecting Sensitive Data.
What we can do in this case is encrypt the project itself. This will also encrypt all the values in your project's .xml file.