2012-11-06 75 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。