WSO2 AM 1.10.0 验证查询参数

WSO2 AM 1.10.0 validate query parameters

为了防止日志注入,我需要在 WSO2 AM 中验证查询参数(国家、农药和作物)。 API 如下所示,

http://172.17.100.149/api/mrldatabase/v1/reports?country=AUS&pesticide=ABew30000&crop=22020347

如果有人能告诉我一种验证方法,我将不胜感激。

您可以为此编写自定义调解序列。 See docs

您可以像这样阅读查询参数。 See this了解更多详情。

<sequence xmlns="http://ws.apache.org/ns/synapse" name="admin--Temp:v1.0.0--In">  
      <log level="custom">  
          <property name="SubPath" expression="$ctx:REST_SUB_REQUEST_PATH"/>  
      </log>  
 </sequence>