简体   繁体   English

WSO2 APIM:如何实现“设计优先”模式? (开发人员无法测试)

[英]WSO2 APIM: How to implement “Design first” pattern? (Developers cannot test)

We are using WSO2 API 2.1.0 to deploy our business APIs. 我们正在使用WSO2 API 2.1.0部署我们的业务API。

Until now, we can follow, without problems, the pattern "Code first" for existing APIs. 到目前为止,我们可以毫无问题地遵循现有API的“代码优先”模式。 For example, we have an existing API REST in C#/NetFramework. 例如,我们在C#/ NetFramework中已有一个API REST。 In this case: - Developer install a plugin, generate the Swagger file, and import ("Have an existing API") in API Publisher. 在这种情况下:-开发人员安装插件,生成Swagger文件,然后在API Publisher中导入(“具有现有API”)。 - Administrator deploy this new API, configuring the right backends (remember, the API already exists) -管理员部署此新API,并配置正确的后端(请记住,该API已经存在)

But now, we are going to deploy new APIs, and we want to follow "Design first" pattern. 但是现在,我们将部署新的API,并且我们希望遵循“设计优先”的模式。 I mean, we want to describe the APIs using "Design a new Rest API" in publisher. 我的意思是,我们要在发布者中使用“设计新的Rest API”来描述API。

Our problem is that, in this case, the developer can generate code skeletons, but cannot test them, because they have the role "creator" only, and then, cannot deploy "prototype" or "test code" in any way (either in local PCs). 我们的问题是,在这种情况下,开发人员可以生成代码框架,但无法对其进行测试,因为它们仅具有“创建者”角色,然后无法以任何方式部署“原型”或“测试代码”(本地PC)。 Obviously, as API is in development stage, we cannot ask Publisher to publish it. 显然,由于API处于开发阶段,因此我们无法要求Publisher进行发布。

We cannot add publisher role for the developers, because, then, they can deploy directly in production environments. 我们无法为开发人员添加发布者角色,因为他们可以直接在生产环境中进行部署。

NOTE: Initially we thought we have a security flaw, and we have confirmed with WSO2 staff that this is the intended behaviour for security. 注意:最初我们认为我们存在安全漏洞,并且我们已经与WSO2员工确认这是安全的预期行为。 Developers cannot deploy event in prototype! 开发人员无法在原型中部署事件!

Suggestions? 有什么建议吗?

The testing right after just creating or testing for the creator functionality is not there. 仅在创建或测试创建者功能后才进行测试。 Because in terms of WSO2 creator is always just creator so no rights for testing it out. 因为就WSO2而言,创建者始终只是创建者,所以没有测试它的权利。 Also, in current wso2 process of publishing the APIs there is no way of testing it before you publish. 另外,在当前的发布API的wso2过程中,无法在发布之前对其进行测试。

The best thing you can do is to create another WSO2 instance on which developers can test out the APIs through WSO2. 最好的办法是创建另一个WSO2实例,开发人员可以在该实例上通过WSO2测试API。 (That's what we do currently). (这就是我们目前所做的)。 I hope this helps you. 我希望这可以帮助你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM