在REST世界中,我们有类似Swagger规范的东西,它完全描述了REST接口边界(客户端和服务器之间)的合同.这些Swagger规范可用于自动生成REST客户端,也可用于为REST API使用者自动生成文档.此外,这些Swagger规范也是CI和版本化API的宝贵资产.
我想知道异步发布订阅世界中是否存在类似的解决方案:让我们说一下RabbitMQ上的典型AMQP消费者/制作人....
最好的祝福,
巴特
我在我的REST后端项目中使用以下组件:
我正在使用基于XML的bean配置,并且我能够使用Swagger启动并运行基本设置,使用Spring XML Configuration文件中的以下内容:
<mvc:annotation-driven/> <!-- Required so swagger-springmvc can access spring's RequestMappingHandlerMapping -->
<bean class="com.mangofactory.swagger.configuration.SpringSwaggerConfig" />
Run Code Online (Sandbox Code Playgroud)
然后我从https://github.com/wordnik/swagger-ui克隆了Swagger-UI GIT repo ,并将dist文件夹复制到我的/ webapp/docs文件夹中.在这样做后,我能够在以下URL上使用基于JS的UI:
http://localhost:9090/docs/index.html (works so far).
Run Code Online (Sandbox Code Playgroud)
问题是没有一个试用按钮工作,可以用来直接使用JSON与REST API交互.它不起作用的原因是它没有采用正确的基本URL路径与我的控制器通信:
http://localhost:9090/rest/addresses (actual controller location)
http://localhost:9090/addresses (swagger's attempt to talk to the API)
Run Code Online (Sandbox Code Playgroud)
经过一些网上研究后,我发现我可能更喜欢使用SwaggerSpringMvcPlugin更灵活的方法,如https://github.com/martypitt/swagger-springmvc所述.
这是我的招摇配置类文件:
@Configuration
@EnableSwagger
public class MySwaggerConfig {
private SpringSwaggerConfig springSwaggerConfig;
@Autowired
public void setSpringSwaggerConfig(SpringSwaggerConfig springSwaggerConfig) {
this.springSwaggerConfig = springSwaggerConfig;
}
@Bean …Run Code Online (Sandbox Code Playgroud) 我正在创建有关缓冲区溢出和堆栈/堆攻击的培训。我正在 Ubuntu 12.04 x86_64机器上工作,想要展示一些有错误的程序示例以及利用这些漏洞的方法。
我试图从迄今为止找到的最基本的 shellcode 开始,即简单的 exit 调用,它应该退出溢出的程序。
因此exitcall.asm:
;exitcall.asm
[SECTION .text]
global _start
_start:
xor ebx,ebx ; zero out ebx, same function as mov ebx,0
mov al, 1 ; exit command to kernel
int 0x80
Run Code Online (Sandbox Code Playgroud)
我从其他教程中得到了这个 asm 文件,但它是为i386架构编写的。接下来要做的是生成一个目标文件并将其设为二进制可执行文件:
# nasm -f elf64 exitcall.asm
# ld -o exitcall exitcall.o
# file exitcall
exitcall: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped
# strace ./exitcall
execve("./exitcall", ["./exitcall"], [/* 73 vars */]) …Run Code Online (Sandbox Code Playgroud) rest ×2
amqp ×1
elf ×1
linux ×1
nasm ×1
rabbitmq ×1
shellcode ×1
spring-mvc ×1
swagger ×1
swagger-2.0 ×1
swagger-ui ×1
x86-64 ×1