API网关发送的请求Header
<p>开启API网关的签名密钥功能后,调用绑定签名密钥的API时,API网关到后端服务的请求头中会添加签名密钥的Key及API网关计算的签名结果的相关信息,后端服务在收到请求后,需要按照API网关的签名计算方法进行同样的签名计算,并将计算的结果与API网关的签名结果进行比对,从而校验API网关的合法性。本文主要介绍API网关转发API请求到后端服务时,API网关如何计算签名数据。</p>
<p><span style="font-size:18px"><strong>API网关发送的请求Header</strong></span></p>
<table border="1" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td style="background-color:#ededed; vertical-align:top">
<p><strong>参数</strong></p>
</td>
<td style="background-color:#ededed; vertical-align:top; width:62px">
<p><strong>是否必选</strong></p>
</td>
<td style="background-color:#ededed; vertical-align:top; width:65px">
<p><strong>类型</strong></p>
</td>
<td style="background-color:#ededed; vertical-align:top; width:483px">
<p><strong>说明</strong></p>
</td>
</tr>
<tr>
<td style="vertical-align:top">
<p>PA-AG-Gateway-Signature</p>
</td>
<td style="vertical-align:top; width:62px">
<p>是</p>
</td>
<td style="vertical-align:top; width:65px">
<p>string</p>
</td>
<td style="vertical-align:top; width:483px">
<p>API网关计算的签名字符串。</p>
</td>
</tr>
<tr>
<td style="vertical-align:top">
<p>PA-AG-Gateway-Sign-Key</p>
</td>
<td style="vertical-align:top; width:62px">
<p>是</p>
</td>
<td style="vertical-align:top; width:65px">
<p>string</p>
</td>
<td style="vertical-align:top; width:483px">
<p>API网关在计算签名时使用的Key,即您在<a href="https://pinganyun.com/console/apiGateway" target="_blank">API网关管理控制台</a>绑定的签名密钥的Key。</p>
</td>
</tr>
<tr>
<td style="vertical-align:top">
<p>PA-AG-Gateway-Timestamp</p>
</td>
<td style="vertical-align:top; width:62px">
<p>是</p>
</td>
<td style="vertical-align:top; width:65px">
<p>string</p>
</td>
<td style="vertical-align:top; width:483px">
<p>API网关接受并处理API请求的时间戳,取值为当前时间的毫秒数,即从1970年1月1日到当前时间的毫秒数。</p>
</td>
</tr>
<tr>
<td style="vertical-align:top">
<p>PA-AG-Gateway-Signature-Headers</p>
</td>
<td style="vertical-align:top; width:62px">
<p>否</p>
</td>
<td style="vertical-align:top; width:65px">
<p>string</p>
</td>
<td style="vertical-align:top; width:483px">
<p>参与校验的服务方配置的其他请求头,格式为: header1,header2...headerN</p>
<p><!--[if gte mso 9]><xml>
<o:OLEObject Type="Embed" ProgID="PBrush" ShapeID="_x0000_i1025"
DrawAspect="Content" ObjectID="_1633963788">
</o:OLEObject>
</xml><![endif]--><img src="https://pcp-portal-sca.obs-cn-shenzhen.pinganyun.com/pcp-portal-sca/20193010172857-1adc39c19380.png" style="height:26px; margin:0px; width:65px" />:多个header之间以英文逗号,为分隔符,同时忽略英文逗号两侧的空格。</p>
</td>
</tr>
</tbody>
</table>
提交成功!非常感谢您的反馈,我们会继续努力做到更好!