2012-11-06 38 views

回答

0

的API经理犯规支持“https”开头的端点当前版本......我们必须在我们的路线图,将修复,在未来的版本中。但是您可以在APIManager和后端服务之间使用ESB来路由请求

0

从WSO2 API Manager版本1.3.0开始,已添加对调用安全后端服务的支持。请参阅下面的调用安全后端服务的示例API的突触配置。目前支持仅适用于通过基本身份验证保护的服务。

<api xmlns="http://ws.apache.org/ns/synapse" name="admin--SecuredAPI" context="/secure" version="1.0.0" version-type="url"> 
    <resource methods="POST GET OPTIONS DELETE PUT" url-mapping="/*"> 
     <inSequence> 
      <property name="Authorization" expression="fn:concat('Basic ', base64Encode('username:password'))" scope="transport"/> 
      <property name="POST_TO_URI" value="true" scope="axis2"/> 
      <filter source="$ctx:AM_KEY_TYPE" regex="PRODUCTION"> 
       <then> 
        <send> 
         <endpoint name="admin--SecuredAPI_APIEndpoint_0"> 
          <address uri="https://securebackend.com/search"> 
           <timeout> 
            <duration>30000</duration> 
            <responseAction>fault</responseAction> 
           </timeout> 
           <suspendOnFailure> 
            <errorCodes>-1</errorCodes> 
            <initialDuration>0</initialDuration> 
            <progressionFactor>1.0</progressionFactor> 
            <maximumDuration>0</maximumDuration> 
           </suspendOnFailure> 
           <markForSuspension> 
            <errorCodes>-1</errorCodes> 
           </markForSuspension> 
          </address> 
         </endpoint> 
        </send> 
       </then> 
       <else> 
        <sequence key="_sandbox_key_error_"/> 
       </else> 
      </filter> 
     </inSequence> 
     <outSequence> 
      <send/> 
     </outSequence> 
    </resource> 
    <handlers> 
     <handler class="org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler"/> 
     <handler class="org.wso2.carbon.apimgt.usage.publisher.APIMgtUsageHandler"/> 
     <handler class="org.wso2.carbon.apimgt.usage.publisher.APIMgtGoogleAnalyticsTrackingHandler"/> 
     <handler class="org.wso2.carbon.apimgt.gateway.handlers.throttling.APIThrottleHandler"> 
      <property name="id" value="A"/> 
      <property name="policyKey" value="gov:/apimgt/applicationdata/tiers.xml"/> 
     </handler> 
     <handler class="org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler"/> 
    </handlers> 
</api> 

谢谢, Nuwan。