Skip to content

Commit

Permalink
Merge pull request #13531 from dakshina99/lightweight_apikey
Browse files Browse the repository at this point in the history
Add Integration Test for Lightweight API Key and Fix WebSocket API Invocation Test Issues
  • Loading branch information
RakhithaRR authored Sep 27, 2024
2 parents 6dd2f16 + 12df6f5 commit 43d6da9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 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
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 @@ -356,6 +356,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 @@ -370,8 +371,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 43d6da9

Please sign in to comment.