如何解决Swagger 2.0 YAML中的AWS授权
我正在使用Swagger UI查询企业S3实例,需要使用AccessKey和SecretKey中的AWS签名。在Postman中,这将产生以下格式的授权标头:
“授权:AWS4-HMAC-SHA256 凭据= <... accesskey ...> // us-east-1 / execute-api / aws4_request,SignedHeaders = host; x-amz-date,Signature = <......>“
如果我正在使用Swagger YAML(如下所示),该如何完成以下两项操作?
- 定义“安全性”和“ securityDefinitions”以允许用户通过和进行身份验证
或
- 生成签名并使用带有内置凭据的Authorization标头进行身份验证
**我会注意到,该YAML正在进行中,是从Postman集合中生成/转换的,因此这就是为什么不充实响应类型的原因
swagger: '2.0'
info:
version: '1.0'
title: POC
contact:
name:
email:
host: <s3 endpoint>
basePath: /<bucket>
schemes:
- https
consumes:
- application/json
produces:
- application/json
securityDefinitions:
????
paths:
/{resource}:
put:
summary: PUT in Bucket
tags:
- Misc
operationId: PUTinBucket
deprecated: false
produces:
- application/json
consumes:
- multipart/form-data
parameters:
- name: File
in: formData
required: true
type: file
format: file
description: ''
- name: resource
type: string
required: true
in: path
description: Identifier/Name of the resource to upload
responses:
200:
description: ''
headers: {}
get:
summary: GET Object from Bucket
tags:
- Misc
operationId: GETObjectfromBucket
deprecated: false
produces:
- application/json
parameters:
- name: resource
type: string
required: true
in: path
description: Identifier/Name of the resource to download
responses:
200:
description: ''
headers: {}
delete:
summary: DELETE Object from Bucket
tags:
- Misc
operationId: DELETEObjectfromBucket
deprecated: false
produces:
- application/json
parameters:
- name: resource
type: string
required: true
in: path
description: Identifier/Name of the resource to delete
responses:
200:
description: ''
headers: {}
tags:
- name: Misc
description: ''
security:
- ???: []
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。