From 649879f998dc7e2210cc615fab1442cf903e2328 Mon Sep 17 00:00:00 2001 From: GPrathap Date: Sun, 1 Jan 2017 21:13:53 +0530 Subject: [PATCH 1/3] removed setting APIs secured as default. Because if secured is enabled, it is to be needed to provided parameters which are related to basic oauth, when this is false, jwt token is being used. --- .../webapp/publisher/APIPublisherUtil.java | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherUtil.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherUtil.java index 6d1bc7695b..630aa32d13 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherUtil.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherUtil.java @@ -50,7 +50,7 @@ public class APIPublisherUtil { private static final String PARAM_PROVIDER_TENANT_DOMAIN = "providerTenantDomain"; - public static API getAPI(APIConfig config) throws APIManagementException { + public static API PARAM_MANAGED_API_IS_SECURED(APIConfig config) throws APIManagementException { APIProvider provider = config.getProvider(); String apiVersion = config.getVersion(); @@ -75,7 +75,7 @@ public class APIPublisherUtil { api.setUrl(config.getEndpoint()); api.addAvailableTiers(provider.getTiers()); - api.setEndpointSecured(true); + api.setEndpointSecured(false); api.setStatus(APIStatus.CREATED); api.setTransports(config.getTransports()); api.setApiLevelPolicy(config.getPolicy()); @@ -261,18 +261,7 @@ public class APIPublisherUtil { } apiConfig.setOwner(owner); - String isSecuredParam = servletContext.getInitParameter(PARAM_MANAGED_API_IS_SECURED); - boolean isSecured; - if (isSecuredParam == null || isSecuredParam.isEmpty()) { - if (log.isDebugEnabled()) { - log.debug("'managed-api-isSecured' attribute is not configured. Therefore, using the default, " + - "which is 'true'"); - } - isSecured = false; - } else { - isSecured = Boolean.parseBoolean(isSecuredParam); - } - apiConfig.setSecured(isSecured); + apiConfig.setSecured(false); String transports = servletContext.getInitParameter(PARAM_MANAGED_API_TRANSPORTS); if (transports == null || transports.isEmpty()) { From 4c9578ebe24b5930c2b8c1cbdb4ba4fa031deecb Mon Sep 17 00:00:00 2001 From: GPrathap Date: Sun, 1 Jan 2017 21:53:53 +0530 Subject: [PATCH 2/3] resized buffer size to 0 for each scope --- .../device/mgt/core/config/permission/AnnotationProcessor.java | 1 + 1 file changed, 1 insertion(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/permission/AnnotationProcessor.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/permission/AnnotationProcessor.java index ee2ebb4c2e..b20936c8f3 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/permission/AnnotationProcessor.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/permission/AnnotationProcessor.java @@ -403,6 +403,7 @@ public class AnnotationProcessor { .getMethod(SWAGGER_ANNOTATIONS_PROPERTIES_KEY), annotatedScopes[i], STRING)); permissions = (String[])methodHandler.invoke(annotatedScopes[i], scopeClass .getMethod(SWAGGER_ANNOTATIONS_PROPERTIES_PERMISSIONS, null),null); + aggregatedPermissions.setLength(0); for (String permission : permissions) { aggregatedPermissions.append(permission); aggregatedPermissions.append(" "); From f508bcfd0e7e11d3b401f899b9eb2270d8f25827 Mon Sep 17 00:00:00 2001 From: GPrathap Date: Sun, 1 Jan 2017 22:03:50 +0530 Subject: [PATCH 3/3] corrected method name --- .../wso2/carbon/apimgt/webapp/publisher/APIPublisherUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherUtil.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherUtil.java index 630aa32d13..ce194ebb3c 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherUtil.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherUtil.java @@ -50,7 +50,7 @@ public class APIPublisherUtil { private static final String PARAM_PROVIDER_TENANT_DOMAIN = "providerTenantDomain"; - public static API PARAM_MANAGED_API_IS_SECURED(APIConfig config) throws APIManagementException { + public static API getAPI(APIConfig config) throws APIManagementException { APIProvider provider = config.getProvider(); String apiVersion = config.getVersion();