Skip to content

Commit

Permalink
Add: Key type support for Custom Backend invocation
Browse files Browse the repository at this point in the history
  • Loading branch information
BLasan committed Sep 12, 2024
1 parent b3a7405 commit 1201bc5
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions modules/distribution/resources/api_templates/velocity_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,22 @@ $in_sequences.get("$resource.getUriTemplate()").get($uri)
#if( $endpoint_config.get("sandbox"))
#set( $sandboxConf = $endpoint_config.get("sandbox") )
#set( $sequenceKey = $sandboxConf.get("sequence_name"))
<sequence key="$sequenceKey"/>
<filter source="$ctx:AM_KEY_TYPE" regex="SANDBOX">
<then>
<sequence key="$sequenceKey"/>
</then>
<else/>
</filter>
#end
#if( $endpoint_config.get("production"))
#set( $sandboxConf = $endpoint_config.get("production") )
#set( $sequenceKey = $sandboxConf.get("sequence_name"))
<sequence key="$sequenceKey"/>
<filter source="$ctx:AM_KEY_TYPE" regex="PRODUCTION">
<then>
<sequence key="$sequenceKey"/>
</then>
<else/>
</filter>
#end
## AWS Lambda: start
#elseif( $endpoint_config.get("endpoint_type") == 'awslambda' )
Expand Down Expand Up @@ -345,7 +355,7 @@ $in_sequences.get("$resource.getUriTemplate()").get($uri)
#end
</inSequence>
<outSequence>
#if( $isSoapToRestMode && $endpoint_config.get("endpoint_type") == 'custom_backend' )
#if( $isSoapToRestMode )
#foreach( $uri in $out_sequences.get("$resource.getUriTemplate()").keySet() )
$out_sequences.get("$resource.getUriTemplate()").get($uri)
#end
Expand All @@ -354,7 +364,7 @@ $out_sequences.get("$resource.getUriTemplate()").get($uri)
#if( $responseCacheEnabled )
<cache scope="per-host" collector="true"/>
#end
if( $endpoint_config.get("endpoint_type") == 'custom_backend' )
if( $endpoint_config.get("endpoint_type") != 'custom_backend' )
<filter source="$ctx:AM_KEY_TYPE" regex="$filterRegex">
<then>
#if($endpointSecurityProd.clientId && ($endpointSecurityProd.type == "oauth" || $endpointSecurityProd.type == "OAUTH"))
Expand Down

0 comments on commit 1201bc5

Please sign in to comment.