Skip to content

Commit

Permalink
Add: Support for Custom Backend with different key types
Browse files Browse the repository at this point in the history
  • Loading branch information
BLasan committed Sep 11, 2024
1 parent 0641b54 commit c28d757
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<sequence xmlns=\"http://ws.apache.org/ns/synapse\" name=\"{{sequence_name}}\">
{% if custom_sequence is defined %}
{{ custom_sequence }}
{% endif %}
</sequence>
14 changes: 12 additions & 2 deletions modules/distribution/resources/api_templates/velocity_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@

faultSequence=#print_string_if_exist($faultSequence "fault")>
<inSequence>

## check and set response caching
#if( $responseCacheEnabled )
<cache scope="per-host" collector="false" hashGenerator="org.wso2.carbon.mediator.cache.digest.HttpRequestHashGenerator" timeout="$!responseCacheTimeOut">
Expand Down Expand Up @@ -245,8 +244,19 @@ $in_sequences.get("$resource.getUriTemplate()").get($uri)
#else
#set( $filterRegex = "PRODUCTION" )
#end
#if( $endpoint_config.get("endpoint_type") == 'custom_backend' )
#if( $endpoint_config.get("sandbox"))
#set( $sandboxConf = $endpoint_config.get("sandbox") )
#set( $sequenceKey = $sandboxConf.get("sequence_name"))
<sequence key="$sequenceKey"/>
#end
#if( $endpoint_config.get("production"))
#set( $sandboxConf = $endpoint_config.get("production") )
#set( $sequenceKey = $sandboxConf.get("sequence_name"))
<sequence key="$sequenceKey"/>
#end
## AWS Lambda: start
#if( $endpoint_config.get("endpoint_type") == 'awslambda' )
#elseif( $endpoint_config.get("endpoint_type") == 'awslambda' )
#set( $accessKey = $!{endpoint_config.get("amznAccessKey")} )
#set( $secretKey = $!{endpoint_config.get("amznSecretKey")} )
#set( $region = $!{endpoint_config.get("amznRegion")} )
Expand Down

0 comments on commit c28d757

Please sign in to comment.