From 3e7c0cdcfebad4b0e7ba6592058f5fc39c7ace5b Mon Sep 17 00:00:00 2001 From: sgayangi Date: Mon, 8 Apr 2024 18:22:19 +0530 Subject: [PATCH] Update config deployer test cases --- runtime/config-deployer-service/ballerina/APIClient.bal | 2 +- .../ballerina/tests/resources/apiKeyOnly.apk-conf | 1 + .../ballerina/tests/resources/jwtandAPIKey.apk-conf | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime/config-deployer-service/ballerina/APIClient.bal b/runtime/config-deployer-service/ballerina/APIClient.bal index a11f5ca900..b5ea081e25 100644 --- a/runtime/config-deployer-service/ballerina/APIClient.bal +++ b/runtime/config-deployer-service/ballerina/APIClient.bal @@ -361,7 +361,7 @@ public class APIClient { } else if authentication.authType == "JWT" { JWTAuthentication jwtAuthentication = check authentication.cloneWithType(JWTAuthentication); authTypes.jwt = {header: jwtAuthentication.headerName, sendTokenToUpstream: jwtAuthentication.sendTokenToUpstream, disabled: !jwtAuthentication.enabled, audience: jwtAuthentication.audience}; - } else if authentication.authType == "APIKey" && authentication is APIKeyAuthentication { + } else if authentication.authType == "APIKey" { APIKeyAuthentication apiKeyAuthentication = check authentication.cloneWithType(APIKeyAuthentication); model:APIKey[] apiKeys = []; boolean|() headerEnabled = apiKeyAuthentication.headerEnable; diff --git a/runtime/config-deployer-service/ballerina/tests/resources/apiKeyOnly.apk-conf b/runtime/config-deployer-service/ballerina/tests/resources/apiKeyOnly.apk-conf index 52ef282892..b1f0824119 100644 --- a/runtime/config-deployer-service/ballerina/tests/resources/apiKeyOnly.apk-conf +++ b/runtime/config-deployer-service/ballerina/tests/resources/apiKeyOnly.apk-conf @@ -18,6 +18,7 @@ authentication: - authType: "APIKey" enabled: true queryParamEnable: true + headerEnable: true corsConfiguration: corsConfigurationEnabled: false accessControlAllowOrigins: diff --git a/runtime/config-deployer-service/ballerina/tests/resources/jwtandAPIKey.apk-conf b/runtime/config-deployer-service/ballerina/tests/resources/jwtandAPIKey.apk-conf index 62d5518b9a..88b21c4aa3 100644 --- a/runtime/config-deployer-service/ballerina/tests/resources/jwtandAPIKey.apk-conf +++ b/runtime/config-deployer-service/ballerina/tests/resources/jwtandAPIKey.apk-conf @@ -20,6 +20,7 @@ authentication: - authType: "APIKey" enabled: true queryParamEnable: true + headerEnable: true corsConfiguration: corsConfigurationEnabled: false accessControlAllowOrigins: