Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/wso2/product-apim into ai…
Browse files Browse the repository at this point in the history
…_api_gateway
  • Loading branch information
AnuGayan committed Sep 27, 2024
2 parents a211a0c + cf02393 commit 046c4dd
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 6 deletions.
2 changes: 1 addition & 1 deletion modules/distribution/product/src/main/conf/deployment.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ enable = true
token = ""

[apim.key_manager]
enable_apikey_subscription_validation = true
enable_lightweight_apikey_generation = true
#service_url = "https://localhost:${mgt.transport.https.port}/services/"
#username = "$ref{super_admin.username}"
#password = "$ref{super_admin.password}"
Expand Down
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>
27 changes: 24 additions & 3 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,29 @@ $in_sequences.get("$resource.getUriTemplate()").get($uri)
#else
#set( $filterRegex = "PRODUCTION" )
#end
#if( $endpoint_config.get("endpoint_type") == 'sequence_backend' )
#if( $endpoint_config.get("sandbox"))
#set( $sequenceKey = $endpoint_config.get("sandbox") )
<filter source="$ctx:AM_KEY_TYPE" regex="SANDBOX">
<then>
<sequence key="$sequenceKey"/>
<loopback/>
</then>
<else/>
</filter>
#end
#if( $endpoint_config.get("production"))
#set( $sequenceKey = $endpoint_config.get("production") )
<filter source="$ctx:AM_KEY_TYPE" regex="PRODUCTION">
<then>
<sequence key="$sequenceKey"/>
<loopback/>
</then>
<else/>
</filter>
#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 Expand Up @@ -344,6 +364,7 @@ $out_sequences.get("$resource.getUriTemplate()").get($uri)
#if( $responseCacheEnabled )
<cache scope="per-host" collector="true"/>
#end
#if( $endpoint_config.get("endpoint_type") != 'sequence_backend' )
<filter source="$ctx:AM_KEY_TYPE" regex="$filterRegex">
<then>
#if($endpointSecurityProd.clientId && ($endpointSecurityProd.type == "oauth" || $endpointSecurityProd.type == "OAUTH"))
Expand All @@ -356,7 +377,7 @@ $out_sequences.get("$resource.getUriTemplate()").get($uri)
#end
</else>
</filter>

#end
<send/>
</outSequence>
</resource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -807,9 +807,11 @@ private void invokeAPI(WebSocketClient client, String accessToken, AUTH_IN in, H
} else if (AUTH_IN.OAUTH_QUERY == in) {
echoUri = new URI(apiEndPoint + "?access_token=" + accessToken);
} else if (AUTH_IN.APIKEY_HEADER == in) {
Thread.sleep(24000);
request.setHeader("apikey", accessToken);
echoUri = new URI(apiEndPoint);
} else if (AUTH_IN.APIKEY_QUERY == in) {
Thread.sleep(24000);
echoUri = new URI(apiEndPoint + "?apikey=" + accessToken);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ password = "wso2carbon"
alias = "wso2carbon"
key_password = "wso2carbon"

[apim.key_manager]
enable_lightweight_apikey_generation = false

[[apim.gateway.environment]]
name = "Default"
type = "hybrid"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@
<parameter name="group" value="group4"/>
<classes>
<class name="org.wso2.am.integration.tests.other.AdvancedConfigDeploymentConfig"/>
<class name="org.wso2.am.integration.tests.api.lifecycle.APISecurityTestCase" />
<class name="org.wso2.am.integration.tests.other.NotificationTestCase"/>
<class name="org.wso2.am.integration.tests.json.ESBJAVA3380TestCase"/>
<!--THis test will be enabled once the stats event streams are finalized -->
Expand All @@ -371,8 +372,6 @@
</classes>
</test>



<test name="apim-integration-tests-application-sharing" preserve-order="true" parallel="false" group-by-instances="true">
<parameter name="group" value="group1"/>
<classes>
Expand Down

0 comments on commit 046c4dd

Please sign in to comment.